AnsweredAssumed Answered

iMX6UL - device tree settings for SD1 VSELECT

Question asked by nickbedbury on Jul 16, 2018
Latest reply on Jul 18, 2018 by igorpadykov

I would like to enable the VSELECT feature for SD1 on a custom iMX6UL platform.  I have the interface working at 3.3V with the "no-1.8-v;" option in the device tree.  However, if I remove that (enabling voltage negotiation), the card does not enumerate.


The following errors are printed to the Linux console when the SD card is inserted:

mmc0: host does not support reading read-only switch, assuming write-enable     
sdhci: Tuning procedure failed, falling back to fixed sampling clock            
mmc0: tuning execution failed: -5                                               
mmc0: error -5 whilst initialising SD card 


I'm not sure if I have the device tree correct.  I'm trying to let a GPIO regulator drive a pin to the PMIC for VSELECT.  The relevant portion of our device tree looks like this:


&usdhc1 {
    pinctrl-names = "default", "state_100mhz", "state_200mhz";
    pinctrl-0 = <&pinctrl_usdhc1>;
    pinctrl-1 = <&pinctrl_usdhc1_100mhz>;
    pinctrl-2 = <&pinctrl_usdhc1_200mhz>;
    vmmc-supply = <&reg_sd1_vmmc>;
    status = "okay";


    regulators {
        compatible = "simple-bus";
        #address-cells = <1>;
        #size-cells = <0>;


        reg_sd1_vmmc: sd1_regulator {
                        compatible = "regulator-gpio";
                        pinctrl-names = "default";
                        pinctrl-0 = <&pinctrl_sd1>;
                        regulator-name = "gpio_sd1";
                        regulator-type ="voltage";
                        regulator-min-microvolt = <1800000>;
                        regulator-max-microvolt = <3300000>;
                        gpio = <&gpio4 28 GPIO_ACTIVE_HIGH>; // What does ACTIVE_HIGH vs ACTIVE_LOW mean here?
                        states = <1800000 0x0 3300000 0x1>;



    pinctrl_sd1: sd1grp {
        fsl,pins = <
            MX6UL_PAD_CSI_DATA07__GPIO4_IO28 0x8B0
/*            MX6UL_PAD_CSI_DATA07__USDHC1_VSELECT 0x8B0*/  // Which should this be?  This or the above?


Any recommendations on my device tree?  Per my last comment above, I wasn't sure if the peripheral's VSELECT or a GPIO should be mapped to the pin.