Commit Graph
22 Commits
Author SHA1 Message Date
Ahmed Naseef 193648a73a econet: en7528: add support for JioFiber JCOW407/JCOW407-IN
The JioFiber JCOW407 is an ISP provided GPON ONT and home router, based
on the EcoNet EN7528. The JCOW407-IN is the same board with a
second-source SPI NAND, Winbond W25M02G in place of the Micron
MT29F2G01, and is covered by the same image.

Both share their flash layout, MAC pool, WiFi EEPROM offsets, PCIe
topology, switch and USB with the JioFiber JCOW414 and reuse
en7528_jiofiber.dtsi. The LEDs and buttons are wired differently: the
RGB status LED is on GPIO 2/3/4 rather than 27/25/23, WPS is on GPIO 1
rather than GPIO 4, and the two colours of each LAN jack are swapped,
green on the odd pin and amber on the even one.

Specifications
==============
* SoC: EcoNet EN7528
* RAM: 512MiB DDR3
* Flash: 256MiB SPI NAND (Winbond W25M02G or Micron MT29F2G01)
* WiFi 2.4GHz: MT7603E 2T2R, on PCIe port 0
* WiFi 5GHz: MT7663 2T2R 802.11ac, on PCIe port 1
* Ethernet: 4x 10/100/1000
* LEDs: 1x RGB status (3 GPIOs), plus green and amber per LAN jack
* Buttons: Reset, WPS
* USB: 2x USB ports
* UART: 4-pin header, GND 3.3V RX TX, 115200 8n1
* Other: 1x FXS phone jack, 1 GPON port

Notes
=====
* OpenWrt has to live in the first image slot (tclinux). Which slot the
  vendor firmware boots from varies between units. The bootloader
  picks the slot from a single ASCII byte at flash offset 0x0DFC0000,
  '0' selects tclinux and '1' selects tclinux_slave. If your device is
  booting from the second slot, the flag has to be moved after flashing;
  see "Switching slots" below.
* The green LAN LEDs are described but stay dark until pinctrl support
  lands. This bootloader leaves GPIO 31/33/35/37 muxed to the GPHY LED
  function, so writing the GPIO output has no effect. Muxing them back
  to GPIO makes all four work as ordinary GPIOs. The amber LEDs are
  unaffected, their pins come up in GPIO mode already, as do all eight
  on the JCOW414.
* The rootfs is a UBI volume on an mtd-concat of tclinux_rootfs and the
  7.25MiB region at 0x0D680000 that the vendor partition table does not
  cover, giving 43.25MiB.

Installation
============
Both methods need serial console access. Power the device on, press a
key within one second to stop the bootloader, and log in with
telecomadmin / nE7jA%5m.

Booting an initramfs image over TFTP
------------------------------------
The bootloader runs a TFTP server that only validates the file name
after the transfer has finished, so any name other than tcboot.bin or
tclinux.bin lands in RAM without touching the flash.

1. Connect ethernet and give the PC the address 192.168.1.2
2. Upload the image:

     tftp 192.168.1.1 -m binary -v -c put \
       openwrt-econet-en7528-jiofiber_jcow407-initramfs-kernel.bin

   The bootloader answers "Invalid filename, upload failed" after
   reporting "start = 0x80020000". That is expected, the image is in
   RAM at that point.
3. bldr> jump 80020000

Booting an initramfs image over XMODEM
--------------------------------------
1. Get the image length in hex:

     printf '%X\n' "$(stat -c%s \
       openwrt-econet-en7528-jiofiber_jcow407-initramfs-kernel.bin)"

2. bldr> xmdm 80020000 <file length hex>
3. Once "CCCC" appears, start the transfer from the terminal, e.g. with
   picocom --send-cmd "lsx -vv" -b 115200 /dev/ttyUSB0 and ctrl+a ctrl+s
4. bldr> jump 80020000

Installing permanently
----------------------
1. Load openwrt-econet-en7528-jiofiber_jcow407-squashfs-tclinux.trx into
   RAM with either method above
2. Write it to the first slot:

     bldr> flash 80000 80020000 <file length hex>

3. Move the boot flag to the first slot as described below, then
   power-cycle

Switching slots
---------------
From OpenWrt:

    en75_chboot                # show the active slot
    en75_chboot openwrt        # first slot, OpenWrt
    en75_chboot factory        # second slot, vendor

From the vendor firmware:

    sys bootflag read          # show the active slot
    sys bootflag swap          # switch to the other slot

From the bootloader, writing the byte directly:

    bldr> memwl a1000000 30   # 30='0' tclinux, 31='1' tclinux_slave
    bldr> memrl a1000000       # read it back to confirm the staged byte
    bldr> flash dfc0000 a1000000 1

Power-cycle afterwards.

Reverting to stock is "en75_chboot factory" followed by a power cycle,
or the same bootloader sequence with 31 instead of 30.

MAC addresses
=============
MAC addresses are stored in the bootloader partition at offset 0x3fe48
and are assigned exactly as the vendor firmware assigns them:

    offset 0    vendor WAN/PON
    offset 1    LAN, br-lan and eth0
    offset 2    WLAN 2.4GHz
    offset 3    WLAN 5GHz

Signed-off-by: Ahmed Naseef <naseefkm@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24798
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-08-21 08:57:55 +02:00
Ahmed Naseef f9002452a6 econet: en7528: add support for JioFiber JCOW414/JCO4032
The JioFiber JCOW414 is an ISP provided GPON ONT and home router, based
on the EcoNet EN7528.

The JioFiber JCO4032 is a different form factor built on the same
internals and is covered by the same image. Flash layout, bootloader
build, PCIe topology, WiFi EEPROM offsets, MAC pool, LEDs and USB were
all verified to be identical on both.

The parts that are common to every EN7528 board Jio ships live in
en7528_jiofiber.dtsi, leaving the board files to describe only their
LEDs and buttons.

Specifications
==============
* SoC: EcoNet EN7528
* RAM: 512MiB DDR3
* Flash: 256MiB SPI NAND (Micron MT29F2G01)
* WiFi 2.4GHz: MT7603E 2T2R, on PCIe port 0
* WiFi 5GHz: MT7663 2T2R 802.11ac, on PCIe port 1
* Ethernet: 4x 10/100/1000
* LEDs: 1x RGB status (3 GPIOs), plus green and amber per LAN jack
* Buttons: Reset, WPS
* USB: 2x USB ports
* UART: 4-pin header, GND TX RX 3.3V reading from the triangle marking
  towards the PCB edge, 115200 8n1
* Other: 1x FXS phone jack, 1 GPON port

Notes
=====
* OpenWrt has to live in the first image slot (tclinux). Which slot the
  vendor firmware boots from varies between units. The bootloader
  picks the slot from a single ASCII byte at flash offset 0x0DFC0000,
  '0' selects tclinux and '1' selects tclinux_slave. If your device is
  booting from the second slot, the flag has to be moved after flashing;
  see "Switching slots" below.
* The rootfs is a UBI volume on an mtd-concat of tclinux_rootfs and the
  7.25MiB region at 0x0D680000 that the vendor partition table does not
  cover, giving 43.25MiB.

Installation
============
Both methods need serial console access. Power the device on, press a
key within one second to stop the bootloader, and log in with
telecomadmin / nE7jA%5m.

Booting an initramfs image over TFTP
------------------------------------
The bootloader runs a TFTP server that only validates the file name
after the transfer has finished, so any name other than tcboot.bin or
tclinux.bin lands in RAM without touching the flash.

1. Connect ethernet and give the PC the address 192.168.1.2
2. Upload the image:

     tftp 192.168.1.1 -m binary -v -c put \
       openwrt-econet-en7528-jiofiber_jcow414-initramfs-kernel.bin

   The bootloader answers "Invalid filename, upload failed" after
   reporting "start = 0x80020000". That is expected, the image is in
   RAM at that point.
3. bldr> jump 80020000

Booting an initramfs image over XMODEM
--------------------------------------
1. Get the image length in hex:

     printf '%X\n' "$(stat -c%s \
       openwrt-econet-en7528-jiofiber_jcow414-initramfs-kernel.bin)"

2. bldr> xmdm 80020000 <file length hex>
3. Once "CCCC" appears, start the transfer from the terminal, e.g. with
   picocom --send-cmd "lsx -vv" -b 115200 /dev/ttyUSB0 and ctrl+a ctrl+s
4. bldr> jump 80020000

Installing permanently
----------------------
1. Load openwrt-econet-en7528-jiofiber_jcow414-squashfs-tclinux.trx into
   RAM with either method above
2. Write it to the first slot:

     bldr> flash 80000 80020000 <file length hex>

3. Move the boot flag to the first slot as described below, then
   power-cycle

Switching slots
---------------
From OpenWrt:

    en75_chboot                # show the active slot
    en75_chboot openwrt        # first slot, OpenWrt
    en75_chboot factory        # second slot, vendor

From the vendor firmware:

    sys bootflag read          # show the active slot
    sys bootflag swap          # switch to the other slot

From the bootloader, writing the byte directly:

    bldr> memwl a1000000 30   # 30='0' tclinux, 31='1' tclinux_slave
    bldr> memrl a1000000       # read it back to confirm the staged byte
    bldr> flash dfc0000 a1000000 1

Power-cycle afterwards.

Reverting to stock is "en75_chboot factory" followed by a power cycle,
or the same bootloader sequence with 31 instead of 30.

MAC addresses
=============
MAC addresses are stored in the bootloader partition at offset 0x3fe48
and are assigned exactly as the vendor firmware assigns them:

    offset 0    vendor WAN/PON
    offset 1    LAN, br-lan and eth0
    offset 2    WLAN 2.4GHz
    offset 3    WLAN 5GHz

Signed-off-by: Ahmed Naseef <naseefkm@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24798
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-08-21 08:57:55 +02:00
Ahmed Naseef 8b8e47906f econet: make the TRX header and jump stub configurable per device
The tclinux TRX generator hardcodes the address that the bootloader
decompresses the kernel to, and TRX_MODEL is a plain global rather than
a per-device variable, so the last device to set it wins for every
device in the target. The free bootbase jump stub is also emitted as a
big endian instruction, which is wrong on little endian subtargets.

Add a --loadaddr option to tclinux-trx.sh, export TRX_MODEL and
TRX_LOADADDR per device and reset both in Device/Default, and pick the
jump stub encoding from CONFIG_BIG_ENDIAN. Behaviour is unchanged for
the existing devices.

Signed-off-by: Ahmed Naseef <naseefkm@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24798
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-08-21 08:57:54 +02:00
Ahmed Naseef 6ca3332676 econet: en7528: add UBI support to DASAN H660GM-A
Move the DASAN H660GM-A root filesystem from a raw squashfs in the tclinux
partition to UBI, following the layout already used by the en751221
ChinaMobile GS3101.

tclinux is split into an explicit 4MB tclinux_kernel partition holding the
raw LZMA kernel and a tclinux_rootfs partition covering the remainder. The
latter is concatenated with the unused "unknown" partition into a single UBI
volume, giving 153MB on the Airtel variant and 41MB on the Generic one. The
two regions are not adjacent, so this needs mtd virtual concat, which is
enabled for the subtarget.

The TRX plus UBI image recipe is identical to the one the GS3101 uses, so
factor it out into a Device/tclinux-ubi template instead of duplicating it.

The .trx is written linearly into tclinux by the vendor installer, so an
oversized image would run past its end into tclinux_slave and destroy the
vendor firmware in the alternate slot. FACTORY_SIZE guards against this and
is set to the size of the partition the .trx is written into.

Existing installations have to be reflashed with the .trx rather than
sysupgraded, since the ubi MTD only appears once the new device tree is
running.

Signed-off-by: Ahmed Naseef <naseefkm@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24398
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-08-02 15:08:46 +02:00
Caleb James DeLisle 3ae630b5b8 econet: add ChinaMobile GS3101
The ChinaMobile GS3101 has:
256MB RAM
256MB flash (TC58CVG1S3H)
1x MT7603 802.11 b/g/n - DISABLED
1x optical port
On-die MT7530 switch with:
- 1x gigabit ethernet port
- 3x 100Mb ethernet ports
1x USB 2.0 port
1x telephone VoIP port
3 controllable LEDs
1 GPIO button (reset), 1 WPS button (not detected in GPIOs)
UART header inside (solder required) 115200 baud
12v power (5.5mm x 2.1mm barrel connector)

Installation instructions: You will need a USB stick
1. Reformat the USB stick as VFAT with MBR partition table. This is important,
if it is GPT then it will silently fail to load.
2. Download openwrt-econet-en751221-chinamobile_gs3101-squashfs-tclinux.trx and
store it in the USB stick.
3. Start the device with the vendor OS
4. Connect a cable and request an IP address - it will issue in 192.168.1.0/24
5. Use telnet to connect to the modem on 192.168.1.1
6. Login as root@2024 / system
7. Plugin the USB stick
8. cp /mnt/usb1_1/openwrt-econet-en751221-chinamobile_gs3101-squashfs-tclinux.trx /tmp/openwrt.trx
9. mtd -r -f write /tmp/openwrt.trx tclinux
10. You will lose your shell, look at the power light on the device, it should
begin blinking and then go back to solid. You should NOT see any red light.
11. re-request an IP address
12. ssh root@192.168.1.1
13. You should be on OpenWrt now

