summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Fiore <mfiore@multitech.com>2013-04-16 17:08:19 -0500
committerMike Fiore <mfiore@multitech.com>2013-04-16 17:08:19 -0500
commit8a9bc528cd4a34a3dfe660c49804b84ab41434c7 (patch)
tree70ba641c27ad160d9023e4348a8d8f5abd1ca89e
parentbd0572e76d7bc9ee9323af567fbdfc0f0cd9e5d7 (diff)
wl12xx-scripts: init, add scripts & recipe, add to corecdp-base-image
-rw-r--r--multitech/recipes/images/corecdp-base-image.bb1
-rw-r--r--multitech/recipes/wl12xx-scripts/wl12xx-scripts-1.0.inc14
-rw-r--r--multitech/recipes/wl12xx-scripts/wl12xx-scripts-1.0/mt100eocg-pcie-dk/calibrate-wifi.sh37
-rw-r--r--multitech/recipes/wl12xx-scripts/wl12xx-scripts-1.0/mt100eocg-pcie-dk/enable-wifi.sh23
-rw-r--r--multitech/recipes/wl12xx-scripts/wl12xx-scripts-1.0/mtocgd3/calibrate-wifi.sh37
-rw-r--r--multitech/recipes/wl12xx-scripts/wl12xx-scripts-1.0/mtocgd3/enable-wifi.sh23
-rw-r--r--multitech/recipes/wl12xx-scripts/wl12xx-scripts_1.0.bb8
7 files changed, 143 insertions, 0 deletions
diff --git a/multitech/recipes/images/corecdp-base-image.bb b/multitech/recipes/images/corecdp-base-image.bb
index 53e4a1e..2d2450e 100644
--- a/multitech/recipes/images/corecdp-base-image.bb
+++ b/multitech/recipes/images/corecdp-base-image.bb
@@ -39,6 +39,7 @@ WIFI_FEATURES = " \
WL1271_SUPPORT = " \
ti-compat-wireless-wl12xx wl12xx-firmware \
ti-wifi-utils \
+ wl12xx-scripts \
"
BLUETOOTH_FEATURES = "bluez4"
diff --git a/multitech/recipes/wl12xx-scripts/wl12xx-scripts-1.0.inc b/multitech/recipes/wl12xx-scripts/wl12xx-scripts-1.0.inc
new file mode 100644
index 0000000..88f0e6d
--- /dev/null
+++ b/multitech/recipes/wl12xx-scripts/wl12xx-scripts-1.0.inc
@@ -0,0 +1,14 @@
+HOMEPAGE = "http://www.multitech.net/"
+LICENSE = "GPL"
+
+inherit update-rc.d
+
+INITSCRIPT_NAME = "enable-wifi.sh"
+INITSCRIPT_PARAMS = "start 91 S ."
+
+do_install() {
+ install -d ${D}${sbindir}
+ install -m 755 ${WORKDIR}/calibrate-wifi.sh ${D}${sbindir}
+ install -d ${D}${sysconfdir}/init.d
+ install -m 755 ${WORKDIR}/enable-wifi.sh ${D}${sysconfdir}/init.d
+}
diff --git a/multitech/recipes/wl12xx-scripts/wl12xx-scripts-1.0/mt100eocg-pcie-dk/calibrate-wifi.sh b/multitech/recipes/wl12xx-scripts/wl12xx-scripts-1.0/mt100eocg-pcie-dk/calibrate-wifi.sh
new file mode 100644
index 0000000..b16467e
--- /dev/null
+++ b/multitech/recipes/wl12xx-scripts/wl12xx-scripts-1.0/mt100eocg-pcie-dk/calibrate-wifi.sh
@@ -0,0 +1,37 @@
+#!/bin/bash
+
+if [[ $# -ne 1 ]]; then
+ echo "usage: $0 <wifi-mac-address>"
+ exit 1
+fi
+
+WIFIMAC=$1
+
+set -x
+
+killall hostapd
+killall wpa_supplicant
+
+modprobe -r wl12xx_sdio
+modprobe -r at91_mci
+
+mts-io-sysfs store wlan-enabled 0
+sleep 1
+mts-io-sysfs store wlan-enabled 1
+sleep 1
+
+mount -o remount,rw /var/oem
+rm -f /var/oem/mts/wl1271-nvs.bin
+ln -f -s /var/oem/mts/wl1271-nvs.bin /lib/firmware/ti-connectivity/wl1271-nvs.bin
+
+modprobe at91_mci
+sleep 1
+rmmod wl12xx_sdio
+
+calibrator plt autocalibrate wlan0 \
+ /lib/modules/2.6.39.4/updates/drivers/net/wireless/wl12xx/wl12xx_sdio.ko \
+ /usr/share/ti/wifi-utils/ini_files/127x/TQS_S_2.6.ini \
+ /lib/firmware/ti-connectivity/wl1271-nvs.bin \
+ $WIFIMAC
+
+mount -o remount,ro /var/oem
diff --git a/multitech/recipes/wl12xx-scripts/wl12xx-scripts-1.0/mt100eocg-pcie-dk/enable-wifi.sh b/multitech/recipes/wl12xx-scripts/wl12xx-scripts-1.0/mt100eocg-pcie-dk/enable-wifi.sh
new file mode 100644
index 0000000..ee128a3
--- /dev/null
+++ b/multitech/recipes/wl12xx-scripts/wl12xx-scripts-1.0/mt100eocg-pcie-dk/enable-wifi.sh
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+NVS_FILE="/var/oem/mts/wl1271-nvs.bin"
+NVS_DEFAULT_FILE="/lib/firmware/ti-connectivity/wl1271-nvs.bin.factory"
+
+echo "wl12xx: enabling wifi"
+
+set -x
+
+# make sure nvs file exists
+if [[ ! -f $NVS_FILE ]]; then
+ mount -o remount,rw /var/oem
+ cp $NVS_DEFAULT_FILE $NVS_FILE
+ mount -o remount,ro /var/oem
+fi
+
+# probe wifi chip
+mts-io-sysfs store wlan-enabled 0
+usleep 50000
+mts-io-sysfs store wlan-enabled 1
+sleep 1
+modprobe at91_mci
+sleep 3
diff --git a/multitech/recipes/wl12xx-scripts/wl12xx-scripts-1.0/mtocgd3/calibrate-wifi.sh b/multitech/recipes/wl12xx-scripts/wl12xx-scripts-1.0/mtocgd3/calibrate-wifi.sh
new file mode 100644
index 0000000..21659cd
--- /dev/null
+++ b/multitech/recipes/wl12xx-scripts/wl12xx-scripts-1.0/mtocgd3/calibrate-wifi.sh
@@ -0,0 +1,37 @@
+#!/bin/bash
+
+if [[ $# -ne 1 ]]; then
+ echo "usage: $0 <wifi-mac-address>"
+ exit 1
+fi
+
+WIFIMAC=$1
+
+set -x
+
+killall hostapd
+killall wpa_supplicant
+
+modprobe -r wl12xx_sdio
+modprobe -r atmel_mci
+
+mts-io-sysfs store wlan-enabled 0
+sleep 1
+mts-io-sysfs store wlan-enabled 1
+sleep 1
+
+mount -o remount,rw /var/oem
+rm -f /var/oem/mts/wl1271-nvs.bin
+ln -f -s /var/oem/mts/wl1271-nvs.bin /lib/firmware/ti-connectivity/wl1271-nvs.bin
+
+modprobe atmel_mci
+sleep 1
+rmmod wl12xx_sdio
+
+calibrator plt autocalibrate wlan0 \
+ /lib/modules/2.6.39.4/updates/drivers/net/wireless/wl12xx/wl12xx_sdio.ko \
+ /usr/share/ti/wifi-utils/ini_files/127x/TQS_S_2.6.ini \
+ /lib/firmware/ti-connectivity/wl1271-nvs.bin \
+ $WIFIMAC
+
+mount -o remount,ro /var/oem
diff --git a/multitech/recipes/wl12xx-scripts/wl12xx-scripts-1.0/mtocgd3/enable-wifi.sh b/multitech/recipes/wl12xx-scripts/wl12xx-scripts-1.0/mtocgd3/enable-wifi.sh
new file mode 100644
index 0000000..6fb1e85
--- /dev/null
+++ b/multitech/recipes/wl12xx-scripts/wl12xx-scripts-1.0/mtocgd3/enable-wifi.sh
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+NVS_FILE="/var/oem/mts/wl1271-nvs.bin"
+NVS_DEFAULT_FILE="/lib/firmware/ti-connectivity/wl1271-nvs.bin.factory"
+
+echo "wl12xx: enabling wifi"
+
+set -x
+
+# make sure nvs file exists
+if [[ ! -f $NVS_FILE ]]; then
+ mount -o remount,rw /var/oem
+ cp $NVS_DEFAULT_FILE $NVS_FILE
+ mount -o remount,ro /var/oem
+fi
+
+# probe wifi chip
+mts-io-sysfs store wlan-enabled 0
+usleep 50000
+mts-io-sysfs store wlan-enabled 1
+sleep 1
+modprobe atmel_mci
+sleep 3
diff --git a/multitech/recipes/wl12xx-scripts/wl12xx-scripts_1.0.bb b/multitech/recipes/wl12xx-scripts/wl12xx-scripts_1.0.bb
new file mode 100644
index 0000000..5614cf6
--- /dev/null
+++ b/multitech/recipes/wl12xx-scripts/wl12xx-scripts_1.0.bb
@@ -0,0 +1,8 @@
+DESCRIPTION = "Scripts to enable and calibrate the wifi chip on the OCG"
+
+require wl12xx-scripts-1.0.inc
+
+PR = "r1"
+
+SRC_URI = "file://calibrate-wifi.sh \
+ file://enable-wifi.sh"