Skip to contentSkip to conversation

board: ti: Add support for BeagleBone AI-64

PATCH Superseded Nishanth Menon 6 participants 36 messages Nov 3, 2023 – Nov 20, 2023

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover board: ti: Add support for BeagleBone AI-64

Cleanups for J721e/J7200 and add support for BeagleBone AI-64

Based off:
master 07fe79c93c5c Merge tag 'i2cfixes-for-v2024-01-rc2' of https://source.denx.de/u-boot/custodians/u-boot-i2c

Boot Logs:
J721e-SK: https://gist.github.com/nmenon/c144e64f1da9fd49997ef5794b056bb0
J721e-EVM: https://gist.github.com/nmenon/e79bed6807da05c723e71687fb3c0b90
J7200-HSEVM: https://gist.github.com/nmenon/5658dd6fa2f67bce915c77b25c02f897

BeagleBone AI-64:
SD/MMC boot: https://gist.github.com/nmenon/1e07858fb8ca39ca87e40d3894e4d9b7
eMMC boot: https://gist.github.com/nmenon/9b0602df1f1be2c6b512d135b0afae60
eMMC boot with SDcard detected: https://gist.github.com/nmenon/82058014f4b2f6b9ed21431bc675e12a

U-Boot CI: https://github.com/u-boot/u-boot/pull/444

BeagleBone AI-64 is introduced without EEPROM detection and cleanups to j721e evm configuration is done to facilitate that. based on when and timing of [1] is merged in, we can introduce an equivalent patch or squash similar patch in for beagleboneai64.

Boot uses stdboot as default - so we also transition j721e over to sdboot along with it.

Fixes a breakage with HBMC that was getting in my way of testing, but I have'nt focussed on converting j7200 to stdboot - but probably a minor patch similar to that in this series for j721e.

What works:
* emmc, sd, dhcp, basic i2c gpio etc..
* DDR looks stable as well.

TODO:
* PMIC support will need to be added for AVS to be active - something to do once upstream kernel gets that support
* USB boot is broken (or was just noticed) - some sort of regression with serdes is my best guess.
* We could potentially enable something like nvme boot as well if we can make PCIe work

Nishanth Menon (14):
arm: mach-k3: j721e: Improve support for UDA FS
configs: j7200: Remove HBMC_AM654 config
board: ti: j721e: evm: Drop board check for ESM
board: ti: j721e: evm: Drop unused headers
board: ti: j721e: evm: Switch to using IS_ENABLED
board: ti: j721e: evm: Drop board based serdes initialization
board: ti: j721e: evm: Use IS_ENABLED with CONFIG_PHYS_64BIT
board: ti: j721e: evm: Split code to isolate eeprom detected logic
board: ti: j721e: j721e.env: Add explicit boot_targets
configs: j721e_evm_a72_defconfig: Switch to bootstd
arm: dts: k3-j721e-binman: Allow a single board configuration
arm: dts: k3-j721e-binman: Use macros that can be overridden for dtbs
board: ti: Add j721e_beagleboneai64_* config fragments and env file
doc: board: ti: Add BeagleBone AI-64 documentation

Robert Nelson (1):
arm: dts: Add k3-j721e-beagleboneai64

 arch/arm/dts/Makefile                         |    5 +-
 .../dts/k3-j721e-beagleboneai64-u-boot.dtsi   |  206 ++
 arch/arm/dts/k3-j721e-beagleboneai64.dts      |  993 ++++++++
 arch/arm/dts/k3-j721e-binman.dtsi             |   33 +-
 .../k3-j721e-common-proc-board-u-boot.dtsi    |    2 +
 .../k3-j721e-ddr-beagleboneai64-lp4-3200.dtsi | 2200 +++++++++++++++++
 arch/arm/dts/k3-j721e-r5-beagleboneai64.dts   |   96 +
 arch/arm/dts/k3-j721e-sk-u-boot.dtsi          |    2 +
 arch/arm/mach-k3/j721e_init.c                 |    9 +-
 board/ti/j721e/MAINTAINERS                    |    7 +
 board/ti/j721e/Makefile                       |    1 +
 board/ti/j721e/beagleboneai64.env             |   19 +
 board/ti/j721e/beagleboneai64_a72.config      |   55 +
 board/ti/j721e/beagleboneai64_r5.config       |   19 +
 board/ti/j721e/{evm.c => board-variants.c}    |  276 +--
 board/ti/j721e/evm.c                          |  459 +---
 board/ti/j721e/evm.h                          |   24 +
 board/ti/j721e/j721e.env                      |    1 +
 configs/j7200_evm_a72_defconfig               |    1 -
 configs/j7200_evm_r5_defconfig                |    1 -
 configs/j721e_evm_a72_defconfig               |    5 +-
 doc/board/ti/j721e_beagleboneai64.rst         |  327 +++
 doc/board/ti/k3.rst                           |    1 +
 23 files changed, 4083 insertions(+), 659 deletions(-)
 create mode 100644 arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi
 create mode 100644 arch/arm/dts/k3-j721e-beagleboneai64.dts
 create mode 100644 arch/arm/dts/k3-j721e-ddr-beagleboneai64-lp4-3200.dtsi
 create mode 100644 arch/arm/dts/k3-j721e-r5-beagleboneai64.dts
 create mode 100644 board/ti/j721e/beagleboneai64.env
 create mode 100644 board/ti/j721e/beagleboneai64_a72.config
 create mode 100644 board/ti/j721e/beagleboneai64_r5.config
 copy board/ti/j721e/{evm.c => board-variants.c} (63%)
 create mode 100644 board/ti/j721e/evm.h
 create mode 100644 doc/board/ti/j721e_beagleboneai64.rst

[1] https://lore.kernel.org/all/[email protected]/

Signature · 1 line
2.40.0
#1 lore raw

PATCH 1/15 arm: mach-k3: j721e: Improve support for UDA FS

Commit 5019170970ad ("arch: arm: mach-k3: j721e: add support for UDA FS") introduced basic UDA FS support, however, we can Take approach similar to commit 0f1c1e8b368b ("arm: mach-k3: am625: Add support for UDA FS"). While boot partition support with EMMC boot is useful, it is constrained by the size of boot hardware partition itself.

In the case of K3 devices, tispl images can contain OP-TEE images that can substantially vary in size and the u-boot image itself can vary over time as we enable various features.

So use the CSD information in the case of EMMC_BOOT configuration being enabled to pick boot partition or UDA FS mode operation to pick.

If EMMC_BOOT is disabled, then depend on filesystem configuration to pick data from UDA.

---
 arch/arm/mach-k3/j721e_init.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
arch/arm/mach-k3/j721e_init.c +8 -1
index b1f7e25ed092..bcdfbfc79c4a 100644
@@ -294,7 +294,14 @@ u32 spl_mmc_boot_mode(struct mmc *mmc, const u32 boot_device)
 {
 	switch (boot_device) {
 	case BOOT_DEVICE_MMC1:
-		return (spl_mmc_emmc_boot_partition(mmc) ? MMCSD_MODE_EMMCBOOT : MMCSD_MODE_FS);
+		if (IS_ENABLED(CONFIG_SUPPORT_EMMC_BOOT)) {
+			if (spl_mmc_emmc_boot_partition(mmc))
+				return MMCSD_MODE_EMMCBOOT;
+			return MMCSD_MODE_FS;
+		}
+		if (IS_ENABLED(CONFIG_SPL_FS_FAT) || IS_ENABLED(CONFIG_SPL_FS_EXT4))
+			return MMCSD_MODE_FS;
+		return MMCSD_MODE_EMMCBOOT;
 	case BOOT_DEVICE_MMC2:
 		return MMCSD_MODE_FS;
 	default:
Signature · 1 line
2.40.0
#2 lore raw

Re: [PATCH 01/15] arm: mach-k3: j721e: Improve support for UDA FS

Quoted 10 lines · Nishanth Menon

Commit 5019170970ad ("arch: arm: mach-k3: j721e: add support for UDA FS") introduced basic UDA FS support, however, we can Take approach similar to commit 0f1c1e8b368b ("arm: mach-k3: am625: Add support for UDA FS"). While boot partition support with EMMC boot is useful, it is constrained by the size of boot hardware partition itself.

In the case of K3 devices, tispl images can contain OP-TEE images that can substantially vary in size and the u-boot image itself can vary over time as we enable various features.

Quoted 5 lines

So use the CSD information in the case of EMMC_BOOT configuration being enabled to pick boot partition or UDA FS mode operation to pick.

If EMMC_BOOT is disabled, then depend on filesystem configuration to pick data from UDA.

I am thinking, in which case we have EMMC_BOOT disabled,

Case here I am considering, updating u-boot to eMMC from u-boot shell, If EMMC_BOOT

is not set then , we can not set CSD information

Quoted 11 lines
---
  arch/arm/mach-k3/j721e_init.c | 9 ++++++++-
  1 file changed, 8 insertions(+), 1 deletion(-)
arch/arm/mach-k3/j721e_init.c +0 -0
index b1f7e25ed092..bcdfbfc79c4a 100644

arch/arm/mach-k3/j721e_init.c u32 spl_mmc_boot_mode(struct mmc *mmc, const u32 boot_device) · line 301

Quoted 9 lines
arch/arm/mach-k3/j721e_init.c +5 -1
@@ -294,7 +294,14 @@ u32 spl_mmc_boot_mode(struct mmc *mmc, const u32 boot_device)
  {
  	switch (boot_device) {
  	case BOOT_DEVICE_MMC1:
-		return (spl_mmc_emmc_boot_partition(mmc) ? MMCSD_MODE_EMMCBOOT : MMCSD_MODE_FS);
+		if (IS_ENABLED(CONFIG_SUPPORT_EMMC_BOOT)) {
+			if (spl_mmc_emmc_boot_partition(mmc))
+				return MMCSD_MODE_EMMCBOOT;
+			return MMCSD_MODE_FS;
+		}

I had a view EMMC_BOOT should be needed config.

arch/arm/mach-k3/j721e_init.c u32 spl_mmc_boot_mode(struct mmc *mmc, const u32 boot_device) · line 304

Quoted 3 lines
arch/arm/mach-k3/j721e_init.c +3 -0
+		if (IS_ENABLED(CONFIG_SPL_FS_FAT) || IS_ENABLED(CONFIG_SPL_FS_EXT4))
+			return MMCSD_MODE_FS;
+		return MMCSD_MODE_EMMCBOOT;

If you consider, to make EMMC_BOOT as needed config, then this is not needed

Quoted 3 lines
arch/arm/mach-k3/j721e_init.c +0 -0
  	case BOOT_DEVICE_MMC2:
  		return MMCSD_MODE_FS;
  	default:
#3 lore raw

Re: [PATCH 01/15] arm: mach-k3: j721e: Improve support for UDA FS

Quoted 18 lines · Udit
Quoted 10 lines · Nishanth Menon

Commit 5019170970ad ("arch: arm: mach-k3: j721e: add support for UDA FS") introduced basic UDA FS support, however, we can Take approach similar to commit 0f1c1e8b368b ("arm: mach-k3: am625: Add support for UDA FS"). While boot partition support with EMMC boot is useful, it is constrained by the size of boot hardware partition itself.

In the case of K3 devices, tispl images can contain OP-TEE images that can substantially vary in size and the u-boot image itself can vary over time as we enable various features.

Quoted 5 lines

So use the CSD information in the case of EMMC_BOOT configuration being enabled to pick boot partition or UDA FS mode operation to pick.

If EMMC_BOOT is disabled, then depend on filesystem configuration to pick data from UDA.

Quoted 6 lines

I am thinking, in which case we have EMMC_BOOT disabled,

Case here I am considering, updating u-boot to eMMC from u-boot shell, If EMMC_BOOT

is not set then , we can not set CSD information

Yes, but we cannot use boot0 mode of operation for Beagle family. the size of u-boot and optee vary over time and SK's boot0 partition strategy does'nt work for Beagle platforms.

Quoted 25 lines
Quoted 12 lines
---
  arch/arm/mach-k3/j721e_init.c | 9 ++++++++-
  1 file changed, 8 insertions(+), 1 deletion(-)
arch/arm/mach-k3/j721e_init.c +0 -0
index b1f7e25ed092..bcdfbfc79c4a 100644

arch/arm/mach-k3/j721e_init.c u32 spl_mmc_boot_mode(struct mmc *mmc, const u32 boot_device) · line 301

Quoted 9 lines
arch/arm/mach-k3/j721e_init.c +5 -1
@@ -294,7 +294,14 @@ u32 spl_mmc_boot_mode(struct mmc *mmc, const u32 boot_device)
  {
  	switch (boot_device) {
  	case BOOT_DEVICE_MMC1:
-		return (spl_mmc_emmc_boot_partition(mmc) ? MMCSD_MODE_EMMCBOOT : MMCSD_MODE_FS);
+		if (IS_ENABLED(CONFIG_SUPPORT_EMMC_BOOT)) {
+			if (spl_mmc_emmc_boot_partition(mmc))
+				return MMCSD_MODE_EMMCBOOT;
+			return MMCSD_MODE_FS;
+		}

I had a view EMMC_BOOT should be needed config.

Quoted 5 lines

arch/arm/mach-k3/j721e_init.c u32 spl_mmc_boot_mode(struct mmc *mmc, const u32 boot_device) · line 304

Quoted 3 lines
arch/arm/mach-k3/j721e_init.c +3 -0
+		if (IS_ENABLED(CONFIG_SPL_FS_FAT) || IS_ENABLED(CONFIG_SPL_FS_EXT4))
+			return MMCSD_MODE_FS;
+		return MMCSD_MODE_EMMCBOOT;

If you consider, to make EMMC_BOOT as needed config, then this is not needed

EMMC_BOOT is not a mandatory config.

Quoted 5 lines
Quoted 5 lines
arch/arm/mach-k3/j721e_init.c +0 -0
  	case BOOT_DEVICE_MMC2:
  		return MMCSD_MODE_FS;
  	default:
Signature · 3 lines
Regards,
Nishanth Menon
Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3  1A34 DDB5 849D 1736 249D
Reviewed-by
#4 lore raw

Re: [PATCH 01/15] arm: mach-k3: j721e: Improve support for UDA FS

Quoted 19 lines · Nishanth Menon
Quoted 18 lines · Udit
Quoted 10 lines · Nishanth Menon

Commit 5019170970ad ("arch: arm: mach-k3: j721e: add support for UDA FS") introduced basic UDA FS support, however, we can Take approach similar to commit 0f1c1e8b368b ("arm: mach-k3: am625: Add support for UDA FS"). While boot partition support with EMMC boot is useful, it is constrained by the size of boot hardware partition itself.

In the case of K3 devices, tispl images can contain OP-TEE images that can substantially vary in size and the u-boot image itself can vary over time as we enable various features.

Quoted 5 lines

So use the CSD information in the case of EMMC_BOOT configuration being enabled to pick boot partition or UDA FS mode operation to pick.

If EMMC_BOOT is disabled, then depend on filesystem configuration to pick data from UDA.

I am thinking, in which case we have EMMC_BOOT disabled,

Quoted 8 lines
Quoted 4 lines

Case here I am considering, updating u-boot to eMMC from u-boot shell, If EMMC_BOOT

is not set then , we can not set CSD information

Yes, but we cannot use boot0 mode of operation for Beagle family. the size of u-boot and optee vary over time and SK's boot0 partition strategy does'nt work for Beagle platforms.

Thanks, I was not aware of this limitation of Beagle family.

Let each board chose needed config with that

Quoted 31 lines
Quoted 22 lines
Quoted 10 lines
---
   arch/arm/mach-k3/j721e_init.c | 9 ++++++++-
   1 file changed, 8 insertions(+), 1 deletion(-)
arch/arm/mach-k3/j721e_init.c +0 -0
index b1f7e25ed092..bcdfbfc79c4a 100644

arch/arm/mach-k3/j721e_init.c u32 spl_mmc_boot_mode(struct mmc *mmc, const u32 boot_device) · line 301

Quoted 9 lines
arch/arm/mach-k3/j721e_init.c +5 -1
@@ -294,7 +294,14 @@ u32 spl_mmc_boot_mode(struct mmc *mmc, const u32 boot_device)
   {
   	switch (boot_device) {
   	case BOOT_DEVICE_MMC1:
-		return (spl_mmc_emmc_boot_partition(mmc) ? MMCSD_MODE_EMMCBOOT : MMCSD_MODE_FS);
+		if (IS_ENABLED(CONFIG_SUPPORT_EMMC_BOOT)) {
+			if (spl_mmc_emmc_boot_partition(mmc))
+				return MMCSD_MODE_EMMCBOOT;
+			return MMCSD_MODE_FS;
+		}

I had a view EMMC_BOOT should be needed config.

Quoted 4 lines

arch/arm/mach-k3/j721e_init.c u32 spl_mmc_boot_mode(struct mmc *mmc, const u32 boot_device) · line 304

Quoted 3 lines
arch/arm/mach-k3/j721e_init.c +3 -0
+		if (IS_ENABLED(CONFIG_SPL_FS_FAT) || IS_ENABLED(CONFIG_SPL_FS_EXT4))
+			return MMCSD_MODE_FS;
+		return MMCSD_MODE_EMMCBOOT;

If you consider, to make EMMC_BOOT as needed config, then this is not needed

EMMC_BOOT is not a mandatory config.

Quoted 4 lines
Quoted 4 lines
arch/arm/mach-k3/j721e_init.c +0 -0
   	case BOOT_DEVICE_MMC2:
   		return MMCSD_MODE_FS;
   	default:
#5 lore raw

PATCH 2/15 configs: j7200: Remove HBMC_AM654 config

In reply to Nishanth Menon

Kernel commit 1b77265626a4 ("arm64: dts: ti: k3-j7200-mcu-wakeup: Add HyperBus node") was merged to kernel without its dependent patch [1]. Similar fix is needed in U-Boot, and hbmc currently breaks boot. Till this gets fixed in U-Boot, disable the config by default so that the hbmc probe that happens in board/ti/j721e/evm.c will not take place and lead to boot failure.

This is similar to the approach in commit 5b2671594b80 ("configs:
j721e: Remove HBMC_AM654 config"), introduced to j7200 evm platform.

[1] https://lore.kernel.org/all/[email protected]/

---
 configs/j7200_evm_a72_defconfig | 1 -
 configs/j7200_evm_r5_defconfig  | 1 -
 2 files changed, 2 deletions(-)
configs/j7200_evm_a72_defconfig +0 -1
index cb4a141675da..889358afc316 100644
@@ -138,7 +138,6 @@ CONFIG_CFI_FLASH=y
 CONFIG_SYS_FLASH_USE_BUFFER_WRITE=y
 CONFIG_FLASH_CFI_MTD=y
 CONFIG_SYS_FLASH_CFI=y
-CONFIG_HBMC_AM654=y
 CONFIG_SYS_MAX_FLASH_BANKS_DETECT=y
 CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
configs/j7200_evm_r5_defconfig +0 -1
index d25dd8134b63..6452c60345fd 100644
@@ -114,7 +114,6 @@ CONFIG_CFI_FLASH=y
 CONFIG_SYS_FLASH_USE_BUFFER_WRITE=y
 CONFIG_FLASH_CFI_MTD=y
 CONFIG_SYS_FLASH_CFI=y
-CONFIG_HBMC_AM654=y
 CONFIG_SYS_MAX_FLASH_BANKS_DETECT=y
 CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH_SFDP_SUPPORT=y
Signature · 1 line
2.40.0
#6 lore raw

PATCH 3/15 board: ti: j721e: evm: Drop board check for ESM

In reply to Nishanth Menon

When config is enabled, the esm dt probe makes sense. Simplify by dropping board specific checks.

---
 board/ti/j721e/evm.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)
board/ti/j721e/evm.c +2 -8
index d4f7c1d9f938..75d51a0552c4 100644
@@ -531,10 +531,8 @@ err_free_gpio:
 
 void spl_board_init(void)
 {
-#if defined(CONFIG_ESM_K3) || defined(CONFIG_ESM_PMIC)
 	struct udevice *dev;
 	int ret;
-#endif
 
 	if ((IS_ENABLED(CONFIG_TARGET_J721E_A72_EVM) ||
 	     IS_ENABLED(CONFIG_TARGET_J7200_A72_EVM)) &&
@@ -543,24 +541,20 @@ void spl_board_init(void)
 			probe_daughtercards();
 	}
 
-#ifdef CONFIG_ESM_K3
-	if (board_ti_k3_is("J721EX-PM2-SOM")) {
+	if (IS_ENABLED(CONFIG_ESM_K3)) {
 		ret = uclass_get_device_by_driver(UCLASS_MISC,
 						  DM_DRIVER_GET(k3_esm), &dev);
 		if (ret)
 			printf("ESM init failed: %d\n", ret);
 	}
-#endif
 
-#ifdef CONFIG_ESM_PMIC
-	if (board_ti_k3_is("J721EX-PM2-SOM")) {
+	if (IS_ENABLED(CONFIG_ESM_PMIC)) {
 		ret = uclass_get_device_by_driver(UCLASS_MISC,
 						  DM_DRIVER_GET(pmic_esm),
 						  &dev);
 		if (ret)
 			printf("ESM PMIC init failed: %d\n", ret);
 	}
-#endif
 	if ((IS_ENABLED(CONFIG_TARGET_J7200_A72_EVM) || IS_ENABLED(CONFIG_TARGET_J721E_A72_EVM)) &&
 	    IS_ENABLED(CONFIG_HBMC_AM654)) {
 		struct udevice *dev;
Signature · 1 line
2.40.0
#7 lore raw

Re: [PATCH 03/15] board: ti: j721e: evm: Drop board check for ESM

Quoted 25 lines · Nishanth Menon

When config is enabled, the esm dt probe makes sense. Simplify by dropping board specific checks.

---
  board/ti/j721e/evm.c | 10 ++--------
  1 file changed, 2 insertions(+), 8 deletions(-)
board/ti/j721e/evm.c +0 -2
index d4f7c1d9f938..75d51a0552c4 100644
@@ -531,10 +531,8 @@ err_free_gpio:
 
  void spl_board_init(void)
  {
-#if defined(CONFIG_ESM_K3) || defined(CONFIG_ESM_PMIC)
  	struct udevice *dev;
  	int ret;
-#endif
 
  	if ((IS_ENABLED(CONFIG_TARGET_J721E_A72_EVM) ||
  	     IS_ENABLED(CONFIG_TARGET_J7200_A72_EVM)) &&
@@ -543,24 +541,20 @@ void spl_board_init(void)
  			probe_daughtercards();

board/ti/j721e/evm.c void spl_board_init(void) · line 549

Quoted 10 lines
board/ti/j721e/evm.c +1 -2
  	}
 
-#ifdef CONFIG_ESM_K3
-	if (board_ti_k3_is("J721EX-PM2-SOM")) {
+	if (IS_ENABLED(CONFIG_ESM_K3)) {
  		ret = uclass_get_device_by_driver(UCLASS_MISC,
  						  DM_DRIVER_GET(k3_esm), &dev);
  		if (ret)
  			printf("ESM init failed: %d\n", ret);
  	}

Nothing related to this patch, but to get esm completely functional

Second k3_esm probing needs to be added in this file.

Also, DT changes are needed, in next sync

https://lore.kernel.org/all/[email protected]/

Quoted 15 lines
board/ti/j721e/evm.c +1 -4
-#endif
 
-#ifdef CONFIG_ESM_PMIC
-	if (board_ti_k3_is("J721EX-PM2-SOM")) {
+	if (IS_ENABLED(CONFIG_ESM_PMIC)) {
  		ret = uclass_get_device_by_driver(UCLASS_MISC,
  						  DM_DRIVER_GET(pmic_esm),
  						  &dev);
  		if (ret)
  			printf("ESM PMIC init failed: %d\n", ret);
  	}
-#endif
  	if ((IS_ENABLED(CONFIG_TARGET_J7200_A72_EVM) || IS_ENABLED(CONFIG_TARGET_J721E_A72_EVM)) &&
  	    IS_ENABLED(CONFIG_HBMC_AM654)) {
  		struct udevice *dev;
#8 lore raw

Re: [PATCH 03/15] board: ti: j721e: evm: Drop board check for ESM

Quoted 37 lines · Udit
Quoted 22 lines · Nishanth Menon

When config is enabled, the esm dt probe makes sense. Simplify by dropping board specific checks.

---
  board/ti/j721e/evm.c | 10 ++--------
  1 file changed, 2 insertions(+), 8 deletions(-)
board/ti/j721e/evm.c +0 -2
index d4f7c1d9f938..75d51a0552c4 100644
@@ -531,10 +531,8 @@ err_free_gpio:
  void spl_board_init(void)
  {
-#if defined(CONFIG_ESM_K3) || defined(CONFIG_ESM_PMIC)
  	struct udevice *dev;
  	int ret;
-#endif
  	if ((IS_ENABLED(CONFIG_TARGET_J721E_A72_EVM) ||
  	     IS_ENABLED(CONFIG_TARGET_J7200_A72_EVM)) &&

board/ti/j721e/evm.c void spl_board_init(void) · line 548

Quoted 10 lines
board/ti/j721e/evm.c +1 -2
@@ -543,24 +541,20 @@ void spl_board_init(void)
  			probe_daughtercards();
  	}
-#ifdef CONFIG_ESM_K3
-	if (board_ti_k3_is("J721EX-PM2-SOM")) {
+	if (IS_ENABLED(CONFIG_ESM_K3)) {
  		ret = uclass_get_device_by_driver(UCLASS_MISC,
  						  DM_DRIVER_GET(k3_esm), &dev);
  		if (ret)
  			printf("ESM init failed: %d\n", ret);
  	}

Nothing related to this patch, but to get esm completely functional

Quoted 8 lines

Second k3_esm probing needs to be added in this file.

Also, DT changes are needed, in next sync

https://lore.kernel.org/all/[email protected]/

Understood. no action on the current series, I assume.

Signature · 3 lines
Regards,
Nishanth Menon
Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3  1A34 DDB5 849D 1736 249D
Reviewed-by
#9 lore raw

Re: [PATCH 03/15] board: ti: j721e: evm: Drop board check for ESM

Quoted 39 lines · Nishanth Menon
Quoted 38 lines · Udit
Quoted 22 lines · Nishanth Menon

When config is enabled, the esm dt probe makes sense. Simplify by dropping board specific checks.

---
   board/ti/j721e/evm.c | 10 ++--------
   1 file changed, 2 insertions(+), 8 deletions(-)
board/ti/j721e/evm.c +0 -2
index d4f7c1d9f938..75d51a0552c4 100644
@@ -531,10 +531,8 @@ err_free_gpio:
   void spl_board_init(void)
   {
-#if defined(CONFIG_ESM_K3) || defined(CONFIG_ESM_PMIC)
   	struct udevice *dev;
   	int ret;
-#endif
   	if ((IS_ENABLED(CONFIG_TARGET_J721E_A72_EVM) ||
   	     IS_ENABLED(CONFIG_TARGET_J7200_A72_EVM)) &&

board/ti/j721e/evm.c void spl_board_init(void) · line 548

Quoted 10 lines
board/ti/j721e/evm.c +1 -2
@@ -543,24 +541,20 @@ void spl_board_init(void)
   			probe_daughtercards();
   	}
-#ifdef CONFIG_ESM_K3
-	if (board_ti_k3_is("J721EX-PM2-SOM")) {
+	if (IS_ENABLED(CONFIG_ESM_K3)) {
   		ret = uclass_get_device_by_driver(UCLASS_MISC,
   						  DM_DRIVER_GET(k3_esm), &dev);
   		if (ret)
   			printf("ESM init failed: %d\n", ret);
   	}

Nothing related to this patch, but to get esm completely functional

Second k3_esm probing needs to be added in this file.

Quoted 6 lines
Quoted 5 lines

Also, DT changes are needed, in next sync

https://lore.kernel.org/all/[email protected]/

Understood. no action on the current series, I assume.

yes, no action on current series.

#10 lore raw

PATCH 4/15 board: ti: j721e: evm: Drop unused headers

In reply to Nishanth Menon

Drop headers that are no longer necessary for build

---
 board/ti/j721e/evm.c | 8 --------
 1 file changed, 8 deletions(-)
board/ti/j721e/evm.c +0 -8
index 75d51a0552c4..8f0996c32ee6 100644
@@ -8,21 +8,13 @@
  */
 
 #include <common.h>
-#include <env.h>
-#include <fdt_support.h>
 #include <generic-phy.h>
 #include <image.h>
-#include <init.h>
-#include <log.h>
 #include <net.h>
 #include <asm/arch/hardware.h>
-#include <asm/global_data.h>
 #include <asm/gpio.h>
-#include <asm/io.h>
 #include <spl.h>
 #include <dm.h>
-#include <dm/uclass-internal.h>
-#include <linux/printk.h>
 
 #include "../common/board_detect.h"
 
Signature · 1 line
2.40.0
#11 lore raw

PATCH 5/15 board: ti: j721e: evm: Switch to using IS_ENABLED

In reply to Nishanth Menon

Switch to using IS_ENABLED() for inline function usage.

---
 board/ti/j721e/evm.c | 83 ++++++++++++++++++++++----------------------
 1 file changed, 42 insertions(+), 41 deletions(-)
board/ti/j721e/evm.c +42 -41
index 8f0996c32ee6..17640ae79665 100644
@@ -300,53 +300,54 @@ static int probe_daughtercards(void)
 		printf("Detected: %s rev %s\n", ep.name, ep.version);
 		daughter_card_detect_flags[i] = true;
 
-#ifndef CONFIG_SPL_BUILD
-		int j;
-		/*
-		 * Populate any MAC addresses from daughtercard into the U-Boot
-		 * environment, starting with a card-specific offset so we can
-		 * have multiple ext_cards contribute to the MAC pool in a well-
-		 * defined manner.
-		 */
-		for (j = 0; j < mac_addr_cnt; j++) {
-			if (!is_valid_ethaddr((u8 *)mac_addr[j]))
-				continue;
-
-			eth_env_set_enetaddr_by_index("eth",
-						      ext_cards[i].eth_offset + j,
-						      (uchar *)mac_addr[j]);
+		if (!IS_ENABLED(CONFIG_SPL_BUILD)) {
+			int j;
+			/*
+			 * Populate any MAC addresses from daughtercard into the U-Boot
+			 * environment, starting with a card-specific offset so we can
+			 * have multiple ext_cards contribute to the MAC pool in a well-
+			 * defined manner.
+			 */
+			for (j = 0; j < mac_addr_cnt; j++) {
+				if (!is_valid_ethaddr((u8 *)mac_addr[j]))
+					continue;
+
+				eth_env_set_enetaddr_by_index("eth",
+							      ext_cards[i].eth_offset + j,
+							      (uchar *)mac_addr[j]);
+			}
 		}
-#endif
 	}
-#ifndef CONFIG_SPL_BUILD
-	char name_overlays[1024] = { 0 };
 
-	for (i = 0; i < ARRAY_SIZE(ext_cards); i++) {
-		if (!daughter_card_detect_flags[i])
-			continue;
+	if (!IS_ENABLED(CONFIG_SPL_BUILD)) {
+		char name_overlays[1024] = { 0 };
 
-		/* Skip if no overlays are to be added */
-		if (!strlen(ext_cards[i].dtbo_name))
-			continue;
+		for (i = 0; i < ARRAY_SIZE(ext_cards); i++) {
+			if (!daughter_card_detect_flags[i])
+				continue;
 
-		/*
-		 * Make sure we are not running out of buffer space by checking
-		 * if we can fit the new overlay, a trailing space to be used
-		 * as a separator, plus the terminating zero.
-		 */
-		if (strlen(name_overlays) + strlen(ext_cards[i].dtbo_name) + 2 >
-		    sizeof(name_overlays))
-			return -ENOMEM;
-
-		/* Append to our list of overlays */
-		strcat(name_overlays, ext_cards[i].dtbo_name);
-		strcat(name_overlays, " ");
-	}
+			/* Skip if no overlays are to be added */
+			if (!strlen(ext_cards[i].dtbo_name))
+				continue;
 
-	/* Apply device tree overlay(s) to the U-Boot environment, if any */
-	if (strlen(name_overlays))
-		return env_set("name_overlays", name_overlays);
-#endif
+			/*
+			 * Make sure we are not running out of buffer space by checking
+			 * if we can fit the new overlay, a trailing space to be used
+			 * as a separator, plus the terminating zero.
+			 */
+			if (strlen(name_overlays) + strlen(ext_cards[i].dtbo_name) + 2 >
+			    sizeof(name_overlays))
+				return -ENOMEM;
+
+			/* Append to our list of overlays */
+			strcat(name_overlays, ext_cards[i].dtbo_name);
+			strcat(name_overlays, " ");
+		}
+
+		/* Apply device tree overlay(s) to the U-Boot environment, if any */
+		if (strlen(name_overlays))
+			return env_set("name_overlays", name_overlays);
+	}
 
 	return 0;
 }
Signature · 1 line
2.40.0
#12 lore raw

PATCH 6/15 board: ti: j721e: evm: Drop board based serdes initialization

In reply to Nishanth Menon

Serdes initialization should be compile flag based instead of being eeprom based.

---
 board/ti/j721e/evm.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)
board/ti/j721e/evm.c +2 -8
index 17640ae79665..d49993fffe39 100644
@@ -359,9 +359,6 @@ void configure_serdes_torrent(void)
 	struct phy serdes;
 	int ret;
 
-	if (!IS_ENABLED(CONFIG_PHY_CADENCE_TORRENT))
-		return;
-
 	ret = uclass_get_device_by_driver(UCLASS_PHY,
 					  DM_DRIVER_GET(torrent_phy_provider),
 					  &dev);
@@ -393,9 +390,6 @@ void configure_serdes_sierra(void)
 	int ret, count, i;
 	int link_count = 0;
 
-	if (!IS_ENABLED(CONFIG_PHY_CADENCE_SIERRA))
-		return;
-
 	ret = uclass_get_device_by_driver(UCLASS_MISC,
 					  DM_DRIVER_GET(sierra_phy_provider),
 					  &dev);
@@ -477,10 +471,10 @@ int board_late_init(void)
 			probe_daughtercards();
 	}
 
-	if (board_is_j7200_som())
+	if (IS_ENABLED(CONFIG_PHY_CADENCE_TORRENT))
 		configure_serdes_torrent();
 
-	if (board_is_j721e_som())
+	if (IS_ENABLED(CONFIG_PHY_CADENCE_SIERRA))
 		configure_serdes_sierra();
 
 	return 0;
Signature · 1 line
2.40.0
#13 lore raw

Re: [PATCH 06/15] board: ti: j721e: evm: Drop board based serdes initialization

Quoted 34 lines · Nishanth Menon

Serdes initialization should be compile flag based instead of being eeprom based.

---
  board/ti/j721e/evm.c | 10 ++--------
  1 file changed, 2 insertions(+), 8 deletions(-)
board/ti/j721e/evm.c +0 -6
index 17640ae79665..d49993fffe39 100644
@@ -359,9 +359,6 @@ void configure_serdes_torrent(void)
  	struct phy serdes;
  	int ret;
 
-	if (!IS_ENABLED(CONFIG_PHY_CADENCE_TORRENT))
-		return;
-
  	ret = uclass_get_device_by_driver(UCLASS_PHY,
  					  DM_DRIVER_GET(torrent_phy_provider),
  					  &dev);
@@ -393,9 +390,6 @@ void configure_serdes_sierra(void)
  	int ret, count, i;
  	int link_count = 0;
 
-	if (!IS_ENABLED(CONFIG_PHY_CADENCE_SIERRA))
-		return;
-
  	ret = uclass_get_device_by_driver(UCLASS_MISC,
  					  DM_DRIVER_GET(sierra_phy_provider),
  					  &dev);
@@ -477,10 +471,10 @@ int board_late_init(void)
  			probe_daughtercards();

board/ti/j721e/evm.c int board_late_init(void) · line 479

Quoted 10 lines
board/ti/j721e/evm.c +2 -2
  	}
 
-	if (board_is_j7200_som())
+	if (IS_ENABLED(CONFIG_PHY_CADENCE_TORRENT))
  		configure_serdes_torrent();
 
-	if (board_is_j721e_som())
+	if (IS_ENABLED(CONFIG_PHY_CADENCE_SIERRA))
  		configure_serdes_sierra();
 

Could be merged into one if condition

Quoted 1 line
board/ti/j721e/evm.c +0 -0
  	return 0;
Reviewed-by
#14 lore raw

Re: [PATCH 06/15] board: ti: j721e: evm: Drop board based serdes initialization

Quoted 35 lines · Udit
Quoted 33 lines · Nishanth Menon

Serdes initialization should be compile flag based instead of being eeprom based.

---
  board/ti/j721e/evm.c | 10 ++--------

  1 file changed, 2 insertions(+), 8 deletions(-)
board/ti/j721e/evm.c +0 -4
index 17640ae79665..d49993fffe39 100644
@@ -359,9 +359,6 @@ void configure_serdes_torrent(void)
       struct phy serdes;
       int ret;
   -    if (!IS_ENABLED(CONFIG_PHY_CADENCE_TORRENT))
-        return;
-
       ret = uclass_get_device_by_driver(UCLASS_PHY,
                         DM_DRIVER_GET(torrent_phy_provider),
                         &dev);
@@ -393,9 +390,6 @@ void configure_serdes_sierra(void)
       int ret, count, i;
       int link_count = 0;
   -    if (!IS_ENABLED(CONFIG_PHY_CADENCE_SIERRA))
-        return;
-
       ret = uclass_get_device_by_driver(UCLASS_MISC,
                         DM_DRIVER_GET(sierra_phy_provider),
                         &dev);
@@ -477,10 +471,10 @@ int board_late_init(void)
               probe_daughtercards();
       }
Quoted 9 lines

board/ti/j721e/evm.c int board_late_init(void) · line 478

Quoted 6 lines
board/ti/j721e/evm.c +2 -0
   -    if (board_is_j7200_som())
+    if (IS_ENABLED(CONFIG_PHY_CADENCE_TORRENT))
           configure_serdes_torrent();
   -    if (board_is_j721e_som())
+    if (IS_ENABLED(CONFIG_PHY_CADENCE_SIERRA))
           configure_serdes_sierra();

Could be merged into one if condition

Please ignore above comments

with that

Quoted 2 lines
Quoted 2 lines
board/ti/j721e/evm.c +0 -0
       return 0;
#15 lore raw

PATCH 7/15 board: ti: j721e: evm: Use IS_ENABLED with CONFIG_PHYS_64BIT

In reply to Nishanth Menon

Use IS_ENABLED to replace the #ifdeffery.

---
 board/ti/j721e/evm.c | 25 +++++++++++--------------
 1 file changed, 11 insertions(+), 14 deletions(-)
board/ti/j721e/evm.c +11 -14
index d49993fffe39..0fc141776818 100644
@@ -39,22 +39,19 @@ int board_init(void)
 
 int dram_init(void)
 {
-#ifdef CONFIG_PHYS_64BIT
-	gd->ram_size = 0x100000000;
-#else
-	gd->ram_size = 0x80000000;
-#endif
+	if (IS_ENABLED(CONFIG_PHYS_64BIT))
+		gd->ram_size = 0x100000000;
+	else
+		gd->ram_size = 0x80000000;
 
 	return 0;
 }
 
 phys_addr_t board_get_usable_ram_top(phys_size_t total_size)
 {
-#ifdef CONFIG_PHYS_64BIT
 	/* Limit RAM used by U-Boot to the DDR low region */
-	if (gd->ram_top > 0x100000000)
+	if (IS_ENABLED(CONFIG_PHYS_64BIT) && gd->ram_top > 0x100000000)
 		return 0x100000000;
-#endif
 
 	return gd->ram_top;
 }
@@ -66,12 +63,12 @@ int dram_init_banksize(void)
 	gd->bd->bi_dram[0].size = 0x80000000;
 	gd->ram_size = 0x80000000;
 
-#ifdef CONFIG_PHYS_64BIT
-	/* Bank 1 declares the memory available in the DDR high region */
-	gd->bd->bi_dram[1].start = CFG_SYS_SDRAM_BASE1;
-	gd->bd->bi_dram[1].size = 0x80000000;
-	gd->ram_size = 0x100000000;
-#endif
+	if (IS_ENABLED(CONFIG_PHYS_64BIT)) {
+		/* Bank 1 declares the memory available in the DDR high region */
+		gd->bd->bi_dram[1].start = CFG_SYS_SDRAM_BASE1;
+		gd->bd->bi_dram[1].size = 0x80000000;
+		gd->ram_size = 0x100000000;
+	}
 
 	return 0;
 }
Signature · 1 line
2.40.0
#16 lore raw

PATCH 8/15 board: ti: j721e: evm: Split code to isolate eeprom detected logic

In reply to Nishanth Menon

Move code out of evm.c that is based on evm specific checks for board variants and initialization sequences there of.

---
 board/ti/j721e/Makefile                    |   1 +
 board/ti/j721e/{evm.c => board-variants.c} | 172 +--------
 board/ti/j721e/evm.c                       | 409 +--------------------
 board/ti/j721e/evm.h                       |  24 ++
 4 files changed, 53 insertions(+), 553 deletions(-)
 copy board/ti/j721e/{evm.c => board-variants.c} (75%)
 create mode 100644 board/ti/j721e/evm.h
board/ti/j721e/Makefile +1 -0
index 97535f5d86d1..f42fcf5c463b 100644
@@ -6,3 +6,4 @@
 #
 
 obj-y	+= evm.o
+obj-${CONFIG_TI_I2C_BOARD_DETECT} += board-variants.o
board/ti/j721e/board-variants.c renamed from board/ti/j721e/evm.c +17 -155

227 lines not on this page · raw message

board/ti/j721e/evm.c +11 -398

452 lines not on this page · raw message

board/ti/j721e/evm.h new file +24 -0
new file mode 100644
index 000000000000..8f8681817586
@@ -0,0 +1,24 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Board detected logic initialization abstraction
+ *
+ * Copyright (C) 2023 Texas Instruments Incorporated - https://www.ti.com/
+ *
+ */
+
+#ifndef __J72E_EVM_H
+#define __J72E_EVM_H
+
+#ifdef CONFIG_TI_I2C_BOARD_DETECT
+
+int variant_board_late_init(void);
+void variant_spl_board_init(void);
+
+#else /* CONFIG_TI_I2C_BOARD_DETECT */
+
+static inline int variant_board_late_init(void) { return 0; }
+static inline void variant_spl_board_init(void) { }
+
+#endif /* CONFIG_TI_I2C_BOARD_DETECT */
+
+#endif /* __J72E_EVM_H */
Signature · 1 line
2.40.0
#17 lore raw

PATCH 9/15 board: ti: j721e: j721e.env: Add explicit boot_targets

In reply to Nishanth Menon

Add explicit boot_targets to indicate the specific boot sequence to follow.

---
 board/ti/j721e/j721e.env | 1 +
 1 file changed, 1 insertion(+)
board/ti/j721e/j721e.env +1 -0
index 8cc8232fc131..cb27bf5e2b24 100644
@@ -31,6 +31,7 @@ addr_mcur5f0_0load=0x89000000
 name_mcur5f0_0fw=/lib/firmware/j7200-mcu-r5f0_0-fw
 #endif
 
+boot_targets=mmc1 mmc0 usb pxe dhcp
 boot=mmc
 mmcdev=1
 bootpart=1:2
Signature · 1 line
2.40.0
#18 lore raw

PATCH 10/15 configs: j721e_evm_a72_defconfig: Switch to bootstd

In reply to Nishanth Menon

Switch to using bootstd. Note with this change, we will stop using distro_bootcmd and instead depend entirely on bootflow method of starting the system up.

---
 configs/j721e_evm_a72_defconfig | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
configs/j721e_evm_a72_defconfig +3 -2
index 99e0e168ebf7..98ac7ca59789 100644
@@ -29,10 +29,11 @@ CONFIG_SPL_SPI=y
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL_LOAD_FIT=y
 CONFIG_SPL_LOAD_FIT_ADDRESS=0x81000000
-CONFIG_DISTRO_DEFAULTS=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_SYSTEM_SETUP=y
-CONFIG_BOOTCOMMAND="run envboot; run distro_bootcmd;"
+CONFIG_BOOTSTD_FULL=y
+CONFIG_BOOTSTD_DEFAULTS=y
+CONFIG_BOOTCOMMAND="run envboot; bootflow scan -lb"
 CONFIG_LOGLEVEL=7
 CONFIG_SPL_MAX_SIZE=0xc0000
 CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
Signature · 1 line
2.40.0
#19 lore raw

Re: [PATCH 10/15] configs: j721e_evm_a72_defconfig: Switch to bootstd

Hi Nishanth,

Quoted 14 lines · Nishanth Menon

Switch to using bootstd. Note with this change, we will stop using distro_bootcmd and instead depend entirely on bootflow method of starting the system up.

---
 configs/j721e_evm_a72_defconfig | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
configs/j721e_evm_a72_defconfig +0 -0
index 99e0e168ebf7..98ac7ca59789 100644

configs/j721e_evm_a72_defconfig CONFIG_SPL_SPI=y · line 36

Quoted 10 lines
configs/j721e_evm_a72_defconfig +3 -2
@@ -29,10 +29,11 @@ CONFIG_SPL_SPI=y
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL_LOAD_FIT=y
 CONFIG_SPL_LOAD_FIT_ADDRESS=0x81000000
-CONFIG_DISTRO_DEFAULTS=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_SYSTEM_SETUP=y
-CONFIG_BOOTCOMMAND="run envboot; run distro_bootcmd;"
+CONFIG_BOOTSTD_FULL=y
+CONFIG_BOOTSTD_DEFAULTS=y
+CONFIG_BOOTCOMMAND="run envboot; bootflow scan -lb"

Coming back to [0], AM62x didn't have early remote procs but j721e does, do you have any alternatives in place before migrating J7 platforms to stdboot?

Regards,
Manorit

[0]: https://lore.kernel.org/u-boot/20231005171010.zvza7uqyn4mcgp5g@handsaw/

Quoted 6 lines
configs/j721e_evm_a72_defconfig +0 -0
 CONFIG_LOGLEVEL=7
 CONFIG_SPL_MAX_SIZE=0xc0000
 CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
Signature · 1 line
2.40.0
#20 lore raw

Re: [PATCH 10/15] configs: j721e_evm_a72_defconfig: Switch to bootstd

Quoted 23 lines · Manorit Chawdhry

Hi Nishanth,

Quoted 20 lines · Nishanth Menon

Switch to using bootstd. Note with this change, we will stop using distro_bootcmd and instead depend entirely on bootflow method of starting the system up.

---
 configs/j721e_evm_a72_defconfig | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
configs/j721e_evm_a72_defconfig +0 -1
index 99e0e168ebf7..98ac7ca59789 100644
@@ -29,10 +29,11 @@ CONFIG_SPL_SPI=y
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL_LOAD_FIT=y
 CONFIG_SPL_LOAD_FIT_ADDRESS=0x81000000
-CONFIG_DISTRO_DEFAULTS=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_SYSTEM_SETUP=y
Quoted 8 lines

configs/j721e_evm_a72_defconfig CONFIG_SPL_SPI=y · line 36

Quoted 4 lines
configs/j721e_evm_a72_defconfig +3 -1
-CONFIG_BOOTCOMMAND="run envboot; run distro_bootcmd;"
+CONFIG_BOOTSTD_FULL=y
+CONFIG_BOOTSTD_DEFAULTS=y
+CONFIG_BOOTCOMMAND="run envboot; bootflow scan -lb"

Coming back to [0], AM62x didn't have early remote procs but j721e does, do you have any alternatives in place before migrating J7 platforms to stdboot?

As I have stated before. distro boot support for remote proc has been hacked up atm. what needs to happen is standardize it. Which is independent of this series.

Please discuss with stdboot folks how to get it in. WORST case, envboot is still supported, so in effect, what is achieved today can still continue to occur with envboot.

Quoted 12 lines

Regards,
Manorit

[0]: https://lore.kernel.org/u-boot/20231005171010.zvza7uqyn4mcgp5g@handsaw/

Quoted 6 lines
configs/j721e_evm_a72_defconfig +0 -0
 CONFIG_LOGLEVEL=7
 CONFIG_SPL_MAX_SIZE=0xc0000
 CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
Signature · 1 line
2.40.0
Signature · 3 lines
Regards,
Nishanth Menon
Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3  1A34 DDB5 849D 1736 249D
#21 lore raw

Re: [PATCH 10/15] configs: j721e_evm_a72_defconfig: Switch to bootstd

Quoted 33 lines · Nishanth Menon
Quoted 23 lines · Manorit Chawdhry

Hi Nishanth,

Quoted 20 lines · Nishanth Menon

Switch to using bootstd. Note with this change, we will stop using distro_bootcmd and instead depend entirely on bootflow method of starting the system up.

---
 configs/j721e_evm_a72_defconfig | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
configs/j721e_evm_a72_defconfig +0 -1
index 99e0e168ebf7..98ac7ca59789 100644
@@ -29,10 +29,11 @@ CONFIG_SPL_SPI=y
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL_LOAD_FIT=y
 CONFIG_SPL_LOAD_FIT_ADDRESS=0x81000000
-CONFIG_DISTRO_DEFAULTS=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_SYSTEM_SETUP=y
Quoted 8 lines

configs/j721e_evm_a72_defconfig CONFIG_SPL_SPI=y · line 36

Quoted 4 lines
configs/j721e_evm_a72_defconfig +3 -1
-CONFIG_BOOTCOMMAND="run envboot; run distro_bootcmd;"
+CONFIG_BOOTSTD_FULL=y
+CONFIG_BOOTSTD_DEFAULTS=y
+CONFIG_BOOTCOMMAND="run envboot; bootflow scan -lb"

Coming back to [0], AM62x didn't have early remote procs but j721e does, do you have any alternatives in place before migrating J7 platforms to stdboot?

Quoted 7 lines

As I have stated before. distro boot support for remote proc has been hacked up atm. what needs to happen is standardize it. Which is independent of this series.

Please discuss with stdboot folks how to get it in. WORST case, envboot is still supported, so in effect, what is achieved today can still continue to occur with envboot.

There's not "stdboot folks" to talk with about this. The first step would be someone from TI posting some RFC patches about how exactly the remote proc support should be handled in that case, explaining where the what being run comes from and so forth. Maybe the answer is that "envboot" just keeps being defined and run before hand because that's the standard way to handle what needs doing on those processors? At least personally I feel like there's a gap in knowledge of what the use cases here are. Thanks.

Signature · 1 line
Tom
#22 lore raw

PATCH 11/15 arm: dts: k3-j721e-binman: Allow a single board configuration

In reply to Nishanth Menon

Allow the reuse of k3-j721e-binman for other platforms such as BeagleBone-AI64. We don't need to build SK device tree blobs in-order to be able to build dtbs for single configuration platforms.

---
 arch/arm/dts/k3-j721e-binman.dtsi             | 21 ++++++++++++++++++-
 .../k3-j721e-common-proc-board-u-boot.dtsi    |  2 ++
 arch/arm/dts/k3-j721e-sk-u-boot.dtsi          |  2 ++
 3 files changed, 24 insertions(+), 1 deletion(-)
arch/arm/dts/k3-j721e-binman.dtsi +20 -1
index 4f566c21a9af..d9c4fbf593af 100644
@@ -296,11 +296,14 @@
 
 #define SPL_NODTB "spl/u-boot-spl-nodtb.bin"
 #define SPL_J721E_EVM_DTB "spl/dts/k3-j721e-common-proc-board.dtb"
-#define SPL_J721E_SK_DTB "spl/dts/k3-j721e-sk.dtb"
 
 #define UBOOT_NODTB "u-boot-nodtb.bin"
 #define J721E_EVM_DTB "u-boot.dtb"
+
+#ifdef DUAL_DTB_BINMAN
+#define SPL_J721E_SK_DTB "spl/dts/k3-j721e-sk.dtb"
 #define J721E_SK_DTB "arch/arm/dts/k3-j721e-sk.dtb"
+#endif
 
 &binman {
 	ti-dm {
@@ -400,6 +403,7 @@
 					};
 				};
 
+#ifdef DUAL_DTB_BINMAN
 				fdt-1 {
 					description = "k3-j721e-sk";
 					type = "flat_dt";
@@ -414,6 +418,7 @@
 						filename = SPL_J721E_SK_DTB;
 					};
 				};
+#endif
 			};
 
 			configurations {
@@ -426,12 +431,14 @@
 					fdt = "fdt-0";
 				};
 
+#ifdef DUAL_DTB_BINMAN
 				conf-1 {
 					description = "k3-j721e-sk";
 					firmware = "atf";
 					loadables = "tee", "dm", "spl";
 					fdt = "fdt-1";
 				};
+#endif
 			};
 		};
 	};
@@ -482,6 +489,7 @@
 					};
 				};
 
+#ifdef DUAL_DTB_BINMAN
 				fdt-1 {
 					description = "k3-j721e-sk";
 					type = "flat_dt";
@@ -499,6 +507,7 @@
 						algo = "crc32";
 					};
 				};
+#endif
 			};
 
 			configurations {
@@ -511,12 +520,14 @@
 					fdt = "fdt-0";
 				};
 
+#ifdef DUAL_DTB_BINMAN
 				conf-1 {
 					description = "k3-j721e-sk";
 					firmware = "uboot";
 					loadables = "uboot";
 					fdt = "fdt-1";
 				};
+#endif
 			};
 		};
 	};
@@ -595,6 +606,7 @@
 					};
 				};
 
+#ifdef DUAL_DTB_BINMAN
 				fdt-1 {
 					description = "k3-j721e-sk";
 					type = "flat_dt";
@@ -604,6 +616,7 @@
 						filename = SPL_J721E_SK_DTB;
 					};
 				};
+#endif
 			};
 
 			configurations {
@@ -616,12 +629,14 @@
 					fdt = "fdt-0";
 				};
 
+#ifdef DUAL_DTB_BINMAN
 				conf-1 {
 					description = "k3-j721e-sk";
 					firmware = "atf";
 					loadables = "tee", "dm", "spl";
 					fdt = "fdt-1";
 				};
+#endif
 			};
 		};
 	};
@@ -664,6 +679,7 @@
 					};
 				};
 
+#ifdef DUAL_DTB_BINMAN
 				fdt-1 {
 					description = "k3-j721e-sk";
 					type = "flat_dt";
@@ -676,6 +692,7 @@
 						algo = "crc32";
 					};
 				};
+#endif
 			};
 
 			configurations {
@@ -688,12 +705,14 @@
 					fdt = "fdt-0";
 				};
 
+#ifdef DUAL_DTB_BINMAN
 				conf-1 {
 					description = "k3-j721e-sk";
 					firmware = "uboot";
 					loadables = "uboot";
 					fdt = "fdt-1";
 				};
