Re: [PATCH 1/3 v2] ARM: dts: rk3288-tinker.dtsi: Fix SD card detection

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2019-02-22 19: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 */

I think disable-wp correctly describes that wp is not expected to work and should not be removed.

>From comment in mmc_sd_get_ro():
"Some systems don't feature a write-protect pin and don't need one.
E.g. because they only have micro-SD card slot. For those systems
assume that the SD card is always read-write."

Without disable-wp core will call dw_mci_get_ro() to get wp status.


This patch also fixes reboot when booting from sd-card and having emmc zeroed out.

Tested-by: Jonas Karlman <jonas@xxxxxxxxx>

Regards,
Jonas

>  	pinctrl-names = "default";
>  	pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>;
>  	status = "okay";




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux