mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Roland Hieber <rhi@pengutronix.de>
To: "Tomaž Šolc" <tomaz.solc@klevio.com>
Cc: barebox@lists.infradead.org,
	Moritz Augsburger <ml+barebox@moritz.augsburger.name>
Subject: Re: Accessing MMC/SD card storage on Raspberry Pi
Date: Tue, 12 Feb 2019 12:22:40 +0100	[thread overview]
Message-ID: <20190212112240.sjrrrcdmysdyr3iy@pengutronix.de> (raw)
In-Reply-To: <eb738c4f-0594-566f-e3e8-67e71d3b3b32@klevio.com>

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@pengutronix.de     |
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@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2019-02-12 11:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-11 15:09 Tomaž Šolc
2019-02-12 11:22 ` Roland Hieber [this message]
2019-02-12 15:31   ` Tomaž Šolc

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190212112240.sjrrrcdmysdyr3iy@pengutronix.de \
    --to=rhi@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=ml+barebox@moritz.augsburger.name \
    --cc=tomaz.solc@klevio.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox