Forums » Software Development »
AM62A eMMC Boot - Kernel Device Tree
I’m working with the AM62A SoM and a Yocto development environment, switching between the CL devkit and custom hardware.
I am trying to boot the system with a modified device tree. This works fine from SD-cards but when I follow the instructions to boot eMMC the kernel is loaded with the device-tree that is part of the u-boot/tispl image (k3-am62a7-mitysom-devkit.dtb).
I believe this is related to the bootloader being unable to find the blob in the expected location of /boot/ and I would appreciate any input you have into fixing this.
I am working on rebuilding the u-boot image anyways, but this isn’t very sustainable for quick changes of the device tree.
Replies (11)
RE: AM62A eMMC Boot - Kernel Device Tree - Added by Jonathan Cormier 1 day ago
Hi Ben,
The device tree file that gets loaded is set in the fdtfile variable. You should be able to update it to match your device tree.
=> print fdtfile fdtfile="ti/k3-am62a7-mitysom-devkit.dtb" => setenv fdtfile "ti/k3-am62a7-mitysom-custom.dtb" => saveenv Saving Environment to MMC... Writing to MMC(0)... OK
Or if you want it to be the default, you can update it in the u-boot source CONFIG_DEFAULT_FDT_FILE.
https://support.criticallink.com/gitweb/?p=u-boot-ti.git;a=blob;f=configs/mitysom_am62ax_devkit_a53_defconfig;h=a3f458b6f83ba61ae78cd5ad56c1d1cc2f5020d1;hb=refs/heads/mitysom-u-boot-2025.01
Note: If you have run "saveenv" before, u-boot will ignore its built-in default environment. So changes made to the default env won't take effect unless you clear out the saved environment on the emmc.
RE: AM62A eMMC Boot - Kernel Device Tree - Added by Ben H 1 day ago
Hi Jonathan,
Thanks for your reply. Unfortunately, that did not solve the problem. The system fails to find the file and then proceeds to boot with the bootloader image fdt.
I have confirmed the dtb I want is located in the user partition (rootfs) at "/boot/dtb/ti/k3-am62a7-mitysom-<custom>.dtb" and is loaded properly when using SD-card boot
Let me know if there are any details/logs that would be helpful to see.
RE: AM62A eMMC Boot - Kernel Device Tree - Added by Jonathan Cormier 1 day ago
Yeah please share the console log during the boot attempt.
To get a bit more debug info, enable xtrace in u-boot before running boot
=> setenv xtrace yes => boot
Also print out the dtbs on the emmc
=> ls mmc 0 /boot/dtb/ti
./
../
2142 k3-am62a7-mitysom-devkit-imx219.dtbo
69311 k3-am62a7-mitysom-devkit.dtb
1059 k3-am62a7-mitysom-mcan.dtbo
46512 k3-am62a7-mitysom-poe-cam.dtb
1983 k3-am62a7-mitysom-sdhci2-wl1837.dtbo
47433 k3-am62a7-mitysom-testfixture.dtb
6 file(s), 2 dir(s)
RE: AM62A eMMC Boot - Kernel Device Tree - Added by Ben H 1 day ago
Hi Jonathan,
Some progress made, it now finds the file but still does not load it.
Here are the dtbs (the "-tfc" is mine)
=> ls mmc 0 /boot/dtb/ti
./
../
1059 k3-am62a7-mitysom-mcan.dtbo
69311 k3-am62a7-mitysom-devkit.dtb
64025 k3-am62a7-mitysom-tfc.dtb
1983 k3-am62a7-mitysom-sdhci2-wl1837.dtbo
47433 k3-am62a7-mitysom-testfixture.dtb
2142 k3-am62a7-mitysom-devkit-imx219.dtbo
46512 k3-am62a7-mitysom-poe-cam.dtb
7 file(s), 2 dir(s)
Here is the boot log:
boot + boot + run reset_hdmi + echo Resetting HDMI tfp410 Resetting HDMI tfp410 + i2c dev 1 Setting bus to 1 + i2c mw 0x20 3 fb + i2c mw 0x20 1 fb + i2c mw 0x20 1 ff + run envboot + mmc dev 0 switch to partitions #0, OK mmc0(part 0) is current device + mmc rescan + echo SD/MMC found on device 0 SD/MMC found on device 0 + test -n + run loadbootenv + fatload mmc 0 0x82000000 uEnv.txt Can't set block device + test -n + run bootcmd_ti_mmc + run init_mmc + run args_all args_mmc + setenv optargs earlycon=ns16550a,mmio32,0x02800000 mtdparts=spi-nand0:512k(ospi_nand.tiboot3),2m(ospi_nand.tispl),4m(ospi_nand.u-boot),256k(ospi_nand.env),256k(ospi_nand.env.backup),98048k@32m(ospi_nand.rootfs),256k@130816k(ospi_nand.phypattern) + run finduuid + part uuid mmc 0 uuid + setenv bootargs console=ttyS2,115200n8 earlycon=ns16550a,mmio32,0x02800000 mtdparts=spi-nand0:512k(ospi_nand.tiboot3),2m(ospi_nand.tispl),4m(ospi_nand.u-boot),256k(ospi_nand.env),256k(ospi_nand.env.backup),98048k@32m(ospi_nand.rootfs),256k@130816k(ospi_nand.phypattern) root=PARTUUID=13ce8ce8-3899-4f35-b870-5f9dcc0e7d05 rw rootfstype=ext4 rootwait + run update_do_main_cpsw0_qsgmii_phyinit + setenv do_main_cpsw0_qsgmii_phyinit 0 + test 0 -eq 1 + run boot_rprocs + test 1 -eq 1 + test mmc = mmc + rproc init + run boot_rprocs_mmc + env set rproc_id + env set rproc_fw + env set secure_suffix + test 0 -eq 1 + test -z + env set rproc_id 0 + test -z 0 + env set rproc_fw /lib/firmware/am62a-mcu-r5f0_0-fw + run rproc_load_and_boot_one + load mmc 0 0x82000000 /lib/firmware/am62a-mcu-r5f0_0-fw 54164 bytes read in 5 ms (10.3 MiB/s) + rproc load 0 0x82000000 d394 Warning: Did not detect image signing certificate. Skipping authentication to prevent boot failure. This will fail on Security Enforcing(HS-SE) devices Load Remote Processor 0 with data@addr=0x82000000 54164 bytes: Success! + rproc start 0 + env set rproc_id + env set rproc_fw + test -z + env set rproc_id 2 + test -z 2 + env set rproc_fw /lib/firmware/am62a-c71_0-fw + run rproc_load_and_boot_one + load mmc 0 0x82000000 /lib/firmware/am62a-c71_0-fw 19210280 bytes read in 109 ms (168.1 MiB/s) + rproc load 2 0x82000000 1252028 Warning: Did not detect image signing certificate. Skipping authentication to prevent boot failure. This will fail on Security Enforcing(HS-SE) devices Load Remote Processor 2 with data@addr=0x82000000 19210280 bytes: Success! + rproc start 2 + env set rproc_id + env set rproc_fw + test -z + env set rproc_id + test -z + env set rproc_id Boot + test -z Boot + env set rproc_fw rproc + run rproc_load_and_boot_one + load mmc 0 0x82000000 rproc Failed to load 'rproc' + env set rproc_id + env set rproc_fw + test -z + env set rproc_id in + test -z in + env set rproc_fw u-boot + run rproc_load_and_boot_one + load mmc 0 0x82000000 u-boot Failed to load 'u-boot' + env set rproc_id + env set rproc_fw + test 0 -eq 1 + run get_kern_mmc + load mmc 0 0x82000000 /boot/Image 29514240 bytes read in 161 ms (174.8 MiB/s) + run get_fdt_mmc + load mmc 0 0x88000000 /boot/dtb/ti/k3-am62a7-mitysom-tfc.dtb 64025 bytes read in 2 ms (30.5 MiB/s) + run get_overlay_mmc + fdt address 0x88000000 Working FDT set to 88000000 + fdt resize 0x100000 + run run_kern + booti 0x82000000 - 88000000 ## Flattened Device Tree blob at 88000000 Booting using the fdt blob at 0x88000000 Working FDT set to 88000000 Loading Device Tree to 000000008feed000, end 000000008fffffff ... OK Working FDT set to 8feed000
RE: AM62A eMMC Boot - Kernel Device Tree - Added by Jonathan Cormier about 16 hours ago
Some progress made, it now finds the file but still does not load it.
It looks like it did load it from the eMMC so that is indeed progress
+ load mmc 0 0x82000000 /boot/Image 29514240 bytes read in 161 ms (174.8 MiB/s) + run get_fdt_mmc + load mmc 0 0x88000000 /boot/dtb/ti/k3-am62a7-mitysom-tfc.dtb 64025 bytes read in 2 ms (30.5 MiB/s) + run get_overlay_mmc + fdt address 0x88000000 Working FDT set to 88000000 + fdt resize 0x100000 + run run_kern + booti 0x82000000 - 88000000 ## Flattened Device Tree blob at 88000000 Booting using the fdt blob at 0x88000000 Working FDT set to 88000000 Loading Device Tree to 000000008feed000, end 000000008fffffff ... OK Working FDT set to 8feed000
Is this were the boot stopped? Kind of a strange place for it to hang,
Normally if a boot was going to crash, its usually right after the Starting kernel line, which indicated u-boot has jumped to the kernel code.
[17:50:52.030] + booti 0x82000000 - 88000000 [17:50:52.041] ## Flattened Device Tree blob at 88000000 [17:50:52.041] Booting using the fdt blob at 0x88000000 [17:50:52.041] Working FDT set to 88000000 [17:50:52.080] Loading Device Tree to 000000008feec000, end 000000008fffffff ... OK [17:50:52.083] Working FDT set to 8feec000 [17:50:52.100] Starting kernel ...
Does it boot if you ask it to load the devkit dts?
RE: AM62A eMMC Boot - Kernel Device Tree - Added by Ben H about 16 hours ago
Sorry, I just posted the u-boot log, it does indeed boot. Per the u-boot log it claims to load my dtb but the differences in the device tree once in linux are not present, here's just one example, if in SD boot I see my device tree reflected properly:
root@mitysom-am62ax-tfc:~# find /sys/firmware/devicetree/base | grep uart5 /sys/firmware/devicetree/base/bus@f0000/pinctrl@f4000/uart5-default-pins /sys/firmware/devicetree/base/bus@f0000/pinctrl@f4000/uart5-default-pins/pinctrl-single,pins /sys/firmware/devicetree/base/bus@f0000/pinctrl@f4000/uart5-default-pins/phandle /sys/firmware/devicetree/base/bus@f0000/pinctrl@f4000/uart5-default-pins/name /sys/firmware/devicetree/base/__symbols__/uart5_pins_default /sys/firmware/devicetree/base/__symbols__/main_uart5
But after eMMC boot (and claiming to load the -tfc.dtb) it matches the devkit dtb not mine
root@mitysom-am62ax-tfc:~# find /sys/firmware/devicetree/base | grep uart5 /sys/firmware/devicetree/base/__symbols__/main_uart5
I am attaching full boot logs from SD and EMMC boot.
| emmc boot.txt (47.6 KB) emmc boot.txt | |||
| sd-boot.txt (52.1 KB) sd-boot.txt |
RE: AM62A eMMC Boot - Kernel Device Tree - Added by Michael Williamson about 15 hours ago
can you also post the dtb file?
RE: AM62A eMMC Boot - Kernel Device Tree - Added by Jonathan Cormier about 15 hours ago
Thanks Ben, I hadn't realized that.
Lets make sure the tfc device tree file contains what you expect it to.
Do you have the "dtc" tool on the filesystem, I think we include it by default?
You can use it to inspect the compiled dtbs to ensure they contain what you expect
[11:15:57.501] root@mitysom-am62ax:/opt/edgeai-gst-apps# dtc -q /boot/dtb/ti/k3-am62a7-mitysom-devkit.dtb | grep uart5 [11:15:58.208] main_uart5 = "/bus@f0000/serial@2850000";
You can also point it to the loaded device tree, as sometimes that's easier to parse in text instead of as a file tree.
Note: /proc/device-tree and /sys/firmware/devicetree/base point to the same thing, proc is just shorter.
[11:19:16.543] root@mitysom-am62ax:/opt/edgeai-gst-apps# dtc -q /proc/device-tree | grep uart5 [11:19:23.537] main_uart5 = "/bus@f0000/serial@2850000";
# ls -la /proc/device-tree lrwxrwxrwx 1 root root 29 Feb 5 16:54 /proc/device-tree -> /sys/firmware/devicetree/base
RE: AM62A eMMC Boot - Kernel Device Tree - Added by Jonathan Cormier about 14 hours ago
It would also be a good idea to md5sum the emmc and sdcard versions of the tfc dtb to make sure they are infact identical.
RE: AM62A eMMC Boot - Kernel Device Tree - Added by Ben H about 14 hours ago
I md5sum'ed the SD dtb and the emmc dtb, they were in-fact different. I re-copied the files and now it is working. I guess in some step I mixed up which device I had updated the rootfs on. I think this is solved. Thank you for your help!
RE: AM62A eMMC Boot - Kernel Device Tree - Added by Jonathan Cormier about 14 hours ago
Great glad it worked. Hopefully the dtc command examples will be helpful for you and others as well