Repository navigation
qualcommax: add support for Mercusys MR80X v2 - #24919
Conversation
6536d73 to
ba0c541
Compare
ba0c541 to
5addf96
Compare
5aa38d8 to
91b8d2b
Compare
openwrt-ai
left a comment
There was a problem hiding this comment.
Commit checks
- 91b8d2b "qualcommax: add support for Mercusys MR80X v2" — the MAC address layout is a single line ("MACs come from the vendor tp_data UBI volume, mounted in preinit") and never says which MAC each interface gets. The diff derives four of them from
/tmp/tp_data/default-macoffset 0: LAN and label = base, WAN = base+1 (02_network), 2.4 GHz = base-1 and 5 GHz = base-2 (11-ath11k-caldata). Please spell that out one line per interface, usingxx:xx:xxfor the unit-specific bytes, as the other new-device commits do. The Hardware specification and Installation sections look complete.
Reviewed 3 new commits. The kernel patch matches v6.18.44 drivers/spi/spi-qpic-snand.c (hunk offsets are correct, nothing else in the tree touches that file before it applies), and CI on 91b8d2b is green.
Generated by Claude Code
91b8d2b to
7888b8d
Compare
openwrt-ai
left a comment
There was a problem hiding this comment.
Commit checks
- 7888b8d "qualcommax: add support for Mercusys MR80X v2" — the MAC note is still one line ("MACs come from the vendor tp_data UBI volume, mounted in preinit") while the diff assigns four addresses off
/tmp/tp_data/default-macoffset 0 (LAN/label = base, WAN = base+1, 2.4 GHz = base-1, 5 GHz = base-2). Only repeating because the commit was re-rolled — one line per interface,xx:xx:xxfor the unit-specific bytes, as other new-device commits do.
Reviewed 3 re-rolled commits against 91b8d2b. The interdiff is confined to the previous round's feedback and each change checks out: the envtools case folded into the existing 0:appsblenv group in alphabetical order, ethernet-switch@1d now matching reg = <29>, gmac0/ethernet0 dropped with ucidef_set_network_device_mac following to eth0 (gmac1 is the only enabled stmmac instance, so it registers first), DEVICE_VENDOR := MERCUSYS, IMAGES += factory.bin, the device renamed to mercusys_mr80x-v2 with the DTS renamed alongside so DEVICE_DTS still resolves and SUPPORTED_DEVICES derives correctly from Device/Default, the caldata cases moved into sort order, and 7486c0a now documents why the fwup container cannot be a flag on tplink-mkimage-2022.py. CI on 7888b8d is green.
Generated by Claude Code
7888b8d to
12d566b
Compare
12d566b to
7e9535c
Compare
openwrt-ai
left a comment
There was a problem hiding this comment.
Commit checks
- 7e9535c "qualcommax: add support for Mercusys MR80X v2" — the MAC address layout is still the single line "MACs come from the vendor tp_data UBI volume, mounted in preinit"; it needs one line per interface (LAN/label =
default-mac+0, WAN = +1, 2.4 GHz = -1, 5 GHz = -2),xx:xx:xxfor the unit-specific bytes.
Generated by Claude Code
7e9535c to
a969ee3
Compare
|
Look at #25153
Not entirely, because, for instance, in the case of multiple simultaneous LAN-to-LAN connections in non-hardware-offloading mode, the sum of their throughput will not exceed 1 Gbps. |
Thanks, I've checked it, the race isn't what my sgmii note was about , my wording was wrong in the description and forgot to update here. The 7-of-8 TX failure was gmac1 left at sgmii while the CPU port moved to 2500base-x. So testing both ends at 2500base-x this board links at 2.5 Gbps on 8/8 boots without #25153. |
Good point, that only holds on the offloaded path, and anything on the software path shares the trunk. HSGMII works so switching both gmac1 and the CPU port to Updated the Description of this PR. |
a969ee3 to
eebbd44
Compare
|
Tested 8/8 9 hours ago, tested today again and the device rate come to 7/8, investigating the issue... |
|
Updates:
To avoid delaying this PR I'm reverting the CPU port to sgmii. Once the fix is upstream it can move back to HSGMII and be retested. |
eebbd44 to
599e932
Compare
599e932 to
249dabc
Compare
Formality Check: Suggestions AvailableWe checked this pull request against the contribution guidelines. Here is what needs your attention:
|
249dabc to
cbdbe0f
Compare
qcom_spi_ecc_init_ctx_pipelined() installs the ooblayout but never publishes the ECC context it allocates, and the cleanup path frees that context without clearing snandc->qspi->ecc. The ooblayout callbacks then run against a stale pointer. On IPQ5018 the qcom,smem-part parser makes the first spi-nand probe defer, so the retry computes the OOB layout from the freed context and spinand_init() aborts with -512. About half of the boots on a Mercusys MR80X ended in "Waiting for root device /dev/ubiblock0_1". Accepted upstream for v7.4 as f94c9b68bb5f, tagged for stable. Signed-off-by: Johan Alvarado <[email protected]> Link: openwrt#24919 Signed-off-by: Robert Marko <[email protected]>
Mercusys devices whose stock web UI expects an fwup container reject the tplink-image-2022 container: the loader picks its verification algorithm from the fw-type string at offset 0x14, which that container does not write. Build the container the loader accepts, with the fw-type string, the support list and the MD5 placeholder digest in place. This is a separate script rather than a flag on tplink-mkimage-2022.py because only the first 0x14 bytes match, the BE length and the salted MD5 over file[4:]. That script writes 0xff filler up to 0x1014, a table there (>2I rootfs_size/num_items, then >I32s2I entries), data at a fixed 0x1814 base, the rootfs first and a packed >4B1I2I soft version. The fwup container has no table: 0x2c records of name[32] + >III base, next_off, size, each followed by its own data and chained through next_off until 0, the rootfs appended after the last record, and the soft version as ASCII soft_ver: in an ordinary record. Signed-off-by: Johan Alvarado <[email protected]> Link: openwrt#24919 Signed-off-by: Robert Marko <[email protected]>
Hardware: SoC: Qualcomm IPQ5018 (2x Cortex-A53) RAM: 256 MiB DDR3 Flash: 128 MiB SPI-NAND (ESMT) Switch: Realtek RTL8367S, 4x GbE (3x LAN + 1x WAN), SGMII CPU port WiFi: IPQ5018 2.4 GHz, QCN6122 5 GHz, both 802.11ax LEDs: system (green/amber), WAN, LAN1-3 Button: reset UART: 115200 8N1, 3.3V, on-board header Wi-Fi is left disabled: 256 MiB is too few for ath11k, same as on the ELECOM WRC-X3000GS2. Notes: - The label reads "Ver 2.20", but the vendor firmware only ever calls the board V2: the GPL tree is GPL_MR80Xv2, PRODUCT_NAME is MR80Xv2, the running system reports "MR80X V2" and the fwup support list carries product_ver 2.0.0. The trailing digits are a production sub-revision, so the port is named v2. - MAC1 runs sgmii through the UNIPHY PCS to RTL8367S port 6. The link is wired for HSGMII and 2500base-x does come up, but only when gmac1 and the CPU port carry the same phy-mode: the UNIPHY PCS belongs to the conduit (pcs-handle = <&uniphy0> in ipq5018-ess.dtsi), so setting the CPU port alone leaves the switch running HSGMII into a SerDes still clocked for SGMII. With both ends at 2500base-x the trunk still dies on some boots: over 12 reboots, 2 came up with the CPU port passing no traffic at all - eth0 transmitting while s00_p06_ifInOctets stayed at 0, no FCS errors, the link reporting 2.5 Gbps. That matches the bring-up ordering race described in openwrt#25153, where the switch end of the trunk is configured before the IPQ5018 UNIPHY resets and recalibrates its PLL. sgmii has not reproduced it, so the port ships at sgmii until that fix lands. - MAC addresses come from default-mac in the vendor tp_data UBI volume, 6 raw bytes at offset 0, mounted read-only during preinit: label default-mac LAN default-mac WAN default-mac + 1 2.4 GHz default-mac - 1 5 GHz default-mac - 2 - Sysupgrade A/B ping-pongs rootfs/rootfs_1 via tp_boot_idx, switched only after the new slot is fully written. primaryboot stays 0, the stock loader and the button recovery rely on it. - factory.bin is wrapped in the Mercusys fwup container the stock web UI accepts (scripts/mercusys-fwup.py). The generic tplink-image-2022 container is rejected: the loader picks its verification algorithm from the fw-type string, which that container does not write. - The board needs the backported spi-qpic-snand ECC context fix, otherwise about half of the boots end in "Waiting for root device /dev/ubiblock0_1". Installation: In the stock web UI go to Advanced -> System -> Firmware Update -> Local Update, browse for openwrt-qualcommax-ipq50xx-mercusys_mr80x-v2-squashfs-factory.bin and press UPDATE. Tested on stock firmware MR80X(EU)_V2.20_1.1.7 Build 20250415 (Multi-language). The U-Boot web recovery does not accept this image: it verifies an RSA1024 signature and has no keyless path. Use the stock web UI. Signed-off-by: Johan Alvarado <[email protected]> Link: openwrt#24919 Signed-off-by: Robert Marko <[email protected]>
cbdbe0f to
938f67a
Compare
|
Thanks! Rebased on top of main and merged! |
qcom_spi_ecc_init_ctx_pipelined() installs the ooblayout but never publishes the ECC context it allocates, and the cleanup path frees that context without clearing snandc->qspi->ecc. The ooblayout callbacks then run against a stale pointer. On IPQ5018 the qcom,smem-part parser makes the first spi-nand probe defer, so the retry computes the OOB layout from the freed context and spinand_init() aborts with -512. About half of the boots on a Mercusys MR80X ended in "Waiting for root device /dev/ubiblock0_1". Accepted upstream for v7.4 as f94c9b68bb5f, tagged for stable. Signed-off-by: Johan Alvarado <[email protected]> Link: openwrt#24919 Signed-off-by: Robert Marko <[email protected]>
Mercusys devices whose stock web UI expects an fwup container reject the tplink-image-2022 container: the loader picks its verification algorithm from the fw-type string at offset 0x14, which that container does not write. Build the container the loader accepts, with the fw-type string, the support list and the MD5 placeholder digest in place. This is a separate script rather than a flag on tplink-mkimage-2022.py because only the first 0x14 bytes match, the BE length and the salted MD5 over file[4:]. That script writes 0xff filler up to 0x1014, a table there (>2I rootfs_size/num_items, then >I32s2I entries), data at a fixed 0x1814 base, the rootfs first and a packed >4B1I2I soft version. The fwup container has no table: 0x2c records of name[32] + >III base, next_off, size, each followed by its own data and chained through next_off until 0, the rootfs appended after the last record, and the soft version as ASCII soft_ver: in an ordinary record. Signed-off-by: Johan Alvarado <[email protected]> Link: openwrt#24919 Signed-off-by: Robert Marko <[email protected]>
Hardware: SoC: Qualcomm IPQ5018 (2x Cortex-A53) RAM: 256 MiB DDR3 Flash: 128 MiB SPI-NAND (ESMT) Switch: Realtek RTL8367S, 4x GbE (3x LAN + 1x WAN), SGMII CPU port WiFi: IPQ5018 2.4 GHz, QCN6122 5 GHz, both 802.11ax LEDs: system (green/amber), WAN, LAN1-3 Button: reset UART: 115200 8N1, 3.3V, on-board header Wi-Fi is left disabled: 256 MiB is too few for ath11k, same as on the ELECOM WRC-X3000GS2. Notes: - The label reads "Ver 2.20", but the vendor firmware only ever calls the board V2: the GPL tree is GPL_MR80Xv2, PRODUCT_NAME is MR80Xv2, the running system reports "MR80X V2" and the fwup support list carries product_ver 2.0.0. The trailing digits are a production sub-revision, so the port is named v2. - MAC1 runs sgmii through the UNIPHY PCS to RTL8367S port 6. The link is wired for HSGMII and 2500base-x does come up, but only when gmac1 and the CPU port carry the same phy-mode: the UNIPHY PCS belongs to the conduit (pcs-handle = <&uniphy0> in ipq5018-ess.dtsi), so setting the CPU port alone leaves the switch running HSGMII into a SerDes still clocked for SGMII. With both ends at 2500base-x the trunk still dies on some boots: over 12 reboots, 2 came up with the CPU port passing no traffic at all - eth0 transmitting while s00_p06_ifInOctets stayed at 0, no FCS errors, the link reporting 2.5 Gbps. That matches the bring-up ordering race described in openwrt#25153, where the switch end of the trunk is configured before the IPQ5018 UNIPHY resets and recalibrates its PLL. sgmii has not reproduced it, so the port ships at sgmii until that fix lands. - MAC addresses come from default-mac in the vendor tp_data UBI volume, 6 raw bytes at offset 0, mounted read-only during preinit: label default-mac LAN default-mac WAN default-mac + 1 2.4 GHz default-mac - 1 5 GHz default-mac - 2 - Sysupgrade A/B ping-pongs rootfs/rootfs_1 via tp_boot_idx, switched only after the new slot is fully written. primaryboot stays 0, the stock loader and the button recovery rely on it. - factory.bin is wrapped in the Mercusys fwup container the stock web UI accepts (scripts/mercusys-fwup.py). The generic tplink-image-2022 container is rejected: the loader picks its verification algorithm from the fw-type string, which that container does not write. - The board needs the backported spi-qpic-snand ECC context fix, otherwise about half of the boots end in "Waiting for root device /dev/ubiblock0_1". Installation: In the stock web UI go to Advanced -> System -> Firmware Update -> Local Update, browse for openwrt-qualcommax-ipq50xx-mercusys_mr80x-v2-squashfs-factory.bin and press UPDATE. Tested on stock firmware MR80X(EU)_V2.20_1.1.7 Build 20250415 (Multi-language). The U-Boot web recovery does not accept this image: it verifies an RSA1024 signature and has no keyless path. Use the stock web UI. Signed-off-by: Johan Alvarado <[email protected]> Link: openwrt#24919 Signed-off-by: Robert Marko <[email protected]>
qcom_spi_ecc_init_ctx_pipelined() installs the ooblayout but never publishes the ECC context it allocates, and the cleanup path frees that context without clearing snandc->qspi->ecc. The ooblayout callbacks then run against a stale pointer. On IPQ5018 the qcom,smem-part parser makes the first spi-nand probe defer, so the retry computes the OOB layout from the freed context and spinand_init() aborts with -512. About half of the boots on a Mercusys MR80X ended in "Waiting for root device /dev/ubiblock0_1". Accepted upstream for v7.4 as f94c9b68bb5f, tagged for stable. Signed-off-by: Johan Alvarado <[email protected]> Link: openwrt#24919 Signed-off-by: Robert Marko <[email protected]>
Mercusys devices whose stock web UI expects an fwup container reject the tplink-image-2022 container: the loader picks its verification algorithm from the fw-type string at offset 0x14, which that container does not write. Build the container the loader accepts, with the fw-type string, the support list and the MD5 placeholder digest in place. This is a separate script rather than a flag on tplink-mkimage-2022.py because only the first 0x14 bytes match, the BE length and the salted MD5 over file[4:]. That script writes 0xff filler up to 0x1014, a table there (>2I rootfs_size/num_items, then >I32s2I entries), data at a fixed 0x1814 base, the rootfs first and a packed >4B1I2I soft version. The fwup container has no table: 0x2c records of name[32] + >III base, next_off, size, each followed by its own data and chained through next_off until 0, the rootfs appended after the last record, and the soft version as ASCII soft_ver: in an ordinary record. Signed-off-by: Johan Alvarado <[email protected]> Link: openwrt#24919 Signed-off-by: Robert Marko <[email protected]>
Hardware: SoC: Qualcomm IPQ5018 (2x Cortex-A53) RAM: 256 MiB DDR3 Flash: 128 MiB SPI-NAND (ESMT) Switch: Realtek RTL8367S, 4x GbE (3x LAN + 1x WAN), SGMII CPU port WiFi: IPQ5018 2.4 GHz, QCN6122 5 GHz, both 802.11ax LEDs: system (green/amber), WAN, LAN1-3 Button: reset UART: 115200 8N1, 3.3V, on-board header Wi-Fi is left disabled: 256 MiB is too few for ath11k, same as on the ELECOM WRC-X3000GS2. Notes: - The label reads "Ver 2.20", but the vendor firmware only ever calls the board V2: the GPL tree is GPL_MR80Xv2, PRODUCT_NAME is MR80Xv2, the running system reports "MR80X V2" and the fwup support list carries product_ver 2.0.0. The trailing digits are a production sub-revision, so the port is named v2. - MAC1 runs sgmii through the UNIPHY PCS to RTL8367S port 6. The link is wired for HSGMII and 2500base-x does come up, but only when gmac1 and the CPU port carry the same phy-mode: the UNIPHY PCS belongs to the conduit (pcs-handle = <&uniphy0> in ipq5018-ess.dtsi), so setting the CPU port alone leaves the switch running HSGMII into a SerDes still clocked for SGMII. With both ends at 2500base-x the trunk still dies on some boots: over 12 reboots, 2 came up with the CPU port passing no traffic at all - eth0 transmitting while s00_p06_ifInOctets stayed at 0, no FCS errors, the link reporting 2.5 Gbps. That matches the bring-up ordering race described in openwrt#25153, where the switch end of the trunk is configured before the IPQ5018 UNIPHY resets and recalibrates its PLL. sgmii has not reproduced it, so the port ships at sgmii until that fix lands. - MAC addresses come from default-mac in the vendor tp_data UBI volume, 6 raw bytes at offset 0, mounted read-only during preinit: label default-mac LAN default-mac WAN default-mac + 1 2.4 GHz default-mac - 1 5 GHz default-mac - 2 - Sysupgrade A/B ping-pongs rootfs/rootfs_1 via tp_boot_idx, switched only after the new slot is fully written. primaryboot stays 0, the stock loader and the button recovery rely on it. - factory.bin is wrapped in the Mercusys fwup container the stock web UI accepts (scripts/mercusys-fwup.py). The generic tplink-image-2022 container is rejected: the loader picks its verification algorithm from the fw-type string, which that container does not write. - The board needs the backported spi-qpic-snand ECC context fix, otherwise about half of the boots end in "Waiting for root device /dev/ubiblock0_1". Installation: In the stock web UI go to Advanced -> System -> Firmware Update -> Local Update, browse for openwrt-qualcommax-ipq50xx-mercusys_mr80x-v2-squashfs-factory.bin and press UPDATE. Tested on stock firmware MR80X(EU)_V2.20_1.1.7 Build 20250415 (Multi-language). The U-Boot web recovery does not accept this image: it verifies an RSA1024 signature and has no keyless path. Use the stock web UI. Signed-off-by: Johan Alvarado <[email protected]> Link: openwrt#24919 Signed-off-by: Robert Marko <[email protected]>
This patch series adds support for the Mercusys MR80X v2.
Note: Wi-Fi related peripherals are disabled to save available memory, same as on the ELECOM WRC-X3000GS2.
Usefull Links: