全志平台ap6476 wifi模组调试(1)介绍&sysconfig修改

free-jdx 2021-01-15 17:26:20 5779
1. 前言

ap6476是ampak封装的一颗broadcom四合一功能模组,包含wifi、bluetooth、gps和fm功能,使用到的芯片是bcm40181+bcm2076

功能特性如下

802.11b/g/n single-band radio

Bluetooth V4.0 with integrated Class 1.5 PA and Low Energy (BLE) support
Concurrent Bluetooth, FM (RX) RDS/RBDS, and WLAN operation
Simultaneous BT/WLAN receive with single antenna
WLAN host interface options: SDIO v2.0x — up to 50 MHz clock rate
BT host digital interface: UART (up to 4 Mbps)
GPS able to track up to 16 satellites.
FM multiple audio routing options: PCM, eSCO, A2DP
IEEE Co-existence technologies are integrated die solution
SECI — serial enhanced coexistence support, ability to coordinate BT SCO transmissions around WLAN receive

调试平台:
A31平台
android4.2

2. wifi模块涉及调试文件

(1)kernel

sys_config.fex 系统配置文件,wifi和蓝牙 gpio和电源的配置、sdio和uart使用的配置
rf 无线设备(wifi和蓝牙)电源管理实现驱动,供wifi驱动和蓝牙接口调用
bcmdhd broadcom wifi driver
btlmp.c broadcom 蓝牙低功能管理实现驱动

(2)android
libt 蓝牙HAL层实现文件
fiber_xxx 平台文件夹,wifi和蓝牙的配置、相关文件的拷贝和服务的开启
bluetooth 蓝牙profile实现文件
ap6476 ap6476模组的firmware、nvram、hcd文件

3. 移植说明

由于SDK已支持broadcom的ap6181和ap6210的wifi功能,ap6xxx系列的wifi是共用一份驱动,因而ap6476的移植将在已有框架上进行,修改的地方不多

4. 配置内核

系统默认是不编译bcmdhd驱动,需要修改.config文件把bcmdhd加入编译,修改如下

inux-3.3目录下,输入make ARCH=arm menuconfig
然后选择Device Drivers ---> 
Network device support ---> 
Wireless LAN ---> 
<*> Broadcom 4329/30 wireless cards support
                    (/system/vendor/modules/fw_bcmxxxx.bin) Firmware path
                    (/system/vendor/modules/nvram_apxxxx.txt) NVRAM path
                         Interrupt type (Out-of-Band Interrupt)  --->
                     [*]   Low level trigger for OOB interrupt
5.sys_config.fex修改

sys_config.fex是系统的配置文件,wifi功能是否有、选用哪款型号的模组及模组的供电电源等均是在sys_config.fex中设定。

;--------------------------------------------------------------------------------
;wifi configuration
;wifi_sdc_id    ---  0- SDC0, 1- SDC1, 2- SDC2, 3- SDC3
;wifi_usbc_id  ---  0- USB0, 1- USB1, 2- USB2
;wifi_usbc_type --  1- EHCI(speed 2.0), 2- OHCI(speed 1.0)
;wifi_mod_sel   ---  0- none, 1- ap6181, 2- ap6210(wifi+bt),
;                    3 - rtl8723as(wifi+bt), 4- rtl8189es(SM89E00),
;                    5 - rtl8192cu, 6 - rtl8188eu, 7 - mt6620
;                    8 - rtl8723au, 9 ap6330(wifi+bt), 10 - ap6476(wifi+bt+gps)
;--------------------------------------------------------------------------------
[wifi_para]
wifi_used          = 1
wifi_sdc_id        = 1
wifi_usbc_id       = 1
wifi_usbc_type     = 1
wifi_mod_sel       = 10
wifi_power         = "axp22_dldo2"

; 10 - ap6476 sdio wifi gpio config
ap6xxx_wl_regon      = port:PL05<1><default><default><0>
ap6xxx_wl_host_wake  = port:PL06<0><default><default><0>

wifi_para是wifi配置的主键名,在sys_config.fex中是唯一的,会在脚本解释中被用到。
wifi_used子键值为1代指平台使用wifi功能,值为0代指平台无wifi功能,wifi_used会被rf电源管理驱动通过脚本解释读取其值,若值为0 rf电源管理驱动会直接返回,不做任何注册。
wifi_sdc_id子键值是sdio wifi使用哪个sd控制器,需要根据实际的电路原理图修改子键值,该值会在wifi驱动中被读取,打开wifi和关闭wifi均有scan卡的操作。
wifi_usbc_id和wifi_usbc_type两个子键是USB接口wifi才用得到的,对于sdio接口wifi保持默认值即可。
wifi_mod_sel子键值代指选用哪一款型号的模组,rf电源管理驱动和bcmdhd驱动均会读取该值。
wifi_power子键值是模组的电压源是哪个,需要根据实现电路原图原理图修改子键值。

根据原理图,wifi使用sd 1控制器、wifi模组型号是ap6476、电压源是ap22_dldo2、wifi使能脚连到PL05、wifi唤醒主控脚连到PL06,所以有如上的配置

;--------------------------------------------------------------------------------
;   SDMMC PINS MAPPING                             
; ------------------------------------------------------------------------------|
;   Config Guide                                       
;   sdc_used: 1-enable card, 0-disable card                   
;   sdc_detmode: card detect mode                          
;                1-detect card by gpio polling               
;                2-detect card by gpio irq(must use IO with irq function)       
;                3-no detect, always in for boot card                       
;                4-manually insert and remove by /proc/driver/sunxi-mmc.x/insert
;   sdc_buswidth: card bus width, 1-1bit, 4-4bit, 8-8bit                        
;   sdc_use_wp: 1-with write protect IO, 0-no write protect IO                  
;   sdc_isio: for sdio card                                                
;   sdc_regulator: power control.if card supports UHS-I/DDR and HS200 timing for 
;                  SD3.0 or eMMC4.5, regulator must be configured. the value is 
;                  the ldo name of AXP221, eg: sdc_regulator = "axp22_eldo2"  
;   other: GPIO Mapping configuration                                     
; ------------------------------------------------------------------------------|
[mmc1_para]
sdc_used          = 1
sdc_detmode       = 4
sdc_buswidth      = 4
sdc_clk           = port:PG00<2><1><2><default>
sdc_cmd           = port:PG01<2><1><2><default>
sdc_d0            = port:PG02<2><1><2><default>
sdc_d1            = port:PG03<2><1><2><default>
sdc_d2            = port:PG04<2><1><2><default>
sdc_d3            = port:PG05<2><1><2><default>
sdc_det           =
sdc_use_wp        = 0
sdc_wp            =
sdc_isio          = 1
sdc_regulator     = "none"

wifi配置中指明wifi使用sd 1接口,需要对mmc1_para主键下的子键进行检验和修改,需要特别注意的是detmode要设成手动模式并把sdc_isio值赋成1代指是sdio设备

[wakeup_src_para]
cpu_en              =   0
cpu_freq            =   48
; (cpu:apb:ahb)
pll_ratio           =   0x111
dram_selfresh_en        =   1
dram_freq           =   36
wakeup_wl           =  port:PL06<2><1><default><default>

p6476模组是支持wifi唤醒休眠主控,需要在wakeup_src_para主键下把wifi的唤醒源添加上,唤醒源要跟wifi配置下的ap6xxx_wl_host_wake一致。

声明:本文内容由易百纳平台入驻作者撰写,文章观点仅代表作者本人,不代表易百纳立场。如有内容侵权或者其他问题,请联系本站进行删除。
free-jdx
红包 87 9 评论 打赏
评论
0个
内容存在敏感词
手气红包
    易百纳技术社区暂无数据
相关专栏
置顶时间设置
结束时间
删除原因
  • 广告/SPAM
  • 恶意灌水
  • 违规内容
  • 文不对题
  • 重复发帖
打赏作者
易百纳技术社区
free-jdx
您的支持将鼓励我继续创作!
打赏金额:
¥1易百纳技术社区
¥5易百纳技术社区
¥10易百纳技术社区
¥50易百纳技术社区
¥100易百纳技术社区
支付方式:
微信支付
支付宝支付
易百纳技术社区微信支付
易百纳技术社区
打赏成功!

感谢您的打赏,如若您也想被打赏,可前往 发表专栏 哦~

举报反馈

举报类型

  • 内容涉黄/赌/毒
  • 内容侵权/抄袭
  • 政治相关
  • 涉嫌广告
  • 侮辱谩骂
  • 其他

详细说明

审核成功

发布时间设置
发布时间:
是否关联周任务-专栏模块

审核失败

失败原因
备注
拼手气红包 红包规则
祝福语
恭喜发财,大吉大利!
红包金额
红包最小金额不能低于5元
红包数量
红包数量范围10~50个
余额支付
当前余额:
可前往问答、专栏板块获取收益 去获取
取 消 确 定

小包子的红包

恭喜发财,大吉大利

已领取20/40,共1.6元 红包规则

    易百纳技术社区