1. 程式人生 > >[RK3399][Android7.1] SDIO WiFi除錯步驟小結

[RK3399][Android7.1] SDIO WiFi除錯步驟小結

Platform: RK3399
OS: Android 7.1
Kernel: v4.4.83

用的是SDIO介面的AP6356S。
此文主要記錄下除錯的過程和方法。

原因:

硬體電源上有個0歐姆電阻沒焊。

除錯:

檢查DTS配置有沒有出錯:

sdio_pwrseq: sdio-pwrseq {
    compatible = "mmc-pwrseq-simple";
    clocks = <&rk818 1>;
    clock-names = "ext_clock";
    pinctrl-names = "default"
; pinctrl-0 = <&wifi_enable_h>; //控制WiFi電源的GPIO reset-gpios = <&gpio0 10 GPIO_ACTIVE_LOW>; /* GPIO0_B2 */ }; wireless-wlan { compatible = "wlan-platdata"; rockchip,grf = <&grf>; wifi_chip_type = "ap6354"; sdio_vref = <1800>; //控制WiFi中斷的GPIO WIFI,host_wake_irq =
<&gpio0 3 GPIO_ACTIVE_HIGH>; /* GPIO0_a3 */ status = "okay"; };

SDIO WiFi註冊成功會有如下Log:

mmc2: new ultra high speed SDR104 SDIO card at address 0001 

檢視sys/bus/sdio/devices也能看到裝置,如果沒有說明硬體有異常。

檢查硬體:
命令做SDIO導通性測試,萬用表量測拉低拉高是否可控。

GPIO2_C4/SDIO0_D0/SPI5_RXD
GPIO2_C5/SDIO0_D1/SPI5_TXD
GPIO2_C6/SDIO0_D2/SPI5_CLK
GPIO2_C7/SDIO0_D3/SPI5_CS
GPIO2_D0/SDIO0_CMD_u
GPIO2_D1/SDIO0_CLKOUT/TEST_CLKOUT1


GRF base  0xFF770000
GRF_GPIO2C_IOMUX 0x0e008 GRF_GPIO2D_IOMUX 0x0e00c io -4 -r 0xff77e008 //bit[15]~bit[8] //5500 io -4 -r 0xff77e00C //bit[0]~bit[3] //5 rk3399_mid:/ # io -4 0xff77e008 ff77e008: 00005555 rk3399_mid:/ # io -4 0xff77e00C ff77e00c: 00000005 導通性測試 配製為GPIO io -4 -w 0xFF77e008 0x0fff0000 io -4 -w 0xFF770e00c 0x000f0000 配製為輸出FF78_0000 io -4 -w 0xFF780004 0x03f00000 配製為高電平 io -4 -w 0xFF780000 0x03f00000 配製為低電平 io -4 -w 0xFF780000 0x00000000 GPIO2_C4/SDIO0_D0/SPI5_RXD GPIO0_B2(WIFI_REG_ON) io -4 -w 0xFF720004 0x04000400 io -4 -w 0xFF720000 0x04000400 io -4 -w 0xFF720004 0x00000000 io -4 -w 0xFF720000 0x00000000 echo 1084 > /sys/class/gpio/export echo out > /sys/class/gpio/gpio1084/direction echo 1085 > /sys/class/gpio/export echo out > /sys/class/gpio/gpio1085/direction echo 1086 > /sys/class/gpio/export echo out > /sys/class/gpio/gpio1086/direction echo 1087 > /sys/class/gpio/export echo out > /sys/class/gpio/gpio1087/direction echo 1088 > /sys/class/gpio/export echo out > /sys/class/gpio/gpio1088/direction echo 1089 > /sys/class/gpio/export echo out > /sys/class/gpio/gpio1089/direction echo 1 > /sys/class/gpio/gpio1084/value echo 1 > /sys/class/gpio/gpio1085/value echo 1 > /sys/class/gpio/gpio1086/value echo 1 > /sys/class/gpio/gpio1087/value echo 1 > /sys/class/gpio/gpio1088/value echo 1 > /sys/class/gpio/gpio1089/value cat /sys/kernel/debug/gpio echo 0 > /sys/class/gpio/gpio1084/value echo 0 > /sys/class/gpio/gpio1085/value echo 0 > /sys/class/gpio/gpio1086/value echo 0 > /sys/class/gpio/gpio1087/value echo 0 > /sys/class/gpio/gpio1088/value echo 0 > /sys/class/gpio/gpio1089/value

示波器接上量 VDDIO VBAT 電壓, 啟動時WIFI_REG_ON是否有拉高, 32K是否有給,37.4M是否有起振, SDIO_CLK SDIO_CMD 的波形。

IOMUX檢查:
檢查sdio對應的pin的IOMUX關係是否正確,
busybox find /d/pinctrl -name pinmux-pins
cat xxx/xxx/pinmux-pins

pin 84 (gpio2-20): fe310000.dwmmc (GPIO UNCLAIMED) function sdio0 group sdio0-bus4
pin 85 (gpio2-21): fe310000.dwmmc (GPIO UNCLAIMED) function sdio0 group sdio0-bus4
pin 86 (gpio2-22): fe310000.dwmmc (GPIO UNCLAIMED) function sdio0 group sdio0-bus4
pin 87 (gpio2-23): fe310000.dwmmc (GPIO UNCLAIMED) function sdio0 group sdio0-bus4
pin 88 (gpio2-24): fe310000.dwmmc (GPIO UNCLAIMED) function sdio0 group sdio0-cmd
pin 89 (gpio2-25): fe310000.dwmmc (GPIO UNCLAIMED) function sdio0 group sdio0-clk

參考:

Rockchip-Developer-Guide-linux4.4-SDMMC-SDIO-eMMC.pdf