.. include:: /keyword.rst .. _MT7921 Module: ============= MT7921 Module ============= .. contents:: General :local: :depth: 1 -------------------------------- 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 :doc:`Wi-Fi ` chapter. -------------------------------- .. contents:: Sections :local: :depth: 2 .. _MT7921 - the Combo Connectivity Solution for Wi-Fi 6 and BT 5.2: 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 ``MT320`` is 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: |G510-G700-EVK|, |G520-G720-EVK| and |G1200-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. .. code:: text # 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. The ``gpio`` property sets GPIO 135, which presumably controls the power supply. The regulator-always-on property indicates that the regulator is always on. .. code:: text 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. .. code:: text pcie0_default_pins: pcie0-default-pins { pins { pinmux = , , ; bias-pull-up; }; }; ``pcie0_idle_pins``: This node defines the idle pin configuration for the PCIe interface. The ``pinmux`` property 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. .. code:: text pcie0_idle_pins: pcie0-idle-pins { pins { pinmux = ; bias-disable; output-low; }; }; ``&pcie0``: This node configures the PCIe interface. The ``pinctrl-names`` property defines two states: "default" and "idle". The ``pinctrl-0`` and ``pinctrl-1`` properties link to the ``pcie0_pins_default`` and ``pcie0_pins_idle`` nodes, respectively. The status property, set to "okay", indicates that the interface enables. Don't forget to enable ``&pciephy``. .. code:: text &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 |G510-G700-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 |G510-G700-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 |G510-G700-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. The ``reset-gpios`` property resets the chip. .. code:: text 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. The ``gpios`` property enables the Wake on WiFi feature. .. code:: text 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 = ; wakeup-source; }; }; ``&mmc1``: This node configures the MMC (MultiMediaCard) interface for the SDIO (Secure Digital Input Output) module (it should be ``&mmc2`` on |G510-G700-EVK|). Various properties are set to configure the interface, including the ``sdio_wakeup``, ``wifi_pwrseq``, and ``bt_reset``. The ``mmc-pwrseq`` property links to the ``wifi_pwrseq`` node. .. code:: text &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`` (previous ``wifi_pins_pwrseq`` in Kernel 5.15), ``wifi_pins_wakeup``, and ``bt_pins_reset``: These nodes define the pin configurations for the Wi-Fi power sequence, Wi-Fi wake-up, and Bluetooth reset functionalities, respectively. .. code:: text wifi_enable_pin: wifi-enable-pins { pins-wifi-enable { pinmux = ; }; }; wifi_wakeup_pin: wifi-wakeup-pins { pins-wifi-wakeup { pinmux = ; input-enable; }; }; bt_pins_reset: bt-pins-reset { pins_bt_reset { pinmux = ; output-high; }; }; ``mt6366_vcn33_reg`` (previous ``mt6366_vcn33_bt_reg`` and ``mt6366_vcn33_wifi_reg``): These nodes configure the voltage regulators for the Bluetooth and Wi-Fi functionalities, respectively. .. code:: text 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. .. code:: text 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 |G510-G700-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 |G510-G700-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 |G510-G700-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. .. code:: text &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_default`` and ``mmc2_pins_eint``: These nodes configure the pinctrl of the MMC (MultiMediaCard) interface for the SDIO (Secure Digital Input Output) module. .. code:: text mmc2_pins_default: mmc2default { pins-clk { pinmux = ; drive-strength = ; bias-pull-down = ; }; pins-cmd-dat { pinmux = , , , , ; input-enable; drive-strength = ; bias-pull-up = ; }; pins-wifichip-wcn-3v3-en { pinmux = , ; output-high; }; }; mmc2_pins_uhs: mmc2uhs { pins-clk { pinmux = ; drive-strength = ; bias-pull-down = ; }; pins-cmd-dat { pinmux = , , , , ; input-enable; drive-strength = ; bias-pull-up = ; }; }; mmc2_pins_eint: dat1-eint { pins-dat1 { pinmux = ; input-enable; bias-pull-up = ; }; }; ``pins_3v3en`` and ``pins_wcn_3v3_en``: These nodes define the pin configurations for the Wi-Fi power sequence. .. code:: text 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_3v3`` and ``&sdio_fixed_1v8``: These nodes configure the voltage regulators for the MMC2 M.2 slot, respectively. .. code:: text 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.