All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] arm: socfpga: Only do 'is OS booted from FIT' checking when VAB is enabled
@ 2021-03-22 10:04 Siew Chin Lim
  2021-03-23  5:55 ` Tan, Ley Foon
  0 siblings, 1 reply; 2+ messages in thread
From: Siew Chin Lim @ 2021-03-22 10:04 UTC (permalink / raw)
  To: u-boot

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.

Signed-off-by: Siew Chin Lim <elly.siew.chin.lim@intel.com>
---
 arch/arm/mach-socfpga/board.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-socfpga/board.c b/arch/arm/mach-socfpga/board.c
index 81aa07c902..650122fcd4 100644
--- a/arch/arm/mach-socfpga/board.c
+++ b/arch/arm/mach-socfpga/board.c
@@ -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
-- 
2.13.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH] arm: socfpga: Only do 'is OS booted from FIT' checking when VAB is enabled
  2021-03-22 10:04 [PATCH] arm: socfpga: Only do 'is OS booted from FIT' checking when VAB is enabled Siew Chin Lim
@ 2021-03-23  5:55 ` Tan, Ley Foon
  0 siblings, 0 replies; 2+ messages in thread
From: Tan, Ley Foon @ 2021-03-23  5:55 UTC (permalink / raw)
  To: u-boot



> -----Original Message-----
> From: Lim, Elly Siew Chin <elly.siew.chin.lim@intel.com>
> Sent: Monday, March 22, 2021 6:05 PM
> To: u-boot at lists.denx.de
> Cc: Marek Vasut <marex@denx.de>; Tan, Ley Foon
> <ley.foon.tan@intel.com>; See, Chin Liang <chin.liang.see@intel.com>;
> Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>; Chee, Tien Fong
> <tien.fong.chee@intel.com>; Westergreen, Dalon
> <dalon.westergreen@intel.com>; Simon Glass <sjg@chromium.org>; Gan,
> Yau Wai <yau.wai.gan@intel.com>; Lim, Elly Siew Chin
> <elly.siew.chin.lim@intel.com>
> 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.
> 
> 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.
> 
> Signed-off-by: Siew Chin Lim <elly.siew.chin.lim@intel.com>


Reviewed-by: Ley Foon Tan <ley.foon.tan@intel.com>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-03-23  5:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-22 10:04 [PATCH] arm: socfpga: Only do 'is OS booted from FIT' checking when VAB is enabled Siew Chin Lim
2021-03-23  5:55 ` Tan, Ley Foon

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.