DESK-MX8M-L/Peripherals/WiFI

From DAVE Developer's Wiki
Jump to: navigation, search
History
Issue Date Notes

2024/04/08

DESK-MX8M-L-4.1.0 release

2024/05/31

DESK-MX8M-L-4.1.0 release
2025/01/30 DESK-MX8M-L-4.2.1 release


Peripheral WiFi[edit | edit source]

Device tree configuration[edit | edit source]

ORCA SOM[edit | edit source]

Here below an example of device tree configuration used on standard DAVE's kit for the ORCA SOM:

From imx8mp-mito8mplus-cb1001.dts:

/ {
...
	usdhc1_pwrseq: usdhc1_pwrseq {
		compatible = "mmc-pwrseq-simple";
		reset-gpios = <&gpio2 8 GPIO_ACTIVE_LOW>;
	};
...
};

...
...

/* AW-CM276MA SDIOUART */
&usdhc1 {
	pinctrl-names = "default", "state_100mhz", "state_200mhz";
	pinctrl-0 = <&pinctrl_usdhc1>;
	pinctrl-1 = <&pinctrl_usdhc1_100mhz>;
	pinctrl-2 = <&pinctrl_usdhc1_200mhz>;
	keep-power-in-suspend;
	non-removable;
	wakeup-source;
	mmc-pwrseq = <&usdhc1_pwrseq>;
	fsl,sdio-async-interrupt-enabled;
	no-1-8-v;
	max-frequency = <24000000>;
	status = "okay";
};

and from imx8mp-mito8mplus.dtsi:

	pinctrl_usdhc1: usdhc1grp {
		fsl,pins = <
			MX8MP_IOMUXC_SD1_CLK__USDHC1_CLK	0x190
			MX8MP_IOMUXC_SD1_CMD__USDHC1_CMD	0x1d0
			MX8MP_IOMUXC_SD1_DATA0__USDHC1_DATA0	0x1d0
			MX8MP_IOMUXC_SD1_DATA1__USDHC1_DATA1	0x1d0
			MX8MP_IOMUXC_SD1_DATA2__USDHC1_DATA2	0x1d0
			MX8MP_IOMUXC_SD1_DATA3__USDHC1_DATA3	0x1d0
                        MX8MP_IOMUXC_SD1_DATA6__GPIO2_IO08	0x10
		>;
	};

	pinctrl_usdhc1_100mhz: usdhc1grp-100mhz {
		fsl,pins = <
			MX8MP_IOMUXC_SD1_CLK__USDHC1_CLK	0x194
			MX8MP_IOMUXC_SD1_CMD__USDHC1_CMD	0x1d4
			MX8MP_IOMUXC_SD1_DATA0__USDHC1_DATA0	0x1d4
			MX8MP_IOMUXC_SD1_DATA1__USDHC1_DATA1	0x1d4
			MX8MP_IOMUXC_SD1_DATA2__USDHC1_DATA2	0x1d4
			MX8MP_IOMUXC_SD1_DATA3__USDHC1_DATA3	0x1d4
                        MX8MP_IOMUXC_SD1_DATA6__GPIO2_IO08	0x10
		>;
	};

	pinctrl_usdhc1_200mhz: usdhc1grp-200mhz {
		fsl,pins = <
			MX8MP_IOMUXC_SD1_CLK__USDHC1_CLK	0x196
			MX8MP_IOMUXC_SD1_CMD__USDHC1_CMD	0x1d6
			MX8MP_IOMUXC_SD1_DATA0__USDHC1_DATA0	0x1d6
			MX8MP_IOMUXC_SD1_DATA1__USDHC1_DATA1	0x1d6
			MX8MP_IOMUXC_SD1_DATA2__USDHC1_DATA2	0x1d6
			MX8MP_IOMUXC_SD1_DATA3__USDHC1_DATA3	0x1d6
                        MX8MP_IOMUXC_SD1_DATA6__GPIO2_IO08	0x10
		>;
	};

MITO 8M Mini[edit | edit source]

For device-tree configuration, please take a look to PCIe page for DESK-MX8M-L

Accessing the peripheral SBC ORCA[edit | edit source]

Linux messages at boot time[edit | edit source]

Load AzureWave driver

...
...                                                                                  
root@desk-mx8mp:~# modprobe moal mod_para=nxp/wifi_mod_para.conf
[   29.113964] wlan: Loading MWLAN driver
[   29.118613] wlan: Register to Bus Driver...
[   29.128076] vendor=0x02DF device=0x9141 class=0 function=1
[   29.133656] Attach moal handle ops, card interface type: 0x104
[   29.141637] SD8997: init module param from usr cfg
[   29.146457] card_type: SD8997, config block: 0
[   29.150946] cfg80211_wext=0xf
[   29.153929] max_vir_bss=1
[   29.156563] cal_data_cfg=none
[   29.159530] ps_mode = 1
[   29.161986] auto_ds = 1
[   29.164447] host_mlme=enable
[   29.167330] fw_name=nxp/sdiouart8997_combo_v4.bin
[   29.172077] SDIO: max_segs=128 max_seg_size=65535
[   29.176800] rx_work=1 cpu_num=4
[   29.179973] Attach mlan adapter operations.card_type is 0x104.
[   29.186198] wlan: Enable TX SG mode
[   29.189713] wlan: Enable RX SG mode
[   29.200374] Request firmware: nxp/sdiouart8997_combo_v4.bin
[   30.177507] Wlan: FW download over, firmwarelen=594556 downloaded 594556
[   30.888915] WLAN FW is active
[   30.891897] on_time is 30751963125
[   30.923386] fw_cap_info=0x187c7fa3, dev_cap_mask=0xffffffff
[   30.928999] max_p2p_conn = 8, max_sta_conn = 8
[   30.950120] Register NXP 802.11 Adapter mlan0
[   30.954748] wlan: uap%d set max_mtu 2000
[   30.960330] Register NXP 802.11 Adapter uap0
[   30.967481] Register NXP 802.11 Adapter wfd0
[   30.971983] wlan: version = SD8997----16.92.21.p55.3-MM5X16366.p5-GPL-(FP92)
[   30.984959] wlan: Register to Bus Driver Done
[   30.989428] wlan: Driver loaded successfully
...
...

Setup for static connection[edit | edit source]

Check that the interface is properly intialized:

root@desk-mx8mp:~# ifconfig mlan0
mlan0: flags=4098<BROADCAST,MULTICAST>  mtu 1500
        ether 48:e7:da:78:33:6b  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

Setup the wpa_supplicant.conf configuration file for handling the WiFi connection, for example:

root@desk-mx8mp:~# cat /etc/wpa_supplicant.conf
network={
    ssid="ZyXEL"
    key_mgmt=NONE
}

Apply the wpa_supplicant.conf configuration file manually starting the wpa_supplicant:

root@desk-mx8mp:~# wpa_supplicant -i mlan0 -c /etc/wpa_supplicant.conf -B
Successfully initialized wpa_supplicant
root@desk-mx8mp:~# [  102.732838] wlan: mlan0 START SCAN
[  107.685985] wlan: SCAN COMPLETED: scanned AP count=5
[  107.694267] wlan: HostMlme mlan0 send auth to bssid fc:XX:XX:XX:03:90
[  107.929571] mlan0:
[  107.929585] wlan: HostMlme Auth received from fc:XX:XX:XX:03:90
[  108.101873] wlan: HostMlme mlan0 Connected to bssid fc:XX:XX:XX:03:90 successfully
[  108.110851] IPv6: ADDRCONF(NETDEV_CHANGE): mlan0: link becomes ready
Successfully initialized wpa_supplicant
...

Add the mlan0 IP address:

root@desk-mx8mp:~# ip addr add 192.168.11.89/255.255.255.0 dev mlan0

Then the network access is enabled:

root@desk-mx8mp:~# ping 192.168.11.243 -c 4
PING 192.168.11.243 (192.168.11.243) 56(84) bytes of data.
64 bytes from 192.168.11.243: icmp_seq=1 ttl=64 time=108 ms
64 bytes from 192.168.11.243: icmp_seq=2 ttl=64 time=23.3 ms
64 bytes from 192.168.11.243: icmp_seq=3 ttl=64 time=80.4 ms
64 bytes from 192.168.11.243: icmp_seq=4 ttl=64 time=31.9 ms

--- 192.168.11.243 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3005ms
rtt min/avg/max/mdev = 23.333/60.832/107.753/34.737 ms
root@desk-mx8mp:~#

Setup for DHCP connection[edit | edit source]

Check that the interface is properly recognized:

root@desk-mx8mp:~# ifconfig mlan0
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

Add the network configuration for systemd-networkd

root@desk-mx8mp:~# 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

Setup your wpa_supplicant.conf configuration file for handle WiFi connection:

root@desk-mx8mp:~# cat /etc/wpa_supplicant.conf
network={
        ssid="daveguest"
        psk="******"
}

Reboot the system and manually start the wpa_supplicant using the mlan0 interface and the wpa_supplicant.conf configuration file:

Successfully initialized wpa_supplicant
root@desk-mx8mp:~# [   37.959411] wlan: mlan0 START SCAN
[   43.231759] wlan: SCAN COMPLETED: scanned AP count=5
[   43.246886] wlan: HostMlme mlan0 send auth to bssid d0:XX:XX:XX:87:e8
[   43.257254] mlan0:
[   43.257264] wlan: HostMlme Auth received from d0:XX:XX:XX:87:e8
[   43.280121] wlan: HostMlme mlan0 Connected to bssid d0:XX:XX:XX:87:e8 successfully
[   43.291872] mlan0:
[   43.291919] wlan: Send EAPOL pkt to d0:XX:XX:XX:87:e8
[   43.312739] mlan0:
[   43.312752] wlan: Send EAPOL pkt to d0:XX:XX:XX:87:e8
[   43.320857] IPv6: ADDRCONF(NETDEV_CHANGE): mlan0: link becomes ready
[   43.327719] woal_cfg80211_set_rekey_data return: gtk_rekey_offload is DISABLE

