arm: mvebu: add support for boot from SATA
authorBaruch Siach <baruch@tkos.co.il>
Thu, 16 May 2019 10:03:58 +0000 (13:03 +0300)
committerStefan Roese <sr@denx.de>
Thu, 11 Jul 2019 08:58:02 +0000 (10:58 +0200)
Add the required Kconfig and macro definitions to allow boot from SATA
on Armada 38x systems.

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Reviewed-by: Chris Packham <judge.packham@gmail.com>
Signed-off-by: Stefan Roese <sr@denx.de>
arch/arm/mach-mvebu/Kconfig
arch/arm/mach-mvebu/Makefile
arch/arm/mach-mvebu/include/mach/soc.h
arch/arm/mach-mvebu/spl.c

index 495c48e6c7495ddf66f5d34c6544c46db3b8d2f7..fdd39685b75dbd512b80f2d302e482d98a5531f0 100644 (file)
@@ -239,6 +239,11 @@ config MVEBU_SPL_BOOT_DEVICE_MMC
        bool "SDIO/MMC card"
        select SPL_LIBDISK_SUPPORT
 
+config MVEBU_SPL_BOOT_DEVICE_SATA
+       bool "SATA"
+       select SPL_SATA_SUPPORT
+       select SPL_LIBDISK_SUPPORT
+
 config MVEBU_SPL_BOOT_DEVICE_UART
        bool "UART"
 
index 02d3ce27ee74189ac0d156f39b56a98a0764d24f..8228a17972f96e14a5b1409d2f9e55094f25344f 100644 (file)
@@ -37,6 +37,9 @@ endif
 ifneq ($(CONFIG_MVEBU_SPL_BOOT_DEVICE_MMC),)
        KWB_CFG_BOOT_FROM=sdio
 endif
+ifneq ($(CONFIG_MVEBU_SPL_BOOT_DEVICE_SATA),)
+       KWB_CFG_BOOT_FROM=sata
+endif
 ifneq ($(CONFIG_MVEBU_SPL_BOOT_DEVICE_UART),)
        KWB_CFG_BOOT_FROM=uart
 endif
index f666ee24243b4cd06ced9b5291c2488d1e43fb03..acb9257c90fe35f140c60dcda386da57a37f63e1 100644 (file)
 #define BOOT_DEV_SEL_MASK      (0x3f << BOOT_DEV_SEL_OFFS)
 
 #define BOOT_FROM_NAND         0x0A
+#define BOOT_FROM_SATA         0x22
 #define BOOT_FROM_UART         0x28
+#define BOOT_FROM_SATA_ALT     0x2A
 #define BOOT_FROM_UART_ALT     0x3f
 #define BOOT_FROM_SPI          0x32
 #define BOOT_FROM_MMC          0x30
index 530b98c1aa31e637b5f869323d28a77a3840295f..d54de5195624be7915c5c181dfcff4d6410e52ef 100644 (file)
@@ -59,6 +59,11 @@ static u32 get_boot_device(void)
        case BOOT_FROM_UART_ALT:
 #endif
                return BOOT_DEVICE_UART;
+#ifdef BOOT_FROM_SATA
+       case BOOT_FROM_SATA:
+       case BOOT_FROM_SATA_ALT:
+               return BOOT_DEVICE_SATA;
+#endif
        case BOOT_FROM_SPI:
        default:
                return BOOT_DEVICE_SPI;