MAC address matches that of vendor OS but it is not the address on the label
of the device. It is in a compressed xml file in the 'romfile' partition.
WAN is this mac, LAN is mac+1 and 2.4Ghz WLAN is mac+2, there is no 5Ghz WLAN.

Wifi Note: Of the devices tested, there were numerous upon which starting the
wlan chip caused the CPU to hang. In the interest of avoiding bricked boards,
the wlan is disabled in the DT.

Signed-off-by: Caleb James DeLisle <cjd@cjdns.fr>
Link: https://github.com/openwrt/openwrt/pull/23533
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-07-22 17:11:24 +02:00
Caleb James DeLisle 04c747b3fc econet: tclinux-trx.sh make rootfs optional and move padding to kernel
The TRX header contains a checksum of the full kernel and rootfs length. Vendor
OS uses a raw squashfs on the NAND and relies on the BMT to resolve bad block
issues. OpenWrt typically uses UBI on NAND and places the root squashfs inside
of that. Since UBI changes over time, checksumming over it would cause a boot
failure later on. However, vendor TRX installers typically the entire file as
uploaded, without regard for the declared kernel and rootfs lengths.

Make --rootfs optional so that a UBI rootfs can be appended but excluded from
the checksum.

Secondly, this script previously prepended padding to the rootfs in order to
move the beginning of the rootfs 4MB away from the TRX header (the max kernel
size). That prepended padding was included in the rootfs length/checksum.

There is a bug https://econet-linux.pkt.wiki/en/bootloader#a-length-bug in some
versions of the bootloader which causes the bootloader to always use the length
of the first kernel, even if it is booting the second. The impact of this is if
the second slot kernel is larger than the first, it will fail to boot. Smaller
is okay because LZMA will stop when it is done.

Move padding from rootfs to kernel and include it in the length/checksum of the
kernel so that the kernel will always register as being 4MB-minus-TRX-header in
length. Therefore if A/B upgrading is used in the future, this bug will not
occur even if an upgrade with a larger kernel is installed into slot B.

Signed-off-by: Caleb James DeLisle <cjd@cjdns.fr>
Link: https://github.com/openwrt/openwrt/pull/23533
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
2026-07-22 17:11:23 +02:00
Caleb James DeLisle b33959a668 econet: add EN751627 subtarget and Zyxel EX3301-T0 board
The EN751627 EcoNet subtarget consists of the EN7516 DSL SoC and the
(rare) EN7527 xPON SoC.

We currently support pci / wifi, usb and flash, but the EN751221 eth
driver is not portable to this family right now.

Zyxel EX3301-T0 is a wifi router based on the EN7516, it is a DSL SoC
but lacks the DSL port.

Installation instructions:
1. Serial access is required, stop the Zyxel bootloader.
2. Use ATENv3 https://github.com/cjdelisle/ATENv3 to unlock bootloader
3. "ATLD x" on the prompt to start a TFTP server
4. Connect ethernet cable from any lan (yellow) port on modem to a
device.
5. On your device, configure network to 192.168.1.2/30
6. On your device, send TRX file to 192.168.1.1 with name x, i.e.
tftp -p -l ./econet/tclinux -r x 192.168.1.1
7. On modem, you should see a line like this:
"Total 8022324 (0x7A6934) bytes received" note the hex value
8. "ATGU" to enter econet bootloader
9. "flash 80000 80020000 <the hex number without 0x>"
For example: flash 80000 80020000 7A6934
10. "reboot 1" -- start the system

If it boots back into the factory OS, you need to switch OS, from the
ZHAL prompt:

1. "ATCB" -- load data from flash
2. "ATCF 0" -- switch to OS 0
3. "ATBT 1" -- enable flash write
4. "ATSB" -- save data
5. "ATSR 1" -- reboot system

Signed-off-by: Caleb James DeLisle <cjd@cjdns.fr>
Link: https://github.com/openwrt/openwrt/pull/22945
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-05-14 21:12:46 +02:00
David Yang 284668f151 econet: en751221: add support for Huawei HG2821T-U
This patch adds support for Huawei HG2821T-U, EPON ONU and home router,
often comes with ISP service.

