I have been working on trying to get the Netgear WN370 AP booting and running OpenWrt, but have been running into one issue I can't seem to find any solution for. While The WN370 does not have an official OpenWrt build available, it is based on the Atheros AR9344 SOC, which I have successfully compiled a kernel for. It is built for target ar71xx (for OpenWrt ver <= 19) or ath79 (for ver >= 20). I am currently building ver 19.07.7, as version 20+ will not produce the UImage format I need.
With that said, I have been able to get it to boot the kernel no problems, but the issue I'm running into is it will not detect the SPI flash whatsoever (as far as I can tell it makes no attempt to initialize the "mtdparts" argument specified). Unfortunately I am limited by the stock U-Boot already on the device, which only supports booting kernels in either UImage-lzma or UImage-gzip formats. It will not boot any build in the common "-squashfs-factory.img" or "-squashfs-sysupgrade.bin" formats.
For comparison, below are the bootlogs of both the (failed) OpenWrt boot, and the boot of the stock firmware that came with the device. I have tried multiple different SPI ROM chips just for testing, but that made no difference. I also substituted "ath-nor0" with "spi0.0" in the mtdparts argument, which also did not make a difference.
OpenWrt boot: (0x2000000 is the address I loaded the UImage bin into via tftp)
ar7240> bootm 0x2000000
## Booting image at 02000000 ...
Image Name: MIPS OpenWrt Linux-4.14.241
Created: 2021-07-29 19:50:28 UTC
Image Type: MIPS Linux Kernel Image (lzma compressed)
Data Size: 1607412 Bytes = 1.5 MB
Load Address: 80060000
Entry Point: 80060000
Verifying Checksum at 0x02000040 ...OK
Uncompressing Kernel Image ... OK
No initrd
## Transferring control to Linux (at address 80060000) ...
## Giving linux memsize in bytes, 134217728
Starting kernel ...
[ 0.000000] Linux version 4.14.241 (cbax@tantalum) (gcc version 7.5.0 (OpenWrt GCC 7.5.0 r11364-ef56c85848)) #0 Thu Jul 29 19:50:28 2021
[ 0.000000] bootconsole [early0] enabled
[ 0.000000] CPU0 revision is: 0001974c (MIPS 74Kc)
[ 0.000000] SoC: Atheros AR9344 rev 3
[ 0.000000] Determined physical RAM map:
[ 0.000000] memory: 08000000 @ 00000000 (usable)
[ 0.000000] User-defined physical RAM map:
[ 0.000000] memory: 08000000 @ 00000000 (usable)
[ 0.000000] Initrd not found or empty - disabling initrd
[ 0.000000] Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
[ 0.000000] Primary data cache 32kB, 4-way, VIPT, cache aliases, linesize 32 bytes
[ 0.000000] Zone ranges:
[ 0.000000] Normal [mem 0x0000000000000000-0x0000000007ffffff]
[ 0.000000] Movable zone start for each node
[ 0.000000] Early memory node ranges
[ 0.000000] node 0: [mem 0x0000000000000000-0x0000000007ffffff]
[ 0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000007ffffff]
[ 0.000000] random: get_random_bytes called from start_kernel+0x90/0x47c with crng_init=0
[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 32512
[ 0.000000] Kernel command line: console=ttyS0,9600 root=31:02 rootfstype=jffs2 init=/sbin/init mtdparts=ath-nor0:256k(u-boot),64k(u-boot-env),8192k(rootfs),2624k(vmlinux.gz.uImage),4096k(FT_CONF),64k(manuf),1024k(NG_OOPS),64k(ART) mem=128M rootfstype=squashfs noinitrd
[ 0.000000] PID hash table entries: 512 (order: -1, 2048 bytes)
[ 0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
[ 0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
[ 0.000000] Writing ErrCtl register=00000000
[ 0.000000] Readback ErrCtl register=00000000
[ 0.000000] Memory: 124172K/131072K available (3713K kernel code, 185K rwdata, 888K rodata, 324K init, 204K bss, 6900K reserved, 0K cma-reserved)
[ 0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[ 0.000000] NR_IRQS: 51
[ 0.000000] Clocks: CPU:560.000MHz, DDR:400.000MHz, AHB:200.000MHz, Ref:40.000MHz
[ 0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 6825930166 ns
[ 0.000009] sched_clock: 32 bits at 280MHz, resolution 3ns, wraps every 7669584382ns
[ 0.092721] Calibrating delay loop... 278.93 BogoMIPS (lpj=1394688)
[ 0.237636] pid_max: default: 32768 minimum: 301
[ 0.293084] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.372235] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.458866] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[ 0.576516] futex hash table entries: 256 (order: -1, 3072 bytes)
[ 0.649881] NET: Registered protocol family 16
[ 0.704514] MIPS: machine is Generic AR71XX/AR724X/AR913X based board
[ 0.800456] clocksource: Switched to clocksource MIPS
[ 0.861923] NET: Registered protocol family 2
[ 0.914193] IP idents hash table entries: 2048 (order: 2, 16384 bytes)
[ 0.992877] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[ 1.076253] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[ 1.152239] TCP: Hash tables configured (established 1024 bind 1024)
[ 1.228383] UDP hash table entries: 256 (order: 0, 4096 bytes)
[ 1.298184] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[ 1.373383] NET: Registered protocol family 1
[ 1.430181] Crashlog allocated RAM at address 0x3f00000
[ 1.494076] workingset: timestamp_bits=30 max_order=15 bucket_order=0
[ 1.576204] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[ 1.646049] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[ 1.772017] io scheduler noop registered
[ 1.818893] io scheduler deadline registered (default)
[ 1.880618] Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled
[ 1.957065] console [ttyS0] disabled
\xFF[ 2.019901] serial8250.0: ttyS0 at MMIO 0x18020000 (irq = 11, base_baud = 2500000) is a 16550A
[ 2.122959] console [ttyS0] enabled
[ 2.122959] console [ttyS0] enabled
[ 2.206245] bootconsole [early0] disabled
[ 2.206245] bootconsole [early0] disabled
[ 2.303799] libphy: Fixed MDIO Bus: probed
[ 2.356253] NET: Registered protocol family 10
[ 2.422461] Segment Routing with IPv6
[ 2.466384] NET: Registered protocol family 17
[ 2.520093] 8021q: 802.1Q VLAN Support v1.8
[ 2.572825] VFS: Cannot open root device "31:02" or unknown-block(31,2): error -6
[ 2.662430] Please append a correct "root=" boot option; here are the available partitions:
[ 2.762340] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(31,2)
[ 2.862884] Rebooting in 1 seconds..
Stock firmware boot:
Starting kernel ...
@\x15\xFF1\xA5\xB9\xD5\xE1\x81version 2.6.31--LSDK-9.2.0_U11.14 (netgear@netgear-build-PC) (gcc version 4.3.3 (GCC) ) #2 Thu Jan 2 03:52:14 EST 2014
flash_size passed from bootloader = 16
arg 1: console=ttyS0,9600
arg 2: root=31:02
arg 3: rootfstype=jffs2
arg 4: init=/sbin/init
arg 5: mtdparts=ath-nor0:256k(u-boot),64k(u-boot-env),8192k(rootfs),2624k(vmlinux.gz.uImage),4096k(FT_CONF),64k(manuf),1024k(NG_OOPS),64k(ART)
arg 6: mem=128M
CPU revision is: 0001974c (MIPS 74Kc)
ath_sys_frequency: cpu srif ddr srif cpu 560 ddr 400 ahb 200
Determined physical RAM map:
memory: 02000000 @ 00000000 (usable)
User-defined physical RAM map:
memory: 08000000 @ 00000000 (usable)
Initrd not found or empty - disabling initrd
Zone PFN ranges:
Normal 0x00000000 -> 0x00008000
Movable zone start PFN for each node
early_node_map[1] active PFN ranges
0: 0x00000000 -> 0x00008000
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 32512
Kernel command line: console=ttyS0,9600 root=31:02 rootfstype=jffs2 init=/sbin/init mtdparts=ath-nor0:256k(u-boot),64k(u-boot-env),8192k(rootfs),2624k(vmlinux.gz.uImage),4096k(FT_CONF),64k(manuf),1024k(NG_OOPS),64k(ART) mem=128M
PID hash table entries: 512 (order: 9, 2048 bytes)
Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
Primary data cache 32kB, 4-way, VIPT, cache aliases, linesize 32 bytes
Writing ErrCtl register=00000000
Readback ErrCtl register=00000000
Memory: 112540k/131072k available (2033k kernel code, 18364k reserved, 580k data, 168k init, 0k highmem)
NR_IRQS:128
plat_time_init: plat time init done
Calibrating delay loop... 279.55 BogoMIPS (lpj=559104)
Mount-cache hash table entries: 512
****************ALLOC***********************
Packet mem: 802cbea0 (0xe00000 bytes)
********************************************
NET: Registered protocol family 16
***** Warning *****: PCIe WLAN H/W not found !!!
bio: create slab <bio-0> at 0
SCSI subsystem initialized
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 4096 (order: 3, 32768 bytes)
TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
TCP: Hash tables configured (established 4096 bind 4096)
TCP reno registered
NET: Registered protocol family 1
ATH GPIOC major 0
JFFS2 version 2.2 (ZLIB) (RTIME) (c) 2001-2006 Red Hat, Inc.
fuse init (API version 7.12)
msgmni has been set to 220
alg: No test for stdrng (krng)
io scheduler noop registered
io scheduler deadline registered (default)
Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled
serial8250.0: ttyS0 at MMIO 0xb8020000 (irq = 19) is a 16550A
console [ttyS0] enabled
brd: module loaded
8 cmdlinepart partitions found on MTD device ath-nor0
Creating 8 MTD partitions on "ath-nor0":
0x000000000000-0x000000040000 : "u-boot"
0x000000040000-0x000000050000 : "u-boot-env"
0x000000050000-0x000000850000 : "rootfs"
0x000000850000-0x000000ae0000 : "vmlinux.gz.uImage"
0x000000ae0000-0x000000ee0000 : "FT_CONF"
0x000000ee0000-0x000000ef0000 : "manuf"
0x000000ef0000-0x000000ff0000 : "NG_OOPS"
0x000000ff0000-0x000001000000 : "ART"
nf_conntrack version 0.5.0 (2048 buckets, 8192 max)
IPv4 over IPv4 tunneling driver
GRE over IPv4 tunneling driver
ip_tables: (C) 2000-2006 Netfilter Core Team
TCP cubic registered
NET: Registered protocol family 17
Bridge firewalling registered
802.1Q VLAN Support v1.8 Ben Greear <greearb@candelatech.com>
All bugs added by David S. Miller <davem@redhat.com>
athwdt_init: Registering WDT success
ath_otp_init: Registering OTP success
ath_clksw_init: Registering Clock Switch Interface success
VFS: Mounted root (jffs2 filesystem) readonly on device 31:2.
Freeing unused kernel memory: 168k freed
init started: BusyBox v1.15.3 (2013-12-27 08:13:44 EST)
Note Creating 8 MTD partitions on "ath-nor0"
If anybody has any ideas, please let me know. It would be greatly appreciated.