diff options
Diffstat (limited to 'board/xilinx/zynqmp/zynqmp.c')
-rw-r--r-- | board/xilinx/zynqmp/zynqmp.c | 51 |
1 files changed, 34 insertions, 17 deletions
diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c index 41e88b03f9..5e1d2116bc 100644 --- a/board/xilinx/zynqmp/zynqmp.c +++ b/board/xilinx/zynqmp/zynqmp.c @@ -20,7 +20,6 @@ #include <usb.h> #include <dwc3-uboot.h> #include <zynqmppl.h> -#include <i2c.h> #include <g_dnl.h> DECLARE_GLOBAL_DATA_PTR; @@ -409,22 +408,6 @@ int board_early_init_r(void) return 0; } -int zynq_board_read_rom_ethaddr(unsigned char *ethaddr) -{ -#if defined(CONFIG_ZYNQ_GEM_EEPROM_ADDR) && \ - defined(CONFIG_ZYNQ_GEM_I2C_MAC_OFFSET) && \ - defined(CONFIG_ZYNQ_EEPROM_BUS) - i2c_set_bus_num(CONFIG_ZYNQ_EEPROM_BUS); - - if (eeprom_read(CONFIG_ZYNQ_GEM_EEPROM_ADDR, - CONFIG_ZYNQ_GEM_I2C_MAC_OFFSET, - ethaddr, 6)) - printf("I2C EEPROM MAC address read failed\n"); -#endif - - return 0; -} - unsigned long do_go_exec(ulong (*entry)(int, char * const []), int argc, char * const argv[]) { @@ -531,6 +514,36 @@ static u32 reset_reason(void) return ret; } +static int set_fdtfile(void) +{ + char *compatible, *fdtfile; + const char *suffix = ".dtb"; + const char *vendor = "xilinx/"; + + if (env_get("fdtfile")) + return 0; + + compatible = (char *)fdt_getprop(gd->fdt_blob, 0, "compatible", NULL); + if (compatible) { + debug("Compatible: %s\n", compatible); + + /* Discard vendor prefix */ + strsep(&compatible, ","); + + fdtfile = calloc(1, strlen(vendor) + strlen(compatible) + + strlen(suffix) + 1); + if (!fdtfile) + return -ENOMEM; + + sprintf(fdtfile, "%s%s%s", vendor, compatible, suffix); + + env_set("fdtfile", fdtfile); + free(fdtfile); + } + + return 0; +} + int board_late_init(void) { u32 reg = 0; @@ -553,6 +566,10 @@ int board_late_init(void) return 0; } + ret = set_fdtfile(); + if (ret) + return ret; + ret = zynqmp_mmio_read((ulong)&crlapb_base->boot_mode, ®); if (ret) return -EINVAL; |