[U-Boot] [PATCH 4/6] sunxi: When we've both mmc0 and mmc2, detect from which one we're booting

Ian Campbell ijc at hellion.org.uk
Mon Oct 6 10:33:34 CEST 2014


On Sun, 2014-10-05 at 17:10 +0200, Hans de Goede wrote:
> 
> On 10/04/2014 10:35 AM, Ian Campbell wrote:
> > On Fri, 2014-10-03 at 17:05 +0200, Hans de Goede wrote:
> >> sunxi SOCs can boot from both mmc0 and mmc2, detect from which one we're
> >> booting, and make that one "mmc dev 0" so that a single u-boot binary can
> >> be used for both the onboard eMMC and for external sdcards.
> > 
> > Where does the dependency on dev 0 being the boot device come from? Is
> > it just the env via CONFIG_SYS_MMC_ENV_DEV?
> 
> No, the main reason why we need dev 0 to be the mmc we're actually booting
> from is because that is where the SPL will load the tertiary payload
> (the actual u-boot binary in our case) from, see:
> 
> common/spl/spl_mmc.c
> 
> Which has dev 0 hardcoded everywhere.

I see. Could you paste this bit of reasoning into the commit log please?
(pretty much s/No, t/T/ on the above would do IMHO)

> There is no fallback path, if you insert a sdcard with a bad
> u-boot build, things will just hang, the brom is not smart enough
> to switch over to an internal boot medium in this case. So I believe
> that the check which I'm adding should be sufficient to determine whether
> or not we're booting from mmc0. I really don't expect people to leave
> a bootable sdcard in slot0, they could have a sdcard there to store data,
> but in that case I would expect it to not have the magic boot signature.

This makes sense too, thanks.

Ian



More information about the U-Boot mailing list