Skip to contentSkip to conversation

arm: mvebu: clearfog: support boot from SATA disk

PATCH New Baruch Siach 3 participants 16 messages May 16, 2019 – Jul 11, 2019

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

cover arm: mvebu: clearfog: support boot from SATA disk

This series enables support for boot from SATA on the SolidRun Clearfog platform.

Patches 1-3 are preparations for the addition of loading U-Boot main image from raw SATA device. They make spl sata code independent of board macros and specific kconfig symbols.

Patch 4 adds to SPL generic support for loading U-Boot from a raw SATA device. This code is modeled after the similar support for MMC devices.

Patches 5-6 are mvebu specific. Patch 5 fixes SATA access from SPL. Patch 6 adds the SATA boot option at the SoC level.

Patches 7-9 are the board specific update that enable SATA boot in Clearfog, and document the offset setting requirement.

Baruch Siach (9):
spl: sata: add default partition and image name
spl: sata: fix build with DM_SCSI
spl: sata: don't force FS_FAT support
spl: sata: support U-Boot load from raw sata disk
arm: mvebu: fix ahci mbus config in SPL
arm: mvebu: add support for boot from SATA
arm: mvebu: clearfog: enable SATA in SPL
arm: mvebu: clearfog: set U-Boot offset for SATA boot
arm: mvebu: clearfog: document boot from SATA

 arch/arm/dts/armada-388-clearfog-u-boot.dtsi |  8 ++++
 arch/arm/mach-mvebu/Kconfig                  |  5 ++
 arch/arm/mach-mvebu/Makefile                 |  3 ++
 arch/arm/mach-mvebu/cpu.c                    |  4 ++
 arch/arm/mach-mvebu/include/mach/soc.h       |  2 +
 arch/arm/mach-mvebu/spl.c                    |  5 ++
 board/solidrun/clearfog/README               |  6 +++
 common/spl/Kconfig                           | 14 ++++++
 common/spl/spl_sata.c                        | 49 ++++++++++++++++++--
 include/configs/clearfog.h                   |  2 +-
 10 files changed, 94 insertions(+), 4 deletions(-)
Signature · 1 line
2.20.1
#1 lore raw

PATCH 1/9 spl: sata: add default partition and image name

Add sensible defaults for the FAT partition selection and the main U-Boot image file name. This allows spl_sata to build when the board headers does not select them explicitly.

---
 common/spl/spl_sata.c | 8 ++++++++
 1 file changed, 8 insertions(+)
common/spl/spl_sata.c +8 -0
index adfce1d527f6..b08efc841903 100644
@@ -17,6 +17,14 @@
 #include <fat.h>
 #include <image.h>
 
