Skip to contentSkip to conversation

board: beagleplay: Fix the bootpart to pick from root partition

PATCH Superseded Dhruva Gole 6 participants 13 messages Jun 13, 2024 – Jun 17, 2024

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 board: beagleplay: Fix the bootpart to pick from root partition

The Kernel Image and DTB files are supposed to be picked from the rootfs of the SD Card, this fails in legacy boot flow because bootpart is set to 1:1. Fix it.

Fixes a200f428b5b21 ("board: ti: am62x: Add am62x_beagleplay_* defconfigs and env file")
---
 board/beagle/beagleplay/beagleplay.env | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
board/beagle/beagleplay/beagleplay.env +1 -1
index bbf6b925d02c..190181c8ad0c 100644
@@ -11,7 +11,7 @@ set_led_state_start_load=led led-0 on; led led-1 off;
 	led led-2 on; led led-3 off; led led-4 on
 boot=mmc
 mmcdev=1
-bootpart=1:1
+bootpart=1:2
 bootdir=/boot
 boot_targets=mmc1 mmc0
 bootmeths=script extlinux efi pxe
Signature · 1 line
2.34.1
Acked-by on v1 1/1
#1 lore raw

Hi Dhruva,

Quoted 6 lines · Dhruva Gole

The Kernel Image and DTB files are supposed to be picked from the rootfs of the SD Card, this fails in legacy boot flow because bootpart is set to 1:1. Fix it.

Fixes a200f428b5b21 ("board: ti: am62x: Add am62x_beagleplay_* defconfigs and env file")
Quoted 17 lines
---
  board/beagle/beagleplay/beagleplay.env | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
board/beagle/beagleplay/beagleplay.env +1 -1
index bbf6b925d02c..190181c8ad0c 100644
@@ -11,7 +11,7 @@ set_led_state_start_load=led led-0 on; led led-1 off;
  	led led-2 on; led led-3 off; led led-4 on
  boot=mmc
  mmcdev=1
-bootpart=1:1
+bootpart=1:2
  bootdir=/boot
  boot_targets=mmc1 mmc0
  bootmeths=script extlinux efi pxe
#2 lore raw
In reply to Dhruva Gole
Quoted 4 lines · Dhruva Gole

The Kernel Image and DTB files are supposed to be picked from the rootfs of the SD Card, this fails in legacy boot flow because bootpart is set to 1:1. Fix it.

and where is that rule defined?

Production boards ship with Kernel Image and DTB's in the 1st fat partition..

Regards,

Signature · 2 lines
Robert Nelson
https://rcn-ee.com/
#3 lore raw
Quoted 10 lines · Robert Nelson
Quoted 4 lines · Dhruva Gole

The Kernel Image and DTB files are supposed to be picked from the rootfs of the SD Card, this fails in legacy boot flow because bootpart is set to 1:1. Fix it.

and where is that rule defined?

Production boards ship with Kernel Image and DTB's in the 1st fat partition..

Besides, u-boot should scan for extlinux.conf on "any" partition.

Regards,

Signature · 2 lines
Robert Nelson
https://rcn-ee.com/
#4 lore raw

Robert,

Quoted 8 lines · Robert Nelson
Quoted 7 lines · Robert Nelson
Quoted 4 lines · Dhruva Gole

The Kernel Image and DTB files are supposed to be picked from the rootfs of the SD Card, this fails in legacy boot flow because bootpart is set to 1:1. Fix it.

Quoted 5 lines
Quoted 3 lines

and where is that rule defined?

Production boards ship with Kernel Image and DTB's in the 1st fat partition..

Besides, u-boot should scan for extlinux.conf on "any" partition.

I can see where you come from, and I agree on the above points when it comes to stdboot.
However when a user wishes to use legacy boot, and in the case there isn't extlinux.conf in such a case u-boot will rely on information in the env file (please correct me if my understanding is wrong).

The env file says:
bootdir=/boot

Thus u-boot ends up looking for Image and dtb in /boot/Image under BOOT partition, and ultimately fails, because the /boot/Image path is generally found inside the root partition ie. 1:2

The idea of this patch is to keep support for such legacy boot alive, if you feel there's another way to do this feel free to suggest.

--
Dhruva

#5 lore raw
Quoted 27 lines · Dhruva Gole

Robert,

Quoted 8 lines · Robert Nelson
Quoted 7 lines · Robert Nelson
Quoted 4 lines · Dhruva Gole

The Kernel Image and DTB files are supposed to be picked from the rootfs of the SD Card, this fails in legacy boot flow because bootpart is set to 1:1. Fix it.

