Tool/software:
Hi,
I am using custom design for TDA4VM replicating SK-TDA4VM.
I missed Board ID EEPROM which I discussed in this thread tda4vm-custom-pcb-s-compatible-device.
So, I am using k3-j721e-common-proc-board.dts replicating k3-j721e-sk.dts instead of direct k3-j721e-sk.dts.
Enabling EMMC
I am using eMMC [MTFC128GAZAQJP-IT] in mmc0.
Changes in linux-ti-staging device tree k3-j721e-sk.dts (in my case k3-j721e-common-proc-board.dts):
&main_sdhci0 { - status = "disabled"; + non-removable; + ti,driver-strength-ohm = <50>; + disable-wp; };
The eMMC is working fine in Linux kernel, I can be able to read and write data.
Enabling mmc0 in U-Boot
Now I wanted to try eMMC boot. So first I decided to add mmc0 in u-boot. I was in the confusion about u-boot's device tree. And figured out a way to take arch/arm/dts/k3-j721e-sk.dts
Here is the change I did in arch/arm/dts/k3-j721e-binman.dtsi#ifdef CONFIG_TARGET_J721E_A72_EVM
#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_EVM_DTB "spl/dts/k3-j721e-sk.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"
+ #define J721E_EVM_DTB "arch/arm/dts/k3-j721e-sk.dtb"
#define J721E_SK_DTB "arch/arm/dts/k3-j721e-sk.dtb"
Here is the change for mmc0diff --git a/arch/arm/dts/k3-j721e-sk-u-boot.dtsi b/arch/arm/dts/k3-j721e-sk-u-boot.dtsi
index 9731094af2..d56b1cf2cf 100644
--- a/arch/arm/dts/k3-j721e-sk-u-boot.dtsi
+++ b/arch/arm/dts/k3-j721e-sk-u-boot.dtsi
@@ -27,6 +27,7 @@
i2c0 = &wkup_i2c0;
i2c1 = &mcu_i2c0;
i2c2 = &main_i2c0;
+ mmc0 = &main_sdhci0; /* SD Card */
mmc1 = &main_sdhci1; /* SD Card */
};
};
@@ -122,7 +123,7 @@
};
&main_sdhci0 {
- status = "disabled";
+ bootph-pre-ram;
};
&main_sdhci1 {
diff --git a/arch/arm/dts/k3-j721e-sk.dts b/arch/arm/dts/k3-j721e-sk.dts
index 34b762cd0e..38a3523eb0 100644
--- a/arch/arm/dts/k3-j721e-sk.dts
+++ b/arch/arm/dts/k3-j721e-sk.dts
@@ -376,8 +362,10 @@
};
&main_sdhci0 {
- /* Unused */
- status = "disabled";
+ /* eMMC */
+ non-removable;
+ ti,driver-strength-ohm = <50>;
+ disable-wp;
};
&main_sdhci1 {
After this board successfully booted with changes in k3-j721e-sk.dtb
Flashing eMMC
Now I am trying to flash eMMC with tisdk-edgeai-image-j721e-evm.wic (which is successfully booted in SD card)
I used the following command to flash eMMC.
root@j721e-evm:~# dd if=tisdk-edgeai-image-j721e-evm.wic of=/dev/mmcblk0 status=progress
After successful flashing, I can see following partitionsroot@j721e-evm:~# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
mtdblock0 31:0 0 512K 0 disk
mtdblock1 31:1 0 2M 0 disk
mtdblock2 31:2 0 4M 0 disk
mtdblock3 31:3 0 256K 0 disk
mtdblock4 31:4 0 1M 0 disk
mtdblock5 31:5 0 256K 0 disk
mtdblock6 31:6 0 55.8M 0 disk
mtdblock7 31:7 0 256K 0 disk
mmcblk0 179:0 0 118.6G 0 disk
|-mmcblk0p1 179:1 0 128M 0 part /run/media/BOOT-mmcblk0p1
`-mmcblk0p2 179:2 0 9.8G 0 part /run/media/rootfs-mmcblk0p2
mmcblk0boot0 179:32 0 31.5M 1 disk
mmcblk0boot1 179:64 0 31.5M 1 disk
mmcblk1 179:96 0 119.1G 0 disk
|-mmcblk1p1 179:97 0 128M 0 part /run/media/BOOT-mmcblk1p1
`-mmcblk1p2 179:98 0 119G 0 part /
The Problem
After this I rebooted, but the board is trying to boot from eMMC without changing and boot mode pins. Unfortunately, there is error in flashed build. In spl/dts/k3-j721e-sk.dtb, mmc0 is not defined probably.
So, board is struck at u-boot
Here is the log:U-Boot SPL 2023.04-ti-gf9b966c67473 (Mar 19 2024 - 20:31:40 +0000)
SYSFW ABI: 3.1 (firmware rev 0x0009 '9.2.4--v09.02.04 (Kool Koala)')
EEPROM not available at 0x50, trying to read at 0x51
Reading on-board EEPROM at 0x51 failed -121
Trying to boot from MMC1
mmc_load_image_raw_sector: mmc block read error
Warning: Detected image signing certificate on GP device. Skipping certificate to prevent boot failure. This will fail if the image was also encrypted
Warning: Detected image signing certificate on GP device. Skipping certificate to prevent boot failure. This will fail if the image was also encrypted
Warning: Detected image signing certificate on GP device. Skipping certificate to prevent boot failure. This will fail if the image was also encrypted
Warning: Detected image signing certificate on GP device. Skipping certificate to prevent boot failure. This will fail if the image was also encrypted
Warning: Detected image signing certificate on GP device. Skipping certificate to prevent boot failure. This will fail if the image was also encrypted
Loading Environment from nowhere... OK
init_env from device 17 not supported!
Starting ATF on ARM64 core...
NOTICE: BL31: v2.10.0(release):v2.10.0-367-g00f1ec6b87-dirty
NOTICE: BL31: Built : 16:09:05, Feb 9 2024
I/TC:
I/TC: OP-TEE version: 4.1.0-51-g012cdca49 (gcc version 11.4.0 (GCC)) #1 Tue Jan 30 10:48:03 UTC 2024 aarch64
I/TC: WARNING: This OP-TEE configuration might be insecure!
I/TC: WARNING: Please check https://optee.readthedocs.io/en/latest/architecture/porting_guidelines.html
I/TC: Primary CPU initializing
I/TC: GIC redistributor base address not provided
I/TC: Assuming default GIC group status and modifier
I/TC: SYSFW ABI: 3.1 (firmware rev 0x0009 '9.2.4--v09.02.04 (Kool Koala)')
I/TC: HUK Initialized
I/TC: Activated SA2UL device
I/TC: Fixing SA2UL firewall owner for GP device
I/TC: Enabled firewalls for SA2UL TRNG device
I/TC: SA2UL TRNG initialized
I/TC: SA2UL Drivers initialized
I/TC: Primary CPU switching to normal world boot
U-Boot SPL 2023.04-ti-gf9b966c67473 (Mar 19 2024 - 20:31:40 +0000)
SYSFW ABI: 3.1 (firmware rev 0x0009 '9.2.4--v09.02.04 (Kool Koala)')
EEPROM not available at 0x50, trying to read at 0x51
Reading on-board EEPROM at 0x51 failed -121
Trying to boot from MMC1
MMC Device 0 not found
spl: could not find mmc device 0. error: -19
SPL: failed to boot from all boot devices
### ERROR ### Please RESET the board ###
Regardless of SD card present or not board tries to boot through eMMC only.
But as per my bootmode pins SD card(mmc1) should be the first.
I thought of changing mmcdev and bootpart in u-boot but the build failed before that.
Here is the log when booted through SD card:U-Boot SPL 2023.04-ti-gf9b966c67473 (Mar 19 2024 - 20:31:40 +0000)
SYSFW ABI: 3.1 (firmware rev 0x0009 '9.2.4--v09.02.04 (Kool Koala)')
EEPROM not available at 0x50, trying to read at 0x51
Reading on-board EEPROM at 0x51 failed -121
Trying to boot from MMC2
Warning: Detected image signing certificate on GP device. Skipping certificate to prevent boot failure. This will fail if the image was also encrypted
Warning: Detected image signing certificate on GP device. Skipping certificate to prevent boot failure. This will fail if the image was also encrypted
Warning: Detected image signing certificate on GP device. Skipping certificate to prevent boot failure. This will fail if the image was also encrypted
Warning: Detected image signing certificate on GP device. Skipping certificate to prevent boot failure. This will fail if the image was also encrypted
Warning: Detected image signing certificate on GP device. Skipping certificate to prevent boot failure. This will fail if the image was also encrypted
Loading Environment from nowhere... OK
Starting ATF on ARM64 core...
NOTICE: BL31: v2.10.0(release):v2.10.0-367-g00f1ec6b87-dirty
NOTICE: BL31: Built : 16:09:05, Feb 9 2024
I/TC:
I/TC: OP-TEE version: 4.1.0-51-g012cdca49 (gcc version 11.4.0 (GCC)) #1 Tue Jan 30 10:48:03 UTC 2024 aarch64
I/TC: WARNING: This OP-TEE configuration might be insecure!
I/TC: WARNING: Please check https://optee.readthedocs.io/en/latest/architecture/porting_guidelines.html
I/TC: Primary CPU initializing
I/TC: GIC redistributor base address not provided
I/TC: Assuming default GIC group status and modifier
I/TC: SYSFW ABI: 3.1 (firmware rev 0x0009 '9.2.4--v09.02.04 (Kool Koala)')
I/TC: HUK Initialized
I/TC: Activated SA2UL device
I/TC: Fixing SA2UL firewall owner for GP device
I/TC: Enabled firewalls for SA2UL TRNG device
I/TC: SA2UL TRNG initialized
I/TC: SA2UL Drivers initialized
I/TC: Primary CPU switching to normal world boot
U-Boot SPL 2023.04-ti-gf9b966c67473 (Mar 19 2024 - 20:31:40 +0000)
SYSFW ABI: 3.1 (firmware rev 0x0009 '9.2.4--v09.02.04 (Kool Koala)')
EEPROM not available at 0x50, trying to read at 0x51
Reading on-board EEPROM at 0x51 failed -121
Trying to boot from MMC2
Warning: Detected image signing certificate on GP device. Skipping certificate to prevent boot failure. This will fail if the image was also encrypted
Warning: Detected image signing certificate on GP device. Skipping certificate to prevent boot failure. This will fail if the image was also encrypted
U-Boot 2023.04-ti-gf9b966c67473 (Mar 19 2024 - 20:31:40 +0000)
SoC: J721E SR1.1 GP
Model: Texas Instruments J721E SK A72
EEPROM not available at 0x50, trying to read at 0x51
Reading on-board EEPROM at 0x51 failed -121
Board: J721EX-PM1-SOM rev E2
DRAM: 2 GiB (effective 4 GiB)
Core: 96 devices, 34 uclasses, devicetree: separate
Flash: 0 Bytes
MMC: mmc@4f80000: 0, mmc@4fb0000: 1
Loading Environment from nowhere... OK
In: serial@2800000
Out: serial@2800000
Err: serial@2800000
am65_cpsw_nuss ethernet@46000000: K3 CPSW: nuss_ver: 0x6BA00101 cpsw_ver: 0x6BA80100 ale_ver: 0x00293904 Ports:1 mdio_freq:1000000
EEPROM not available at 0x50, trying to read at 0x51
Reading on-board EEPROM at 0x51 failed -121
Net: eth0: ethernet@46000000port@1
Hit any key to stop autoboot: 0
switch to partitions #0, OK
mmc1 is current device
SD/MMC found on device 1
Failed to load 'boot.scr'
1493 bytes read in 21 ms (69.3 KiB/s)
Loaded env from uEnv.txt
Importing environment from mmc1 ...
Running uenvcmd ...
1 bytes read in 21 ms (0 Bytes/s)
Already setup.
GPIO: 'gpio@22_17' not found
Command 'gpio' failed: Error -22
GPIO: 'gpio@22_16' not found
Command 'gpio' failed: Error -22
k3_r5f_rproc r5f@41000000: Core 1 is already in use. No rproc commands work
Failed to load '/lib/firmware/j7-mcu-r5f0_1-fw'
450240 bytes read in 33 ms (13 MiB/s)
Load Remote Processor 2 with data@addr=0x82000000 450240 bytes: Success!
322804 bytes read in 31 ms (9.9 MiB/s)
Load Remote Processor 3 with data@addr=0x82000000 322804 bytes: Success!
Failed to load '/lib/firmware/j7-main-r5f1_0-fw'
Failed to load '/lib/firmware/j7-main-r5f1_1-fw'
998192 bytes read in 45 ms (21.2 MiB/s)
Load Remote Processor 6 with data@addr=0x82000000 998192 bytes: Success!
998192 bytes read in 44 ms (21.6 MiB/s)
Load Remote Processor 7 with data@addr=0x82000000 998192 bytes: Success!
13504656 bytes read in 134 ms (96.1 MiB/s)
Load Remote Processor 8 with data@addr=0x82000000 13504656 bytes: Success!
19376640 bytes read in 408 ms (45.3 MiB/s)
100343 bytes read in 26 ms (3.7 MiB/s)
Working FDT set to 88000000
10434 bytes read in 24 ms (423.8 KiB/s)
3381 bytes read in 24 ms (136.7 KiB/s)
## Flattened Device Tree blob at 88000000
Booting using the fdt blob at 0x88000000
Working FDT set to 88000000
ERROR: reserving fdt memory region failed (addr=880000000 size=27000000 flags=4)
Loading Device Tree to 000000008fee4000, end 000000008fffffff ... OK
Working FDT set to 8fee4000
Starting kernel ...
My bootmode pins are:
MCU_BOOTMODE [9:0] = 00 0000 0000
SYS_BOOTMODE [7:0] = 0100 1011
SDK Version: 9.2