[PATCH] riscv: sifive: fu540: Enable saving environment in MMC

Bin Meng bmeng.cn at gmail.com
Thu Jan 16 08:21:09 CET 2020


At present U-Boot environment is not saved so it's a little bit
inconvenient if booting kernel via network as each time we need
input the network environment variables from U-Boot shell.

We already have the MMC support and let's enable saveenv with that.

Signed-off-by: Bin Meng <bmeng.cn at gmail.com>
---

 configs/sifive_fu540_defconfig | 2 ++
 include/configs/sifive-fu540.h | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/configs/sifive_fu540_defconfig b/configs/sifive_fu540_defconfig
index 7d38ec9..6f9e619 100644
--- a/configs/sifive_fu540_defconfig
+++ b/configs/sifive_fu540_defconfig
@@ -1,5 +1,6 @@
 CONFIG_RISCV=y
 CONFIG_ENV_SIZE=0x20000
+CONFIG_ENV_OFFSET=0x1000000
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_TARGET_SIFIVE_FU540=y
 CONFIG_ARCH_RV64I=y
@@ -11,5 +12,6 @@ CONFIG_DEFAULT_DEVICE_TREE="hifive-unleashed-a00"
 CONFIG_DISPLAY_CPUINFO=y
 CONFIG_DISPLAY_BOARDINFO=y
 CONFIG_OF_SEPARATE=y
+CONFIG_ENV_IS_IN_MMC=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM_MTD=y
diff --git a/include/configs/sifive-fu540.h b/include/configs/sifive-fu540.h
index 2756ed5..fb829be 100644
--- a/include/configs/sifive-fu540.h
+++ b/include/configs/sifive-fu540.h
@@ -24,6 +24,8 @@
 
 /* Environment options */
 
+#define CONFIG_SYS_MMC_ENV_DEV		0
+
 #define BOOT_TARGET_DEVICES(func) \
 	func(MMC, mmc, 0) \
 	func(DHCP, dhcp, na)
-- 
2.7.4



More information about the U-Boot mailing list