您的位置:首页 > 移动开发 > Android开发

【实践驱动开发3-002】TI WL1835MODCOM8 在android的移植 - 软件获取

2014-07-07 19:54 681 查看
继续上一篇,我们还是要找到能减少改动最小的一个SDK驱动包。TI 给出的SDK是基于am3355的,所以,改动是必须的,

这里把大部分SDK相关的东西该为灰色。

在软件包里面的发表说明里面有关于软件的版本说明:

WiLink8 Release Notes

http://processors.wiki.ti.com/index.php/WiLink8_Release_Notes/R8.3SP1

General Information

Release Notes Document:

WLAN IP WL18xx R8.3 SP1

Product Components

ComponentVersion
Reference Host PlatformTI AM335x EVM Rev 1.2
Linux Kernel3.8.13+
SDK ReleaseN/A (not released as part of an SDK)
WL18xx MAC firmware version8.8.0.0.13
WL18xx PHY firmware version8.2.0.0.195
WL18xx Driver versionol_r8.a8.10

Release Highlights

This service pack includes all features included in R8.3 release with additional bug fixes.

Stability and robustness fixes
PHY Improvements.

Release Quality

This is a Beta release.

Solved Issues

IDTitle
MCS00128368

AP Connection Failure: Failure to re-connect to AP after a disconnection during beacon profile or with traffic at low duty cycle (e.g. periodic ping)
MCS00125828Some FW crashes observed during long traffic-stability tests
MCS00127878STA sometimes doesn’t enter ELP immediately after re-connection
MCS00128389Clipping temperature estimation for PA calibration to 50degC. Improves stability and robustness in MIMO scenarios.
MCS00128387

MCS00128938
Improve IQMM calibration in automotive packages
MCS00128390Automotive 5GHz TX improvements through DPD optimizations
MCS00128736

MCS00128832
CSD fix. Solving degraded performance when connected in CSD mode

HW/System Limitation

Role Band
2.4GHz5GHz
STA20 MHz SISO

40 MHz SISO

20 MHz MIMO
20 MHz SISO

40 MHz SISO
AP20 MHz SISO

20 MHz MIMO
20 MHz SISO

40 MHz SISO
P2P20 MHz SISO

20 MHz MIMO
20 MHz SISO

40 MHz SISO



SW Limitations

AP/P2P SISO40 in 2.4GHz is not supported, due to missing components in the implementation required to meet specification requirements.

Release Components and Sources

Platform and Kernel information

This release was developed and tested on the following HW/SW platform:

Linux Kernel: Kernel 3.8 (with "device-tree" support) http://elinux.org/Device_Trees
EVM: TI AM335x EVM Rev 1.2


Note: Information regarding the kernel used in the development of this release, as well as patches
that were needed in order to adapt the Wilink SW to the "Device-Tree" mechanism in the kernel can be found in Appendix I - Kernel and Kernel-Patches.

WLAN SW components with Linux Kernel 3.8 ("device-tree" support)

The WLAN codebase can be found in github, according to the following specification:

WL18xx WLAN R8.3 SP1 SW Manifest

Repository: TI-OpenLink.
Git tag: ol_r8.a8.10
Relevant components covered by this tag:

github.com/TI-OpenLink/wl18xx.git
github.com/TI-OpenLink/hostap.git
github.com/TI-OpenLink/compat.git
github.com/TI-OpenLink/compat-wireless.git
github.com/TI-OpenLink/18xx-ti-utils.git
github.com/TI-OpenLink/wl18xx_fw.git (***)
github.com/TI-OpenLink/wl12xx_target_scripts.git

Hostap configuration files:

There are 3 configuration files for the hostap package: hostapd.conf, p2p_supplicant.conf and wpa_supplicant.conf
This release modifies the default parameters of these configuration-files for optimizing operation and meeting the release requirements. It is important to use the same configuration files that were used during TI development and testing in order to achieve
the same behavior and performance.
These updated configuration files are currently managed outside of the original code-base. They can be found in this location (using the same git-tag mentioned above):

github.com/TI-OpenLink/wl12xx_target_scripts.git (under "conf" folder.)

(***)

Note: The WLAN Firmware Binary file-name is required to be "wl18xx-fw-2.bin".

For Legacy SDK6.0 Kernel 3.2 support:

To build the driver with kernel 3.2 please use tag : ol_r8.a8.10_32

On these repositories :

github.com/TI-OpenLink/wl18xx.git

github.com/TI-OpenLink/compat-wireless.git

Evaluation Pre-Builds provided for legacy SDK6.0 (kernel 3.2) boot,

rootfs

For Kernel 3.8 support

Please refer to the following page:R8.3SP1_kernel_3.8

Testing

Testing/Coverage limitations

This release was not integrated into a formal AM335x SDK. Therefore there WiFi operation was not tested with GUI (all testing done using command-line tools).
SW was not tested with recent TELEC changes
For full testing results please contact your TI representative.

WiFI Pre-Certification Test Status

WL18xx WiFi Build Process

http://processors.wiki.ti.com/index.php/WL18xx_WiFi_Build_Process

1 Introduction

This page will walk you through how to do the following:

Configure and build your host environment
Configure and compile the PSP Linux kernel for support of the WL18xx.
Use the system build scripts to update functions and drivers.

This page assumes that you are familiar with the process of configuring and compiling the kernel.

2 Building the Host Environment

2.1 Securing a Host OS

This section describes the building process for a host running

Ubuntu Linux distribution. On other Linux distributions the process should be same. In the case results of the used shell commands will not be as expected, please, consult your distribution's documentation to see the differences.
Linux distribution must have the following tools:

libglib2.0-dev (version 2.32 and later) - general-purpose C library used by projects such as GTK+ and GNOME
libdbus-glib-1-dev - simple interprocess messaging system (GLib interface), this package provides a GLib-style interface to D-Bus.
bash - GNU Bourne-Again Shell
autoconf and automake - automatic configure script and Makefile builder
libtool - generic library support
perl - Practical Extraction and Report Language
gettext - support for internalization
patch - utility to apply code patches
bison - parser generator compatible with yacc
flex - generates programs that perform pattern-matching on text
bc - arbitrary precision calculator language
python - interpreted, object-oriented programming language
python-m2crypto - Python wrapper for OpenSSL
python-dev - Python header files
python-2.7-dev
git - control version utility
corkscrew - tunnel TCP connections through HTTP proxies
u-boot-tools - This package includes the mkimage program, which allows generation of U-Boot images in various formats.

On Ubuntu Linux distribution use apt-get command to install each of the specified packages, for example:
sudo apt-get install perl


In case working behaind a proxy, several steps should be apply, this is necessary since part of the WLAN components are downloaded from GitHub.com which cannot work with proxy. follow the steps below:

1. Ensure the proxy environment variables are exported:
export http_proxy=<http proxy name>:<http proxy port>
export https_proxy=<https proxy name>:<https proxy port>
export ftp_proxy=<ftp proxy name>:<ftp proxy port>
export all_proxy=<all proxy name>:<all proxy port>

2. Edit your.gitconfig file (located in the HOME directory, like "/home/user/") to use 'corcscrew':
user@ubt1004:~$ cat .gitconfig
[user]

[core]
	gitproxy = none for ti.com
	gitproxy = /home/user/bin/git-proxy-corcscrew-script.sh
[color]

[gui]

[sendemail]


For more information about GIT version control system, please check

GIT's User Manual.

3. Create git-proxy-corcscrew-script.sh (in that example in folder /home/user/bin/), where corkscrew script is shell script containing the following command:
#!/bin/bash
exec corkscrew <proxy-name> <proxy-port> $*

4. modify the script permissions to executable mode
chmod +x /home/user/bin/git-proxy-corcscrew-script.sh


If your host build environment is 64 bit you should have all libraries and headers of standard C library for 32 bits. For example, for Ubuntu 12.4 64 bits install following packages:

sudo apt-get install ia32-libs
sudo apt-get install ia32-libs-multiarch


This is required the cross compile to work properly.

Download the SDK (source code and file system)

The following example assumes AM335x SDK release
SDK can be downloaded from
<AM335x SDK Release Download Page>

choose specific platform (that example is for AM335x platform) and inside download 2 files:

AM335x SDK PSP Source Code - PSP including Kernel source code
AM335x SDK prebuilt PSP binaries and root filesystem - filesystem (SD Card images)

Download and install suitable for your board SDK package. This document assumes that SDK was installed under
/home/user/SDK location.
Each SDK package comes with compressed archive containing precompiled root file system structure and binaries to be run on evaluation board. Extract this archive to some location on your Linux PC, this document assumes
/home/user/SDK/targetfs is such location. Export environment variable to point to a location of just extracted root file system:

bash# ~/SDK> export ROOTFS=/home/user/SDK/targetfs


Export following environment variables to point to the Linux kernel sources placed inside SDK package:

export KLIB_BUILD=/home/bvijay/ti-sdk-am335x-evm-06.00.00.00/board-support/linux-3.2.0-psp04.06.00.11<kernel build>

For example, download "ti-sdk-am335x-evm-06.00.00.00-Linux-x86-Install" and change the permission if required to run the installer.

Please refer to the
Sitara_Linux_Software_Developer’s_Guide on how to use the installer

SDK Directory Structure Overview

这里是移植的参考,为各个目录文件的位置做设想,当然依旧是SDK AM335X Sitara

The Sitara Linux SDK contains the following top-level directories and files





These directories contain the code and tools used to develop for Sitara
devices.

bin - Contains the helper scripts for configuring the host system and target device. Most of these scripts are used by the setup.sh script.
board-support - Contains the SDK components that need to be modified when porting to a custom platform. This includes the kernel and boot loaders as well as any out of tree drivers.
docs - Contains various SDK documentation such as the software manifest and additional user's guide. This is also the location where you can find the
training directory with the device training materials.
example-applications - Contains the sources for the TI provided example applications seen during the out-of-box demonstration.
filesystem - Contains the reference file systems. These include the smaller base file system as well as the full-featured SDK file system.
host-tools - Contains the host side tools such as pinmux and flash tool.
linux-devkit - Contains the cross-compile toolchain and libraries to speed development for the target device.
Graphics_SDK_setuplinux_<version>.bin - This is the installer for the graphics SDK. The graphics SDK components are used by the Sitara Linux SDK to provide additional demos as well as integrated with the pre-built Qt libraries to accelerate various Qt functions.
Makefile - Provides build targets for many of the SDK components from the top-level of the SDK.
Rules.make - Sets default values used by the top-level Makefile as well as sub-component Makefiles
setup.sh - Configures the users host system as well as the target system for development

bvijay@ulx0112741:~/ti-sdk-am335x-evm-06.00.00.00$ cd board-support/linux-3.2.0-psp04.06.00.11/
bvijay@ulx0112741:~/ti-sdk-am335x-evm-06.00.00.00/board-support/linux-3.2.0-psp04.06.00.11/$ ls
arch	       firmware  kernel       README	      usr
block	       fs	 lib	      REPORTING-BUGS  virt
COPYING        include	 MAINTAINERS  samples
CREDITS        init	 Makefile     scripts
crypto	       ipc	 mm	      security
Documentation  Kbuild	 net	      sound
drivers        Kconfig	 patches      tools
bvijay@ulx0112741:~/ti-sdk-am335x-evm-06.00.00.00$


Root file system file name is arago-base-tisdk-image-am335x-evm.tar.gz

Following is the instruction how to extract it:

bvijay@ulx0112741:~/AM335x/rootFS$ ls
arago-base-tisdk-image-am335x-evm.tar.gz
bvijay@ulx0112741:~/AM335x/rootFS$

