]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
mediatek: add support for JioRouter AX6000 JIDU6101 22201/head
authorsh3ikh-faisal <sheikhfaisal713@gmail.com>
Fri, 27 Feb 2026 18:32:29 +0000 (00:02 +0530)
committerHauke Mehrtens <hauke@hauke-m.de>
Tue, 19 May 2026 22:51:40 +0000 (00:51 +0200)
| Component        | Details                                         |
|------------------|-------------------------------------------------|
| **SoC**          | MediaTek MT7986A (4× ARM Cortex-A53 @ 2.0 GHz) |
| **RAM**          | 512 MB                                          |
| **Flash**        | 256 MB NAND                                     |
| **Ethernet**     | 5× 10/100/1000 Mbps (1 WAN + 4 LAN)            |
| **WLAN 2.4 GHz** | MediaTek MT7976GN — 802.11b/g/n/ax, 4×4 MIMO   |
| **WLAN 5 GHz**   | MediaTek MT7976AN — 802.11n/ac/ax, 4×4 MIMO    |
| **LEDs**         | 1× RGB LED (GPIO-controlled)                    |
| **Button**       | 1× Reset                                        |
| **USB**          | Yes                                             |

**MAC Addresses:**

| Interface  | Source                                          |
|------------|-------------------------------------------------|
| WAN/Label  | u-boot-env MTD partition, "mac" (text)          |
| LAN        | WAN + 1                                         |
| 2.4 GHz    | WAN + 2                                         |
| 5 GHz      | WAN + 3                                         |

---

**1. Prepare TFTP server**

Set a static IP on the ethernet interface of your computer (e.g. default: ip `192.168.1.2`, gateway `192.168.1.1`).

Download the initramfs image and host it with the TFTP server.

**2. Interrupt boot**

Attach UART and power on the router. When the boot menu appears, select **Failsafe Mode**,
then press `Ctrl-C` to interrupt and enter the U-Boot prompt.

**3. Load and run initramfs image**
```sh
setenv ipaddr 192.168.1.1
setenv serverip 192.168.1.2
tftpboot 0x46000000 openwrt-mediatek-filogic-jiorouter_ax6000-jidu6101-initramfs-kernel.bin
fdt addr $(fdtcontroladdr)
fdt rm /signature
bootm
```

**4. Flash sysupgrade image**

Place the sysupgrade image in `/tmp`, then run:
```sh
sysupgrade /tmp/openwrt-mediatek-filogic-jiorouter_ax6000-jidu6101-squashfs-sysupgrade.bin
```
Alternatively, use the sysupgrade option in LuCI.

Note:
- The raw MTD u-boot-env partition is only used for MAC address storage, while the active U-Boot environment is stored in the UBI volume.
- These devices ship with secure boot enabled and stock U-Boot only accepts vendor-signed FIT images.
- BL2/FIP cannot be replaced, so the stock signature verification path cannot be disabled directly.
- Setting ipaddr='' forces U-Boot to exit the web failsafe path and continue into autoboot.
- The custom bootcmd loads OpenWrt from the UBI volume and removes the /signature node before bootm, allowing unsigned OpenWrt FIT images to boot.
- Stock U-Boot expects its environment in a UBI volume named u-boot-env, so it is created during initial setup.

Signed-off-by: sh3ikh-faisal <sheikhfaisal713@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22201
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
package/boot/uboot-tools/uboot-envtools/files/mediatek_filogic
target/linux/mediatek/dts/mt7986a-jiorouter-ax6000-jidu6101.dts [new file with mode: 0644]
target/linux/mediatek/dts/mt7986a-jiorouter-common.dtsi [new file with mode: 0644]
target/linux/mediatek/filogic/base-files/etc/board.d/02_network
target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac
target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh
target/linux/mediatek/image/filogic.mk

index db87120c517fd19cc8ef891c911bb64db9bcf34c..81b0e6a310b21e8a5f77ec47ff95c53b1bb2c056 100644 (file)
@@ -133,6 +133,12 @@ gatonetworks,gdsp)
 glinet,gl-mt3000)
        ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x80000" "0x20000"
        ;;
+jiorouter,ax6000-jidu6101)
+       . /lib/upgrade/nand.sh
+       envubi=$(nand_find_ubi ubi)
+       envdev=/dev/$(nand_find_volume "$envubi" u-boot-env)
+       ubootenv_add_uci_config "$envdev" "0x0" "0x80000" "0x80000" "1"
+       ;;
 openembed,som7981)
        ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x80000" "0x80000"
        ubootenv_add_uci_sys_config "/dev/mtd3" "0x0" "0x100000" "0x100000"
diff --git a/target/linux/mediatek/dts/mt7986a-jiorouter-ax6000-jidu6101.dts b/target/linux/mediatek/dts/mt7986a-jiorouter-ax6000-jidu6101.dts
new file mode 100644 (file)
index 0000000..e4cd110
--- /dev/null
@@ -0,0 +1,53 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+
+/dts-v1/;
+#include "mt7986a-jiorouter-common.dtsi"
+
+/ {
+       compatible = "jiorouter,ax6000-jidu6101", "mediatek,mt7986a";
+       model = "JioRouter AX6000 JIDU6101";
+};
+
+&switch {
+       ports {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               port@0 {
+                       reg = <0>;
+                       label = "wan";
+               };
+
+               port@1 {
+                       reg = <1>;
+                       label = "lan2";
+               };
+
+               port@2 {
+                       reg = <2>;
+                       label = "lan3";
+               };
+
+               port@3 {
+                       reg = <3>;
+                       label = "lan4";
+               };
+
+               port@4 {
+                       reg = <4>;
+                       label = "lan1";
+               };
+
+               port@6 {
+                       reg = <6>;
+                       ethernet = <&gmac0>;
+                       phy-mode = "2500base-x";
+
+                       fixed-link {
+                               speed = <2500>;
+                               full-duplex;
+                               pause;
+                       };
+               };
+       };
+};
diff --git a/target/linux/mediatek/dts/mt7986a-jiorouter-common.dtsi b/target/linux/mediatek/dts/mt7986a-jiorouter-common.dtsi
new file mode 100644 (file)
index 0000000..b713591
--- /dev/null
@@ -0,0 +1,283 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/leds/common.h>
+#include <dt-bindings/pinctrl/mt65xx.h>
+
+#include "mt7986a.dtsi"
+
+/ {
+       aliases {
+               serial0 = &uart0;
+               led-boot = &led_red;
+               led-failsafe = &led_red;
+               led-running = &led_red;
+               led-upgrade = &led_blue;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+               bootargs = "dm-mod.create=''";
+       };
+
+       keys {
+               compatible = "gpio-keys";
+
+               reset {
+                       label = "reset";
+                       gpios = <&pio 9 GPIO_ACTIVE_LOW>;
+                       linux,code = <KEY_RESTART>;
+               };
+       };
+
+       leds {
+               compatible = "gpio-leds";
+
+               led_red: led-0 {
+                       color = <LED_COLOR_ID_RED>;
+                       function = LED_FUNCTION_STATUS;
+                       gpios = <&pio 12 GPIO_ACTIVE_LOW>;
+                       default-state = "on";
+               };
+
+               led_green: led-1 {
+                       color = <LED_COLOR_ID_GREEN>;
+                       function = LED_FUNCTION_STATUS;
+                       gpios = <&pio 13 GPIO_ACTIVE_LOW>;
+               };
+
+               led_blue: led-2 {
+                       color = <LED_COLOR_ID_BLUE>;
+                       function = LED_FUNCTION_STATUS;
+                       gpios = <&pio 14 GPIO_ACTIVE_LOW>;
+               };
+       };
+
+       memory@40000000 {
+               reg = <0 0x40000000 0 0x20000000>;
+               device_type = "memory";
+       };
+
+       reg_3p3v: regulator-3p3v {
+               compatible = "regulator-fixed";
+               regulator-name = "fixed-3.3V";
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+               regulator-boot-on;
+               regulator-always-on;
+       };
+
+       reg_5v: regulator-5v {
+               compatible = "regulator-fixed";
+               regulator-name = "fixed-5V";
+               regulator-min-microvolt = <5000000>;
+               regulator-max-microvolt = <5000000>;
+               regulator-boot-on;
+               regulator-always-on;
+       };
+};
+
+&crypto {
+       status = "okay";
+};
+
+&eth {
+       status = "okay";
+
+       gmac0: mac@0 {
+               compatible = "mediatek,eth-mac";
+               reg = <0>;
+               phy-mode = "2500base-x";
+               fixed-link {
+                       speed = <2500>;
+                       full-duplex;
+                       pause;
+               };
+       };
+
+       mdio: mdio-bus {
+               #address-cells = <1>;
+               #size-cells = <0>;
+       };
+};
+
+&mdio {
+       switch: switch@1f {
+               compatible = "mediatek,mt7531";
+               reg = <31>;
+               reset-gpios = <&pio 5 GPIO_ACTIVE_HIGH>;
+               interrupt-controller;
+               #interrupt-cells = <1>;
+               interrupt-parent = <&pio>;
+               interrupts = <66 IRQ_TYPE_LEVEL_HIGH>;
+       };
+};
+
+&pio {
+       spi_flash_pins: spi-flash-pins-33-to-38 {
+               mux {
+                       function = "spi";
+                       groups = "spi0", "spi0_wp_hold";
+               };
+               conf-pu {
+                       pins = "SPI2_CS", "SPI2_HOLD", "SPI2_WP";
+                       drive-strength = <MTK_DRIVE_8mA>;
+                       bias-disable;
+               };
+               conf-pd {
+                       pins = "SPI2_CLK", "SPI2_MOSI", "SPI2_MISO";
+                       drive-strength = <MTK_DRIVE_8mA>;
+                       bias-disable;
+               };
+       };
+
+       wf_2g_5g_pins: wf_2g_5g-pins {
+               mux {
+                       function = "wifi";
+                       groups = "wf_2g", "wf_5g";
+               };
+               conf {
+                       pins = "WF0_HB1", "WF0_HB2", "WF0_HB3", "WF0_HB4",
+                       "WF0_HB0", "WF0_HB0_B", "WF0_HB5", "WF0_HB6",
+                       "WF0_HB7", "WF0_HB8", "WF0_HB9", "WF0_HB10",
+                       "WF0_TOP_CLK", "WF0_TOP_DATA", "WF1_HB1",
+                       "WF1_HB2", "WF1_HB3", "WF1_HB4", "WF1_HB0",
+                       "WF1_HB5", "WF1_HB6", "WF1_HB7", "WF1_HB8",
+                       "WF1_TOP_CLK", "WF1_TOP_DATA";
+                       drive-strength = <MTK_DRIVE_4mA>;
+               };
+       };
+
+       wf_dbdc_pins: wf_dbdc-pins {
+               mux {
+                       function = "wifi";
+                       groups = "wf_dbdc";
+               };
+               conf {
+                       pins = "WF0_HB1", "WF0_HB2", "WF0_HB3", "WF0_HB4",
+                       "WF0_HB0", "WF0_HB0_B", "WF0_HB5", "WF0_HB6",
+                       "WF0_HB7", "WF0_HB8", "WF0_HB9", "WF0_HB10",
+                       "WF0_TOP_CLK", "WF0_TOP_DATA", "WF1_HB1",
+                       "WF1_HB2", "WF1_HB3", "WF1_HB4", "WF1_HB0",
+                       "WF1_HB5", "WF1_HB6", "WF1_HB7", "WF1_HB8",
+                       "WF1_TOP_CLK", "WF1_TOP_DATA";
+                       drive-strength = <MTK_DRIVE_4mA>;
+               };
+       };
+};
+
+&spi0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&spi_flash_pins>;
+       status = "okay";
+
+       spi_nand_flash: flash@0 {
+               compatible = "spi-nand";
+               reg = <0>;
+               #address-cells = <1>;
+               #size-cells = <1>;
+               spi-max-frequency = <52000000>;
+               spi-tx-bus-width = <4>;
+               spi-rx-bus-width = <4>;
+               mediatek,nmbm;
+               mediatek,bmt-max-ratio = <1>;
+               mediatek,bmt-max-reserved-blocks = <64>;
+
+               partitions: partitions {
+                       compatible = "fixed-partitions";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+
+                       partition@0 {
+                               label = "BL2";
+                               reg = <0x0 0x100000>;
+                               read-only;
+                       };
+
+                       /* Only used for MAC address storage.
+                        * The active U-Boot environment is stored in UBI.
+                        */
+                       partition@100000 {
+                               label = "u-boot-env";
+                               reg = <0x100000 0x80000>;
+                               read-only;
+                       };
+
+                       factory: partition@180000 {
+                               label = "Factory";
+                               reg = <0x180000 0x200000>;
+                               read-only;
+
+                               nvmem-layout {
+                                       compatible = "fixed-layout";
+                                       #address-cells = <1>;
+                                       #size-cells = <1>;
+
+                                       eeprom_factory_0: eeprom@0 {
+                                               reg = <0x0 0x1000>;
+                                       };
+                               };
+                       };
+
+                       partition@380000 {
+                               label = "FIP";
+                               reg = <0x380000 0x200000>;
+                               read-only;
+                       };
+
+                       partition@580000 {
+                               label = "ubi";
+                               reg = <0x580000 0x8c00000>;
+                       };
+
+                       partition@9180000 {
+                               label = "ubi2";
+                               reg = <0x9180000 0x5a00000>;
+                       };
+
+                       partition@eb80000 {
+                               label = "MFG";
+                               reg = <0xeb80000 0x200000>;
+                               read-only;
+                       };
+
+                       partition@ed80000 {
+                               label = "Reserved";
+                               reg = <0xed80000 0x200000>;
+                               read-only;
+                       };
+               };
+       };
+};
+
+&ssusb {
+       vusb33-supply = <&reg_3p3v>;
+       vbus-supply = <&reg_5v>;
+       status = "okay";
+};
+
+&trng {
+       status = "okay";
+};
+
+&uart0 {
+       status = "okay";
+};
+
+&usb_phy {
+       status = "okay";
+};
+
+&watchdog {
+       status = "okay";
+};
+
+&wifi {
+       nvmem-cells = <&eeprom_factory_0>;
+       nvmem-cell-names = "eeprom";
+       pinctrl-names = "default", "dbdc";
+       pinctrl-0 = <&wf_2g_5g_pins>;
+       pinctrl-1 = <&wf_dbdc_pins>;
+       status = "okay";
+};
index a48b62f17b02d8b3f886d6e33d10cf08644522a1..6770b8642431dbdb61ab4c5b2018ead16dd493f0 100644 (file)
@@ -264,6 +264,11 @@ mediatek_setup_macs()
                lan_mac=$(macaddr_add "$wan_mac" 1)
                label_mac=$wan_mac
                ;;
+       jiorouter,ax6000-jidu6101)
+               label_mac=$(mtd_get_mac_ascii u-boot-env mac)
+               wan_mac=$label_mac
+               lan_mac=$(macaddr_add "$label_mac" 1)
+               ;;
        mercusys,mr80x-v3|\
        mercusys,mr85x)
                mac_dirty=$(cat "/tmp/tp_data/default-mac" | sed -n 's/^'"MAC"'://p')
index b5ca7d605f2ebb0fbb39e35c6077158242300e1e..8bd48a15d26432e428fd67f8355150a012220684 100644 (file)
@@ -158,6 +158,11 @@ case "$board" in
        jdcloud,re-cp-03)
                [ "$PHYNBR" = "1" ] && mmc_get_mac_binary factory 0xa > /sys${DEVPATH}/macaddress
                ;;
+       jiorouter,ax6000-jidu6101)
+               addr=$(mtd_get_mac_ascii u-boot-env mac)
+               [ "$PHYNBR" = "0" ] && macaddr_add $addr 2 > /sys${DEVPATH}/macaddress
+               [ "$PHYNBR" = "1" ] && macaddr_add $addr 3 > /sys${DEVPATH}/macaddress
+               ;;
        keenetic,kap-630|\
        keenetic,kn-3711|\
        keenetic,kn-3811|\
