public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: "Pali Rohár" <pali@kernel.org>
To: Martin Rowe <martin.p.rowe@gmail.com>,
	Tony Dinh <mibodhi@gmail.com>, Stefan Roese <sr@denx.de>,
	Chris Packham <judge.packham@gmail.com>,
	Baruch Siach <baruch@tkos.co.il>
Cc: u-boot@lists.denx.de
Subject: [PATCH u-boot-mvebu 7/7] arm: mvebu: spl: Allow to build SATA kwbimage for 4K Native disks
Date: Wed, 29 Mar 2023 21:25:58 +0200	[thread overview]
Message-ID: <20230329192558.12417-8-pali@kernel.org> (raw)
In-Reply-To: <20230329192558.12417-1-pali@kernel.org>

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>
---
 arch/arm/mach-mvebu/Kconfig         | 10 ++++++++++
 arch/arm/mach-mvebu/Makefile        |  5 +++++
 arch/arm/mach-mvebu/kwbimage.cfg.in |  3 +++
 3 files changed, 18 insertions(+)

diff --git a/arch/arm/mach-mvebu/Kconfig b/arch/arm/mach-mvebu/Kconfig
index 1f0dbef1c68a..e6e911f8af7d 100644
--- a/arch/arm/mach-mvebu/Kconfig
+++ b/arch/arm/mach-mvebu/Kconfig
@@ -380,6 +380,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
diff --git a/arch/arm/mach-mvebu/Makefile b/arch/arm/mach-mvebu/Makefile
index 90f88337bc10..0584ed2be5b4 100644
--- a/arch/arm/mach-mvebu/Makefile
+++ b/arch/arm/mach-mvebu/Makefile
@@ -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)
diff --git a/arch/arm/mach-mvebu/kwbimage.cfg.in b/arch/arm/mach-mvebu/kwbimage.cfg.in
index 90cf00c5b984..588c259202bb 100644
--- a/arch/arm/mach-mvebu/kwbimage.cfg.in
+++ b/arch/arm/mach-mvebu/kwbimage.cfg.in
@@ -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
 
-- 
2.20.1


  parent reply	other threads:[~2023-03-29 19:29 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-29 19:25 [PATCH u-boot-mvebu 0/7] arm: mvebu: Boot support for 4K Native disks Pali Rohár
2023-03-29 19:25 ` [PATCH u-boot-mvebu 1/7] arm: mvebu: spl: Do not hardcode SATA block size to 512 Pali Rohár
2023-03-29 19:25 ` [PATCH u-boot-mvebu 2/7] cmd: mvebu/bubt: a38x: " Pali Rohár
2023-04-11 12:33   ` Stefan Roese
2023-04-11 18:35     ` Pali Rohár
2023-04-11 18:35   ` [PATCH v2 u-boot-mvebu] " Pali Rohár
2023-03-29 19:25 ` [PATCH u-boot-mvebu 3/7] tools: imagetool: Extend print_header() by params argument Pali Rohár
2023-03-30  9:17   ` Simon Glass
2023-03-29 19:25 ` [PATCH u-boot-mvebu 4/7] tools: kwbimage: Simplify align code Pali Rohár
2023-03-29 19:25 ` [PATCH u-boot-mvebu 5/7] tools: kwbimage: Add support for SATA images with non-512 byte block size Pali Rohár
2023-03-29 19:25 ` [PATCH u-boot-mvebu 6/7] tools: kwboot: Add support for parsing SATA images with non-512 " Pali Rohár
2023-03-29 19:25 ` Pali Rohár [this message]
2023-03-30 10:31   ` [PATCH u-boot-mvebu 7/7] arm: mvebu: spl: Allow to build SATA kwbimage for 4K Native disks Martin Rowe
2023-03-30 20:26 ` [PATCH u-boot-mvebu 0/7] arm: mvebu: Boot support " Tony Dinh
2023-04-14  6:06 ` Stefan Roese

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230329192558.12417-8-pali@kernel.org \
    --to=pali@kernel.org \
    --cc=baruch@tkos.co.il \
    --cc=judge.packham@gmail.com \
    --cc=martin.p.rowe@gmail.com \
    --cc=mibodhi@gmail.com \
    --cc=sr@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox