[U-Boot] raspberrypi compute module3 emmc not usable

Hello,
I'm trying to use u-boot on CM3 (which contains eMMC) to boot kernel. I'm using u-boot 2018.05 and it can start fine like: U-Boot 2018.05 (Jul 10 2018 - 20:32:05 +0000)
DRAM: 948 MiB RPI Compute Module 3 (0xa220a0) MMC: sdhci@7e300000: 0 Loading Environment from FAT... unable to select a mode ** No partition table - mmc 0 ** Failed (-5) In: serial Out: vidconsole Err: vidconsole Net: No ethernet found. starting USB... USB0: scanning bus 0 for devices... 1 USB Device(s) found scanning usb for storage devices... 0 Storage Device(s) found Hit any key to stop autoboot: 0 U-Boot> U-Boot> U-Boot> U-Boot> mmc info Device: sdhci@7e300000 Manufacturer ID: 15 OEM: 100 Name: 4FPD3 Bus Speed: 52000000 Mode : MMC legacy Rd Block Len: 512 MMC version 5.0 High Capacity: Yes Capacity: 3.6 GiB Bus Width: 1-bit Erase Group Size: 512 KiB HC WP Group Size: 8 MiB User Capacity: 3.6 GiB WRREL Boot Capacity: 4 MiB ENH RPMB Capacity: 512 KiB ENH U-Boot> mmc part ## Unknown partition table type 0 U-Boot> mmc read $loadaddr 0 2
but reading from eMMC fails with:
MMC read: dev # 0, block # 0, count 2 ... 0 blocks read: ERROR
so it looks like eMMC is not properly working with CM3 in this version? Any ideas what to check to have it working before I dig to debugging session ;). Thanks.
BR,
marek

On Tue, Jul 10, 2018 at 10:37:19PM +0200, Belisko Marek wrote:
Hello,
I'm trying to use u-boot on CM3 (which contains eMMC) to boot kernel. I'm using u-boot 2018.05 and it can start fine like: U-Boot 2018.05 (Jul 10 2018 - 20:32:05 +0000)
DRAM: 948 MiB RPI Compute Module 3 (0xa220a0) MMC: sdhci@7e300000: 0 Loading Environment from FAT... unable to select a mode ** No partition table - mmc 0 ** Failed (-5) In: serial Out: vidconsole Err: vidconsole Net: No ethernet found. starting USB... USB0: scanning bus 0 for devices... 1 USB Device(s) found scanning usb for storage devices... 0 Storage Device(s) found Hit any key to stop autoboot: 0 U-Boot> U-Boot> U-Boot> U-Boot> mmc info Device: sdhci@7e300000 Manufacturer ID: 15 OEM: 100 Name: 4FPD3 Bus Speed: 52000000 Mode : MMC legacy Rd Block Len: 512 MMC version 5.0 High Capacity: Yes Capacity: 3.6 GiB Bus Width: 1-bit Erase Group Size: 512 KiB HC WP Group Size: 8 MiB User Capacity: 3.6 GiB WRREL Boot Capacity: 4 MiB ENH RPMB Capacity: 512 KiB ENH U-Boot> mmc part ## Unknown partition table type 0 U-Boot> mmc read $loadaddr 0 2
but reading from eMMC fails with:
MMC read: dev # 0, block # 0, count 2 ... 0 blocks read: ERROR
so it looks like eMMC is not properly working with CM3 in this version? Any ideas what to check to have it working before I dig to debugging session ;). Thanks.
You should give 2018.07 a try, which includes a change for a problem reported by someone with a CM3.
commit 79fd08f7456c7d12b04ef39e51d84d9981599c3a Author: Alexander Graf agraf@suse.de Date: Wed May 23 22:24:51 2018 +0200
mmc: Unirqify bcm2835_sdhost and fix writes
The bcm2835 sdhost driver has a problem with "write multiple" commands. It seems to boil down to the fact that the controller dislikes its FIFO to get drained at the end of a block when a write multiple blocks command is in flight.
The easy fix is to simply get rid of all the IRQ driven logic and make the driver push as much data into the FIFO as it can. That way we never drain and we never run into the problem.
Reported-by: Jan Leonhardt jan@cyberdesigner.net Signed-off-by: Alexander Graf agraf@suse.de
drivers/mmc/bcm2835_sdhost.c | 265 ++++++++++-------------------------------------------- 1 file changed, 47 insertions(+), 218 deletions(-)

