ap6212移植

1.ap6212

功能:wifi stationsoftapwifi directbt

接口类型:sdiouart

调试方案:octopus-f1,下面以A83T平台android4.4为例说明ap6212的移植过程

2、软硬件设计部份差异说明

(1) ap6212采用的是26M晶振,A框去掉,即不需要反相器;

(2) ap6212硬件上第29悬空,与ap6210不同

(3)ap6212必须采用bcmhd新驱动1.201.34.x版本,如附件;

(4)ap6212 firmware部分如附件请覆盖至\hardware\broadcom\wlan\bcmdhd\firmware

3内核配置

3.1 .config

.config中需要配置如下选项,将wifi driver编译进内核

CONFIG_BCMDHD = y

CONFIG_BCMDHD_OOB = y

同时把ap6212驱动代码加到/android/hardware/broadcom/wlan/bcmdhd/firmware路径下。

3.2 BoardConfig.mk

BoardConfig.mk文件决定android要加载哪一款wifi模组、是否开启蓝牙和使用哪一款蓝牙模组,要配置成使用ap6212模组并启用wifi和蓝牙功能需要把BoardConfig.mk文件的相关代码修改成如下。

# wifi and bt configuration

# 1. Wifi Configuration

#BOARD_WIFI_VENDOR := realtek

BOARD_WIFI_VENDOR := broadcom

# 1.1 broadcom wifi support

ifeq ($(BOARD_WIFI_VENDOR), broadcom)

    BOARD_WPA_SUPPLICANT_DRIVER := NL80211

    WPA_SUPPLICANT_VERSION      := VER_0_8_X

    BOARD_WPA_SUPPLICANT_PRIVATE_LIB := lib_driver_cmd_bcmdhd

    BOARD_HOSTAPD_DRIVER        := NL80211

    BOARD_HOSTAPD_PRIVATE_LIB   := lib_driver_cmd_bcmdhd

    BOARD_WLAN_DEVICE           := bcmdhd

    WIFI_DRIVER_FW_PATH_PARAM   := "/sys/module/bcmdhd/parameters/firmware_path"

    BOARD_USR_WIFI := ap6212

    include hardware/broadcom/wlan/bcmdhd/firmware/$(BOARD_USR_WIFI)/device-bcm.mk

endif

# 2. Bluetooth Configuration

# make sure BOARD_HAVE_BLUETOOTH is true for every bt vendor

BOARD_HAVE_BLUETOOTH := true

BOARD_HAVE_BLUETOOTH_BCM := true

#BOARD_HAVE_BLUETOOTH_RTK := true

#BLUETOOTH_HCI_USE_RTK_H5 := true

BOARD_HAVE_BLUETOOTH_NAME := ap6212

BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR := device/softwinner/tulip-t1/bluetooth/

说明:

1、“#”符号起注释作用;

2、“BOARD_USR_WIFI := AP6210”宏指明wifi选用ap6212;

3、“BOARD_HAVE_BLUETOOTH := true”宏指明使用蓝牙;

4、“BOARD_HAVE_BLUETOOTH_BCM := true”宏指定蓝牙厂商为Broadcom

5、“BOARD_HAVE_BLUETOOTH_NAME := ap6212”宏指明蓝牙模组名字;

6、“BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR :=  device/softwinner/tulip-t1/bluetooth/”宏指明配置文件bdroid_buildcfg.h路径;

注意:

1、需注释掉#BOARD_HAVE_BLUETOOTH_RTK := true

2、若不需要蓝牙功能只需要把相关宏注释掉就可以。

3OARD_USR_WIFI的大小写根据你在3.1中命名规则来写。

3.3 init.sun8i.rc

这部分只要注意两点:

注意:

1若init.sun50iw1p1.rc文件无修改后代码,可手动添加;

2、需注释掉realtek wifibluetooth相关内容。

3.3 octopus-f1

octopus-f1.mk文件会在编译时拷贝指定文件到特定目录下,使用ap6212需要确认如下修改:

DEVICE_PACKAGE_OVERLAYS := device/softwinner/octopus-perf/overlay \

                           $(DEVICE_PACKAGE_OVERLAYS)

PRODUCT_PACKAGES += gatord

PRODUCT_PACKAGES += \

    ESFileExplorer \

    VideoPlayer \

    Bluetooth

PRODUCT_PACKAGES += \

    gps.exdroid \

PRODUCT_COPY_FILES += \

        device/softwinner/octopus-perf/configs/gps.conf:system/etc/gps.conf

