summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorAristo Chen <[email protected]>2026-06-23 14:15:15 +0000
committerTom Rini <[email protected]>2026-07-16 12:03:40 -0600
commitc85bf61b14f9caa34662d9b767b61ba2b5da74f0 (patch)
tree2b9a35f14a42f9d98d92029fd1a77228cab4951c /board
parent1708f49de9cb6ba9a24735faa9679f6f9146cbd4 (diff)
arm: k3: select tifsstub via board_fit_config_name_match
TI K3 AM62x/AM62Ax/AM62Px boards carry two or three mutually-exclusive tifsstub variants in their tispl.bin FIT images, all at the same load address. The existing approach loads every variant and then discards the wrong ones at runtime via a *p_size = 0 hack in board_fit_image_post_process(). Switch to selecting the appropriate FIT configuration up front via board_fit_config_name_match() so only the correct tifsstub is loaded in the first place. board_fit_config_name_match() is invoked by the R5 SPL during FIT config selection. get_device_type() is a simple register read that is available at that point, so the security state can be determined early. The matching logic is factored into k3_fit_config_match_security_state() in arch/arm/mach-k3/common.c so it can be shared by any K3 board that wants this scheme. It matches configurations by a suffix appended to the description string: -hs-se -> HS-SE (K3_DEVICE_TYPE_HS_SE) -hs-fs -> HS-FS (K3_DEVICE_TYPE_HS_FS) -gp -> GP (K3_DEVICE_TYPE_GP) Configurations without a security-state suffix (e.g. u-boot.img) do not match and fall through to the DTS-specified default config naturally. Each TI EVM board defines its board_fit_config_name_match() as a thin wrapper around the shared helper: - board/ti/am62x/evm.c (AM625 SK: hs-se, hs-fs, gp) - board/ti/am62ax/evm.c (AM62A SK: hs-se, hs-fs, gp) - board/ti/am62px/evm.c (AM62P SK: hs-se, hs-fs, gp) FIT configurations are split per security state in: - arch/arm/dts/k3-am625-sk-binman.dtsi (ti-falcon, ti-spl, ti-spl_unsigned: conf-hs-se/conf-hs-fs/conf-gp) - arch/arm/dts/k3-am62a-sk-binman.dtsi (ti-falcon, ti-spl: conf-hs-se/conf-hs-fs; no GP variant on AM62A) - arch/arm/dts/k3-am62p-sk-binman.dtsi (ti-falcon, ti-spl: conf-hs-se/conf-hs-fs; no GP variant on AM62P) The runtime filter in board_fit_image_post_process() is intentionally left in place. It becomes redundant once every board using the AM62x family dtsi files migrates to per-state configurations. The dtsi for phytec phycore and toradex verdin boards is updated by separate patches in this series, and the now-redundant runtime filter is removed by the final patch in the series. Signed-off-by: Aristo Chen <[email protected]> Reviewed-by: Anshul Dalal <[email protected]>
Diffstat (limited to 'board')
-rw-r--r--board/ti/am62ax/evm.c6
-rw-r--r--board/ti/am62px/evm.c6
-rw-r--r--board/ti/am62x/evm.c6
3 files changed, 18 insertions, 0 deletions
diff --git a/board/ti/am62ax/evm.c b/board/ti/am62ax/evm.c
index 4916eec3b2b..adb784e69a8 100644
--- a/board/ti/am62ax/evm.c
+++ b/board/ti/am62ax/evm.c
@@ -6,6 +6,7 @@
*
*/
+#include <image.h>
#include <asm/arch/hardware.h>
#include <asm/io.h>
#include <dm/uclass.h>
@@ -17,6 +18,11 @@
#include "../common/fdt_ops.h"
#include "../common/k3_32k_lfosc.h"
+int board_fit_config_name_match(const char *name)
+{
+ return k3_fit_config_match_security_state(name);
+}
+
#if defined(CONFIG_XPL_BUILD)
void spl_perform_board_fixups(struct spl_image_info *spl_image)
{
diff --git a/board/ti/am62px/evm.c b/board/ti/am62px/evm.c
index 8fde47fb1be..9fa0a1c9f72 100644
--- a/board/ti/am62px/evm.c
+++ b/board/ti/am62px/evm.c
@@ -7,6 +7,7 @@
*/
#include <efi_loader.h>
+#include <image.h>
#include <asm/arch/hardware.h>
#include <asm/io.h>
#include <cpu_func.h>
@@ -43,6 +44,11 @@ struct efi_capsule_update_info update_info = {
.images = fw_images,
};
+int board_fit_config_name_match(const char *name)
+{
+ return k3_fit_config_match_security_state(name);
+}
+
#if IS_ENABLED(CONFIG_SPL_BUILD)
void spl_board_init(void)
{
diff --git a/board/ti/am62x/evm.c b/board/ti/am62x/evm.c
index 49e58ad6d6c..90beed341b6 100644
--- a/board/ti/am62x/evm.c
+++ b/board/ti/am62x/evm.c
@@ -18,6 +18,7 @@
#include <fdt_support.h>
#include <fdt_simplefb.h>
#include <asm/io.h>
+#include <image.h>
#include <asm/arch/hardware.h>
#include <dm/uclass.h>
#include <asm/arch/k3-ddr.h>
@@ -135,6 +136,11 @@ int board_late_init(void)
}
#endif
+int board_fit_config_name_match(const char *name)
+{
+ return k3_fit_config_match_security_state(name);
+}
+
#if defined(CONFIG_XPL_BUILD)
void spl_board_init(void)
{