diff mbox series

octeontx: do not require cavium BDK node to be present

Message ID 20210617233107.14169-1-tharvey@gateworks.com
State Accepted
Commit 800433814af22708ec11f8042089bcf2c8bb1fa6
Delegated to: Stefan Roese
Headers show
Series octeontx: do not require cavium BDK node to be present | expand

Commit Message

Tim Harvey June 17, 2021, 11:31 p.m. UTC
The cavium,bdk node is a non-standard dt node used by the BDK and
therefore it is removed from the dt before booting Linux. Do not
require this node to exist as it won't for standard dt's.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
---
 board/Marvell/octeontx/board-fdt.c | 20 ++++++++------------
 1 file changed, 8 insertions(+), 12 deletions(-)

Comments

Stefan Roese June 18, 2021, 6:04 a.m. UTC | #1
On 18.06.21 01:31, Tim Harvey wrote:
> The cavium,bdk node is a non-standard dt node used by the BDK and
> therefore it is removed from the dt before booting Linux. Do not
> require this node to exist as it won't for standard dt's.
> 
> Signed-off-by: Tim Harvey <tharvey@gateworks.com>

Reviewed-by: Stefan Roese <sr@denx.de>

Thanks,
Stefan

> ---
>   board/Marvell/octeontx/board-fdt.c | 20 ++++++++------------
>   1 file changed, 8 insertions(+), 12 deletions(-)
> 
> diff --git a/board/Marvell/octeontx/board-fdt.c b/board/Marvell/octeontx/board-fdt.c
> index 0b05ef11e9..1db2a4a267 100644
> --- a/board/Marvell/octeontx/board-fdt.c
> +++ b/board/Marvell/octeontx/board-fdt.c
> @@ -281,20 +281,16 @@ int ft_board_setup(void *blob, struct bd_info *bd)
>   	}
>   
>   	if (blob) {
> +		/* delete cavium,bdk node if it exists */
>   		offset = fdt_path_offset(blob, "/cavium,bdk");
> -		if (offset < 0) {
> -			printf("ERROR: FDT BDK node not found\n");
> -			return offset;
> -		}
> -
> -		/* delete node */
> -		ret = fdt_del_node(blob, offset);
> -		if (ret < 0) {
> -			printf("WARNING : could not remove bdk node\n");
> -			return ret;
> +		if (offset >= 0) {
> +			ret = fdt_del_node(blob, offset);
> +			if (ret < 0) {
> +				printf("WARNING : could not remove bdk node\n");
> +				return ret;
> +			}
> +			debug("%s deleted bdk node\n", __func__);
>   		}
> -
> -		debug("%s deleted bdk node\n", __func__);
>   	}
>   
>   	return 0;
> 


Viele Grüße,
Stefan
Stefan Roese July 9, 2021, 5:19 a.m. UTC | #2
On 18.06.21 01:31, Tim Harvey wrote:
> The cavium,bdk node is a non-standard dt node used by the BDK and
> therefore it is removed from the dt before booting Linux. Do not
> require this node to exist as it won't for standard dt's.
> 
> Signed-off-by: Tim Harvey <tharvey@gateworks.com>

Applied to u-boot-marvell/master

Thanks,
Stefan

> ---
>   board/Marvell/octeontx/board-fdt.c | 20 ++++++++------------
>   1 file changed, 8 insertions(+), 12 deletions(-)
> 
> diff --git a/board/Marvell/octeontx/board-fdt.c b/board/Marvell/octeontx/board-fdt.c
> index 0b05ef11e9..1db2a4a267 100644
> --- a/board/Marvell/octeontx/board-fdt.c
> +++ b/board/Marvell/octeontx/board-fdt.c
> @@ -281,20 +281,16 @@ int ft_board_setup(void *blob, struct bd_info *bd)
>   	}
>   
>   	if (blob) {
> +		/* delete cavium,bdk node if it exists */
>   		offset = fdt_path_offset(blob, "/cavium,bdk");
> -		if (offset < 0) {
> -			printf("ERROR: FDT BDK node not found\n");
> -			return offset;
> -		}
> -
> -		/* delete node */
> -		ret = fdt_del_node(blob, offset);
> -		if (ret < 0) {
> -			printf("WARNING : could not remove bdk node\n");
> -			return ret;
> +		if (offset >= 0) {
> +			ret = fdt_del_node(blob, offset);
> +			if (ret < 0) {
> +				printf("WARNING : could not remove bdk node\n");
> +				return ret;
> +			}
> +			debug("%s deleted bdk node\n", __func__);
>   		}
> -
> -		debug("%s deleted bdk node\n", __func__);
>   	}
>   
>   	return 0;
> 


Viele Grüße,
Stefan
diff mbox series

Patch

diff --git a/board/Marvell/octeontx/board-fdt.c b/board/Marvell/octeontx/board-fdt.c
index 0b05ef11e9..1db2a4a267 100644
--- a/board/Marvell/octeontx/board-fdt.c
+++ b/board/Marvell/octeontx/board-fdt.c
@@ -281,20 +281,16 @@  int ft_board_setup(void *blob, struct bd_info *bd)
 	}
 
 	if (blob) {
+		/* delete cavium,bdk node if it exists */
 		offset = fdt_path_offset(blob, "/cavium,bdk");
-		if (offset < 0) {
-			printf("ERROR: FDT BDK node not found\n");
-			return offset;
-		}
-
-		/* delete node */
-		ret = fdt_del_node(blob, offset);
-		if (ret < 0) {
-			printf("WARNING : could not remove bdk node\n");
-			return ret;
+		if (offset >= 0) {
+			ret = fdt_del_node(blob, offset);
+			if (ret < 0) {
+				printf("WARNING : could not remove bdk node\n");
+				return ret;
+			}
+			debug("%s deleted bdk node\n", __func__);
 		}
-
-		debug("%s deleted bdk node\n", __func__);
 	}
 
 	return 0;