Then the interface will be properly configured and the network access is enabled:

root@desk-mx8mp:~# ping www.dave.eu -c 4
PING www.dave.eu (51.91.120.202) 56(84) bytes of data.
64 bytes from 202.ip-51-91-120.eu (51.91.120.202): icmp_seq=1 ttl=48 time=42.2 ms
64 bytes from 202.ip-51-91-120.eu (51.91.120.202): icmp_seq=2 ttl=48 time=216 ms
64 bytes from 202.ip-51-91-120.eu (51.91.120.202): icmp_seq=3 ttl=48 time=146 ms
64 bytes from 202.ip-51-91-120.eu (51.91.120.202): icmp_seq=4 ttl=48 time=66.0 ms

--- www.dave.eu ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3004ms
rtt min/avg/max/mdev = 42.243/117.484/215.939/68.572 ms
root@desk-mx8mp:~#

Accessing the peripheral MITO 8M Mini[edit | edit source]

Linux messages at boot time[edit | edit source]

Check that AzureWave driver for PCIe was initialized:

...
...                                                                                  
[    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____)
...
[    7.638822] mwifiex_pcie 0000:01:00.0: 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)
...
...

and the WiFi module is available as PCIe device:

root@desk-mx8mm:~# lspci
00: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)
root@desk-mx8mm:~#

Setup for static connection[edit | edit source]

Check that the interface is properly intialized:

root@desk-mx8mm:~# ifconfig mlan0
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

Setup the wpa_supplicant.conf configuration file for handling the WiFi connection, for example:

root@desk-mx8mm:~# cat /etc/wpa_supplicant.conf
network={
    ssid="ZyXEL"
    key_mgmt=NONE
}

Apply the wpa_supplicant.conf configuration file manually starting the wpa_supplicant:

root@desk-mx8mm:~# wpa_supplicant -i mlan0 -c /etc/wpa_supplicant.conf -B
Successfully initialized wpa_supplicant
...
root@desk-mx8mm:~#

Add the mlan0 IP address:

root@desk-mx8mm:~# ip addr add 192.168.11.165/255.255.255.0 dev mlan0

Then the network access is enabled:

root@desk-mx8mm:~# ping 192.168.11.243 -c 4
PING 192.168.11.243 (192.168.11.243) 56(84) bytes of data.
64 bytes from 192.168.11.243: icmp_seq=1 ttl=64 time=2.93 ms
64 bytes from 192.168.11.243: icmp_seq=2 ttl=64 time=2.96 ms
64 bytes from 192.168.11.243: icmp_seq=3 ttl=64 time=1.97 ms
64 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, time 3005ms
rtt min/avg/max/mdev = 1.969/2.657/2.962/0.404 ms
root@desk-mx8mm:~#

Setup for DHCP connection[edit | edit source]

Check that the interface is properly recognized:

root@desk-mx8mm:~# ifconfig mlan0
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

Add the network configuration for systemd-networkd

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

Setup your wpa_supplicant.conf configuration file for handle WiFi connection:

root@desk-mx8mm:~# cat /etc/wpa_supplicant.conf
network={
        ssid="daveguest"
        psk="******"
}

Reboot the system and manually start the wpa_supplicant using the mlan0 interface and the wpa_supplicant.conf configuration file:

root@desk-mx8mm:~# wpa_supplicant -i mlan0 -c /etc/wpa_supplicant.conf -B
Successfully initialized wpa_supplicant
...
[  131.877506] ieee80211 phy0: mwifiex_cfg80211_sched_scan_start : Invalid Sched_scan parameters
root@desk-mx8mm:~# [  134.728825] mwifiex_pcie 0000:01:00.0: info: trying to associate to bssid d0:21:f9:35:87:e8
[  134.754118] mwifiex_pcie 0000:01:00.0: info: associated to bssid d0:21:f9:35:87:e8 successfully
[  134.778115] IPv6: ADDRCONF(NETDEV_CHANGE): mlan0: link becomes ready

Then the interface will be properly configured and the network access is enabled:

root@desk-mx8mm:~# ping www.dave.eu -c 4
PING www.dave.eu (51.91.120.202) 56(84) bytes of data.
64 bytes from 202.ip-51-91-120.eu (51.91.120.202): icmp_seq=1 ttl=48 time=332 ms
64 bytes from 202.ip-51-91-120.eu (51.91.120.202): icmp_seq=2 ttl=48 time=254 ms
64 bytes from 202.ip-51-91-120.eu (51.91.120.202): icmp_seq=3 ttl=48 time=174 ms
64 bytes from 202.ip-51-91-120.eu (51.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 3004ms
rtt min/avg/max/mdev = 94.197/213.585/332.136/88.720 ms
root@desk-mx8mm:~#

Additional information[edit | edit source]