Skip to contentSkip to conversation

AM64: Add support for higher speed modes and boot mode in eMMC

PATCH Superseded Aswath Govindraju 2 participants 8 messages Jun 3, 2021 – Jul 29, 2021

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover AM64: Add support for higher speed modes and boot mode in eMMC

The following series of patches add support for,
- HS200/HS400 speed modes
- eMMC boot mode
- gpt and FDT library overlay

This series of patches,
- dependent on
https://patchwork.ozlabs.org/project/uboot/list/?series=237442

- applies on top of,
https://patchwork.ozlabs.org/project/uboot/list/?series=246976

Aswath Govindraju (4):
arch: arm: mach-k3: am642_init: Correct the function name
spl_boot_mode() to spl_mmc_boot_mode()
arch: dts: am642-sk-u-boot: Disable main_sdhci0 DT node and define
alias index 1 for main_sdhci1 node
configs: am64x_evm: Move CONFIG_SYS_MMC_ENV_DEV and
CONFIG_SYS_MMC_ENV_PART to defconfig files and enable configs to save env in eMMC and FAT write.
configs: am64x_evm_*_defconfig: Enable config to support gpt and FDT
library overlay

Kishon Vijay Abraham I (2):
configs: am64x_evm_a53_defconfig: Enable configs to support

    HS200/HS400

configs: am64x_evm_a53_defconfig/am64x_evm_r5_defconfig: Enable
configs to support eMMC boot

 arch/arm/dts/k3-am642-sk-u-boot.dtsi |  5 +++++
 arch/arm/mach-k3/am642_init.c        |  2 +-
 configs/am64x_evm_a53_defconfig      | 18 +++++++++++++++---
 configs/am64x_evm_r5_defconfig       |  7 +++++++
 include/configs/am64x_evm.h          |  6 ------
 5 files changed, 28 insertions(+), 10 deletions(-)
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/6 arch: arm: mach-k3: am642_init: Correct the function name spl_boot_mode() to spl_mmc_boot_mode()

Function spl_boot_mode() is called in common/spl/spl_mmc.c, to find the boot mode for a given boot device. This function was renamed to spl_mmc_boot_mode() by commit e97590654aea4c964f49bd915543a417d0c76996.

Therefore, rename spl_boot_mode to spl_mmc_boot_mode.

Fixes 57dba04afbb7 ("arm: mach-k3: am642: Add support for boot device detection")
---
 arch/arm/mach-k3/am642_init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-k3/am642_init.c +1 -1
index 579dbacb7e48..8d8b07076a98 100644
@@ -198,7 +198,7 @@ void board_init_f(ulong dummy)
 #endif
 }
 
-u32 spl_boot_mode(const u32 boot_device)
+u32 spl_mmc_boot_mode(const u32 boot_device)
 {
 	switch (boot_device) {
 	case BOOT_DEVICE_MMC1:
Signature · 1 line
2.17.1
#2 lore raw

PATCH 2/6 arch: dts: am642-sk-u-boot: Disable main_sdhci0 DT node and define alias index 1 for main_sdhci1 node

In reply to Aswath Govindraju

A Wilink wireless device is connected to MMCSD0 subsystem and is not supported in U-Boot. Therefore, disable main_sdhci0 device tree node in U-Boot.

If main_sdhci0 device tree node is disabled then the the index of main_sdhci1 node becomes 0 which leads to break in boot flow. Therefore, add an alias to fix the index to 1.

---
 arch/arm/dts/k3-am642-sk-u-boot.dtsi | 5 +++++
 1 file changed, 5 insertions(+)
arch/arm/dts/k3-am642-sk-u-boot.dtsi +5 -0
index 35b49df85106..efbcfb36e92a 100644
@@ -8,6 +8,10 @@
 		stdout-path = "serial2:115200n8";
 		tick-timer = &timer1;
 	};
+
+	aliases {
+		mmc1 = &sdhci1;
+	};
 };
 
 &cbass_main{
@@ -79,6 +83,7 @@
 };
 
 &sdhci0 {
+	status = "disabled";
 	u-boot,dm-spl;
 };
 
Signature · 1 line
2.17.1
#3 lore raw

PATCH 3/6 configs: am64x_evm_a53_defconfig: Enable configs to support HS200/HS400

In reply to Aswath Govindraju

From: Kishon Vijay Abraham I <[email protected]>

Enable configs to support HS200/HS400.

---
 configs/am64x_evm_a53_defconfig | 5 +++++
 1 file changed, 5 insertions(+)
configs/am64x_evm_a53_defconfig +5 -0
index a3aab807c6e7..41eb43f191d6 100644
@@ -73,6 +73,11 @@ CONFIG_DM_I2C=y
 CONFIG_SYS_I2C_OMAP24XX=y
 CONFIG_DM_MAILBOX=y
 CONFIG_K3_SEC_PROXY=y
+CONFIG_DM_MMC=y
+CONFIG_MMC_HS200_SUPPORT=y
+CONFIG_SPL_MMC_HS200_SUPPORT=y
+CONFIG_MMC_HS400_SUPPORT=y
+CONFIG_SPL_MMC_HS400_SUPPORT=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_ADMA=y
 CONFIG_SPL_MMC_SDHCI_ADMA=y
