-
-
Notifications
You must be signed in to change notification settings - Fork 11.8k
mediatek: add Xiaomi Redmi Router AX6000 support #10690
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
There is some instruction on the Wiki for rooting the device. https://openwrt.org/toh/xiaomi/redmi_ax6000#rooting |
ideally we should first have some instruction and at least link them in the commit description |
|
Instructions worked great for me! LED bar stays on and solid blue for me, so definitely not working but I can live with it for now. |
Great, I'll add this link to the commit message.
Can you see which chip the leds are connected to? |
|
I remember kernel size in mediatek target is very close to 4 MiB recently, so it's better to enlarge it to 8 MiB. And for NMBM reserved space, 8 MiB is enough. Refer to bootlog, block 960 start at 0x7800000: |
So I added this line |
|
After leaving my device running all day, I did a reboot an hour or two ago and it seems hard bricked. Bootloader appears corrupt, u-boot is busted, can't tftpboot, and UART is not working correctly. I'm not sure if I'm just a one-off, but something bad happened. |
|
@soxrok2212 Can you try plugging in the power first and waiting for about 1~2 second, then connect the TTL GND to see if there is any output. |
Thank you so much for your suggestion. I tried to ask mtk, and their reply was that since the kernel is already in ubi, there is no need to care about the size of kernel. |
|
trying to make it possible to flash via ssh on stock system (and we don't like to use serial port to flash firmware.) diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk
index 3015c7a86f..2c9ddcb86f 100644
--- a/target/linux/mediatek/image/filogic.mk
+++ b/target/linux/mediatek/image/filogic.mk
@@ -38,6 +38,20 @@ define Build/mt7986-gpt
rm $@.tmp
endef
+define Build/gen-ubi-initramfs
+ sh $(TOPDIR)/scripts/ubinize-image.sh \
+ $(if $(UBOOTENV_IN_UBI),--uboot-env) \
+ --kernel $(KDIR)/tmp/$(KERNEL_INITRAMFS_IMAGE) \
+ $(foreach part,$(UBINIZE_PARTS),--part $(part)) \
+ "$(1).tmp" \
+ -p $(BLOCKSIZE:%k=%KiB) -m $(PAGESIZE) \
+ $(if $(SUBPAGESIZE),-s $(SUBPAGESIZE)) \
+ $(if $(VID_HDR_OFFSET),-O $(VID_HDR_OFFSET)) \
+ $(UBINIZE_OPTS) && \
+ cat "$(1).tmp" > "$(1)" && rm "$(1).tmp" && \
+ $(CP) "$(1)" $(BIN_DIR)/
+endef
+
define Device/bananapi_bpi-r3
DEVICE_VENDOR := Bananapi
DEVICE_MODEL := BPi-R3
@@ -136,6 +150,9 @@ define Device/xiaomi_redmi-router-ax6000
BLOCKSIZE := 128k
PAGESIZE := 2048
KERNEL_IN_UBI := 1
+ KERNEL_INITRAMFS := kernel-bin | lzma | \
+ fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | \
+ gen-ubi-initramfs $(KDIR)/tmp/$$(KERNEL_INITRAMFS_PREFIX)-factory.ubi
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
endef
TARGET_DEVICES += xiaomi_redmi-router-ax6000possible installation method:
where
I have no device to do test, I hope somebody can add more details |
|
It is best if stock u-boot can be replaced like Linksys E8450 |
I was able to tftpboot again and refresh OpenWrt, but the device still refuses to boot it. Think the console was broken last night because of a bad ground pin. |
|
I grabbed a dump of the flash from the forums and reset these: sys1 was at 9 and sys2 was at 97. I presume some other nvram params need to be changed as the standard fw as 2 ubi partitions. https://openwrt.org/toh/xiaomi/redmi_ax6000#flash_layout Seems it got stuck looking at the second. Unsure what triggered it to go bad. Bad gnd pin on uart made the rest look corrupt but seems okay. So I guess 2 things to figure out/adjust are:
|
|
@soxrok2212 Can you try setting uboot env like this? Then the router will boot from ubi or ubi1? |
This puts it into a boot loop, so yes looks like it tries booting from ubi1. From there, reset |
So if |
Looks like its booting normally even though both flag_try_sys1_failed and flag_try_sys2_failed counters are not 0. The boot loader algorithm is here, from the forums. https://pastebin.com/xzRXCbzU (this is from the RB03 but looks to be the same on the RB06). |
Should be easily possible, just pick the right combination for storage and DRAM and check ARM Trusted Firmware and U-Boot are done for the Bananapi BPi-R3. |
target/linux/mediatek/dts/mt7986a-xiaomi-redmi-router-ax6000.dts
Outdated
Show resolved
Hide resolved
target/linux/mediatek/dts/mt7986a-xiaomi-redmi-router-ax6000.dts
Outdated
Show resolved
Hide resolved
And why is it so difficult? Users here can do terrible things! Here is the simplest solution: https://forum.openwrt.org/t/adding-openwrt-support-for-xiaomi-redmi-router-ax6s-xiaomi-router-ax3200/111085/938 |
|
For some users reverting would be great. I’ll personally never go back to a fw that calls home though… :) |
|
Perhaps we could make multiple (2) options like the RT3200/E8450? For those like myself who'd rather utilize all the available space and do not wish to ever return to stock fw this would be optimal. I'd imagine most users would like to stick with OpenWrt as the stock fw is only available in Chinese if no other reason. |
|
@soxrok2212 Can you test the replacement of u-boot? I'm not sure if this will make it bricks. |
|
I’m a little hesitant to do that, especially now that setting flag_try_sys1_failed >= 6 and flag_try_sys2_failed >= 6 seems to have fixed that bricked device. |
The ability to easily return to stock firmware should be required!
I made a very easy to use stock firmware translator (EN/RU): https://forum.openwrt.org/t/adding-openwrt-support-for-xiaomi-redmi-router-ax6s-xiaomi-router-ax3200/111085/938 |
Having the option to return to stock firmware is nice to have, especially while the device is still very new. So having 10% less flash space is absolutely ok, of course. But if keeping compatibility with the stock firmware means having to live with more limiting choices of the vendor I'd always be in favor of getting the most out the device when running OpenWrt, because that's what the project is all about in the end. |
|
@dangowrt could we get your approval to start 1 of 6? :) |
target/linux/mediatek/dts/mt7986a-xiaomi-redmi-router-ax6000.dts
Outdated
Show resolved
Hide resolved
@aiamadeus do you still need some testing on u-boot replacement? (or anything else) I have a couple of these. I'm going to dump the nand shortly and then should be able to do some testing if that would be helpful. Manufacture date on the box is 2202.07 and came out of the box with 1.0.48 firmware. I've got root and checked that mtd7/mtd8 partitions are read-write. The LEDs appear to have embedded drivers. I haven't identified which yet but they are on the SPI bus, the 4 pin header goes to a LED board under the heat sink with two packages on it. |
|
What's left to get this merged in? |
|
Most of us can't open this lower cover perfectly, so I think we should give priority to submitting solutions that can be TTL-free? |
|
If using LEDs requires proprietary drivers, can we skip the LED-related ones first and then merge this new device in first? |
|
Up and stable for about 2 weeks for me. 0 issues so far. Device is rock stable and MT7986 is great :) |
imho this should be the best solution currently. |
|
I'm a complete newbie when it comes to the code here, I have a Redmi AX6000 myself and am eagerly awaiting OpenWRT support. I can see that 6 approvers are required for this PR to be merged into the OpenWRT master branch. So far there's 1 approval and 2 with review comments so essentially 5 more approvals are needed. The PR seems to be sound code wise according to the comments here so apart from the LEDs which can be revisited later (would majority of users care about this if option for OpenWRT support was granted to begin with?), what is the hold up? The LED strip as far as i am concerned is a waste of time to begin with, all multiple dots of one color with no symbols showing what each LED means, purely aesthetics rather than usefulness in my opinion. |
|
I just got one of these devices yesterday, and I was able to get my device flashed successfully. My observations thus-far have been:
|
Hardware specification:
SoC: MediaTek MT7986A 4x A53
Flash: ESMT F50L1G41LB 128 MB
RAM: K4A4G165WF-BCWE 512 MB
Ethernet: 4x 10/100/1000 Mbps
WiFi1: MT7976GN 2.4GHz ax 4x4
WiFi2: MT7976AN 5GHz ax 4x4
Button: Mesh, Reset
Flash instructions:
1. Gain ssh and serial port access, see the link below:
https://openwrt.org/toh/xiaomi/redmi_ax6000#installation
2. Use ssh or serial port to log in to the router, and
execute the following command:
nvram set boot_wait=on
nvram set flag_boot_rootfs=0
nvram set flag_boot_success=1
nvram set flag_last_success=1
nvram set flag_try_sys1_failed=8
nvram set flag_try_sys2_failed=8
nvram commit
3. Set a static ip on the ethernet interface of your computer
(e.g. default: ip 192.168.31.100, gateway 192.168.31.1)
4. Download the initramfs image, rename it to initramfs.bin,
and host it with the tftp server.
5. Interrupt U-Boot and run these commands:
setenv mtdparts nmbm0:1024k(bl2),256k(Nvram),256k(Bdata),2048k(factory),2048k(fip),256k(crash),256k(crash_log),112640k(ubi)
saveenv
tftpboot initramfs.bin
bootm
6. After openwrt boots up, use scp or luci web
to upload sysupgrade.bin to upgrade.
Revert to stock firmware:
Restore mtdparts back to default, then use the
vendor's recovery tool (Windows only).
Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
Can you try the latest code? |
Yes, that fixed it. The OpenWRT UI seems to be consistent with what's printed on the device now. Thanks! |
|
Picked. Thank you! |
|
@dangowrt excuse me, may i know this pr is closed? |
|
Because the commit has been picked into the main git branch. |





Hardware specification:
SoC: MediaTek MT7986A 4x A53
Flash: ESMT F50L1G41LB 128 MB
RAM: K4A4G165WF-BCWE 512 MB
Ethernet: 4x 10/100/1000 Mbps
WiFi1: MT7976GN 2.4GHz ax 4x4
WiFi2: MT7976AN 5GHz ax 4x4
Button: Mesh, Reset
Flash instructions:
nvram set boot_wait=on
nvram set flag_boot_rootfs=0
nvram set flag_last_success=1
nvram set flag_boot_success=1
nvram set flag_try_sys1_failed=8
nvram set flag_try_sys2_failed=8
nvram commit
setenv mtdparts nmbm0:1024k(bl2),256k(Nvram),256k(Bdata),2048k(factory),2048k(fip),256k(crash),256k(crash_log),112640k(ubi)
saveenv
tftpboot initramfs.bin
bootm
Note:
to write it into the commit message. Hope someone can help write the unlocking tutorial into the openwrt wiki.
Checklist: