compulab-yokneam / u-boot-compulab

u-boot-compulab
https://www.compulab.com/products/computer-on-modules/
0 stars 2 forks source link

ucm-imx8m-plus: U-boot stuck during boot when using emmc for env storage #4

Open belzerus opened 5 days ago

belzerus commented 5 days ago

I'm trying to configure u-boot to use env in emmc and boot through uuu on the ucm-imx8m-plus devkit. However it seems like the board get stuck before displaying the u-boot promt after SPL + firmware loading as far as I try to disable CONFIG_ENV_IS_NOWHERE .

I'm using the u-boot-compulab_v2023.04 branch plus below changes in the defconfig:

+CONFIG_SYS_MMC_ENV_DEV=2
+CONFIG_SYS_MMC_ENV_PART=1
 CONFIG_SYS_PROMPT="u-boot=> "
 CONFIG_SPL_SERIAL=y
 CONFIG_SPL_DRIVERS_MISC=y
@@ -86,7 +88,6 @@ CONFIG_CMD_EXT4_WRITE=y
 CONFIG_OF_CONTROL=y
 CONFIG_SPL_OF_CONTROL=y
 CONFIG_ENV_OVERWRITE=y
-CONFIG_ENV_IS_NOWHERE=y

That seems to lead to below when loading it through uuu (SDPS: boot -f flash.bin)

U-Boot SPL 2023.04-g201da4e764-dirty (Jul 04 2024 - 17:32:42 +0200)
pca9450@25 [ldo4][d] = 1v8
DDRINFO: EEPROM VALID DATA [ [ cafecafe ] = 1061010 4 
DDRINFO(D): Samsung 4096MB @ 3200 MHz
DDRINFO: start DRAM init
DDRINFO: DRAM rate 3200MTS
DDRINFO:ddrphy calibration done
DDRINFO: ddrmix config done
DDRINFO(M): mr5-8 [ 0x1061010 ]
DDRINFO(E): mr5-8 [ 0x1061010 ]
SEC0:  RNG instantiated
Normal Boot
Trying to boot from BOOTROM
Boot Stage: USB boot
Find img info 0x4801fc00, size 1256
Need continue download 1024
Download 1845392, Total size 1847440
NOTICE:  Do not release JR0 to NS as it can be used by HAB
NOTICE:  BL31: v2.8(release):lf-6.6.3-1.0.0-0-g8dbe28631
NOTICE:  BL31: Built : 17:57:56, Jan 22 2024

>>>>>>> STUCK HERE <<<<<<<

Any ideas if I'm missing something or if this is a real issue?

belzerus commented 4 days ago

Found a workaround forward for this. Seems like SDP boot (uuu) isn't really supported for this type of configuration on imx8 boards. So u-boot hanging if we get to the default case and NOWHERE is not set. So doing a hack like below will make it work for me..

diff --git a/arch/arm/mach-imx/imx8m/soc.c b/arch/arm/mach-imx/imx8m/soc.c
index 1b891ff2b8..3d18506830 100644
--- a/arch/arm/mach-imx/imx8m/soc.c
+++ b/arch/arm/mach-imx/imx8m/soc.c
@@ -2012,6 +2012,7 @@ enum env_location arch_env_get_location(enum env_operation op, int prio)
        case MMC1_BOOT:
        case MMC2_BOOT:
        case MMC3_BOOT:
+       case USB_BOOT:
                if (IS_ENABLED(CONFIG_ENV_IS_IN_MMC))
                        return ENVL_MMC;
                else if (IS_ENABLED(CONFIG_ENV_IS_IN_EXT4))
vraevsky commented 3 days ago

CompuLab decided to use NOWHERE for SDP. Ran into the same issue ~ years ago. It is up to you. whether to use EMMC for environment at SDP boot.