]> git.ipfire.org Git - thirdparty/openwrt.git/commit
airoha: add initial support for Nokia XG-040G-MF 23809/head
authorMikhail Zhilkin <csharper2005@gmail.com>
Mon, 15 Jun 2026 14:27:49 +0000 (17:27 +0300)
committerJonas Jelonek <jelonek.jonas@gmail.com>
Sat, 18 Jul 2026 08:21:09 +0000 (10:21 +0200)
commit42b8e0d9b78177bdc9e370d5a34d0cab3e278521
treebfaf4c8a0d212a568ad35cb7e54b10f392a86110
parent05c4cb954e481316fea45462c0da174eaef733d2
airoha: add initial support for Nokia XG-040G-MF

This commit adds initial support for Nokia XG-040G-MF XG-PON ONU.

Specification
-------------
- SoC       : Airoha AN7583DT (dual-core ARM Cortex-A53 1.2 GHz)
- RAM       : 512 MiB DDR4 (Winbond W664GG6RB-06)
- Flash     : SPI-NAND 256 MiB (GigaDevice GD5F2GM7UEYIG)
- WLAN      : -
- Ethernet  : 1x 2500 Mbps (LAN1, Airoha EN8811HN)
              3x 10/100/1000 Mbps (LAN2-LAN4, Airoha AN7583 SoC switch)
- XG-PON    : ECONET EN7572, SLIC: MaxLinear PEF32001VSV12
- USB       : 1x USB2 (with power control via gpio)
              1x USB3 (with power control via gpio)
- Buttons   : Reset
- LEDs      : 1x Power (green)
              1x WAN (green)
              1x WAN (red)
              4x LAN (green)
              2x USB (green)
- Power     : 12 VDC, 1 A

Unsupported functions, limitations and known issues
---------------------------------------------------
1. XG-PON won't be available after installing OpenWrt.
2. USB ports: AN7583 SoC in OpenWrt doesn't support USB at this time.

Installation (UART)
-------------------
1. Attach UART and run picocom:
   picocom -b 115200 --send-cmd "sb -vv" /dev/ttyUSB0
2. Interrupt boot process by pressing Enter key to enter u-boot
   Username: telecomadmin
   Password: nE7jA%5m
3. Start download firmware via ymodem protocol (via UART):
   loady 0x85000000
4. Press Ctrl + A then Ctrl + S in the picocom terminal (if you are using
   a different terminal, please refer to the documentation) to start
   upload OpenWrt initramfs image using ymodem protocol. Enter local path
   to the OpenWrt initramfs image and press Enter.
5. Load OpenWrt initramfs image from the memory:
   bootm 0x85000000
5. Sysupgrade with OpenWrt sysupgrade image

Alternative for the p.3-4. Load and boot OpenWrt initramfs from tftp IP
192.168.1.254:
   tftpboot 0x85000000 192.168.1.254:openwrt-initramfs-uImage.itb
   bootm 0x85000000

Backup and installation (without UART)
--------------------------------------
1. Unplug Fiber
2. Make ONU Reset
3. Navigate: http://192.168.1.1
   Username: CMCCAdmin
   Password: aDm8H%MdA
4. Go to Apps -> Home Storage -> FTP and check Enable FTP
5. Go to Apps -> Home Storage -> SAMBA Sharing and check Enable Samba
6. Visit the following URL to open Telnet:
   http://192.168.1.1/system.cgi?telnet
7. Telnet account login:
   Username: user
   Password: <see ONU label>
8. Get root privileges:
   su user_ftp
   Password: <see ONU label>
9. Copy 'squashfs-factory-kernel.bin', 'squashfs-factory-rootfs.bin' and
   'OpenWrt.mtd2.u-boot-env.bin' (backup of 'u-boot-env' partition from
   the another Nokia XG-040G-MF with OpenWrt installed)
9. Attach USB flash drive and check the new dir in /mnt:
   ls /mnt
