Difference between revisions of "Wl12xx driver"

From ArmadeusWiki
Jump to: navigation, search
(Going further)
(Rework instructions: use /etc/init.d/S30wifi script.)
 
Line 26: Line 26:
 
==Calibration==
 
==Calibration==
 
{{Note|Following instructions are only needed the first time after you flashed your rootfs.}}
 
{{Note|Following instructions are only needed the first time after you flashed your rootfs.}}
* Poweroff then on your board. You have limited time to execute the following commands so don't be lazy ;-).
 
  
* Use the calibrator tool to generate the new calibration data. This will generate a file called new-nvs.bin.
+
To calibrate the chip use the S30wifi script with a MAC address
<pre class="apf">
+
# calibrator set ref_nvs /usr/share/ti-utils/ini_files/127x/TQS_S_2.6.ini
+
</pre>
+
  
* Copy the file to the right place.
 
 
<pre class="apf">
 
<pre class="apf">
# cp new-nvs.bin /lib/firmware/ti-connectivity/wl1271-nvs.bin
+
# /etc/init.d/S30wifi calibrate 00:1E:AC:00:51:22
</pre>
+
Calibrating
 
+
wlcore: down
* Set a MAC address (here for example an Armadeus Systems one).
+
mmc0: card 0001 removed
<pre class="apf">
+
sdhci-esdhc-imx 2190000.usdhc: card claims to support voltages below defined range
# calibrator set nvs_mac /lib/firmware/ti-connectivity/wl1271-nvs.bin 00:1E:AC:00:51:22
+
mmc0: queuing unknown CIS tuple 0x91 (3 bytes)
</pre>
+
mmc0: new SDIO card at address 0001
 
+
wl1271_sdio mmc0:0001:2: legacy platform data not found, trying device tree
* Load the wl12xx driver.
+
wlcore: loaded
<pre class="apf">
+
mmc0: card 0001 removed
# modprobe wl12xx
+
sdhci-esdhc-imx 2190000.usdhc: card claims to support voltages below defined range
# modprobe wlcore_sdio
+
mmc0: queuing unknown CIS tuple 0x91 (3 bytes)
 +
mmc0: new SDIO card at address 0001
 
wl1271_sdio mmc0:0001:2: legacy platform data not found, trying device tree
 
wl1271_sdio mmc0:0001:2: legacy platform data not found, trying device tree
...
 
 
wlcore: loaded
 
wlcore: loaded
</pre>
 
 
* Calibrate the chip.
 
<pre class="apf">
 
# calibrator plt calibrate dual
 
 
wlcore: power up
 
wlcore: power up
 
wlcore: firmware booted in PLT mode PLT_ON (PLT 6.3.10.0.133)
 
wlcore: firmware booted in PLT mode PLT_ON (PLT 6.3.10.0.133)
Line 61: Line 51:
 
The path to NVS file not provided, use default (/lib/firmware/ti-connectivity/wl1271-nvs.bin)
 
The path to NVS file not provided, use default (/lib/firmware/ti-connectivity/wl1271-nvs.bin)
 
wlcore: power down
 
wlcore: power down
 +
mmc0: card 0001 removed
 
</pre>
 
</pre>
  
* Reset the chip. (or reboot the board)
+
==Daily use==
<pre class="apf">
+
# echo 40 > /sys/class/gpio/export
+
# echo out > /sys/class/gpio/gpio40/direction
+
# echo 0 > /sys/class/gpio/gpio40/value; sleep 1
+
# echo 1 > /sys/class/gpio/gpio40/value
+
</pre>
+
  
* Congratulations ! Your chip is calibrated. :)
+
* The WiFi is started automatically at boot thanks to the /etc/init.d/S30wifi script.
 
+
==Daily use==
+
  
* Reset the chip: (or reboot the board)
+
* To stop the WiFi
 
<pre class="apf">
 
<pre class="apf">
# echo 40 > /sys/class/gpio/export
+
# /etc/init.d/S30wifi stop
# echo out > /sys/class/gpio/gpio40/direction
+
wlcore: down
# echo 0 > /sys/class/gpio/gpio40/value; sleep 1
+
mmc0: card 0001 removed
# echo 1 > /sys/class/gpio/gpio40/value
+
 
</pre>
 
</pre>
  
* Load the wl12xx driver:
+
* To start the Wifi
 
<pre class="apf">
 
<pre class="apf">
# modprobe wl12xx
+
# /etc/init.d/S30wifi start
# modprobe wlcore_sdio
+
sdhci-esdhc-imx 2190000.usdhc: card claims to support voltages below defined range
 +
mmc0: queuing unknown CIS tuple 0x91 (3 bytes)
 +
mmc0: new SDIO card at address 0001
 +
wl1271_sdio mmc0:0001:2: legacy platform data not found, trying device tree
 +
