arm: mvebu: spl: Allow to build SATA kwbimage for 4K Native disks
authorPali Rohár <pali@kernel.org>
Wed, 29 Mar 2023 19:25:58 +0000 (21:25 +0200)
committerStefan Roese <sr@denx.de>
Thu, 13 Apr 2023 09:34:47 +0000 (11:34 +0200)
Add a new config option CONFIG_MVEBU_SPL_SATA_BLKSZ for specifying block
size of SATA disk. This information is used during building of SATA
kwbimage and must be correctly set, otherwise BootROM does not load SPL.

For 4K Native disks CONFIG_MVEBU_SPL_SATA_BLKSZ must be set to 4096.

Signed-off-by: Pali Rohár <pali@kernel.org>
Tested-by: Martin Rowe <martin.p.rowe@gmail.com>
arch/arm/mach-mvebu/Kconfig
arch/arm/mach-mvebu/Makefile
arch/arm/mach-mvebu/kwbimage.cfg.in

index b1f2e97..ac484c7 100644 (file)
@@ -381,6 +381,16 @@ config MVEBU_SPL_NAND_BADBLK_LOCATION
          Value 0x0 = SLC flash = BBI at page 0 or page 1
          Value 0x1 = MLC flash = BBI at last page in the block
 
+config MVEBU_SPL_SATA_BLKSZ
+       int "SATA block size"
+       depends on MVEBU_SPL_BOOT_DEVICE_SATA
+       range 512 32768
+       default 512
+       help
+         Block size of the SATA disk in bytes.
+         Typically 512 bytes for majority of disks
+         and 4096 bytes for 4K Native disks.
+
 config MVEBU_EFUSE
        bool "Enable eFuse support"
        depends on HAVE_MVEBU_EFUSE
index 90f8833..0584ed2 100644 (file)
@@ -73,6 +73,11 @@ KWB_CFG_NAND_BLKSZ = $(CONFIG_SYS_NAND_BLOCK_SIZE)
 KWB_CFG_NAND_BADBLK_LOCATION = $(CONFIG_MVEBU_SPL_NAND_BADBLK_LOCATION)
 endif
 
+ifneq ($(CONFIG_MVEBU_SPL_BOOT_DEVICE_SATA),)
+KWB_REPLACE += SATA_BLKSZ
+KWB_CFG_SATA_BLKSZ = $(CONFIG_MVEBU_SPL_SATA_BLKSZ)
+endif
+
 ifneq ($(CONFIG_SECURED_MODE_IMAGE),)
 KWB_REPLACE += CSK_INDEX
 KWB_CFG_CSK_INDEX = $(CONFIG_SECURED_MODE_CSK_INDEX)
index 90cf00c..588c259 100644 (file)
@@ -16,6 +16,9 @@ VERSION               1
 #@NAND_BLKSZ
 #@NAND_BADBLK_LOCATION
 
+# SATA configuration
+#@SATA_BLKSZ
+
 # Enable BootROM output via DEBUG flag on SoCs which require it
 #@DEBUG