// 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>
/* 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);