Quoted 5 lines
Quoted 3 lines

and where is that rule defined?

Production boards ship with Kernel Image and DTB's in the 1st fat partition..

Besides, u-boot should scan for extlinux.conf on "any" partition.

I can see where you come from, and I agree on the above points when it comes to stdboot.
However when a user wishes to use legacy boot, and in the case there isn't extlinux.conf in such a case u-boot will rely on information in the env file (please correct me if my understanding is wrong).

The env file says:
bootdir=/boot

Quoted 6 lines

Thus u-boot ends up looking for Image and dtb in /boot/Image under BOOT partition, and ultimately fails, because the /boot/Image path is generally found inside the root partition ie. 1:2

The idea of this patch is to keep support for such legacy boot alive, if you feel there's another way to do this feel free to suggest.

For BeagleBoard.org we never used the legacy boot path on this target (or BeagleBone-AI64), this was put in place mostly for TI's u-boot scripts. ;)

Regards,

Signature · 2 lines
Robert Nelson
https://rcn-ee.com/
#6 lore raw
In reply to Dhruva Gole

On June 13, 2024 thus sayeth Dhruva Gole:

Quoted 16 lines

The Kernel Image and DTB files are supposed to be picked from the rootfs of the SD Card, this fails in legacy boot flow because bootpart is set to 1:1. Fix it.

