* Accessing MMC/SD card storage on Raspberry Pi @ 2019-02-11 15:09 Tomaž Šolc 2019-02-12 11:22 ` Roland Hieber 0 siblings, 1 reply; 3+ messages in thread From: Tomaž Šolc @ 2019-02-11 15:09 UTC (permalink / raw) To: barebox 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? 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. 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; + 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 { _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Accessing MMC/SD card storage on Raspberry Pi 2019-02-11 15:09 Accessing MMC/SD card storage on Raspberry Pi Tomaž Šolc @ 2019-02-12 11:22 ` Roland Hieber 2019-02-12 15:31 ` Tomaž Šolc 0 siblings, 1 reply; 3+ messages in thread From: Roland Hieber @ 2019-02-12 11:22 UTC (permalink / raw) To: Tomaž Šolc; +Cc: barebox, Moritz Augsburger 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 ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Accessing MMC/SD card storage on Raspberry Pi 2019-02-12 11:22 ` Roland Hieber @ 2019-02-12 15:31 ` Tomaž Šolc 0 siblings, 0 replies; 3+ messages in thread From: Tomaž Šolc @ 2019-02-12 15:31 UTC (permalink / raw) To: Roland Hieber; +Cc: barebox, Moritz Augsburger Hi On 12. 02. 19 12:22, Roland Hieber wrote: > 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) Ah, thanks for pointing this out. That commit only touched device tree for R.Pi 1. I tried to do something similar on Compute Module 3 by adding the following into bcm2837-rpi-3.dts: &sdhci { pinctrl-0 = <&emmc_gpio48>; /delete-property/ mmc-pwrseq; /delete-property/ non-removable; /delete-property/ #address-cells; /delete-property/ #size-cells; /delete-node/ wifi@1; }; &sdhost { status = "disabled"; }; Unfortunately it fails to boot like that with the last things printed out being: initcall-> rpi_devices_init+0x0/0x138 register_device: bcm2835_fb0 bcm2835_mci 3f300000.sdhci@7e300000.of: Wanted 400000 hz, returning divider 313 (626) which yields 399361 hz bcm2835_mci 3f300000.sdhci@7e300000.of: Changing bus width to 1 bcm2835_mci 3f300000.sdhci@7e300000.of: IO settings: bus width=0, frequency=400000 Hz bcm2835_mci 3f300000.sdhci@7e300000.of: Changing bus width to 1 bcm2835_mci 3f300000.sdhci@7e300000.of: IO settings: bus width=0, frequency=400000 Hz One possible reason for this might be that pin functions aren't re-assigned. I think pinctrl isn't implemented for bcm2835. It probably works on R.Pi 1 because there firmware already assigns correct pin functions by default before jumping to Bearbox. I'll see if I can implement pinctrl. It shouldn't be much work since most things already seem to be implemented in gpio-bcm2835.c. Best regards Tomaž _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-02-12 15:31 UTC | newest] Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2019-02-11 15:09 Accessing MMC/SD card storage on Raspberry Pi Tomaž Šolc 2019-02-12 11:22 ` Roland Hieber 2019-02-12 15:31 ` Tomaž Šolc
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox