Open main menu

DAVE Developer's Wiki β

Changes

DESK-MX8M-L/Peripherals/WiFI

2,656 bytes added, 8 April
no edit summary
==Peripheral WiFi==
=== Device For device-tree configuration ===, please take a look to [[DESK-MX8M-L/Peripherals/PCI_express | PCIe]] page for DESK-MX8M-L
Here below an example of device tree configuration used on standard DAVE's kit for ===Accessing the MITO 8M Mini:peripheral === ====Linux messages at boot time====
From <code>imx8mm-mito8mmini.dts</code>Check that AzureWave driver for PCIe was initialized:
<preclass="workstation-terminal">
...
...
[ 6.519674] mwifiex_pcie 0000:01:00.0: no quirks enabled
[ 6.525230] mwifiex_pcie 0000:01:00.0: enabling device (0000 -> 0002)
[ 6.593357] mwifiex_pcie: PCI memory map Virt0: (____ptrval____) PCI memory map Virt2: (____ptrval____)
...
pcie0_refclk[ 7.638822] mwifiex_pcie 0000: pcie0-refclk { compatible = "fixed-clock"; #clock-cells = <01:00.0>; clock-frequency = <100000000>; };: info: FW download over, size 632240 bytes
...
[ 8.509865] mwifiex_pcie 0000:01:00.0: WLAN FW is active
[ 8.562243] mwifiex_pcie 0000:01:00.0: info: MWIFIEX VERSION: mwifiex 1.0 (16.68.1.p179)
[ 8.570473] mwifiex_pcie 0000:01:00.0: driver_version = mwifiex 1.0 (16.68.1.p179)
...
regulators {
...
reg_pcie_pwr: pcie_pwr {</pre> Check that AzureWave connected to the PCIe  compatible <pre class= "regulatorworkstation-fixedterminal";> regulatorroot@desk-name = "PCIe_PWREN";mx8mm:~# lspci00:00.0 PCI bridge: Synopsys, Inc. DWC_usb3 / PCIe bridge (rev 01)01:00.0 Ethernet controller: Marvell Technology Group Ltd. Device 2b42 (rev 11) regulatorroot@desk-min-microvolt = mx8mm:~#<3300000/pre>; regulator-max-microvolt ====Setup for static connection==== <3300000>; regulator-always-on; gpio Check that interface was recognize correctly <pre class= <&gpio2 20 GPIO_ACTIVE_HIGH"workstation-terminal">; enableroot@desk-activemx8mm:~# ifconfig -high; };a
...
...
&pcie0 { pinctrl-names mlan0: flags= "default";4098<BROADCAST,MULTICAST> mtu 1500 ether e8:fb:1c:e1:80:65 txqueuelen 1000 (Ethernet) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 0 bytes 0 (0.0 B) pinctrl- TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 = <&pinctrl_pcie0>; disable-gpio = <&gpio5 20 GPIO_ACTIVE_LOW/pre>; reset-gpio = <&gpio5 21 GPIO_ACTIVE_LOW>; wake-gpio = Setup your <&gpio3 20 GPIO_ACTIVE_HIGHcode>; clocks = wpa_supplicant.conf<&clk IMX8MM_CLK_PCIE1_ROOT/code>,configuration file for handle WiFi connection <&clk IMX8MM_CLK_PCIE1_AUX>, <&clk IMX8MM_CLK_PCIE1_PHYpre class="workstation-terminal">, <&pcie0_refclkroot@desk-mx8mm:~# echo 'network={' >;/tmp/wpa_supplicant.conf clockroot@desk-names mx8mm:~# echo ' ssid= "pcieZyXEL", "pcie_aux", "pcie_phy", "pcie_bus";' >> /tmp/wpa_supplicant.conf assignedroot@desk-clocks mx8mm:~# echo ' key_mgmt= <&clk IMX8MM_CLK_PCIE1_AUXNONE' >>,/tmp/wpa_supplicant.conf <&clk IMX8MM_CLK_PCIE1_PHYroot@desk-mx8mm:~# echo '}' >, <&clk IMX8MM_CLK_PCIE1_CTRL>;/tmp/wpa_supplicant.conf assignedroot@desk-clock-rates mx8mm:~# cat /tmp/wpa_supplicant.confnetwork={ ssid= <10000000>, <100000000>, <250000000>;"ZyXEL" assigned-clock-parents key_mgmt= NONE}<&clk IMX8MM_SYS_PLL2_50M/pre>, Apply your <&clk IMX8MM_SYS_PLL2_100Mcode>, wpa_supplicant.conf<&clk IMX8MM_SYS_PLL2_250M/code>;configuration file  ext_osc = <0>; status pre class= "okayworkstation-terminal";>};root@desk-mx8mm:~# wpa_supplicant -i mlan0 -c /tmp/wpa_supplicant.conf -BSuccessfully initialized wpa_supplicant
...
root@desk-mx8mm:~#</pre> Add network ip address <pre class="workstation-terminal">root@desk-mx8mm:~# ip addr add 192.168.11.165/255.255.255.0 dev mlan0</pre> Ping to local gateway&iomuxc {<pre class="workstation-terminal">root@desk-mx8mm:~# ping 192.168.11.243 -c 4PING 192.168.11.243 (192.168.11.243) 56(84) bytes of data. pinctrl_pcie064 bytes from 192.168.11.243: pcie0grp {icmp_seq=1 ttl=64 time=2.93 ms fsl64 bytes from 192.168.11.243: icmp_seq=2 ttl=64 time=2.96 ms64 bytes from 192.168.11.243: icmp_seq=3 ttl=64 time=1.97 ms64 bytes from 192.168.11.243: icmp_seq=4 ttl=64 time=2.77 ms --- 192.168.11.243 ping statistics ---4 packets transmitted, 4 received, 0% packet loss,pins time 3005msrtt min/avg/max/mdev = 1.969/2.657/2.962/0.404 msroot@desk-mx8mm:~#</pre> MX8MM_IOMUXC_I2C4_SCL_GPIO5_IO20 0x19 MX8MM_IOMUXC_I2C4_SDA_GPIO5_IO21 0x19 MX8MM_IOMUXC_SD2_WP_GPIO2_IO20 0x19====Setup for DHCP connection==== MX8MM_IOMUXC_SAI5_RXC_GPIO3_IO20 0x19 Check that interface was recognize correctly <pre class="workstation-terminal">; };root@desk-mx8mm:~# ifconfig -a
...
...
 
mlan0: flags=4098<BROADCAST,MULTICAST> mtu 1500
ether e8:fb:1c:e1:80:65 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
</pre>
 
Add network configuration for Systemd
 
<pre class="workstation-terminal">
root@desk-mx8mm:~# cat /etc/systemd/network/21-mlan0.network
[Match]
Name=mlan0
 
# Prevent the interface loading if the kernel boots from nfs
KernelCommandLine=!nfsroot
 
[Network]
DHCP=yes
</pre>
===Accessing the peripheral ===Setup your <code>wpa_supplicant.conf</code> configuration file for handle WiFi connection
<pre class="workstation-terminal">root@desk-mx8mm:~# echo 'network={' > /tmp/wpa_supplicant.confroot@desk-mx8mm:~# echo ' ssid="daveguest"' >> /tmp/wpa_supplicant.confroot@desk-mx8mm:~# echo ' psk=Linux messages at boot time="******"' >> /tmp/wpa_supplicant.confroot@desk-mx8mm:~# echo '}' >> /tmp/wpa_supplicant.confroot@desk-mx8mm:~# cat /tmp/wpa_supplicant.confnetwork={ ssid="daveguest" psk="******"}</pre>
PCIe driver initialized:Apply your <code>wpa_supplicant.conf</code> configuration file
<pre class="workstation-terminal">
root@desk-mx8mm:~# wpa_supplicant -i mlan0 -c /tmp/wpa_supplicant.conf -B
Successfully initialized wpa_supplicant
...
... [ 1 131.131579877506] ehci-pciieee80211 phy0: mwifiex_cfg80211_sched_scan_start : EHCI PCI platform driverInvalid Sched_scan parameters[ 1.147680] ohciroot@desk-pcimx8mm: OHCI PCI platform driver ~# [ 3 134.234024728825] imx6q-pcie 33800000mwifiex_pcie 0000:01:00.pcie0: info: supply epdev_on not found, using dummy regulator[ 3.242348] imx6q-pcie 33800000.pcietrying to associate to bssid d0:21: PLL REF_CLK is used!. [ 3.276463] imx6q-pcie 33800000.pcief9: PCIe PLL is locked. [ 3.284714] imx6q-pcie 33800000.pcie35: iATU unroll87: enabled e8[ 3 134.295015754118] imx6q-pcie 33800000.pciemwifiex_pcie 0000: Detected iATU regions01: 4 outbound, 4 inbound[ 300.309648] imx6q-pcie 33800000.pcie0: info: host bridge /soc@0/pcie@33800000 rangesassociated to bssid d0:[ 3.316925] imx6q-pcie 33800000.pcie21: IO 0x001ff80000..0x001ff8ffff -> 0x0000000000[ 3.330476] imx6q-pcie 33800000.pcief9: MEM 0x0018000000..0x001fefffff -> 0x0018000000[ 3.342505] imx6q-pcie 33800000.pcie35: iATU unroll87: enabled e8 successfully[ 3 134.351821778115] imx6q-pcie 33800000.pcieIPv6: Detected iATU regionsADDRCONF(NETDEV_CHANGE): 4 outbound, 4 inbound[ 3.444200] imx6q-pcie 33800000.pciemlan0: Link up......link becomes ready
</pre>
Check which are the devices connected Ping to the PCIe<code>www.dave.eu</code>
<pre class="workstation-terminal">
root@desk-mx8mm:~# lspciln -sf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf00root@desk-mx8mm:00~# systemctl restart systemd-resolvedroot@desk-mx8mm:~# ping www.dave.eu -c 4PING www.dave.eu (51.91.120.202) 56(84) bytes of data.64 bytes from 202.ip-51-91-120.0 PCI bridgeeu (51.91.120.202): Synopsys, Incicmp_seq=1 ttl=48 time=332 ms64 bytes from 202.ip-51-91-120. DWC_usb3 / PCIe bridge eu (rev 0151.91.120.202): icmp_seq=2 ttl=48 time=254 ms0164 bytes from 202.ip-51-91-120.eu (51.91.120.202):00icmp_seq=3 ttl=48 time=174 ms64 bytes from 202.0 Network controller: Intel Corporation Wireless 7260 ip-51-91-120.eu (rev bb51.91.120.202): icmp_seq=4 ttl=48 time=94.2 ms --- www.dave.eu ping statistics ---4 packets transmitted, 4 received, 0% packet loss, time 3004msrtt min/avg/max/mdev = 94.197/213.585/332.136/88.720 ms
root@desk-mx8mm:~#
</pre>
dave_user
417
edits