Wl12xx driver: Difference between revisions

From ArmadeusWiki
(Rework instructions: use /etc/init.d/S30wifi script.)
 
(19 intermediate revisions by 2 users not shown)
Line 1: Line 1:
The wl12xx driver is used by the Wifi / BT chip present on the APF6Dev board. Before using the wifi, you have to calibrate the chip. This page details how to do it.
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==
==Installation==
* On APF6, all needed tools/drivers are installed by default. You can directly switch to [[Wl12xx_driver#Calibration| calibration]].


===Linux===
===Linux===


* Be sure to have CONFIG_NL80211_TESTMODE enabled.
* Be sure to have CONFIG_NL80211_TESTMODE enabled.
<pre>
<pre class="config">
Networking support --->
Networking support --->
  Wireless --->
  Wireless --->
Line 17: Line 18:
* You need the calibrator tool from the ti-utils package.
* You need the calibrator tool from the ti-utils package.


<pre>
<pre class="config">
Target package --->
Target package --->
  Hardware handling --->
  Hardware handling --->
Line 24: Line 25:


==Calibration==
==Calibration==
{{Note|Following instructions are only needed the first time after you flashed your rootfs.}}


* 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>
# 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>
# /etc/init.d/S30wifi calibrate 00:1E:AC:00:51:22
# cp new-nvs.bin /lib/firmware/ti-connectivity/wl1271-nvs.bin
Calibrating
</pre>
wlcore: down
 
mmc0: card 0001 removed
* Load the wl12xx driver.
sdhci-esdhc-imx 2190000.usdhc: card claims to support voltages below defined range
<pre>
mmc0: queuing unknown CIS tuple 0x91 (3 bytes)
# modprobe wl12xx
mmc0: new SDIO card at address 0001
# modprobe wlcore_sdio
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: loaded
</pre>
* Calibrate the chip.
<pre>
# 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 51: 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>


* Unload the driver
==Daily use==
<pre>
 
# rmmod wlcore_sdio
* The WiFi is started automatically at boot thanks to the /etc/init.d/S30wifi script.
 
* To stop the WiFi
<pre class="apf">
# /etc/init.d/S30wifi stop
wlcore: down
mmc0: card 0001 removed
</pre>
</pre>


* Reset the chip. (or reboot the board)
* To start the Wifi
<pre>
<pre class="apf">
# echo 40 > /sys/class/gpio/export
# /etc/init.d/S30wifi start
# echo out > /sys/class/gpio/gpio40/direction
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
mmc0: card 0001 removed
# echo 1 > /sys/class/gpio/gpio40/value
sdhci-esdhc-imx 2190000.usdhc: card claims to support voltages below defined range
sdhci-esdhc-imx 2190000.usdhc: card claims to support voltages below defined range
mmc0: queuing unknown CIS tuple 0x91 (3 bytes)
mmc0: queuing unknown CIS tuple 0x91 (3 bytes)
mmc0: new SDIO card at address 0001
mmc0: new SDIO card at address 0001
</pre>
wl1271_sdio mmc0:0001:2: legacy platform data not found, trying device tree
 
wlcore: loaded
* Set a MAC address.
<pre>
# calibrator set nvs_mac /lib/firmware/ti-connectivity/wl1271-nvs.bin 00:1E:AC:00:51:22
</pre>
 
* Load the driver.
<pre>
# modprobe wlcore_sdio
</pre>
 
* Power up the wireless interface.
<pre>
# 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
</pre>
</pre>


Congratulations ! Your chip is calibrated. :)
==Going further==
* Now you can use the [[WiFi|general instructions here to setup your Wi-Fi network (as client/station (STA))]].
* If you want to use your APF board as an access point then take a look at [[APF as Wi-Fi Access Point]] (AP).
* It should be possible to use this chip in Multi-Role (STA+AP), but currently we have a firmware reboot problem when following [http://processors.wiki.ti.com/index.php/OMAP_Wireless_Connectivity_NLCP_Multi_Role_Configuration]. If anyone knows how to proceed, please send us an email or join us on IRC ;-).


==Going further==
==Tips==
* Now you can use the [[WiFi|general instructions here to setup your WiFi network]].
* To have more debug messages of firmware loading/boot process, one may load drivers this way:
<pre class="apf">
# modprobe wlcore debug_level=4; modprobe wl12xx; modprobe wlcore_sdio
</pre>


==Links==
==Links==
[http://wireless.kernel.org/en/users/Drivers/wl12xx/calibrator http://wireless.kernel.org/en/users/Drivers/wl12xx/calibrator]
* [http://wireless.kernel.org/en/users/Drivers/wl12xx/calibrator http://wireless.kernel.org/en/users/Drivers/wl12xx/calibrator]
 
* [http://processors.wiki.ti.com/index.php/WL12xx_NLCP_Calibration_Process http://processors.wiki.ti.com/index.php/WL12xx_NLCP_Calibration_Process]
[http://processors.wiki.ti.com/index.php/WL12xx_NLCP_Calibration_Process http://processors.wiki.ti.com/index.php/WL12xx_NLCP_Calibration_Process]
* [http://processors.wiki.ti.com/index.php/OMAP_Wireless_Connectivity_NLCP_Multi_Role_Configuration http://processors.wiki.ti.com/index.php/OMAP_Wireless_Connectivity_NLCP_Multi_Role_Configuration]


[[Category:Linux drivers]]
[[Category:Linux drivers]]
[[Category:Wireless]]
[[Category:Wireless]]

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