TI中文支持网
TI专业的中文技术问题搜集分享网站

am335x 使用SDIO接口WIFI

补充:

之前弄错了,我们用的是MMC2,dts文件里的mmc3,修改后依旧WIFI无法工作

大家好,请教下,我们使用RTL8723BSwifi模块,驱动加载成功了,但是probe函数未被调用是怎么回事?

GPIO3-14是WIFI的使能,低的时候poweron WIFI.

注释掉dma是因为有“错误提示

[ 1.378795] /ocp/mmc@481d8000: could not get #dma-cells for /ocp/l4_wkup@44c00000/prcm@200000/clocks/dpll_disp_ck
[ 1.391306] omap_hsmmc 481d8000.mmc: RX DMA channel request failed

dst修改参考的是am335x-evmsk

具体如下:

&mmc2 {
/* these are on the crossbar and are outlined in the
xbar-event-map element */
/* dmas = <&edma 12
&edma 13>;
dma-names = "tx", "rx";*/
status = "okay";
vmmc-supply = <&wlan_en_reg>;
bus-width = <4>;
pinctrl-names = "default";
pinctrl-0 = <&mmc2_pins_default >;
ti,non-removable;
ti,needs-special-hs-handling;
cap-power-off-card;
keep-power-in-suspend;

#address-cells = <1>;
#size-cells = <0>;
rtl8723bs_wifi: rtl8723bs_wifi@0 {
compatible = "ti,8723bs";
reg = <2>;
};
};

wlan_en_reg: fixedregulator@2 {
compatible = "regulator-fixed";
regulator-name = "wlan-en-regulator";
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
pinctrl-names = "default";
pinctrl-0 = <&wlan_pins_default>;
/* WLAN_EN GPIO for this board – Bank1, pin16 */
/*gpio = <&gpio1 16 0>;*/
gpio = <&gpio3 14 0>;

/* WLAN card specific delay */
startup-delay-us = <70000>;
enable-active-high;
};

mmc2_pins_default: mmc2_pins_default {
pinctrl-single,pins = <
0x8c ( PIN_INPUT | MUX_MODE3 ) /* (V12) gpmc_clk.mmc2_clk */
0x88 ( PIN_OUTPUT | MUX_MODE3 ) /* (T13) gpmc_csn3.mmc2_cmd */
0x44 ( PIN_INPUT | MUX_MODE3 ) /* (V14) gpmc_a1.mmc2_dat0 */
0x48 ( PIN_INPUT | MUX_MODE3 ) /* (U14) gpmc_a2.mmc2_dat1 */
0x4c ( PIN_INPUT | MUX_MODE3 ) /* (T14) gpmc_a3.mmc2_dat2 */
0x78 ( PIN_INPUT | MUX_MODE3 ) /* (U18) gpmc_be1n.mmc2_dat3 */
>;
};

/* wl12xx/wl18xx card enable/irq GPIOs. */
wlan_pins_default: pinmux_wlan_pins_default {
pinctrl-single,pins = <
0x190 ( PIN_INPUT | MUX_MODE7 ) /* (A13) mcasp0_aclkx.gpio3[14] */
/* 0x198 ( PIN_INPUT | MUX_MODE7 ) /* (D12) mcasp0_axr0.gpio3[16] */
>;
};

Jian Zhou:

这个probe()函数,你是指hsmmc_omap.c里的mmc probe()函数么?

zizhen hu:

回复 Jian Zhou:

是WIFI的probe。

有些奇怪的是我在dts中配置的MMC电压是3.3v,为什么Log信息里是1.8V?会不会和这个有关系?

MMC的log如下

[ 1.795855] [huzz]mmc_of_parse[ 1.798952] omap_hsmmc 481d8000.mmc: GPIO lookup for consumer cd[ 1.798962] omap_hsmmc 481d8000.mmc: using device tree for GPIO lookup[ 1.798976] of_get_named_gpiod_flags: can't parse 'cd-gpios' property of node '/ocp/mmc@481d8000[0]'[ 1.798986] of_get_named_gpiod_flags: can't parse 'cd-gpio' property of node '/ocp/mmc@481d8000[0]'[ 1.798994] omap_hsmmc 481d8000.mmc: using lookup tables for GPIO lookup[ 1.799004] omap_hsmmc 481d8000.mmc: lookup for GPIO cd failed[ 1.799016] omap_hsmmc 481d8000.mmc: GPIO lookup for consumer wp[ 1.799025] omap_hsmmc 481d8000.mmc: using device tree for GPIO lookup[ 1.799033] of_get_named_gpiod_flags: can't parse 'wp-gpios' property of node '/ocp/mmc@481d8000[0]'[ 1.799042] of_get_named_gpiod_flags: can't parse 'wp-gpio' property of node '/ocp/mmc@481d8000[0]'[ 1.799050] omap_hsmmc 481d8000.mmc: using lookup tables for GPIO lookup[ 1.799058] omap_hsmmc 481d8000.mmc: lookup for GPIO wp failed[ 1.799479] omap_hsmmc 481d8000.mmc: unable to get vmmc_aux regulator -19[ 1.799502] omap_hsmmc 481d8000.mmc: unable to get pbias regulator -19[ 1.799658] mmc1: clock 0Hz busmode 2 powermode 1 cs 0 Vdd 21 width 0 timing 0[ 1.873713] omap_hsmmc 481d8000.mmc: Initial signal voltage of 1.8v[ 1.893678] mmc1: clock 400000Hz busmode 2 powermode 2 cs 0 Vdd 21 width 0 timing 0[ 1.913696] [huzz]drivers/mmc/core/core.c:mmc_rescan_try_freq[ 1.919471] mmc1: mmc_rescan_try_freq: trying to init card at 400000 Hz[ 1.926449] vdd_mpu: supplied by vmmcsd_fixed

mmc1: starting CMD52 arg 00000c00 flags 00000195[ 2.488719] mmc1: req done (CMD52): -16: 00000000 00000000 00000000 00000000[ 2.488738] mmc1: starting CMD52 arg 80000c08 flags 00000195[ 2.987207] mmc1: req done (CMD52): -16: 00000000 00000000 00000000 00000000[ 2.987223] mmc1: clock 400000Hz busmode 2 powermode 2 cs 1 Vdd 21 width 0 timing 0[ 2.988241] mmc1: starting CMD0 arg 00000000 flags 000000c0[ 2.988417] mmc1: req done (CMD0): 0: 00000000 00000000 00000000 00000000[ 2.989450] mmc1: clock 400000Hz busmode 2 powermode 2 cs 0 Vdd 21 width 0 timing 0[ 2.990462] mmc1: starting CMD8 arg 000001aa flags 000002f5[ 2.990826] mmc1: req done (CMD8): -110: 00000000 00000000 00000000 00000000[ 2.990847] [huzz]drivers/mmc/core/sdio.c:mmc_attach_sdio[ 2.996288] mmc1: starting CMD5 arg 00000000 flags 000002e1[ 2.996654] mmc1: req failed (CMD5): -110, retrying…[ 2.997017] mmc1: req failed (CMD5): -110, retrying…[ 2.997379] mmc1: req failed (CMD5): -110, retrying…[ 2.997734] mmc1: req done (CMD5): -110: 00000000 00000000 00000000 00000000[ 2.997750] [huzz]drivers/mmc/core/sdio.c:mmc_attach_sdio:mmc_send_io_op_cond failed,-110[ 3.006007] [huzz]drivers/mmc/core/sd.c:mmc_attach_sd[ 3.011083] mmc1: starting CMD55 arg 00000000 flags 000000f5[ 3.011442] mmc1: req done (CMD55): -110: 00000000 00000000 00000000 00000000[ 3.011463] mmc1: starting CMD55 arg 00000000 flags 000000f5[ 3.011820] mmc1: req done (CMD55): -110: 00000000 00000000 00000000 00000000[ 3.011840] mmc1: starting CMD55 arg 00000000 flags 000000f5[ 3.012196] mmc1: req done (CMD55): -110: 00000000 00000000 00000000 00000000[ 3.012219] mmc1: starting CMD55 arg 00000000 flags 000000f5[ 3.012574] mmc1: req done (CMD55): -110: 00000000 00000000 00000000 00000000[ 3.012594] [huzz]drivers/mmc/core/sd.c:mmc_attach_sd:mmc_send_app_op_cond failed -110[ 3.020575] [huzz]drivers/mmc/core/mmc.c:mmc_attach_mmc[ 3.025847] mmc1: clock 400000Hz busmode 1 powermode 2 cs 0 Vdd 21 width 0 timing 0[ 3.025861] mmc1: starting CMD1 arg 00000000 flags 000000e1[ 3.026220] mmc1: req done (CMD1): -110: 00000000 00000000 00000000 00000000[ 3.026240] [huzz]drivers/mmc/core/mmc.c:mmc_attach_mmc:mmc_send_op_cond failed,-110[ 3.034032] mmc1: clock 0Hz busmode 2 powermode 0 cs 0 Vdd 0 width 0 timing 0[ 3.133682] omap_hsmmc 481d8000.mmc: disabled

Eggsy Pang:

回复 zizhen hu:

这个wifi驱动文件ti,8723bs已经放到内核了吗?

zizhen hu:

回复 Eggsy Pang:

是的,WIFI驱动由厂家提供。目前碰到的问题是

1.omap_hsmmc_set_capabilities这个函数中,val = OMAP_HSMMC_READ(host->base, CAPA),寄存器CAPA的值MMC0和MMC2不一样,这个是为什么?

2.WIFI驱动加载过程中SDIO的数据通讯没问题,SD_CLK和SD_CMD都有信号,但是当初始化到CMD53这个命令的时候,没有返回值,卡住没响应了。

厂家说需要类似rescan的函数来控制,我移植了amlogic m805的sdio_reinit函数(我们另外的项目m805上,用的也是rtl8723bs的模块),但是没有效果,依旧卡死在CMD53这个命令,Eggsy,请帮忙给分析一下,谢谢。

根据你发来的log,应该是在软件里面没有rescan,可参考platform_ARM_SUNnI_sdio.c

        

       rescan的代码需要找处理器的平台厂商要!

       有rescan的kernel的log参考如下:

      

wen ting:

zizhen 您好:請問您GPIO3-14的接腳是接到RTL8723BSwifi模块的哪隻接腳呢?至於SDIO的PINMUX部分想請問gpmc_csn3.mmc2_cmd為何是設定 0x88 ( PIN_OUTPUT | MUX_MODE3 ) ? 我GOOGLE到的資料都為 0x88 (PIN_INPUT_PULLUP | MUX_MODE3 ),想請問您其中的差別,感謝。 

赞(0)
未经允许不得转载:TI中文支持网 » am335x 使用SDIO接口WIFI
分享到: 更多 (0)