Skip to contentSkip to conversation

ARM: mvebu: add support for boot from SATA

PATCH New Baruch Siach 1 participant 3 messages May 16, 2019 1 message not in the archive

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

PATCH 6/9 ARM: mvebu: add support for boot from SATA

In reply to a message not in the archive

Add the required Kconfig and macro definitions to allow boot from SATA on Armada 38x systems.

---
 arch/arm/mach-mvebu/Kconfig            | 5 +++++
 arch/arm/mach-mvebu/Makefile           | 3 +++
 arch/arm/mach-mvebu/include/mach/soc.h | 2 ++
 arch/arm/mach-mvebu/spl.c              | 5 +++++
 4 files changed, 15 insertions(+)
arch/arm/mach-mvebu/Kconfig +5 -0
index 495c48e6c749..fdd39685b75d 100644
@@ -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"
 
arch/arm/mach-mvebu/Makefile +3 -0
index 02d3ce27ee74..8228a17972f9 100644
@@ -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
arch/arm/mach-mvebu/include/mach/soc.h +2 -0
index f666ee24243b..acb9257c90fe 100644
@@ -159,7 +159,9 @@
 #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
arch/arm/mach-mvebu/spl.c +5 -0
index 530b98c1aa31..d54de5195624 100644
@@ -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;
Signature · 1 line
2.20.1
#3 lore raw

PATCH 7/9 ARM: dts: clearfog: enable SATA in SPL

In reply to a message not in the archive

Enable SATA peripherals in SPL to allow boot from SATA.

---
 arch/arm/dts/armada-388-clearfog-u-boot.dtsi | 8 ++++++++
 1 file changed, 8 insertions(+)
arch/arm/dts/armada-388-clearfog-u-boot.dtsi +8 -0
index a12694e17103..cf6c08881b18 100644
@@ -11,3 +11,11 @@
 &sdhci {
 	u-boot,dm-spl;
 };
+
+&ahci0 {
+	u-boot,dm-spl;
+};
+
+&ahci1 {
+	u-boot,dm-spl;
+};
Signature · 1 line
2.20.1
#2 lore raw

PATCH 6/9 ARM: mvebu: add support for boot from SATA

In reply to Baruch Siach

Hi u-boot list, Stefan,

Please ignore this patch and the next. The patch series starts at the 0/9 cover letter.

Sorry for the spam.

baruch

Quoted 71 lines · Baruch Siach

Add the required Kconfig and macro definitions to allow boot from SATA on Armada 38x systems.

---
 arch/arm/mach-mvebu/Kconfig            | 5 +++++
 arch/arm/mach-mvebu/Makefile           | 3 +++
 arch/arm/mach-mvebu/include/mach/soc.h | 2 ++
 arch/arm/mach-mvebu/spl.c              | 5 +++++
 4 files changed, 15 insertions(+)
arch/arm/mach-mvebu/Kconfig +5 -0
index 495c48e6c749..fdd39685b75d 100644
@@ -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"
 
arch/arm/mach-mvebu/Makefile +3 -0
index 02d3ce27ee74..8228a17972f9 100644
@@ -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
arch/arm/mach-mvebu/include/mach/soc.h +2 -0
index f666ee24243b..acb9257c90fe 100644
@@ -159,7 +159,9 @@
 #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
arch/arm/mach-mvebu/spl.c +5 -0
index 530b98c1aa31..d54de5195624 100644
@@ -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;
Signature · 3 lines
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -