public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Jagan Teki <jagan@amarulasolutions.com>
To: u-boot@lists.denx.de
Subject: [PATCH 2/5] env: Enable SPI flash env for SiFive FU540
Date: Mon, 20 Apr 2020 19:35:11 +0530	[thread overview]
Message-ID: <20200420140514.25847-3-jagan@amarulasolutions.com> (raw)
In-Reply-To: <20200420140514.25847-1-jagan@amarulasolutions.com>

SPI flash device on HiFive Unleashed has 32MiB Size.

This patch add 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

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
---
 env/Kconfig | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/env/Kconfig b/env/Kconfig
index 0d6f559b39..67c88fd40b 100644
--- a/env/Kconfig
+++ b/env/Kconfig
@@ -500,6 +500,7 @@ config ENV_OFFSET
 	default 0 if ARC
 	default 0x140000 if ARCH_AT91
 	default 0x260000 if ARCH_OMAP2PLUS
+	default 0x505000 if TARGET_SIFIVE_FU540
 	help
 	  Offset from the start of the device (or partition)
 
@@ -519,6 +520,7 @@ config ENV_SIZE
 	default 0x2000 if ARCH_ROCKCHIP && ENV_IS_IN_SPI_FLASH
 	default 0x8000 if ARCH_ZYNQMP || ARCH_VERSAL
 	default 0x4000 if ARC
+	default 0x20000 if TARGET_SIFIVE_FU540
 	default 0x1f000
 	help
 	  Size of the environment storage area
@@ -529,6 +531,7 @@ config ENV_SECT_SIZE
 	default 0x2000 if ARCH_ROCKCHIP
 	default 0x40000 if ARCH_ZYNQMP || ARCH_VERSAL
 	default 0x20000 if ARCH_ZYNQ || ARCH_OMAP2PLUS || ARCH_AT91
+	default 0x10000 if TARGET_SIFIVE_FU540
 	help
 	  Size of the sector containing the environment.
 
-- 
2.17.1

  parent reply	other threads:[~2020-04-20 14:05 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-20 14:05 [PATCH 0/5] riscv: sifive/fu540: Booting from SPI Jagan Teki
2020-04-20 14:05 ` [PATCH 1/5] sifive: fu540: Add " Jagan Teki
2020-04-20 14:24   ` Bin Meng
2020-04-20 14:28     ` Jagan Teki
2020-04-20 14:05 ` Jagan Teki [this message]
2020-04-20 14:35   ` [PATCH 2/5] env: Enable SPI flash env for SiFive FU540 Bin Meng
2020-04-20 14:05 ` [PATCH 3/5] sifive: fu540: Mark the default env as SPI flash Jagan Teki
2020-04-20 14:36   ` Bin Meng
2020-04-20 14:05 ` [PATCH 4/5] sifive: fu540: Add boot flash script offset, size Jagan Teki
2020-04-20 14:05 ` [PATCH 5/5] sifive: fu540: Enable SF distro bootcmd Jagan Teki
2020-04-20 14:46 ` [PATCH 0/5] riscv: sifive/fu540: Booting from SPI Bin Meng

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=20200420140514.25847-3-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