diff options
Diffstat (limited to 'board')
-rw-r--r-- | board/xilinx/common/board.c | 6 | ||||
-rw-r--r-- | board/xilinx/versal/board.c | 32 | ||||
-rw-r--r-- | board/xilinx/zynq/board.c | 32 | ||||
-rw-r--r-- | board/xilinx/zynqmp/zynqmp.c | 2 |
4 files changed, 66 insertions, 6 deletions
diff --git a/board/xilinx/common/board.c b/board/xilinx/common/board.c index 475628b925..92b61d83ca 100644 --- a/board/xilinx/common/board.c +++ b/board/xilinx/common/board.c @@ -378,14 +378,12 @@ int board_late_init_xilinx(void) int i, id, macid = 0; struct xilinx_board_description *desc; phys_size_t bootm_size = gd->ram_size; - struct bd_info *bd = gd->bd; - if (!CONFIG_IS_ENABLED(MICROBLAZE) && bd->bi_dram[0].start) { + if (!CONFIG_IS_ENABLED(MICROBLAZE)) { ulong scriptaddr; scriptaddr = env_get_hex("scriptaddr", 0); - ret |= env_set_hex("scriptaddr", - bd->bi_dram[0].start + scriptaddr); + ret |= env_set_hex("scriptaddr", gd->ram_base + scriptaddr); } if (CONFIG_IS_ENABLED(ARCH_ZYNQ) || CONFIG_IS_ENABLED(MICROBLAZE)) diff --git a/board/xilinx/versal/board.c b/board/xilinx/versal/board.c index e2f9d13c12..6045eb2baa 100644 --- a/board/xilinx/versal/board.c +++ b/board/xilinx/versal/board.c @@ -9,6 +9,7 @@ #include <env.h> #include <fdtdec.h> #include <init.h> +#include <env_internal.h> #include <log.h> #include <malloc.h> #include <time.h> @@ -129,7 +130,7 @@ int board_late_init(void) switch (bootmode) { case USB_MODE: puts("USB_MODE\n"); - mode = "dfu_usb"; + mode = "usb_dfu0 usb_dfu1"; break; case JTAG_MODE: puts("JTAG_MODE\n"); @@ -245,3 +246,32 @@ int dram_init(void) void reset_cpu(void) { } + +enum env_location env_get_location(enum env_operation op, int prio) +{ + u32 bootmode = versal_get_bootmode(); + + if (prio) + return ENVL_UNKNOWN; + + switch (bootmode) { + case EMMC_MODE: + case SD_MODE: + case SD1_LSHFT_MODE: + case SD_MODE1: + if (IS_ENABLED(CONFIG_ENV_IS_IN_FAT)) + return ENVL_FAT; + if (IS_ENABLED(CONFIG_ENV_IS_IN_EXT4)) + return ENVL_EXT4; + return ENVL_UNKNOWN; + case OSPI_MODE: + case QSPI_MODE_24BIT: + case QSPI_MODE_32BIT: + if (IS_ENABLED(CONFIG_ENV_IS_IN_SPI_FLASH)) + return ENVL_SPI_FLASH; + return ENVL_UNKNOWN; + case JTAG_MODE: + default: + return ENVL_NOWHERE; + } +} diff --git a/board/xilinx/zynq/board.c b/board/xilinx/zynq/board.c index 7533dddb9b..e2e9b3f0f7 100644 --- a/board/xilinx/zynq/board.c +++ b/board/xilinx/zynq/board.c @@ -9,6 +9,7 @@ #include <log.h> #include <dm/uclass.h> #include <env.h> +#include <env_internal.h> #include <fdtdec.h> #include <fpga.h> #include <malloc.h> @@ -119,3 +120,34 @@ int dram_init(void) return 0; } #endif + +enum env_location env_get_location(enum env_operation op, int prio) +{ + u32 bootmode = zynq_slcr_get_boot_mode() & ZYNQ_BM_MASK; + + if (prio) + return ENVL_UNKNOWN; + + switch (bootmode) { + case ZYNQ_BM_SD: + if (IS_ENABLED(CONFIG_ENV_IS_IN_FAT)) + return ENVL_FAT; + if (IS_ENABLED(CONFIG_ENV_IS_IN_EXT4)) + return ENVL_EXT4; + return ENVL_UNKNOWN; + case ZYNQ_BM_NAND: + if (IS_ENABLED(CONFIG_ENV_IS_IN_NAND)) + return ENVL_NAND; + if (IS_ENABLED(CONFIG_ENV_IS_IN_UBI)) + return ENVL_UBI; + return ENVL_UNKNOWN; + case ZYNQ_BM_NOR: + case ZYNQ_BM_QSPI: + if (IS_ENABLED(CONFIG_ENV_IS_IN_SPI_FLASH)) + return ENVL_SPI_FLASH; + return ENVL_UNKNOWN; + case ZYNQ_BM_JTAG: + default: + return ENVL_NOWHERE; + } +} diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c index 23c12f45ea..d05f0b2e12 100644 --- a/board/xilinx/zynqmp/zynqmp.c +++ b/board/xilinx/zynqmp/zynqmp.c @@ -571,7 +571,7 @@ int board_late_init(void) switch (bootmode) { case USB_MODE: puts("USB_MODE\n"); - mode = "usb"; + mode = "usb_dfu0 usb_dfu1"; env_set("modeboot", "usb_dfu_spl"); break; case JTAG_MODE: |