summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesse Gilles <jgilles@multitech.com>2013-04-19 17:41:43 -0500
committerJesse Gilles <jgilles@multitech.com>2013-04-19 17:41:43 -0500
commitcdeafea43f2c116ac417a51a3522c1ee3a2c306b (patch)
tree53eba6727fb4609f6171028cecaa0d2e8907c91a
parent78d159e0e18a8aa32776b134490aa802514d6f4c (diff)
wl12xx-scripts: detect mci module type
* calibration works on mt100eocg-pcie-dk now
-rw-r--r--multitech/recipes/wl12xx-scripts/wl12xx-scripts-1.0/calibrate-wifi.sh13
-rw-r--r--multitech/recipes/wl12xx-scripts/wl12xx-scripts-1.0/enable-wifi.sh23
-rw-r--r--multitech/recipes/wl12xx-scripts/wl12xx-scripts_1.0.bb2
3 files changed, 27 insertions, 11 deletions
diff --git a/multitech/recipes/wl12xx-scripts/wl12xx-scripts-1.0/calibrate-wifi.sh b/multitech/recipes/wl12xx-scripts/wl12xx-scripts-1.0/calibrate-wifi.sh
index b57e0bb..bb14702 100644
--- a/multitech/recipes/wl12xx-scripts/wl12xx-scripts-1.0/calibrate-wifi.sh
+++ b/multitech/recipes/wl12xx-scripts/wl12xx-scripts-1.0/calibrate-wifi.sh
@@ -12,13 +12,20 @@ NVS_OEM_FILE="$OEM_DIR/$NVS_DIR/wl1271-nvs.bin"
NVS_FILE="/lib/firmware/ti-connectivity/wl1271-nvs.bin"
NVS_DEFAULT_FILE="$NVS_FILE.factory"
+# detect mci driver
+if find /lib/modules -name "atmel-mci.ko" | grep -q "atmel-mci"; then
+ MCI_MODULE="atmel_mci"
+else
+ MCI_MODULE="at91_mci"
+fi
+
echo "starting wifi calibration..."
killall hostapd
killall wpa_supplicant
modprobe -r wl12xx_sdio
-modprobe -r atmel_mci
+modprobe -r $MCI_MODULE
mts-io-sysfs store wlan-enabled 0
sleep 1
@@ -29,8 +36,8 @@ mount -o remount,rw /var/oem
echo "removing $NVS_OEM_FILE"
rm -f $NVS_OEM_FILE
-modprobe atmel_mci
-sleep 1
+modprobe $MCI_MODULE
+sleep 3
rmmod wl12xx_sdio
echo "calibrating..."
diff --git a/multitech/recipes/wl12xx-scripts/wl12xx-scripts-1.0/enable-wifi.sh b/multitech/recipes/wl12xx-scripts/wl12xx-scripts-1.0/enable-wifi.sh
index 2da1e24..bb51bc6 100644
--- a/multitech/recipes/wl12xx-scripts/wl12xx-scripts-1.0/enable-wifi.sh
+++ b/multitech/recipes/wl12xx-scripts/wl12xx-scripts-1.0/enable-wifi.sh
@@ -8,12 +8,19 @@ NVS_OEM_FILE="$OEM_DIR/$NVS_DIR/wl1271-nvs.bin"
NVS_FILE="/lib/firmware/ti-connectivity/wl1271-nvs.bin"
NVS_DEFAULT_FILE="$NVS_FILE.factory"
+# detect mci driver
+if find /lib/modules -name "atmel-mci.ko" | grep -q "atmel-mci"; then
+ MCI_MODULE="atmel_mci"
+else
+ MCI_MODULE="at91_mci"
+fi
+
if [[ $WIFIENABLED == "yes" ]]; then
echo "Wifi: enabling"
# make sure nvs file exists in /var/oem/mts/
if [[ ! -f $NVS_OEM_FILE ]]; then
- echo "copying nvs file to $OEM_DIR"
+ echo "Copying nvs file to $OEM_DIR"
mount -o remount,rw $OEM_DIR
mkdir -p $OEM_DIR/$NVS_DIR
cp $NVS_DEFAULT_FILE $NVS_OEM_FILE
@@ -21,20 +28,22 @@ if [[ $WIFIENABLED == "yes" ]]; then
fi
# make sure nvs file exists in /lib/firmware/ti-connectivity/
- echo "creating $NVS_FILE"
- ln -fs $NVS_OEM_FILE $NVS_FILE
+ if [[ ! -L $NVS_FILE ]]; then
+ echo "Creating $NVS_FILE"
+ ln -fs $NVS_OEM_FILE $NVS_FILE
+ fi
# probe wifi chip
mts-io-sysfs store wlan-enabled 0
usleep 50000
- echo "starting up wifi chip"
+ echo "Enabling wifi chip"
mts-io-sysfs store wlan-enabled 1
sleep 1
- echo "loading atmel_mci driver"
- modprobe atmel_mci
+ echo "Loading $MCI_MODULE driver"
+ modprobe $MCI_MODULE
sleep 3
else
echo "Wifi: disabled"
mts-io-sysfs store wlan-enabled 0
- modprobe atmel_mci
+ modprobe $MCI_MODULE
fi
diff --git a/multitech/recipes/wl12xx-scripts/wl12xx-scripts_1.0.bb b/multitech/recipes/wl12xx-scripts/wl12xx-scripts_1.0.bb
index 98a6797..d43d010 100644
--- a/multitech/recipes/wl12xx-scripts/wl12xx-scripts_1.0.bb
+++ b/multitech/recipes/wl12xx-scripts/wl12xx-scripts_1.0.bb
@@ -2,7 +2,7 @@ DESCRIPTION = "Scripts to enable and calibrate the wifi chip on the OCG"
HOMEPAGE = "http://www.multitech.net/"
LICENSE = "GPL"
-PR = "r3"
+PR = "r4"
inherit update-rc.d