Skip to contentSkip to conversation

arm: socfpga: Only do 'is OS booted from FIT' checking when VAB is enabled

PATCH New Siew Chin Lim 2 participants 2 messages Mar 22, 2021 – Mar 23, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm: socfpga: Only do 'is OS booted from FIT' checking when VAB is enabled

Check CONFIG_SOCFPGA_SECURE_VAB_AUTH before perform 'is OS booted from FIT' checking in board_prep_linux function. And, fix typo of CONFIG_SOCFPGA_SECURE_VAB_AUTH_ALLOW_NON_FIT_IMAGE.

CONFIG_FIT will be enabled in both ATF and VAB boot flow, thus, board_prep_linux function will always be called by both ATF and VAB boot flow.

board_pre_linux function will do 'is OS booted from FIT' checking, and it will be called before board_fit_image_post_process function.

VAB boot flow expects the OS is always booted from FIT and with VAB signed cerfiticate because the VAB authentication is implemented in board_fit_image_post_process function. So, VAB needs the 'is OS booted from FIT' checking in board_pre_linux function.

However, for ATF boot flow, it is not a requirement that the OS must always booted from FIT. The OS can be booted from individual Image and kernel dtb file. Thus, we should not do 'if OS is booted from FIT' checking in board_prep_linux function.

---
 arch/arm/mach-socfpga/board.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm/mach-socfpga/board.c +2 -1
index 81aa07c902..650122fcd4 100644
@@ -115,7 +115,8 @@ void board_fit_image_post_process(void **p_image, size_t *p_size)
 #if !IS_ENABLED(CONFIG_SPL_BUILD) && IS_ENABLED(CONFIG_FIT)
 void board_prep_linux(bootm_headers_t *images)
 {
-	if (!IS_ENABLED(CONFIG_SECURE_VAB_AUTH_ALLOW_NON_FIT_IMAGE)) {
+	if (IS_ENABLED(CONFIG_SOCFPGA_SECURE_VAB_AUTH) &&
+	    !IS_ENABLED(CONFIG_SOCFPGA_SECURE_VAB_AUTH_ALLOW_NON_FIT_IMAGE)) {
 		/*
 		 * Ensure the OS is always booted from FIT and with
 		 * VAB signed certificate
Signature · 1 line
2.13.0
#1 lore raw

PATCH 1/1 arm: socfpga: Only do 'is OS booted from FIT' checking when VAB is enabled

Quoted 33 lines

-----Original Message-----
From: Lim, Elly Siew Chin <[email protected]>
Sent: Monday, March 22, 2021 6:05 PM
To: u-boot at lists.denx.de
Cc: Marek Vasut <[email protected]>; Tan, Ley Foon <[email protected]>; See, Chin Liang <[email protected]>; Simon Goldschmidt <[email protected]>; Chee, Tien Fong <[email protected]>; Westergreen, Dalon <[email protected]>; Simon Glass <[email protected]>; Gan, Yau Wai <[email protected]>; Lim, Elly Siew Chin <[email protected]>
Subject: [PATCH] arm: socfpga: Only do 'is OS booted from FIT' checking when VAB is enabled

Check CONFIG_SOCFPGA_SECURE_VAB_AUTH before perform 'is OS booted from FIT'
checking in board_prep_linux function. And, fix typo of CONFIG_SOCFPGA_SECURE_VAB_AUTH_ALLOW_NON_FIT_IMAGE.

CONFIG_FIT will be enabled in both ATF and VAB boot flow, thus, board_prep_linux function will always be called by both ATF and VAB boot flow.

board_pre_linux function will do 'is OS booted from FIT' checking, and it will be called before board_fit_image_post_process function.

VAB boot flow expects the OS is always booted from FIT and with VAB signed cerfiticate because the VAB authentication is implemented in board_fit_image_post_process function. So, VAB needs the 'is OS booted from FIT' checking in board_pre_linux function.

Quoted 6 lines

However, for ATF boot flow, it is not a requirement that the OS must always booted from FIT. The OS can be booted from individual Image and kernel dtb file. Thus, we should not do 'if OS is booted from FIT' checking in board_prep_linux function.