PRODUCT_COPY_FILES += \

    device/softwinner/octopus-perf/kernel:kernel \

    device/softwinner/octopus-perf/fstab.sun8i:root/fstab.sun8i \

    device/softwinner/octopus-perf/init.sun8i.rc:root/init.sun8i.rc \

    device/softwinner/octopus-perf/init.recovery.sun8i.rc:root/init.recovery.sun8i.rc \

    device/softwinner/octopus-perf/ueventd.sun8i.rc:root/ueventd.sun8i.rc \

    device/softwinner/octopus-perf/recovery.fstab:recovery.fstab \

    device/softwinner/octopus-perf/modules/modules/nand.ko:root/nand.ko \

    device/softwinner/octopus-perf/modules/modules/sunxi_tr.ko:root/sunxi_tr.ko \

    device/softwinner/octopus-perf/modules/modules/disp.ko:root/disp.ko \

    device/softwinner/octopus-perf/modules/modules/sw-device.ko:obj/sw-device.ko \

PRODUCT_COPY_FILES += \

    device/softwinner/octopus-perf/configs/tablet_core_hardware.xml:system/etc/permissions/tablet_core_hardware.xml

PRODUCT_COPY_FILES += \

    device/softwinner/octopus-perf/configs/camera.cfg:system/etc/camera.cfg \

    device/softwinner/octopus-perf/configs/cfg-Gallery2.xml:system/etc/cfg-Gallery2.xml \

    device/softwinner/octopus-perf/configs/gsensor.cfg:system/usr/gsensor.cfg \

    device/softwinner/octopus-perf/configs/media_profiles.xml:system/etc/media_profiles.xml \

    device/softwinner/octopus-perf/configs/sunxi-keyboard.kl:system/usr/keylayout/sunxi-keyboard.kl \

        device/softwinner/octopus-perf/configs/sunxi-ir.kl:system/usr/keylayout/sunxi-ir.kl \

    device/softwinner/octopus-perf/configs/tp.idc:system/usr/idc/tp.idc

PRODUCT_COPY_FILES += \

    frameworks/native/data/etc/android.hardware.touchscreen.multitouch.xml:system/etc/permissions/android.hardware.touchscreen.multitouch.xml \

    frameworks/native/data/etc/android.hardware.location.gps.xml:system/etc/permissions/android.hardware.location.gps.xml \

    frameworks/native/data/etc/android.hardware.ethernet.xml:system/etc/permissions/android.hardware.ethernet.xml

PRODUCT_COPY_FILES += \

    device/softwinner/octopus-perf/bluetooth/bt_vendor.conf:system/etc/bluetooth/bt_vendor.conf

PRODUCT_COPY_FILES += \

    device/softwinner/octopus-perf/bluetooth/bt_vendor.conf:system/etc/bluetooth/bt_vendor.conf

PRODUCT_COPY_FILES += \

    frameworks/native/data/etc/android.hardware.camera.xml:system/etc/permissions/android.hardware.camera.xml   \

    frameworks/native/data/etc/android.hardware.usb.accessory.xml:system/etc/permissions/android.hardware.usb.accessory.xml

# Low mem(memory <= 512M) device should not copy android.software.managed_users.xml

PRODUCT_COPY_FILES += \

    frameworks/native/data/etc/android.software.managed_users.xml:system/etc/permissions/android.software.managed_users.xml

PRODUCT_COPY_FILES += \

        device/softwinner/octopus-perf/media/bootanimation.zip:system/media/bootanimation.zip \

#camera config for camera detector

PRODUCT_COPY_FILES += \

        device/softwinner/octopus-perf/hawkview/sensor_list_cfg.ini:system/etc/hawkview/sensor_list_cfg.ini

# Radio Packages and Configuration Flie

$(call inherit-product, device/softwinner/common/rild/radio_common.mk)

#$(call inherit-product, device/softwinner/common/ril_modem/huawei/mu509/huawei_mu509.mk)

#$(call inherit-product, device/softwinner/common/ril_modem/Oviphone/em55/oviphone_em55.mk)

#sensor

PRODUCT_COPY_FILES += \

        device/softwinner/octopus-perf/sensor.sh:system/bin/sensor.sh

注意:

1android.hardware.wifi.xml拷贝到指定目录,以使设置界面显示wifi

2android.hardware.wifi.direct.xml是在wifi设备中显示wifi direct选项

3android.hardware.bluetooth.xml是在setting界面中显示蓝牙

4、“PRODUCT_PACKAGES +=  Bluetooth”指定去编译Bluetooth.apk

3.4config.xml

config.xml文件路径:\android5.1\device\softwinner\tulip-t1\overlay\frameworks\base\core\res\res

\values\config.xml

要打开蓝牙功能,需要在config.xml中把蓝牙的bt-pan网口打开,修改的部分代码如下。 

"wlan0"

-->

    

    

        "bt-pan"

你可能感兴趣的:(嵌入式-wifi实践)