AnsweredAssumed Answered

P1020 and eMMC - different behavior on different kernels

Question asked by Lukasz Zemla on Apr 27, 2016
Latest reply on Aug 10, 2016 by John Clark

Hello,

 

I'm trying to find out the best kernel supported by Xenomai and I'm testing different versions of the kernel on my custom board using P1020 CPU. Every time I use the same DTB (fragment below)

 

sdhc@2e000 {

            compatible = "fsl,p1020-esdhc", "fsl,esdhc";

            reg = <0x2e000 0x1000>;

            interrupts = <0x48 0x2 0x0 0x0>;

            clock-frequency = <0x0>;

            sdhci,auto-cmd12;

            non-removable;

        };

 

and the same defconfig (mpc_85xx_smp_defconfig).

 

Currently I run system from TFTP, but noticed different different eMMC (would like to put kernel and rootfs finally there) behavior on different kernels.

My eMMC is Greenliant GLS85VM1001P-S-I-LFWE-ND201 (MMC v4.4), connected using 4-bit interface to P1020. It is powered by 3.3V power supply.

That eMMC works fine only on:

- kernel provided by NXP SDK 1.9 (it's 3.12.37-rt51+g43cecda).

- latest vanilla 4.5.2

It works partially on vanilla 3.14.

 

I'm wondering what is the reason? Do I need special entries in DTB for eMMC or P1020 esdhc controller for some kernels? Is P1020 or eMMC support for that particular chip broken in some kernels (3.18, 4.1?)?

May some troubles be caused that my eMMC card is v4.4 but P1020 supports only v4.2?

I'm a kernel newbe, but maybe backporting of 4.5.2 drivers to 4.1.x should solve the problem? Which files should be backported?

I understand that community takes care mainly about SDK and NXP kernels, but maybe someone has some other experience and could give some hint.

 

More details:

On SDK kernel 3.12 and vanilla 4.5.2 everything works fine (card is detected, can be mounted and read/written).

On following versions I've tested, there are problems:

- vanilla 3.14

- vanilla 3.18

- vanilla 4.1 (I'd prefer to use that one because it is the most recent kernel with Xenomai patch available)

- vanilla 4.4

 

 

SDK 3.12 - OK

root@p1020rdb:~# uname -a

Linux p1020rdb 3.12.37-rt51+g43cecda #1 SMP PREEMPT RT Tue Apr 26 08:08:29 CEST 2016 ppc GNU/Linux

root@p1020rdb:~# cat /sys/kernel/debug/mmc0/ios

clock:          52000000 Hz

vdd:            7 (1.65 - 1.95 V)   Why is there wrong voltage?

bus mode:       2 (push-pull)

chip select:    0 (don't care)

power mode:     2 (on)

bus width:      2 (4 bits)

timing spec:    1 (mmc high-speed)

signal voltage: 0 (3.30 V)

root@p1020rdb:~# ls /dev/mmcblk0*

/dev/mmcblk0       /dev/mmcblk0boot0  /dev/mmcblk0boot1  /dev/mmcblk0p1     /dev/mmcblk0p2

 

 

Vanilla 3.14.67 - PARTIALLY OK

Some errors during startup, wrong bus width detected, but card can be mounted and accessed:

 

root@p1020rdb:~# uname -a

Linux p1020rdb 3.14.67 #3 SMP PREEMPT Wed Apr 27 09:45:24 CEST 2016 ppc GNU/Linux

root@p1020rdb:~# cat /sys/kernel/debug/mmc0/ios

clock:          52000000 Hz

vdd:            21 (3.3 ~ 3.4 V)

bus mode:       2 (push-pull)

chip select:    0 (don't care)

power mode:     2 (on)

bus width:      0 (1 bits)   wrong bus width detected?

timing spec:    1 (mmc high-speed)

signal voltage: 0 (3.30 V)

 

mmc0: new high speed MMC card at address 0001

mmcblk0: mmc0:0001 VM010B 868 MiB

mmcblk0boot0: mmc0:0001 VM010B partition 1 512 KiB

mmcblk0boot1: mmc0:0001 VM010B partition 2 512 KiB

mmc0: Got data interrupt 0x00600000 even though no data operation was in progress.

mmc0: Got data interrupt 0x00600000 even though no data operation was in progress.

mmc0: Got data interrupt 0x00600000 even though no data operation was in progress.

mmc0: Got data interrupt 0x00600000 even though no data operation was in progress.

mmc0: Got data interrupt 0x00600000 even though no data operation was in progress.

mmc0: Got data interrupt 0x00200000 even though no data operation was in progress.

mmc0: Got data interrupt 0x0060000a even though no data operation was in progress.

mmcblk0: error -84 transferring data, sector 0, nr 8, cmd response 0x900, card status 0x0

mmcblk0: retrying using single block read

mmcblk0: p1 p2

mmcblk0boot1: unknown partition table

mmcblk0boot0: unknown partition table

 

root@p1020rdb:~# ls /dev/mmcblk0*

/dev/mmcblk0       /dev/mmcblk0boot0  /dev/mmcblk0boot1  /dev/mmcblk0p1     /dev/mmcblk0p2

 

 

Vanilla 3.18.31 - NOT OK

System continously prints following message every few seconds:

mmc0: Timeout waiting for hardware interrupt.

 

root@p1020rdb:~# uname -a

Linux p1020rdb 3.18.31 #1 SMP Fri Apr 22 17:54:30 CEST 2016 ppc GNU/Linux

root@p1020rdb:~# cat /sys/kernel/debug/mmc0/ios

clock:          400000 Hz

vdd:            21 (3.3 ~ 3.4 V)

bus mode:       2 (push-pull)

chip select:    0 (don't care)

power mode:     2 (on)

bus width:      0 (1 bits)

timing spec:    0 (legacy)

signal voltage: 0 (3.30 V)

 

root@p1020rdb:~# dmesg | grep mmc

sdhci-esdhc e3e2e000.sdhc: No vmmc regulator found

sdhci-esdhc e3e2e000.sdhc: No vqmmc regulator found

mmc0: SDHCI controller on e3e2e000.sdhc [e3e2e000.sdhc] using DMA

mmc0: Timeout waiting for hardware interrupt.

mmc0: Timeout waiting for hardware interrupt.

 

root@p1020rdb:~# ls /dev/mmc*

ls: /dev/mmc*: No such file or directory

 

 

Vanilla 4.1.22 - NOT OK

There are errors during startup, card cannot be mounted.

 

root@p1020rdb:~# uname -a

Linux p1020rdb 4.1.22 #2 SMP Mon Apr 25 23:34:01 CEST 2016 ppc GNU/Linux

root@p1020rdb:~# cat /sys/kernel/debug/mmc0/ios

clock:          52000000 Hz

vdd:            21 (3.3 ~ 3.4 V)

bus mode:       2 (push-pull)

chip select:    0 (don't care)

power mode:     2 (on)

bus width:      2 (4 bits)

timing spec:    1 (mmc high-speed)

signal voltage: 0 (3.30 V)

 

sdhci-esdhc e3e2e000.sdhc: No vmmc regulator found

sdhci-esdhc e3e2e000.sdhc: No vqmmc regulator found

mmc0: SDHCI controller on e3e2e000.sdhc [e3e2e000.sdhc] using DMA

mmc0: mmc_rescan_try_freq: trying to init card at 400000 Hz

mmc0: switch to bus width 1 failed

mmc0: new high speed MMC card at address 0001

mmcblk0: mmc0:0001 VM010B 868 MiB

mmcblk0boot0: mmc0:0001 VM010B partition 1 512 KiB

mmcblk0boot1: mmc0:0001 VM010B partition 2 512 KiB

mmcblk0: error -84 transferring data, sector 0, nr 8, cmd response 0x900, card status 0x0

mmc0: tried to reset card

mmcblk0: retrying using single block read

mmcblk0: error -84 transferring data, sector 0, nr 8, cmd response 0x900, card status 0x0

blk_update_request: I/O error, dev mmcblk0, sector 0

mmcblk0: error -84 transferring data, sector 1, nr 7, cmd response 0x900, card status 0x0

blk_update_request: I/O error, dev mmcblk0, sector 1

[...]

root@p1020rdb:~# ls /dev/mmcblk0*

/dev/mmcblk0       /dev/mmcblk0boot0  /dev/mmcblk0boot1

 

 

Vanilla 4.5.2 - OK

root@p1020rdb:~# uname -a

Linux p1020rdb 4.5.2 #1 SMP Tue Apr 26 12:29:53 CEST 2016 ppc GNU/Linux

root@p1020rdb:~# cat /sys/kernel/debug/mmc0/ios

clock:          52000000 Hz

actual clock:   49999999 Hz

vdd:            21 (3.3 ~ 3.4 V)

bus mode:       2 (push-pull)

chip select:    0 (don't care)

power mode:     2 (on)

bus width:      2 (4 bits)

timing spec:    1 (mmc high-speed)

signal voltage: 0 (3.30 V)

driver type:    0 (driver type B)

root@p1020rdb:~# ls /dev/mmcblk0*

/dev/mmcblk0       /dev/mmcblk0boot0  /dev/mmcblk0boot1  /dev/mmcblk0p1     /dev/mmcblk0p2

Outcomes