Skip to content

ramips: add support for ZyXEL LTE3302 - #17706

Open
perrin-1 wants to merge 3 commits into
openwrt:mainfrom
perrin-1:feature/zyxel_lte3302
Open

perrin-1 wants to merge 3 commits into
openwrt:mainfrom
perrin-1:feature/zyxel_lte3302

Conversation

@perrin-1

@perrin-1 perrin-1 commented Jan 23, 2025 •

Copy link
Copy Markdown

ramips: add support for ZyXEL LTE3302

The ZyXEL LTE3302-M432 is a 4G indoor CPE with 2 external LTE antennas. There are multiple variants of the device. This PR includes support for the "Deutsche Telekom" as well as the "genuine ZyXEL" variant. The device is fully functional including the LTE modem.

Specifications

  • SoC: MediaTek MT7620N
  • RAM: 64 MB
  • Flash: 16 MB NOR (W25Q128FV)
  • WiFi: MediaTek MT7620N built-in wifi
  • Switch: 2 LAN ports (100M)
  • LTE: WNC M18QW modem
  • SIM: 1 micro-SIM slot
  • Buttons: Reset, WPS
  • LEDs: Multicolor LTE signal, multicolor internet, WiFi, LAN, Battery

The device is built as an indoor ethernet to LTE bridge or router with WiFi.

UART Serial

57600 8N1, located on the unpopulated 4 pin header J8:

[o] GND
[o] RX
[o] TX
[o] 3.3V Vcc

MAC assignment

  • lan: label MAC (base, on the device bottom)
  • wlan: label MAC + 1

The MAC address and the WiFi calibration data are read from the JBOOT config partition by a new NVMEM layout driver (see below), because their offsets differ between units.

Installation

  1. Boot the bootloader into recovery by pushing and holding the reset key while powering on the device.
  2. Wait until the lights start flashing quickly.
  3. Open http://192.168.123.254
  4. Upload openwrt-ramips-mt7620-zyxel_lte3302-squashfs-factory.bin (or -dt- for the Telekom variant, see ROM_ID below).
    If http doesn't work, it can be done with curl:
    curl -F [email protected] http://192.168.123.254/upg
    where XXXXX.bin is the name of the firmware file.
  5. Wait for OpenWrt to boot (first boot takes about 80 s) and ssh to [email protected]

The variants differ by their ROM_ID, which can be checked in the bootloader using the info command. The ROM_ID is needed for the factory image so that the bootloader recognizes and accepts it:

Image ROM_ID
zyxel_lte3302 ZXL6E2431001
zyxel_lte3302-dt (Deutsche Telekom) ZXL6E2431002

Commits

  • ramips: add support for ZyXEL LTE3302: device support, including two kernel patches for the WNC M18QW modem (qmi_wwan DTR quirk, option serial interfaces).
  • generic: nvmem: add AMIT JBOOT config layout: new NVMEM layout driver (amit,jboot-config) for the JBOOT factory config block. JBOOT stores the factory data as variable length records, so the absolute offsets of MAC and calibration data differ between units of the same model. The driver validates the STAG/CSXF headers and checksums, walks the records and exposes mac-address and eeprom cells. Other JBOOT based boards can use it later instead of jboot_config_read in userspace.
  • ramips: lte3302: use JBOOT nvmem layout for MAC and eeprom: uses the new layout for the LTE3302.

Tested

On an LTE3302-M432 (Telekom variant) with kernel 6.18: ethernet and wlan MACs (label MAC / +1), WiFi calibration (RF chipset 7620 detected), LTE modem (qmi_wwan, option), sysupgrade.

@perrin-1 perrin-1 changed the title Add support for ZyXEL LTE3301 ramips: add support for ZyXEL LTE3301 Jan 23, 2025
@github-actions github-actions Bot added the target/ramips pull request/issue for ramips target label Jan 23, 2025
@obsy

obsy commented Jan 23, 2025

Copy link
Copy Markdown
Contributor

Wrong title.

