OpenWrt support for Zyxel PMG5617GA, first GPON support !?

Bootloader(U-Boot) from keenetic runs on a device with the same processor (Sercomm FG824CD).

U-Boot log
BGA IC
Xtal:1
DDR3 init.
DRAMC init done.
Calculate size.
DRAM size=256MB
Set new TRFC.
ddr-1066

7512DRAMC V1.2.2 (0)


U-Boot 1.1.3 [4.0.0.4-33] (Nov 29 2019 - 18:49:25)

Board: Ralink APSoC DRAM:  256 MB
relocate_code Pointer at: 8ff8c000


******************************
Software System Reset Occurred
******************************
Set SPI Clock to 50 Mhz
spi_nand_probe: mfr_id = 0xc2, dev_id = 0x12
Using Flash ECC.
Detected SPI NAND Flash: MXIC MX35LF1G, Flash Size: 128 MB
bmt pool size: 81
BBT found, bad block count: 0
BMT & BBT Init Success
*** Warning - bad CRC, using default environment

============================================
Ralink UBoot Version: 4.0.0.4_NDMS
--------------------------------------------
ASIC 7512_MP (Port5<->None)
SYS_CLK: 225 MHz
DRAM_CONF_FROM: From SPRAM
DRAM_TYPE: DDR3
DRAM component: 2048 Mbits
DRAM bus: 16 bit
Total memory: 256 MBytes
Flash component: SPI NAND Flash
Date:Nov 29 2019  Time:18:49:25
============================================
icache: sets: 512, ways:4, linesz:32, total: 64kB
dcache: sets: 256, ways:4, linesz:32, total: 32kB

 ##### The CPU freq = 900 MHZ ####
 estimate memory size = 256 Mbytes

Detected internal switch MT7530

Detected external switch MT7530
Dual image:     on
Boot active:    1
Boot backup:    1
Boot fails:     0


Please choose the operation:
   1: Load system code to SDRAM via TFTP.
   2: Load system code then write to Flash via TFTP.
   3: Boot system code via Flash (default).
   4: Enter boot command line interface.
   7: Load Boot Loader code then write to Flash via Serial.
   9: Load Boot Loader code then write to Flash via TFTP.                                                                                                                                                    0

3: System Boot system code via Flash.
## Booting image at 00060000 ...
Bad Magic Number,FFFFFFFF

Load system code then write to Flash via TFTP.

System Boot log
3: System Boot system code via Flash.

## Booting image at 00060000 ...

   Image Name:   Keenetic DSL

   Created:      2018-10-23  16:55:17 UTC

   Image Type:   MIPS Linux Kernel Image (lzma compressed)

   Data Size:    1268528 Bytes =  1.2 MB

   Load Address: 80020000

   Entry Point:  802ef100

   Verifying Checksum ... OK

   Uncompressing Kernel Image ... OK

No initrd

## Transferring control to Linux (at address 802ef100) ...

## Giving linux memsize in MB, 256


Starting kernel ...


Linux version 3.4.113 (developers@ndmsystems.com) (gcc version 7.3.0 (crosstool-NG crosstool-ng-1.23.0-ndm-4 - NDMS Toolkit 1.0.0) ) #1 SMP Tue Oct 16 18:48:53 MSK 2018
ISPRAM0: PA=00300000,Size=00010000,enabled
EcoNet SoC: RAM: DDR3 256MB
CPU/SYS frequency: 900/225 MHz
SoC power status: Hard reset occured
CPU revision is: 00019558 (MIPS 34Kc)
Determined physical RAM map:
 memory: 0ffe0000 @ 00020000 (usable)
Wasting 1024 bytes for tracking 32 unused pages
Zone PFN ranges:
  Normal   
0x00000020 -> 0x00010000
Movable zone start PFN for each node
Early memory PFN ranges
    0: 0x00000020 -> 0x00010000
Detected 1 available secondary CPU(s)
Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
Primary data cache 32kB, 4-way, VIPT, cache aliases, linesize 32 bytes
PERCPU: Embedded 7 pages/cpu @81203000 s5984 r8192 d14496 u32768
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 64992
Kernel command line: console=ttyS0,57600n8 rdinit=/sbin/init es=1
PID hash table entries: 1024 (order: 0, 4096 bytes)
Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
Writing ErrCtl register=0003b800
Readback ErrCtl register=0003b800
NMI base is 8124c200
Memory: 255612k/262016k available (3008k kernel code, 6404k reserved, 618k data, 212k init, 0k highmem)
Hierarchical RCU implementation.
NR_IRQS:41
 Using 200.000 MHz high precision timer
