aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorRazvan Ionut Cirjan <razvanionut.cirjan@nxp.com>2020-04-28 16:09:59 +0300
committerPriyanka Jain <priyanka.jain@nxp.com>2020-05-19 09:22:08 +0530
commitd5b0af047a942b21ea86476e3931df28445b1ca4 (patch)
tree99e5c0143d9fe0e898af24c2cc3591e8b65a87a9 /drivers
parent62d3a58dcef90aeb2e2aae7349ecf6d7bce8d54a (diff)
downloadu-boot-d5b0af047a942b21ea86476e3931df28445b1ca4.zip
u-boot-d5b0af047a942b21ea86476e3931df28445b1ca4.tar.gz
u-boot-d5b0af047a942b21ea86476e3931df28445b1ca4.tar.bz2
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> Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/fsl-mc/mc.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/drivers/net/fsl-mc/mc.c b/drivers/net/fsl-mc/mc.c
index 9c4ba7d..3621842 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>
@@ -478,8 +478,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);