Move mmc_select_hs400() out from hs200 init path and make hs400
independent.
The patch makes quite some changes and needs to be reviewed carefully.
In function mmc_select_timing() call for mmc_select_hs400().
HS400 requires a host bus with of 8bit, if not supported we
return with -ENOTSUPP, there is no retry.
If the host controller can't switch to 8bit (dts: bus-width = <4>)
it can't recover on next power-up init failed.
Have the controller set to HS mode, make the hs400 tuning prepare
if any and run mmc tuning before switching to HS400.
This patch resolve the problem if hs400-1_8v is set but extended
strobe is not.
&sdhci { // eMMC
bus-width = <8>;
mmc-hs400-1_8v;
// mmc-hs400-enhanced-strobe;
non-removable;
status = "okay";
};
[ 1.775721] mmc1: CQHCI version 5.10
[ 1.802342] mmc1: SDHCI controller on fe330000.sdhci [fe330000.sdhci] using ADMA
[ 2.007581] mmc1: mmc_select_hs200 failed, error -110
[ 2.007589] mmc1: error -110 whilst initialising MMC card
[ 2.413559] mmc1: mmc_select_hs200 failed, error -110
[ 2.413562] mmc1: error -110 whilst initialising MMC card
[ 3.183343] mmc1: Command Queue Engine enabled
[ 3.183355] mmc1: new HS400 MMC card at address 0001
[ 3.197163] mmcblk1: mmc1:0001 DG4008 7.28 GiB
[ 3.197256] mmcblk1boot0: mmc1:0001 DG4008 partition 1 4.00 MiB
[ 3.197360] mmcblk1boot1: mmc1:0001 DG4008 partition 2 4.00 MiB
[ 3.197360] mmcblk1boot1: mmc1:0001 DG4008 partition 2 4.00 MiB
[ 3.197479] mmcblk1rpmb: mmc1:0001 DG4008 partition 3 4.00 MiB, chardev (242:0)
[ 1.743386] mmc1: CQHCI version 5.10
[ 1.769952] mmc1: SDHCI controller on fe330000.sdhci [fe330000.sdhci] using ADMA
[ 1.846223] mmc1: Command Queue Engine enabled
[ 1.846230] mmc1: new HS400 MMC card at address 0001
[ 1.846557] mmcblk1: mmc1:0001 DG4008 7.28 GiB
[ 1.846650] mmcblk1boot0: mmc1:0001 DG4008 partition 1 4.00 MiB
[ 1.846742] mmcblk1boot1: mmc1:0001 DG4008 partition 2 4.00 MiB
[ 1.846825] mmcblk1rpmb: mmc1:0001 DG4008 partition 3 4.00 MiB, chardev (242:0)
Tested with rk3399 customized board.