MT7921 Module
This chapter describes module-dependent information and instructions. For example, you will get different benchmark results on different module on different platforms.
For general usage of Wi-Fi, such as command to configure DHCP (Dynamic Host Configuration Protocol) or static IP and so on, please refer to Wi-Fi chapter.
MT7921 - the Combo Connectivity Solution for Wi-Fi 6 and BT 5.2
The MediaTek MT7921 solution supports various kinds of form factors. Currently IoT Yocto supports the MT7921L (PCIE+USB), MT7921S (SDIO) combo modules made by Azurewave, and another MT7921S (SDIO) combo module made by Sona (since IoT Yocto v25.1). These solutions are high-performance wireless modules that provide robust Wi-Fi and Bluetooth connectivity.
The MT7921L leverages the PCIe interface for Wi-Fi and the USB interface for Bluetooth. It supports the latest Wi-Fi 6 standard, offering faster and more reliable connections compared to previous Wi-Fi standards. It also supports the latest Bluetooth 5.2 standard for fast and reliable connections to a wide range of Bluetooth devices. On the other hand, the MT7921S uses the SDIO (Secure Digital Input Output) interface, which is a type of interface that allows peripherals and memory cards to connect to the embedded platform.
Important
- There are 2 types of MT7921 modules made by Azurewave.
AW-XB468NF: a MT7921L module that uses the PCIe interface for Wi-Fi and the USB interface for Bluetooth.AW-XB554NF: a MT7921S module where both Wi-Fi and Bluetooth share the SDIO interfaces.
The pin assignment of Azurewave MT7921L M.2 module AW-XB468NF is compatible with standard M.2 E Key.
However, the pin assignment of Azurewave MT7921S M.2 module AW-XB554NF is not compatible with the standard M.2 E Key.
- There is one type of MT7921 modules made by Sona.
MT320: a MT7921S module where both Wi-Fi and Bluetooth share the SDIO (Secure Digital Input Output) interfaces.
- The pin assignment of Sona MT7921S M.2 module
MT320is with the standard M.2 E Key. Hence it is not compatible with Azurewave MT7921S M.2 module and the corresponded M.2 E Key slot. These cards are not interchangeable. Please use it carefully.
Kernel Configurations for MT7921
IoT Yocto applies kernel configurations of MT7921 families as a common setting for supporting platforms: Genio 510/700-EVK, Genio 520/720-EVK and Genio 1200-EVK.
User can find the Kernel configurations file of MT7921 in meta-mediatek-bsp layer: mt7921.cfg.
We list the settings separately, noting that MT792L is also compatible with MT7921E.
# common CONFIG_UHID=y CONFIG_BT_MTK=m # mt7921e CONFIG_BT_HCIBTUSB=m CONFIG_BT_HCIBTUSB_MTK=y CONFIG_MT7921E=m # mt7921s CONFIG_BT_MTKSDIO=m CONFIG_MT7921S=m
Configuration for MT7921L in DTS
The MT7921L module, being compatible with the standard M.2 PCIe slot, is straightforward to use and requires only minimal DTS (Device Tree Source) configurations. You can refer to the configurations of the Genio 1200 EVK , Genio 510 EVK , Genio 700 EVK , Genio 520/720 EVK for guidance.
The provided DTS nodes for the MT7921L PCIe (Peripheral Component Interconnect Express) M.2 module configure the hardware settings of the module on the |G1200-EVK| platform. Here’s a brief explanation of each node:
wifi_pwr_fixed_3v3: This node configures a fixed regulator that provides a 3.3V power supply to the Wi-Fi module. Thegpioproperty sets GPIO 135, which presumably controls the power supply. The regulator-always-on property indicates that the regulator is always on.wifi_fixed_3v3: regulator-2 { compatible = "regulator-fixed"; regulator-name = "wifi_3v3"; regulator-min-microvolt = <3300000>; regulator-max-microvolt = <3300000>; gpio = <&pio 135 GPIO_ACTIVE_HIGH>; enable-active-high; regulator-always-on; };
pcie0_default_pins: This node defines the default pin configuration for the PCIe interface. The pinmux property sets three different functions: WAKEN (Wake-up Enable), PERSTN, and CLKREQN, which presumably handle wake-up, reset, and clock request signals, respectively. The bias-pull-up property indicates that these pins have a pull-up resistor.pcie0_default_pins: pcie0-default-pins { pins { pinmux = <PINMUX_GPIO19__FUNC_WAKEN>, <PINMUX_GPIO20__FUNC_PERSTN>, <PINMUX_GPIO21__FUNC_CLKREQN>; bias-pull-up; }; };
pcie0_idle_pins: This node defines the idle pin configuration for the PCIe interface. Thepinmuxproperty sets GPIO 20, which is presumably used when the interface is idle. The bias-disable and output-low properties indicate that the pin has no bias and drives low when idle.pcie0_idle_pins: pcie0-idle-pins { pins { pinmux = <PINMUX_GPIO20__FUNC_GPIO20>; bias-disable; output-low; }; };
&pcie0: This node configures the PCIe interface. Thepinctrl-namesproperty defines two states: “default” and “idle”. Thepinctrl-0andpinctrl-1properties link to thepcie0_pins_defaultandpcie0_pins_idlenodes, respectively. The status property, set to “okay”, indicates that the interface enables. Don’t forget to enable&pciephy.&pcie0 { pinctrl-names = "default", "idle"; pinctrl-0 = <&pcie0_default_pins>; pinctrl-1 = <&pcie0_idle_pins>; status = "okay"; }; &pciephy { status = "okay"; };
Configuration for AzureWave MT7921S in DTS
Users can install and probe AzureWave MT7921S on Genio 510/700-EVK without any modification for DTS file mt8370-genio-510-evk.dts and mt8390-genio-700-evk.dts. However, only basic Wi-Fi and Bluetooth functions are supported. Advanced system related functions such as module reset, BT SCO (Synchronous Connection Oriented), and Wake on wireless are not supported.
Important
Please note that the SDIO (Secure Digital Input Output) pin assignment of the MT7921S is not fully compatible with the Genio 510/700-EVK. As a result, certain functionalities, such as module reset, BT SCO, and wake on wireless, cannot not work as expected. Modifications for both the board and DTS may be necessary to enable these functionalities. Please double check the customized hardware schematic and DTS assignment with hardware engineer very carefully.
Note
The functionalities of module reset, BT SCO (Synchronous Connection Oriented), and wake on wireless are not included in the scope of the IoT Yocto v23.1 release. However, it’s important to reserve the circuits and pin definitions in your design in advance for these features.
To fully support all system-related functions, customized boards and DTS files are necessary. The provided DTS nodes serve as an example for configuring the hardware settings of the MT7921S SDIO (Secure Digital Input Output) module. However, attempting to apply these modifications to the Genio 510/700-EVK without any hardware modifications will not be successful.
Note
The provided DTS example demonstrates the usage of MT7921S from the Chromebook mt8186-corsola.dts
Here are some important DTS nodes that can serve as a reference for porting MT7921S.
wifi_pwrseq: This node configures the power sequence for the Wi-Fi module. Thereset-gpiosproperty resets the chip.wifi_pwrseq: wifi-pwrseq { compatible = "mmc-pwrseq-simple"; pinctrl-names = "default"; pinctrl-0 = <&wifi_enable_pin>; post-power-on-delay-ms = <50>; reset-gpios = <&pio 54 GPIO_ACTIVE_LOW>; };
wifi_wakeup: This node configures the wake-up functionality for the Wi-Fi module. Thegpiosproperty enables the Wake on WiFi feature.wifi_wakeup: wifi-wakeup { compatible = "gpio-keys"; pinctrl-names = "default"; pinctrl-0 = <&wifi_wakeup_pin>; wowlan-event { label = "Wake on WiFi"; gpios = <&pio 7 GPIO_ACTIVE_LOW>; linux,code = <KEY_WAKEUP>; wakeup-source; }; };
&mmc1: This node configures the MMC (MultiMediaCard) interface for the SDIO (Secure Digital Input Output) module (it should be&mmc2on Genio 510/700-EVK). Various properties are set to configure the interface, including thesdio_wakeup,wifi_pwrseq, andbt_reset. Themmc-pwrseqproperty links to thewifi_pwrseqnode.&mmc1 { status = "okay"; ... interrupt-names = "msdc", "sdio_wakeup"; interrupts-extended = <&gic GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH 0>, <&pio 87 IRQ_TYPE_LEVEL_LOW>; ... wakeup-source; ... mmc-pwrseq = <&wifi_pwrseq>; bt_reset: bt-reset { compatible = "mediatek,mt7921s-bluetooth"; pinctrl-names = "default"; pinctrl-0 = <&bt_pins_reset>; reset-gpios = <&pio 155 GPIO_ACTIVE_LOW>; }; };
wifi_enable_pin(previouswifi_pins_pwrseqin Kernel 5.15),wifi_pins_wakeup, andbt_pins_reset: These nodes define the pin configurations for the Wi-Fi power sequence, Wi-Fi wake-up, and Bluetooth reset functionalities, respectively.wifi_enable_pin: wifi-enable-pins { pins-wifi-enable { pinmux = <PINMUX_GPIO54__FUNC_GPIO54>; }; }; wifi_wakeup_pin: wifi-wakeup-pins { pins-wifi-wakeup { pinmux = <PINMUX_GPIO7__FUNC_GPIO7>; input-enable; }; }; bt_pins_reset: bt-pins-reset { pins_bt_reset { pinmux = <PINMUX_GPIO155__FUNC_GPIO155>; output-high; }; };
mt6366_vcn33_reg(previousmt6366_vcn33_bt_regandmt6366_vcn33_wifi_reg): These nodes configure the voltage regulators for the Bluetooth and Wi-Fi functionalities, respectively.mt6366_vcn33_reg: vcn33 { regulator-name = "pp3300_vcn33_x"; regulator-min-microvolt = <3300000>; regulator-max-microvolt = <3300000>; regulator-enable-ramp-delay = <270>; };
btsco: This node enables the Bluetooth SCO (Synchronous Connection Oriented) link, which provides voice communication over Bluetooth.bt-sco { compatible = "linux,bt-sco"; #sound-dai-cells = <0>; };
Note
Interface name in Linux OS may be different by modules. It should be wlp1s0 for MT7921L PCIe module, and wlan0 for MT7921S SDIO (Secure Digital Input Output) module.
Configuration for Sona MT7921S in DTS
Users can install and probe Sona MT7921S on Genio 510/700-EVK without any modification for DTS file mt8391-genio-720-evk.dts . However, only basic Wi-Fi and Bluetooth functions are supported. Advanced system related functions such as module reset, BT SCO (Synchronous Connection Oriented), and Wake on wireless are not supported.
Important
Please note that the SDIO (Secure Digital Input Output) pin assignment of the Sona MT7921S is not fully compatible with the Genio 510/700-EVK. As a result, certain functionalities, such as module reset, BT SCO, and wake on wireless, cannot not work as expected. Modifications for both the board and DTS may be necessary to enable these functionalities. Please double check the customized hardware schematic and DTS assignment with hardware engineer very carefully.
Note
The functionalities of module reset, BT SCO (Synchronous Connection Oriented), and wake on wireless are not included in the scope of the IoT Yocto v23.1 release. However, it’s important to reserve the circuits and pin definitions in your design in advance for these features.
To fully support all system-related functions, customized boards and DTS files are necessary. The provided DTS nodes serve as an example for configuring the hardware settings of the MT7921S SDIO (Secure Digital Input Output) module. However, attempting to apply these modifications to the Genio 510/700-EVK without any hardware modifications will not be successful.
Note
The provided DTS example demonstrates the usage of MT7921S from the mt8391-genio-720-evk.dts .
Here are some important DTS nodes that can serve as a reference for porting MT7921S.
&mmc2: This node configures the MMC (MultiMediaCard) interface for the SDIO (Secure Digital Input Output) module.&mmc2 { status = "okay"; interrupts-extended = <&gic GIC_SPI 389 IRQ_TYPE_LEVEL_HIGH 0>, <&pio 177 IRQ_TYPE_LEVEL_LOW>; interrupt-names = "sdio", "sdio_wakeup"; pinctrl-names = "default", "state_uhs", "state_eint"; pinctrl-0 = <&mmc2_pins_default>; pinctrl-1 = <&mmc2_pins_uhs>; pinctrl-2 = <&mmc2_pins_eint>; bus-width = <4>; max-frequency = <200000000>; cap-sd-highspeed; sd-uhs-sdr104; keep-power-in-suspend; wakeup-source; cap-sdio-irq; mediatek,disable-single-burst; no-mmc; no-sd; non-removable; vmmc-supply = <&sdio_fixed_3v3>; vqmmc-supply = <&sdio_fixed_1v8>; };
mmc2_pins_defaultandmmc2_pins_eint: These nodes configure the pinctrl of the MMC (MultiMediaCard) interface for the SDIO (Secure Digital Input Output) module.mmc2_pins_default: mmc2default { pins-clk { pinmux = <PINMUX_GPIO175__FUNC_MSDC2_CLK>; drive-strength = <MTK_DRIVE_4mA>; bias-pull-down = <MTK_PUPD_SET_R1R0_10>; }; pins-cmd-dat { pinmux = <PINMUX_GPIO176__FUNC_MSDC2_DAT0>, <PINMUX_GPIO177__FUNC_MSDC2_DAT1>, <PINMUX_GPIO178__FUNC_MSDC2_DAT2>, <PINMUX_GPIO179__FUNC_MSDC2_DAT3>, <PINMUX_GPIO174__FUNC_MSDC2_CMD>; input-enable; drive-strength = <MTK_DRIVE_4mA>; bias-pull-up = <MTK_PUPD_SET_R1R0_01>; }; pins-wifichip-wcn-3v3-en { pinmux = <PINMUX_GPIO75__FUNC_GPIO75>, <PINMUX_GPIO79__FUNC_GPIO79>; output-high; }; }; mmc2_pins_uhs: mmc2uhs { pins-clk { pinmux = <PINMUX_GPIO175__FUNC_MSDC2_CLK>; drive-strength = <MTK_DRIVE_6mA>; bias-pull-down = <MTK_PUPD_SET_R1R0_10>; }; pins-cmd-dat { pinmux = <PINMUX_GPIO176__FUNC_MSDC2_DAT0>, <PINMUX_GPIO177__FUNC_MSDC2_DAT1>, <PINMUX_GPIO178__FUNC_MSDC2_DAT2>, <PINMUX_GPIO179__FUNC_MSDC2_DAT3>, <PINMUX_GPIO174__FUNC_MSDC2_CMD>; input-enable; drive-strength = <MTK_DRIVE_6mA>; bias-pull-up = <MTK_PUPD_SET_R1R0_01>; }; }; mmc2_pins_eint: dat1-eint { pins-dat1 { pinmux = <PINMUX_GPIO177__FUNC_GPIO177>; input-enable; bias-pull-up = <MTK_PUPD_SET_R1R0_01>; }; };
pins_3v3enandpins_wcn_3v3_en: These nodes define the pin configurations for the Wi-Fi power sequence.pins_3v3en: regulator-7 { compatible = "regulator-fixed"; regulator-name = "pins_3v3en"; regulator-min-microvolt = <3300000>; regulator-max-microvolt = <3300000>; gpio = <&pio 79 GPIO_ACTIVE_HIGH>; enable-active-high; regulator-always-on; }; pins_wcn_3v3_en: regulator-8 { compatible = "regulator-fixed"; regulator-name = "pins_wcn_3v3_en"; regulator-min-microvolt = <3300000>; regulator-max-microvolt = <3300000>; gpio = <&pio 75 GPIO_ACTIVE_HIGH>; enable-active-high; regulator-always-on; };
&sdio_fixed_3v3and&sdio_fixed_1v8: These nodes configure the voltage regulators for the MMC2 M.2 slot, respectively.sdio_fixed_1v8: regulator-3 { compatible = "regulator-fixed"; regulator-name = "sdio_io"; regulator-min-microvolt = <1800000>; regulator-max-microvolt = <1800000>; enable-active-high; startup-delay-us = <200000>; gpio = <&pio 49 0>; /* chip SYSRST */ }; sdio_fixed_3v3: regulator-4 { compatible = "regulator-fixed"; regulator-name = "sdio_card"; regulator-min-microvolt = <3300000>; regulator-max-microvolt = <3300000>; enable-active-high; regulator-always-on; };
Note
Interface name in Linux OS may be different by modules. It should be wlan0 for MT7921S SDIO (Secure Digital Input Output) module.