Skip to contentSkip to conversation

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

PATCH In review Aswath Govindraju 2 participants 8 messages Jul 26, 2021 – Jul 29, 2021

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

v2 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=255259

changes since v1:
- rebased the series on top of latest mainline master

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_*_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 v2 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 0e46d70e8425..533905daeb41 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 v2 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 v2 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 6fab1deeb270..1effb3a3b318 100644
@@ -81,6 +81,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 v2 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 1effb3a3b318..128a32a9518d 100644
@@ -8,6 +8,7 @@ CONFIG_SOC_K3_AM642=y
 CONFIG_K3_ATF_LOAD_ADDR=0x701c0000
 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_DEFAULT_DEVICE_TREE="k3-am642-evm"
@@ -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_ENV_SUPPORT=y
 CONFIG_SPL_I2C_SUPPORT=y
@@ -56,10 +59,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
@@ -136,4 +139,5 @@ CONFIG_USB_GADGET_VENDOR_NUM=0x0451
 CONFIG_USB_GADGET_PRODUCT_NUM=0x6165
 CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_USB_FUNCTION_MASS_STORAGE=y
+CONFIG_FAT_WRITE=y
 CONFIG_FS_FAT_MAX_CLUSTSIZE=16384
configs/am64x_evm_r5_defconfig +4 -0
index 8ce06274bc78..6d5c39023c4b 100644
@@ -7,11 +7,15 @@ 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
 CONFIG_DEFAULT_DEVICE_TREE="k3-am642-r5-evm"
 CONFIG_SPL_TEXT_BASE=0x70000000
+CONFIG_ENV_IS_IN_MMC=y
+CONFIG_SYS_MMC_ENV_DEV=0
+CONFIG_SYS_MMC_ENV_PART=1
 CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL_DRIVERS_MISC_SUPPORT=y
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 v2 5/6 configs: am64x_evm_*_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 128a32a9518d..34a1390582a9 100644
@@ -88,6 +88,7 @@ CONFIG_DM_MMC=y
 CONFIG_MMC_HS200_SUPPORT=y
 CONFIG_SPL_MMC_HS200_SUPPORT=y
 CONFIG_MMC_HS400_SUPPORT=y
+CONFIG_SUPPORT_EMMC_BOOT=y
 CONFIG_SPL_MMC_HS400_SUPPORT=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_ADMA=y
configs/am64x_evm_r5_defconfig +2 -0
index 6d5c39023c4b..7b6dce03e9bd 100644
@@ -33,6 +33,8 @@ CONFIG_SPL_SIZE_LIMIT_SUBTRACT_GD=y
 CONFIG_SPL_SIZE_LIMIT_SUBTRACT_MALLOC=y
 CONFIG_SPL_SYS_REPORT_STACK_F_USAGE=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_SYS_MALLOC_SIMPLE=y
 CONFIG_SPL_STACK_R=y
 CONFIG_SPL_SEPARATE_BSS=y
Signature · 1 line
2.17.1
#6 lore raw

PATCH v2 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 34a1390582a9..4034cd418f28 100644
@@ -49,6 +49,7 @@ CONFIG_SPL_YMODEM_SUPPORT=y
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_DFU=y
 CONFIG_CMD_DM=y
+CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_USB=y
@@ -141,4 +142,5 @@ CONFIG_USB_GADGET_PRODUCT_NUM=0x6165
 CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_USB_FUNCTION_MASS_STORAGE=y
 CONFIG_FAT_WRITE=y
+CONFIG_OF_LIBFDT_OVERLAY=y
 CONFIG_FS_FAT_MAX_CLUSTSIZE=16384
configs/am64x_evm_r5_defconfig +1 -0
index 7b6dce03e9bd..c58d71c942b8 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_*_defconfig: Enable configs to support eMMC boot
      https://source.denx.de/u-boot/custodians/u-boot-ti/-/commit/da6a7206be
[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