U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Fabio Estevam <festevam@gmail.com>
To: kever.yang@rock-chips.com
Cc: djw@t-chip.com.cn, u-boot@lists.denx.de,
	Fabio Estevam <festevam@nabladev.com>
Subject: [PATCH v2 1/5] roc-pc-rk3399: Enable redundant SPI flash environment
Date: Wed,  1 Jul 2026 14:57:56 -0300	[thread overview]
Message-ID: <20260701175800.40141-1-festevam@gmail.com> (raw)

From: Fabio Estevam <festevam@nabladev.com>

Enable redundant environment storage in the SPI NOR flash by enabling
CONFIG_ENV_REDUNDANT and defining CONFIG_ENV_OFFSET_REDUND.

Move the primary environment to 0x3f0000 and place the redundant copy
at 0x3f8000, matching the existing SPI NOR layout.

Having two copies of the environment improves robustness against
power loss or interrupted writes and is useful for software update
frameworks such as SWUpdate that modify the U-Boot environment during
system updates.

Signed-off-by: Fabio Estevam <festevam@nabladev.com>
---
Changes since v1:
- Use CONFIG_ENV_OFFSET=0x3F0000 and CONFIG_ENV_OFFSET_REDUND=0x3F8000.

 configs/roc-pc-rk3399_defconfig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/configs/roc-pc-rk3399_defconfig b/configs/roc-pc-rk3399_defconfig
index 1df5cb03adbb..c7cbe8ec34b3 100644
--- a/configs/roc-pc-rk3399_defconfig
+++ b/configs/roc-pc-rk3399_defconfig
@@ -7,6 +7,6 @@ CONFIG_NR_DRAM_BANKS=1
 CONFIG_SF_DEFAULT_SPEED=30000000
 CONFIG_ENV_SIZE=0x8000
-CONFIG_ENV_OFFSET=0x3F8000
+CONFIG_ENV_OFFSET=0x3F0000
 CONFIG_ENV_SECT_SIZE=0x1000
 CONFIG_DEFAULT_DEVICE_TREE="rockchip/rk3399-roc-pc"
 CONFIG_DM_RESET=y
@@ -17,6 +17,7 @@ CONFIG_SYS_LOAD_ADDR=0x800800
 CONFIG_SF_DEFAULT_BUS=1
 CONFIG_DEBUG_UART_BASE=0xFF1A0000
 CONFIG_DEBUG_UART_CLOCK=24000000
+CONFIG_ENV_OFFSET_REDUND=0x3F8000
 CONFIG_SPL_SPI_FLASH_SUPPORT=y
 CONFIG_SPL_SPI=y
 CONFIG_DEBUG_UART=y
@@ -39,6 +40,7 @@ CONFIG_CMD_TIME=y
 CONFIG_SPL_OF_CONTROL=y
 CONFIG_OF_SPL_REMOVE_PROPS="clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
 CONFIG_ENV_IS_IN_SPI_FLASH=y
+CONFIG_ENV_REDUNDANT=y
 CONFIG_ENV_RELOC_GD_ENV_ADDR=y
 CONFIG_ROCKCHIP_GPIO=y
 CONFIG_SYS_I2C_ROCKCHIP=y
-- 
2.43.0

             reply	other threads:[~2026-07-01 17:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-01 17:57 Fabio Estevam [this message]
2026-07-01 17:57 ` [PATCH v2 2/5] roc-pc-rk3399: Introduce a common defconfig Fabio Estevam
2026-07-01 17:57 ` [PATCH v2 3/5] mtd: spi-nor-ids: Add XMC XM25QH128C Fabio Estevam
2026-07-01 17:57 ` [PATCH v2 4/5] roc-pc-plus-rk3399: Introduce new variant Fabio Estevam
2026-07-01 17:58 ` [PATCH v2 5/5] roc-pc-plus-rk3399: Enable USB Mass Storage support Fabio Estevam

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=20260701175800.40141-1-festevam@gmail.com \
    --to=festevam@gmail.com \
    --cc=djw@t-chip.com.cn \
    --cc=festevam@nabladev.com \
    --cc=kever.yang@rock-chips.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