0

Recently I acquire a R-Car M3 development board. I had successfully built an embedded Linux image with YOCTO 3.9.0 by following the steps on elinux.org/.../Yocto-Gen3

I have also update the firmware of the board by following the steps on elinux.org/.../M3SK.

Now I am trying to boot up Linux image form an SD card but when I turn on my board I get the error "MMC init fail". I know I can access the SD card and load the images that are saved there. But when trying to boot from the SD card it stops the boot and show the following message "mmc0: error -110 whilst initialising MMC card"

It seems that this error when trying to boot is because the board is not able to initialize the mmc. Has anybody face this same problem? Can someone help me solve it?

Boot logs

Welcome to minicom 2.7



OPTIONS: I18n

Compiled on Nov 15 2018, 20:18:47.

Port /dev/ttyUSB0, 22:57:14



Press CTRL-A Z for help on special keys



[ 0.000190] NOTICE: BL2: R-Car Gen3 Initial Program Loader(CA57) Rev.1.0.21

[ 0.005752] NOTICE: BL2: PRR is R-Car M3 Ver.1.0

[ 0.010421] NOTICE: BL2: Board is Starter Kit Rev.1.0

[ 0.015533] NOTICE: BL2: Boot device is HyperFlash(80MHz)

[ 0.020959] NOTICE: BL2: LCM state is CM

[ 0.025001] NOTICE: BL2: AVS setting succeeded. DVFS_SetVID=0x53

[ 0.030988] NOTICE: BL2: DDR3200(rev.0.33)NOTICE: [COLD_BOOT]NOTICE: ..0

[ 0.086074] NOTICE: BL2: DRAM Split is 2ch

[ 0.089960] NOTICE: BL2: QoS is default setting(rev.0.19)

[ 0.095463] NOTICE: BL2: Lossy Decomp areas

[ 0.099636] NOTICE: Entry 0: DCMPAREACRAx:0x80000540 DCMPAREACRBx:0x570

[ 0.106721] NOTICE: Entry 1: DCMPAREACRAx:0x40000000 DCMPAREACRBx:0x0

[ 0.113633] NOTICE: Entry 2: DCMPAREACRAx:0x20000000 DCMPAREACRBx:0x0

[ 0.120548] NOTICE: BL2: v1.4(release):15dba6b

[ 0.125038] NOTICE: BL2: Built : 05:48:04, Feb 18 2019

[ 0.130225] NOTICE: BL2: Normal boot

[ 0.133871] NOTICE: BL2: dst=0xe6320d00 src=0x8180000 len=512(0x200)

[ 0.140254] NOTICE: BL2: dst=0x43f00000 src=0x8180400 len=6144(0x1800)

[ 0.146875] NOTICE: BL2: dst=0x44000000 src=0x81c0000 len=65536(0x10000)

[ 0.154105] NOTICE: BL2: dst=0x44100000 src=0x8200000 len=1048576(0x100000)

[ 0.168928] NOTICE: BL2: dst=0x50000000 src=0x8640000 len=1048576(0x100000)





U-Boot 2015.04 (Feb 17 2019 - 23:28:11)



CPU: Renesas Electronics R8A7796 rev 1.0

Board: M3ULCB

I2C: ready

DRAM: 1.9 GiB

Bank #0: 0x048000000 - 0x07fffffff, 896 MiB

Bank #1: 0x600000000 - 0x63fffffff, 1 GiB



MMC: sh-sdhi: 0, sh-sdhi: 1

MMC init failed

Using default environment



In: serial

Out: serial

Err: serial

Net: Board Net Initialization Failed

No ethernet found.

Hit any key to stop autoboot: 0

=> mmc dev 0

switch to partitions #0, OK

mmc0 is current device

=> mmc info

Device: sh-sdhi

Manufacturer ID: 3

OEM: 5344

Name: SC64G

Tran Speed: 50000000

Rd Block Len: 512

SD version 3.0

High Capacity: Yes

Capacity: 59.5 GiB

Bus Width: 4-bit

Erase Group Size: 512 Bytes

=> ext2ls mmc 0:1 /boot

<DIR> 4096 .

<DIR> 4096 ..

<SYM> 28 Image

18522624 Image-4.14.35-yocto-standard

67069 Image-r8a7796-m3ulcb.dtb

67069 r8a7796-m3ulcb.dtb

67069 Image--4.14.35+git0+118adc53e8-r1-r8a7796-m3ulcb-2019021804481b

=> setenv bootargs 'rw root=/dev/mmcblk0p1 rootfstype=ext4 rootwait'

=> saveenv

Saving Environment to MMC...

MMC init failed
**END OF BOOTING LOG**

**DTB file Information** 

sd@ee100000 {
            compatible = "renesas,sdhi-r8a7796", "renesas,rcar-gen3-sdhi";
            reg = <0x0 0xee100000 0x0 0x2000>;
            interrupts = <0x0 0xa5 0x4>;
            clocks = <0xa 0x1 0x13a>;
            max-frequency = <0xbebc200>;
            power-domains = <0x7 0x20>;
            resets = <0xa 0x13a>;
            status = "okay";
            pinctrl-0 = <0x61>;
            pinctrl-1 = <0x62>;
            pinctrl-names = "default", "state_uhs";
            vmmc-supply = <0x63>;
            vqmmc-supply = <0x64>;
            cd-gpios = <0x65 0xc 0x1>;
            bus-width = <0x4>;
            sd-uhs-sdr50;
            sd-uhs-sdr104;
        };

        sd@ee120000 {
            compatible = "renesas,sdhi-r8a7796", "renesas,rcar-gen3-sdhi";
            reg = <0x0 0xee120000 0x0 0x2000>;
            interrupts = <0x0 0xa6 0x4>;
            clocks = <0xa 0x1 0x139>;
            max-frequency = <0xbebc200>;
            power-domains = <0x7 0x20>;
            resets = <0xa 0x139>;
            status = "disabled";
        };

        sd@ee140000 {
            compatible = "renesas,sdhi-r8a7796", "renesas,rcar-gen3-sdhi";
            reg = <0x0 0xee140000 0x0 0x2000>;
            interrupts = <0x0 0xa7 0x4>;
            clocks = <0xa 0x1 0x138>;
            max-frequency = <0xbebc200>;
            power-domains = <0x7 0x20>;
            resets = <0xa 0x138>;
            status = "okay";
            pinctrl-0 = <0x66>;
            pinctrl-1 = <0x67>;
            pinctrl-names = "default", "state_uhs";
            vmmc-supply = <0x68>;
            vqmmc-supply = <0x69>;
            bus-width = <0x8>;
            mmc-hs200-1_8v;
            mmc-hs400-1_8v;
            non-removable;
        };

        sd@ee160000 {
            compatible = "renesas,sdhi-r8a7796", "renesas,rcar-gen3-sdhi";
            reg = <0x0 0xee160000 0x0 0x2000>;
            interrupts = <0x0 0xa8 0x4>;
            clocks = <0xa 0x1 0x137>;
            max-frequency = <0xbebc200>;
            power-domains = <0x7 0x20>;
            resets = <0xa 0x137>;
            status = "disabled";
        };

  • Did you check the device tree file? Is the MMC enabled in device tree for Linux to work correctly? It is possible that it is not or the wrong MMC peripheral is enabled. For example, you require MMC0, but, MMC1 might be enabled there. Also, note that Linux can change the MMC device id dynamically. If two MMC's exist, it is possible the one you are expecting to have id 0 actually gets a 1. Also check the pinmux. – Sanchayan Maity Feb 26 '19 at 10:06
  • I have check the dtb file and find 4 different sd devices; sd@ee100000, sd@ee120000, sd@ee140000 and sd@ee160000. The sd@ee100000 (pinctrl-0 = <0x61>, pinctrl-1 = <0x62>) and sd@ee140000 (pinctrl-0 = <0x66>, pinctrl-1 = <0x67>) have an "ok" status, the other ones are disable. I do not know how to interpret this information. My first idea was to disable one of the MMC and try to boot the image again. The thing is that I do not know how to modify the dtb file. I have seen that they convert a dtb - dts and then dts - dtb to modify it. – Carlos Ochoa Feb 27 '19 at 04:41
  • You need to modify the dts file if required. dtb is the device tree binary blob generated by compiling the dts with device tree compiler. You need to cross check against the hardware schematic which SD card interface is supposed to be used and accordingly change things. – Sanchayan Maity Feb 28 '19 at 05:36
  • I was able to boot the image. What I did was decompiling the dtb file into a dts file, which is an editable txt. Then on the sd section, I edit the status of the "sd@ee140000" from "ok" to "disable". After that modification I compile this modified dts file into a dtb file and load it to the R-Car M3 board. Only then I was able to boot the image. – Carlos Ochoa Mar 13 '19 at 15:26
  • Despite the fact I was able to boot the image, I can say that the main issue is still not resolve. When I power on the board, it is not able to successfully initialize the mmc card and therefore I can not save environmental variables. So every time I power on the board I need to stop auto boot and manually modified the default environmental variables in order to boot from the SD Card. – Carlos Ochoa Mar 13 '19 at 15:26

2 Answers2

0

With Renesas Yocto version 3.9.0, there were some already-known issues raised at:

https://elinux.org/R-Car/Boards/M3SK

(scroll down to the bottom)

You should apply the workaround on MMC driver for the kernel.

For mmc spec on M3SK,

  + sdhi0: used for sdcard 4-bit bus width 
  + sdhi2: used for on-board 8bit eMMC
  + sd-uhs-sdr50: SD UHS SDR50 speed is supported
  + sd-uhs-sdr104: SD UHS SDR104 speed is supported
  + mmc-hs200-1_8v: eMMC HS200 mode(1.8V I/O) is supported
  + mmc-hs400-1_8v: eMMC HS400 mode(1.8V I/O) is supported

There were also some patches that may deal with your issue:

https://patchwork.kernel.org/patch/9963437/

https://patchwork.kernel.org/patch/9998159/

By the way, you are using arm-tf v1.4, it should be used with u-boot v2018.09 for compatibility.

Thảo M. Hoàng
  • 1,224
  • 3
  • 20
  • 42
  • Thank you for answering. When I try to run the patch it asks me to select the file which is going to be modify. Do you have any idea on which file should I patch? I also do not know how to update the u-boot of the board. I already update the firmware and loaded a file name "u-boot-elf.srec". I think that when updating the firmware it should also update the version of u-boot used. Am I right? – Carlos Ochoa Mar 24 '19 at 03:01
0

u-boot should support mmc and sdcard init. Did you try to use another sdcard?

To update u-boot-elf.srec, you need flash_writer from https://github.com/renesas-rcar/flash_writer

  1. Build your flash_writer
  2. Let device boot-up in SCIF download mode or USB download mode. type "ctrl+A S", send your xxx.mot
  3. Refer the steps in https://elinux.org/R-Car/Boards/M3SK#Flashing_firmware
Andronicus
  • 25,419
  • 17
  • 47
  • 88
mrwcs
  • 41
  • 4