[U-Boot] Converting to SPL_OF_CONTROL

Alex Kiernan alex.kiernan at gmail.com
Wed Aug 1 13:18:29 UTC 2018


On Wed, Aug 1, 2018 at 12:30 PM Johann Neuhauser
<jneuhauser at dh-electronics.de> wrote:
>
> Hello Alex,
>
> have you tried to set "u-boot,spl-boot-order" in choosen node?
>
> Take a look into:
> doc/device-tree-bindings/chosen.txt
>

Thanks, I totally failed to see that.

Let me have an investigate!

> Best regards
>
> Johann Neuhauser
>
> -----Ursprüngliche Nachricht-----
> Von: U-Boot [mailto:u-boot-bounces at lists.denx.de] Im Auftrag von Alex Kiernan
> Gesendet: Mittwoch, 1. August 2018 12:42
> An: u-boot <u-boot at lists.denx.de>; Simon Glass <sjg at chromium.org>
> Betreff: [U-Boot] Converting to SPL_OF_CONTROL
>
> I've long been trying to convert our board (AM3352) to all DM, after knocking out lots of problems, I've run into one I can't seem to configure my way around, when I enable SPL_OF_CONTROL.
>
> We have MMC2 as our boot device, with no MMC1 (and hence not present in the DTB). Once we're into full U-Boot this is all okay, we get the board's MMC2 appearing as mmc0 and everything's fine.
>
> My problem's during SPL, where the boot device is MMC2, the code tries to lookup by devnum (which is 1 because it numbers from 0 at this point), which doesn't exist. I'd expected aliases to work, but we don't seem to lookup up by alias, only index, so I don't have any way that I can see of overriding it.
>
> If I make this change, then everything works (with the addition of an an alias for mmc1 = &mmc2):
>
> diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c index 0b2f059570..b7544ba183 100644
> --- a/common/spl/spl_mmc.c
> +++ b/common/spl/spl_mmc.c
> @@ -131,7 +131,7 @@ static int spl_mmc_find_device(struct mmc **mmcp,
> u32 boot_device)
>         }
>
>  #if CONFIG_IS_ENABLED(DM_MMC)
> -       err = uclass_get_device(UCLASS_MMC, mmc_dev, &dev);
> +       err = uclass_get_device_by_seq(UCLASS_MMC, mmc_dev, &dev);
>         if (!err)
>                 *mmcp = mmc_get_mmc_dev(dev);  #else
>
> But that feels like a pretty fundamental change to make across every board and I've no real idea if that would even be the right thing to do, or if I should be trying to fix this some other way.
>
> --
> Alex Kiernan
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> https://lists.denx.de/listinfo/u-boot



--
Alex Kiernan


More information about the U-Boot mailing list