All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net: fsl-mc: fixup DPC: add /board/ports node if missing
@ 2020-04-28 13:09 Razvan Ionut Cirjan
  2020-04-30 12:46 ` Ioana Ciornei
  2020-05-20 10:58 ` Priyanka Jain
  0 siblings, 2 replies; 3+ messages in thread
From: Razvan Ionut Cirjan @ 2020-04-28 13:09 UTC (permalink / raw)
  To: u-boot

The DPC fixup for MAC address and enet_if is not made if
/board/ports node is missing in DPC file.
Add /board/ports or /ports nodes if them are missing.

Signed-off-by: Razvan Ionut Cirjan <razvanionut.cirjan@nxp.com>
---
 drivers/net/fsl-mc/mc.c | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/drivers/net/fsl-mc/mc.c b/drivers/net/fsl-mc/mc.c
index 07bbcc9b2311..a9bccdd1b04e 100644
--- a/drivers/net/fsl-mc/mc.c
+++ b/drivers/net/fsl-mc/mc.c
@@ -1,7 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
  * Copyright 2014 Freescale Semiconductor, Inc.
- * Copyright 2017-2018 NXP
+ * Copyright 2017-2018, 2020 NXP
  */
 #include <common.h>
 #include <command.h>
@@ -439,8 +439,19 @@ static int mc_fixup_dpc(u64 dpc_addr)
 
 	/* fixup MAC addresses for dpmac ports */
 	nodeoffset = fdt_path_offset(blob, "/board_info/ports");
-	if (nodeoffset < 0)
-		goto out;
+	if (nodeoffset < 0) {
+		err = fdt_increase_size(blob, 512);
+		if (err) {
+			printf("fdt_increase_size: err=%s\n",
+			       fdt_strerror(err));
+			goto out;
+		}
+		nodeoffset = fdt_path_offset(blob, "/board_info");
+		if (nodeoffset < 0)
+			nodeoffset = fdt_add_subnode(blob, 0, "board_info");
+
+		nodeoffset = fdt_add_subnode(blob, nodeoffset, "ports");
+	}
 
 	err = mc_fixup_mac_addrs(blob, MC_FIXUP_DPC);
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH] net: fsl-mc: fixup DPC: add /board/ports node if missing
  2020-04-28 13:09 [PATCH] net: fsl-mc: fixup DPC: add /board/ports node if missing Razvan Ionut Cirjan
@ 2020-04-30 12:46 ` Ioana Ciornei
  2020-05-20 10:58 ` Priyanka Jain
  1 sibling, 0 replies; 3+ messages in thread
From: Ioana Ciornei @ 2020-04-30 12:46 UTC (permalink / raw)
  To: u-boot

> Subject: [PATCH] net: fsl-mc: fixup DPC: add /board/ports node if missing
> 
> The DPC fixup for MAC address and enet_if is not made if /board/ports node is
> missing in DPC file.
> Add /board/ports or /ports nodes if them are missing.
> 
> Signed-off-by: Razvan Ionut Cirjan <razvanionut.cirjan@nxp.com>

Reviewed-by: Ioana Ciornei <Ioana.ciornei@nxp.com>

> ---
>  drivers/net/fsl-mc/mc.c | 17 ++++++++++++++---
>  1 file changed, 14 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/fsl-mc/mc.c b/drivers/net/fsl-mc/mc.c index
> 07bbcc9b2311..a9bccdd1b04e 100644
> --- a/drivers/net/fsl-mc/mc.c
> +++ b/drivers/net/fsl-mc/mc.c
> @@ -1,7 +1,7 @@
>  // SPDX-License-Identifier: GPL-2.0+
>  /*
>   * Copyright 2014 Freescale Semiconductor, Inc.
> - * Copyright 2017-2018 NXP
> + * Copyright 2017-2018, 2020 NXP
>   */
>  #include <common.h>
>  #include <command.h>
> @@ -439,8 +439,19 @@ static int mc_fixup_dpc(u64 dpc_addr)
> 
>  	/* fixup MAC addresses for dpmac ports */
>  	nodeoffset = fdt_path_offset(blob, "/board_info/ports");
> -	if (nodeoffset < 0)
> -		goto out;
> +	if (nodeoffset < 0) {
> +		err = fdt_increase_size(blob, 512);
> +		if (err) {
> +			printf("fdt_increase_size: err=%s\n",
> +			       fdt_strerror(err));
> +			goto out;
> +		}
> +		nodeoffset = fdt_path_offset(blob, "/board_info");
> +		if (nodeoffset < 0)
> +			nodeoffset = fdt_add_subnode(blob, 0, "board_info");
> +
> +		nodeoffset = fdt_add_subnode(blob, nodeoffset, "ports");
> +	}
> 
>  	err = mc_fixup_mac_addrs(blob, MC_FIXUP_DPC);
> 
> --
> 1.9.1

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] net: fsl-mc: fixup DPC: add /board/ports node if missing
  2020-04-28 13:09 [PATCH] net: fsl-mc: fixup DPC: add /board/ports node if missing Razvan Ionut Cirjan
  2020-04-30 12:46 ` Ioana Ciornei
@ 2020-05-20 10:58 ` Priyanka Jain
  1 sibling, 0 replies; 3+ messages in thread
From: Priyanka Jain @ 2020-05-20 10:58 UTC (permalink / raw)
  To: u-boot

>-----Original Message-----
>From: U-Boot <u-boot-bounces@lists.denx.de> On Behalf Of Razvan Ionut
>Cirjan
>Sent: Tuesday, April 28, 2020 6:40 PM
>To: Priyanka Jain <priyanka.jain@nxp.com>; joe.hershberger at ni.com; u-
>boot at lists.denx.de
>Cc: Ioana Ciornei <ioana.ciornei@nxp.com>; Florin Laurentiu Chiculita
><florinlaurentiu.chiculita@nxp.com>; Cristi Sovaiala
><cristian.sovaiala@nxp.com>; Razvan Ionut Cirjan
><razvanionut.cirjan@nxp.com>
>Subject: [PATCH] net: fsl-mc: fixup DPC: add /board/ports node if missing
>
>The DPC fixup for MAC address and enet_if is not made if /board/ports node
>is missing in DPC file.
>Add /board/ports or /ports nodes if them are missing.
>
>Signed-off-by: Razvan Ionut Cirjan <razvanionut.cirjan@nxp.com>
>---
Applied to u-boot-fsl-qoriq. Awaiting upstream.

Thanks
Priyanka

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-05-20 10:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-28 13:09 [PATCH] net: fsl-mc: fixup DPC: add /board/ports node if missing Razvan Ionut Cirjan
2020-04-30 12:46 ` Ioana Ciornei
2020-05-20 10:58 ` Priyanka Jain

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.