Skip to contentSkip to conversation

arm: rpi: explicitly enumerate mmc boot targets

PATCH In review Ben Wolsieffer 3 participants 7 messages Oct 7, 2023 – Oct 10, 2023 Broadcom BCM2711/BCM2835 Arm architecture

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm: rpi: explicitly enumerate mmc boot targets

Using the unqualified "mmc" boot target causes the Raspberry Pi 4 to fail to boot. c771e5b explains this approach as follows:

Quoted 2 lines

We don't need to specify the mmc devices individually, since they are used in order from 0 to 2, and standard boot uses that order anyway.

In practice, U-Boot first attempts to boot from the unconnected mmc1 interface, and, when this fails, moves on to attempt the USB and network boot targets rather than trying mmc0.

This patch explicitly enumerates the mmc interfaces, causing each to be attempted in turn. This matches what is done on other boards, and allows the system to boot successfully.

Fixes c771e5b8c2 ("arm: rpi: Switch to standard boot")
---
 board/raspberrypi/rpi/rpi.env | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
board/raspberrypi/rpi/rpi.env +1 -1
index 30228285ed..02210b97b5 100644
@@ -74,4 +74,4 @@ pxefile_addr_r=0x02500000
 fdt_addr_r=0x02600000
 ramdisk_addr_r=0x02700000
 
-boot_targets=mmc usb pxe dhcp
+boot_targets=mmc0 mmc1 mmc2 usb pxe dhcp
Signature · 1 line
2.42.0
#1 lore raw

Hi Ben,

Quoted 32 lines · Ben Wolsieffer

Using the unqualified "mmc" boot target causes the Raspberry Pi 4 to fail to boot. c771e5b explains this approach as follows:

Quoted 2 lines

We don't need to specify the mmc devices individually, since they are used in order from 0 to 2, and standard boot uses that order anyway.

In practice, U-Boot first attempts to boot from the unconnected mmc1 interface, and, when this fails, moves on to attempt the USB and network boot targets rather than trying mmc0.

This patch explicitly enumerates the mmc interfaces, causing each to be attempted in turn. This matches what is done on other boards, and allows the system to boot successfully.

Fixes c771e5b8c2 ("arm: rpi: Switch to standard boot")
---
 board/raspberrypi/rpi/rpi.env | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
board/raspberrypi/rpi/rpi.env +1 -2
index 30228285ed..02210b97b5 100644
@@ -74,4 +74,4 @@ pxefile_addr_r=0x02500000
 fdt_addr_r=0x02600000
 ramdisk_addr_r=0x02700000
 
-boot_targets=mmc usb pxe dhcp
+boot_targets=mmc0 mmc1 mmc2 usb pxe dhcp
--
Quoted 2 lines

2.42.0

Does this patch help? [1]. Alternatively, if you just remove that variable entirely, does it do the right thing?

Regards,
Simon

[1] https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/

#2 lore raw

Hi Simon,

Quoted 25 lines · Simon Glass

Hi Ben,

Quoted 15 lines · Ben Wolsieffer

Using the unqualified "mmc" boot target causes the Raspberry Pi 4 to fail to boot. c771e5b explains this approach as follows:

Quoted 2 lines

We don't need to specify the mmc devices individually, since they are used in order from 0 to 2, and standard boot uses that order anyway.

In practice, U-Boot first attempts to boot from the unconnected mmc1 interface, and, when this fails, moves on to attempt the USB and network boot targets rather than trying mmc0.

This patch explicitly enumerates the mmc interfaces, causing each to be attempted in turn. This matches what is done on other boards, and allows the system to boot successfully.

Quoted 6 lines
Fixes c771e5b8c2 ("arm: rpi: Switch to standard boot")
---
 board/raspberrypi/rpi/rpi.env | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 2 lines

Does this patch help? [1]. Alternatively, if you just remove that variable entirely, does it do the right thing?

Yes, trying either of those suggestions makes it work correctly.

Quoted 5 lines

Regards,
Simon

[1] https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/

Thanks, Ben

#3 lore raw

Hi Ben,

Quoted 7 lines · Ben Wolsieffer

Hi Simon,

Quoted 3 lines · Simon Glass

Hi Ben,

On Sat, 7 Oct 2023 at 09:55, Ben Wolsieffer <[email protected]>

Quoted 5 lines · wrote:
Quoted 5 lines
Quoted 5 lines

Using the unqualified "mmc" boot target causes the Raspberry Pi 4 to fail to boot. c771e5b explains this approach as follows:

Quoted 1 line

We don't need to specify the mmc devices individually, since they

are

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 1 line

used in order from 0 to 2, and standard boot uses that order anyway.

In practice, U-Boot first attempts to boot from the unconnected mmc1 interface, and, when this fails, moves on to attempt the USB and

network

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

boot targets rather than trying mmc0.

This patch explicitly enumerates the mmc interfaces, causing each to

be

Quoted 1 line
Quoted 1 line
Quoted 1 line

attempted in turn. This matches what is done on other boards, and

allows

Quoted 9 lines
Quoted 9 lines
Quoted 8 lines

the system to boot successfully.

Fixes c771e5b8c2 ("arm: rpi: Switch to standard boot")
---
 board/raspberrypi/rpi/rpi.env | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 4 lines
Quoted 2 lines

Does this patch help? [1]. Alternatively, if you just remove that variable entirely, does it do the right thing?

Yes, trying either of those suggestions makes it work correctly.

Thank you for testing this

In that case, I would rather that [1] since it should fix it for all boards. If you want to send a patch to drop boot_targets, please do and I'll leave that to Peter.

Quoted 6 lines
Quoted 6 lines

Regards,
Simon

[1]

https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/

Quoted 3 lines

Thanks, Ben

Regards,
Simon

#4 lore raw
In reply to Ben Wolsieffer
Quoted 10 lines · Ben Wolsieffer

Using the unqualified "mmc" boot target causes the Raspberry Pi 4 to fail to boot. c771e5b explains this approach as follows:

Quoted 2 lines

We don't need to specify the mmc devices individually, since they are used in order from 0 to 2, and standard boot uses that order anyway.

In practice, U-Boot first attempts to boot from the unconnected mmc1 interface, and, when this fails, moves on to attempt the USB and network boot targets rather than trying mmc0.

Really? It shouldn't be enumerating it if it's not defined in device tree, I've not seen this in my testing.

Quoted 15 lines

This patch explicitly enumerates the mmc interfaces, causing each to be attempted in turn. This matches what is done on other boards, and allows the system to boot successfully.

Fixes c771e5b8c2 ("arm: rpi: Switch to standard boot")
---
 board/raspberrypi/rpi/rpi.env | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
board/raspberrypi/rpi/rpi.env +0 -0
index 30228285ed..02210b97b5 100644

board/raspberrypi/rpi/rpi.env pxefile_addr_r=0x02500000 · line 77

Quoted 5 lines
board/raspberrypi/rpi/rpi.env +1 -1
@@ -74,4 +74,4 @@ pxefile_addr_r=0x02500000
 fdt_addr_r=0x02600000
 ramdisk_addr_r=0x02700000
 
-boot_targets=mmc usb pxe dhcp
+boot_targets=mmc0 mmc1 mmc2 usb pxe dhcp

Why are you adding mmc1 and mmc2 if they're not connected?

#5 lore raw

Hi Peter,

Quoted 8 lines · Peter Robinson
Quoted 7 lines · Ben Wolsieffer

Using the unqualified "mmc" boot target causes the Raspberry Pi 4 to fail to boot. c771e5b explains this approach as follows:

Quoted 2 lines

We don't need to specify the mmc devices individually, since they are used in order from 0 to 2, and standard boot uses that order anyway.

Quoted 6 lines
Quoted 3 lines

In practice, U-Boot first attempts to boot from the unconnected mmc1 interface, and, when this fails, moves on to attempt the USB and network boot targets rather than trying mmc0.

Really? It shouldn't be enumerating it if it's not defined in device tree, I've not seen this in my testing.

It does seem odd, but U-Boot definitely sees two MMC interfaces:

U-Boot> mmc list
mmcnr@7e300000: 1
mmc@7e340000: 0 (SD)

Quoted 19 lines
Quoted 19 lines

This patch explicitly enumerates the mmc interfaces, causing each to be attempted in turn. This matches what is done on other boards, and allows the system to boot successfully.

Fixes c771e5b8c2 ("arm: rpi: Switch to standard boot")
---
 board/raspberrypi/rpi/rpi.env | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
board/raspberrypi/rpi/rpi.env +0 -0
index 30228285ed..02210b97b5 100644
@@ -74,4 +74,4 @@ pxefile_addr_r=0x02500000
 fdt_addr_r=0x02600000
 ramdisk_addr_r=0x02700000
 
Quoted 4 lines

board/raspberrypi/rpi/rpi.env pxefile_addr_r=0x02500000 · line 77

Quoted 2 lines
board/raspberrypi/rpi/rpi.env +1 -1
-boot_targets=mmc usb pxe dhcp
+boot_targets=mmc0 mmc1 mmc2 usb pxe dhcp

Why are you adding mmc1 and mmc2 if they're not connected?

I was trying to match the old distro boot behavior, which had three MMC interfaces listed.

#6 lore raw
Quoted 16 lines · Ben Wolsieffer

Hi Peter,

Quoted 12 lines · Peter Robinson
Quoted 10 lines · Ben Wolsieffer

Using the unqualified "mmc" boot target causes the Raspberry Pi 4 to fail to boot. c771e5b explains this approach as follows:

Quoted 2 lines

We don't need to specify the mmc devices individually, since they are used in order from 0 to 2, and standard boot uses that order anyway.

In practice, U-Boot first attempts to boot from the unconnected mmc1 interface, and, when this fails, moves on to attempt the USB and network boot targets rather than trying mmc0.

Quoted 8 lines
Quoted 2 lines

Really? It shouldn't be enumerating it if it's not defined in device tree, I've not seen this in my testing.

It does seem odd, but U-Boot definitely sees two MMC interfaces:

U-Boot> mmc list
mmcnr@7e300000: 1
mmc@7e340000: 0 (SD)

The WiFi interface is connected by SDHCI/SDIO which AFAICT is the first interface.

Quoted 26 lines
Quoted 19 lines
Quoted 19 lines

This patch explicitly enumerates the mmc interfaces, causing each to be attempted in turn. This matches what is done on other boards, and allows the system to boot successfully.

Fixes c771e5b8c2 ("arm: rpi: Switch to standard boot")
---
 board/raspberrypi/rpi/rpi.env | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
board/raspberrypi/rpi/rpi.env +0 -0
index 30228285ed..02210b97b5 100644
@@ -74,4 +74,4 @@ pxefile_addr_r=0x02500000
 fdt_addr_r=0x02600000
 ramdisk_addr_r=0x02700000
 
Quoted 4 lines

board/raspberrypi/rpi/rpi.env pxefile_addr_r=0x02500000 · line 77

Quoted 2 lines
board/raspberrypi/rpi/rpi.env +1 -1
-boot_targets=mmc usb pxe dhcp
+boot_targets=mmc0 mmc1 mmc2 usb pxe dhcp

Why are you adding mmc1 and mmc2 if they're not connected?

I was trying to match the old distro boot behavior, which had three MMC interfaces listed.