On 21 April 2016 at 21:11, Liming Wang liming.wang@canonical.com wrote:
On Thu, Apr 21, 2016 at 04:38:29PM +0800, Guodong Xu wrote:
On 21 April 2016 at 16:07, Haojian Zhuang haojian.zhuang@linaro.org wrote:
On 21 April 2016 at 15:29, Peter Griffin peter.griffin@linaro.org wrote:
Hi Guodong,
On 21 April 2016 at 02:38, Guodong Xu guodong.xu@linaro.org wrote:
Hi, Liming
The subject line is miss-leading. :)
Kernel 4.4 based hikey-mainline-rebase is full featured. MMC/SD card is supported. One of the possible reason should be related to mmc host controller not reset completely.
There is no such issue in UEFI. But since you are using uboot, maybe it lacks some initialization codes for mmc controller.
Does the UEFI code assert the reset line on the IP before booting the kernel? If so I might need to add something similar to U-Boot.
UEFI didn't reset eMMC/SD just before booting the kernel.
Let's wait and see Liming's test result. I would prefer to do this in mmc kernel driver, instead of bootloader.
Hi Guodong,
I have tested your patch, but unfortunately, with your patch, my 4.4 kernel still can't detect any sd card on hikey board. BTW, my hikey board is LeMaker's 2G DRAM/8G NAND FLash version.
But I found some causes why the kernel can't detect the sd card: it's all about the dtb.
For 3.18 kernel, I used dtbs from snapshot version [1] and release version [2], but only release version works well. After investigating the code, I found below commit removes some settings from dts:
commit d840635065f5a2731dea22cf827d8dadc6524729 Author: Fei Wang william.wfei@gmail.com Date: Fri Dec 18 22:31:55 2015 +0800
dts: hikey: fix some sd card partition not recognized Some sd card be recognized SDR50 and set 1.8v, but when read partition return -84 error so that not get partition information. TODO:make sure set voltage is right!
If I revert this commit, the 3.18 kernel can detect sd cards.
From this and log messages below, your SD card is a 'UHS' mode card.
(https://www.sdcard.org/developers/overview/bus_speed/). Let me know if it is not.
- For 4.4 kernel, I found this commit modifies the wrong location:
commit 40fd5e086e1ef1835b97f11f4f5d6a3253c2fe3d Author: Guodong Xu guodong.xu@linaro.org Date: Sat Feb 6 19:55:49 2016 +0800
arm64: dts: hi6220: add sd-uhs- properties into dwmmc_1 With these properties added, sd cards inserted into hikey can work at UHS mode if they have such capability. Due to some silicon defect in hi6220, a UHS support patch must be applied into drivers/mmc/host/dw_mmc to enable UHS mode. If you didn't add this patch, but added sd-uhs- properties into dwmmc_1, then sd cards cannot work.
This patch should modify dwmmc_1 but it actually modifies dwmmc_0. After fix this bug, my 4.4 kernel also can detect sd card.
Thanks a lot. I will fix that.
- In all my testings, whether 3.18 or 4.4 kernel, on UEFI or u-boot, the kernel
can't detect sd card when booting up. Only if I re-insert the sd card to slot, the kernel could detect the sd card.
The boot sequence of UEFI is: if SD card exists, it will try boot from SD card; when there is no valid partition and kernel image (and files) in SD cards, then it will not boot. Does this match what you saw on UEFI w/ both 3.18 and 4.4 kernel?
- But the detections are not 100% successful.
Do you mean on 3.18 or 4.4? If 3.18, I'm afraid we will not do anything since it's already released and moved on to 4.4.
I have a board with me using 4.6-rc3 kernel, about 20 insertion/removal, UHS-1 mode sd, all success.
I will test a 4.4 version in this afternoon. Will report back.
If it fails, the kernel prints: mmc_host mmc1: Bus speed (slot 0) = 25000000Hz (slot req 400000Hz, actual 390625HZ div = 32) mmc1: error -110 whilst initialising SD card
If it succeeds, the kernel prints: mmc_host mmc1: Bus speed (slot 0) = 100000000Hz (slot req 100000000Hz, actual 100000000HZ div = 0) mmc1: new ultra high speed SDR50 SDHC card at address aaaa
It seems that when host->bus_hz is 100000000Hz, it will succeed, otherwise, 25000000Hz or 50000000Hz, it always fails.
Wish my testing results may help you to fix the bug.
Very useful. Thanks a lot.
-Guodong
BR, Liming Wang
[1] https://builds.96boards.org/snapshots/hikey/linaro/debian/latest/ [2] https://builds.96boards.org/releases/hikey/linaro/debian/latest/
From SoC hardware engineer, he confirmed that need to set assert bit then wait, then deassert.
-Guodong
Regards Haojian
Dev mailing list Dev@lists.96boards.org https://lists.96boards.org/mailman/listinfo/dev