diff mbox series

[v3,2/2] riscv: Enable SPI flash env for SiFive Unmatched.

Message ID 20211124223210.5281-3-thomas-git@skibo.net
State Accepted
Commit c0ffc12a701621dc72dfc896965cbfe5b0dbf9b4
Delegated to: Andes
Headers show
Series riscv: Support booting SiFive Unmatched from SPI flash. | expand

Commit Message

Thomas Skibo Nov. 24, 2021, 10:32 p.m. UTC
Enable saving environment to SPI flash memory on SiFive
Unmatched.

Signed-off-by: Thomas Skibo <thomas-git@skibo.net>
---
 arch/riscv/cpu/fu740/Kconfig   | 13 +++++++++++++
 board/sifive/unmatched/Kconfig |  1 +
 2 files changed, 14 insertions(+)

Comments

Leo Liang Dec. 2, 2021, 8:42 a.m. UTC | #1
On Wed, Nov 24, 2021 at 02:32:10PM -0800, Thomas Skibo wrote:
> Enable saving environment to SPI flash memory on SiFive
> Unmatched.
> 
> Signed-off-by: Thomas Skibo <thomas-git@skibo.net>
> ---
>  arch/riscv/cpu/fu740/Kconfig   | 13 +++++++++++++
>  board/sifive/unmatched/Kconfig |  1 +
>  2 files changed, 14 insertions(+)

Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
diff mbox series

Patch

diff --git a/arch/riscv/cpu/fu740/Kconfig b/arch/riscv/cpu/fu740/Kconfig
index 049a0a0584..3e0c1fddc8 100644
--- a/arch/riscv/cpu/fu740/Kconfig
+++ b/arch/riscv/cpu/fu740/Kconfig
@@ -40,3 +40,16 @@  config SIFIVE_FU740
 	imply DM_I2C
 	imply SYS_I2C_OCORES
 	imply SPL_I2C
+
+if ENV_IS_IN_SPI_FLASH
+
+config ENV_OFFSET
+	default 0x505000
+
+config ENV_SIZE
+	default 0x20000
+
+config ENV_SECT_SIZE
+	default 0x10000
+
+endif # ENV_IS_IN_SPI_FLASH
diff --git a/board/sifive/unmatched/Kconfig b/board/sifive/unmatched/Kconfig
index fb2c1fbb58..fe213fd504 100644
--- a/board/sifive/unmatched/Kconfig
+++ b/board/sifive/unmatched/Kconfig
@@ -26,6 +26,7 @@  config SPL_OPENSBI_LOAD_ADDR
 config BOARD_SPECIFIC_OPTIONS # dummy
 	def_bool y
 	select SIFIVE_FU740
+	select ENV_IS_IN_SPI_FLASH
 	select SUPPORT_SPL
 	select RESET_SIFIVE
 	select BINMAN