@perrin-1

Copy link
Copy Markdown
Author

Wrong title.

Can you be a little bit more precise on what you need to be changed? Is it the Title of the PR? If yes, I would require some more hint on what to change in the title....

@namiltd

namiltd commented Jan 24, 2025 •

Copy link
Copy Markdown
Contributor

Your commits should have a title starting with "ramips: "
They should also have a short description.

Look at: https://github.com/openwrt/openwrt/actions/runs/12932084171/job/36083119884

@perrin-1

Copy link
Copy Markdown
Author

Alright, got it. What would be your suggestion on how to fix that? Fix it with a further commit (i need to update the leds in the dts) or revert this PR and add a new one?

@obsy

obsy commented Jan 24, 2025

Copy link
Copy Markdown
Contributor

LTE3302

title: Are you supporting LTE3302 or LTE3301?

@perrin-1 perrin-1 changed the title ramips: add support for ZyXEL LTE3301 ramips: add support for ZyXEL LTE3302 Jan 24, 2025
@perrin-1

Copy link
Copy Markdown
Author

title: Are you supporting LTE3302 or LTE3301?

OMG, my bad. I am targeting the LTE3302. Sorry for the typo...

@perrin-1

Copy link
Copy Markdown
Author

I don't want to overcomplicate things, but since this is my first PR, can somebody please advise if it makes sense to keep this PR open and correct the issues in this PR or close it in favor for a new PR with all the issues corrected?

@obsy

obsy commented Jan 24, 2025

Copy link
Copy Markdown
Contributor

Keep it open and fix PR.

@perrin-1
perrin-1 force-pushed the feature/zyxel_lte3302 branch from 0f5d487 to 195fe3a Compare January 24, 2025 18:43
@perrin-1
perrin-1 marked this pull request as draft January 24, 2025 18:45
@perrin-1
perrin-1 marked this pull request as ready for review January 25, 2025 07:37
@perrin-1
perrin-1 force-pushed the feature/zyxel_lte3302 branch 3 times, most recently from ca414a2 to 9ce65af Compare January 26, 2025 05:56
@Neustradamus

Copy link
Copy Markdown

@perrin-1: Good job!

@perrin-1
perrin-1 requested review from Noltari and namiltd January 27, 2025 10:48
@perrin-1
perrin-1 requested a review from namiltd January 29, 2025 06:30
@namiltd

namiltd commented Jan 29, 2025 •

Copy link
Copy Markdown
Contributor

The line ucidef_set_led_netdev "wifi_led" "WiFi" "green:wifi" "phy0-ap0" can be removed if you add trigger:

                led-5 {
		        color = <LED_COLOR_ID_GREEN>;
			function = LED_FUNCTION_WLAN;
			gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
			linux,default-trigger = "phy0tpt";
                };

@perrin-1

Copy link
Copy Markdown
Author

The line ucidef_set_led_netdev "wifi_led" "WiFi" "green:wifi" "phy0-ap0" can be removed if you add trigger:

                led-5 {
		        color = <LED_COLOR_ID_GREEN>;
			function = LED_FUNCTION_WLAN;
			gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
			linux,default-trigger = "phy0tpt";
                };

fixed in f6ee014

@hauke

hauke commented Feb 9, 2025

Copy link
Copy Markdown
Member

Please use a name and not just for initials as author and in the SoB line.

@perrin-1
perrin-1 force-pushed the feature/zyxel_lte3302 branch from e937640 to e9f5508 Compare February 10, 2025 20:25
@perrin-1

Copy link
Copy Markdown
Author

Please use a name and not just for initials as author and in the SoB line.

I've changed my git username. hope this is now ok...

@perrin-1
perrin-1 requested a review from hauke February 19, 2025 06:18

@DragonBluep DragonBluep left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Neustradamus

Copy link
Copy Markdown

@perrin-1: For information, there is an old PR done by @CHKDSK88, can you look?

@perrin-1

Copy link
Copy Markdown
Author

@perrin-1: For information, there is an old PR done by @CHKDSK88, can you look?

* [ramips: mt7620: add support for ZyXEL LTE3302-M432 #10050](https://github.com/openwrt/openwrt/pull/10050)

Thanks for pointing me towards this PR. I did not notice that one before I created my own. However I think the old PR is outdated and not fully functional, especially regarding the issues with the modem which are solved in this PR. Also the other PR only contains a single variant and not both like this one.

Comment on lines +138 to +140
macaddr_config: macaddr@e2cd {
compatible = "mac-base";
reg = <0xc2cd 0x6>;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is that a typo? (e2cd, c2cd)

@kke kke May 27, 2025 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(on my eeprom dump the mac address is at e2cc)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is that a typo? (e2cd, c2cd)

c2cd is a typo - needs to be e2cd in my device.

(on my eeprom dump the mac address is at e2cc)

that seems to be the same issue as the RF Chipset issue. Your device seems to have a different eeprom contents. We'll have to figure out if that is due to the device being somewhat different (branding?) or if there are multiple versions of the eeprom data. In the latter case, we'd have to keep using the userspace programs to set the mac address and rf frontends, which is not nice...

#size-cells = <1>;

eeprom_config: eeprom@e07c {
reg = <0xe07c 0x200>;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0xe07c in my firmware is 0x02 0x20.

This results in Invalid RF chipset 0x2002 detected in dmesg.

The next byte is 0x76. So offset 0xe07d should match RF7620.

With that offset, I have wifi working.

The WiFi MAC is the MAC printed on the label + 1. (Ending in e2 instead of e1).

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, that is not good. So it seems that these eeprom contents are not stable.
What is the exact model and brand of your device?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have bought it straight from the shop like a regular customer a long long time ago. It was not some operator deal or operator branded device.

The label on the bottom does not specify any model name.

SN is S182Z05001456.

@Neustradamus

Copy link
Copy Markdown

@perrin-1: Have you progressed on it?

@perrin-1

Copy link
Copy Markdown
Author

@perrin-1: Have you progressed on it?

Sorry, did not make any further progress as the problem with the eeprom data seems to be not solvable for me. Did not have the time to further debug and did not continue working on this project. So if no one else can step in, we might have to close this pr.

@openwrt-ai openwrt-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most important item: the two kernel patches are filed under patches-6.6/, but ramips on main has moved to KERNEL_PATCHVER:=6.18 (only patches-6.18/ exists in-tree now), so they would not be applied — see the inline comment. The DTS also still ships with CRLF line endings despite an earlier resolved thread. Both inline. One nit on redundant variant variables.

The macaddr@e2cd node name vs reg = <0xc2cd> offset mismatch and the RF-chipset/MAC offset questions are already under active discussion in existing threads, so not re-flagged here.


Generated by Claude Code

@@ -0,0 +1,172 @@
// SPDX-License-Identifier: GPL-2.0-or-later
#include "mt7620n.dtsi"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All 172 lines of this DTS use CRLF (Windows) line endings. An earlier thread flagged this and was marked resolved, but the current head commit still has them on every line. In-tree DTS files are LF-only. Please convert to LF-only line endings (this also clears the trailing space after the semicolon on the openwrt,ih-magic = <IH_MAGIC_OKLI>; line at L119 and the trailing tabs on the blank line between the firmware and config partitions).


Generated by Claude Code

Comment thread target/linux/ramips/image/mt7620.mk Outdated
$(Device/zyxel_lte3302)
DEVICE_DTS := mt7620n_zyxel_lte3302
DEVICE_VENDOR := ZyXEL
DEVICE_MODEL := LTE3302-M432

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: zyxel_lte3302-dt already inherits DEVICE_VENDOR and DEVICE_MODEL from $(Device/zyxel_lte3302) and redefines them to identical values, so these two lines are redundant. Drop them and keep only the variant-specific overrides (DEVICE_DTS, DEVICE_VARIANT, DLINK_ROM_ID, SUPPORTED_DEVICES).


Generated by Claude Code

@openwrt-ai openwrt-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fresh review of the single commit at e9f5508. The most important item: the two kernel patches are added under patches-6.6/, but ramips is on kernel 6.18 on current main, so they would never be applied and the LTE modem support would be missing from the build — see the inline comments for the move to patches-6.18/. A likely-real DTS offset bug (macaddr@e2cd vs reg = <0xc2cd ...>) and a couple of whitespace/wording nits are also flagged inline.


Generated by Claude Code

Comment thread target/linux/ramips/image/mt7620.mk Resolved
@ddimension

ddimension commented Oct 6, 2026 •

Copy link
Copy Markdown

Take a look at my pr #25670. Perhaps jboot supports helps here, too?

@perrin-1

Copy link
Copy Markdown
Author

Take a look at my pr #25670. Perhaps jboot supports helps here, too?

@ddimension That might acutally help. So you managed to flash stock uboot on the device thus, having the config as uboot vars instead of the jboot binary?

@perrin-1
perrin-1 force-pushed the feature/zyxel_lte3302 branch from e9f5508 to 76689ab Compare October 19, 2026 07:31
@openwrt openwrt Bot added the kernel pull request/issue with Linux kernel related changes label Oct 19, 2026
@perrin-1
perrin-1 force-pushed the feature/zyxel_lte3302 branch from 76689ab to 8528359 Compare October 19, 2026 07:57
@perrin-1

Copy link
Copy Markdown
Author

Rebased onto current main (kernel 6.18) and reworked the MAC / calibration data handling.

Root cause of the different offsets: the JBOOT config partition stores the factory data as a STAG/CSXF header followed by tightly packed, variable length records. Some of them hold per-unit strings (WiFi key, WPS PIN, passwords) of varying length, so the absolute offsets of the MAC and the eeprom records shift between units of the same model (e.g. 0xe07c/0xe2cd on my unit vs. 0xe07d/0xe2cc on @kke's). A fixed-layout can't describe that.

Changes (details in the updated PR description):

  • New generic NVMEM layout driver amit,jboot-config, which parses the records and exposes mac-address and eeprom cells, independent of the absolute offsets.
  • The LTE3302 uses it on a jboot-config sub-partition at 0xe000 of config. No more userspace MAC/caldata handling for this device, and jboot-tools is no longer installed.
  • Addressed the review comments:
    • modem patches moved to patches-6.18/ and regenerated with git format-patch
    • DTS converted to LF, trailing whitespace removed
    • redundant DEVICE_VENDOR/DEVICE_MODEL dropped
    • commit message fixed
    • full name in author and SoB

Tested on 6.18 (LTE3302-M432, Telekom variant): eth0 = label MAC, wlan = label MAC + 1, RF chipset 7620 detected, LTE modem enumerates (qmi_wwan, option). First boot is now ~80 s.

@kke: since your unit has the shifted layout, could you test the zyxel_lte3302 image (or -dt, depending on your ROM_ID) and post dmesg | grep -iE "jboot|random MAC|RF chipset" plus the MACs of eth0/phy0?

@ddimension: thanks for the pointer to #25670. I went for an NVMEM layout instead of replacing JBOOT, because the offsets are per unit, not per variant. Your M209/Q222 offsets (0xe2a8 vs 0xe07c) might be the same effect, so the layout could be useful for the LTE3301 as well.

@openwrt openwrt Bot added the not following guidelines Pull request does not follow formatting guidelines label Oct 19, 2026
@perrin-1
perrin-1 force-pushed the feature/zyxel_lte3302 branch from dfa764d to 064dde7 Compare October 19, 2026 09:50
@openwrt openwrt Bot removed the not following guidelines Pull request does not follow formatting guidelines label Oct 19, 2026
@perrin-1
perrin-1 force-pushed the feature/zyxel_lte3302 branch from 064dde7 to 9606816 Compare October 19, 2026 11:45
@openwrt openwrt Bot added the target/mediatek pull request/issue for mediatek target label Oct 19, 2026
The ZyXEL LTE3302-M432 is a 4G indoor CPE with 2 external LTE antennas.
There are multiple variants of the device. This patch includes support
for the "Deutsche Telekom" as well as the "genuine ZyXEL" variant.
The device is fully functional including the LTE modem.

Specifications:

    SoC: MediaTek MT7620N
    RAM: 64 MB
    Flash: 16 MB NOR (W25Q128FV)
    WiFi: MediaTek MT7620N built-in wifi
    Switch: 2 LAN ports (100M)
    LTE: WNC M18QW modem
    SIM: 1 micro-SIM slot
    Buttons: Reset, WPS
    LEDs: Multicolor LTE signal, multicolor internet, WiFi, LAN, Battery

The device is built as an indoor ethernet to LTE bridge or router with
WiFi.

UART Serial:

57600 8N1
Located on unpopulated 4 pin header J8:

[o] GND
[o] RX
[o] TX
[o] 3.3V Vcc

MAC assignment:

    lan:  label MAC (base, on the device bottom)
    wlan: label MAC + 1

Installation:

    Boot the bootloader into recovery by pushing and holding the reset
    key while powering on the device.
    Wait until the lights start flashing quickly.
    Open http://192.168.123.254
    Upload openwrt-ramips-mt7620-zyxel_lte3302-squashfs-factory.bin
    If http doesn't work, it can be done with curl:
    curl -F [email protected] http://192.168.123.254/upg
    where XXXXX.bin is the name of the firmware file.
    Wait for OpenWrt to boot and ssh to [email protected]

The variants differ by their ROM_ID, which can be checked in the
bootloader using the "info" command. The ROM_ID is needed for the
factory image so that the bootloader recognizes and accepts it.

Signed-off-by: Ulv Michel <[email protected]>
Devices booting the AMIT JBOOT loader (D-Link DWR/DIR, Zyxel LTE, ...)
store their factory data in a config partition as a STAG/CSXF header
followed by tightly packed, variable length records. Some records hold
per-unit strings (keys, PINs) of varying length, so the absolute offsets
of the MAC address and the wireless calibration data differ between units
of the same model and cannot be described with a fixed-layout.

Add an NVMEM layout driver which validates the STAG and CSXF headers and
their checksums, walks the record list and exposes:
 - "mac-address" (record type 0x42, id 0x30), supports a MAC offset index
 - "eeprom" (record type 0xf5, id 0x00), the wireless calibration data

The layout must be attached to a (sub)partition starting with the
factory block STAG header. The driver registers at subsys_initcall level
so that the cells exist before consumers which do not handle
-EPROBE_DEFER (e.g. the ralink ethernet driver) probe.

Signed-off-by: Ulv Michel <[email protected]>
The offsets of the MAC address and the calibration data inside the JBOOT
config partition differ between units, so fixed nvmem cells only work
on some devices.

Use the new JBOOT config NVMEM layout on a "jboot-config" sub-partition
at 0xe000 of the config partition instead:
 - ethernet: base MAC, label MAC
 - wmac: calibration data and base MAC + 1

This removes the need for jboot_config_read in userspace, so drop the
LTE3302 cases from 02_network and 10_fix_wifi_mac and don't install
jboot-tools.

While at it, convert the DTS to LF line endings and remove trailing
whitespace.

Tested on kernel 6.18: ethernet and wlan get the label MAC and label
MAC + 1, the RF chipset is detected from the calibration data and the
LTE modem enumerates (qmi_wwan, option).

Signed-off-by: Ulv Michel <[email protected]>
@perrin-1
perrin-1 force-pushed the feature/zyxel_lte3302 branch from 9606816 to 52441c4 Compare October 20, 2026 05:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kernel pull request/issue with Linux kernel related changes target/mediatek pull request/issue for mediatek target target/ramips pull request/issue for ramips target

Projects

None yet

Development

Successfully merging this pull request may close these issues.