Hi Jonathan,
On Wed, Jul 11, 2018 at 3:11 AM Jonathan Gray jsg@jsg.id.au wrote:
On Tue, Jul 10, 2018 at 10:37:19PM +0200, Belisko Marek wrote:
Hello,
I'm trying to use u-boot on CM3 (which contains eMMC) to boot kernel. I'm using u-boot 2018.05 and it can start fine like: U-Boot 2018.05 (Jul 10 2018 - 20:32:05 +0000)
DRAM: 948 MiB RPI Compute Module 3 (0xa220a0) MMC: sdhci@7e300000: 0 Loading Environment from FAT... unable to select a mode ** No partition table - mmc 0 ** Failed (-5) In: serial Out: vidconsole Err: vidconsole Net: No ethernet found. starting USB... USB0: scanning bus 0 for devices... 1 USB Device(s) found scanning usb for storage devices... 0 Storage Device(s) found Hit any key to stop autoboot: 0 U-Boot> U-Boot> U-Boot> U-Boot> mmc info Device: sdhci@7e300000 Manufacturer ID: 15 OEM: 100 Name: 4FPD3 Bus Speed: 52000000 Mode : MMC legacy Rd Block Len: 512 MMC version 5.0 High Capacity: Yes Capacity: 3.6 GiB Bus Width: 1-bit Erase Group Size: 512 KiB HC WP Group Size: 8 MiB User Capacity: 3.6 GiB WRREL Boot Capacity: 4 MiB ENH RPMB Capacity: 512 KiB ENH U-Boot> mmc part ## Unknown partition table type 0 U-Boot> mmc read $loadaddr 0 2
but reading from eMMC fails with:
MMC read: dev # 0, block # 0, count 2 ... 0 blocks read: ERROR
so it looks like eMMC is not properly working with CM3 in this version? Any ideas what to check to have it working before I dig to debugging session ;). Thanks.
You should give 2018.07 a try, which includes a change for a problem reported by someone with a CM3.
commit 79fd08f7456c7d12b04ef39e51d84d9981599c3a Author: Alexander Graf agraf@suse.de Date: Wed May 23 22:24:51 2018 +0200
mmc: Unirqify bcm2835_sdhost and fix writes The bcm2835 sdhost driver has a problem with "write multiple" commands. It seems to boil down to the fact that the controller dislikes its FIFO to get drained at the end of a block when a write multiple blocks command is in flight. The easy fix is to simply get rid of all the IRQ driven logic and make the driver push as much data into the FIFO as it can. That way we never drain and we never run into the problem. Reported-by: Jan Leonhardt <jan@cyberdesigner.net> Signed-off-by: Alexander Graf <agraf@suse.de>
drivers/mmc/bcm2835_sdhost.c | 265 ++++++++++-------------------------------------------- 1 file changed, 47 insertions(+), 218 deletions(-)
tried but looks like result is same: U-Boot 2018.07-dirty (Jul 11 2018 - 03:14:31 +0000)
DRAM: 948 MiB RPI Compute Module 3 (0xa220a0) MMC: sdhci@7e300000: 0 Loading Environment from FAT... ** No partition table - mmc 0 ** Failed (-5) In: serial Out: vidconsole Err: vidconsole Net: No ethernet found. starting USB... USB0: scanning bus 0 for devices... 1 USB Device(s) found scanning usb for storage devices... 0 Storage Device(s) found Hit any key to stop autoboot: 0 U-Boot> U-Boot> mmc dev unable to select a mode switch to partitions #0, OK mmc0(part 0) is current device U-Boot> mmc info Device: sdhci@7e300000 Manufacturer ID: 15 OEM: 100 Name: 4FPD3 Bus Speed: 52000000 Mode : MMC legacy Rd Block Len: 512 MMC version 5.0 High Capacity: Yes Capacity: 3.6 GiB Bus Width: 1-bit Erase Group Size: 512 KiB HC WP Group Size: 8 MiB User Capacity: 3.6 GiB WRREL Boot Capacity: 4 MiB ENH RPMB Capacity: 512 KiB ENH U-Boot> mmc part ## Unknown partition table type 0 U-Boot> mmc read $loadaddr 0 2
MMC read: dev # 0, block # 0, count 2 ... 0 blocks read: ERROR U-Boot>
Thanks and BR,
marek

On Tue, Jul 10, 2018 at 9:37 PM, Belisko Marek marek.belisko@gmail.com wrote:
Hello,
I'm trying to use u-boot on CM3 (which contains eMMC) to boot kernel. I'm using u-boot 2018.05 and it can start fine like: U-Boot 2018.05 (Jul 10 2018 - 20:32:05 +0000)
DRAM: 948 MiB RPI Compute Module 3 (0xa220a0) MMC: sdhci@7e300000: 0 Loading Environment from FAT... unable to select a mode ** No partition table - mmc 0 ** Failed (-5) In: serial Out: vidconsole Err: vidconsole Net: No ethernet found. starting USB... USB0: scanning bus 0 for devices... 1 USB Device(s) found scanning usb for storage devices... 0 Storage Device(s) found Hit any key to stop autoboot: 0 U-Boot> U-Boot> U-Boot> U-Boot> mmc info Device: sdhci@7e300000 Manufacturer ID: 15 OEM: 100 Name: 4FPD3 Bus Speed: 52000000 Mode : MMC legacy Rd Block Len: 512 MMC version 5.0 High Capacity: Yes Capacity: 3.6 GiB Bus Width: 1-bit Erase Group Size: 512 KiB HC WP Group Size: 8 MiB User Capacity: 3.6 GiB WRREL Boot Capacity: 4 MiB ENH RPMB Capacity: 512 KiB ENH U-Boot> mmc part ## Unknown partition table type 0 U-Boot> mmc read $loadaddr 0 2
but reading from eMMC fails with:
MMC read: dev # 0, block # 0, count 2 ... 0 blocks read: ERROR
so it looks like eMMC is not properly working with CM3 in this version? Any ideas what to check to have it working before I dig to debugging session ;). Thanks.
I'm sure there was a patch series explicitly enabling the CM3 and associated IO board but I don't see it in git or my inbox but maybe my search fu is off this morning. There is a patch series landing in 4.19 with support for it [1] so I suspect it'll be worthwhile someone looking at proper support for it in u-boot too.
[1] http://lists.infradead.org/pipermail/linux-rpi-kernel/2018-July/007651.html

Hi Peter, On Wed, Jul 11, 2018 at 10:01 AM Peter Robinson pbrobinson@gmail.com wrote:
On Tue, Jul 10, 2018 at 9:37 PM, Belisko Marek marek.belisko@gmail.com wrote:
Hello,
I'm trying to use u-boot on CM3 (which contains eMMC) to boot kernel. I'm using u-boot 2018.05 and it can start fine like: U-Boot 2018.05 (Jul 10 2018 - 20:32:05 +0000)
DRAM: 948 MiB RPI Compute Module 3 (0xa220a0) MMC: sdhci@7e300000: 0 Loading Environment from FAT... unable to select a mode ** No partition table - mmc 0 ** Failed (-5) In: serial Out: vidconsole Err: vidconsole Net: No ethernet found. starting USB... USB0: scanning bus 0 for devices... 1 USB Device(s) found scanning usb for storage devices... 0 Storage Device(s) found Hit any key to stop autoboot: 0 U-Boot> U-Boot> U-Boot> U-Boot> mmc info Device: sdhci@7e300000 Manufacturer ID: 15 OEM: 100 Name: 4FPD3 Bus Speed: 52000000 Mode : MMC legacy Rd Block Len: 512 MMC version 5.0 High Capacity: Yes Capacity: 3.6 GiB Bus Width: 1-bit Erase Group Size: 512 KiB HC WP Group Size: 8 MiB User Capacity: 3.6 GiB WRREL Boot Capacity: 4 MiB ENH RPMB Capacity: 512 KiB ENH U-Boot> mmc part ## Unknown partition table type 0 U-Boot> mmc read $loadaddr 0 2
but reading from eMMC fails with:
MMC read: dev # 0, block # 0, count 2 ... 0 blocks read: ERROR
so it looks like eMMC is not properly working with CM3 in this version? Any ideas what to check to have it working before I dig to debugging session ;). Thanks.
I'm sure there was a patch series explicitly enabling the CM3 and associated IO board but I don't see it in git or my inbox but maybe my search fu is off this morning. There is a patch series landing in 4.19 with support for it [1] so I suspect it'll be worthwhile someone looking at proper support for it in u-boot too.
Patch https://github.com/anholt/linux/commit/e9af481cbc21bba1d4447a5a4bd1674c40d61... add support for CM1 which is different processor but IIRC CM3 support is already in u-boot except eMMC is not working, so probably I dig to that area ;).
[1] http://lists.infradead.org/pipermail/linux-rpi-kernel/2018-July/007651.html
BR,
marek
participants (3)
-
Belisko Marek
-
Jonathan Gray
-
Peter Robinson