Sorry for late response…maybe this:
https://lore.kernel.org/all/[email protected]/T/#rdf4176e65da050b8125edf90ab2f0753147bff90
Do you use the ddr_flyby option for r64 (in my r64 atf repo i do not use it afaik)? I try to integrate weijis current state into my uboot repo to have one atf branch for r64 and r3…
@ericwoud can you confirm that it fixes your issue?
@dangowrt can you please repost this fix?
@hackpascal daniel mentioned that this should be fixed in TF-A too…have you done this already? it looks like we have similar issue on r3/mt7986…reboot hangs in uboot and it cannot access sdcard (but i have not tried your new source from here as i struggle with correct flags)
tried to use the new TF-A code for bpi-r3 (and created gpt with sgdisk instead of flashing the broken gpt img)
F0: 102B 0000
FA: 1040 0000
FA: 1040 0000 [0200]
F9: 103F 0000
F3: 1001 0000 [0200]
F3: 1001 0000
F6: 300C 0028
F5: 480C 0000
00: 1005 0000
FA: 1040 0000
FA: 1040 0000 [0200]
F9: 103F 0000
F3: 1001 0000 [0200]
F3: 1001 0000
F6: 300C 0028
01: 102A 0001
02: 1005 0000
BP: 2000 00C0 [0001]
EC: 0000 0000 [3000]
T0: 0000 0182 [010F]
System halt!
built u-boot.bin from 2022-10-r3 branch, switched to mtk-atf branch, build it and created image with createimg command (using values 100 for boot and 6144 for root to have same sectors as my current gpt created by your py2-script)
partitiontable looks good for me:
non-working:
Number Start (sector) End (sector) Size Code Name
1 34 8191 4.0 MiB 8300 bl2
2 8192 9215 512.0 KiB 8300 u-boot-env
3 9216 13311 2.0 MiB 8300 factory
4 13312 17407 2.0 MiB 8300 fip
5 17408 222207 100.0 MiB 8300 boot
6 222208 12805120 6.0 GiB 8300 rootfs
working (from py2 gpt-img):
Number Start (sector) End (sector) Size Code Name
1 34 8191 4.0 MiB 8300 bl2
2 8192 9215 512.0 KiB 8300 u-boot-env
3 9216 13311 2.0 MiB 8300 factory
4 13312 17407 2.0 MiB 8300 fip
5 17408 222207 100.0 MiB 8300 kernel
6 222208 12805120 6.0 GiB 8300 rootfs
content of bl2-partition looks a bit different (maybe caused by mkimage usage?):
non-working:
00000000 53 44 4d 4d 43 5f 42 4f 4f 54 00 ff 01 00 00 00 |SDMMC_BOOT......|
00000010 00 02 00 00 ff ff ff ff ff ff ff ff ff ff ff ff |................|
00000020 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
*
00000200 42 52 4c 59 54 00 00 00 01 00 00 00 00 4a 00 00 |BRLYT........J..|
00000210 88 51 03 00 42 42 42 42 08 00 01 00 00 06 00 00 |.Q..BBBB........|
00000220 88 51 03 00 ff ff ff ff ff ff ff ff ff ff ff ff |.Q..............|
00000230 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
*
00000600 4d 4d 4d 01 38 00 00 00 46 49 4c 45 5f 49 4e 46 |MMM.8...FILE_INF|
00000610 4f 00 00 00 01 00 00 00 01 00 05 01 00 0d 20 00 |O............. .|
00000620 88 07 03 00 88 0d 03 00 00 03 00 00 20 00 00 00 |............ ...|
00000630 00 03 00 00 01 00 00 00 4d 4d 4d 01 0c 00 01 00 |........MMM.....|
00000640 01 00 00 00 4d 4d 4d 01 14 00 02 00 00 00 00 00 |....MMM.........|
00000650 10 00 00 00 80 00 00 00 4d 4d 4d 01 14 02 03 00 |........MMM.....|
00000660 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
working (old bpi-atf source):
00000000 53 44 4d 4d 43 5f 42 4f 4f 54 00 ff 01 00 00 00 |SDMMC_BOOT......|
00000010 00 02 00 00 ff ff ff ff ff ff ff ff ff ff ff ff |................|
00000020 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
*
00000200 42 52 4c 59 54 00 00 00 01 00 00 00 00 06 00 00 |BRLYT...........|
00000210 88 fd 02 00 42 42 42 42 08 00 01 00 00 06 00 00 |....BBBB........|
00000220 88 fd 02 00 ff ff ff ff ff ff ff ff ff ff ff ff |................|
00000230 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
*
00000600 4d 4d 4d 01 38 00 00 00 46 49 4c 45 5f 49 4e 46 |MMM.8...FILE_INF|
00000610 4f 00 00 00 01 00 00 00 01 00 05 01 00 0d 20 00 |O............. .|
00000620 88 f7 02 00 88 fd 02 00 00 03 00 00 20 00 00 00 |............ ...|
00000630 00 03 00 00 01 00 00 00 4d 4d 4d 01 0c 00 01 00 |........MMM.....|
00000640 01 00 00 00 4d 4d 4d 03 64 00 07 00 90 11 00 00 |....MMM.d.......|
00000650 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
mhm, flashed old bl2/fip to the new parttable, and got same system-halt…so maybe i miss something in gpt (flags??)…old gpt with new atf works…so anything i miss in gpt-creation
took me some time to read out the information, but it looks like the legacy bootable flag is needed…do not know yet how to set it with sgdisk, but gdisk prints this when i read the working gpt
Expert command (? for help): a
Partition number (1-6): 1
Known attributes are:
0: system partition
1: hide from EFI
2: legacy BIOS bootable
60: read-only
62: hidden
63: do not automount
Attribute value is 0000000000000004. Set fields are:
2 (legacy BIOS bootable)
seems that was the problem…got it set by this
sudo sgdisk --attributes=1:set:2 ${LDEV}
after that bl2 got loaded 