u-boot on custom board will not use boot_device=mmc
We have a custom board based on the stm32mp151 that shall boot from emmc. I can flash alright, but when I switch the boot pins, the boot device remains on usb. I can see from arch/arm/mach-stm32mp/cpu.c, that boot_device is set to usb, here is the debug line:
setup_boot_mode: boot_ctx=0x2203 => boot_mode=22, instance=1 forced=3when I break into u-boot, and manually set boot_device to mmc, it works. Also, it does not seem to pick up the default environment:
CPU: STM32MP151CAC Rev.Z
Model: STMicroelectronics custom STM32CubeMX board
Board: stm32mp1 in trusted mode (st,stm32mp151c-0068-new-linux-mx)
DRAM: 128 MiB
Clocks:
- MPU : 650 MHz
- MCU : 208 MHz
- AXI : 266.500 MHz
- PER : 24 MHz
- DDR : 533 MHz
STM32Programmer key pressed, entering download mode...
WDT: Not found!
NAND: 0 MiB
MMC: STM32 SD/MMC: 0
Loading Environment from MMC... MMC Device 1 not found
*** Warning - No MMC card found, using default environment
In: serial@40010000
Out: serial@40010000
Err: serial@40010000
setup_boot_mode: boot_ctx=0x2203 => boot_mode=22, instance=1 forced=3
invalid MAC address in OTP 00:00:00:00:00:00
Net: No ethernet found.
Hit any key to stop autoboot: 0
STM32MP> printenv boot_device
boot_device=usb
STM32MP> setenv boot_device mmc
STM32MP> env save
Saving Environment to MMC... MMC Device 1 not found
No MMC card found
Failed (1)
STM32MP> run bootcmd
Boot over mmc0!
Saving Environment to MMC... MMC Device 1 not found
No MMC card found
Failed (1)
switch to partitions #0, OK
mmc0(part 0) is current device
Scanning mmc 0:2...
Found U-Boot script /boot.scr.uimg
2943 bytes read in 4 ms (717.8 KiB/s)
## Executing script at c4100000The boot continues fine from there
