From: Massimo Pegorer <massimo.pegorer+oss@gmail.com>
To: u-boot@lists.u-boot-project.org,
Quentin Schulz <u-boot@0leil.net>,
Jonas Karlman <jonas@kwiboo.se>
Cc: Tom Rini <trini@konsulko.com>,
Ilias Apalodimas <ilias.apalodimas@linaro.org>,
Johan Jonker <jbx6244@gmail.com>,
Massimo Pegorer <massimo.pegorer+oss@gmail.com>
Subject: [PATCH 7/7] mach-rockchip: Add xPL phase context to ROCKCHIP_BROM_HELPER option
Date: Tue, 01 Dec 2026 20:18:24 +0100 [thread overview]
Message-ID: <20261201-brom-v1-7-06f157a269fd@gmail.com> (raw)
In-Reply-To: <20261201-brom-v1-0-06f157a269fd@gmail.com>
There are 58 Rockchip board configurations that have all three options:
CONFIG_TPL CONFIG_SPL and CONFIG_ROCKCHIP_BROM_HELPER. In this case, the
ROCKCHIP_BROM_HELPER code is built into both TPL and SPL too, even if it
is really needed in only one of them. In all of these configurations only
the TPL needs to return to BootROM: TPL_ROCKCHIP_BACK_TO_BROM is selected
while SPL_ROCKCHIP_BACK_TO_BROM is not.
Split the current ROCKCHIP_BROM_HELPER option into TPL and SPL specific
ones, and rely on the appropriate one based on the built phase context.
There were 64 configurations with ROCKCHIP_BROM_HELPER. Now there are 58
with TPL_ROCKCHIP_BROM_HELPER only, and 6 with SPL_ROCKCHIP_BROM_HELPER
only.
For the 58 configurations with TPL_ROCKCHIP_BROM_HELPER only, the SPL
size decreases by up to 380 bytes.
Signed-off-by: Massimo Pegorer <massimo.pegorer+oss@gmail.com>
---
arch/arm/mach-rockchip/Kconfig | 9 ++++++---
arch/arm/mach-rockchip/Makefile | 4 ++--
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig
index 18ab21ad38e..92183db9cdd 100644
--- a/arch/arm/mach-rockchip/Kconfig
+++ b/arch/arm/mach-rockchip/Kconfig
@@ -603,7 +603,7 @@ config ROCKCHIP_USB_UART
config SPL_ROCKCHIP_BACK_TO_BROM
bool "SPL returns to boot ROM"
- select ROCKCHIP_BROM_HELPER
+ select SPL_ROCKCHIP_BROM_HELPER
select SPL_BOOTROM_SUPPORT if SPL_FRAMEWORK
depends on SPL
help
@@ -614,7 +614,7 @@ config SPL_ROCKCHIP_BACK_TO_BROM
config TPL_ROCKCHIP_BACK_TO_BROM
bool "TPL returns to boot ROM"
default y
- select ROCKCHIP_BROM_HELPER if !ROCKCHIP_RK3066
+ select TPL_ROCKCHIP_BROM_HELPER if !ROCKCHIP_RK3066
select TPL_BOOTROM_SUPPORT if TPL_FRAMEWORK
depends on TPL
help
@@ -686,7 +686,10 @@ config ROCKCHIP_SPL_RESERVE_IRAM
address is in IRAM and may overlay with SPL text area if not
reserved.
-config ROCKCHIP_BROM_HELPER
+config SPL_ROCKCHIP_BROM_HELPER
+ bool
+
+config TPL_ROCKCHIP_BROM_HELPER
bool
config SPL_ROCKCHIP_EARLYRETURN_TO_BROM
diff --git a/arch/arm/mach-rockchip/Makefile b/arch/arm/mach-rockchip/Makefile
index d3bc0689f89..e5149858eb7 100644
--- a/arch/arm/mach-rockchip/Makefile
+++ b/arch/arm/mach-rockchip/Makefile
@@ -7,9 +7,9 @@
# this may have entered from ATF with the stack-pointer pointing to
# inaccessible/protected memory (and the bootrom-helper assumes that
# the stack-pointer is valid before switching to the U-Boot stack).
-obj-spl-$(CONFIG_ROCKCHIP_BROM_HELPER) += bootrom.o
+obj-spl-$(CONFIG_SPL_ROCKCHIP_BROM_HELPER) += bootrom.o
obj-spl-$(CONFIG_SPL_ROCKCHIP_COMMON_BOARD) += spl.o spl-boot-order.o spl_common.o
-obj-tpl-$(CONFIG_ROCKCHIP_BROM_HELPER) += bootrom.o
+obj-tpl-$(CONFIG_TPL_ROCKCHIP_BROM_HELPER) += bootrom.o
obj-tpl-$(CONFIG_TPL_ROCKCHIP_COMMON_BOARD) += tpl.o spl_common.o
obj-tpl-$(CONFIG_ROCKCHIP_PX30) += px30-board-tpl.o spl_common.o
--
2.34.1
prev parent reply other threads:[~2026-12-01 19:18 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-01 19:18 [PATCH 0/7] mach-rockchip: Add xPL phase context to ROCKCHIP_BROM_HELPER Massimo Pegorer
2026-12-01 19:18 ` [PATCH 1/7] mach-rockchip: px30: TPL_ROCKCHIP_COMMON_BOARD is not an option Massimo Pegorer
2026-12-01 19:18 ` [PATCH 2/7] mach-rockchip: rk3036: SPL_ROCKCHIP_COMMON_BOARD " Massimo Pegorer
2026-12-01 19:18 ` [PATCH 3/7] mach-rockchip: px30: force TPL_ROCKCHIP_BACK_TO_BROM option selection Massimo Pegorer
2026-12-01 19:18 ` [PATCH 4/7] mach-rockchip: rk3036: force SPL_ROCKCHIP_BACK_TO_BROM " Massimo Pegorer
2026-12-01 19:18 ` [PATCH 5/7] mach-rockchip: Kconfig: Select xPL_BOOTROM_SUPPORT only if needed Massimo Pegorer
2026-12-01 19:18 ` [PATCH 6/7] configs: rockchip: Drop unneeded SPL_BOOTROM_SUPPORT option Massimo Pegorer
2026-12-01 19:18 ` Massimo Pegorer [this message]
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=20261201-brom-v1-7-06f157a269fd@gmail.com \
--to=massimo.pegorer+oss@gmail.com \
--cc=ilias.apalodimas@linaro.org \
--cc=jbx6244@gmail.com \
--cc=jonas@kwiboo.se \
--cc=trini@konsulko.com \
--cc=u-boot@0leil.net \
--cc=u-boot@lists.u-boot-project.org \
/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 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.