Specifications
==============
* SoC: Econet EN7526GT
* RAM: 512MiB DDR3L (MT41K256M16TW-107)
* Flash: 256MiB SPI NAND (TC58CVG1S3HRAIG)
* WiFi 2.4GHz: MT7592N
* WiFi 5GHz: MT7612EN
* Ethernet: builtin switch
* LED: Power, Internet, WiFi, USB
* Buttons: Reset
* UART: Serial console (115200 8n1)
* USB: 1 x USB2
* Other: Phone jack, XPON fiber port

!!! BACKUP YOUR ROM !!!
=======================
Please always have your FULL flash image backup before flashing
anything. The vendor firmware varies a lot depending on your ISP and
location. You will have a hard time finding the right regional firmware
if you don't have a backup.

Notes
=====
* Due to the target `econet` being incomplete, WiFi, DSA switch, and
many other features are not supported yet. Do not flash the image unless
you know the consquences or `econet` is declared stable.
* This device, and apparently many other devices of this platform, use
a dual-image layout. OpenWRT (with `econet` target) only uses slot A.
Slot B is not used by OpenWRT, and is applicable for dual-booting to
vendor firmware.
* If you do not use vendor firmware anymore, you can erase and reuse
anything after `configuration_b`, which gives you ~110 MiB free space.
Again, backup your flash first.

Installation
============
Within shell
------------
Note that acquiring the shell access to the vendor firmware can be a bit
tricky depending on the firmware variation. If you can't play with the
vendor firmware, boot to OpenWrt using debricking method below.

0. (Optional) Back up your flash, and / or move the vendor firmware to
   slot B
1. Build and then locate the `kernel.bin` and `rootfs.bin` image files
2. Upload `kernel.bin` and `rootfs.bin` to the device (via HTTP or USB
   stick), then type:
   ```
   mtd write -f -e KernelA kernel.bin KernelA
   mtd erase RootfsA
   mtd write -f -r -e AppA rootfs.bin AppA
   ```

From bootloader
---------------
1. Build and then locate the `kernel.bin` and `rootfs.bin` image files
2. Switch device on and press a key within 3 seconds
3. Upload `kernel.bin` via TFTP as described below
4. Once the transfer has completed successfully, bootloader will give
   you the file length in "Total %d (0x%X) bytes received", then type
   `flash 200000 80020000 <file length hex>`
5. Upload `rootfs.bin` then flash with
   `flash 600000 80020000 <file length hex>`
6. Restart the device to boot into OpenWRT

> [!IMPORTANT]
> Do not try `httpd` in the bootloader. It writes to the wrong address
  and will corrupt the flash.

Debricking
==========
1. Build and then locate the `initramfs-kernel.bin` image files
2. Switch device on and press a key within 3 seconds
3. Connect to device via ethernet, set the IP address to `192.168.1.X`,
   then upload the image via TFTP
   `tftp 192.168.1.1 -m binary -v -c put initramfs-kernel.bin`

   The file name can be anything except `tcboot.bin` or `tclinux.bin`,
   they will corrupt the flash.
4. Type `jump 80020000` to boot the kernel from memory

Dual boot
=========
Use `en75_chboot` tool to switch between vendor firmware and OpenWrt. If
you are soft-locked, you can also switch the flag in the bootloader:
1. Switch device on and press a key within 3 seconds
2. Select the kernel that you wish to use:
   - `memwl 80020000 30ffffff` for `KernelA` (OpenWrt)
   - `memwl 80020000 31ffffff` for `KernelB` (Factory)
3. Select the rootfs, which should be the same as the kernel:
   - `memwl 80020004 30ffffff` for `RootfsA` (OpenWrt)
   - `memwl 80020004 31ffffff` for `RootfsB` (Factory)
3. Commit the data to flash: `flash 1e0000 80020000 8`
4. Restart the device to boot into the selected OS

MAC addresses
=============
`//configuration_a/factory.conf` contains MAC addresses, along with
other pre-configured settings. OpenWrt uses `brmac`, `internetmac`,
`APMAC`, and `APMAC_5G`, while `tr069mac`, `voipmac`, `priprotocolmac`,
and `PONMac` are not used for now.

Signed-off-by: David Yang <mmyangfl@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23131
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-05-14 20:52:09 +02:00
Caleb James DeLisle c6bec81528 econet: add PCIe driver for EN751221 and enable wifi
Extend the EN7528 PCIe driver to EN751221 with a specific PHY
tuning ritual. Also enable wifi drivers on SmartFiber XP8421-B,
TpLink Archer VR1200V v2 and Zyxel PMG5617GA.

