【平台信息】
CPU:RK3288 Android:7.1 Linux:4.4 WIFI&BT:AP6255
【硬件连接】
1、芯片介绍
【代码梳理】
1、Dts配置
1) arch/arm/boot/dts/rk3288.dtsi
sdio: rksdmmc@ff0d0000 {
compatible = "rockchip,rk_mmc", "rockchip,rk32xx-sdmmc";
reg = <0xff0d0000 0x4000>;
interrupts = <GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>;
#address-cells = <1>;
#size-cells = <0>;
pinctrl-names = "default","idle";
pinctrl-0 = <&sdio0_clk &sdio0_cmd &sdio0_bus4>;
pinctrl-1 = <&sdio0_gpio>;
clocks = <&clk_sdio0>, <&clk_gates8 4>;
clock-names = "clk_mmc", "hclk_mmc";
num-slots = <1>;
fifo-depth = <0x100>;
bus-width = <4>;
tune_regsbase = <0x208>;
cru_regsbase = <0x1d8>;
cru_reset_offset = <1>;
};
2) arch/arm/boot/dts/rk3288-n1904.dts
wireless-wlan {
compatible = "wlan-platdata";
wifi_chip_type = "ap6212";
sdio_vref = <1800>;
power_pmu_regulator = "act_ldo3";
power_pmu_enable_level = <1>;
vref_pmu_regulator = "act_ldo3";
vref_pmu_enable_level = <1>;
WIFI,poweren_gpio = <&gpio4 GPIO_D4 GPIO_ACTIVE_HIGH>;
WIFI,host_wake_irq = <&gpio4 GPIO_D6 GPIO_ACTIVE_HIGH>;
status = "okay";
};
&sdio {
clock-frequency = <50000000>;
clock-freq-min-max = <200000 50000000>;
supports-highspeed;
supports-sdio;
ignore-pm-notify;
keep-power-in-suspend;
status = "okay";
};
3) arch/arm/boot/dts/rk3288-pinctrl.dts
pinctrl: pinctrl@ff770000 {
gpio4_sdio0 {
sdio0_clk: sdio0_clk {
rockchip,pins = <SDIO0_CLKOUT>;
rockchip,pull = <VALUE_PULL_DISABLE>;
rockchip,drive = <VALUE_DRV_4MA>;
};
sdio0_cmd: sdio0_cmd {
rockchip,pins = <SDIO0_CMD>;
rockchip,pull = <VALUE_PULL_UP>;
rockchip,drive = <VALUE_DRV_4MA>;
};
sdio0_bus4: sdio0-bus-width4 {
rockchip,pins = <SDIO0_DATA0>,
<SDIO0_DATA1>,
<SDIO0_DATA2>,
<SDIO0_DATA3>;
rockchip,pull = <VALUE_PULL_UP>;
rockchip,drive = <VALUE_DRV_4MA>;
};
sdio0_pwr: sdio0-pwren{
rockchip,pins = <SDIO0_PWREN>;
rockchip,pull = <VALUE_PULL_UP>;
rockchip,drive = <VALUE_DRV_DEFAULT>;
};
sdio0_intn: sdio0-intn{
rockchip,pins = <SDIO0_INTN>;
rockchip,pull = <VALUE_PULL_UP>;
rockchip,drive = <VALUE_DRV_DEFAULT>;
};
RK808 PMU芯片的RTC CLK32KOUT2信号接到AP6212芯片SUSCLK_IN脚输入时钟
2、驱动介绍
kernel/.config文件CONFIG_AP6210=y
wifi 驱动路径:kernel/net/rfkill/rfkill-wlan.c
【调试过程】
查看芯片 /sys/bus/sdio/devices/mmc1:0001:3 $ dmesg | grep “card at address”
查看Wifi芯片型号 rk3288:/ $ cat /sys/class/rkwifi/chip [ 267.558874] Current WiFi chip is AP6255.
查看Wifi日志打印 logcat | grep WifiHW
【参考资料】
1、rk3288 Android7.1 wifi 蓝牙 驱动 https://blog.csdn.net/zx19890621/article/details/106981845?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522163503327916780366532389%2522%252C%2522scm%2522%253A%252220140713.130102334…%2522%257D&request_id=163503327916780366532389&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2allbaidu_landing_v2~default-3-106981845.first_rank_v2_pc_rank_v29&utm_term=rk3288+wifi&spm=1018.2226.3001.4187
2、RK3288 添加WiFi&BT模块AP6212 https://blog.csdn.net/weixin_30323961/article/details/95061815?ops_request_misc=&request_id=&biz_id=102&utm_term=rk3288%20wifi&utm_medium=distribute.pc_search_result.none-task-blog-2allsobaiduweb~default-8-95061815.first_rank_v2_pc_rank_v29&spm=1018.2226.3001.4187
https://download.csdn.net/download/gzweiyan2/10836625?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522163503629116780366518399%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fdownload.%2522%257D&request_id=163503629116780366518399&biz_id=1&utm_medium=distribute.pc_search_result.none-task-download-2downloadfirst_rank_v2~rank_dl_default-2-10836625.pc_v2_rank_dl_default&utm_term=Android++3.10+WiFi+BT&spm=1018.2226.3001.4451.2
Android命令行测试BT,WIFI,Sensor工作状态 http://blog.chinaunix.net/uid-25909619-id-3554423.html
CYW43438 Datasheet https://www.cypress.com/documentation/datasheets/cyw43438-single-chip-ieee-80211-bgn-macbasebandradio-integrated-bluetooth
|