nerves-project / nerves_system_bbb

Base Nerves system configuration for the BeagleBone-based boards
Apache License 2.0
34 stars 39 forks source link

Beaglebone eMMC boot with uBoot 2021.10 #286

Open jeanparpaillon opened 1 year ago

jeanparpaillon commented 1 year ago

Booting Beaglebone off of eMMC memory has been compex so far as it required to patch uBoot (see https://github.com/nerves-project/nerves_system_bbb/issues/94)

With nervs_system_bbb upgrading uBoot to 2021.10, those patches are not applicable anymore.

It seems that uBoot has introduced a different way of describing booting device. I'd like to know:

fhunleth commented 1 year ago

Here's what I know about the combo eMMC/MicroSD boot issue:

  1. There wasn't a way to tell which device U-Boot was loaded off of. The choice was to hardcode the MMC number in the U-Boot boot script.
  2. U-Boot is really hard to change when you have devices in the field, so I've avoided changing it.

All of my custom BBB-clone hardware has the eMMC connected to the same MMC interface as the BBB's MicroSD card. This made it super easy for me to switch back and forth. This is not a viable long term solution any more since there's an issue with that particular MMC interface that restricts it to < 4GB eMMC parts (the normal eMMC MMC interface doesn't have this problem). I exclusively use 2 GB eMMC parts so this isn't an issue for me right now, but it may be in the future as the parts are getting harder to buy. Here's an example project.

I do not know whether the latest version of U-Boot has the ability to detect where it came from. If it does, then that would be interesting. One alternative would be change the boot script to check both MMC interfaces and boot off whichever one shows up.

I have been thinking about making backwards incompatible updates to the Nerves BBB and Raspberry Pi systems. It's a thankless task so I've been putting it off. If I were to update, I'd definitely update U-Boot to the latest. There are other changes that I'd want to make as well, though.

Before I start down any path, could I ask why you're interested in updating U-Boot? Is there a particular feature that you need?

jeanparpaillon commented 1 year ago

Thanks for those infos. Yep, first, I have rebased my whole BSP onto nerves_system_bbb 2.15.1 and wanted to limit divergence between 'upstream' and our custom BSP. Hence using u-boot 2021.10. I think I may try to backport u-boot 2018.x as I had working set of patches for it.

I suppose some adaptation on fwup.conf may be required too. I will also try to get more informations from Beaglebone's project people. (https://github.com/RobertCNelson ?)

fhunleth commented 1 year ago

fwup.conf won't need to be changed for a U-Boot version update. U-Boot supports multiple disk layouts for booting AM335x. To my knowledge, they didn't remove any in the latest versions.

Fwiw, the AM3358 is super old and Nerves hardly uses U-Boot. I'm not sure upgrading for the sake of upgrading is worth it unless there's a feature you want.

jeanparpaillon commented 1 year ago

@fhunleth that sounds perfect. I will try not to upgrade uBoot in my BSP and will close this accordingly

CaptChrisD commented 4 months ago

Reviving this issue. Where does this stand? I am actively trying to get my BBB to boot from eMMC and not making any progress. Then found this issue and wanted to know if this is still a blocker. If so what do we see as a path forward?

Thanks in advance for any insights!