nxp-imx / mfgtools

Freescale/NXP I.MX Chip image deploy tools.
BSD 3-Clause "New" or "Revised" License
523 stars 293 forks source link

imx8mm: jump failed to start u-boot #427

Open parthitce opened 3 weeks ago

parthitce commented 3 weeks ago

Board: Phytec Tauri-L with imx8mm

U-boot mainline: https://source.denx.de/u-boot/u-boot Additional changes:

commit 579deeeba4516fa86541e3028779d557a8eefa65 (HEAD -> master)
Author: Parthiban Nallathambi <parthiban@linumiz.com>
Date:   Thu Jun 6 22:30:30 2024 +0530

    SDP WIP patch

    Upstream-Status: Inappropriate [Internal develpment]

    Signed-off-by: Parthiban Nallathambi <parthiban@linumiz.com>

diff --git a/configs/imx8mm-phygate-tauri-l_defconfig b/configs/imx8mm-phygate-tauri-l_defconfig
index cb292dde4c..9171e71530 100644
--- a/configs/imx8mm-phygate-tauri-l_defconfig
+++ b/configs/imx8mm-phygate-tauri-l_defconfig
@@ -57,6 +57,7 @@ CONFIG_CMD_FUSE=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
+CONFIG_CMD_USB_SDP=y
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
@@ -111,4 +112,17 @@ CONFIG_SYSRESET_PSCI=y
 CONFIG_SYSRESET_WATCHDOG=y
 CONFIG_DM_THERMAL=y
 CONFIG_IMX_TMU=y
+CONFIG_USB=y
+CONFIG_SPL_USB_HOST=y
+CONFIG_USB_EHCI_HCD=y
+CONFIG_MXC_USB_OTG_HACTIVE=y
+CONFIG_USB_GADGET=y
+CONFIG_SPL_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="FSL"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0525
+CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
+CONFIG_CI_UDC=y
+CONFIG_SDP_LOADADDR=0x40400000
+CONFIG_USB_GADGET_DOWNLOAD=y
+CONFIG_SPL_USB_SDP_SUPPORT=y
 CONFIG_IMX_WATCHDOG=y

and USB enabled in SPL using

git diff
diff --git a/arch/arm/dts/imx8mm-phygate-tauri-l-u-boot.dtsi b/arch/arm/dts/imx8mm-phygate-tauri-l-u-boot.dtsi
index f59f119374..037d28c19f 100644
--- a/arch/arm/dts/imx8mm-phygate-tauri-l-u-boot.dtsi
+++ b/arch/arm/dts/imx8mm-phygate-tauri-l-u-boot.dtsi
@@ -57,6 +57,18 @@
        bootph-pre-ram;
 };

+&usbmisc1 {
+       bootph-pre-ram;
+};
+
+&usbphynop1 {
+       bootph-pre-ram;
+};
+
+&usbotg1 {
+       bootph-pre-ram;
+};
+
 &usdhc2 {
        bootph-pre-ram;
 };

Compiled with

make ARCH=arm CROSS_COMPILE=aarch64-none-linux-gnu- make ARCH=arm CROSS_COMPILE=aarch64-none-linux-gnu- O=../out -j32 O=../out -j32
make ARCH=arm CROSS_COMPILE=aarch64-none-linux-gnu- O=../out -j32

TFA: https://review.trustedfirmware.org/TF-A/trusted-firmware-a.git

Problem:

Console log

U-Boot SPL 2024.07-rc4-00013-g579deeeba4-dirty (Jun 10 2024 - 08:40:54 +0530)
ofnode_read_prop: assigned-clock-rates: <not found>
ofnode_read_u32_index: timeout-sec: (not found)
ofnode_read_u32_index: hw_margin_ms: (not found)
ofnode_read_bool: u-boot,noautostart: false
ofnode_read_bool: u-boot,autostart: false
ofnode_read_prop: assigned-clock-rates: <not found>
ofnode_read_bool: fsl,ext-reset-output: true
WDT:   Started watchdog@30280000 with servicing every 1000ms (10s timeout)
Trying to boot from USB SDP
ofnode_read_prop: dr_mode: otg
ofnode_read_prop: assigned-clock-rates: <not found>
Looking for clock-controller@30380000
Looking for clock-controller@30380000
   - result for clock-controller@30380000: clock-controller@30380000 (ret=0)
   - result for clock-controller@30380000: clock-controller@30380000 (ret=0)
ofnode_read_prop: assigned-clock-rates: <not found>
ofnode_read_u32_index: clock-frequency: x (24000000)
ofnode_read_prop: assigned-clock-rates: <not found>
ofnode_read_prop: assigned-clock-rates: <not found>
ofnode_read_prop: assigned-clock-rates: <not found>
Looking for clock-controller@30380000
Looking for clock-controller@30380000
   - result for clock-controller@30380000: clock-controller@30380000 (ret=0)
   - result for clock-controller@30380000: clock-controller@30380000 (ret=0)
ofnode_read_prop: assigned-clock-rates: <not found>
Looking for clock-controller@30380000
Looking for clock-controller@30380000
   - result for clock-controller@30380000: clock-controller@30380000 (ret=0)
   - result for clock-controller@30380000: clock-controller@30380000 (ret=0)
USB EHCI 1.00
SDP: initialize...
SDP: handle requests...
Downloading file of size 887824 to 0x40400000... done
Jumping to header at 0x40400000
Header Tag is not an IMX image
Found header at 0x40422400

Running the built-in script using uuu -v -b emmc ./flash.bin

Wait for Known USB Device Appear...
New USB Device Attached at 3:53-
3:53->Start Cmd:SDP: boot -f ./flash.bin
100%3:53->Okay (0.58s)
New USB Device Attached at 3:53-
3:53->Start Cmd:SDPV: delay 1000
3:53->Okay (1.001s)
3:53->Start Cmd:SDPV: write -f ./flash.bin -skipspl
100%3:53->Okay (1.305s)
3:53->Start Cmd:SDPV: jump
100%

Analysis:

Thanks in advance for the hint or help to narrow down.