Signed-off-by: Caleb James DeLisle <cjd@cjdns.fr>
Link: https://github.com/openwrt/openwrt/pull/22208
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-05-14 20:34:20 +02:00
Ahmed Naseef 62c1c6a946 econet: en7528: add USB support
Add USB host support for EN7528 SoC:

- New phy-en7528-usb driver with U2 slew rate calibration and U3
  RX impedance tuning, based on GPL vendor code and the Airoha
  AN7581 USB PHY driver
- xHCI LTSSM timing quirk for TD 6.5 compliance (patch 915)
- USB PHY and xHCI DTS nodes with IPPC register mapping
- VBUS power via regulator-fixed for DASAN H660GM-A
- Enable USB, xHCI, PHY, and regulator kernel configs

Signed-off-by: Ahmed Naseef <naseefkm@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22498
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-05-10 19:44:56 +02:00
Ahmed Naseef 7ee18e84dc econet: en7528: split DASAN H660GM-A into Airtel and Generic variants
The DASAN H660GM-A GPON ONT exists in two hardware variants, one
distributed by ISPs and one sold directly by the manufacturer [1].

Split the single DTS into a shared dtsi and per-variant DTS files
with the correct GPIO mappings, flash layout, and LED definitions.

Variant comparison:

  Feature        | Airtel                    | Generic
  ---------------+---------------------------+-------------------------
  Supplied by    | Airtel Xstream Fiber      | Retail
  Flash          | Micron MT29F2G01ABAGD     | Micron MT29F1G01ABAFD
                 | 256 MB                    | 128 MB
  Known P/N      | DPW-G-P-66GMAZ-A3         | DPW:G-P-660GMAY-G0
                 | (some units unlabelled)   | DPW:G-P-660GMAY-G3
  WPS LED        | Yes                       | No
  WLAN button    | No                        | Yes
  USB LED        | No                        | Yes
  LAN LEDs       | Green only                | Green + Amber

[1] https://dasanns.com/en/solution/detail.php?mode=view&cat_no=32&offset=&idx=122

Tested-by: Arif Rahman Hakim <arif2785id@gmail.com>
Signed-off-by: Ahmed Naseef <naseefkm@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22095
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-02-24 20:17:24 +01:00
Ahmed Naseef be24a13ad5 econet: en7528: add PCIe and WiFi support
Add PCIe controller and PHY support for EN7528 SoC. This includes
a new PCIe PHY driver, EN7528-specific startup in the MediaTek PCIe
controller, and a fix for bogus prefetch window reads on bridges
that do not implement the registers.

Enable WiFi for the DASAN H660GM-A board with MT7603 (2.4 GHz) and
MT7615/MT7663 (5 GHz).

Signed-off-by: Ahmed Naseef <naseefkm@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21326
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-02-15 01:12:52 +01:00
Ahmed Naseef 8440e79c9f econet: en7528: add support for DASAN H660GM-A
DASAN H660GM-A is a GPON ONT.

Specification:
- SoC:      EcoNet EN7528
- RAM:      256 MB
- Flash:    256 MB SPI NAND
- Ethernet: 4x 1GbE
- FXS:      1 port
- GPON:     1 port
- USB:      1x USB 2.0

Install via OEM web UI:
1. Login to the factory web UI with username "superuser"
   and password "Dz$!A!r7".
2. Rename the OpenWrt image
   openwrt-econet-en7528-dasan_h660gm-a-squashfs-tclinux.trx
   to G_ONU_openwrt.bin.
3. Upload the renamed image via the firmware upgrade page
   at Maintenance > Firmware Upgrade in the factory web UI.

Signed-off-by: Ahmed Naseef <naseefkm@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21326
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-02-15 01:12:52 +01:00
Ahmed Naseef 9ba87609b8 econet: image: add little endian TRX support for EN7528
The EN7528 SoC uses a little endian MIPS architecture, unlike the big
endian EN751221 family. The tclinux TRX firmware format stores multi-byte
fields in the CPU's native byte order, requiring different header layouts
for each architecture:

  - Big endian (EN751221): magic "2RDH", fields in big endian order
  - Little endian (EN7528): magic "HDR2", fields in little endian order