wlcore: loaded
 +
mmc0: card 0001 removed
 +
sdhci-esdhc-imx 2190000.usdhc: card claims to support voltages below defined range
 +
mmc0: queuing unknown CIS tuple 0x91 (3 bytes)
 +
mmc0: new SDIO card at address 0001
 
wl1271_sdio mmc0:0001:2: legacy platform data not found, trying device tree
 
wl1271_sdio mmc0:0001:2: legacy platform data not found, trying device tree
...
 
 
wlcore: loaded
 
wlcore: loaded
</pre>
 
 
* Power up the wireless interface:
 
<pre class="apf">
 
# ifconfig wlan0 up
 
 
wlcore: firmware booted (Rev 6.3.10.0.133)
 
wlcore: firmware booted (Rev 6.3.10.0.133)
 
IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
 
IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
Line 108: Line 92:
 
<pre class="apf">
 
<pre class="apf">
 
# modprobe wlcore debug_level=4; modprobe wl12xx; modprobe wlcore_sdio
 
# modprobe wlcore debug_level=4; modprobe wl12xx; modprobe wlcore_sdio
</pre>
 
 
* You can put the reset instructions in a script:
 
<pre class="apf">
 
#/bin/sh
 
 
if [ ! -d /sys/class/gpio/gpio40 ]; then
 
        echo 40 > /sys/class/gpio/export
 
        echo out > /sys/class/gpio/gpio40/direction
 
fi
 
 
echo 0 > /sys/class/gpio/gpio40/value
 
sleep 1
 
echo 1 > /sys/class/gpio/gpio40/value
 
 
</pre>
 
</pre>
  

Latest revision as of 16:15, 2 October 2015

The wl12xx driver is used by the Wi-Fi/Bluetooth chip present on the APF6 module. Before using the Wi-Fi, you have to calibrate the chip. This page details how to do it.

Installation

  • On APF6, all needed tools/drivers are installed by default. You can directly switch to calibration.

Linux

  • Be sure to have CONFIG_NL80211_TESTMODE enabled.
Networking support --->
 Wireless --->
  <*> cfg80211 - wireless configuration API
   [*] nl80211 testmode command

Buildroot

  • You need the calibrator tool from the ti-utils package.
Target package --->
 Hardware handling --->
  [*] ti-utils

Calibration

Note Note: Following instructions are only needed the first time after you flashed your rootfs.


To calibrate the chip use the S30wifi script with a MAC address

# /etc/init.d/S30wifi calibrate 00:1E:AC:00:51:22
Calibrating
wlcore: down
mmc0: card 0001 removed
sdhci-esdhc-imx 2190000.usdhc: card claims to support voltages below defined range
mmc0: queuing unknown CIS tuple 0x91 (3 bytes)
mmc0: new SDIO card at address 0001
wl1271_sdio mmc0:0001:2: legacy platform data not found, trying device tree
wlcore: loaded
mmc0: card 0001 removed
sdhci-esdhc-imx 2190000.usdhc: card claims to support voltages below defined range
mmc0: queuing unknown CIS tuple 0x91 (3 bytes)
mmc0: new SDIO card at address 0001
wl1271_sdio mmc0:0001:2: legacy platform data not found, trying device tree
wlcore: loaded
wlcore: power up
wlcore: firmware booted in PLT mode PLT_ON (PLT 6.3.10.0.133)
wlcore: testmode cmd: radio status=0

The path to NVS file not provided, use default (/lib/firmware/ti-connectivity/wl1271-nvs.bin)
wlcore: power down
mmc0: card 0001 removed

Daily use

  • The WiFi is started automatically at boot thanks to the /etc/init.d/S30wifi script.
  • To stop the WiFi
# /etc/init.d/S30wifi stop
wlcore: down
mmc0: card 0001 removed
  • To start the Wifi
# /etc/init.d/S30wifi start
sdhci-esdhc-imx 2190000.usdhc: card claims to support voltages below defined range
mmc0: queuing unknown CIS tuple 0x91 (3 bytes)
mmc0: new SDIO card at address 0001
wl1271_sdio mmc0:0001:2: legacy platform data not found, trying device tree
wlcore: loaded
mmc0: card 0001 removed
sdhci-esdhc-imx 2190000.usdhc: card claims to support voltages below defined range
mmc0: queuing unknown CIS tuple 0x91 (3 bytes)
mmc0: new SDIO card at address 0001
wl1271_sdio mmc0:0001:2: legacy platform data not found, trying device tree
wlcore: loaded
wlcore: firmware booted (Rev 6.3.10.0.133)
IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready

Going further

Tips

  • To have more debug messages of firmware loading/boot process, one may load drivers this way:
# modprobe wlcore debug_level=4; modprobe wl12xx; modprobe wlcore_sdio

Links