10. Change current dir to the flash drive (change D to your flash drive
   label):
   cd /mnt/D
11. Make backup:
   for i in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16; \
   do cat /dev/mtd$i | gzip -9 > mtd$i.bin.gz; done
12. Check image sizes:
   ls -l | awk '{if(NR>1) {$5=sprintf("0x%x", $5); print}}'
13. Write images:
   mtd_debug erase /dev/mtd0 0x60000 0x20000
   mtd_debug write /dev/mtd0 0x60000 0x20000 OpenWrt.mtd2.u-boot-env.bin
   mtd_debug erase /dev/mtd14 0x0 0x2880000
   mtd_debug write /dev/mtd14 0x0 0x3e6cfc squashfs-factory-kernel.bin
   mtd_debug erase /dev/mtd11 0x0 0x80e0000
   mtd_debug write /dev/mtd11 0x0 0x440000 squashfs-factory-rootfs.bin
   0x3e6cfc - size of your 'squashfs-factory-kernel.bin'
   0x440000 - size of your 'squashfs-factory-rootfs.bin'
14. Reboot:
   reboot

Recovery
--------
The same as described in Installation (UART).

Return to stock
---------------
1. Follow the steps 1-5 of the Installation (UART)
2. Once in OpenWrt upload you backup to the /tmp dir of the router:
   scp -O mtd16.bin.gz root@192.168.1.1:/tmp
5. Connect to the router using ssh and install kmod-mtd-rw:
   apk update && apk add kmod-mtd-rw
   insmod mtd-rw i_want_a_brick=1
6. Unlock bootloader:
   mtd unlock bootloader
7. Restore stock:
   zcat /tmp/mtd16.bin.gz | mtd write - all_flash
8. Reboot:
   reboot

Stock layout
------------
+-------+------------+---------+---------+
| mtd   | label      | start   | size    |
+-------+------------+---------+---------+
| mtd0  | bootloader | 0       | 80000   |
| mtd1  | romfile    | 80000   | 40000   |
| mtd14 | nsb_master | c0000   | 2880000 |
| mtd15 | nsb_slave  | 2940000 | 2880000 |
| mtd6  | bosa       | 51c0000 | 40000   |
| mtd7  | ri         | 5200000 | 40000   |
| mtd8  | flag       | 5240000 | 40000   |
| mtd9  | flagback   | 5280000 | 40000   |
| mtd10 | config     | 52c0000 | a00000  |
| mtd11 | data       | 5cc0000 | 80e0000 |
| mtd12 | oopsfs     | dda0000 | 400000  |
| mtd13 | log        | e1a0000 | a00000  |
+-------+------------+---------+---------+

UART
----
A view from the back side of the PCB:
   ------------------------
   |       GND RX TX
   |        X  X  X
Connection parameters:
115200, 8N1, 3.3V

MAC addresses
-------------
+---------+-------------------+-----------+
|         | MAC               | Algorithm |
+---------+-------------------+-----------+
| LAN     | e0:xx:xx:xx:xx:a0 | label     |
| WAN     | e0:xx:xx:xx:xx:a1 | label + 1 |
+---------+-------------------+-----------+
The LAN MAC (hex) was found in 'ri', 0x3e

Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23809
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
package/boot/uboot-tools/uboot-envtools/files/airoha_an7583 [new file with mode: 0644]
target/linux/airoha/an7583/base-files/etc/board.d/01_leds [new file with mode: 0644]
target/linux/airoha/an7583/base-files/etc/board.d/02_network
target/linux/airoha/an7583/base-files/lib/upgrade/platform.sh [new file with mode: 0644]
target/linux/airoha/dts/an7583-nokia_xg-040g-mf-common.dtsi [new file with mode: 0644]
target/linux/airoha/dts/an7583-nokia_xg-040g-mf.dts [new file with mode: 0644]
target/linux/airoha/image/an7583.mk