Update tclinux-trx.sh to support both endianness variants:
  - Add --endian parameter to select byte order (default: be)
  - Add --model parameter for optional platform identifier field
  - Convert to named parameters for clarity and extensibility
  - Use hex32() helper for endian-aware 32-bit field output

Move TRX_ENDIAN configuration to subtarget files, allowing each subtarget
to specify its native byte order:
  - en751221.mk: TRX_ENDIAN := be
  - en7528.mk: TRX_ENDIAN := le

Signed-off-by: Ahmed Naseef <naseefkm@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21326
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-02-15 01:12:52 +01:00
Ahmed Naseef fab098cb61 econet: add EN7528 subtarget support
The EN7528 is a little endian dual-core MIPS 1004Kc SoC used in xPON
devices. Unlike the big endian EN751221, EN7528 uses the MIPS GIC
interrupt controller for SMP.

This adds minimal boot support for EN7528:
- New en7528 subtarget with mipsel architecture
- Kernel patches for EN7528 SoC with GIC support
- Timer driver extended to support GIC shared interrupts per CPU
- SPI driver fix for EN7528 chip select handling
- Generic device tree for initial bring-up

Signed-off-by: Ahmed Naseef <naseefkm@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21326
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-02-15 01:12:52 +01:00
Caleb James DeLisle 31f5fc8fea econet: New device: Zyxel PMG5617GA
This device has one USB2.0 port, plus ethernet, 2x wifi, ethernet, xPON
and VoIP.

Installation instructions: (Assuming root shell via SSH or serial)
1. Place OpenWrt TRX file on a USB stick formatted VFAT
2. Plug in the stick to the modem
3. Type: mtd write -f -e tclinux /mnt/usb2_sda1/<name of file>.trx tclinux

At this point, both OpenWrt and the vendor OS will be installed
because the device has space for two operating systems. Switch the OS
to boot to OpenWrt:

1. mtd readflash tmpdata 999999999 0 reservearea
2. echo -n '0' | dd of=./tmpdata bs=1 count=1 seek=397311 conv=notrunc
3. mtd write -f -e reservearea ./tmpdata reservearea
4. reboot

WARNING: While you can install with SSH alone, you need serial to use
OpenWrt on EcoNet devices because the Ethernet driver has not yet been
developed.

Signed-off-by: Caleb James DeLisle <cjd@cjdns.fr>
Link: https://github.com/openwrt/openwrt/pull/20580
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-25 00:50:54 +01:00
Caleb James DeLisle 1cd3660bee econet: Add Nokia G-240G-E and EN751221 recovery image
The Nokia G-240G-E is an xPON device with an EN7526G, 256M of
memory and 128M of flash. It has 1 USB2 port as well as phone and
ethernet but no wifi. Flashing instructions are per the typical
process using xmodem in the bootloader. This and other things
are described here: https://openwrt.org/inbox/toh/bt/g-240g-e_1

In addition, a generic image is offered, this image can be loaded
into memory from within the bootloader and launched directly. It
is recommended on the wiki of G-240G-E and other EcoNet devices
to be used for backing up the flash before flashing OpenWRT.

Signed-off-by: Caleb James DeLisle <cjd@cjdns.fr>
Link: https://github.com/openwrt/openwrt/pull/20338
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-10-19 22:21:41 +02:00
Caleb James DeLisle c43925313e econet: Add basic USB support with Mass Storage
The EN751221 has an XHCI that is compatible with MT7621.
While there is setup logic in the vendor code for both
EN751221 and MT7621, but MT7621 does not use it in mainline
or OpenWRT, and it appears to work correctly with EN751221.

Include SCSI / Mass Storage because many EcoNet devices
contain a builtin USB SD-Card reader.

Signed-off-by: Caleb James DeLisle <cjd@cjdns.fr>
Link: https://github.com/openwrt/openwrt/pull/20050
[Remove usb storage kmod from smartfiber_xp8421-b]
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-09-18 22:36:28 +02:00
Caleb James DeLisle 7d37cb0986 econet: Clean up kernel config and move subtarget devices into own file
The kernel config accidentally contains CONFIG_UBIFS_FS_AUTHENTICATION
which select a number of other unnecessary components, remove them.

The target has at least two subtargets, only one is currently
implemented. Move the Device builds into a file for this subtarget.

Signed-off-by: Caleb James DeLisle <cjd@cjdns.fr>
Link: https://github.com/openwrt/openwrt/pull/20027
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-09-12 21:06:05 +02:00
Caleb James DeLisle 442f91c117 econet: Add new target TP-Link Archer VR1200v (v2)
The TP-Link Archer VR1200v (v2) is a low end DSL modem based on the
EcoNet EN751221 processor platform.

While it does have an unlocked bootloader, the factory upgrade feature
requires a cryptographic signature so flashing from the web UI is not
feasible.

The Archer VR1200v (v2) uses a dual-image layout. I have chosen to reuse
this to support dual-boot between OpenWRT and the factory firmware.

Flashing instructions (from bootloader):

Build and then locate the squashfs-sysupgrade.bin image file
Get the length of that file in hex: printf '%X\n' "$(stat -c%s the-file-squashfs-sysupgrade.bin)"
Connect to device with xmodem capability, e.g. picocom --send-cmd lsx -vv -b 115200 /dev/ttyUSB0
Switch device on and press a key within 3 seconds, you should get to a `bldr>` prompt
Type: xmdm 80020000 <file length hex>
Quickly start xmodem and send the file, in picocom that is ctrl+a ctrl+s <paste-the-file-name> enter If the transfer fails to start, wait 30 seconds to a minute for the bootloader prompt to return and then try the command again.
Once the transfer has completed successfully, type the following flash 80000 80020000 <file length hex>
Type `re` or simply restart the device to boot into OpenWRT

Signed-off-by: Caleb James DeLisle <cjd@cjdns.fr>
Link: https://github.com/openwrt/openwrt/pull/19021
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-09-12 00:51:58 +02:00
Caleb James DeLisle ef2785a2d0 econet: Add new target SmartFiber XP8421-B
The SmartFiber XP8421-B is a fiber modem which is available for $20 online
and has 512MB of memory, 256MB of SPI NAND flash and 2 USB 2.0 ports in
addition to ethernet, wifi and XPON.

Because EcoNet is not currently producing evaluation boards, the XP8421-B
stands in as a convenient, low cost, off-the-shelf, representitive example
of the capabilities of the EN751221 econet processor. This is also the
example board that is included in the upstream Linux patchset.

The XP8421-B, and apparently many other devices of this platform, use a
dual-image layout. I have chosen to reuse this to support dual-boot between
OpenWRT and the factory firmware. Certain design decisions were made with
the goal of not overwriting data that is used by the factory OS.

This commit also introduces a utility for switching between OS_A and OS_B
which are used for OpenWRT and Factory OS respectively.

Flashing instructions (from bootloader):

Build and then locate the squashfs-tclinux.trx image file
Get the length of that file in hex: printf '%X\n' "$(stat -c%s the-file-squashfs-tclinux.trx)"
Connect to device with xmodem capability, e.g. picocom --send-cmd lsx -vv -b 115200 /dev/ttyUSB0
Switch device on and press a key within 3 seconds
Enter bootloader username and password: telecomadmin nE7jA%5m
Type: xmdm 80020000 <file length hex>
Quickly start xmodem and send the file, in picocom that is ctrl+a ctrl+s <paste-the-file-name> enter If the transfer fails to start, wait 30 seconds to a
minute for the bootloader prompt to return and then try the command again.
Once the transfer has completed successfully, type the following flash 80000 80020000 <file length hex>
Type go or simply restart the device to boot into OpenWRT

Signed-off-by: Caleb James DeLisle <cjd@cjdns.fr>
Link: https://github.com/openwrt/openwrt/pull/19021
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-09-12 00:51:58 +02:00
Caleb James DeLisle 73d0f92460 kernel: Add new platform EcoNet MIPS
EcoNet EN75xx is a big endian MIPS platform used in XPON (fiber),
DSL, and SIM (3g/4g) applications. Complete GPL vender SDKs exist
for this platform, but are based on Linux 2.6.

The bulk of this submission has already been accepted upstream:
https://patchwork.kernel.org/project/linux-mips/list/?series=960479&state=*

This platform uses a bootloader that is derived from old TrendChip
code. This bootloader implements a frustratingly complex Bad Block
Table which is implemented here in en75_bmt.c

This BMT is not upstreamed because it depends on mtk_bmt framework
which likewise is not upstreamed.

This BMT system rewrites block indexes in flash and if the bootloader
considers it to be corrupted, it will attempt to automatically rebuild
on boot. So without implementing the algorithm, you can't safely use
the disk at all.

Signed-off-by: Caleb James DeLisle <cjd@cjdns.fr>
Link: https://github.com/openwrt/openwrt/pull/19021
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-09-12 00:51:58 +02:00