Fixes a200f428b5b21 ("board: ti: am62x: Add am62x_beagleplay_*

defconfigs and env file")

---
 board/beagle/beagleplay/beagleplay.env | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
board/beagle/beagleplay/beagleplay.env +0 -0
index bbf6b925d02c..190181c8ad0c 100644

board/beagle/beagleplay/beagleplay.env set_led_state_start_load=led led-0 on; led led-1 off; · line 17

Quoted 8 lines
board/beagle/beagleplay/beagleplay.env +1 -1
@@ -11,7 +11,7 @@ set_led_state_start_load=led led-0 on; led led-1 off;
 	led led-2 on; led led-3 off; led led-4 on
 boot=mmc
 mmcdev=1
-bootpart=1:1
+bootpart=1:2
 bootdir=/boot
 boot_targets=mmc1 mmc0
 bootmeths=script extlinux efi pxe

Shouldn't the fix be to just drop 'script' from bootmeths. These TI scripts needed to go away years ago.

~Bryan

#7 lore raw
Quoted 13 lines · Bryan Brattlof

On June 13, 2024 thus sayeth Dhruva Gole:

Quoted 11 lines

The Kernel Image and DTB files are supposed to be picked from the rootfs of the SD Card, this fails in legacy boot flow because bootpart is set to 1:1. Fix it.

Fixes a200f428b5b21 ("board: ti: am62x: Add am62x_beagleplay_*

defconfigs and env file")

---
 board/beagle/beagleplay/beagleplay.env | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 16 lines

board/beagle/beagleplay/beagleplay.env set_led_state_start_load=led led-0 on; led led-1 off; · line 17

Quoted 13 lines
board/beagle/beagleplay/beagleplay.env +1 -1
index bbf6b925d02c..190181c8ad0c 100644
@@ -11,7 +11,7 @@ set_led_state_start_load=led led-0 on; led led-1 off;
      led led-2 on; led led-3 off; led led-4 on
 boot=mmc
 mmcdev=1
-bootpart=1:1
+bootpart=1:2
 bootdir=/boot
 boot_targets=mmc1 mmc0
 bootmeths=script extlinux efi pxe

Shouldn't the fix be to just drop 'script' from bootmeths. These TI scripts needed to go away years ago.

I agree! nuke the non bootmeth's. ;)

Regards,

Signature · 2 lines
Robert Nelson
https://rcn-ee.com/
#8 lore raw

Hi Robert and Bryan,

Quoted 31 lines · Robert Nelson
Quoted 13 lines · Bryan Brattlof

On June 13, 2024 thus sayeth Dhruva Gole:

Quoted 11 lines

The Kernel Image and DTB files are supposed to be picked from the rootfs of the SD Card, this fails in legacy boot flow because bootpart is set to 1:1. Fix it.

Fixes a200f428b5b21 ("board: ti: am62x: Add am62x_beagleplay_*

defconfigs and env file")

---
 board/beagle/beagleplay/beagleplay.env | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 16 lines

board/beagle/beagleplay/beagleplay.env set_led_state_start_load=led led-0 on; led led-1 off; · line 17

Quoted 13 lines
board/beagle/beagleplay/beagleplay.env +1 -1
index bbf6b925d02c..190181c8ad0c 100644
@@ -11,7 +11,7 @@ set_led_state_start_load=led led-0 on; led led-1 off;
      led led-2 on; led led-3 off; led led-4 on
 boot=mmc
 mmcdev=1
-bootpart=1:1
+bootpart=1:2
 bootdir=/boot
 boot_targets=mmc1 mmc0
 bootmeths=script extlinux efi pxe

Shouldn't the fix be to just drop 'script' from bootmeths. These TI scripts needed to go away years ago.

Quoted 1 line

I agree! nuke the non bootmeth's. ;)

People are still using legacy bootmethods out there. I think the cleanup will still take time till everyone is on the same page and I feel like beagle being a community platform, doesn't mandate to use a "fixed" boot flow atleast until stdboot is fully at feature parity with legacy boot. Some users may still care for the legacy boot method.

From the discussions so far it seems evident to me that the BeagleBone debian images are anyway going to be unaffected by this change so that removes the question of it causing any regressions on that end.

People who do want to use legacy boot and pick kernel image and DTB from their root partitions will benefit from this change for sure.

So I don't really see the need/argument here to not go ahead with this patch?

We can definitely have separate discussion around whether we need to remove legacy flow bits from upstream U-Boot, but no reason to keep this small fix blocked till we have those discussions is what I feel.

Signature · 2 lines
Best regards,
Dhruva Gole <[email protected]>
#9 lore raw

On June 17, 2024 thus sayeth Dhruva Gole:

Quoted 47 lines

Hi Robert and Bryan,

Quoted 31 lines · Robert Nelson
Quoted 13 lines · Bryan Brattlof

On June 13, 2024 thus sayeth Dhruva Gole:

Quoted 11 lines

The Kernel Image and DTB files are supposed to be picked from the rootfs of the SD Card, this fails in legacy boot flow because bootpart is set to 1:1. Fix it.

Fixes a200f428b5b21 ("board: ti: am62x: Add am62x_beagleplay_*

defconfigs and env file")

---
 board/beagle/beagleplay/beagleplay.env | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 16 lines

board/beagle/beagleplay/beagleplay.env set_led_state_start_load=led led-0 on; led led-1 off; · line 17

Quoted 13 lines
board/beagle/beagleplay/beagleplay.env +1 -1
index bbf6b925d02c..190181c8ad0c 100644
@@ -11,7 +11,7 @@ set_led_state_start_load=led led-0 on; led led-1 off;
      led led-2 on; led led-3 off; led led-4 on
 boot=mmc
 mmcdev=1
-bootpart=1:1
+bootpart=1:2
 bootdir=/boot
 boot_targets=mmc1 mmc0
 bootmeths=script extlinux efi pxe

Shouldn't the fix be to just drop 'script' from bootmeths. These TI scripts needed to go away years ago.

Quoted 1 line

I agree! nuke the non bootmeth's. ;)

People are still using legacy bootmethods out there. I think the cleanup will still take time till everyone is on the same page and I feel like beagle being a community platform, doesn't mandate to use a "fixed" boot flow atleast until stdboot is fully at feature parity with legacy boot. Some users may still care for the legacy boot method.

From the discussions so far it seems evident to me that the BeagleBone debian images are anyway going to be unaffected by this change so that removes the question of it causing any regressions on that end.

Quoted 8 lines

People who do want to use legacy boot and pick kernel image and DTB from their root partitions will benefit from this change for sure.

So I don't really see the need/argument here to not go ahead with this patch?

We can definitely have separate discussion around whether we need to remove legacy flow bits from upstream U-Boot, but no reason to keep this small fix blocked till we have those discussions is what I feel.

config_distro_bootcmd.h was introduced in 2014. If we or these distributions cannot update their packaging in a decade we cannot support them. Simply hiding their inability to update their builds and shifting the work to U-Boot is not acceptable.

As you have just demonstrated these legacy boot scripts have no way of being tested. You've linked to a fundamental boot issue since the very introduction of the beagleplay support. Obviously no one is using them.

a200f428b5b2 ("oard: ti: am62x: Add am62x_beagleplay_* ...

Fixing these scripts continue to signal to these distributions that relying on custom scripting to boot their distribution rather than packing a EFI stub or extlinux.conf file is acceptable.

The reason I'm trying to block this is because we will never be able to remove them if we keep fixing them. I'm fine if we want to fix our reference boards booting Arago, but we shouldn't block BeaglePlay from cleaning up their codebase because of our reference distributions.

~Bryan

Reviewed-by
#10 lore raw
In reply to Dhruva Gole
Quoted 46 lines · Dhruva Gole

Hi Robert and Bryan,

Quoted 31 lines · Robert Nelson
Quoted 13 lines · Bryan Brattlof

On June 13, 2024 thus sayeth Dhruva Gole:

Quoted 11 lines

The Kernel Image and DTB files are supposed to be picked from the rootfs of the SD Card, this fails in legacy boot flow because bootpart is set to 1:1. Fix it.

Fixes a200f428b5b21 ("board: ti: am62x: Add am62x_beagleplay_*

defconfigs and env file")

---
 board/beagle/beagleplay/beagleplay.env | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 16 lines

board/beagle/beagleplay/beagleplay.env set_led_state_start_load=led led-0 on; led led-1 off; · line 17

Quoted 13 lines
board/beagle/beagleplay/beagleplay.env +1 -1
index bbf6b925d02c..190181c8ad0c 100644
@@ -11,7 +11,7 @@ set_led_state_start_load=led led-0 on; led led-1 off;
      led led-2 on; led led-3 off; led led-4 on
 boot=mmc
 mmcdev=1
-bootpart=1:1
+bootpart=1:2
 bootdir=/boot
 boot_targets=mmc1 mmc0
 bootmeths=script extlinux efi pxe

Shouldn't the fix be to just drop 'script' from bootmeths. These TI scripts needed to go away years ago.

Quoted 1 line

I agree! nuke the non bootmeth's. ;)

People are still using legacy bootmethods out there. I think the cleanup will still take time till everyone is on the same page and I feel like beagle being a community platform, doesn't mandate to use a "fixed" boot flow atleast until stdboot is fully at feature parity with legacy boot. Some users may still care for the legacy boot method.

From the discussions so far it seems evident to me that the BeagleBone debian images are anyway going to be unaffected by this change so that removes the question of it causing any regressions on that end.

Quoted 8 lines

People who do want to use legacy boot and pick kernel image and DTB from their root partitions will benefit from this change for sure.

So I don't really see the need/argument here to not go ahead with this patch?

We can definitely have separate discussion around whether we need to remove legacy flow bits from upstream U-Boot, but no reason to keep this small fix blocked till we have those discussions is what I feel.

Based on an offline discussion, while it is in the ineterest of dropping legacy boot, we are currently supporting both set of users at the moment. The fix is valid for legacy boot folks.. so, for this patch, at this point in time:

Signature · 3 lines
Regards,
Nishanth Menon
Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3  1A34 DDB5 849D 1736 249D
#11 lore raw
In reply to Dhruva Gole

Hi Dhruva,

Quoted 11 lines · Dhruva Gole

The Kernel Image and DTB files are supposed to be picked from the rootfs of the SD Card, this fails in legacy boot flow because bootpart is set to 1:1. Fix it.

Fixes a200f428b5b21 ("board: ti: am62x: Add am62x_beagleplay_* defconfigs and env file")
---
 board/beagle/beagleplay/beagleplay.env | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

What is the legacy boot flow?

Quoted 14 lines
board/beagle/beagleplay/beagleplay.env +1 -2
index bbf6b925d02c..190181c8ad0c 100644
@@ -11,7 +11,7 @@ set_led_state_start_load=led led-0 on; led led-1 off;
        led led-2 on; led led-3 off; led led-4 on
 boot=mmc
 mmcdev=1
-bootpart=1:1
+bootpart=1:2
 bootdir=/boot
 boot_targets=mmc1 mmc0
 bootmeths=script extlinux efi pxe
--
Quoted 2 lines

2.34.1

Regards,
Simon

#12 lore raw
Quoted 9 lines · Simon Glass

Hi Dhruva,

Quoted 5 lines · Dhruva Gole

The Kernel Image and DTB files are supposed to be picked from the rootfs of the SD Card, this fails in legacy boot flow because bootpart is set to 1:1. Fix it.

Quoted 8 lines
Quoted 6 lines
Fixes a200f428b5b21 ("board: ti: am62x: Add am62x_beagleplay_* defconfigs and env file")
---
 board/beagle/beagleplay/beagleplay.env | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

What is the legacy boot flow?

Here's the fun part. From BeagleBoard.org, all BeaglePlay's manufactured by Seeed has the eMMC booting via extlinux.conf. All BeagleBoard.org images use extlinux.conf by default for this hardware.

Dhruva's just looking to make sure it works with TI's currently released sdk's. (So last year, and this quarter's releases..)

Regards,

Signature · 2 lines
Robert Nelson
https://rcn-ee.com/