天工测控WG225 WIFI&BT RTL8821CS海思平台hi3559av100移植

1、源码获取

       WG225源码包括:

                                  WIFI驱动:RTL8821CS_WiFi_linux_v5.2.8_21706_COEX20170310-1212.20170323、

                                  蓝牙驱动:Linux_BT_UART_v3.10_20171127_8821CS_BTCOEX_20170825-1d1d

2、修改makefile,编译出ko文件 

新增 CONFIG_PLATFORM_HI3559A = y
修改 CONFIG_PLATFORM_I386_PC = n

添加编译选项 ARCH必须修改成arm64,否则报错
ifeq ($(CONFIG_PLATFORM_HI3559A), y)
EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
ARCH = arm64
CROSS_COMPILE = /opt/hisi-linux/x86-arm/aarch64-himix100-linux/bin/aarch64-himix100-linux-
KSRC := /home/ubuntu/Hi3559AV100_SDK_V2.0.1.0/osdrv/opensource/kernel/linux-4.9.y_multi-core/
MODDESTDIR := /home/ubuntu/
INSTALL_PREFIX :=
STAGINGMODDIR := /home/ubuntu/
endif

如果ARCH= arm 报错打印如下: 

 CC [M]  /home/ubuntu/RTL8821CS_WiFi_linux_v5.2.8_21706_COEX20170310-1212.20170323/driver/rtl8821CS_linux_v5.2.8_21706.20170323_COEX20170310-1212/core/rtw_cmd.o
aarch64-himix100-linux-gcc: error: unrecognized argument in option ‘-mabi=apcs-gnu’
aarch64-himix100-linux-gcc: note: valid arguments to ‘-mabi=’ are: ilp32 lp64
aarch64-himix100-linux-gcc: error: unrecognized command line option ‘-mapcs’; did you mean ‘--specs’?
aarch64-himix100-linux-gcc: error: unrecognized command line option ‘-mno-sched-prolog’; did you mean ‘-Wno-sign-promo’?
aarch64-himix100-linux-gcc: error: unrecognized command line option ‘-msoft-float’

3、kernel内核支持

RTL8821CS需要以下支持,所以需要配置内核

     1)cfg80211(cfg80211是Linux 802.11配置API, 用于对无线设备进行配置管理)
     2)master模式(配置wifi的AP热点模式时需要改模式的支持)

天工测控WG225 WIFI&BT RTL8821CS海思平台hi3559av100移植_第1张图片

天工测控WG225 WIFI&BT RTL8821CS海思平台hi3559av100移植_第2张图片

4、加载驱动 ,配置wifi

/var # insmod 8821cs.ko 
RTW: module init start
RTW: rtl8821cs v5.2.8_21706.20170323_COEX20170310-1212
RTW: build time: May 30 2019 08:59:35
RTW: rtl8821cs BT-Coex version = COEX20170310-1212
RTW: module init ret=0

你可能感兴趣的:(海思方案)