+#endif
 			};
 		};
 	};
arch/arm/dts/k3-j721e-common-proc-board-u-boot.dtsi +2 -0
index cd95907b981b..3317e902d677 100644
@@ -3,6 +3,8 @@
  * Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com/
  */
 
+#define DUAL_DTB_BINMAN 1
+
 #include "k3-j721e-binman.dtsi"
 
 &cbass_main {
arch/arm/dts/k3-j721e-sk-u-boot.dtsi +2 -0
index 370fe5190b2d..507964827547 100644
@@ -3,6 +3,8 @@
  * Copyright (C) 2021 Texas Instruments Incorporated - https://www.ti.com/
  */
 
+#define DUAL_DTB_BINMAN 1
+
 #include "k3-j721e-binman.dtsi"
 
 &cbass_main {
Signature · 1 line
2.40.0
#23 lore raw

PATCH 12/15 arm: dts: k3-j721e-binman: Use macros that can be overridden for dtbs

In reply to Nishanth Menon

Allow the reuse of k3-j721e-binman for other platforms such as BeagleBone-AI64. Provide a couple of macros to indicate the correct dtb to be able to re-use soc binman dtsi file

---
 arch/arm/dts/k3-j721e-binman.dtsi | 12 ++++++++++++
 1 file changed, 12 insertions(+)
arch/arm/dts/k3-j721e-binman.dtsi +12 -0
index d9c4fbf593af..6166c931dea6 100644
@@ -295,16 +295,28 @@
 #ifdef CONFIG_TARGET_J721E_A72_EVM
 
 #define SPL_NODTB "spl/u-boot-spl-nodtb.bin"
+#ifndef SPL_J721E_EVM_DTB
 #define SPL_J721E_EVM_DTB "spl/dts/k3-j721e-common-proc-board.dtb"
+#endif
 
 #define UBOOT_NODTB "u-boot-nodtb.bin"
+
+#ifndef J721E_EVM_DTB
 #define J721E_EVM_DTB "u-boot.dtb"
+#endif
 
 #ifdef DUAL_DTB_BINMAN
+
+#ifndef SPL_J721E_SK_DTB
 #define SPL_J721E_SK_DTB "spl/dts/k3-j721e-sk.dtb"
+#endif
+
+#ifndef J721E_SK_DTB
 #define J721E_SK_DTB "arch/arm/dts/k3-j721e-sk.dtb"
 #endif
 
+#endif
+
 &binman {
 	ti-dm {
 		filename = "ti-dm.bin";
Signature · 1 line
2.40.0
#24 lore raw

PATCH 13/15 arm: dts: Add k3-j721e-beagleboneai64

In reply to Nishanth Menon

From: Robert Nelson <[email protected]>

BeagleBoard.org BeagleBone AI-64 is an open source hardware single board computer based on the Texas Instruments TDA4VM SoC featuring dual-core 2.0GHz Arm Cortex-A72 processor, C7x+MMA and 2 C66x floating-point VLIW DSPs, 3x dual ARM Cortex-R5 co-processors, 2x 6-core Programmable Real-Time Unit and Industrial Communication SubSystem, PowerVR Rogue 8XE GE8430 3D GPU. The board features 4GB DDR4, USB3.0 Type-C, 2x USB SS Type-A, miniDisplayPort, 2x 4-lane CSI, DSI, 16GB eMMC flash, 1G Ethernet, M.2 E-key for WiFi/BT, and BeagleBone expansion headers.

This board family can be indentified by the BBONEAI-64-B0 in the at24 eeprom:

[aa 55 33 ee 01 37 00 10  2e 00 42 42 4f 4e 45 41 |.U3..7....BBONEA|]
[49 2d 36 34 2d 42 30 2d  00 00 42 30 30 30 37 38 |I-64-B0-..B00078|]

Baseline of the devicetree is from v6.6-rc1

https://beagleboard.org/ai-64
https://git.beagleboard.org/beagleboard/beaglebone-ai-64

---
 arch/arm/dts/Makefile                         |    5 +-
 .../dts/k3-j721e-beagleboneai64-u-boot.dtsi   |  206 ++
 arch/arm/dts/k3-j721e-beagleboneai64.dts      |  993 ++++++++
 .../k3-j721e-ddr-beagleboneai64-lp4-3200.dtsi | 2200 +++++++++++++++++
 arch/arm/dts/k3-j721e-r5-beagleboneai64.dts   |   96 +
 board/ti/j721e/MAINTAINERS                    |    7 +
 6 files changed, 3506 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi
 create mode 100644 arch/arm/dts/k3-j721e-beagleboneai64.dts
 create mode 100644 arch/arm/dts/k3-j721e-ddr-beagleboneai64-lp4-3200.dtsi
 create mode 100644 arch/arm/dts/k3-j721e-r5-beagleboneai64.dts
arch/arm/dts/Makefile +4 -1
index 55aceb51cdb0..2a76acd312d8 100644
@@ -1368,7 +1368,10 @@ dtb-$(CONFIG_SOC_K3_J721E) += k3-j721e-common-proc-board.dtb \
 			      k3-j7200-common-proc-board.dtb \
 			      k3-j7200-r5-common-proc-board.dtb \
 			      k3-j721e-sk.dtb \
-			      k3-j721e-r5-sk.dtb
+			      k3-j721e-r5-sk.dtb \
+			      k3-j721e-beagleboneai64.dtb \
+			      k3-j721e-r5-beagleboneai64.dtb
+
 dtb-$(CONFIG_SOC_K3_J721S2) += k3-am68-sk-base-board.dtb\
 			       k3-am68-sk-r5-base-board.dtb\
 			       k3-j721s2-common-proc-board.dtb\
arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi new file +206 -0

206 lines not on this page · raw message

arch/arm/dts/k3-j721e-beagleboneai64.dts new file +993 -0

993 lines not on this page · raw message

arch/arm/dts/k3-j721e-ddr-beagleboneai64-lp4-3200.dtsi new file +2200 -0

1,790 lines not on this page · raw message

arch/arm/dts/k3-j721e-r5-beagleboneai64.dts new file +96 -0

96 lines not on this page · raw message

board/ti/j721e/MAINTAINERS +7 -0
index f5ca7d06a347..8b79724dca39 100644

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.40.0

Part of the diff is not shown here. View the raw message.

#25 lore raw

PATCH 14/15 board: ti: Add j721e_beagleboneai64_* config fragments and env file

In reply to Nishanth Menon

Add defconfig fragments for J721E based BeagleBone AI-64 and corresponding customized environment.

---
 board/ti/j721e/beagleboneai64.env        | 19 ++++++++
 board/ti/j721e/beagleboneai64_a72.config | 55 ++++++++++++++++++++++++
 board/ti/j721e/beagleboneai64_r5.config  | 19 ++++++++
 3 files changed, 93 insertions(+)
 create mode 100644 board/ti/j721e/beagleboneai64.env
 create mode 100644 board/ti/j721e/beagleboneai64_a72.config
 create mode 100644 board/ti/j721e/beagleboneai64_r5.config
board/ti/j721e/beagleboneai64.env new file +19 -0
new file mode 100644
index 000000000000..4f0a94a8113e
@@ -0,0 +1,19 @@
+#include <env/ti/ti_common.env>
+#include <env/ti/default_findfdt.env>
+#include <env/ti/mmc.env>
+
+name_kern=Image
+console=ttyS2,115200n8
+args_all=setenv optargs ${optargs} earlycon=ns16550a,mmio32,0x02800000
+run_kern=booti ${loadaddr} ${rd_spec} ${fdtaddr}
+set_led_state_fail_load= led led-0 off; led led-1 on;
+	led led-2 off; led led-3 on; led led-4 off
+set_led_state_start_load=led led-0 on; led led-1 off;
+	led led-2 on; led led-3 off; led led-4 on
+boot=mmc
+mmcdev=1
+bootpart=1:1
+bootdir=/boot
+boot_targets=mmc1 mmc0 usb pxe
+bootmeths=script extlinux efi pxe
+rd_spec=-
board/ti/j721e/beagleboneai64_a72.config new file +55 -0

55 lines not on this page · raw message

board/ti/j721e/beagleboneai64_r5.config new file +19 -0
new file mode 100644
index 000000000000..cf124fb70cf1
@@ -0,0 +1,19 @@
+# Defconfig fragment to apply on top of:
+# j721e_evm_r5_defconfig
+
+CONFIG_DEFAULT_DEVICE_TREE="k3-j721e-r5-beagleboneai64"
+CONFIG_SPL_OF_LIST="k3-j721e-r5-beagleboneai64"
+
+# No ESM, PMIC or AVS adjustment till PMIC is enabled
+CONFIG_ESM_K3=n
+CONFIG_K3_AVS0=n
+CONFIG_ESM_PMIC=n
+
+# Do not use emmc boot - we will use FS only
+CONFIG_SUPPORT_EMMC_BOOT=n
+
+CONFIG_HBMC_AM654=n
+# No dependency on EEPROM detection
+CONFIG_TI_I2C_BOARD_DETECT=n
+# No board fixup to do
+CONFIG_OF_BOARD_SETUP=n
Signature · 1 line
2.40.0
#26 lore raw

Re: [PATCH 14/15] board: ti: Add j721e_beagleboneai64_* config fragments and env file

Quoted 8 lines · Nishanth Menon

Add defconfig fragments for J721E based BeagleBone AI-64 and corresponding customized environment.

---
  board/ti/j721e/beagleboneai64.env        | 19 ++++++++
  board/ti/j721e/beagleboneai64_a72.config | 55 ++++++++++++++++++++++++
  board/ti/j721e/beagleboneai64_r5.config  | 19 ++++++++

Beagle boards are not TI boards, add the board support to board/beagle/

Andrew

Quoted 116 lines
  3 files changed, 93 insertions(+)

create mode 100644 board/ti/j721e/beagleboneai64.env create mode 100644 board/ti/j721e/beagleboneai64_a72.config create mode 100644 board/ti/j721e/beagleboneai64_r5.config

board/ti/j721e/beagleboneai64.env new file +19 -0
new file mode 100644
index 000000000000..4f0a94a8113e
@@ -0,0 +1,19 @@
+#include <env/ti/ti_common.env>
+#include <env/ti/default_findfdt.env>
+#include <env/ti/mmc.env>
+
+name_kern=Image
+console=ttyS2,115200n8
+args_all=setenv optargs ${optargs} earlycon=ns16550a,mmio32,0x02800000
+run_kern=booti ${loadaddr} ${rd_spec} ${fdtaddr}
+set_led_state_fail_load= led led-0 off; led led-1 on;
+	led led-2 off; led led-3 on; led led-4 off
+set_led_state_start_load=led led-0 on; led led-1 off;
+	led led-2 on; led led-3 off; led led-4 on
+boot=mmc
+mmcdev=1
+bootpart=1:1
+bootdir=/boot
+boot_targets=mmc1 mmc0 usb pxe
+bootmeths=script extlinux efi pxe
+rd_spec=-
board/ti/j721e/beagleboneai64_a72.config new file +55 -0
new file mode 100644
index 000000000000..926f725508e5
@@ -0,0 +1,55 @@
+# Defconfig fragment to apply on top of j721e_evm_a72_defconfig
+
+CONFIG_DEFAULT_DEVICE_TREE="k3-j721e-beagleboneai64"
+CONFIG_SPL_OF_LIST="k3-j721e-beagleboneai64"
+CONFIG_OF_LIST="k3-j721e-beagleboneai64"
+CONFIG_BOOTCOMMAND="run set_led_state_start_load;run findfdt; run envboot; bootflow scan -lb;run set_led_state_fail_load"
+CONFIG_EXT4_WRITE=y
+CONFIG_LZO=y
+CONFIG_AUTOBOOT_KEYED=y
+CONFIG_AUTOBOOT_PROMPT="Press SPACE to abort autoboot in %d seconds\n"
+CONFIG_AUTOBOOT_DELAY_STR="d"
+CONFIG_AUTOBOOT_STOP_STR=" "
+
+# No Flash
+CONFIG_HBMC_AM654=n
+CONFIG_UFS=n
+
+# Sierra disabled for now till stability
+CONFIG_PHY_CADENCE_SIERRA=n
+CONFIG_PHY_J721E_WIZ=n
+# Torrent only for DP. no DP splash screen
+CONFIG_PHY_CADENCE_TORRENT=n
+
+# Use the Beaglebone-AI64 env file
+CONFIG_ENV_SOURCE_FILE="beagleboneai64"
+# No dependency on EEPROM detection
+CONFIG_TI_I2C_BOARD_DETECT=n
+# No board fixup to do
+CONFIG_OF_BOARD_SETUP=n
+
+# Do not use emmc boot - use FS only
+CONFIG_SUPPORT_EMMC_BOOT=n
+CONFIG_MMC_IO_VOLTAGE=y
+# CONFIG_SPL_MMC_IO_VOLTAGE is not set
+CONFIG_MMC_UHS_SUPPORT=y
+# CONFIG_SPL_MMC_UHS_SUPPORT is not set
+CONFIG_MMC_HS200_SUPPORT=y
+# CONFIG_SPL_MMC_HS200_SUPPORT is not set
+
+# Enable GPIO control
+CONFIG_DM_GPIO=y
+CONFIG_SPL_GPIO=y
+CONFIG_DA8XX_GPIO=y
+CONFIG_CMD_GPIO=y
+CONFIG_CMD_GPIO_READ=y
+# Enable LEDs
+CONFIG_LED=y
+CONFIG_LED_GPIO=y
+CONFIG_SPL_LED=y
+CONFIG_SPL_LED_GPIO=y
+# Enable I2C bus
+CONFIG_SPL_I2C=y
+CONFIG_DM_I2C=y
+CONFIG_SYS_I2C_OMAP24XX=y
+CONFIG_CMD_I2C=y
board/ti/j721e/beagleboneai64_r5.config new file +19 -0
new file mode 100644
index 000000000000..cf124fb70cf1
@@ -0,0 +1,19 @@
+# Defconfig fragment to apply on top of:
+# j721e_evm_r5_defconfig
+
+CONFIG_DEFAULT_DEVICE_TREE="k3-j721e-r5-beagleboneai64"
+CONFIG_SPL_OF_LIST="k3-j721e-r5-beagleboneai64"
+
+# No ESM, PMIC or AVS adjustment till PMIC is enabled
+CONFIG_ESM_K3=n
+CONFIG_K3_AVS0=n
+CONFIG_ESM_PMIC=n
+
+# Do not use emmc boot - we will use FS only
+CONFIG_SUPPORT_EMMC_BOOT=n
+
+CONFIG_HBMC_AM654=n
+# No dependency on EEPROM detection
+CONFIG_TI_I2C_BOARD_DETECT=n
+# No board fixup to do
+CONFIG_OF_BOARD_SETUP=n
#27 lore raw

Re: [PATCH 14/15] board: ti: Add j721e_beagleboneai64_* config fragments and env file

Quoted 11 lines · Andrew Davis
Quoted 8 lines · Nishanth Menon

Add defconfig fragments for J721E based BeagleBone AI-64 and corresponding customized environment.

---
  board/ti/j721e/beagleboneai64.env        | 19 ++++++++
  board/ti/j721e/beagleboneai64_a72.config | 55 ++++++++++++++++++++++++
  board/ti/j721e/beagleboneai64_r5.config  | 19 ++++++++

Beagle boards are not TI boards, add the board support to board/beagle/

Huh, why bring in commercials and organization changes here? am335x and am62 are under the TI umbrella.

$ git grep beagle board/|cut -d ':' -f1|sort -u
board/ti/am335x/board.c
board/ti/am335x/board.h
board/ti/am57xx/board.c
board/ti/am62x/beagleplay_a53.config
board/ti/am62x/beagleplay_r5.config
board/ti/am62x/MAINTAINERS
board/ti/beagle/beagle.c
board/ti/beagle/Kconfig
board/ti/beagle/led.c
board/ti/beagle/MAINTAINERS
board/ti/beagle/Makefile
board/ti/j721e/beagleboneai64_a72.config
board/ti/j721e/beagleboneai64_r5.config
board/ti/j721e/MAINTAINERS
board/timll/devkit8000/README
Signature · 3 lines
Regards,
Nishanth Menon
Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3  1A34 DDB5 849D 1736 249D
#28 lore raw

Re: [PATCH 14/15] board: ti: Add j721e_beagleboneai64_* config fragments and env file

Quoted 11 lines · Nishanth Menon
Quoted 10 lines · Andrew Davis
Quoted 8 lines · Nishanth Menon

Add defconfig fragments for J721E based BeagleBone AI-64 and corresponding customized environment.

---
   board/ti/j721e/beagleboneai64.env        | 19 ++++++++
   board/ti/j721e/beagleboneai64_a72.config | 55 ++++++++++++++++++++++++
   board/ti/j721e/beagleboneai64_r5.config  | 19 ++++++++
Quoted 5 lines
Quoted 1 line

Beagle boards are not TI boards, add the board support to board/beagle/

Huh, why bring in commercials and organization changes here? am335x and am62 are under the TI umbrella.

The SoCs used are yes, the boards are not, we only make our EVM/SK line of boards in house.

We did AM335x wrong, in board/ti/am335x/board.c we tried to support like 11 different boards in one file. And while it might have made adding our own extra EVMs easier, it only made things less clear for folks trying to add their own AM335x based boards[0].

We don't integrate support for any other board partner like this. Our friends over at Toradex or Phytec are currently upstreaming boards based on K3 SoCs and in doing so have shown us some areas we can improve.

We focus on these little short-cuts to make adding our EVMs (or boards that look like our EVMs) easy. But that only leads to extra work and code duplication for external boards.

If something is actually common to the SoC then lets move it to arch/arm/mach-k3/j721e. Tricks like board-variants.c only hide the issue and doesn't help folks wanting to add their boards based on our SoCs to their board/<vendor>/ directory.

Andrew

[0] See "Software Design" https://jaycarlson.net/embedded-linux/#am335x

Quoted 17 lines
$ git grep beagle board/|cut -d ':' -f1|sort -u
board/ti/am335x/board.c
board/ti/am335x/board.h
board/ti/am57xx/board.c
board/ti/am62x/beagleplay_a53.config
board/ti/am62x/beagleplay_r5.config
board/ti/am62x/MAINTAINERS
board/ti/beagle/beagle.c
board/ti/beagle/Kconfig
board/ti/beagle/led.c
board/ti/beagle/MAINTAINERS
board/ti/beagle/Makefile
board/ti/j721e/beagleboneai64_a72.config
board/ti/j721e/beagleboneai64_r5.config
board/ti/j721e/MAINTAINERS
board/timll/devkit8000/README
#29 lore raw

Re: [PATCH 14/15] board: ti: Add j721e_beagleboneai64_* config fragments and env file

Hello Andrew, All,

Le 03/11/2023 à 20:20, Andrew Davis a écrit :

Quoted 30 lines · Nishanth Menon
Quoted 11 lines · Andrew Davis
Quoted 10 lines · Nishanth Menon
Quoted 8 lines

Add defconfig fragments for J721E based BeagleBone AI-64 and corresponding customized environment.

---
   board/ti/j721e/beagleboneai64.env        | 19 ++++++++ board/ti/j721e/beagleboneai64_a72.config | 55 ++++++++++++++++++++++++ board/ti/j721e/beagleboneai64_r5.config  | 19 ++++++++

Quoted 5 lines
Quoted 1 line

Beagle boards are not TI boards, add the board support to board/beagle/

Huh, why bring in commercials and organization changes here? am335x and am62 are under the TI umbrella.

The SoCs used are yes, the boards are not, we only make our EVM/SK line of boards in house.

We did AM335x wrong, in board/ti/am335x/board.c we tried to support like 11 different boards in one file. And while it might have made adding our own extra EVMs easier, it only made things less clear for folks trying to add their own AM335x based boards[0].

We don't integrate support for any other board partner like this. Our friends over at Toradex or Phytec are currently upstreaming boards based on K3 SoCs and in doing so have shown us some areas we can improve.

Quoted 8 lines

We focus on these little short-cuts to make adding our EVMs (or boards that look like our EVMs) easy. But that only leads to extra work and code duplication for external boards.

If something is actually common to the SoC then lets move it to arch/arm/mach-k3/j721e. Tricks like board-variants.c only hide the issue and doesn't help folks wanting to add their boards based on our SoCs to their board/<vendor>/ directory.

I'm starting a new custom board bring-up based on a j721e SoC (without any SOM) and adding a now board variant from the u-boot provided in the TI SDK (based on 2023.04) is far from easy for the reasons mentioned above (extra work and code duplication for external boards).

Also the build break for j7200/j721e SoC as soon as CONFIG_TARGET_J721E_A72_EVM and CONFIG_TARGET_J7200_A72_EVM are undefined:

https://source.denx.de/u-boot/u-boot/-/blob/v2023.10/arch/arm/mach-k3/arm64-mmu.c?ref_type=tags#L71

I always wonder if I should work on top of EVMs board or create a new board/<vendor>/ directory for customer boards.

Best regards,
Romain

Quoted 22 lines

Andrew

[0] See "Software Design" https://jaycarlson.net/embedded-linux/#am335x

Quoted 17 lines
$ git grep beagle board/|cut -d ':' -f1|sort -u
board/ti/am335x/board.c
board/ti/am335x/board.h
board/ti/am57xx/board.c
board/ti/am62x/beagleplay_a53.config
board/ti/am62x/beagleplay_r5.config
board/ti/am62x/MAINTAINERS
board/ti/beagle/beagle.c
board/ti/beagle/Kconfig
board/ti/beagle/led.c
board/ti/beagle/MAINTAINERS
board/ti/beagle/Makefile
board/ti/j721e/beagleboneai64_a72.config
board/ti/j721e/beagleboneai64_r5.config
board/ti/j721e/MAINTAINERS
board/timll/devkit8000/README
#30 lore raw

Re: [PATCH 14/15] board: ti: Add j721e_beagleboneai64_* config fragments and env file

Quoted 42 lines · Romain Naour

Hello Andrew, All,

Le 03/11/2023 à 20:20, Andrew Davis a écrit :

Quoted 30 lines · Nishanth Menon
Quoted 11 lines · Andrew Davis
Quoted 10 lines · Nishanth Menon
Quoted 8 lines

Add defconfig fragments for J721E based BeagleBone AI-64 and corresponding customized environment.

---
    board/ti/j721e/beagleboneai64.env        | 19 ++++++++
    board/ti/j721e/beagleboneai64_a72.config | 55 ++++++++++++++++++++++++
    board/ti/j721e/beagleboneai64_r5.config  | 19 ++++++++
Quoted 5 lines
Quoted 1 line

Beagle boards are not TI boards, add the board support to board/beagle/

Huh, why bring in commercials and organization changes here? am335x and am62 are under the TI umbrella.

The SoCs used are yes, the boards are not, we only make our EVM/SK line of boards in house.

We did AM335x wrong, in board/ti/am335x/board.c we tried to support like 11 different boards in one file. And while it might have made adding our own extra EVMs easier, it only made things less clear for folks trying to add their own AM335x based boards[0].

We don't integrate support for any other board partner like this. Our friends over at Toradex or Phytec are currently upstreaming boards based on K3 SoCs and in doing so have shown us some areas we can improve.

Quoted 8 lines

We focus on these little short-cuts to make adding our EVMs (or boards that look like our EVMs) easy. But that only leads to extra work and code duplication for external boards.

If something is actually common to the SoC then lets move it to arch/arm/mach-k3/j721e. Tricks like board-variants.c only hide the issue and doesn't help folks wanting to add their boards based on our SoCs to their board/<vendor>/ directory.

Quoted 8 lines

I'm starting a new custom board bring-up based on a j721e SoC (without any SOM) and adding a now board variant from the u-boot provided in the TI SDK (based on 2023.04) is far from easy for the reasons mentioned above (extra work and code duplication for external boards).

Also the build break for j7200/j721e SoC as soon as CONFIG_TARGET_J721E_A72_EVM and CONFIG_TARGET_J7200_A72_EVM are undefined:

The issue is we didn't properly split J7200 support from J721e and now that there are differences between the two, the only way we have to check which is which is to check the TARGET board, not the SOC (as there is no SOC_K3_J7200, but we are working on that [0]). So currently adding new J721E/J7200 TARGET boards breaks things :(

Quoted 5 lines

https://source.denx.de/u-boot/u-boot/-/blob/v2023.10/arch/arm/mach-k3/arm64-mmu.c?ref_type=tags#L71

I always wonder if I should work on top of EVMs board or create a new board/<vendor>/ directory for customer boards.

New board/<vendor>/ would be preferred, we do things in our EVM board/ti/ dir that are specific to our EVMs, and there will be more churn, etc..

If adding a new board/<vendor>/ for our SoCs is difficult just let us know, we are working several issues to make it more easy going forward and guiding feedback always helps.

Andrew

[0] https://lore.kernel.org/all/20231106165044.xrmlxoyfbnkmpb5v@revolt/

Quoted 26 lines

Best regards,
Romain

Quoted 22 lines

Andrew

[0] See "Software Design" https://jaycarlson.net/embedded-linux/#am335x

Quoted 17 lines
$ git grep beagle board/|cut -d ':' -f1|sort -u
board/ti/am335x/board.c
board/ti/am335x/board.h
board/ti/am57xx/board.c
board/ti/am62x/beagleplay_a53.config
board/ti/am62x/beagleplay_r5.config
board/ti/am62x/MAINTAINERS
board/ti/beagle/beagle.c
board/ti/beagle/Kconfig
board/ti/beagle/led.c
board/ti/beagle/MAINTAINERS
board/ti/beagle/Makefile
board/ti/j721e/beagleboneai64_a72.config
board/ti/j721e/beagleboneai64_r5.config
board/ti/j721e/MAINTAINERS
board/timll/devkit8000/README
#31 lore raw

Re: [PATCH 14/15] board: ti: Add j721e_beagleboneai64_* config fragments and env file

Hello Andrew, All,

Le 17/11/2023 à 19:43, Andrew Davis a écrit :

Quoted 52 lines · Romain Naour
Quoted 42 lines

Hello Andrew, All,

Le 03/11/2023 à 20:20, Andrew Davis a écrit :

Quoted 30 lines · Nishanth Menon
Quoted 11 lines · Andrew Davis
Quoted 10 lines · Nishanth Menon
Quoted 8 lines

Add defconfig fragments for J721E based BeagleBone AI-64 and corresponding customized environment.

---
    board/ti/j721e/beagleboneai64.env        | 19 ++++++++ board/ti/j721e/beagleboneai64_a72.config | 55 ++++++++++++++++++++++++ board/ti/j721e/beagleboneai64_r5.config  | 19 ++++++++

Quoted 5 lines
Quoted 1 line

Beagle boards are not TI boards, add the board support to board/beagle/

Huh, why bring in commercials and organization changes here? am335x and am62 are under the TI umbrella.

The SoCs used are yes, the boards are not, we only make our EVM/SK line of boards in house.

We did AM335x wrong, in board/ti/am335x/board.c we tried to support like 11 different boards in one file. And while it might have made adding our own extra EVMs easier, it only made things less clear for folks trying to add their own AM335x based boards[0].

We don't integrate support for any other board partner like this. Our friends over at Toradex or Phytec are currently upstreaming boards based on K3 SoCs and in doing so have shown us some areas we can improve.

Quoted 8 lines

We focus on these little short-cuts to make adding our EVMs (or boards that look like our EVMs) easy. But that only leads to extra work and code duplication for external boards.

If something is actually common to the SoC then lets move it to arch/arm/mach-k3/j721e. Tricks like board-variants.c only hide the issue and doesn't help folks wanting to add their boards based on our SoCs to their board/<vendor>/ directory.

Quoted 8 lines

I'm starting a new custom board bring-up based on a j721e SoC (without any SOM) and adding a now board variant from the u-boot provided in the TI SDK (based on 2023.04) is far from easy for the reasons mentioned above (extra work and code duplication for external boards).

Also the build break for j7200/j721e SoC as soon as CONFIG_TARGET_J721E_A72_EVM and CONFIG_TARGET_J7200_A72_EVM are undefined:

Quoted 5 lines

The issue is we didn't properly split J7200 support from J721e and now that there are differences between the two, the only way we have to check which is which is to check the TARGET board, not the SOC (as there is no SOC_K3_J7200, but we are working on that [0]). So currently adding new J721E/J7200 TARGET boards breaks things :(

Ok, I understand.

Quoted 9 lines
Quoted 6 lines

https://source.denx.de/u-boot/u-boot/-/blob/v2023.10/arch/arm/mach-k3/arm64-mmu.c?ref_type=tags#L71

I always wonder if I should work on top of EVMs board or create a new board/<vendor>/ directory for customer boards.

New board/<vendor>/ would be preferred, we do things in our EVM board/ti/ dir that are specific to our EVMs, and there will be more churn, etc..

Ok, maybe I'll work on top of the EVM board support for the first try and create a new board/<vendor>/ while cleaning for the final release.

Quoted 4 lines

If adding a new board/<vendor>/ for our SoCs is difficult just let us know, we are working several issues to make it more easy going forward and guiding feedback always helps.

Thanks, for now I only have the SK-TDA4VM board and I'll receive the customer board in several weeks.

For now the main difficulty is to remove CONFIG_TARGET_J721E_{R6,A72}_EVM from the u-boot config file without breaking stuff.

Also I'm wondering if yaml files in board/ti/j721e/*-cfg.yaml are generic enough to avoid to copy them to board/<vendor>/. (I'm not yet familiar with binman tool).

Best regards,
Romain

Quoted 31 lines

Andrew

[0] https://lore.kernel.org/all/20231106165044.xrmlxoyfbnkmpb5v@revolt/

Quoted 26 lines

Best regards,
Romain

Quoted 22 lines

Andrew

[0] See "Software Design" https://jaycarlson.net/embedded-linux/#am335x

Quoted 17 lines
$ git grep beagle board/|cut -d ':' -f1|sort -u
board/ti/am335x/board.c
board/ti/am335x/board.h
board/ti/am57xx/board.c
board/ti/am62x/beagleplay_a53.config
board/ti/am62x/beagleplay_r5.config
board/ti/am62x/MAINTAINERS
board/ti/beagle/beagle.c
board/ti/beagle/Kconfig
board/ti/beagle/led.c
board/ti/beagle/MAINTAINERS
board/ti/beagle/Makefile
board/ti/j721e/beagleboneai64_a72.config
board/ti/j721e/beagleboneai64_r5.config
board/ti/j721e/MAINTAINERS
board/timll/devkit8000/README
#32 lore raw

Re: [PATCH 14/15] board: ti: Add j721e_beagleboneai64_* config fragments and env file

In reply to Nishanth Menon
Quoted 16 lines · Nishanth Menon
Quoted 11 lines · Andrew Davis
Quoted 8 lines · Nishanth Menon

Add defconfig fragments for J721E based BeagleBone AI-64 and corresponding customized environment.

---
  board/ti/j721e/beagleboneai64.env        | 19 ++++++++
  board/ti/j721e/beagleboneai64_a72.config | 55 ++++++++++++++++++++++++
  board/ti/j721e/beagleboneai64_r5.config  | 19 ++++++++

Beagle boards are not TI boards, add the board support to board/beagle/

Huh, why bring in commercials and organization changes here? am335x and am62 are under the TI umbrella.

Quoted 16 lines
$ git grep beagle board/|cut -d ':' -f1|sort -u
board/ti/am335x/board.c
board/ti/am335x/board.h
board/ti/am57xx/board.c
board/ti/am62x/beagleplay_a53.config
board/ti/am62x/beagleplay_r5.config
board/ti/am62x/MAINTAINERS
board/ti/beagle/beagle.c
board/ti/beagle/Kconfig
board/ti/beagle/led.c
board/ti/beagle/MAINTAINERS
board/ti/beagle/Makefile
board/ti/j721e/beagleboneai64_a72.config
board/ti/j721e/beagleboneai64_r5.config
board/ti/j721e/MAINTAINERS
board/timll/devkit8000/README

So, yeah, we've been bad about this historically for a few kinds of reasons, but it makes more sense now to have board/beagle/{x,y,z} than it does to have board/ti/... for these platforms.

Signature · 1 line
Tom
#33 lore raw

Re: [PATCH 14/15] board: ti: Add j721e_beagleboneai64_* config fragments and env file

Quoted 34 lines · Tom Rini
Quoted 16 lines · Nishanth Menon
Quoted 11 lines · Andrew Davis
Quoted 8 lines · Nishanth Menon

Add defconfig fragments for J721E based BeagleBone AI-64 and corresponding customized environment.

---
  board/ti/j721e/beagleboneai64.env        | 19 ++++++++
  board/ti/j721e/beagleboneai64_a72.config | 55 ++++++++++++++++++++++++
  board/ti/j721e/beagleboneai64_r5.config  | 19 ++++++++

Beagle boards are not TI boards, add the board support to board/beagle/

Huh, why bring in commercials and organization changes here? am335x and am62 are under the TI umbrella.

Quoted 16 lines
$ git grep beagle board/|cut -d ':' -f1|sort -u
board/ti/am335x/board.c
board/ti/am335x/board.h
board/ti/am57xx/board.c
board/ti/am62x/beagleplay_a53.config
board/ti/am62x/beagleplay_r5.config
board/ti/am62x/MAINTAINERS
board/ti/beagle/beagle.c
board/ti/beagle/Kconfig
board/ti/beagle/led.c
board/ti/beagle/MAINTAINERS
board/ti/beagle/Makefile
board/ti/j721e/beagleboneai64_a72.config
board/ti/j721e/beagleboneai64_r5.config
board/ti/j721e/MAINTAINERS
board/timll/devkit8000/README
Quoted 3 lines

So, yeah, we've been bad about this historically for a few kinds of reasons, but it makes more sense now to have board/beagle/{x,y,z} than it does to have board/ti/... for these platforms.

OK. I will respin.

Signature · 3 lines
Regards,
Nishanth Menon
Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3  1A34 DDB5 849D 1736 249D
#34 lore raw

PATCH 15/15 doc: board: ti: Add BeagleBone AI-64 documentation

In reply to Nishanth Menon

Add base documentation for BeagleBone AI-64.

---
 doc/board/ti/j721e_beagleboneai64.rst | 327 ++++++++++++++++++++++++++
 doc/board/ti/k3.rst                   |   1 +
 2 files changed, 328 insertions(+)
 create mode 100644 doc/board/ti/j721e_beagleboneai64.rst
doc/board/ti/j721e_beagleboneai64.rst new file +327 -0
new file mode 100644
index 000000000000..18e154bd417a
@@ -0,0 +1,327 @@
+.. SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
+.. sectionauthor:: Nishanth Menon <[email protected]>
+
+J721E/TDA4VM Beagleboard.org BeagleBone AI-64
+=============================================
+
+Introduction:
+-------------
+
+BeagleBoard.org BeagleBone AI-64 is an open source hardware single
+board computer based on the Texas Instruments TDA4VM SoC featuring
+dual-core 2.0GHz Arm Cortex-A72 processor, C7x+MMA and 2 C66x
+floating-point VLIW DSPs, 3x dual ARM Cortex-R5 co-processors,
+2x 6-core Programmable Real-Time Unit and Industrial Communication
+SubSystem, PowerVR Rogue 8XE GE8430 3D GPU. The board features 4GB
+DDR4, USB3.0 Type-C, 2x USB SS Type-A, miniDisplayPort, 2x 4-lane
+CSI, DSI, 16GB eMMC flash, 1G Ethernet, M.2 E-key for WiFi/BT, and
+BeagleBone expansion headers.
+
+Further information can be found at:
+
+* Product Page: https://beagleboard.org/ai-64
+* Hardware documentation: https://git.beagleboard.org/beagleboard/beaglebone-ai-64
+
+Boot Flow:
+----------
+Below is the pictorial representation of boot flow:
+
+.. image:: img/boot_diagram_j721e.svg
+  :alt: Boot flow diagram
+
+- On this platform, DMSC runs 'TI Foundational Security' (TIFS) which
+  functions as the security enclave master. The 'Device Manager' (DM),
+  also known as the 'TISCI server' in "TI terminology", running on boot
+  R5F, offers all the essential services required for device management.
+  The A72, C7x, C6x or R5F (Aux cores) sends requests to TIFS/DM to
+  accomplish the needed services, as illustrated in the diagram above.
+
+Sources:
+--------
+.. include::  k3.rst
+    :start-after: .. k3_rst_include_start_boot_sources
+    :end-before: .. k3_rst_include_end_boot_sources
+
+Build procedure:
+----------------
+0. Setup the environment variables:
+
+.. include::  k3.rst
+    :start-after: .. k3_rst_include_start_common_env_vars_desc
+    :end-before: .. k3_rst_include_end_common_env_vars_desc
+
+.. include::  k3.rst
+    :start-after: .. k3_rst_include_start_board_env_vars_desc
+    :end-before: .. k3_rst_include_end_board_env_vars_desc
+
+Set the variables corresponding to this platform:
+
+.. include::  k3.rst
+    :start-after: .. k3_rst_include_start_common_env_vars_defn
+    :end-before: .. k3_rst_include_end_common_env_vars_defn
+.. prompt:: bash $
+
+  export UBOOT_CFG_CORTEXR="j721e_evm_r5_defconfig beagleboneai64_r5.config"
+  export UBOOT_CFG_CORTEXA="j721e_evm_a72_defconfig beagleboneai64_a72.config"
+  export TFA_BOARD=generic
+  # we dont use any extra TFA parameters
+  unset TFA_EXTRA_ARGS
+  export OPTEE_PLATFORM=k3-j721e
+  # we dont use any extra OP-TEE parameters
+  unset OPTEE_EXTRA_ARGS
+
+.. include::  j721e_evm.rst
+    :start-after: .. j721e_evm_rst_include_start_build_steps
+    :end-before: .. j721e_evm_rst_include_end_build_steps
+
+Target Images
+--------------
+Copy the below images to an SD card and boot:
+
+* tiboot3-j721e-gp-evm.bin from R5 build as tiboot3.bin
+* tispl.bin_unsigned from Cortex-A build as tispl.bin
+* u-boot.img_unsigned from Cortex-A build as u-boot.img
+
+Image formats
+-------------
+
+- tiboot3.bin
+
+.. image:: img/no_multi_cert_tiboot3.bin.svg
+  :alt: tiboot3.bin image format
+
+- tispl.bin
+
+.. image:: img/dm_tispl.bin.svg
+  :alt: tispl.bin image format
+
+- sysfw.itb
+
+.. image:: img/sysfw.itb.svg
+  :alt: sysfw.itb image format
+
+Additional hardware for U-Boot development
+------------------------------------------
+
+* Serial Console is critical for U-Boot development on BeagleBone AI-64. See
+  `BeagleBone AI-64 connector documentation
+  <https://docs.beagleboard.org/latest/boards/beaglebone/ai-64/ch07.html>`_.
+* uSD is preferred option over eMMC, and a SD/MMC reader will be needed.
+* (optionally) JTAG is useful when working with very early stages of boot.
+
+Default storage options
+-----------------------
+
+There are multiple storage media options on BeagleBone AI-64, but primarily:
+
+* Onboard eMMC (default) - reliable, fast and meant for deployment use.
+* SD/MMC card interface (hold 'BOOT' switch and power on) - Entirely
+  depends on the SD card quality.
+
+Flash to uSD card or how to deal with "bricked" Board
+--------------------------------------------------------
+
+When deploying or working on Linux, it's common to use the onboard
+eMMC. However, avoiding the eMMC and using the uSD card is safer when
+working with U-Boot.
+
+If you choose to  hand format your own bootable uSD card, be
+aware that it can be difficult. The following information
+may be helpful, but remember that it is only sometimes
+reliable, and partition options can cause issues. These
+can potentially help:
+
+* https://git.ti.com/cgit/arago-project/tisdk-setup-scripts/tree/create-sdcard.sh
+* https://elinux.org/Beagleboard:Expanding_File_System_Partition_On_A_microSD
+
+The simplest option is to start with a standard distribution
+image like those in `BeagleBoard.org Distros Page
+<https://www.beagleboard.org/distros>`_ and download a disk image for
+BeagleBone AI-64. Pick a 16GB+ uSD card to be on the safer side.
+
+With an SD/MMC Card reader and `Balena Etcher
+<https://etcher.balena.io/>`_, having a functional setup in minutes is
+a trivial matter, and it works on almost all Host Operating Systems.
+Yes Windows users, Windows Subsystem for Linux(WSL) based development
+with U-Boot and update uSD card is practical.
+
+Updating U-Boot is a matter of copying the tiboot3.bin, tispl.bin and
+u-boot.img to the "BOOT" partition of the uSD card. Remember to sync
+and unmount (or Eject - depending on the Operating System) the uSD
+card prior to physically removing from SD card reader.
+
+Also see following section on switch setting used for booting using
+uSD card.
+
+.. note::
+  Great news! If the board has not been damaged physically, there's no
+  need to worry about it being "bricked" on this platform. You only have
+  to flash an uSD card, plug it in, and reinstall the image on eMMC. This
+  means that even if you make a mistake, you can quickly fix it and rest
+  easy.
+
+  If you are frequently working with uSD cards, you might find the
+  following useful:
+
+  * `USB-SD-Mux <https://www.linux-automation.com/en/products/usb-sd-mux.html>`_
+  * `SD-Wire <https://wiki.tizen.org/SDWire>`_
+
+Flash to eMMC
+-------------
+
+The eMMC layout selected is user-friendly for developers. The
+boot hardware partition of the eMMC only contains the fixed-size
+tiboot3.bin image. This is because the contents of the boot partitions
+need to run from the SoC's internal SRAM, which remains a fixed size
+constant. The other components of the boot sequence, such as tispl.bin
+and u-boot.img, are located in the /BOOT partition in the User Defined
+Area (UDA) hardware partition of the eMMC. These components can vary
+significantly in size. The choice of keeping tiboot3.bin in boot0 or
+boot1 partition depends on A/B update requirements.
+
+.. image:: img/beagleplay_emmc.svg
+  :alt: eMMC partitions and boot file organization for BeagleBone AI-64
+
+The following are the steps from Linux shell to program eMMC:
+
+.. prompt:: bash #
+
+  # Enable Boot0 boot
+  mmc bootpart enable 1 2 /dev/mmcblk0
+  mmc bootbus set single_backward x1 x8 /dev/mmcblk0
+  mmc hwreset enable /dev/mmcblk0
+
+  # Clear eMMC boot0
+  echo '0' >> /sys/class/block/mmcblk0boot0/force_ro
+  dd if=/dev/zero of=/dev/mmcblk0boot0 count=32 bs=128k
+  # Write tiboot3.bin
+  dd if=tiboot3.bin of=/dev/mmcblk0boot0 bs=128k
+
+  # Copy the rest of the boot binaries
+  mount /dev/mmcblk0p1 /boot/firmware
+  cp tispl.bin /boot/firmware
+  cp u-boot.img /boot/firmware
+  sync
+
+.. warning ::
+
+  U-Boot is configured to prioritize booting from an SD card if it
+  detects a valid boot partition and boot files on it, even if the
+  system initially booted from eMMC. The boot order is set as follows:
+
+  * SD/MMC
+  * eMMC
+  * USB
+  * PXE
+
+LED patterns during boot
+------------------------
+
+.. list-table:: USR LED status indication
+   :widths: 16 16
+   :header-rows: 1
+
+   * - USR LEDs (012345)
+     - Indicates
+
+   * - 00000
+     - Boot failure or R5 image not started up
+
+   * - 11111
+     - A53 SPL/U-boot has started up
+
+   * - 10101
+     - OS boot process has been initiated
+
+   * - 01010
+     - OS boot process failed and drops to U-Boot shell
+
+.. note ::
+
+  In the table above, 0 indicates LED switched off and 1 indicates LED
+  switched ON.
+
+.. warning ::
+
+  The green LED very next to the serial connector labelled "WKUP UART0"
+  is the power LED (LED6). This is the same color as the rest of the USR
+  LEDs. If the "green" LED6 power LED is not glowing, the system power
+  supply is not functional. Please refer to `BeagleBone AI-64 documentation
+  <https://beagleboard.org/ai-64/>`_ for further information.
+
+Switch Setting for Boot Mode
+----------------------------
+
+The boot time option is configured via "BOOT" button on the board.
+See `BeagleBone AI-64 Schematics <https://git.beagleboard.org/beagleboard/beaglebone-ai-64/-/blob/main/BeagleBone_AI-64_SCH.pdf>`_
+for details.
+
+.. list-table:: Boot Modes
+   :widths: 16 16 16
+   :header-rows: 1
+
+   * - BOOT Switch Position
+     - Primary Boot
+     - Secondary Boot
+
+   * - Not Pressed
+     - eMMC
+     - SD Card
+
+   * - Pressed
+     - SD Card
+     - SD Card
+
+To switch to SD card boot mode, hold the BOOT button while powering on
+with Type-C power supply, then release when power LED lights up.
+
+Debugging U-Boot
+----------------
+
+See :ref:`Common Debugging environment - OpenOCD<k3_rst_refer_openocd>`: for
+detailed setup and debugging information.
+
+.. warning::
+
+  **OpenOCD support since**: v0.12.0
+
+  If the default package version of OpenOCD in your development
+  environment's distribution needs to be updated, it might be necessary to
+  build OpenOCD from the source.
+
+.. include::  k3.rst
+    :start-after: .. k3_rst_include_start_openocd_connect_tag_connect
+    :end-before: .. k3_rst_include_end_openocd_connect_tag_connect
+
+.. include::  k3.rst
+    :start-after: .. k3_rst_include_start_openocd_cfg_external_intro
+    :end-before: .. k3_rst_include_end_openocd_cfg_external_intro
+
+For example, with BeagleBone AI-64 (J721e platform), the openocd_connect.cfg:
+
+.. code-block:: tcl
+
+  # TUMPA example:
+  # http://www.tiaowiki.com/w/TIAO_USB_Multi_Protocol_Adapter_User's_Manual
+  source [find interface/ftdi/tumpa.cfg]
+
+  transport select jtag
+
+  # default JTAG configuration has only SRST and no TRST
+  reset_config srst_only srst_push_pull
+
+  # delay after SRST goes inactive
+  adapter srst delay 20
+
+  if { ![info exists SOC] } {
+    # Set the SoC of interest
+    set SOC j721e
+  }
+
+  source [find target/ti_k3.cfg]
+
+  ftdi tdo_sample_edge falling
+
+  # Speeds for FT2232H are in multiples of 2, and 32MHz is tops
+  # max speed we seem to achieve is ~20MHz.. so we pick 16MHz
+  adapter speed 16000
doc/board/ti/k3.rst +1 -0
index 89d70db88647..52a5d4a095f2 100644
@@ -36,6 +36,7 @@ K3 Based SoCs
    am64x_evm
    am65x_evm
    j7200_evm
+   j721e_beagleboneai64
    j721e_evm
    j721s2_evm
 
Signature · 1 line
2.40.0
#35 lore raw
In reply to Nishanth Menon
Quoted 10 lines · Nishanth Menon

Cleanups for J721e/J7200 and add support for BeagleBone AI-64

Based off:
master 07fe79c93c5c Merge tag 'i2cfixes-for-v2024-01-rc2' of https://source.denx.de/u-boot/custodians/u-boot-i2c

Boot Logs:
J721e-SK: https://gist.github.com/nmenon/c144e64f1da9fd49997ef5794b056bb0
J721e-EVM: https://gist.github.com/nmenon/e79bed6807da05c723e71687fb3c0b90
J7200-HSEVM: https://gist.github.com/nmenon/5658dd6fa2f67bce915c77b25c02f897

Quoted 6 lines

BeagleBone AI-64:
SD/MMC boot: https://gist.github.com/nmenon/1e07858fb8ca39ca87e40d3894e4d9b7
eMMC boot: https://gist.github.com/nmenon/9b0602df1f1be2c6b512d135b0afae60
eMMC boot with SDcard detected: https://gist.github.com/nmenon/82058014f4b2f6b9ed21431bc675e12a

U-Boot CI: https://github.com/u-boot/u-boot/pull/444

Looking at the end result of the code, the split of evm.c looks good. One small thing is dropping common.h from the board files.

Signature · 1 line
Tom