Add support for Netgear PGZNG1-1ADNAS

Hello.
I'm trying to install openwrt on Netgear PGZNG1-1ADNAS.

Original FW + uboot vars

What i did:

What i expected:
i expected factory.bin which would contain kernel + zeroes up to 4mb + squashfs + overlay + ubi metadata which i could write directly onto 0x80000 and which will create loadable 4mb kernel partition + separate split mtd which will contain rootfs + overlay + nand metadata

then i will boot kernel from 0x80000:
nand read 0x81000000 0x80000 0x00400000 && bootm 0x81000000 and then kernel will pick up mtd partition + overlay according to

                        label = "firmware";
                        reg = <0x00080000 0x00400000>;
                        compatible = "openwrt,uimage", "denx,uimage";
                };

                partition@480000 {
                        label = "rootfs";
                        reg = <0x00480000 0x04e00000>;
                };

what i got:

i can boot it, i see squashfs at expected offset, but after that it's unclear for me what is happening and what is supposed to happen.

I see some contradicting info:
https://openwrt.org/docs/techref/filesystems < this page say that there has to be "ubifs" that replaces jffs2

while i see that cmdline for ath79 hardcoded to be jffs2 and i failed to find any traces of ubifs in makefiles https://github.com/openwrt/openwrt/blob/master/target/linux/ath79/config-5.10#L18

Should i look why ubifs not created instead of jffs2 or why jffs2 not created inside root mtd partition along rootfs_data?

for posterity:
jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at
may mean that jffs found something that resembles data on presumably empty drive. The solution was:

tftp 0x81000000 openwrt-ath79-nand-netgear_pgzng1-1adnas-squashfs-factory.bin && nand erase 0x80000 **0x05200000** && nand write $fileaddr 0x80000 $filesize && nand read 0x81000000 0x80000 0x00400000 && bootm 0x81000000

instead of

tftp 0x81000000 openwrt-ath79-nand-netgear_pgzng1-1adnas-squashfs-factory.bin && nand erase 0x80000 **$filesize** && nand write $fileaddr 0x80000 $filesize && nand read 0x81000000 0x80000 0x00400000 && bootm 0x81000000

Sorry for flooding. I know noone really interesting in this weird device, but just in case i'm going to leave this for future generations. I'm not ready to polish it enough to contribute to upstream, mostly due to unusual gpio config - i failed to find the right module for gpio and i have very low interest in this.
My goal was to use it as torrent box, but single thread cpu isn't enough for this, it's a way too slow.

I was interested in this device cause
The dts located here https://github.com/tsipa/openwrt/commits/pgzng1_master

Netgear PGZNG1-1ADNAS is ADT security device for with integrated z-wave controller and clamp-wire harness that seems to be wired to gpio but i'm not 100% sure.
image

It has 256mb of raw nand and usb 2.0 port. Only 2.4GHz wifi.

Flashing:

  1. hook uart:

    115200 8N1 software flow control
  2. reboot to uboot and double check that your layout is same as my
    mtdparts=ath-nand:256k(u-boot),256k(u-boot-env),2m(uImage),80m(rootfs),2m(uImage2),80m(rootfs_bak),20m(config),71m(storage),384k(dummy),128k(caldata)
    https://paste2.org/6JvHv3KI
  3. Backup nand:
    ar7240> setenv console_mode 1
    ar7240> saveenv
    ar7240> boot
    Drop onto stock fw failsafe with f+entrer when will be prompted.
    Setup network and drop nand dump elsewhere via network. You'll have to insmod something; ifconfig ; nanddump | telnet or something similar
  4. build the fw and make it available over tftp://192.168.1.10/openwrt-ath79-nand-netgear_pgzng1-1adnas-squashfs-factory.bin
  5. IT IS IMPORTANT TO DOUBLE CHECK YOUR LAYOUT THIS STEP MAY ERASE YOUR BOOTLOADER
    From uboot run:
    tftp 0x81000000 openwrt-ath79-nand-netgear_pgzng1-1adnas-squashfs-factory.bin && nand erase 0x80000 0x0a400000 && nand write $fileaddr 0x80000 $filesize && nand read 0x81000000 0x80000 0x00400000 && bootm 0x81000000
    this will erase stock FW and backup FW.
    Run to boot new FW by default:
    setenv bootcmd "nand read 0x81000000 0x80000 0x00400000 && bootm 0x81000000"

Is this related to the PR here:

?

Somewhat. The board is the same, but the person who did this PR is not me and he did fairly better job than me polishing the PR.
inb4 - No, this PR wasn't googlable at the time when i started this.

1 Like

FWIW device support was merged into nightly builds today. Any additional PRs to improve hardware support are appreciated. :smiley:

2 Likes