+#ifndef CONFIG_SYS_SATA_FAT_BOOT_PARTITION
+#define CONFIG_SYS_SATA_FAT_BOOT_PARTITION	1
+#endif
+
+#ifndef CONFIG_SPL_FS_LOAD_PAYLOAD_NAME
+#define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME	"u-boot.img"
+#endif
+
 static int spl_sata_load_image(struct spl_image_info *spl_image,
 			       struct spl_boot_device *bootdev)
 {
Signature · 1 line
2.20.1
#2 lore raw

PATCH 2/9 spl: sata: fix build with DM_SCSI

In reply to Baruch Siach

The init_sata() routine is only present when DM_SCSI is not enabled. Don't call init_sata() when DM_SCSI is enabled. The code will fall back to scsi_scan() in this case.

---
 common/spl/spl_sata.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
common/spl/spl_sata.c +3 -1
index b08efc841903..2fb46108a512 100644
@@ -28,10 +28,12 @@
 static int spl_sata_load_image(struct spl_image_info *spl_image,
 			       struct spl_boot_device *bootdev)
 {
-	int err;
+	int err = 0;
 	struct blk_desc *stor_dev;
 
+#if !defined(CONFIG_DM_SCSI) && !defined(CONFIG_AHCI)
 	err = init_sata(CONFIG_SPL_SATA_BOOT_DEVICE);
+#endif
 	if (err) {
 #ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
 		printf("spl: sata init failed: err - %d\n", err);
Signature · 1 line
2.20.1
#3 lore raw

PATCH 3/9 spl: sata: don't force FS_FAT support

In reply to Baruch Siach

Allow the code to build when FS_FAT is not enabled, and thus spl_load_image_fat() is not provided.

A subsequent patch should add alternative raw access U-Boot main image load method.

---
 common/spl/spl_sata.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
common/spl/spl_sata.c +6 -2
index 2fb46108a512..f0af9f38d19f 100644
@@ -53,9 +53,13 @@ static int spl_sata_load_image(struct spl_image_info *spl_image,
 				  CONFIG_SYS_SATA_FAT_BOOT_PARTITION))
 #endif
 	{
-		err = spl_load_image_fat(spl_image, stor_dev,
+		err = -ENOSYS;
+
+		if (IS_ENABLED(CONFIG_SPL_FS_FAT)) {
+			err = spl_load_image_fat(spl_image, stor_dev,
 					CONFIG_SYS_SATA_FAT_BOOT_PARTITION,
-				CONFIG_SPL_FS_LOAD_PAYLOAD_NAME);
+					CONFIG_SPL_FS_LOAD_PAYLOAD_NAME);
+		}
 	}
 	if (err) {
 		puts("Error loading sata device\n");
Signature · 1 line
2.20.1
#4 lore raw

PATCH 4/9 spl: sata: support U-Boot load from raw sata disk

In reply to Baruch Siach

Support load of the U-Boot image from raw SATA disk sector. This is equivalent to load from MMC raw sector.

---
 common/spl/Kconfig    | 14 ++++++++++++++
 common/spl/spl_sata.c | 29 +++++++++++++++++++++++++++++
 2 files changed, 43 insertions(+)
common/spl/Kconfig +14 -0
index c7cd34449a52..a90c6adbf68b 100644
@@ -733,6 +733,20 @@ config SPL_SATA_SUPPORT
 	  expense and power consumption. This enables loading from SATA
 	  using a configured device.
 
+config SPL_SATA_RAW_U_BOOT_USE_SECTOR
+	bool "SATA raw mode: by sector"
+	depends on SPL_SATA_SUPPORT
+	help
+	  Use sector number for specifying U-Boot location on SATA disk in
+	  raw mode.
+
+config SPL_SATA_RAW_U_BOOT_SECTOR
+	hex "Sector on the SATA disk to load U-Boot from"
+	depends on SPL_SATA_RAW_U_BOOT_USE_SECTOR
+	help
+	  Sector on the SATA disk to load U-Boot from, when the SATA disk is being
+	  used in raw mode. Units: SATA disk sectors (1 sector = 512 bytes).
+
 config SPL_SERIAL_SUPPORT
 	bool "Support serial"
 	select SPL_PRINTF
common/spl/spl_sata.c +29 -0
index f0af9f38d19f..3ad8a5a58035 100644
@@ -25,6 +25,32 @@
 #define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME	"u-boot.img"
 #endif
 
+static int spl_sata_load_image_raw(struct spl_image_info *spl_image,
+		struct blk_desc *stor_dev, unsigned long sector)
+{
+	struct image_header *header;
+	unsigned long count;
+	u32 image_size_sectors;
+	int ret;
+
+	header = spl_get_load_buffer(-sizeof(*header), stor_dev->blksz);
+	count = blk_dread(stor_dev, sector, 1, header);
+	if (count == 0)
+		return -EIO;
+
+	ret = spl_parse_image_header(spl_image, header);
+	if (ret)
+		return ret;
+
+	image_size_sectors = DIV_ROUND_UP(spl_image->size, stor_dev->blksz);
+	count = blk_dread(stor_dev, sector, image_size_sectors,
+			(void *)spl_image->load_addr);
+	if (count != image_size_sectors)
+		return -EIO;
+
+	return 0;
+}
+
 static int spl_sata_load_image(struct spl_image_info *spl_image,
 			       struct spl_boot_device *bootdev)
 {
@@ -59,6 +85,9 @@ static int spl_sata_load_image(struct spl_image_info *spl_image,
 			err = spl_load_image_fat(spl_image, stor_dev,
 					CONFIG_SYS_SATA_FAT_BOOT_PARTITION,
 					CONFIG_SPL_FS_LOAD_PAYLOAD_NAME);
+		} else if (IS_ENABLED(CONFIG_SPL_SATA_RAW_U_BOOT_USE_SECTOR)) {
+			err = spl_sata_load_image_raw(spl_image, stor_dev,
+				CONFIG_SPL_SATA_RAW_U_BOOT_SECTOR);
 		}
 	}
 	if (err) {
Signature · 1 line
2.20.1
#5 lore raw

PATCH 4/9 spl: sata: support U-Boot load from raw sata disk

Hi Baruch,

Quoted 4 lines · Baruch Siach

Support load of the U-Boot image from raw SATA disk sector. This is equivalent to load from MMC raw sector.

This patch breaks cm_t54:

$ ./tools/buildman/buildman cm_t54
Building current source for 1 boards (1 thread, 16 jobs per thread)
        arm:  +   cm_t54
+common/spl/spl_sata.c: In function ?spl_sata_load_image?:
+common/spl/spl_sata.c:90:5: error: ?CONFIG_SPL_SATA_RAW_U_BOOT_SECTOR? undeclared (first use in this function); did you mean ?CONFIG_SPL_SATA_BOOT_DEVICE??
+     CONFIG_SPL_SATA_RAW_U_BOOT_SECTOR);
+     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+     CONFIG_SPL_SATA_BOOT_DEVICE
+common/spl/spl_sata.c:90:5: note: each undeclared identifier is reported only once for each function it appears in
+make[3]: *** [scripts/Makefile.build:278: spl/common/spl/spl_sata.o] Error 1
+make[2]: *** [scripts/Makefile.spl:410: spl/common/spl] Error 2
+make[1]: *** [Makefile:1727: spl/u-boot-spl] Error 2
+make: *** [Makefile:148: sub-make] Error 2
     0    0    1 /1      cm_t54

I'm dropping this one from the upcoming pull request. Please re-send it, once you've fixed it. And please compile test it for all targets (Travis).

Thanks,
Stefan

Quoted 69 lines
---
  common/spl/Kconfig    | 14 ++++++++++++++
  common/spl/spl_sata.c | 29 +++++++++++++++++++++++++++++
  2 files changed, 43 insertions(+)
common/spl/Kconfig +14 -0
index c7cd34449a52..a90c6adbf68b 100644
@@ -733,6 +733,20 @@ config SPL_SATA_SUPPORT
  	  expense and power consumption. This enables loading from SATA
  	  using a configured device.
 
+config SPL_SATA_RAW_U_BOOT_USE_SECTOR
+	bool "SATA raw mode: by sector"
+	depends on SPL_SATA_SUPPORT
+	help
+	  Use sector number for specifying U-Boot location on SATA disk in
+	  raw mode.
+
+config SPL_SATA_RAW_U_BOOT_SECTOR
+	hex "Sector on the SATA disk to load U-Boot from"
+	depends on SPL_SATA_RAW_U_BOOT_USE_SECTOR
+	help
+	  Sector on the SATA disk to load U-Boot from, when the SATA disk is being
+	  used in raw mode. Units: SATA disk sectors (1 sector = 512 bytes).
+
  config SPL_SERIAL_SUPPORT
  	bool "Support serial"
  	select SPL_PRINTF
common/spl/spl_sata.c +26 -0
index f0af9f38d19f..3ad8a5a58035 100644
@@ -25,6 +25,32 @@
  #define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME	"u-boot.img"
  #endif
 
+static int spl_sata_load_image_raw(struct spl_image_info *spl_image,
+		struct blk_desc *stor_dev, unsigned long sector)
+{
+	struct image_header *header;
+	unsigned long count;
+	u32 image_size_sectors;
+	int ret;
+
+	header = spl_get_load_buffer(-sizeof(*header), stor_dev->blksz);
+	count = blk_dread(stor_dev, sector, 1, header);
+	if (count == 0)
+		return -EIO;
+
+	ret = spl_parse_image_header(spl_image, header);
+	if (ret)
+		return ret;
+
+	image_size_sectors = DIV_ROUND_UP(spl_image->size, stor_dev->blksz);
+	count = blk_dread(stor_dev, sector, image_size_sectors,
+			(void *)spl_image->load_addr);
+	if (count != image_size_sectors)
+		return -EIO;
+
+	return 0;
+}
+
  static int spl_sata_load_image(struct spl_image_info *spl_image,
  			       struct spl_boot_device *bootdev)
  {

common/spl/spl_sata.c static int spl_sata_load_image(struct spl_image_info *spl_image, · line 93

Quoted 9 lines
common/spl/spl_sata.c +3 -0
@@ -59,6 +85,9 @@ static int spl_sata_load_image(struct spl_image_info *spl_image,
  			err = spl_load_image_fat(spl_image, stor_dev,
  					CONFIG_SYS_SATA_FAT_BOOT_PARTITION,
  					CONFIG_SPL_FS_LOAD_PAYLOAD_NAME);
+		} else if (IS_ENABLED(CONFIG_SPL_SATA_RAW_U_BOOT_USE_SECTOR)) {
+			err = spl_sata_load_image_raw(spl_image, stor_dev,
+				CONFIG_SPL_SATA_RAW_U_BOOT_SECTOR);
  		}
  	}
  	if (err) {

Viele Grüße,
Stefan

Signature · 3 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr at denx.de
#6 lore raw

PATCH 5/9 arm: mvebu: fix ahci mbus config in SPL

In reply to Baruch Siach

SPL does not initialize mbus_dram_info. Don't change the ahci mbus settings of the ROM. This allows the ahci to work in SPL.

---
 arch/arm/mach-mvebu/cpu.c | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm/mach-mvebu/cpu.c +4 -0
index f09e7b10e935..f4b7a4fa8010 100644
@@ -542,6 +542,10 @@ static void ahci_mvebu_mbus_config(void __iomem *base)
 	const struct mbus_dram_target_info *dram;
 	int i;
 
+	/* mbus is not initialized in SPL; keep the ROM settings */
+	if (IS_ENABLED(CONFIG_SPL_BUILD))
+		return;
+
 	dram = mvebu_mbus_dram_info();
 
 	for (i = 0; i < 4; i++) {
Signature · 1 line
2.20.1
#7 lore raw

PATCH 5/9 arm: mvebu: fix ahci mbus config in SPL

Quoted 5 lines · Baruch Siach

SPL does not initialize mbus_dram_info. Don't change the ahci mbus settings of the ROM. This allows the ahci to work in SPL.

Quoted 26 lines
---
 arch/arm/mach-mvebu/cpu.c | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm/mach-mvebu/cpu.c +4 -1
index f09e7b10e935..f4b7a4fa8010 100644
@@ -542,6 +542,10 @@ static void ahci_mvebu_mbus_config(void __iomem *base)
        const struct mbus_dram_target_info *dram;
        int i;
 
+       /* mbus is not initialized in SPL; keep the ROM settings */
+       if (IS_ENABLED(CONFIG_SPL_BUILD))
+               return;
+
        dram = mvebu_mbus_dram_info();
 
        for (i = 0; i < 4; i++) {
--

2.20.1

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
https://lists.denx.de/listinfo/u-boot

#8 lore raw

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

In reply to 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 · 1 line
2.20.1
#9 lore raw

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

Quoted 5 lines · Baruch Siach

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

Quoted 74 lines
---
 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 -1
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;
--

2.20.1

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
https://lists.denx.de/listinfo/u-boot

#10 lore raw

PATCH 7/9 arm: mvebu: clearfog: enable SATA in SPL

In reply to Baruch Siach

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
#11 lore raw

PATCH 7/9 arm: mvebu: clearfog: enable SATA in SPL

Quoted 4 lines · Baruch Siach

Enable SATA peripherals in SPL to allow boot from SATA.

Quoted 27 lines
---
 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 -1
index a12694e17103..cf6c08881b18 100644
@@ -11,3 +11,11 @@
 &sdhci {
        u-boot,dm-spl;
 };
+
+&ahci0 {
+       u-boot,dm-spl;
+};
+
+&ahci1 {
+       u-boot,dm-spl;
+};
--

2.20.1

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
https://lists.denx.de/listinfo/u-boot

#12 lore raw

PATCH 8/9 arm: mvebu: clearfog: set U-Boot offset for SATA boot

In reply to Baruch Siach

See the offset of U-Boot in raw SATA disk to the same value as the MMC offset. That is 0x140 sectors from the beginning of the SPL, which is 0x141 sectors from the beginning of the device (after the MBR sector).

---
 include/configs/clearfog.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/configs/clearfog.h +1 -1
index 4198ff051177..15c402b542e9 100644
@@ -85,7 +85,7 @@
 /* SPL related SPI defines */
 #define CONFIG_SYS_SPI_U_BOOT_OFFS	0x20000
 #define CONFIG_SYS_U_BOOT_OFFS		CONFIG_SYS_SPI_U_BOOT_OFFS
-#elif defined(CONFIG_MVEBU_SPL_BOOT_DEVICE_MMC)
+#elif defined(CONFIG_MVEBU_SPL_BOOT_DEVICE_MMC) || defined(CONFIG_MVEBU_SPL_BOOT_DEVICE_SATA)
 /* SPL related MMC defines */
 #define CONFIG_SYS_MMC_U_BOOT_OFFS		(160 << 10)
 #define CONFIG_SYS_U_BOOT_OFFS			CONFIG_SYS_MMC_U_BOOT_OFFS
Signature · 1 line
2.20.1
#13 lore raw

PATCH 8/9 arm: mvebu: clearfog: set U-Boot offset for SATA boot

Quoted 2 lines · Baruch Siach

See the offset of U-Boot in raw SATA disk to the same value as the MMC

s/See/Set/

Quoted 4 lines

offset. That is 0x140 sectors from the beginning of the SPL, which is 0x141 sectors from the beginning of the device (after the MBR sector).

With the typo fix above

Quoted 24 lines
---
 include/configs/clearfog.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/configs/clearfog.h +1 -2
index 4198ff051177..15c402b542e9 100644
@@ -85,7 +85,7 @@
 /* SPL related SPI defines */
 #define CONFIG_SYS_SPI_U_BOOT_OFFS     0x20000
 #define CONFIG_SYS_U_BOOT_OFFS         CONFIG_SYS_SPI_U_BOOT_OFFS
-#elif defined(CONFIG_MVEBU_SPL_BOOT_DEVICE_MMC)
+#elif defined(CONFIG_MVEBU_SPL_BOOT_DEVICE_MMC) || defined(CONFIG_MVEBU_SPL_BOOT_DEVICE_SATA)
 /* SPL related MMC defines */
 #define CONFIG_SYS_MMC_U_BOOT_OFFS             (160 << 10)
 #define CONFIG_SYS_U_BOOT_OFFS                 CONFIG_SYS_MMC_U_BOOT_OFFS
--

2.20.1

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
https://lists.denx.de/listinfo/u-boot

#14 lore raw

PATCH 9/9 arm: mvebu: clearfog: document boot from SATA

In reply to Baruch Siach

Document the main U-Boot image offset when booting from SATA disk on the Clearfog board.

---
 board/solidrun/clearfog/README | 6 ++++++
 1 file changed, 6 insertions(+)
board/solidrun/clearfog/README +6 -0
index 0b0e98de90a0..6171ce66f4f8 100644
@@ -40,6 +40,12 @@ Install U-Boot on eMMC boot partition from Linux running on Clearfog:
 Note that the SD card is not accessible when the Clearfog SOM has eMMC.
 Consider initial boot from UART (see below).
 
+Install U-Boot on SATA:
+-----------------------
+
+When loading the main U-Boot image from raw SATA sector, set
+CONFIG_SPL_SATA_RAW_U_BOOT_SECTOR to 0x141.
+
 Boot selection:
 ---------------
 
Signature · 1 line
2.20.1
#15 lore raw

PATCH 9/9 arm: mvebu: clearfog: document boot from SATA

Quoted 5 lines · Baruch Siach

Document the main U-Boot image offset when booting from SATA disk on the Clearfog board.

Quoted 28 lines
---
 board/solidrun/clearfog/README | 6 ++++++
 1 file changed, 6 insertions(+)
board/solidrun/clearfog/README +6 -1
index 0b0e98de90a0..6171ce66f4f8 100644
@@ -40,6 +40,12 @@ Install U-Boot on eMMC boot partition from Linux running on Clearfog:
 Note that the SD card is not accessible when the Clearfog SOM has eMMC.
 Consider initial boot from UART (see below).
 
+Install U-Boot on SATA:
+-----------------------
+
+When loading the main U-Boot image from raw SATA sector, set
+CONFIG_SPL_SATA_RAW_U_BOOT_SECTOR to 0x141.
+
 Boot selection:
 ---------------
 
--

2.20.1

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
https://lists.denx.de/listinfo/u-boot