From: Jagan Teki <jagan@amarulasolutions.com>
To: u-boot@lists.denx.de
Subject: [PATCH v4 3/6] env: Enable SPI flash env for SiFive FU540
Date: Thu, 2 Jul 2020 13:32:59 +0530 [thread overview]
Message-ID: <20200702080259.12417-2-jagan@amarulasolutions.com> (raw)
In-Reply-To: <20200702080259.12417-1-jagan@amarulasolutions.com>
SPI flash device on HiFive Unleashed has 32MiB Size.
This patch adds SPI flash environment after U-Boot proper
partition with a size of 128KiB.
SPI flash partition layout(32MiB):
0 - 34 : reserved for GPT header
35 - 39 : unused
40 - 2087 : loader1 (SPL, FSBL)
2088 - 10279 : loader2 (U-Boot proper, U-Boot)
10280 - 10535 : environment
10536 - 65494 : rootfs
65528 - 65536 : distro script
Note: the loader1 must start from 40th sector even though
there are 6 free sectors prior since 40th sector is nearest
flash sector boundary.?
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Bin Meng <bin.meng@windriver.com>
Tested-by: Bin Meng <bin.meng@windriver.com>
---
Changes for v4:
- %s/add/adds
arch/riscv/cpu/fu540/Kconfig | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/arch/riscv/cpu/fu540/Kconfig b/arch/riscv/cpu/fu540/Kconfig
index e9302e87c0..2dcad8e27f 100644
--- a/arch/riscv/cpu/fu540/Kconfig
+++ b/arch/riscv/cpu/fu540/Kconfig
@@ -13,3 +13,16 @@ config SIFIVE_FU540
imply SPL_CPU_SUPPORT
imply SPL_OPENSBI
imply SPL_LOAD_FIT
+
+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
--
2.25.1
next prev parent reply other threads:[~2020-07-02 8:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-02 8:02 [PATCH v4 2/6] sifive: fu540: Add Booting from SPI Jagan Teki
2020-07-02 8:02 ` Jagan Teki [this message]
[not found] ` <752D002CFF5D0F4FA35C0100F1D73F3FA47261AD@ATCPCS16.andestech.com>
2020-07-13 2:32 ` Rick Chen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200702080259.12417-2-jagan@amarulasolutions.com \
--to=jagan@amarulasolutions.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox