Changes between Version 11 and Version 12 of expansion/gw16146
- Timestamp:
- 11/01/2021 07:30:04 PM (3 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
expansion/gw16146
v11 v12 205 205 * show spi master controllers 206 206 {{{#!bash 207 #ls /sys/class/spi_master/208 spi1 spi3207 ls /sys/class/spi_master/ 208 # spi1 spi3 209 209 }}} 210 210 * show drivers providing each master: 211 211 {{{#!bash 212 #ls -l /sys/class/spi_master/213 total 0214 lrwxrwxrwx 1 root root 0 Aug 27 17:59 spi1 -> ../../devices/platform/soc@0/soc@0:bus@30800000/30830000.spi/spi_master/spi1215 lrwxrwxrwx 1 root root 0 Aug 27 17:59 spi3 -> ../../devices/platform/soc@0/soc@0:bus@32c00000/32e50000.usb/ci_hdrc.1/usb2/2-1/2-1.3/2-1.3:1.0/spi-ft232h.0/spi_master/spi3216 217 #for i in $(ls /sys/class/spi_master/); do echo $i:$(basename $(readlink /sys/class/spi_master/$i/device)); done218 spi1:30830000.spi219 spi3:spi-ft232h.0212 ls -l /sys/class/spi_master/ 213 #total 0 214 #lrwxrwxrwx 1 root root 0 Aug 27 17:59 spi1 -> ../../devices/platform/soc@0/soc@0:bus@30800000/30830000.spi/spi_master/spi1 215 #lrwxrwxrwx 1 root root 0 Aug 27 17:59 spi3 -> ../../devices/platform/soc@0/soc@0:bus@32c00000/32e50000.usb/ci_hdrc.1/usb2/2-1/2-1.3/2-1.3:1.0/spi-ft232h.0/spi_master/spi3 216 217 for i in $(ls /sys/class/spi_master/); do echo $i:$(basename $(readlink /sys/class/spi_master/$i/device)); done 218 # spi1:30830000.spi 219 # spi3:spi-ft232h.0 220 220 }}} 221 221 * find spi master bound to spi-ft232h: 222 222 {{{#!bash 223 #for i in $(ls /sys/class/spi_master/); do if [ "$(basename $(readlink /sys/class/spi_master/$i/device))" == "spi-ft232h.0" ]; then echo $i; fi; done224 spi3223 for i in $(ls /sys/class/spi_master/); do if [ "$(basename $(readlink /sys/class/spi_master/$i/device))" == "spi-ft232h.0" ]; then echo $i; fi; done 224 # spi3 225 225 }}} 226 226 * assign the bus number of the first spi-ft232h bus to a var: 227 227 {{{#!bash 228 #BUSNO=$(for i in $(ls /sys/class/spi_master/); do if [ "$(basename $(readlink /sys/class/spi_master/$i/device))" == "spi-ft232h.0" ]; then echo $i | sed 's/[^0-9]*//g'; fi; done)229 #echo $BUSNO230 3228 BUSNO=$(for i in $(ls /sys/class/spi_master/); do if [ "$(basename $(readlink /sys/class/spi_master/$i/device))" == "spi-ft232h.0" ]; then echo $i | sed 's/[^0-9]*//g'; fi; done) 229 echo $BUSNO 230 #3 231 231 }}} 232 232 … … 254 254 You must determine the SPI bus at runtime which can be done via: 255 255 {{{#!bash 256 #BUSNO=$(for i in $(ls /sys/class/spi_master/); do if [ "$(basename $(readlink /sys/class/spi_master/$i/device))" == "spi-ft232h.0" ]; then echo $i | sed 's/[^0-9]*//g'; fi; done)257 #echo $BUSNO256 BUSNO=$(for i in $(ls /sys/class/spi_master/); do if [ "$(basename $(readlink /sys/class/spi_master/$i/device))" == "spi-ft232h.0" ]; then echo $i | sed 's/[^0-9]*//g'; fi; done) 257 echo $BUSNO 258 258 }}} 259 259 260 260 Now the module can be loaded as such: 261 261 {{{#!bash 262 #modprobe nrc fw_name=nrc7292_cspi.bin bd_name=nrc7292_bd.dat spi_bus_num=$BUSNO spi_polling_interval=5 hifspeed=30000000262 modprobe nrc fw_name=nrc7292_cspi.bin bd_name=nrc7292_bd.dat spi_bus_num=$BUSNO spi_polling_interval=5 hifspeed=30000000 263 263 }}} 264 264 265 265 After several seconds due to the timing of firmware loading you should see a new wlan device under /sys/class/net. To find the correct wlan interface that is bound to the NRC7292 driver: 266 266 {{{#!bash 267 #WLAN="$(for i in $(ls -d /sys/class/net/wlan* 2>/dev/null); do if [ "$(basename $(readlink $i/device))" == "nrc80211" ]; then basename $i; fi; done)"268 #echo $WLAN267 WLAN="$(for i in $(ls -d /sys/class/net/wlan* 2>/dev/null); do if [ "$(basename $(readlink $i/device))" == "nrc80211" ]; then basename $i; fi; done)" 268 echo $WLAN 269 269 wlan0 270 270 }}}