Dear All,
So lets do a synthesis of where we are, People who have an interest:
1) Me
2) Jonas Karlman - disable-wp should be set, and Tested. But commented
"fixes reboot when booting from sd-card and having emmc zeroed out" when
regulator-boot-on is set
3) Heiko Stubner (Rockchip maintainer) - agrees disable-wp should set
4) Doug Anderson - Card Detect shouldn't be power by vccio_sd. So this
error in board construction, means should do "broken-cd" as Card Detect
doesn't work when vccio_sd is down
5) Jaehoon Chung & Ulf Hansson, not posted on this thread - but MMC SD
maintainer. In past thread 4-5 years ago, strongly said this is a broken
cd, hence use "broken-cd"
6) Robin Murphy - who identified the problem with card detected powered
by vccio_sd. So power on vccio_sd always, but can be swayed. Maybe we
should have a software correction to this problem.
7) Tony McKahan - involved in Armbian, so interested in Tinker Board S
support by mainline Linux
And so what to conclude.
Well, although Jaehoon and Ulf haven't posted on this thread, the thread
from four years ago:
http://lists.infradead.org/pipermail/linux-arm-kernel/2014-August/281153.html
And it makes clear that its treated as a broken card detect, and so
"broken-cd" is the correct solution, now Robin says on some machines
this causes a high load due to the polling; but this hasn't clearly been
seen on rk3288 machines, either on this thread or on ArchLinux Arm. To
my mind this means that Ulf and Jaehoon as maintainers, even with a 4
year old post, trump and win - and so we go with "broken-cd" over
enabling the regulator all the time.
Jonas comment though, about warm reboots on sd card. Suggests we do have
"regulator-boot-on". Haven't been able to confirm this; so would be good
if Jonas could confirm this is *exactly* what is needed?
So unless anyone says anything to convince me otherwise, my plan is to
submit v3 of this patch in next few days with:
1) "broken-cd"
2) "disable-wp"
3) "regulator-boot-on"
Now question for Heiko is what schedule are we looking at? My guess is
that the linux 5.1 boot has been missed? So whats the schedule for 5.2?
Guess I should also say some words on the talk of should there be a
software work around for this common hardware fault, where the CD is
powered by vccio_sd. As I see it with "broken-cd" when we want sd status
the kernel does:
1) Power on vccio_sd
2) Poll the card with timeouts
3) Power down the vccio_sd
Now with an additional software work around, would involve step 2
replaced with "test cd pin" - but still need steps 1 and 3. Now testing
the cd pin, should be lower load than polling and timeouts - but still
have the regulator on-off overhead.
Anyway I don't have time right now to follow such a software work
around. So plan this patch to be independent.
Any views let me know - otherwise v3 of the patch ~Wednesday.
David.
On 22/02/2019 18:47, David Summers wrote:
The Problem:
On ASUS Tinker Board S, when booting from the eMMC, and there is no
card sd slot, then there are constant errors.
Cause:
Thanks must go to Robin Murphy @ ARM for idenifying the problem. The
rk808 on the Tinker Board and Tinker Board S has many regulators, one
vccio_sd powers the IO for the sd card. Unfortunatly this is also used
in the card detect. Now when no card is install, the regulator is
powered down. This means that the card detect floats, and this means
random card detection.
The Solution:
Make sure that the sd IO is always powered, this means card detection
is always active, which is what should be done on a board with an sd
slot, which both the Tinker Board and Tinker Board S are. Hence change
is made to the .dtsi which takes effect on all Tinker Boards as
required.
The change also adds "regulator-boot-on" the Tinker Board boot from
uboot, and the sd card is always one option. Hence the IO must be
powered in uboot, and so setting this flag.
Also removed is "disable-wp" the micro sd card which are used have no
write protection, so the concept doesn't mean anything, and the
Tinker Boards work without this. Hence it is removed to simply.
This change came from ArchLinux Arm, but we note it is the fix also
used by Armbian:
https://github.com/Miouyouyou/RockMyy/blob/master/patches/kernel/v5.0/DTS/0016-ARM-DTSI-rk3288-tinker-Setting-up-the-SD-regulators.patch
Signed-off-by: David Summers <beagleboard@xxxxxxxxxxxxxxxxxxx>
---
arch/arm/boot/dts/rk3288-tinker.dtsi | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/arm/boot/dts/rk3288-tinker.dtsi b/arch/arm/boot/dts/rk3288-tinker.dtsi
index aa107ee41b8b..6b7e55085b0c 100644
--- a/arch/arm/boot/dts/rk3288-tinker.dtsi
+++ b/arch/arm/boot/dts/rk3288-tinker.dtsi
@@ -254,6 +254,8 @@
};
vccio_sd: LDO_REG5 {
+ regulator-always-on;
+ regulator-boot-on;
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <3300000>;
regulator-name = "vccio_sd";
@@ -431,7 +433,6 @@
cap-mmc-highspeed;
cap-sd-highspeed;
card-detect-delay = <200>;
- disable-wp; /* wp not hooked up */
pinctrl-names = "default";
pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>;
status = "okay";