Signature · 1 line
2.17.1
#4 lore raw

PATCH 4/6 configs: am64x_evm: Move CONFIG_SYS_MMC_ENV_DEV and CONFIG_SYS_MMC_ENV_PART to defconfig files and enable configs to save env in eMMC and FAT write.

In reply to Aswath Govindraju

Kconfig symbols for SYS_MMC_ENV_DEV and SYS_MMC_ENV_PART have been added by commit 7d080773347c1f6e0e896d9284134a2a411155d6. Therefore, move the definitions of configs to corresponding board defconfig files and enable configs to save env in eMMC.

Also enable config for FAT write in U-Boot.

Fixes 33b7258947f4 ("board: ti: am64x: Add board support for am64x evm")
---
 configs/am64x_evm_a53_defconfig | 10 +++++++---
 configs/am64x_evm_r5_defconfig  |  4 ++++
 include/configs/am64x_evm.h     |  6 ------
 3 files changed, 11 insertions(+), 9 deletions(-)
configs/am64x_evm_a53_defconfig +7 -3
index 41eb43f191d6..34c527940cb6 100644
@@ -8,6 +8,7 @@ CONFIG_SOC_K3_AM642=y
 CONFIG_K3_ATF_LOAD_ADDR=0x701a0000
 CONFIG_TARGET_AM642_A53_EVM=y
 CONFIG_ENV_SIZE=0x20000
+CONFIG_ENV_OFFSET=0x680000
 CONFIG_SYS_SPI_U_BOOT_OFFS=0x280000
 CONFIG_SPL_DM_SPI=y
 CONFIG_SPL_TEXT_BASE=0x80080000
@@ -29,6 +30,8 @@ CONFIG_BOARD_LATE_INIT=y
 CONFIG_SPL_SYS_MALLOC_SIMPLE=y
 CONFIG_SPL_STACK_R=y
 CONFIG_SPL_SEPARATE_BSS=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x1400
 CONFIG_SPL_DMA=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_ENV_SUPPORT=y
@@ -53,10 +56,10 @@ CONFIG_OF_LIST="k3-am642-evm k3-am642-sk"
 CONFIG_MULTI_DTB_FIT=y
 CONFIG_SPL_MULTI_DTB_FIT=y
 CONFIG_SPL_MULTI_DTB_FIT_NO_COMPRESSION=y
-CONFIG_ENV_IS_NOWHERE=y
-CONFIG_ENV_IS_IN_FAT=y
-CONFIG_ENV_FAT_DEVICE_AND_PART="1:1"
 CONFIG_NET_RANDOM_ETHADDR=y
+CONFIG_ENV_IS_IN_MMC=y
+CONFIG_SYS_MMC_ENV_DEV=0
+CONFIG_SYS_MMC_ENV_PART=1
 CONFIG_DM=y
 CONFIG_SPL_DM=y
 CONFIG_SPL_DM_SEQ_ALIAS=y
@@ -147,3 +150,4 @@ CONFIG_USB_GADGET_VBUS_DRAW=2
 CONFIG_USB_GADGET_DUALSPEED=y
 CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_USB_FUNCTION_MASS_STORAGE=y
+CONFIG_FAT_WRITE=y
configs/am64x_evm_r5_defconfig +4 -0
index 3e9b5650c60d..57e0399ea0fa 100644
@@ -7,6 +7,7 @@ CONFIG_SYS_MALLOC_F_LEN=0x80000
 CONFIG_SOC_K3_AM642=y
 CONFIG_TARGET_AM642_R5_EVM=y
 CONFIG_ENV_SIZE=0x20000
+CONFIG_ENV_OFFSET=0x680000
 CONFIG_SYS_SPI_U_BOOT_OFFS=0x80000
 CONFIG_DM_GPIO=y
 CONFIG_SPL_DM_SPI=y
@@ -22,6 +23,9 @@ CONFIG_SPL_LIBDISK_SUPPORT=y
 CONFIG_SPL_SPI_FLASH_SUPPORT=y
 CONFIG_SPL_SPI_SUPPORT=y
 CONFIG_DEFAULT_DEVICE_TREE="k3-am642-r5-evm"
+CONFIG_ENV_IS_IN_MMC=y
+CONFIG_SYS_MMC_ENV_DEV=0
+CONFIG_SYS_MMC_ENV_PART=1
 CONFIG_SPL_LOAD_FIT=y
 CONFIG_SPL_LOAD_FIT_ADDRESS=0x80080000
 # CONFIG_DISPLAY_CPUINFO is not set
include/configs/am64x_evm.h +0 -6
index c2c2bf06777c..7c520f4395b5 100644
@@ -115,10 +115,4 @@
 
 #define CONFIG_SYS_USB_FAT_BOOT_PARTITION 1
 
-/* MMC ENV related defines */
-#ifdef CONFIG_ENV_IS_IN_MMC
-#define CONFIG_SYS_MMC_ENV_DEV		0
-#define CONFIG_SYS_MMC_ENV_PART	1
-#endif
-
 #endif /* __CONFIG_AM642_EVM_H */
Signature · 1 line
2.17.1
#5 lore raw

PATCH 5/6 configs: am64x_evm_a53_defconfig/am64x_evm_r5_defconfig: Enable configs to support eMMC boot

In reply to Aswath Govindraju

From: Kishon Vijay Abraham I <[email protected]>

Enable configs to support eMMC boot.

---
 configs/am64x_evm_a53_defconfig | 1 +
 configs/am64x_evm_r5_defconfig  | 2 ++
 2 files changed, 3 insertions(+)
configs/am64x_evm_a53_defconfig +1 -0
index 34c527940cb6..edce099f28b2 100644
@@ -81,6 +81,7 @@ CONFIG_MMC_HS200_SUPPORT=y
 CONFIG_SPL_MMC_HS200_SUPPORT=y
 CONFIG_MMC_HS400_SUPPORT=y
 CONFIG_SPL_MMC_HS400_SUPPORT=y
+CONFIG_SUPPORT_EMMC_BOOT=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_ADMA=y
 CONFIG_SPL_MMC_SDHCI_ADMA=y
configs/am64x_evm_r5_defconfig +2 -0
index 57e0399ea0fa..df70852669d4 100644
@@ -37,6 +37,8 @@ CONFIG_SPL_STACK_R=y
 CONFIG_SPL_SEPARATE_BSS=y
 CONFIG_SPL_EARLY_BSS=y
 CONFIG_SPL_BOARD_INIT=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=y
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x400
 CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
 CONFIG_SPL_DM_MAILBOX=y
Signature · 1 line
2.17.1
#6 lore raw

PATCH 6/6 configs: am64x_evm_*_defconfig: Enable config to support gpt and FDT library overlay

In reply to Aswath Govindraju

Enable config to support gpt command on AM642 evm/sk and enable config for FDT library overlay support

---
 configs/am64x_evm_a53_defconfig | 2 ++
 configs/am64x_evm_r5_defconfig  | 1 +
 2 files changed, 3 insertions(+)
configs/am64x_evm_a53_defconfig +2 -0
index edce099f28b2..b19b58f795b0 100644
@@ -120,6 +120,7 @@ CONFIG_OMAP_TIMER=y
 CONFIG_FS_FAT_MAX_CLUSTSIZE=16384
 CONFIG_CMD_DFU=y
 CONFIG_CMD_DM=y
+CONFIG_CMD_GPT=y
 CONFIG_CMD_USB=y
 CONFIG_DFU=y
 CONFIG_DFU_OVER_USB=y
@@ -152,3 +153,4 @@ CONFIG_USB_GADGET_DUALSPEED=y
 CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_USB_FUNCTION_MASS_STORAGE=y
 CONFIG_FAT_WRITE=y
+CONFIG_OF_LIBFDT_OVERLAY=y
configs/am64x_evm_r5_defconfig +1 -0
index df70852669d4..1f04b3683f87 100644
@@ -58,6 +58,7 @@ CONFIG_SPL_YMODEM_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_DFU=y
+CONFIG_CMD_GPT=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_REMOTEPROC=y
 CONFIG_CMD_USB=y
Signature · 1 line
2.17.1
#7 lore raw
In reply to Aswath Govindraju
Quoted 10 lines · Aswath Govindraju

The following series of patches add support for,
- HS200/HS400 speed modes
- eMMC boot mode
- gpt and FDT library overlay

This series of patches,
- dependent on
https://patchwork.ozlabs.org/project/uboot/list/?series=237442

[...]

Applied to https://source.denx.de/u-boot/custodians/u-boot-ti.git for-rc, thanks! [1/6] arch: arm: mach-k3: am642_init: Correct the function name spl_boot_mode() to spl_mmc_boot_mode()

      https://source.denx.de/u-boot/custodians/u-boot-ti/-/commit/2140d6b0ff
[2/6] arch: dts: am642-sk-u-boot: Disable main_sdhci0 DT node and define alias index 1 for main_sdhci1 node
      https://source.denx.de/u-boot/custodians/u-boot-ti/-/commit/0817dd5432
[3/6] configs: am64x_evm_a53_defconfig: Enable configs to support HS200/HS400
      https://source.denx.de/u-boot/custodians/u-boot-ti/-/commit/a3d58069c4
[4/6] configs: am64x_evm: Move CONFIG_SYS_MMC_ENV_DEV and CONFIG_SYS_MMC_ENV_PART to defconfig files and enable configs to save env in eMMC and FAT write.
      https://source.denx.de/u-boot/custodians/u-boot-ti/-/commit/acbda111b2
[5/6] configs: am64x_evm_a53_defconfig/am64x_evm_r5_defconfig: Enable configs to support eMMC boot
      (no commit info)
[6/6] configs: am64x_evm_*_defconfig: Enable config to support gpt and FDT library overlay
      https://source.denx.de/u-boot/custodians/u-boot-ti/-/commit/f572129b13

--
Thanks and Regards,
Lokesh