Hi Andreay.

> > > To support bootstrap from SD card run a detect all before
> > > mounting the SD card.
> > >
> > > Signed-off-by: Sam Ravnborg <s...@ravnborg.org>
> > > ---
> > >  lib/bootstrap/disk.c | 2 ++
> > >  1 file changed, 2 insertions(+)
> > >
> > > diff --git a/lib/bootstrap/disk.c b/lib/bootstrap/disk.c
> > > index fd016166e..77be95c2f 100644
> > > --- a/lib/bootstrap/disk.c
> > > +++ b/lib/bootstrap/disk.c
> > > @@ -21,6 +21,8 @@ void* bootstrap_read_disk(const char *dev, const char 
> > > *fstype)
> > >         size_t len;
> > >         const char *path = "/";
> > >
> > > +       device_detect_all();
> > > +
> > 
> > Can device_detect_by_name(dev) be used here instead?
> 
> dev equals "disk0.0" when we call bootstrap_read_disk().
> Calling device_detect_by_name("disk0.0") did not work, and then
> the easy solution with device_detect_all() worked.
> 
> I could pass the dev name to bootstrap_read_disk() but
> this would make the caller less general which is why I ended
> up with the more brutal solution.

I ended up with following code in arch/arm/boards/at91sam9263ek/init.c:
#if defined(CONFIG_MCI_ATMEL)
static struct atmel_mci_platform_data __initdata ek_mci_data = {
        .devname        = "disk0",
        .bus_width      = 4,
        .detect_pin     = AT91_PIN_PE18,
        .wp_pin         = AT91_PIN_PE19,
};

When I specify "devname=disk0", then I could use
detect_by_name(dev) in bootstrap_read_disk().
No too pretty, but preferable compared to
running a loop detecting all devices.

I will include this change in v2.

        Sam

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

Reply via email to