bvijay@ulx0112741:~/ti-sdk-am335x-evm-06.00.00.00$ tar xzf arago-base-tisdk-image-am335x-evm.tar.gz -C AM335x/rootFS/
user@ubt1004:~/AM335x/rootFS$ ls
proc
bin				       sbin
boot				       srv
dev				       sys
etc				       tisdk-rootfs-am335x-evm.tar.gz
home				       tmp
lib				       u-boot-am335x-evm.img
linuxrc				       uImage-am335x-evm.bin
media				       usr
MLO-am335x-evm			       var
mnt				       www
opt
user@ubt1004:~/AM335x/rootFS$

There is a need for sudo permission to extract the dev directory, therefore additional extraction operation needed to extract the dev directory.

user@ubt1004:~/AM335x/rootFS$ sudo tar xzf tisdk-rootfs-am335x-evm.tar.gz dev


in that example the environment variables will be as follows:

export ROOTFS=/home/user/AM335x/rootFS
export KLIB_BUILD=/home/bvijay/ti-sdk-am335x-evm-06.00.00.00/board-support/linux-3.2.0-psp04.06.00.11
export CROSS_COMPILE="arm-linux-gnueabihf-"
export PATH=$PATH:"Path to Cross Compiler"
export WORK_SPACE = "path where wlan components needs to be downloaded"

Building the Kernel

Environment variables - for building kernel

export CROSS_COMPILE=arm-linux-gnueabihf-
export ARCH=arm
export TOOLCHAIN_PATH="Cross compiler tool chain path"
If you are not sure where the tool chain is installed run "locate arm-linux-gnueabihf-" it will show the complete path
export PATH=$PATH:$TOOLCHAIN_PATH/bin
export CC=${CROSS_COMPILE}gcc
export AS=${CROSS_COMPILE}as
export AR=${CROSS_COMPILE}ar
export OBJDUMP=${CROSS_COMPILE}objdump
export STRIP=${CROSS_COMPILE}strip


Creating configuration file (.config) for Linux kernel

It is often easiest to start with a base default configuration and then customize it for you use case if needed. In the Linux kernel a command of the form:

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- <config>

will look in the arch/arm/configs directory for the configuration file (<config> in the line above) use that file to set default configuration options. The table below shows the default configuration files
for various platforms.


Note: The configuration file used to build the pre-built binaries found
in the SDK can be found in the arch/arm/configs directory as tisdk_<device>_config and can be used in place of the config file given below to reproduce the SDK Linux kernel configuration settings. The differences between these files generally revolve around
enabing/disabling additional modules for expected SDK use cases.

DeviceSDK configPSP config
AM335x/Beaglebonetisdk_am335x-evm_defconfigam335x_evm_defconfig
AM37xtisdk_am37x-evm_defconfigomap3_evm_defconfig
AM3517tisdk_am3517-evm_defconfigam3517_evm_defconfig
Beagleboardtisdk_beagleboard_defconfigomap3_beagle_defconfig
AM180xtisdk_am180x-evm_defconfigda850_omapl138_defconfig
For example, to build the default PSP configuration for the AM335x the command would be:

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- am335x_evm_defconfig

To build the SDK configuration for the AM335x the command would be:

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- tisdk_am335x-evm_defconfig

After the configuration step has run the full configuration file is saved to the root of the kernel tree as .config. Any further configuration changes are based on this file until it is cleanup up by doing a kernel clean as mentioned above.

To know exactly what configuration file to use for your board, please consult the documentation comming with the evaluation board package.

Ensure kernel configuration file (.config file) includes the following options and add them if neccessary.

The following switches should be enabled in your kernel defconfig file in order to work with full WLAN and Bluetooth support


Note: As we are using compat-wireless and compat-bluetooth packages, most of the mac80211 and bluetooth
related switches are bot needed in the kernel
.config file.


Note: CONFIG_REGULATOR_FIXED_VOLTAGE=y for AM37x platform and not needed
for AM18x and AM335x platforms.

Make sure that the following build kernel options are
disabled in the .config file in order to disable the Kernel support of WLAN BT , so the Kernel modules for WLAN BT will be provided from the Compat wireless components and not from the Kernel distribution itself.
CONFIG_BT=N
CONFIG_CFG80211=N
CONFIG_MAC80211=N


In addition make sure that the following build kernel options are enabled in the .config file

#
# Network testing
#

# MAC 80211 
CONFIG_WLAN=y
CONFIG_WIRELESS=y
CONFIG_WIRELESS_EXT=y
CONFIG_WL12XX_PLATFORM_DATA=y

CONFIG_KEYS=y
CONFIG_SECURITY=y
CONFIG_CRYPTO=y

CONFIG_WIRELESS_EXT=y
CONFIG_CRYPTO_ARC4=y
CONFIG_CRYPTO_ECB=y
CONFIG_CRYPTO_AES=y
CONFIG_CRYPTO_MICHAEL_MIC=y

CONFIG_RFKILL=y

CONFIG_REGULATOR_FIXED_VOLTAGE=y
CONFIG_CRC7=y

# The following are needed for soft AP
CONFIG_NETFILTER=y
CONFIG_NETFILTER_ADVANCED=y
CONFIG_NF_CONNTRACK=y
CONFIG_NETFILTER_XTABLES=y
CONFIG_NF_DEFRAG_IPV4=y
CONFIG_NF_CONNTRACK_IPV4=y
CONFIG_NF_CONNTRACK_PROC_COMPAT=y
CONFIG_IP_NF_IPTABLES=y
CONFIG_IP_NF_FILTER=y
CONFIG_IP_NF_TARGET_LOG=y
CONFIG_NF_NAT=y
CONFIG_NF_NAT_NEEDED=y
CONFIG_IP_NF_TARGET_MASQUERADE=y

CONFIG_INPUT_UINPUT=y

# Enable Ethernet-WLAN Bridge
CONFIG_NETFILTER=y
CONFIG_NETFILTER_ADVANCED=y
CONFIG_BRIDGE_NETFILTER=y
CONFIG_STP=y
CONFIG_BRIDGE=y
CONFIG_BRIDGE_IGMP_SNOOPING=y
CONFIG_LLC=y
CONFIG_INPUT_UINPUT=y
CONFIG_HAS_IOMEM=y
CONFIG_HAS_IOPORT=y
CONFIG_HAS_DMA=y
CONFIG_NLATTR=y
CONFIG_***ERAGE=y

There are 2 option to perform that

Edit the .config file and update the kernel switches, or add them at the end of the .config file
use script to modify the .config file

use of script to modify the .config file

the script name is wlan_enable_config.sh which comes as part of the zip file, script can be found in

here
in the kernel path run :
./wlan_enable_config.sh .config

which will modify the .config with the right kernel switches


Note: In case there are missing kernel switches like CONFIG_WL12XX_PLATFORM_DATA, then there probably
is a missing part in the kernel that relates to the WL127x chipset, and patches should be applied.

Compile the Kernel

Compile and create uImage by "make uImage" command.
In case there are Questions for kernel options, press "ENTER" to have all the default setting. the reason is due to the new kernel options added to the configuration file (.config).
The uImage will be located on Linux directory under /arch/arm/boot, for example: /home/user/AM335x/PSP/linux-3.2.0-psp04.06.00.08.sdk/arch/arm/boot

System Build Scripts (Up to R8.3 SP1)

The build script located in github and can be cloned as follows:

user@ubuntu:~$ mkdir utility
user@ubuntu:~$ cd utility
user@ubuntu:~/utility$ git clone git://github.com/TI-ECS/build-utilites.git
Cloning into 'build-utilites'...
remote: Counting objects: 223, done.
remote: Compressing objects: 100% (176/176), done.
remote: Total 223 (delta 115), reused 145 (delta 40)
Receiving objects: 100% (223/223), 78.98 KiB | 61 KiB/s, done.
Resolving deltas: 100% (115/115), done.
user@ubuntu:~/utility$ ls
build-utilites
user@ubuntu:~/utility$ cd build-utilites/
user@ubuntu:~/utility/build-utilites$ ls
functions  scripts             wl12xx_build.sh
patches    setup-env.sample    wl18xx_build_bt.sh   wl18xx_build_ble.sh   wl18xx_build.sh
README     wl12xx_build_bt.sh  wlan_enable_config.sh
user@ubuntu:~/utility/build-utilites$

Set tag to build R8.3SP1, there are two possible tags depending upon kernel version.To build with a 3.2 kernel (as in AM335x SDK 6.0) use

git reset --hard ol_r8.a8.10_32

and to build with any other kernel use

git reset --hard ol_r8.a8.10

There are 2 Build scripts:

wl18xx_build.sh - Build the WLAN
wl18xx_build_bt.sh - Build the Bluetooth (Bluez 4.98)

in addition there 2 folders:

functions - holds build script of all the mutual components that are shared by the BT and WLAN, such that it will easier to maintain same components versions.
scripts - holds scripts that are used for BT, BLE , they will be installed by the build scripts in the filesystem

Build script Enviroment file

“setup-env.sample” file is used as base of “setup-env” that includes user specific environment variables.

User should copy the setup-env.sample to setup-env and edit the variables according to user specific environment

Typical file will be as follows:

# User specific environment settings
export CROSS_COMPILE="arm-linux-gnueabihf-"
export PATH="$PATH:"Path to cross compiler tool chain path"
export ROOTFS="/home/user/AM335x/RootFS"
export WORK_SPACE="/home/user/AM335x/work_space_R8_A8_10_32"
export KLIB_BUILD="/home/user/AM335x/PSP/linux-3.2.0-psp04.06.00.11"
# MACHINE_TYPE - The target machine type. Can have one of the following values: "am1808" , "omap3evm" , "am335x"
# This is needed to build bluetooth components.
# This parameter is not relevant for ti814x board.
export MACHINE_TYPE="am335x"
export BUILD_VERSION="r8"

#===========================================================
export ARCH="arm"
export MY_PREFIX="/usr"
export MY_SYSCONFDIR="/etc"
export MY_LOCALSTATEDIR="/var"
export CC="${CROSS_COMPILE}gcc"
export CXX="${CROSS_COMPILE}g++"
export AR="${CROSS_COMPILE}ar"
export RANLIB="${CROSS_COMPILE}ranlib"
export CFLAGS="${CFLAGS} -I${ROOTFS}${MY_PREFIX}/include"
export CPPFLAGS="${CFLAGS}"
export LDFLAGS="${LDFLAGS} -L${ROOTFS}${MY_PREFIX}/lib"
export PKG_CONFIG_SYSROOT_DIR=${ROOTFS}
export PKG_CONFIG_PATH="${ROOTFS}${MY_PREFIX}/lib/pkgconfig:${ROOTFS}/lib/pkgconfig"
export PKG_CONFIG_LIBDIR=""
export PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=""
export PKG_CONFIG_ALLOW_SYSTEM_LIBS=""


The main settings user should provide are:

ROOTFS - path to target root file system
PATH - add to the PATH environment variable toolchain path (after "$PATH:").
KLIB_BUILD - Path to the kernel sources
CROSS_COMPILE - the begin part of cross compiler executable name, for example "arm-none-linux-gnueabi-"
WORK_SPACE - Work directory for download and build process

setup-env file should to be placed in the same directory together with build scripts (wl18xx_build.sh,wl18xx_build_bt.sh etc.).

Building WLAN - wl18xx_build.sh file

This script compiles one of following utilities: libnl, openssl, hostapd, wpa_supplicant,wl12xx_modules,firmware,crda,callibrator by calling specific utility name and action.

./wl18xx_build.sh <module name> <download|build|install>

were available "module name" is

libnl
openssl
iw
hostap
wpa_supplicant
crda
ti-utils
wl18xx-firmware
compat-wireless
wlconf

examples:

./wl18xx_build.sh all
./wl18xx_build.sh compat-wireless build
./wl18xx_build.sh clean-all


If root file system requires root privileges add sudo before the script, for example:

sudo ./wl18xx_build.sh all


Building WLAN - wl18xx_build AMXXX SDK7.0

WL18xx AMxxx Platform Integration Guide

System Build Scripts (R8.4 and above)

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: