Add a config fragment that builds SPL for booting the Genio 520 and 720
EVKs from UFS. It sets the BootROM image header to UFS and makes SPL
load the firmware FIT from the bootloaders partition (partition 1) on
the main UFS LUN, which holds the GPT and is SCSI device 2.

Disable MMC in SPL, since SPL would otherwise pick MMC as its boot
device. This also keeps SPL small.

Use the fragment together with the board defconfig, for example:

  make mt8391_genio_720_evk_defconfig mt8189-genio-spl-ufs.config

Signed-off-by: David Lechner <[email protected]>
---
 board/mediatek/MAINTAINERS                 |  1 +
 board/mediatek/mt8189-genio-spl-ufs.config | 10 ++++++++++
 2 files changed, 11 insertions(+)

diff --git a/board/mediatek/MAINTAINERS b/board/mediatek/MAINTAINERS
index fa8a3ca086c..601e1c5c89a 100644
--- a/board/mediatek/MAINTAINERS
+++ b/board/mediatek/MAINTAINERS
@@ -6,6 +6,7 @@ F:      arch/arm/dts/mt8371-genio-*
 F:     arch/arm/dts/mt8391-genio-*
 F:     arch/arm/dts/mtk-genio-*-binman-u-boot.dtsi
 F:     arch/arm/dts/mtk-genio-binman-u-boot.dtsi
+F:     board/mediatek/mt8189-genio-spl-ufs.config
 F:     configs/mt8189.config
 F:     configs/mt8371_genio_*
 F:     configs/mt8391_genio_*
diff --git a/board/mediatek/mt8189-genio-spl-ufs.config 
b/board/mediatek/mt8189-genio-spl-ufs.config
new file mode 100644
index 00000000000..884b9b97a44
--- /dev/null
+++ b/board/mediatek/mt8189-genio-spl-ufs.config
@@ -0,0 +1,10 @@
+# Boot the Genio 520 and 720 EVKs from UFS instead of eMMC when using SPL.
+# Use with the board defconfig and the -ufs devicetree, for example:
+#   make mt8391_genio_720_evk_defconfig mt8189-genio-spl-ufs.config
+#   make DEVICE_TREE=mt8391-genio-720-evk-ufs
+CONFIG_SPL_UFS=y
+CONFIG_SPL_UFS_RAW_U_BOOT_DEVNUM=2
+CONFIG_SPL_UFS_RAW_U_BOOT_USE_PARTITION=y
+CONFIG_SPL_UFS_RAW_U_BOOT_PARTITION_NUM=1
+# CONFIG_SPL_MMC is not set
+CONFIG_MTK_BROM_HEADER_INFO="media=ufs;arm64=1"

-- 
2.53.0

Reply via email to