* [PATCH] riscv: sifive: fu540: Enable saving environment in MMC
@ 2020-01-16 7:21 Bin Meng
2020-01-16 8:22 ` David Abdurachmanov
0 siblings, 1 reply; 2+ messages in thread
From: Bin Meng @ 2020-01-16 7:21 UTC (permalink / raw)
To: u-boot
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@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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH] riscv: sifive: fu540: Enable saving environment in MMC
2020-01-16 7:21 [PATCH] riscv: sifive: fu540: Enable saving environment in MMC Bin Meng
@ 2020-01-16 8:22 ` David Abdurachmanov
0 siblings, 0 replies; 2+ messages in thread
From: David Abdurachmanov @ 2020-01-16 8:22 UTC (permalink / raw)
To: u-boot
On Thu, Jan 16, 2020 at 9:21 AM Bin Meng <bmeng.cn@gmail.com> wrote:
>
> 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.
Does this also mean we can use fw_setenv and fw_printenv from the
Linux user-space?
How does one need to format partitions / prepare uSD card for this?
Currently I have 4 GPT partitions:
- /boot (ext4)
- FSBL (raw)
- OpenSBI + U-Boot (raw)
- rootfs (ext4)
david
>
> Signed-off-by: Bin Meng <bmeng.cn@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
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-01-16 8:22 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-16 7:21 [PATCH] riscv: sifive: fu540: Enable saving environment in MMC Bin Meng
2020-01-16 8:22 ` David Abdurachmanov
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.