Re: Accessing MMC/SD card storage on Raspberry Pi

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Tomaž,

On Mon, Feb 11, 2019 at 04:09:09PM +0100, Tomaž Šolc wrote:
> Dear all,
> 
> I've been trying to set up Barebox on a Raspberry Pi Compute Module 3. After
> some small fixes (see below) I've got 2019.01.0 to boot to a command line on
> the serial port. However I can't get access to the MMC storage to load a
> kernel ("no /dev/disk0.0. using default env")
> 
> Looking at the source, it seems that a "bcm2835-sdhost" driver is missing
> (bcm2835_mci seems to only be used for the other SDIO interface towards the
> wireless interface on other R. Pis) Is MMC storage indeed not supported on
> R. Pi at the moment or am I missing something?

If I remember correctly, there was a patch changing that behaviour... Ah
yes, commit abc0447440d6 [0]:

    ARM: dts: bcm2835-rpi: re-enable booting from SD card

    Kernel commit a19adf8d86e822eba502486524127595372c85f6 [0] changed the
    RPi1 device tree from &sdhci to &sdhost, which was imported in barebox
    commit d14b844b08635c717fb52a294ed8d6872e260315. It seems that barebox
    does not have a driver for brcm,bcm2835-sdhost (yet), which resulted in
    barebox unable to boot from SD card. However, the driver for
    brcm,bcm2835-sdhci worked fine in the past.

    Although the upstream change was made for good reasons, the simplest
    change for barebox for now is to revert to using &sdhci and disable
    &sdhost.

[0]: https://git.pengutronix.de/cgit/barebox/commit/?h=master&id=abc0447440d6

The "solution" was a small device tree fix. Could this be related to
your problem? Unfortunately no one here has a RPi Compute Module, but
there were already similar questions in the last month. (Cc Moritz)

> Thanks
> Tomaž
> 
> 
> 
> 
> A list of things I needed to do to boot on R. Pi CM3, just in case it's
> useful for someone else:
> 
> Add board rev 10 to rpi_models_new_scheme in rpi-common.c
> 
> Note that rpi_model_init() segfaults if board rev is not found in the list
> because model remains NULL.

Thanks, there is already a patch on next [1] that fixes this :)

[1]: https://git.pengutronix.de/cgit/barebox/commit/?h=next&id=1c7a67ba2fdf8f366127e9cf459c76835ca01004

> Use device tree in bcm2837-rpi-cm3-io3.dts. Most importantly, this disables
> the bcm2835_mci driver, which otherwise hangs on boot (I'm guessing
> unsuccessfully trying to init the empty SDIO bus where there would otherwise
> be a wireless interface on R.Pi 3.).
> 
> 
> diff -ru a/arch/arm/boards/raspberry-pi/rpi-common.c
> b/arch/arm/boards/raspberry-pi/rpi-common.c
> --- a/arch/arm/boards/raspberry-pi/rpi-common.c 2019-02-07
> 15:37:49.181360164 +0100
> +++ b/arch/arm/boards/raspberry-pi/rpi-common.c 2019-02-11
> 08:48:36.000000000 +0100
> @@ -175,6 +175,7 @@
>         RPI_MODEL(0, "Unknown model", NULL),
>         RPI_MODEL(BCM2836_BOARD_REV_2_B, "2 Model B", rpi_b_plus_init),
>         RPI_MODEL(BCM2837_BOARD_REV_3_B, "3 Model B", rpi_b_plus_init),
> +       RPI_MODEL(10, "Compute Module 3", NULL),
>         RPI_MODEL(BCM2835_BOARD_REV_ZERO, "Zero", rpi_b_plus_init),
>         RPI_MODEL(BCM2835_BOARD_REV_ZERO_W, "Zero W", rpi_b_plus_init),
>  };
> @@ -251,6 +252,9 @@
> 
>  static void rpi_model_init(void)
>  {
> +       if (!model)
> +               return;
> +

This one is not fixed yet on next. Care to send a proper patch? :)

 - Roland

>         if (!model->init)
>                 return;
> diff -ru a/arch/arm/dts/bcm2837-rpi-3.dts b/arch/arm/dts/bcm2837-rpi-3.dts
> --- a/arch/arm/dts/bcm2837-rpi-3.dts    2019-01-14 09:05:44.000000000 +0100
> +++ b/arch/arm/dts/bcm2837-rpi-3.dts    2019-02-11 09:49:55.000000000 +0100
> @@ -1,4 +1,5 @@
> -#include <arm64/broadcom/bcm2837-rpi-3-b.dts>
> +//#include <arm64/broadcom/bcm2837-rpi-3-b.dts>
> +#include <arm/bcm2837-rpi-cm3-io3.dts>
> 
>  / {
>         chosen {
> 

-- 
Roland Hieber                     | r.hieber@xxxxxxxxxxxxxx     |
Pengutronix e.K.                  | https://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim | Phone: +49-5121-206917-5086 |
Amtsgericht Hildesheim, HRA 2686  | Fax:   +49-5121-206917-5555 |

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




[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux