summaryrefslogtreecommitdiffstats
path: root/board/xilinx/zynqmp
diff options
context:
space:
mode:
authorMichal Simek <michal.simek@xilinx.com>2020-07-30 13:37:49 +0200
committerMichal Simek <michal.simek@xilinx.com>2020-09-23 10:31:40 +0200
commit1025bd098aa8f12c5509687147b171d265e77285 (patch)
tree7e4f5e53ee29e9d5f361953c84e6953a167d9bed /board/xilinx/zynqmp
parent4d9bc795ae180b53fd561f06f0307282c00895b4 (diff)
downloadu-boot-1025bd098aa8f12c5509687147b171d265e77285.tar.gz
u-boot-1025bd098aa8f12c5509687147b171d265e77285.tar.xz
u-boot-1025bd098aa8f12c5509687147b171d265e77285.zip
xilinx: zynqmp: Add support for saving variables
Enabling saving variables to MMC(FAT), NAND, SPI based on primary bootmode. Maybe that logic can be tuned for more complicated use cases and better tested for different bootmodes. Tested on zcu104 to SD(FAT) and JTAG(NOWHERE). Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Diffstat (limited to 'board/xilinx/zynqmp')
-rw-r--r--board/xilinx/zynqmp/zynqmp.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c
index 4392448334..e95d13a14c 100644
--- a/board/xilinx/zynqmp/zynqmp.c
+++ b/board/xilinx/zynqmp/zynqmp.c
@@ -9,6 +9,7 @@
#include <cpu_func.h>
#include <debug_uart.h>
#include <env.h>
+#include <env_internal.h>
#include <init.h>
#include <log.h>
#include <net.h>
@@ -679,3 +680,37 @@ int checkboard(void)
puts("Board: Xilinx ZynqMP\n");
return 0;
}
+
+enum env_location env_get_location(enum env_operation op, int prio)
+{
+ u32 bootmode = zynqmp_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 NAND_MODE:
+ 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 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;
+ }
+}