This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/AM5728: Changing MMC mode to HS fails

Part Number: AM5728
Other Parts Discussed in Thread: WL1835

Tool/software: Linux

Hi all,

I am trying to setup wifi module in mmc2 (mmc0,mmc1,mmc2) but I am unable to make it work with HS mode,(with clock rate above 48Mhz),

With max-frequency 24Mhz means default mode is working fine.

Failure log:

[   6.294967] mmc2: err from mmc wait for cmd: 0 in mmc_io_rw_direct_host
[    6.294969] Exit mmc_sdio_switch_hs
[    6.294973] mmc2: clock 400000Hz busmode 2 powermode 2 cs 0 Vdd 21 width 1 timing 2
[    6.294995] mmc2: clock 48000000Hz busmode 2 powermode 2 cs 0 Vdd 21 width 4 timing 2
[    6.295001] mmc2:sdio init card done in mmc_attach_sdio
[    6.295005] mmc2:funcs : 3
[    6.295007] ENTER sdio_init_func
[    6.295011] mmc2: alloc fun done fn:1
[    6.295015] mmc2: starting CMD52 arg 00020000 flags 00000195
[    6.295020] WRITE DONE:mmc2: CMD52, argument 0x00020000
[    6.295025] mmc2: req done (CMD52): 0: 00000000 00000000 00000000 00000000
[    6.295045] mmc2: err from mmc wait for cmd: 0 in mmc_io_rw_direct_host
[    6.295047] ENTER sdio_read_cis
[    6.295053] mmc2: starting CMD52 arg 00021200 flags 00000195
[    6.295058] WRITE DONE:mmc2: CMD52, argument 0x00021200
[    6.295063] mmc2: req done (CMD52): 0: 00000000 00000000 00000000 00000000
[    6.295082] mmc2: err from mmc wait for cmd: 0 in mmc_io_rw_direct_host
[    6.295084] mmc2: ret:0 mmc_io_rw_direct done in sdio_read_cis
[    6.295090] mmc2: starting CMD52 arg 00021400 flags 00000195
[    6.295095] WRITE DONE:mmc2: CMD52, argument 0x00021400
[    6.295102] mmc2: req done (CMD52): -84: 00000000 00000000 00000000 00000000
[    6.295118] mmc2: err from mmc wait for cmd: -84 in mmc_io_rw_direct_host
[    6.295121] mmc2: ret:-84 mmc_io_rw_direct done in sdio_read_cis
[    6.295123] mmc2:sdio read func cis done in sdio_init_func
[    6.295136] mmc2: error -84 whilst initialising SDIO card
[    6.295140] mmc2: starting CMD55 arg 00000000 flags 000000f5
[    6.295145] WRITE DONE:mmc2: CMD55, argument 0x00000000
[    6.295152] mmc2: req done (CMD55): -110: 00000000 00000000 00000000 00000000
[    6.295171] mmc2: starting CMD55 arg 00000000 flags 000000f5
-------------------------

Device Tree:

                                                                               
    mmc3_pins_default: mmc3_pins_default {                                      
        pinctrl-single,pins = <                                                 
            DRA7XX_CORE_IOPAD(0x377c, (PIN_INPUT_PULLUP | MUX_MODE0)) /* mmc3_clk.mmc3_clk */
            DRA7XX_CORE_IOPAD(0x3780, (PIN_INPUT_PULLUP | MUX_MODE0)) /* mmc3_cmd.mmc3_cmd */
            DRA7XX_CORE_IOPAD(0x3784, (PIN_INPUT_PULLUP | MUX_MODE0)) /* mmc3_dat0.mmc3_dat0 */
            DRA7XX_CORE_IOPAD(0x3788, (PIN_INPUT_PULLUP | MUX_MODE0)) /* mmc3_dat1.mmc3_dat1 */
            DRA7XX_CORE_IOPAD(0x378c, (PIN_INPUT_PULLUP | MUX_MODE0)) /* mmc3_dat2.mmc3_dat2 */
            DRA7XX_CORE_IOPAD(0x3790, (PIN_INPUT_PULLUP | MUX_MODE0)) /* mmc3_dat3.mmc3_dat3 */
        >;                                                                      
    };                                                                          
                                                                                
    mmc3_pins_hs: mmc3_pins_hs {                                                
        pinctrl-single,pins = <                                                 
            DRA7XX_CORE_IOPAD(0x377c, (PIN_INPUT_PULLUP | MUX_MODE0)) /* mmc3_clk.mmc3_clk */
            DRA7XX_CORE_IOPAD(0x3780, (PIN_INPUT_PULLUP | MUX_MODE0)) /* mmc3_cmd.mmc3_cmd */
            DRA7XX_CORE_IOPAD(0x3784, (PIN_INPUT_PULLUP | MUX_MODE0)) /* mmc3_dat0.mmc3_dat0 */
            DRA7XX_CORE_IOPAD(0x3788, (PIN_INPUT_PULLUP | MUX_MODE0)) /* mmc3_dat1.mmc3_dat1 */
            DRA7XX_CORE_IOPAD(0x378c, (PIN_INPUT_PULLUP | MUX_MODE0)) /* mmc3_dat2.mmc3_dat2 */
            DRA7XX_CORE_IOPAD(0x3790, (PIN_INPUT_PULLUP | MUX_MODE0)) /* mmc3_dat3.mmc3_dat3 */
        >;                                                                      
    }; 

    vmmcwl_fixed: fixedregulator-mmcwl {                                        
        compatible = "regulator-fixed";                                         
        regulator-name = "vmmcwl_fixed";                                        
        /* For TI WL12xx use 1.8V*/                                             
        /*                                                                      
        regulator-min-microvolt = <1800000>;                                    
        regulator-max-microvolt = <1800000>;                                    
        */                                                                                                                 
        regulator-min-microvolt = <3300000>;                                    
        regulator-max-microvolt = <3300000>;                                    
        gpio = <&gpio5 8 GPIO_ACTIVE_HIGH>;                                     
        enable-active-high;                                                     
    };                                                                          
                                                                                
    wlreg_on: fixedregulator@100 {                                              
        compatible = "regulator-fixed";                                         
        regulator-name = "wlreg_on";                                            
        regulator-min-microvolt = <3300000>;                                    
        regulator-max-microvolt = <3300000>;                                    
        startup-delay-us = <70000>;                                             
        gpio = <&gpio5 8 GPIO_ACTIVE_HIGH>;                                     
        enable-active-high;                                                     
    };                                                                        
};                                                                             
                                                                        

&mmc3 {                                                                         
    status = "okay";                                                            
    vmmc-supply = <&vmmcwl_fixed>;                                                                                                   
    bus-width = <4>;                                                            
    pinctrl-names = "default";                                                  
    cap-power-off-card;                                                         
    keep-power-in-suspend;                                                      
    ti,non-removable;                                                           

                                               
    ti,needs-special-hs-handling;                                               
    enable-sdio-wakeup;                                                         
    cd-post; /* This delays card detect until we call wifi_card_detect() */        
    wifi-host; /* This lets wifi_card_detect() work */                          
    cap-sdio-irq; /* To set sdio mmc3 in interrupt mode default use polling mode*/
                                                                                
    pinctrl-names = "default", "hs", "sdr12", "sdr25", "sdr50";                 
    pinctrl-0 = <&mmc3_pins_default>;                                           
    pinctrl-1 = <&mmc3_pins_hs>;                                                
    pinctrl-2 = <&mmc3_pins_sdr12>;                                             
    pinctrl-3 = <&mmc3_pins_sdr25>;                                             
    pinctrl-4 = <&mmc3_pins_sdr50 &mmc3_iodelay_manual1_conf>;                  
   

    max-frequency = <48000000>;                                                 
                                                                                
    #address-cells = <1>;                                                       
    #size-cells = <0>;                                                          
    wlcore: wlcore@2 {                                                          
        compatible = "ti,wl1835";                                               
        reg = <2>;                                                              
        interrupt-parent = <&gpio5>;                                            
        interrupts = <7 IRQ_TYPE_LEVEL_HIGH>;                                   
    };                                                                          
};

--------------------------

Any error in  dts configuration?

Am using latest sdk 4.00 with kernel 4.9.28-geed43d1050.

Thanks,

Suraj