diff mbox series

[u-boot,v2019.04-aspeed-openbmc,04/11] ast2600: spl: Support common boot devices

Message ID 20210413080755.73572-5-joel@jms.id.au
State New
Headers show
Series Use HACE to | expand

Commit Message

Joel Stanley April 13, 2021, 8:07 a.m. UTC
Aspeed's SDK has some custom boot devices. There's also the common SPL
code for loading boot images from various devices that the system can be
configured to use.

This will use the Aspeed device types first and then fall back to the
generic ones.

Signed-off-by: Joel Stanley <joel@jms.id.au>
---
 arch/arm/mach-aspeed/ast2600/spl.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

Comments

Klaus Heinrich Kiwi April 13, 2021, 12:31 p.m. UTC | #1
On 4/13/2021 5:07 AM, Joel Stanley wrote:
> Aspeed's SDK has some custom boot devices. There's also the common SPL
> code for loading boot images from various devices that the system can be
> configured to use.
> 
> This will use the Aspeed device types first and then fall back to the
> generic ones.
> 
> Signed-off-by: Joel Stanley <joel@jms.id.au>
> ---
>   arch/arm/mach-aspeed/ast2600/spl.c | 10 ++++++++++
>   1 file changed, 10 insertions(+)
> 
> diff --git a/arch/arm/mach-aspeed/ast2600/spl.c b/arch/arm/mach-aspeed/ast2600/spl.c
> index d794421b4070..527e14f8e3b6 100644
> --- a/arch/arm/mach-aspeed/ast2600/spl.c
> +++ b/arch/arm/mach-aspeed/ast2600/spl.c
> @@ -34,6 +34,7 @@ void board_init_f(ulong dummy)
> 
>   u32 spl_boot_device(void)
>   {
> +#if IS_ENABLED(CONFIG_ASPEED_SECURE_BOOT)
>   	switch (aspeed_bootmode()) {
>   	case AST_BOOTMODE_EMMC:
>   		return (IS_ENABLED(CONFIG_ASPEED_SECURE_BOOT))?
> @@ -47,6 +48,15 @@ u32 spl_boot_device(void)
>   	default:
>   		break;
>   	}
> +#endif
> +	switch (aspeed_bootmode()) {
> +	case AST_BOOTMODE_EMMC:
> +		return BOOT_DEVICE_MMC1;
> +	case AST_BOOTMODE_SPI:
> +		return BOOT_DEVICE_SPI;
> +	case AST_BOOTMODE_UART:
> +		return BOOT_DEVICE_UART;
> +	}
> 
>   	return BOOT_DEVICE_NONE;
>   }
> 

Reviewed-by: Klaus Heinrich Kiwi <klaus@linux.vnet.ibm.com>
diff mbox series

Patch

diff --git a/arch/arm/mach-aspeed/ast2600/spl.c b/arch/arm/mach-aspeed/ast2600/spl.c
index d794421b4070..527e14f8e3b6 100644
--- a/arch/arm/mach-aspeed/ast2600/spl.c
+++ b/arch/arm/mach-aspeed/ast2600/spl.c
@@ -34,6 +34,7 @@  void board_init_f(ulong dummy)
 
 u32 spl_boot_device(void)
 {
+#if IS_ENABLED(CONFIG_ASPEED_SECURE_BOOT)
 	switch (aspeed_bootmode()) {
 	case AST_BOOTMODE_EMMC:
 		return (IS_ENABLED(CONFIG_ASPEED_SECURE_BOOT))?
@@ -47,6 +48,15 @@  u32 spl_boot_device(void)
 	default:
 		break;
 	}
+#endif
+	switch (aspeed_bootmode()) {
+	case AST_BOOTMODE_EMMC:
+		return BOOT_DEVICE_MMC1;
+	case AST_BOOTMODE_SPI:
+		return BOOT_DEVICE_SPI;
+	case AST_BOOTMODE_UART:
+		return BOOT_DEVICE_UART;
+	}
 
 	return BOOT_DEVICE_NONE;
 }