index 3aac9131b1c87a2ba61ca31c5e225061a289d591..8aadf3e0cf52f4e06990cf72511b19929846920d 100644 (file)
@@ -24,6 +24,27 @@ buffalo_initial_setup()
        ubiformat /dev/mtd$mtdnum -y
 }
 
+jiorouter_initial_setup()
+{
+       [ "$(rootfs_type)" = "tmpfs" ] || return 0
+
+       local mtdnum="$( find_mtd_index ubi )"
+       if [ ! "$mtdnum" ]; then
+               echo "unable to find mtd partition ubi"
+               return 1
+       fi
+
+       ubidetach -m "$mtdnum" 2>/dev/null
+       ubiformat /dev/mtd$mtdnum -y
+       ubiattach -m "$mtdnum"
+       ubimkvol /dev/ubi0 -n 0 -N u-boot-env -s 0x80000
+
+       # Set boot arguments in freshly created U-Boot environment
+       fw_setenv bootcmd 'ubi read 46000000 kernel;fdt addr $(fdtcontroladdr);fdt rm /signature;bootm 0x46000000'
+       fw_setenv bootdelay 0
+       fw_setenv ipaddr ''
+}
+
 xiaomi_initial_setup()
 {
        # initialize UBI and setup uboot-env if it's running on initramfs
@@ -209,7 +230,8 @@ platform_do_upgrade() {
        buffalo,wsr-6000ax8|\
        cudy,wr3000h-v1|\
        cudy,wr3000p-v1|\
-       huasifei,wh3000-pro-nand)
+       huasifei,wh3000-pro-nand|\
+       jiorouter,ax6000-jidu6101)
                CI_UBIPART="ubi"
                nand_do_upgrade "$1"
                ;;
@@ -455,6 +477,9 @@ platform_pre_upgrade() {
                [ -z "$delay" ] || [ "$delay" -eq "0" ] && \
                        fw_setenv bootmenu_delay 3
                ;;
+       jiorouter,ax6000-jidu6101)
+               jiorouter_initial_setup
+               ;;
        xiaomi,mi-router-ax3000t|\
        xiaomi,mi-router-wr30u-stock|\
        xiaomi,redmi-router-ax6000-stock)
index ab76132bd491baa3833b81662f4ab31408345719..84369e23ea44ed3f4bca4e4284c1e38c9393b5fc 100644 (file)
@@ -2014,6 +2014,21 @@ define Device/jdcloud_re-cp-03
 endef
 TARGET_DEVICES += jdcloud_re-cp-03
 
+define Device/jiorouter_ax6000-jidu6101
+  DEVICE_VENDOR := JioRouter
+  DEVICE_MODEL := AX6000
+  DEVICE_VARIANT := JIDU6101
+  DEVICE_DTS := mt7986a-jiorouter-ax6000-jidu6101
+  DEVICE_DTS_DIR := ../dts
+  DEVICE_PACKAGES := kmod-usb3 kmod-mt7915e kmod-mt7916-firmware kmod-mt7986-firmware mt7986-wo-firmware
+  UBINIZE_OPTS := -E 5
+  UBOOTENV_IN_UBI := 1
+  BLOCKSIZE := 128k
+  PAGESIZE := 2048
+  IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
+endef
+TARGET_DEVICES += jiorouter_ax6000-jidu6101
+
 define Device/kebidumei_ax3000-u22
   DEVICE_VENDOR := Kebidumei
   DEVICE_MODEL := AX3000-U22