BigW Consortium Gitlab

Commit 74b0d510 by Zahid Chowdhury

Add Legato & DCS integration and update documentation

parent 6f0f2231
...@@ -5,7 +5,8 @@ ...@@ -5,7 +5,8 @@
* Cypress tar-ball based on: https://community.cypress.com/docs/DOC-15932 * Cypress tar-ball based on: https://community.cypress.com/docs/DOC-15932
* The version of the chip used on the MangOH Yellow is from USI which incorporates * The version of the chip used on the MangOH Yellow is from USI which incorporates
both Bluetooth & Wifi in a SIP package. both Bluetooth & Wifi in a SIP package. The Cypress/USI chip is only available
on MangOH Yellow.
* Porting details * Porting details
* We have kept this as a sub-system driver and not integrated with the Legato Kernel * We have kept this as a sub-system driver and not integrated with the Legato Kernel
...@@ -17,7 +18,8 @@ ...@@ -17,7 +18,8 @@
semantic patching for the different kernels on the WP85 & WP76. semantic patching for the different kernels on the WP85 & WP76.
* We have selected wlan1 for the Cypress chip. We cannot use the lowest numbered interface * We have selected wlan1 for the Cypress chip. We cannot use the lowest numbered interface
as the system reference code has assumed the TI Wifi on the IOT card is wlan0 as the system reference code has assumed the TI Wifi on the IOT card is wlan0
Thus, we picked the next interface. Thus, we picked the next interface. This is not ideal as a tie-in to mdev and
device naming should exist.
* Currently, the Cypress chip cannot operate in low-power mode on the WP85. It seems * Currently, the Cypress chip cannot operate in low-power mode on the WP85. It seems
to be some sort of SDIO timing issue that Cypress will be looking at on the to be some sort of SDIO timing issue that Cypress will be looking at on the
...@@ -38,12 +40,42 @@ ...@@ -38,12 +40,42 @@
have the standard firmware search path used. If you have other firmware that needs have the standard firmware search path used. If you have other firmware that needs
to load afterward please beware. to load afterward please beware.
* We have not integrated fully with the Legato Wifi architecture. TODO: need to work on * It seems that to test with Legato one needs to setup a fake acces point such that
the glue code with Legato Patches. one can set the interface to wlan1. Note that MangOH Red has wlan1 used
by the MT7697 Wifi chip which is not present on the MangOH Yellow. AP_REF refers
to the AP reference found from scan. These are the steps:
* Please apply the Legato Patches as mentioned under:
https://github.com/mangOH/mangOH/wiki/mangOH-Red-mt7697-WiFi
* /legato/systems/current/modules/files/brcmutil/etc/init.d/cywifi.sh init
* wifi client create mangOH
* wifi client setinterface 0x10000001 wlan1
* wifi client start
* wifi client setdriver 0x10000001 wnl80211
* wifi client scan
* wifi client setsecurityproto AP_REF 3
* wifi client setpassphrase AP_REF
* wifi client connect AP_REF
* /sbin/udhcpc -R -b -i wlan1
* ping www.google.com
* Testing was done simply with the following commands: * For DCS (Data Connection Service) testing please do the following steps:
* Please apply the Legato Patches as mentioned under:
https://github.com/mangOH/mangOH/wiki/mangOH-Red-mt7697-WiFi
* /legato/systems/current/modules/files/brcmutil/etc/init.d/cywifi.sh init
* config set dataConnectionService:/wifi/SSID "SSID of your WiFi" string
* config set dataConnectionService:/wifi/passphrase "password" string
* config set dataConnectionService:/wifi/interface wlan1 string
* config set dataConnectionService:/wifi/wpaSupplicantDriver wext string
* config set dataConnectionService:/wifi/secProtocol 3 int
* Follow Legato instructions on starting up and configuring DCS.
* ping www.google.com
* Testing outside of Legato was done simply with the following commands (no
Legato Patches are needed):
* /legato/systems/current/modules/files/brcmutil/etc/init.d/cywifi.sh init
* /legato/systems/current/modules/files/brcmutil/etc/init.d/cywifi.sh start * /legato/systems/current/modules/files/brcmutil/etc/init.d/cywifi.sh start
* wpa_passphrase YOUR_SSID >> /etc/wpa_supplicant.conf (this will ask you for a password).
* wpa_supplicant -B -Dnl80211 -iwlan1 -c /etc/wpa_supplicant.conf * wpa_supplicant -B -Dnl80211 -iwlan1 -c /etc/wpa_supplicant.conf
* /sbin/udhcpc -R -b -i wlan1 * /sbin/udhcpc -R -b -i wlan1
* ping www.google.com * ping www.google.com
8
...@@ -5,13 +5,16 @@ export PATH=$PATH:/usr/bin:/bin:/usr/sbin:/sbin ...@@ -5,13 +5,16 @@ export PATH=$PATH:/usr/bin:/bin:/usr/sbin:/sbin
# The Broadcom/Cypress uses the WL_REG_ON gpio to bring out of reset, but # The Broadcom/Cypress uses the WL_REG_ON gpio to bring out of reset, but
# needs 2 sleep cycles after VBAT & VDDIO is applied before it is # needs 2 sleep cycles after VBAT & VDDIO is applied before it is
# turned on. Both the WP76 & 85 are setup to connect GPIO 8 to WL_REG_ON, # turned on. Both the WP76 & 85 are setup to connect GPIO 33 to WL_REG_ON,
# though its configurable on the command-line # though its configurable on the command-line. It seems with the current
if [ -z "$2" ] ; then # way that the GPIO expander is being initialized this is not needed, nor
WL_REG_ON_GPIO=8 # does the routing need to be setup for SDIO going to the Cypress chip
else # rather than the SD card. The SD card was supposed to be the default.
WL_REG_ON_GPIO=$2 #if [ -z "$2" ] ; then
fi #WL_REG_ON_GPIO=8
#else
#WL_REG_ON_GPIO=$2
#fi
# The WP76 series has an SDHCI-MSM driver that has been setup to run in polled # The WP76 series has an SDHCI-MSM driver that has been setup to run in polled
# mode. Whereas, the WP85 has an MSM-SDCC driver that has been setup to run in # mode. Whereas, the WP85 has an MSM-SDCC driver that has been setup to run in
...@@ -32,11 +35,19 @@ if [ -z "${CF3}" ] ; then ...@@ -32,11 +35,19 @@ if [ -z "${CF3}" ] ; then
exit 1 exit 1
fi fi
# Need the the init separately as the default cfg80211 from the Reference code
# (kernel, yocto) loads a different cfg80211 than the Broadcom/Cypress cfg80211
# Thus, with Legato it causes the default one to load and the FMAC driver load
# fails.
cy_wifi_init () {
insmod /legato/systems/current/modules/compat.ko
insmod /legato/systems/current/modules/cfg80211.ko
}
cy_wifi_start() { cy_wifi_start() {
# Let's bring the Cypress chip out of reset # Let's bring the Cypress chip out of reset - see Note above not needing now
echo ${WL_REG_ON_GPIO} > /sys/class/gpio/export #echo ${WL_REG_ON_GPIO} > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio${WL_REG_ON_GPIO}/direction #echo out > /sys/class/gpio/gpio${WL_REG_ON_GPIO}/direction
echo 1 > /sys/class/gpio/gpio${WL_REG_ON_GPIO}/value #echo 1 > /sys/class/gpio/gpio${WL_REG_ON_GPIO}/value
if [ "${CF3}" = "mdm9x15" ] ; then if [ "${CF3}" = "mdm9x15" ] ; then
rmmod msm_sdcc rmmod msm_sdcc
...@@ -46,13 +57,13 @@ cy_wifi_start() { ...@@ -46,13 +57,13 @@ cy_wifi_start() {
# Let's make sure the Cypress chip got attached by the Kernel's MMC framework # Let's make sure the Cypress chip got attached by the Kernel's MMC framework
# Bug here if dmesg has overflowed - for now we are removing the code below # Bug here if dmesg has overflowed - for now we are removing the code below
# as we will assume MMC enumeration happened. Need a better way to error check # as we will assume MMC enumeration happened. Need a better way to error check
# as the driver on the WP76 continuously polls CIS tuples ad-infintum and messes up the log # as the driver on the WP76 continuously polls CIS tuples ad-infinitum and messes up the log
#sleep 3 #sleep 3
#dmesg | grep "new high speed SDIO card" dmesg | grep "new high speed SDIO card" > /dev/null 2>&1
#if [ $? -ne 0 ] ; then if [ $? -ne 0 ] ; then
#echo "Cypress chip not recognized across MMC/SDIO bus" echo "Cypress chip MMC recognition may have been overwritten"
#exit 2 #exit 2
#fi fi
# We need to get this into the reference software or the product branch ASAP # We need to get this into the reference software or the product branch ASAP
# and remove this temp. workaround, should be /lib/firmware - TODO # and remove this temp. workaround, should be /lib/firmware - TODO
...@@ -68,11 +79,9 @@ cy_wifi_start() { ...@@ -68,11 +79,9 @@ cy_wifi_start() {
#echo 8 > /proc/sys/kernel/printk #echo 8 > /proc/sys/kernel/printk
# load the drivers # load the drivers
insmod `find /legato/systems/current/modules/ -name "*compat.ko"` insmod /legato/systems/current/modules/brcmutil.ko
insmod `find /legato/systems/current/modules/ -name "*cfg80211.ko"` insmod /legato/systems/current/modules/brcmfmac.ko
insmod `find /legato/systems/current/modules/ -name "*brcmutil.ko"`
insmod `find /legato/systems/current/modules/ -name "*brcmfmac.ko"`
# The following bit vector tells the FMAC chip controller debug options # The following bit vector tells the FMAC chip controller debug options
#insmod ${load_module:-brcmfmac.ko} debug=0x100000 #insmod ${load_module:-brcmfmac.ko} debug=0x100000
#insmod ${load_module:-brcmfmac.ko} debug=0x105404 #insmod ${load_module:-brcmfmac.ko} debug=0x105404
...@@ -99,15 +108,18 @@ cy_wifi_stop() { ...@@ -99,15 +108,18 @@ cy_wifi_stop() {
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
ifconfig wlan1 down ifconfig wlan1 down
fi fi
rmmod `find /legato/systems/current/modules/ -name "*brcmfmac.ko"` || exit 127 rmmod /legato/systems/current/modules/brcmfmac.ko || exit 127
rmmod `find /legato/systems/current/modules/ -name "*brcmutil.ko"` || exit 127 rmmod /legato/systems/current/modules/brcmutil.ko || exit 127
rmmod `find /legato/systems/current/modules/ -name "*cfg80211.ko"` || exit 127 rmmod /legato/systems/current/modules/cfg80211.ko || exit 127
rmmod `find /legato/systems/current/modules/ -name "*compat.ko"` || exit 127 rmmod /legato/systems/current/modules/compat.ko || exit 127
# Turn off the Cypress chip # Turn off the Cypress chip
echo 0 > /sys/class/gpio/gpio${WL_REG_ON_GPIO}/value #echo 0 > /sys/class/gpio/gpio${WL_REG_ON_GPIO}/value
} }
case "$1" in case "$1" in
init)
cy_wifi_init
;;
start) start)
cy_wifi_start cy_wifi_start
;; ;;
...@@ -116,6 +128,7 @@ case "$1" in ...@@ -116,6 +128,7 @@ case "$1" in
;; ;;
restart) restart)
cy_wifi_stop cy_wifi_stop
cy_wifi_init
cy_wifi_start cy_wifi_start
;; ;;
*) *)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment