Skip to content

Check if bootm start succeeded before trying to loados#2

Open
penguinwhisperer wants to merge 1 commit intomicrochip-ung:bsp-v2024.04from
penguinwhisperer:bsp-v2024.04
Open

Check if bootm start succeeded before trying to loados#2
penguinwhisperer wants to merge 1 commit intomicrochip-ung:bsp-v2024.04from
penguinwhisperer:bsp-v2024.04

Conversation

@penguinwhisperer
Copy link

When using a U-boot FIP with CONFIG_FIT_SIGNATURE=y, attempting to boot an Image.itb signed with a different key on the LAN969x will cause the device to bootloop and requires manually fixing in U-boot. This is due to no checks being done when ramboot finishes running bootm start, resulting in bootm loados trying to load an invalid image and U-boot panicking.

If ramboot is called from mmc_tryboot (which is the default path from bootcmd), mmc_swap will run at the end of the early finished mmc_tryboot situation to swap to the alternate, working Image.itb file on the other partition. Tested with lan969x_ev23x71a, other dual-image MMC devices may also be able to apply this patch.

U-Boot 2024.04 (Mar 23 2026 - 10:24:31 +0000)

CPU:   ARM A53
Model: lan969x ev23x71a (pcb8398)
DRAM:  896 MiB (effective 897.9 MiB)
Core:  32 devices, 17 uclasses, devicetree: fit
MMC:   emmc@e0830000: 0
Loading Environment from MMC... OK
In:    serial
Out:   serial
Err:   serial
Net:   eth0: switch@0
Hit any key to stop autoboot:  0  
7434999 bytes read in 177 ms (40.1 MiB/s)
Working FDT set to 64000000
libfdt fdt_path_offset() returned FDT_ERR_NOTFOUND
libfdt fdt_path_offset() returned FDT_ERR_NOTFOUND
## Loading kernel from FIT Image at 64000000 ...
  Using 'lan9698_ev23x71a_0_at_lan969x' configuration
  Verifying Hash Integrity ... sha1,rsa2048:dev-  error!
Verification failed for '<NULL>' hash node in 'lan9698_ev23x71a_0_at_lan969x' config node
Failed to verify required signature 'key-dev'
Bad Data Hash
ERROR -2: can't get kernel image!
  XIP Invalid Image to 0
"Synchronous Abort" handler, esr 0x96000147, far 0x0
elr: 0000000000001980 lr : 0000000000004050 (reloc)
elr: 0000000097f3f980 lr : 0000000097f42050
x0 : 0000000000000000 x1 : 0000000000000000
x2 : 0000000000000040 x3 : 000000000000003f
x4 : 0000000000000000 x5 : 0000000097b2ac7c
x6 : 0000000000000030 x7 : 0000000097b2b120
x8 : 0000000000000010 x9 : 00000000ffffffd0
x10: 000000000000000d x11: 0000000000000006
x12: 0000000097b2b04c x13: 0000000064000000
x14: 00000000ffffffff x15: 0000000097b2ac7c
x16: 0000000097f4c144 x17: 71691b435758f5f2
x18: 0000000097b2dd90 x19: 0000000000000000
x20: 0000000097fda9d8 x21: 0000000000000008
x22: 0000000000000000 x23: 0000000097b2b270
x24: 0000000000000000 x25: 0000000000000000
x26: 0000000000000000 x27: 0000000000000000
x28: 0000000000000000 x29: 0000000097b2b1a0
 
Code: d2800082 9ac32042 d1000443 8a230000 (d50b7e20)  
Resetting CPU ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant