eMMC works in U-Boot but not with the Linux Kernel.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

eMMC works in U-Boot but not with the Linux Kernel.

2,167 Views
dougbailey
Contributor III

I have a board based off of a SabreSD board running an iMX6DL. I have built software for the board using the fsl-yocto-L4.1.15_2.0.0-ga from NXP. This has U-boot 2016.03 and the 4.1.15 Linux kernel.

The board has a eMMC device attached to USDHC4 (SD4_CS, SD4_CMD, and SD4_DAT0-7)

I am able to communicate with the eMMC device in U-Boot. I can read the device info via "mmc info" and can write and read data that via the "mmc write" and "mmc read" commands.  (I tested the write and read over power cycles and the data matched.) 

I cannot get the eMMC to work under Linux. When the driver loads, it complains of interrupt timeouts, eventually stops trying and shuts down the system.

I have pad ctl value of 0x17059 on all the pins except for 0x10059 on the SD4_CLK. (These match the values used on the Sabre board.) I see all the MUX values for the SD4 pins set to the SD4 USDHC functionality.

When I ported my board, I used the SabreSD DTS files as a template for my system. I removed a number of items from the DTS file as they are not on my board. (This includes the 2 SD card slots that use SDHC2 and SDHC3.) I have left the USDHC4 definition the same as to what is specified for the SabreSD board:

&usdhc4 {
   pinctrl-names = "default";
   pinctrl-0 = <&pinctrl_usdhc4>;
   bus-width = <8>;
   non-removable;
   no-1-8-v;
   keep-power-in-suspend;
   status = "okay";
};


pinctrl_usdhc4: usdhc4grp {
   fsl,pins = <
      MX6QDL_PAD_SD4_CMD__SD4_CMD 0x17059
      MX6QDL_PAD_SD4_CLK__SD4_CLK 0x10059
      MX6QDL_PAD_SD4_DAT0__SD4_DATA0 0x17059
      MX6QDL_PAD_SD4_DAT1__SD4_DATA1 0x17059
      MX6QDL_PAD_SD4_DAT2__SD4_DATA2 0x17059
      MX6QDL_PAD_SD4_DAT3__SD4_DATA3 0x17059
      MX6QDL_PAD_SD4_DAT4__SD4_DATA4 0x17059
      MX6QDL_PAD_SD4_DAT5__SD4_DATA5 0x17059
      MX6QDL_PAD_SD4_DAT6__SD4_DATA6 0x17059
      MX6QDL_PAD_SD4_DAT7__SD4_DATA7 0x17059
   >;
};

When I probe the board, I do see a 50 MHz clock going to the device in both U-Boot and in the Linux kernel. 


The dmesg output related to the eMMC is as follows:
=============================================================
sdhci: Secure Digital Host Controller Interface driver
sdhci: Copyright(c) Pierre Ossman
sdhci-pltfm: SDHCI platform and OF driver helper
/soc/aips-bus@02100000/usdhc@0219c000: voltage-ranges unspecified
sdhci-esdhc-imx 219c000.usdhc: No vmmc regulator found
sdhci-esdhc-imx 219c000.usdhc: No vqmmc regulator found
mmc3: SDHCI controller on 219c000.usdhc [219c000.usdhc] using ADMA
mmc3: MAN_BKOPS_EN bit is not set


mmc3: Timeout waiting for hardware interrupt.
: =========== REGISTER DUMP (mmc3)===========
: Sys addr: 0x38fd6600   | Version: 0x00000002
: Blk size: 0x00000200    | Blk cnt: 0x00000001
: Argument: 0x00000000 | Trn mode: 0x00000013
: Present: 0x01fd820e     | Host ctl: 0x00000025
: Power: 0x00000002      | Blk gap: 0x00000080
: Wake-up: 0x00000008  | Clock: 0x0000003f
: Timeout: 0x0000008f    | Int stat: 0x00000000
: Int enab: 0x107f100b    | Sig enab: 0x107f100b
: AC12 err: 0x00000000  | Slot int: 0x00000103
: Caps: 0x07eb0000        | Caps_1: 0x0000a007
: Cmd: 0x0000083a         | Max curr: 0x00ffffff
: Host ctl2: 0x00000000
: ADMA Err: 0x00000003 | ADMA Ptr: 0x3c046004
: ===========================================
mmc3: switch to bus width 2 failed


Does anyone have any ideas as to why it does not work in Linux but does work in U-Boot?

Is there something not mentioned here that I need to look at?

Any help/ideas would be appreciated?

Regards,
Doug Bailey

Labels (2)
0 Kudos
2 Replies

1,310 Views
dougbailey
Contributor III

Correct me if I am wrong but I don't believe that a U-Boot driver for the mmc lends itself to be ported into Linux.  The two environments are markedly different and do not share the same system interfaces.  

Or am I missing something? 

0 Kudos

1,310 Views
b36401
NXP Employee
NXP Employee

Please try to compile Linux kernel with the same eMMC/SDcard driver as in u-boot.

Have a great day,
Victor

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos