[PATCH u-boot v2019.04-aspeed-openbmc v2 06/10] ast2600: spl: Add ASPEED_LOADERS option

Joel Stanley joel at jms.id.au
Tue Apr 20 16:46:44 AEST 2021


This places the ASPEED loaders behind configuration option that can be
disabled to instead use the common code. This option is enabled by
default so existing configurations do not need to change.

Signed-off-by: Joel Stanley <joel at jms.id.au>
---
 arch/arm/mach-aspeed/Kconfig          | 15 +++++++++++++++
 arch/arm/mach-aspeed/ast2600/Makefile |  6 ++++--
 arch/arm/mach-aspeed/ast2600/spl.c    |  2 ++
 3 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-aspeed/Kconfig b/arch/arm/mach-aspeed/Kconfig
index 44d392a70610..bccb63a99e54 100644
--- a/arch/arm/mach-aspeed/Kconfig
+++ b/arch/arm/mach-aspeed/Kconfig
@@ -54,6 +54,19 @@ config ASPEED_PALLADIUM
 	  This is mainly for internal verification and investigation
 	  on HW design. If not sure, say N.
 
+config ASPEED_LOADERS
+       bool "ASPEED custom loaders"
+       depends on SPL
+       default y
+       help
+        Enable the custom payload loading methods used by ASPEED. This is requited to
+        use ASPEED's proprietary secure boot feature.
+
+        Disable this is if you are using u-boot's common loader functionally
+        to eg. load u-boot as a FIT and use vboot.
+
+if ASPEED_LOADERS
+
 config ASPEED_SECURE_BOOT
 	bool "Support Aspeed secure boot feature"
 	depends on SPL && ASPEED_AST2600
@@ -154,6 +167,8 @@ config ASPEED_KERNEL_FIT_DRAM_BASE
 	  The DRAM address where the Kernel FIT image
 	  will be loaded if XIP is not supported
 
+endif
+
 source "arch/arm/mach-aspeed/ast2400/Kconfig"
 source "arch/arm/mach-aspeed/ast2500/Kconfig"
 source "arch/arm/mach-aspeed/ast2600/Kconfig"
diff --git a/arch/arm/mach-aspeed/ast2600/Makefile b/arch/arm/mach-aspeed/ast2600/Makefile
index 0abac4c233e4..d07e8c737cfe 100644
--- a/arch/arm/mach-aspeed/ast2600/Makefile
+++ b/arch/arm/mach-aspeed/ast2600/Makefile
@@ -1,2 +1,4 @@
-obj-y   += platform.o board_common.o scu_info.o utils.o cache.o crypto.o aspeed_verify.o
-obj-$(CONFIG_SPL_BUILD) += spl.o spl_boot.o
+obj-y   += platform.o board_common.o scu_info.o utils.o cache.o
+obj-$(CONFIG_ASPEED_SECURE_BOOT) += crypto.o aspeed_verify.o
+obj-$(CONFIG_ASPEED_LOADERS) += spl_boot.o
+obj-$(CONFIG_SPL_BUILD) += spl.o
diff --git a/arch/arm/mach-aspeed/ast2600/spl.c b/arch/arm/mach-aspeed/ast2600/spl.c
index e1eef121d5c6..40eabca683c2 100644
--- a/arch/arm/mach-aspeed/ast2600/spl.c
+++ b/arch/arm/mach-aspeed/ast2600/spl.c
@@ -47,6 +47,7 @@ void spl_board_init(void)
 
 u32 spl_boot_device(void)
 {
+#if IS_ENABLED(CONFIG_ASPEED_LOADERS)
 	switch (aspeed_bootmode()) {
 	case AST_BOOTMODE_EMMC:
 		return (IS_ENABLED(CONFIG_ASPEED_SECURE_BOOT))?
@@ -60,6 +61,7 @@ u32 spl_boot_device(void)
 	default:
 		break;
 	}
+#endif
 
 	return BOOT_DEVICE_NONE;
 }
-- 
2.30.2



More information about the openbmc mailing list