mediatek: add support for Elecom WRC-X6000QS#21387
Conversation
|
This is my first PR to a new device not really similar to anything else I don't fully understand dts so there might be errors or trashes in it. Thank you! Tested: Problem: Full boot logiperf3 from 2.5G WAN port to serveriperf3 from PC over WiFi to routeriperf3 from PC over WiFi NAT WAN to serveriperf3 from PC over WiFi to bridged 2.5G WAN as pure AP |
| led_2g_r: led-5 { | ||
| color = <LED_COLOR_ID_RED>; | ||
| function = LED_FUNCTION_WLAN; | ||
| gpios = <&pio 15 GPIO_ACTIVE_LOW>; | ||
| function-enumerator = <0>; | ||
| }; |
There was a problem hiding this comment.
| led_2g_r: led-5 { | |
| color = <LED_COLOR_ID_RED>; | |
| function = LED_FUNCTION_WLAN; | |
| gpios = <&pio 15 GPIO_ACTIVE_LOW>; | |
| function-enumerator = <0>; | |
| }; | |
| led_2g_r: led-5 { | |
| color = <LED_COLOR_ID_RED>; | |
| function = LED_FUNCTION_WLAN_2GHZ; | |
| gpios = <&pio 15 GPIO_ACTIVE_LOW>; | |
| }; |
ref: https://elixir.bootlin.com/linux/v6.12.63/source/include/dt-bindings/leds/common.h#L109
There was a problem hiding this comment.
Changed. Thank you
|
|
||
| led_2g_g: led-6 { | ||
| color = <LED_COLOR_ID_GREEN>; | ||
| function = LED_FUNCTION_WLAN; |
|
|
||
| led_2g_w: led-7 { | ||
| color = <LED_COLOR_ID_WHITE>; | ||
| function = LED_FUNCTION_WLAN; |
| led_5g_r: led-8 { | ||
| color = <LED_COLOR_ID_RED>; | ||
| function = LED_FUNCTION_WLAN; | ||
| gpios = <&pio 12 GPIO_ACTIVE_LOW>; | ||
| function-enumerator = <1>; | ||
| }; |
There was a problem hiding this comment.
| led_5g_r: led-8 { | |
| color = <LED_COLOR_ID_RED>; | |
| function = LED_FUNCTION_WLAN; | |
| gpios = <&pio 12 GPIO_ACTIVE_LOW>; | |
| function-enumerator = <1>; | |
| }; | |
| led_5g_r: led-8 { | |
| color = <LED_COLOR_ID_RED>; | |
| function = LED_FUNCTION_WLAN_5GHZ; | |
| gpios = <&pio 12 GPIO_ACTIVE_LOW>; | |
| }; |
|
|
||
| led_5g_g: led-9 { | ||
| color = <LED_COLOR_ID_GREEN>; | ||
| function = LED_FUNCTION_WLAN; |
|
|
||
| led_5g_w: led-10 { | ||
| color = <LED_COLOR_ID_WHITE>; | ||
| function = LED_FUNCTION_WLAN; |
| read-only; | ||
| }; | ||
|
|
||
| partition@5A0000 { |
There was a problem hiding this comment.
Please use lowercase characters for unit addresses.
| partition@5A0000 { | |
| partition@5a0000 { |
There was a problem hiding this comment.
Changed. Thank you
ca46e72 to
d193cec
Compare
d193cec to
fa9908a
Compare
|
It seems the routing can be fast right after openwrt starts, but drops dramatically afterwards. iperf3 from PC over WiFi routed to WAN |
|
It seems it's a common problem with mtk that routing between LAN and WAN is of low performance but internet is just fine. Same 80Mbps goes with other openwrt forks with mtk hnat support. Reproducable on another MT8721 device, very similar results. If I copy files off a server on the WAN, it will be around 10MB/s but the internet is still 500Mbps+ When downloading at 55MB/s from the internet, the CPU is about 15-20% I think everything is working as expected now |
40ed57b to
2bdb92c
Compare
cd24510 to
1f62912
Compare
|
I think this can be merged. I just built and tested an hour ago on the latest main, also checked factory.bin on latest stock firmware 1.15 |
6cef703 to
32b1e3f
Compare
9277be3 to
ed5d3d1
Compare
|
I'm sorry I messed it up but had it back on track now. |
| wf_2g_5g_pins: wf-2g-5g-pins { | ||
| mux { | ||
| function = "wifi"; | ||
| groups = "wf_2g", "wf_5g"; | ||
| }; | ||
| }; |
There was a problem hiding this comment.
This is currently inside the spi_flash_pins node, it should go outside of it.
| status = "okay"; | ||
| }; | ||
|
|
||
| ethsys: syscon@15000000 { |
There was a problem hiding this comment.
The ethsys node exists in the arch/arm64/boot/dts/mediatek/mt7986a.dtsi file already. extend that instead dof creating here a new soc node and a new ethsys .
For example:
ðsys {
eth_reset: reset-controller {
compatible = "ti,syscon-reset";
#reset-cells = <1>;
ti,reset-bits = <0x34 0x04 0x34 0x04 0x34 0x04 0x28>;
};
}
There was a problem hiding this comment.
Thank you. I have cleaned up the code so duplicates are removed.
795e4ae to
e404288
Compare
|
Also added LED on WAN port Maxlinear GPY211C |
|
/claude |
|
Claude finished @hauke's task in 4m 19s —— View job Code Review
DTS File:
|
e404288 to
951f504
Compare
Elecom WRC-X6000QS is a 4804Mbps 4xMIMO 2.4/5 GHz 11ax (Wi-Fi 6) router
with 2.5Gbps WAN, based on MT7986b
Specification:
- SoC : MediaTek MT7986B
- RAM : DDR3 512 MiB
- Flash : Winbond 128MiB SPI NAND
- WLAN : 2.4/5 GHz 4T4R (MediaTek MT7986)
- Ethernet : 5x 10/100/1000 Mbps
- wan : Maxlinear Ethernet GPY211C
- lan : MediaTek MT7531
- LEDs/Keys (GPIO): 11x/4x
- UART : through-hole on PCB (J1)
- assignment : 3.3V, TX, RX, NC, GND from tri-angle marking
- settings : 115200n8
- Power : 12 VDC, 2 A
Flash layout:
dev: offset size name
mtd0: 0x00000000 0x00100000 "BL2"
mtd1: 0x00100000 0x00080000 "Ubootenv"
mtd2: 0x00180000 0x00200000 "Factory"
mtd3: 0x00380000 0x00200000 "FIP"
mtd4: 0x00580000 0x00020000 "Fwheader"
mtd5: 0x005a0000 0x03200000 "ubi"
mtd6: 0x037a0000 0x00380000 "Config"
mtd7: 0x03b20000 0x00020000 "Fwheader_2"
mtd8: 0x03b40000 0x03200000 "ubi_2"
mtd9: 0x06d40000 0x00380000 "Config_2"
mtd10: 0x070c0000 0x00100000 "persist"
mtd11: 0x071c0000 0x00040000 "Mrd"
mtd12: 0x07200000 0x00380000 "Backup"
UBI layout:
name: size:
kernel 0x00364000 dynamic
rootfs 0x00FFC000 dynamic
rootfs_data 0x01A47000 dynamic
Flash instruction using factory.bin image:
1. Boot WRC-X6000QS in router mode normally
2. Access to the WebUI ("http://192.168.2.1/") on the device
-> その他設定 (Other settings)
-> フォームウェア更新 (Update firmware)
-> ローカルファイル指定 (Specify local file)
3. Select the OpenWrt factory.bin image and click apply ("適用") button
4. Wait ~120 seconds to complete flashing
Switching to the stock firmware:
1. Load the elecom.sh script
. /lib/upgrade/elecom.sh
2. Check the current index of firmware partition
mstc_rw_bootnum
3. Set the bootnum to opposite value between 1 and 2
mstc_rw_bootnum value
example:
- step2 returned "1": mstc_rw_bootnum 2
- step2 returned "2": mstc_rw_bootnum 1
4. Reboot, to stock FW
5. Flash the stock FW to fuly revert back to original.
Note 1: With the stock firmware, it will flash to another partition and
toggle boot to that partition when any firmware is flashed.
For example when booting on ubi, the new firmware will be flashed
to ubi_2 and the router will boot from ubi_2 afterwards.
The 5th byte of the Persist partition is the boot value (0x01 or 0x02).
During my tests, it never switched to another boot partition if the
firmware failed boot. So if openwrt doesn't boot,
UART might be required to recover.
Note 2: bootmenu_delay=0 is set from factory so uboot menu is hidden.
Signed-off-by: Yuhei Amemiya <[email protected]>
951f504 to
2d7a58f
Compare
|
I have made changes regarding 1, 2, 3, 4, 5, 6, 7, 8, 9, and dropped 11, suggested by Claude |
|
|
||
| button-reset { | ||
| label = "reset"; | ||
| gpios = <&pio 11 GPIO_ACTIVE_HIGH>; |
There was a problem hiding this comment.
Isn't this GPIO_ACTIVE_LOW?
stock dts:
button@2 {
label = "reset";
linux,code = <0x198>;
gpios = <0x0d 0x0b 0x01>; // <--- the 3rd value (0x01): GPIO_ACTIVE_LOW
linux,input-type = <0x01>;
debounce-interval = <0x3c>;
};
There was a problem hiding this comment.
I will check again but at least one of them is randomly triggering openwrt to enter failsafe mode on boot
|
|
||
| button-wps { | ||
| label = "wps"; | ||
| gpios = <&pio 16 GPIO_ACTIVE_HIGH>; |
There was a problem hiding this comment.
Isn't this GPIO_ACTIVE_LOW?
stock dts:
button@1 {
label = "wps";
linux,code = <0x211>;
gpios = <0x0d 0x10 0x01>; // <--- the 3rd value (0x01): GPIO_ACTIVE_LOW
linux,input-type = <0x01>;
debounce-interval = <0x3c>;
};
| label = "wps"; | ||
| gpios = <&pio 16 GPIO_ACTIVE_HIGH>; | ||
| linux,code = <KEY_WPS_BUTTON>; | ||
| linux,input-type = <EV_SW>; |
There was a problem hiding this comment.
This is not a switch, but button.
| label = "ap"; | ||
| gpios = <&pio 7 GPIO_ACTIVE_LOW>; | ||
| linux,code = <BTN_0>; | ||
| }; |
There was a problem hiding this comment.
linux,input-type = <EV_SW>; is missing.
There was a problem hiding this comment.
Additionally, this and "router" button in this dts are also used for repeater mode, so those gpio pins cannot be assigned to each function on a one-to-one relationship.
|
I made some fixes and improvements for WRC-X6000QS and WRC-X6000GSD. https://github.com/musashino-build/openwrt/commits/devadd/wrc-x6000gsd/ |
|
@musashino205 Do you mind just take over? |
|
The previous LAN speed problem is identified as I am running 2.5Gb on 10Gb RJ45 SFP+ that they report to the switch as 10Gb causing other 10Gb senders to pause. So it's a problem of my setup. |
OK, I'll prepare. |
Thank you very much. |
| compatible = "spi-nand"; | ||
| reg = <1>; | ||
|
|
||
| spi-max-frequency = <20000000>; |
There was a problem hiding this comment.
52 MHz should work fine. Can it go higher?
| spi-max-frequency = <20000000>; | |
| spi-max-frequency = <52000000>; |
openwrt-ai
left a comment
There was a problem hiding this comment.
Fresh review of 1 commit (2d7a58f). Several issues already raised by other reviewers (button polarities, EV_SW on switch-ap, EV_SW mistakenly on the WPS button, repeater-mode use of router/AP switches) are not duplicated here.
Generated by Claude Code
| pinctrl-names = "default"; | ||
| pinctrl-0 = <&spi_flash_pins>; |
There was a problem hiding this comment.
These two lines are indented with 4 spaces, while the rest of the file (and every other DTS in target/linux/mediatek/dts/) uses tabs. Replace with tabs to match the file's existing style.
| pinctrl-names = "default"; | |
| pinctrl-0 = <&spi_flash_pins>; | |
| pinctrl-names = "default"; | |
| pinctrl-0 = <&spi_flash_pins>; |
Generated by Claude Code
| num-cs = <2>; | ||
| cs-gpios = <0>, <0>; |
There was a problem hiding this comment.
nit: num-cs = <2>; and cs-gpios = <0>, <0>; are unusual here — none of the other in-tree mt7986b boards (e.g. mt7986b-buffalo-wsr-6000ax8.dts, mt7986b-mercusys-mr90x-v1-common.dtsi, mt7981b-elecom-wrc-x3000gs3.dts) set these properties, and they all attach flash@0 rather than flash@1. Is there a hardware reason this device needs flash@1 (CS#1) and the placeholder cs-gpios = <0>, <0>; over the simpler flash@0 pattern?
Generated by Claude Code
| KERNEL_IN_UBI := 1 | ||
| IMAGE_SIZE := 51200k | ||
| IMAGES := sysupgrade.bin factory.bin | ||
| IMAGE/factory.bin := sysupgrade-tar | mstc-header 5.04(XZQ.0)b90 COMD | \ |
There was a problem hiding this comment.
nit: the mstc-header 5.04(XZQ.0)b90 COMD magic string is copied verbatim from elecom_wrc-x3000gs3 — the contributor noted in a comment they had no idea what the correct value should be for the X6000QS and just reused the X3000GS3 string. The factory image apparently flashes successfully, but it would be worth confirming whether the stock firmware version/model code for the X6000QS actually matches the X3000GS3, otherwise this should be replaced with the correct device-specific value before merge.
Generated by Claude Code
mediatek: add support for Elecom WRC-X6000QS
Elecom WRC-X6000QS is a 4804Mbps 4xMIMO 2.4/5 GHz 11ax (Wi-Fi 6) router
with 2.5Gbps WAN, based on MT7986b
Specification:
Flash layout:
dev: offset size name
mtd0: 0x00000000 0x00100000 "BL2"
mtd1: 0x00100000 0x00080000 "Ubootenv"
mtd2: 0x00180000 0x00200000 "Factory"
mtd3: 0x00380000 0x00200000 "FIP"
mtd4: 0x00580000 0x00020000 "Fwheader"
mtd5: 0x005a0000 0x03200000 "ubi"
mtd6: 0x037a0000 0x00380000 "Config"
mtd7: 0x03b20000 0x00020000 "Fwheader_2"
mtd8: 0x03b40000 0x03200000 "ubi_2"
mtd9: 0x06d40000 0x00380000 "Config_2"
mtd10: 0x070c0000 0x00100000 "persist"
mtd11: 0x071c0000 0x00040000 "Mrd"
mtd12: 0x07200000 0x00380000 "Backup"
UBI layout:
name: size:
kernel 0x00364000 dynamic
rootfs 0x00FFC000 dynamic
rootfs_data 0x01A47000 dynamic
Flash instruction using factory.bin image:
-> その他設定 (Other settings)
-> フォームウェア更新 (Update firmware)
-> ローカルファイル指定 (Specify local file)
Switching to the stock firmware:
Load the elecom.sh script
. /lib/upgrade/elecom.sh
Check the current index of firmware partition
mstc_rw_bootnum
Set the bootnum to opposite value between 1 and 2
mstc_rw_bootnum value
example:
Reboot, to stock FW
Flash the stock FW to fuly revert back to original.
Note 1: With the stock firmware, it will flash to another partition and
toggle boot to that partition when any firmware is flashed.
For example when booting on ubi, the new firmware will be flashed
to ubi_2 and the router will boot from ubi_2 afterwards.
The 5th byte of the Persist partition is the boot value (0x01 or 0x02).
During my tests, it never switched to another boot partition if the
firmware failed boot. So if openwrt doesn't boot,
UART might be required to recover.
Note 2: bootmenu_delay=0 is set from factory so uboot menu is hidden.
Signed-off-by: Yuhei Amemiya [email protected]