Changes between Version 11 and Version 12 of expansion/gw16146


Ignore:
Timestamp:
11/01/2021 07:30:04 PM (3 years ago)
Author:
Cale Collins
Comment:

commands to execute were commented out, output is left uncommented. This was totally backwards, I corrected it so the commands can be coppied and pasted

Legend:

Unmodified
Added
Removed
Modified
  • expansion/gw16146

    v11 v12  
    205205 * show spi master controllers
    206206{{{#!bash
    207 # ls /sys/class/spi_master/
    208 spi1  spi3
     207ls /sys/class/spi_master/
     208# spi1  spi3
    209209}}}
    210210 * show drivers providing each master:
    211211{{{#!bash
    212 # 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
     212ls -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
     217for 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
    220220}}}
    221221 * find spi master bound to spi-ft232h:
    222222{{{#!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; done
    224 spi3
     223for 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
    225225}}}
    226226 * assign the bus number of the first spi-ft232h bus to a var:
    227227{{{#!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 $BUSNO
    230 3
     228BUSNO=$(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)
     229echo $BUSNO
     230#3
    231231}}}
    232232
     
    254254You must determine the SPI bus at runtime which can be done via:
    255255{{{#!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 $BUSNO
     256BUSNO=$(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)
     257echo $BUSNO
    258258}}}
    259259
    260260Now the module can be loaded as such:
    261261{{{#!bash
    262 # modprobe nrc fw_name=nrc7292_cspi.bin bd_name=nrc7292_bd.dat spi_bus_num=$BUSNO spi_polling_interval=5 hifspeed=30000000
     262modprobe nrc fw_name=nrc7292_cspi.bin bd_name=nrc7292_bd.dat spi_bus_num=$BUSNO spi_polling_interval=5 hifspeed=30000000
    263263}}}
    264264
    265265After 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:
    266266{{{#!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 $WLAN
     267WLAN="$(for i in $(ls -d /sys/class/net/wlan* 2>/dev/null); do if [ "$(basename $(readlink $i/device))" == "nrc80211" ]; then basename $i; fi; done)"
     268echo $WLAN
    269269wlan0
    270270}}}