AnsweredAssumed Answered

How do I access eMMC on second eSDHC controller on LS1012A?

Question asked by Tim Hammer on Aug 24, 2018
Latest reply on Aug 31, 2018 by Tim Hammer

Bringing up our custom board based on the LS1012A-Freedom reference design has hit a snag with the second eSDHC controller. We have an SD Card slot on the first eSDHC controller and an eMMC on the second. I am able to see and read an SD card in the slot, but seem to have no access to the eMMC.


My RCW configuration has the following related to the second controller:

  • SDHC2_BASE_DAT321 [374-375] 0b01 (SDHC2_DAT[3:1])
  • SDHC2_BASE_BASE [376-377] 0b01 (SDHC2_CMD, SDHC2_DAT0, SDHC2_CLK)


The SDHC2_EXT_* (where * is one of {CLK|CMD|DAT3|DAT2|DAT1|DAT0}) RCW bits should be ignored when the above two are set to anything other than 0b00.

I am pretty confident that the RCW is configured correctly (at least as confident, maybe more so, than I was  for the SDHC1_ bits, but we did discover that I had missed the SEL and CD pins...).


I am also pretty confident that my device tree has everything needed, although I think the device tree is not used for the U-Boot setup. Stepping through the code, I see the MMC initialized by a call to drivers/mmc/fsl_esdhc.c::fsl_esdhc_mmc_init(). This initialization code only sets up a single esdhc device at address 0x01560000. I do not find any reference to the second controller at 0x01580000 in the source code (u-boot-qoriq from meta-freescale layer repo on Yocto Project git server).


In my research, I came across this ( set of patches for OpenWRT/LEDE that add support for LS1012A.

The initial description does not mention support for the SDHC controllers, but a number of the patch file names include sdhc (or SDHC) including “..._esdhc-support-two-esdhc-host-controllers.patch” and “...2a-enable-two-esdhc-host-controllers-supp.patch”.


Looking more closely at the specific patch sets related to the eSDHC controllers, I see the addition of macros (e.g. CONFIG_FSL_ESDHC_TWO_CONTROLLERS_SUPPORT and CONFIG_SYS_FSL_ESDHC_1_ADDR) and source code based on and/or using these new macros that implement the second eSDHC controller functionality. 


In the u-boot-qoriq source, I do not find/recognize any code that seems to support the second eSDHC controller. In particular, nothing that might initialize a second controller at 0x01580000.

The patches above include adding support for a second controller at 0x01580000..

I started looking at adding the support from the above patches but did not get very far as there are some differences that I did not want to work through yet.


This community discussion:

implies that support for the second eSDHC controller was in the U-Boot he was using on the RDB, but I do not see anything in the source code that indicates that.


From this description, can anyone tell me what I am missing in the configuration that the second eSDHC controller is failing to get setup/run?

Or where I am not looking in the source code to see that the second eSDHC controller is supported and how to enable it?


Any pointers are greatly appreciated!