BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mangoh-drivers
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
mangoh-drivers
Commits
74b0d510
Commit
74b0d510
authored
Dec 11, 2018
by
Zahid Chowdhury
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Legato & DCS integration and update documentation
parent
6f0f2231
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
76 additions
and
31 deletions
+76
-31
README.md
linux_kernel_modules/cypwifi/README.md
+38
-6
cywifi.sh
linux_kernel_modules/cypwifi/scripts/cywifi.sh
+38
-25
No files found.
linux_kernel_modules/cypwifi/README.md
View file @
74b0d510
...
...
@@ -5,7 +5,8 @@
*
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
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
*
We have kept this as a sub-system driver and not integrated with the Legato Kernel
...
...
@@ -17,7 +18,8 @@
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
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
to be some sort of SDIO timing issue that Cypress will be looking at on the
...
...
@@ -38,12 +40,42 @@
have the standard firmware search path used. If you have other firmware that needs
to load afterward please beware.
*
We have not integrated fully with the Legato Wifi architecture. TODO: need to work on
the glue code with Legato Patches.
*
It seems that to test with Legato one needs to setup a fake acces point such that
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
*
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
*
/sbin/udhcpc -R -b -i wlan1
*
ping www.google.com
8
linux_kernel_modules/cypwifi/scripts/cywifi.sh
View file @
74b0d510
...
...
@@ -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
# 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,
# though its configurable on the command-line
if
[
-z
"
$2
"
]
;
then
WL_REG_ON_GPIO
=
8
else
WL_REG_ON_GPIO
=
$2
fi
# turned on. Both the WP76 & 85 are setup to connect GPIO 33 to WL_REG_ON,
# though its configurable on the command-line. It seems with the current
# way that the GPIO expander is being initialized this is not needed, nor
# does the routing need to be setup for SDIO going to the Cypress chip
# rather than the SD card. The SD card was supposed to be the default.
#if [ -z "$2" ] ; then
#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
# mode. Whereas, the WP85 has an MSM-SDCC driver that has been setup to run in
...
...
@@ -32,11 +35,19 @@ if [ -z "${CF3}" ] ; then
exit
1
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
()
{
# Let's bring the Cypress chip out of reset
echo
${
WL_REG_ON_GPIO
}
>
/sys/class/gpio/export
echo
out
>
/sys/class/gpio/gpio
${
WL_REG_ON_GPIO
}
/direction
echo
1
>
/sys/class/gpio/gpio
${
WL_REG_ON_GPIO
}
/value
# 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 out > /sys/class/gpio/gpio${WL_REG_ON_GPIO}/direction
#
echo 1 > /sys/class/gpio/gpio${WL_REG_ON_GPIO}/value
if
[
"
${
CF3
}
"
=
"mdm9x15"
]
;
then
rmmod msm_sdcc
...
...
@@ -46,13 +57,13 @@ cy_wifi_start() {
# 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
# 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-infin
i
tum and messes up the log
#sleep 3
#dmesg | grep "new high speed SDIO card"
#
if [ $? -ne 0 ] ; then
#echo "Cypress chip not recognized across MMC/SDIO bus
"
dmesg |
grep
"new high speed SDIO card"
>
/dev/null 2>&1
if
[
$?
-ne
0
]
;
then
echo
"Cypress chip MMC recognition may have been overwritten
"
#exit 2
#
fi
fi
# We need to get this into the reference software or the product branch ASAP
# and remove this temp. workaround, should be /lib/firmware - TODO
...
...
@@ -68,11 +79,9 @@ cy_wifi_start() {
#echo 8 > /proc/sys/kernel/printk
# load the drivers
insmod
`
find /legato/systems/current/modules/
-name
"*compat.ko"
`
insmod
`
find /legato/systems/current/modules/
-name
"*cfg80211.ko"
`
insmod
`
find /legato/systems/current/modules/
-name
"*brcmutil.ko"
`
insmod /legato/systems/current/modules/brcmutil.ko
insmod /legato/systems/current/modules/brcmfmac.ko
insmod
`
find /legato/systems/current/modules/
-name
"*brcmfmac.ko"
`
# The following bit vector tells the FMAC chip controller debug options
#insmod ${load_module:-brcmfmac.ko} debug=0x100000
#insmod ${load_module:-brcmfmac.ko} debug=0x105404
...
...
@@ -99,15 +108,18 @@ cy_wifi_stop() {
if
[
$?
-eq
0
]
;
then
ifconfig wlan1 down
fi
rmmod
`
find /legato/systems/current/modules/
-name
"*brcmfmac.ko"
`
||
exit
127
rmmod
`
find /legato/systems/current/modules/
-name
"*brcmutil.ko"
`
||
exit
127
rmmod
`
find /legato/systems/current/modules/
-name
"*cfg80211.ko"
`
||
exit
127
rmmod
`
find /legato/systems/current/modules/
-name
"*compat.ko"
`
||
exit
127
rmmod
/legato/systems/current/modules/brcmfmac.ko
||
exit
127
rmmod
/legato/systems/current/modules/brcmutil.ko
||
exit
127
rmmod
/legato/systems/current/modules/cfg80211.ko
||
exit
127
rmmod
/legato/systems/current/modules/compat.ko
||
exit
127
# 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
init
)
cy_wifi_init
;;
start
)
cy_wifi_start
;;
...
...
@@ -116,6 +128,7 @@ case "$1" in
;;
restart
)
cy_wifi_stop
cy_wifi_init
cy_wifi_start
;;
*
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment