summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsh3ikh-faisal2026-02-27 18:32:29 +0000
committerHauke Mehrtens2026-06-27 11:19:59 +0000
commitdaaf5bc69b4dd1e919a8b9d271bb95354aa571b1 (patch)
treea5c3cd13ad736d07a53941131b8aa312ab554a20
parent0def1dd5788372d66e736228114528bf3e920541 (diff)
downloadopenwrt-daaf5bc69b4dd1e919a8b9d271bb95354aa571b1.tar.gz
mediatek: add support for JioRouter AX6000 JIDU6101
| 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 (cherry picked from commit fe3efbd7dae927ec041f068303a5955754fe4ba4) Link: https://github.com/openwrt/openwrt/pull/23454 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
-rw-r--r--package/boot/uboot-tools/uboot-envtools/files/mediatek_filogic6
-rw-r--r--target/linux/mediatek/dts/mt7986a-jiorouter-ax6000-jidu6101.dts53
-rw-r--r--target/linux/mediatek/dts/mt7986a-jiorouter-common.dtsi283
-rw-r--r--target/linux/mediatek/filogic/base-files/etc/board.d/02_network5
-rw-r--r--target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac5
-rw-r--r--target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh27
-rw-r--r--target/linux/mediatek/image/filogic.mk15
7 files changed, 393 insertions, 1 deletions
diff --git a/package/boot/uboot-tools/uboot-envtools/files/mediatek_filogic b/package/boot/uboot-tools/uboot-envtools/files/mediatek_filogic
index aa4b15a5b4..6d02233f8b 100644
--- a/package/boot/uboot-tools/uboot-envtools/files/mediatek_filogic
+++ b/package/boot/uboot-tools/uboot-envtools/files/mediatek_filogic
@@ -135,6 +135,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
index 0000000000..e4cd110b75
--- /dev/null
+++ b/target/linux/mediatek/dts/mt7986a-jiorouter-ax6000-jidu6101.dts
@@ -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
index 0000000000..b7135917b9
--- /dev/null
+++ b/target/linux/mediatek/dts/mt7986a-jiorouter-common.dtsi
@@ -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";
+};
diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network
index 65a4fcecba..16f45f400d 100644
--- a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network
+++ b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network
@@ -263,6 +263,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')
diff --git a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac
index 1c9c908c55..0104fc9d0e 100644
--- a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac
+++ b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac
@@ -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|\
diff --git a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh
index 24412b905f..9293b3692e 100644
--- a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh
+++ b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh
@@ -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
@@ -169,7 +190,8 @@ platform_do_upgrade() {
cudy,wr3000h-v1|\
cudy,wr3000p-v1|\
huasifei,wh3000-pro-nand|\
- huasifei,wh3000r-nand)
+ huasifei,wh3000r-nand|\
+ jiorouter,ax6000-jidu6101)
CI_UBIPART="ubi"
nand_do_upgrade "$1"
;;
@@ -410,6 +432,9 @@ platform_pre_upgrade() {
buffalo,wsr-6000ax8)
buffalo_initial_setup
;;
+ jiorouter,ax6000-jidu6101)
+ jiorouter_initial_setup
+ ;;
xiaomi,mi-router-ax3000t|\
xiaomi,mi-router-wr30u-stock|\
xiaomi,redmi-router-ax6000-stock)
diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk
index 45deff7b42..3b0d0097a8 100644
--- a/target/linux/mediatek/image/filogic.mk
+++ b/target/linux/mediatek/image/filogic.mk
@@ -1965,6 +1965,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