console [ttyS0] enabled
Calibrating delay loop... 597.60 BogoMIPS (lpj=2988032)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
Config7: 0x80080500
ISPRAM0: PA=00300000,Size=00010000,enabled
Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
Primary data cache 32kB, 4-way, VIPT, cache aliases, linesize 32 bytes
CPU revision is: 00019558 (MIPS 34Kc)
Synchronize counters for CPU 1: done.
Brought up 2 CPUs
NET: Registered protocol family 16
PCIe RC0 no card, disable PHY
bio: create slab <bio-0> at 0
NET: Registered protocol family 8
NET: Registered protocol family 20
Switching to clocksource TC HPT
NET: Registered protocol family 2
IP route cache hash table entries: 2048 (order: 1, 8192 bytes)
TCP established hash table entries: 8192 (order: 4, 65536 bytes)
TCP bind hash table entries: 8192 (order: 4, 65536 bytes)
TCP: Hash tables configured (established 8192 bind 8192)
TCP: reno registered
UDP hash table entries: 128 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 128 (order: 0, 4096 bytes)
NET: Registered protocol family 1
squashfs: version 4.0 (2009/01/31) Phillip Lougher
msgmni has been set to 499
io scheduler noop registered (default)
tc3162_uart: UART driver for EN751x SoC, buffer size is 4096 bytes
ttyS0 at I/O 0xbfbf0003 (irq = 1) is a TC3162
Registering NDM partitions parser
EcoNET SPI NAND driver init
Detected SPI NAND Flash: MXIC35LF1G, Flash Size: 128MB
NAND device: Manufacturer ID: 0xc2, Chip ID: 0x12 (Macronix MXIC35LF1G), 128MiB, page size: 2048, OOB size: 64
BMT pool size: 81
BBT found, bad block count: 0
BMT & BBT init success
di: active = 1, backup = 1, current = 1
15 ndmpart partitions found on MTD device EN7512-SPI_NAND
Creating 15 MTD partitions on "EN7512-SPI_NAND":
0x000000000000-0x000000020000: "U-Boot"
0x000000020000-0x000000040000: "U-Config"
0x000000040000-0x000000060000: "RF-EEPROM"
0x000000060000-0x0000001c0000: "Kernel_1"
0x0000001c0000-0x000001da0000: "RootFS_1"
mtd: device 4 (RootFS_1) set to be root filesystem
0x000000060000-0x000001da0000: "Firmware_1"
0x000001da0000-0x000001dc0000: "Config_1"
0x000001dc0000-0x000001fc0000: "Storage"
0x000001fc0000-0x000002000000: "Dump"
0x000003ae0000-0x000003b00000: "U-State"
0x000003b00000-0x000003b20000: "U-Config_res"
0x000003b20000-0x000003b40000: "RF-EEPROM_res"
0x000003b40000-0x000005880000: "Firmware_2"
0x000005880000-0x0000058a0000: "Config_2"
0x000000000000-0x0000075e0000: "Full"
tun: Universal TUN/TAP device driver, 1.6
tun: (C) 1999-2004 Max Krasnyansky <maxk@qualcomm.com>
PPP generic driver version 2.4.2
PPP MPPE Compression module registered
NET: Registered protocol family 24
PPTP driver version 0.8.5
Netfilter messages via NETLINK v0.30.
nfnl_dryrun: registering with nfnetlink.
nf_conntrack version 0.5.0 (16384 buckets, 32768 max)
ctnetlink v0.93: registering with nfnetlink.
xt_time: kernel timezone is -0000
ip_set: protocol 6
Bridge firewalling registered
ubridge: Tiny bridge driver, 1.1
IPv4 over IPv4 tunneling driver
gre: GRE over IPv4 demultiplexor driver
Fast NAT loaded
ip_tables: (C) 2000-2006 Netfilter Core Team
TCP: cubic registered
NET: Registered protocol family 10
ip6_tables: (C) 2000-2006 Netfilter Core Team
IPv6 over IPv4 tunneling driver
NET: Registered protocol family 17
8021q: 802.1Q VLAN Support v1.8
VFS: Mounted root (squashfs filesystem) readonly on device 31:4.
Freeing unused kernel memory: 212k freed
init: init process was started.

init: press Enter to activate this console.

Due to the lack of drivers, only the console and usb work. The network subsystem is not working.

An attempt at porting EcoNet/Mediatek EN7512 SoC to Linux 5.
The system from @minhng99 repository was also launched.