OpenWrt Forum Archive

Topic: WPN824N opensource

The content of this topic has been archived between 6 Feb 2018 and 27 Apr 2018. Unfortunately there are posts – most likely complete pages – missing.

Okay so netgear has so far been completely useless.
if downloaded the netgear source code for the WPN824N if tried version 1.0.0.28 which failed when building the iptables package. tried verison 1.0.0.22 which compiles but when put on the device i get power green flashing and yellow check flashing.

oh btw yes this source is based of openwrt before anyone says it's not.
RELEASE:=Kamikaze
VERSION:=7.09

after being unable to find the issue with the source or what ever is going on i tried this
http://wiki.openwrt.org/oldwiki/OpenWrt … netConsole

put in the mac address labeled on the bottom as noted in the instructions got no errors or anything but telnet hangs.

from what iv been reading openwrt tells people to go to netgear(that makes since to me) then netgear turns around and tells people to go to openwrt(which doesn't make a whole lot of since) even though they modded openwrt to work on there device.

any advice would be great

(Last edited by Pikoko on 10 Jun 2011, 20:35)

I don't know if it makes sense to build a 4 years old openwrt. It runs on kernel 2.6.15 which is pretty outdated. You could add your specific device to openwrt. Your SoC (AR7240) should be covered by the AR71xx, so in best case you only have to copy some config files. See http://wiki.openwrt.org/doc/devel/add.n … rnel.patch for further information.

Ill give it a try. its running 2.6.15 and im gonna start diffing the source supplied by netgear with the the kernel from kernel.org as the how to says.

cool thing is there are madwifi packages for the wireless-n im hoping to turn it in to a jasager router see hak5.org for the wifi pineapple.

Thanks alot MBS

Sorry to disappoint you, but it seems to me that netgear did that already. Just have a look at /target/linux/wpn824n-2.6/src/arch/mips/ar7240. It just happens that in current trunk the ar7240 is part of ar71xx. But as I mentioned already above: it seems to me that all the pieces are already available in current openwrt versions, you just need to patch them together. So I would recommend to copy one of the mach-***.c files found in arch/mips/ar71xx/ to something like mach-wpn824n.c and change it to your needs. Then add it to the Kconfig an Makefile (as mentioned in the wiki) and give it a try.

this is starting to look like something that is beyond my knowledge level.

MBS you seem like you know more about building device specific firmware then i. would you be willing to build firmware for me to test? i can pop my device open and hook up a serial  cable to it for debugging. i just dont have the smarts to convert and move code around.

I'll see what I can do. Though I am no expert and never added any new device before. It is mainly knowledge I gathered by examining existing files. So no warranty.
For the time being, you should hook up a serial cable and get comfortable with the boot loader - it might be necessary sometimes.

i have used uboot. we were doing a project with the literati ereader which used uboot. but ill hook up a serial connector and take a look at it

sounds good. if you've got it working, please post a log from power-on until the system is up and running, and a log when entering u-boot.

here is the bootlog

eth0 up
: cfg1 0xf cfg2 0x7214
eth1: 00:03:7f:09:0b:ad
ATHRS26: resetting s26
ATHRS26: s26 reset done
eth1 up
eth0, eth1
Trying eth1
eth1 link down
FAIL
Trying eth0
eth0 link down
FAIL

 Client starts...[Listening] for ADVERTISE...TTT
Retry count exceeded; boot the image as usual

 nmrp server is stopped or failed !
Hit any key to stop autoboot:  2 1 0 
   Verifying Checksum ... OK
### SQUASHFS loading 'image/uImage' to 0x80800000
### SQUASHFS load complete: 675800 bytes loaded to 0x80800000
## Booting image at 80800000 ...
   Image Name:   Linux Kernel Image
   Created:      2010-04-19   2:32:31 UTC
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    675736 Bytes = 659.9 kB
   Load Address: 80002000
   Entry Point:  801ef000
   Verifying Checksum ... OK
   Uncompressing Kernel Image ... OK
No initrd
## Transferring control to Linux (at address 801ef000) ...
## Giving linux memsize in bytes, 33554432

Starting kernel ...

Booting AR7240(Python)...

Linux version 2.6.15 (root@dnisw3) (gcc version 3.4.4 (OpenWrt-2.0)) #199 Mon Apr 19 10:32:25 CST 2010

flash_size passed from bootloader = 4

CPU revision is: 00019374

Determined physical RAM map:

 memory: 02000000 @ 00000000 (usable)

Built 1 zonelists

Kernel command line: console=ttyS0,115200 root=31:08 rootfstype=squashfs init=/etc/preinit mtdparts=ar7240-nor0:256k(u-boot),64k(u-boot-env),3392k(rootfs),64k(config),128k(language_table),64k(pot),64k(traffic_meter),64k(ART),3473344@327744(mount_fs)

Primary instruction cache 64kB, physically tagged, 4-way, linesize 32 bytes.

Primary data cache 32kB, 4-way, linesize 32 bytes.

Synthesized TLB refill handler (20 instructions).

Synthesized TLB load handler fastpath (32 instructions).

Synthesized TLB store handler fastpath (32 instructions).

Synthesized TLB modify handler fastpath (31 instructions).

Cache parity protection disabled

PID hash table entries: 256 (order: 8, 4096 bytes)

Using 180.000 MHz high precision timer.

Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)

Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)

Memory: 30232k/32768k available (1645k kernel code, 2520k reserved, 322k data, 108k init, 0k highmem)

Mount-cache hash table entries: 512

Checking for 'wait' instruction...  available.

NET: Registered protocol family 16

Returning IRQ 48

AR7240 GPIOC major 0

squashfs: version 3.0 (2006/03/15) Phillip Lougher

Initializing Cryptographic API

io scheduler noop registered

Serial: 8250/16550 driver $Revision: #1 $ 1 ports, IRQ sharing disabled

serial8250.0: ttyS0 at MMIO 0x0 (irq = 19) is a 16550A

9 cmdlinepart partitions found on MTD device ar7240-nor0

Creating 9 MTD partitions on "ar7240-nor0":

0x00000000-0x00040000 : "u-boot"

0x00040000-0x00050000 : "u-boot-env"

0x00050000-0x003a0000 : "rootfs"

0x003a0000-0x003b0000 : "config"

0x003b0000-0x003d0000 : "language_table"

0x003d0000-0x003e0000 : "pot"

0x003e0000-0x003f0000 : "traffic_meter"

0x003f0000-0x00400000 : "ART"

0x00050040-0x003a0000 : "mount_fs"

mtd: partition "mount_fs" doesn't start on an erase block boundary -- force read-only

u32 classifier

    Perfomance counters on

NET: Registered protocol family 2

IP route cache hash table entries: 512 (order: -1, 2048 bytes)

TCP established hash table entries: 2048 (order: 1, 8192 bytes)

TCP bind hash table entries: 2048 (order: 1, 8192 bytes)

TCP: Hash tables configured (established 2048 bind 2048)

TCP reno registered

ip_conntrack version 2.4 (256 buckets, 2048 max) - 228 bytes per conntrack

ip_tables: (C) 2000-2002 Netfilter core team

IPP2P v0.8.2 loading

DNIFILTER loading

TCP bic registered

NET: Registered protocol family 1

NET: Registered protocol family 10

IPv6 over IPv4 tunneling driver

ip6_tables: (C) 2000-2002 Netfilter core team

NET: Registered protocol family 17

Ebtables v2.0 registered

VFS: Mounted root (squashfs filesystem) readonly.

Freeing unused kernel memory: 108k freed

Algorithmics/MIPS FPU Emulator v1.5

- init -

init started:  BusyBox v1.4.2 (2010-04-19 10:23:23 CST) multi-call binary
Loading data from /dev/mtd/3 ...
The data configuration is Valid
The data center is Running ...
ipt_CONENAT: module license 'unspecified' taints kernel.

ip_conntrack_proto_esp loaded

ip_nat_proto_esp loaded

ip_conntrack_rtsp v0.6.21 loading

ip_nat_rtsp v0.6.21 loading

ip_conntrack_pptp version 3.1 loaded

ip_nat_pptp version 3.0 loaded

Generating Rules...
Done!
rmmod: ip_nat_dnisip.ko: Success
rmmod: ip_conntrack_dnisip.ko: Success
POT is Running...
POT is Finished!!!
The POT-(Get/Set) Demo is Running ...
SN: 2AA2065K00A57
WAN MAC: 30:46:9a:0E:80:BC
AG7240: Length per segment 1536

AG7240: Max segments per packet 1

AG7240: Max tx descriptor count    40

AG7240: Max rx descriptor count    252

AG7240: fifo cfg 3 01f00140

AG7240CHH: Mac address for unit 0

AG7240CHH: 30:46:9a:0e:80:bc 

AG7240CHH: Mac address for unit 1

AG7240CHH: 30:46:9a:0e:80:bb 

INIT-SWITCH: Default WAN MAC is : 30:46:9a:0e:80:bc
ag7240_ring_alloc Allocated 640 at 0x81c1a800

ag7240_ring_alloc Allocated 4032 at 0x81308000

Setting PHY...

ADDRCONF(NETDEV_UP): eth0: link is not ready

device eth1 entered promiscuous mode

ag7240_ring_alloc Allocated 640 at 0x81c1a000

ag7240_ring_alloc Allocated 4032 at 0x81cbd000

ATHRS26: resetting s26

ATHRS26: s26 reset done

Setting PHY...

ADDRCONF(NETDEV_UP): eth1: link is not ready

udhcp server (v0.9.8) started
The attached devices demo is Running ...
killall: utelnetd: no process killed
killall: telnetenable: no process killed
The telnetenable is running ...
Deleting static route ... Done!
Adding static route ... Done!
ag7240_ring_free Freeing at 0x81c1a800

ag7240_ring_free Freeing at 0x81308000

ag7240_ring_alloc Allocated 640 at 0x81c1a800

ag7240_ring_alloc Allocated 4032 at 0x81308000

Setting PHY...

ADDRCONF(NETDEV_UP): eth0: link is not ready

ag7240_ring_free Freeing at 0x81c1a800

ag7240_ring_free Freeing at 0x81308000

ag7240_ring_alloc Allocated 640 at 0x81c1a800

ag7240_ring_alloc Allocated 4032 at 0x81308000

Setting PHY...

ADDRCONF(NETDEV_UP): eth0: link is not ready

udhcp client (v0.9.8) started
Sending discover...
Sending discover...
Sending discover...
No lease, forking to background.
traffic_meter config_update : killall: traffic_meter: no process killed
.
killall: ntpclient: no process killed
time zone index is : 20
Run NTP Client with setting: pri:time-b.netgear.com sec:time-c.netgear.com
killall: miniupnpd: no process killed
Jan  1 00:00:33 miniupnpd[388]: listening on 192.168.1.1:5555

lo        no wireless extensions.

sit0      no wireless extensions.

ip6tnl0   no wireless extensions.

br0       no wireless extensions.

eth0      no wireless extensions.

eth1      no wireless extensions.

/etc/rc.d/rc.wlan: /etc/rc.d/rc.wlan: 56: uname: not found
Args: 1
ath_hal: 0.9.17.1 (AR5416, REGOPS_FUNC, WRITE_EEPROM, 11D)

wlan: 0.8.4.2 (Atheros/multi-bss)

ath_rate_atheros: Copyright (c) 2001-2005 Atheros Communications, Inc, All Rights Reserved

ath_dev: Copyright (c) 2001-2007 Atheros Communications, Inc, All Rights Reserved

ath_pci: 0.9.4.5 (Atheros/multi-bss)

wifi0: Atheros 9285: mem=0x10000000, irq=48 hw_base=0xb0000000

wlan: mac acl policy registered

wlan_me: Version 0.1

Copyright (c) 2008 Atheros Communications, Inc. All Rights Reserved

wifi1     no private ioctls.

Creating ap for NETGEAR on
Added ath0 mode master
Interface doesn't accept private ioctl...
HALDbg (8BE0): Operation not permitted
Created ath0 mode ap for NETGEAR
/etc/ath/activateVAP: /etc/ath/activateVAP: 56: uname: not found
lo        no wireless extensions.

sit0      no wireless extensions.

ip6tnl0   no wireless extensions.

br0       no wireless extensions.

eth0      no wireless extensions.

eth1      no wireless extensions.

wifi0     no wireless extensions.

device ath0 entered promiscuous mode

/etc/ath/activateVAP: /etc/ath/activateVAP: 1: arping: not found
>>>>> WPS MODE, 1
>>>>> WPS ENABLED, PSK
cat: /etc/wpa2/WSC_ath0.conf: No such file or directory
>>>>> WPS Translate, Index:0
Making Topology File . . .
Reading topology file /var/run/topology.conf ...
Starting Firewall...
Done!
time zone index is : 20
Run NTP Client with setting: pri:time-b.netgear.com sec:time-c.netgear.com
checksum = 0xFF, len = 131072
There is not language table in flash or language table was broken!
gui_region = English
region = English, download_region =  
 Update string table successfully, memory usage: 216KB.
The httpd server is running ...
dnsmasq: started, version 2.39 cache disabled
dnsmasq: compile time options: IPv6 GNU-getopt ISC-leasefile no-DBus no-I18N no-TFTP
dnsmasq: using local addresses only for domain lan
dnsmasq: failed to access /tmp/dhcp.leases: No such file or directory
dnsmasq: no servers found in /tmp/resolv.conf, will retry
Start utelnetd by telnetenable
killall: lld2d: no process killed
traffic_meter start : .
System startup completed!
Boot up procedure is Finished!!!

Please press Enter to activate this console. Saving Data... Done!
Starting Firewall...
Done!
dnsmasq: NOT DNS Hijack mode!!!
dnsmasq: NOT DNS Hijack mode!!!
Sending discover...
Sending discover...
Sending discover...

here is the uboot help selection

ar7240>  help                                                                   
?       - alias for 'help'                                                      
base    - print or set address offset                                           
bdinfo  - print Board Info structure                                            
boot    - boot default, i.e., run 'bootcmd'                                     
bootd   - boot default, i.e., run 'bootcmd'                                     
bootelf - Boot from an ELF image in memory                                      
bootm   - boot application image from memory                                    
bootp   - boot image via network using BootP/TFTP protocol                      
bootvx  - Boot vxWorks from an ELF image                                        
cmp     - memory compare                                                        
coninfo - print console devices and information                                 
cp      - memory copy                                                           
crc32   - checksum calculation                                                  
fls    - Set to change DDR settings on reboot                                   
dhcp    - invoke DHCP client to obtain IP/boot params                           
echo    - echo args to console                                                  
erase   - erase FLASH memory                                                    
ethreg    - S26 PHY Reg rd/wr  utility                                          
exit    - exit script                                                           
flinfo  - print FLASH memory information                                        
fls    - Set to change Flash size on reboot                                     
fsinfo  - print information about filesystems                                   
fsload  - load binary file from a filesystem image                              
go      - start application at address 'addr'                                   
help    - print online help                                                     
iminfo  - print header information for application image                        
imls    - list all images found in flash                                        
itest   - return true/false on integer compare                                  
loadb   - load binary file over serial line (kermit mode)                       
loads   - load S-Record file over serial line                                   
loady   - load binary file over serial line (ymodem mode)                       
loop    - infinite loop on address range                                        
ls      - list files in a directory (default /)                                 
macset - Set ethernet MAC address                                               
macshow - Show ethernet MAC addresses                                           
md      - memory display                                                        
mii     - MII utility commands                                                  
mm      - memory modify (auto-incrementing)                                     
mtest   - simple RAM test                                                       
mw      - memory write (fill)                                                   
nfs     - boot image via network using NFS protocol                             
nm      - memory modify (constant address)                                      
pci     - list and access PCI Configuration Space                               
ping    - send ICMP ECHO_REQUEST to network host                                
pll    - Set to change CPU/AHB/DDR speeds                                       
printenv- print environment variables                                           
progmac - Set ethernet MAC addresses                                            
protect - enable or disable FLASH write protection                              
rarpboot- boot image via network using RARP/TFTP protocol                       
reset   - Perform RESET of the CPU                                              
run     - run commands in an environment variable                               
saveenv - save environment variables to persistent storage                      
setenv  - set environment variables                                             
sleep   - delay execution for some time                                         
snset   - set serial number                                                     
test    - minimal test like /bin/sh                                             
tftpboot- boot image via network using TFTP protocol                            
version - print monitor version                                                 
wmacset - Set wlan MAC address                                                  
wpspinset - set wpspin number                                                   
autoscr - run script from memory

cpu info:

root@WPN824N:/# cat /proc/cpuinfo                                               
system type             : Atheros AR7240 (Python)                               
processor               : 0                                                     
cpu model               : MIPS 24K V7.4                                         
BogoMIPS                : 238.59                                                
wait instruction        : yes                                                   
microsecond timers      : yes                                                   
tlb_entries             : 16                                                    
extra interrupt vector  : yes                                                   
hardware watchpoint     : yes                                                   
ASEs implemented        : mips16                                                
VCED exceptions         : not available                                         
VCEI exceptions         : not available

version info:

root@WPN824N:/# cat /proc/version                                               
Linux version 2.6.15 (root@dnisw3) (gcc version 3.4.4 (OpenWrt-2.0)) #199 Mon Ap
r 19 10:32:25 CST 2010

memory info:

root@WPN824N:/# cat /proc/meminfo                                               
MemTotal:        30356 kB                                                       
MemFree:         13200 kB                                                       
Buffers:          1640 kB                                                       
Cached:           5592 kB                                                       
SwapCached:          0 kB                                                       
Active:           4328 kB                                                       
Inactive:         4688 kB                                                       
HighTotal:           0 kB                                                       
HighFree:            0 kB                                                       
LowTotal:        30356 kB                                                       
LowFree:         13200 kB                                                       
SwapTotal:           0 kB                                                       
SwapFree:            0 kB                                                       
Dirty:               0 kB                                                       
Writeback:           0 kB                                                       
Mapped:           2788 kB                                                       
Slab:             6048 kB                                                       
CommitLimit:     15176 kB                                                       
Committed_AS:     5292 kB                                                       
PageTables:        480 kB                                                       
VmallocTotal:  1048560 kB                                                       
VmallocUsed:      1308 kB                                                       
VmallocChunk:  1047152 kB

flash layout:

root@WPN824N:/# cat /proc/mtd                                                   
dev:    size   erasesize  name                                                  
mtd0: 00040000 00010000 "u-boot"                                                
mtd1: 00010000 00010000 "u-boot-env"                                            
mtd2: 00350000 00010000 "rootfs"                                                
mtd3: 00010000 00010000 "config"                                                
mtd4: 00020000 00010000 "language_table"                                        
mtd5: 00010000 00010000 "pot"                                                   
mtd6: 00010000 00010000 "traffic_meter"                                         
mtd7: 00010000 00010000 "ART"                                                   
mtd8: 0034ffc0 00010000 "mount_fs"

(Last edited by Pikoko on 21 Jun 2011, 04:00)

Can you check (i.e. in uboot) in which memory area the flash is mapped to? I'd like to confirm that the location of the MAC is at 0x9f3f0000 (maybe md will do that job). Most likely 2 groups of 6 bytes.

yea when i get back to my house tommaro ill post the output for md

just got over https://forum.openwrt.org/viewtopic.php?id=22311 (Netgear WNDR3700) and noticed that bootlog should start a bit earlier than you posted it here. Please check on that again, it seems to contain interesting infos on memorylayout. Also issuing printenv in uboot gives some neat infos.

ok, got some patches ready to hopefully get your wpn824n supported in trunk. i also ran a successful build, so now its up to you to test if it works. at best by just loading it into ram in u-boot and see how it goes. no warranty.
so, here is the patch:

Index: target/linux/ar71xx/config-2.6.37
===================================================================
--- target/linux/ar71xx/config-2.6.37    (Revision 27279)
+++ target/linux/ar71xx/config-2.6.37    (Arbeitskopie)
@@ -45,6 +45,7 @@
 CONFIG_AR71XX_MACH_WNDR3700=y
 CONFIG_AR71XX_MACH_WNR2000=y
 CONFIG_AR71XX_MACH_WP543=y
+CONFIG_AR71XX_MACH_WPN824N=y
 CONFIG_AR71XX_MACH_WRT160NL=y
 CONFIG_AR71XX_MACH_WRT400N=y
 CONFIG_AR71XX_MACH_WZR_HP_AG300H=y
Index: target/linux/ar71xx/config-2.6.38
===================================================================
--- target/linux/ar71xx/config-2.6.38    (Revision 27279)
+++ target/linux/ar71xx/config-2.6.38    (Arbeitskopie)
@@ -45,6 +45,7 @@
 CONFIG_AR71XX_MACH_WNDR3700=y
 CONFIG_AR71XX_MACH_WNR2000=y
 CONFIG_AR71XX_MACH_WP543=y
+CONFIG_AR71XX_MACH_WPN824N=y
 CONFIG_AR71XX_MACH_WRT160NL=y
 CONFIG_AR71XX_MACH_WRT400N=y
 CONFIG_AR71XX_MACH_WZR_HP_G300NH=y
Index: target/linux/ar71xx/files/arch/mips/ar71xx/Makefile
===================================================================
--- target/linux/ar71xx/files/arch/mips/ar71xx/Makefile    (Revision 27279)
+++ target/linux/ar71xx/files/arch/mips/ar71xx/Makefile    (Arbeitskopie)
@@ -59,6 +59,7 @@
 obj-$(CONFIG_AR71XX_MACH_UBNT)        += mach-ubnt.o
 obj-$(CONFIG_AR71XX_MACH_WNDR3700)    += mach-wndr3700.o
 obj-$(CONFIG_AR71XX_MACH_WNR2000)    += mach-wnr2000.o
+obj-$(CONFIG_AR71XX_MACH_WPN824N)    += mach-wpn824n.o
 obj-$(CONFIG_AR71XX_MACH_WP543)        += mach-wp543.o
 obj-$(CONFIG_AR71XX_MACH_WRT160NL)    += mach-wrt160nl.o
 obj-$(CONFIG_AR71XX_MACH_WRT400N)    += mach-wrt400n.o
Index: target/linux/ar71xx/files/arch/mips/ar71xx/machtype.h
===================================================================
--- target/linux/ar71xx/files/arch/mips/ar71xx/machtype.h    (Revision 27279)
+++ target/linux/ar71xx/files/arch/mips/ar71xx/machtype.h    (Arbeitskopie)
@@ -59,6 +59,7 @@
     AR71XX_MACH_WNDR3700,    /* NETGEAR WNDR3700 */
     AR71XX_MACH_WNDR3700V2,    /* NETGEAR WNDR3700v2 */
     AR71XX_MACH_WNR2000,    /* NETGEAR WNR2000 */
+    AR71XX_MACH_WPN824N,    /* NETGEAR WPN824N */
     AR71XX_MACH_WP543,    /* Compex WP543 */
     AR71XX_MACH_WRT160NL,    /* Linksys WRT160NL */
     AR71XX_MACH_WRT400N,    /* Linksys WRT400N */
Index: target/linux/ar71xx/files/arch/mips/ar71xx/Kconfig
===================================================================
--- target/linux/ar71xx/files/arch/mips/ar71xx/Kconfig    (Revision 27279)
+++ target/linux/ar71xx/files/arch/mips/ar71xx/Kconfig    (Arbeitskopie)
@@ -216,6 +216,15 @@
     select AR71XX_DEV_LEDS_GPIO
     default n
 
+config AR71XX_MACH_WPN824N
+    bool "NETGEAR WPN824N board support"
+    select SOC_AR724X
+    select AR71XX_DEV_M25P80
+    select AR71XX_DEV_AP91_PCI if PCI
+    select AR71XX_DEV_GPIO_BUTTONS
+    select AR71XX_DEV_LEDS_GPIO
+    default n
+
 config AR71XX_MACH_MZK_W04NU
     bool "Planex MZK-W04NU board support"
     select SOC_AR913X
Index: target/linux/ar71xx/files/arch/mips/ar71xx/mach-wpn824n.c
===================================================================
--- target/linux/ar71xx/files/arch/mips/ar71xx/mach-wpn824n.c    (Revision 0)
+++ target/linux/ar71xx/files/arch/mips/ar71xx/mach-wpn824n.c    (Revision 0)
@@ -0,0 +1,164 @@
+/*
+ *  NETGEAR WPN824N board support
+ *
+ *  Copyright (C) 2009-2010 Gabor Juhos <juhosg@openwrt.org>
+ *
+ *  This program is free software; you can redistribute it and/or modify it
+ *  under the terms of the GNU General Public License version 2 as published
+ *  by the Free Software Foundation.
+ */
+
+#include <linux/mtd/mtd.h>
+#include <linux/mtd/partitions.h>
+
+#include <asm/mach-ar71xx/ar71xx.h>
+
+#include "machtype.h"
+#include "devices.h"
+#include "dev-m25p80.h"
+#include "dev-ap91-pci.h"
+#include "dev-gpio-buttons.h"
+#include "dev-leds-gpio.h"
+
+#define WPN824N_GPIO_LED_TEST        10     /* amber */
+#define WPN824N_GPIO_LED_POWER        0    /* green */
+#define WPN824N_GPIO_LED_STATUS        1    
+
+#define WPN824N_GPIO_BTN_PUSH        6
+#define WPN824N_GPIO_BTN_RESET        7
+#define WPN824N_GPIO_BTN_WLAN        8
+
+#define WPN824N_KEYS_POLL_INTERVAL    100    /* msecs */
+#define WPN824N_KEYS_DEBOUNCE_INTERVAL (3 * WPN824N_KEYS_POLL_INTERVAL)
+
+#ifdef CONFIG_MTD_PARTITIONS
+static struct mtd_partition wpn824n_partitions[] = {
+    {
+        .name        = "u-boot",
+        .offset        = 0,
+        .size        = 0x040000,
+        .mask_flags    = MTD_WRITEABLE,
+    }, {
+        .name        = "u-boot-env",
+        .offset        = 0x040000,
+        .size        = 0x010000,
+    }, {
+        .name        = "rootfs",
+        .offset        = 0x050000,
+        .size        = 0x350000,
+    }, {
+        .name        = "config",
+        .offset        = 0x3a0000,
+        .size        = 0x010000,
+    }, {
+        .name        = "language_table",
+        .offset        = 0x3b0000,
+        .size        = 0x020000,
+    }, {
+        .name        = "pot",
+        .offset        = 0x3d0000,
+        .size        = 0x010000,
+    }, {
+        .name        = "traffic_meter",
+        .offset        = 0x3e0000,
+        .size        = 0x010000,
+    }, {
+        .name        = "art",
+        .offset        = 0x3f0000,
+        .size        = 0x010000,
+        .mask_flags    = MTD_WRITEABLE,
+    }, {
+        .name        = "mount_fs",
+        .offset        = 0x050040,
+        .size        = 0x34ffc0,
+    }
+};
+#endif /* CONFIG_MTD_PARTITIONS */
+
+static struct flash_platform_data wpn824n_flash_data = {
+#ifdef CONFIG_MTD_PARTITIONS
+    .parts        = wpn824n_partitions,
+    .nr_parts    = ARRAY_SIZE(wpn824n_partitions),
+#endif
+};
+
+static struct gpio_led wpn824n_leds_gpio[] __initdata = {
+    {
+        .name        = "wpn824nd:green:power",
+        .gpio        = WPN824N_GPIO_LED_POWER,
+        .active_low    = 1,
+    }, {
+        .name        = "wpn824nd:green:status",
+        .gpio        = WPN824N_GPIO_LED_STATUS,
+        .active_low    = 1,
+    }, {
+        .name        = "wpn824n:amber:test",
+        .gpio        = WPN824N_GPIO_LED_TEST,
+        .active_low    = 1,
+    }
+};
+
+static struct gpio_keys_button wpn824n_gpio_keys[] __initdata = {
+    {
+        .desc        = "reset",
+        .type        = EV_KEY,
+        .code        = KEY_RESTART,
+        .debounce_interval = WPN824N_KEYS_DEBOUNCE_INTERVAL,
+        .gpio        = WPN824N_GPIO_BTN_RESET,
+        .active_low    = 1,
+    }, {
+        .desc        = "wps",
+        .type        = EV_KEY,
+        .code        = KEY_WPS_BUTTON,
+        .debounce_interval = WPN824N_KEYS_DEBOUNCE_INTERVAL,
+        .gpio        = WPN824N_GPIO_BTN_PUSH,
+        .active_low    = 1,
+    }, {
+        .desc        = "wifi",
+        .type        = EV_KEY,
+        .code        = BTN_2,
+        .debounce_interval = WPN824N_KEYS_DEBOUNCE_INTERVAL,
+        .gpio        = WPN824N_GPIO_BTN_WLAN,
+        .active_low    = 1,
+    }
+};
+
+static void __init wpn824n_setup(void)
+{
+    u8 *mac = (u8 *) KSEG1ADDR(0x9f3f0000);
+    u8 *ee = (u8 *) KSEG1ADDR(0xbfff1000);
+
+    ar71xx_add_device_m25p80(&wpn824n_flash_data);
+
+    ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(wpn824n_leds_gpio),
+                    wpn824n_leds_gpio);
+
+    ar71xx_register_gpio_keys_polled(-1, WPN824N_KEYS_POLL_INTERVAL,
+                     ARRAY_SIZE(wpn824n_gpio_keys),
+                     wpn824n_gpio_keys);
+
+    ar71xx_eth1_data.has_ar7240_switch = 1;
+    ar71xx_init_mac(ar71xx_eth0_data.mac_addr, mac, 0);
+    ar71xx_init_mac(ar71xx_eth1_data.mac_addr, mac, 1);
+
+    /* WAN port */
+    ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
+    ar71xx_eth0_data.speed = SPEED_100;
+    ar71xx_eth0_data.duplex = DUPLEX_FULL;
+    ar71xx_eth0_data.phy_mask = BIT(4);
+
+    /* LAN ports */
+    ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
+    ar71xx_eth1_data.speed = SPEED_1000;
+    ar71xx_eth1_data.duplex = DUPLEX_FULL;
+
+    ar71xx_add_device_mdio(0x0);
+    ar71xx_add_device_eth(1);
+    ar71xx_add_device_eth(0);
+
+    ap91_pci_setup_wmac_led_pin(1);
+
+    ap91_pci_init(ee, mac);
+}
+MIPS_MACHINE(AR71XX_MACH_WPN824N, "WPN824N", "NETGEAR WPN824N",
+         wpn824n_setup);
Index: target/linux/ar71xx/image/Makefile
===================================================================
--- target/linux/ar71xx/image/Makefile    (Revision 27279)
+++ target/linux/ar71xx/image/Makefile    (Arbeitskopie)
@@ -753,6 +753,12 @@
     $(call Image/Build/Template/$(fs_64k)/$(1),Netgear,wndr3700v2,$(wndr3700v2_cmdline),wndr3700v2_mtdlayout,3701,WNDR3700v2,"",-H 29763654+16+64)
 endef
 
+wpn824n_cmdline=board=WPN824N console=ttyS0,115200
+wpn824n_mtdlayout=mtdparts=ar7240-nor0:256k(u-boot),64k(u-boot-env),3392k(rootfs),64k(config),128k(language_table),64k(pot),64k(traffic_meter),64k(ART),3473344@327744(mount_fs)
+define Image/Build/Profile/WPN824N
+    $(call Image/Build/Template/$(fs_64k)/$(1),Netgear,wpn824n,$(wpn824n_cmdline),wpn824n_mtdlayout,1100,WPN824N,"" NA,)
+endef
+
 ap96_cmdline=board=AP96 console=ttyS0,115200
 define Image/Build/Profile/AP96
     $(call Image/Build/Template/$(fs_64k)/$(1),AP83,ap96,$(ap96_cmdline))
Index: target/linux/ar71xx/generic/profiles/netgear.mk
===================================================================
--- target/linux/ar71xx/generic/profiles/netgear.mk    (Revision 27279)
+++ target/linux/ar71xx/generic/profiles/netgear.mk    (Arbeitskopie)
@@ -17,3 +17,15 @@
 endef
 
 $(eval $(call Profile,WNDR3700))
+
+define Profile/WPN824N
+    NAME:=NETGEAR WPN824N
+    PACKAGES:=kmod-ath9k wpad-mini
+endef
+
+define Profile/WPN824N/Description
+    Package set optimized for the NETGEAR WPN824N
+endef
+
+$(eval $(call Profile,WPN824N))
+

good luck and have fun!

Grrr i think i pay have just blown the board -.- i dont get it.

You must be kidding me. After spending almost my whole weekend on that topic you just blow it?!?
So, anyway, how will you go on? Is this thread closed now?

[EDIT: initial version posted was missing the new file, mach-wpn824n.c - current version is correct]

I've taken these patches as a starting point and made a new set which is verified to work and builds a working trunk.  I've used the built in recovery mode to TFTP flash the factory-NA file and the router boots and runs apparently fully featured.  I may have missed some LEDs, and none of the buttons work yet, but for the most part it works great.

These apply to trunk r32760 as I just refreshed them now.  Actual patchfile available at http://www.freefilehosting.net/wpn824n-r32760_1 in case the codebox mangles tabs or something.

Index: target/linux/ar71xx/files/arch/mips/ath79/mach-wpn824n.c
===================================================================
--- target/linux/ar71xx/files/arch/mips/ath79/mach-wpn824n.c    (revision 0)
+++ target/linux/ar71xx/files/arch/mips/ath79/mach-wpn824n.c    (revision 0)
@@ -0,0 +1,134 @@
+/*
+ *  NETGEAR WPN824N board support
+ *
+ *  Copyright (C) 2009-2010 Gabor Juhos <juhosg@openwrt.org>
+ *  Copyright (C) 2012 Tony Butler <spudz76@gmail.com>
+ *
+ *  This program is free software; you can redistribute it and/or modify it
+ *  under the terms of the GNU General Public License version 2 as published
+ *  by the Free Software Foundation.
+ */
+
+#include <linux/platform_device.h>
+#include <linux/delay.h>
+
+#include <asm/mach-ath79/ath79.h>
+
+#include "dev-ap9x-pci.h"
+#include "dev-eth.h"
+#include "dev-gpio-buttons.h"
+#include "dev-leds-gpio.h"
+#include "dev-m25p80.h"
+#include "machtypes.h"
+
+#define WPN824N_GPIO_LED_WAN        0    /* amber */
+#define WPN824N_GPIO_LED_STATUS        1    /* amber */
+#define WPN824N_GPIO_LED_LAN_4        12    /* amber */
+
+#define WPN824N_WGPIO_LED_POWER        0    /* green */
+#define WPN824N_WGPIO_LED_WLAN        1    /* blue  */
+#define WPN824N_WGPIO_LED_WPS1        5    /* blue  */
+#define WPN824N_WGPIO_LED_WPS2        9    /* blue  */
+#define WPN824N_WGPIO_LED_TEST        10    /* amber */
+
+#define WPN824N_GPIO_BTN_UART_ACT    10
+
+#define WPN824N_KEYS_POLL_INTERVAL    20    /* msecs */
+#define WPN824N_KEYS_DEBOUNCE_INTERVAL    (3 * WPN824N_KEYS_POLL_INTERVAL)
+
+static struct flash_platform_data wpn824n_flash_data = {
+};
+
+static struct gpio_led wpn824n_leds_gpio[] __initdata = {
+    {
+        .name        = "wpn824n:amber:wan",
+        .gpio        = WPN824N_GPIO_LED_WAN,
+        .active_low  = 1,
+    }, {
+        .name        = "wpn824n:amber:status",
+        .gpio        = WPN824N_GPIO_LED_STATUS,
+        .active_low  = 1,
+    }, {
+        .name        = "wpn824n:amber:lan4",
+        .gpio        = WPN824N_GPIO_LED_LAN_4,
+        .active_low  = 1,
+    }
+};
+
+static struct gpio_led wpn824n_wmac_leds_gpio[] = {
+    {
+        .name        = "wpn824n:green:power",
+        .gpio        = WPN824N_WGPIO_LED_POWER,
+        .active_low  = 1,
+    }, {
+        .name        = "wpn824n:blue:wlan",
+        .gpio        = WPN824N_WGPIO_LED_WLAN,
+        .active_low  = 1,
+    }, {
+        .name        = "wpn824n:blue:wps1",
+        .gpio        = WPN824N_WGPIO_LED_WPS1,
+        .active_low  = 1,
+    }, {
+        .name        = "wpn824n:blue:wps2",
+        .gpio        = WPN824N_WGPIO_LED_WPS2,
+        .active_low  = 1,
+    }, {
+        .name        = "wpn824n:amber:test",
+        .gpio        = WPN824N_WGPIO_LED_TEST,
+        .active_low  = 1,
+    }
+};
+
+static struct gpio_keys_button wpn824n_gpio_keys[] __initdata = {
+    {
+        .desc        = "UART_ACT",
+        .type        = EV_KEY,
+        .code        = BTN_0,
+        .debounce_interval = WPN824N_KEYS_DEBOUNCE_INTERVAL,
+        .gpio        = WPN824N_GPIO_BTN_UART_ACT,
+        .active_low    = 1,
+    }
+};
+
+#define WPN824N_WAN_PHYMASK 0x10
+
+static void __init wpn824n_setup(void)
+{
+    u8 *mac = (u8 *) KSEG1ADDR(0x9f3f0000);
+    u8 *ee = (u8 *) KSEG1ADDR(0xbfff1000);
+
+    ath79_register_mdio(0, ~(WPN824N_WAN_PHYMASK));
+
+    /* LAN ports */
+    ath79_init_mac(ath79_eth1_data.mac_addr, mac, 1);
+    ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
+    ath79_eth1_data.speed = SPEED_1000;
+    ath79_eth1_data.duplex = DUPLEX_FULL;
+
+    ath79_register_eth(1);
+
+    /* WAN port */
+    ath79_init_mac(ath79_eth0_data.mac_addr, mac, 0);
+    ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
+    ath79_eth0_data.speed = SPEED_100;
+    ath79_eth0_data.duplex = DUPLEX_FULL;
+    ath79_eth0_data.phy_mask = WPN824N_WAN_PHYMASK;
+
+    ath79_register_eth(0);
+
+    ath79_register_m25p80(&wpn824n_flash_data);
+
+    ath79_register_leds_gpio(-1, ARRAY_SIZE(wpn824n_leds_gpio),
+                    wpn824n_leds_gpio);
+
+    ath79_register_gpio_keys_polled(-1, WPN824N_KEYS_POLL_INTERVAL,
+                    ARRAY_SIZE(wpn824n_gpio_keys),
+                    wpn824n_gpio_keys);
+
+
+    ap91_pci_init(ee, mac);
+    ap9x_pci_setup_wmac_led_pin(0,1);
+    ap9x_pci_setup_wmac_leds(0, wpn824n_wmac_leds_gpio,
+                 ARRAY_SIZE(wpn824n_wmac_leds_gpio));
+}
+MIPS_MACHINE(ATH79_MACH_WPN824N, "WPN824N", "NETGEAR WPN824N", wpn824n_setup);
Index: target/linux/ar71xx/image/Makefile
===================================================================
--- target/linux/ar71xx/image/Makefile    (revision 32760)
+++ target/linux/ar71xx/image/Makefile    (working copy)
@@ -1004,6 +1004,12 @@
     $(call Image/Build/Template/$(fs_64k)/$(1),Netgear,wndrmacv2,$(wndr3700_cmdline),$(wndr3700v2_mtdlayout),3701,WNDRMACv2,"",-H 29763654+16+128)
 endef
 
+wpn824n_cmdline=board=WPN824N console=ttyS0,115200
+wpn824n_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,1024k(kernel),2688k(rootfs),64k(art)ro,3712k@0x50000(firmware)
+define Image/Build/Profile/WPN824N
+    $(call Image/Build/Template/$(fs_64k)/$(1),Netgear,wpn824n,$(wpn824n_cmdline),$(wpn824n_mtdlayout),1100,WPN824N,"" NA,)
+endef
+
 wr400n_cmdline=board=WRT400N console=ttyS0,115200
 define Image/Build/Profile/WRT400N
     $(call Image/Build/Template/$(fs_64k)/$(1),WRT400N,wrt400n,$(wr400n_cmdline))
Index: target/linux/ar71xx/config-3.3
===================================================================
--- target/linux/ar71xx/config-3.3    (revision 32760)
+++ target/linux/ar71xx/config-3.3    (working copy)
@@ -68,6 +68,7 @@
 CONFIG_ATH79_MACH_WHR_HP_G300N=y
 CONFIG_ATH79_MACH_WNDR3700=y
 CONFIG_ATH79_MACH_WNR2000=y
+CONFIG_ATH79_MACH_WPN824N=y
 CONFIG_ATH79_MACH_WP543=y
 CONFIG_ATH79_MACH_WPE72=y
 CONFIG_ATH79_MACH_WRT160NL=y
Index: target/linux/ar71xx/patches-3.3/610-MIPS-ath79-openwrt-machines.patch
===================================================================
--- target/linux/ar71xx/patches-3.3/610-MIPS-ath79-openwrt-machines.patch    (revision 32760)
+++ target/linux/ar71xx/patches-3.3/610-MIPS-ath79-openwrt-machines.patch    (working copy)
@@ -1,6 +1,6 @@
 --- a/arch/mips/ath79/machtypes.h
 +++ b/arch/mips/ath79/machtypes.h
-@@ -16,18 +16,91 @@
+@@ -16,18 +16,92 @@
  
  enum ath79_mach_type {
      ATH79_MACH_GENERIC = 0,
@@ -80,6 +80,7 @@
 +    ATH79_MACH_WHR_HP_GN,        /* Buffalo WHR-HP-GN */
 +    ATH79_MACH_WNDR3700,        /* NETGEAR WNDR3700/WNDR3800/WNDRMAC */
 +    ATH79_MACH_WNR2000,        /* NETGEAR WNR2000 */
++    ATH79_MACH_WPN824N,        /* NETGEAR WPN824N */
 +    ATH79_MACH_WP543,        /* Compex WP543 */
 +    ATH79_MACH_WPE72,        /* Compex WPE72 */
 +    ATH79_MACH_WRT160NL,        /* Linksys WRT160NL */
@@ -186,7 +187,7 @@
  config ATH79_MACH_PB44
      bool "Atheros PB44 reference board"
      select SOC_AR71XX
-@@ -66,6 +137,419 @@ config ATH79_MACH_PB44
+@@ -66,6 +137,427 @@ config ATH79_MACH_PB44
        Say 'Y' here if you want your kernel to support the
        Atheros PB44 reference board.
  
@@ -388,6 +389,14 @@
 +    select ATH79_DEV_M25P80
 +    select ATH79_DEV_WMAC
 +
++config ATH79_MACH_WPN824N
++    bool "NETGEAR WPN824N board support"
++    select SOC_AR724X
++    select ATH79_DEV_AP9X_PCI if PCI
++    select ATH79_DEV_GPIO_BUTTONS
++    select ATH79_DEV_LEDS_GPIO
++    select ATH79_DEV_M25P80
++
 +config ATH79_MACH_OM2P
 +    bool "OpenMesh OM2P board support"
 +    select SOC_AR724X
@@ -668,7 +677,7 @@
  endif
 --- a/arch/mips/ath79/Makefile
 +++ b/arch/mips/ath79/Makefile
-@@ -36,9 +36,61 @@ obj-$(CONFIG_ATH79_PCI_ATH9K_FIXUP)    += p
+@@ -36,9 +36,62 @@ obj-$(CONFIG_ATH79_PCI_ATH9K_FIXUP)    += p
  #
  # Machines
  #
@@ -722,6 +731,7 @@
 +obj-$(CONFIG_ATH79_MACH_WHR_HP_G300N)    += mach-whr-hp-g300n.o
 +obj-$(CONFIG_ATH79_MACH_WNDR3700)    += mach-wndr3700.o
 +obj-$(CONFIG_ATH79_MACH_WNR2000)    += mach-wnr2000.o
++obj-$(CONFIG_ATH79_MACH_WPN824N)    += mach-wpn824n.o
 +obj-$(CONFIG_ATH79_MACH_WP543)        += mach-wp543.o
 +obj-$(CONFIG_ATH79_MACH_WPE72)        += mach-wpe72.o
 +obj-$(CONFIG_ATH79_MACH_WRT160NL)    += mach-wrt160nl.o
Index: target/linux/ar71xx/base-files/lib/ar71xx.sh
===================================================================
--- target/linux/ar71xx/base-files/lib/ar71xx.sh    (revision 32760)
+++ target/linux/ar71xx/base-files/lib/ar71xx.sh    (working copy)
@@ -363,6 +363,9 @@
     *"WNDR3700/WNDR3800/WNDRMAC")
         wndr3700_board_detect "$machine"
         ;;
+    *WPN824N)
+        name="wpn824n"
+        ;;
     *WNR2000)
         name="wnr2000"
         ;;
Index: target/linux/ar71xx/base-files/etc/uci-defaults/leds
===================================================================
--- target/linux/ar71xx/base-files/etc/uci-defaults/leds    (revision 32760)
+++ target/linux/ar71xx/base-files/etc/uci-defaults/leds    (working copy)
@@ -131,6 +131,11 @@
     ucidef_set_led_usbdev "usb" "USB" "wndr3700:green:usb" "1-1"
     ;;
 
+wpn824n)
+    ucidef_set_led_wlan "wlan" "WLAN" "wpn824n:blue:wlan" "phy0tpt"
+    ucidef_set_led_netdev "wan" "WAN" "wpn824n:amber:wan" "eth1"
+    ;;
+
 whr-g301n |\
 whr-hp-g300n |\
 whr-hp-gn)
Index: target/linux/ar71xx/base-files/etc/diag.sh
===================================================================
--- target/linux/ar71xx/base-files/etc/diag.sh    (revision 32760)
+++ target/linux/ar71xx/base-files/etc/diag.sh    (working copy)
@@ -150,6 +150,9 @@
     wnr2000)
         status_led="wnr2000:green:power"
         ;;
+    wpn824n)
+        status_led="wpn824n:green:power"
+        ;;
     wp543)
         status_led="wp543:green:diag"
         ;;
Index: target/linux/ar71xx/generic/profiles/netgear.mk
===================================================================
--- target/linux/ar71xx/generic/profiles/netgear.mk    (revision 32760)
+++ target/linux/ar71xx/generic/profiles/netgear.mk    (working copy)
@@ -15,3 +15,14 @@
 endef
 
 $(eval $(call Profile,WNDR3700))
+
+define Profile/WPN824N
+    NAME:=NETGEAR WPN824N
+    PACKAGES:=kmod-ath9k wpad-mini
+endef
+
+define Profile/WPN824N/Description
+    Package set optimized for the NETGEAR WPN824N
+endef
+
+$(eval $(call Profile,WPN824N))

(Last edited by Spudz76 on 17 Jul 2012, 02:58)

OK I've tracked down the button GPIOs in the Netgear GPL 1.0.0.28 code, the issue is that all of them are connected to the AR9285.  I am having trouble figuring out if the ath9k driver even has an input/event layer in it (obviously it has output control, for LEDs, which works as seen above).  The original GPL code seems to build its own event polling loop (of course!) rather than maybe using the actual input events layer already in the kernel (why would anyone want that?).

Anyway, figured I'd report my findings in case anyone had some insight on how to get ath9k to register buttons (or if it's going to take some ath9k upstream work).

Spudz76: I'm attempting to reproduce your successful results with my own WPN824N. I got the r32760 code and patched it with your latest patch. I added
CONFIG_ATH79_MACH_WPN824N=y
to my configuration. Then I ran make, which completed successfully. My question is what file I am supposed to send to the router. The only ones with "factory-NA" in the filename are bin/ar71xx/openwrt-ar71xx-generic-wndr3700-jffs2-factory-NA.img and bin/ar71xx/openwrt-ar71xx-generic-wndr3700-squashfs-factory-NA.img. I would expect something more like bin/ar71xx/openwrt-ar71xx-generic-wpn824n-jffs2-factory-NA.img. Are these wndr3700 ones correct?

I am unsure why the wndr3700 ones got built, my trunk/.config has "CONFIG_TARGET_ar71xx_generic_WPN824N=y" and no other targets selected, however with the CONFIG_ATH79_MACH_WPN824N set in your kernel config (which would be set automatically by the above) the resulting kernel should work.  I have not tested jffs2 recently (and back when I did, it didn't work, but the MTD partitions were all goofed up still - now they are perfect) so you also should set "CONFIG_TARGET_ROOTFS_SQUASHFS=y" in your OpenWRT .config so that openwrt-ar71xx-generic-wpn824n-squashfs-factory-NA.img is built.  Then you need to trigger the recovery mode, one way is to intentionally brick the router during a reflash of the stock firmware (use the stock upgrade page to load the firmware, and then wait something like 15 seconds and cut the power, and then you should be stuck in recovery mode).  Or, you can open it up and use a level shifting console cable (same as any other 3.3v uart port on any other router) at 115200/8n1 the pin by the white square (pin 1) is Vcc, then the two data pins (not sure which is which but hey you have a 50/50 shot and nothing will fry if its backward), and pin 4 on the other end is ground.  Anyway once you have console going boot it up and you should see u-boot doing its thing, whack Ctrl-C before it actually loads a kernel and it will drop you to the prompt.  From there I usually use "fsload" which fails and ends up in recovery mode, but my original firmware is long gone (if you still have the stock image in flash, the fsload command may actually boot correctly instead of failing - I'm not sure as I bricked mine before OpenWRT was anywhere near it).  The router comes up at 192.168.1.1 by default, so follow the normal TFTP methods and send the squashfs wpn824n factory NA bin file and you will see the upgrade progress on the console.  It should take, flash, and reboot into fresh hot OpenWRT r32760.

I will come up with a much cleaner method but that should get you going.  I didn't spend much time figuring out the other commands in the u-boot that is on it.  You can use 'help' and there are plenty of commands to try, including nfs booting and a bunch of other stuff most stock router bootloaders don't have.  There is probably a direct tftp recovery mode command but the broken 'fsload' was the first thing I found that crashed it every time.

Just for fun, I uploaded my full trunk/.config file from which I build my test images - in case I forgot something else.  You should be able to diff it against yours to see where things may have gone wrong.  http://www.freefilehosting.net/openwrt- … n824n-luci

Oh, and my config above also has ipv6 and luci and a couple other things from feeds installed, so make sure your feeds are updated and installed if you want the useful bits to be there.

And after patching, and your tree is not fully clean, you need to at least remove trunk/tmp/.targetinfo so that it all gets reparsed when you run menuconfig, or the WPN824N won't show up.  To be safe you can whack the entire trunk/tmp directory and it will run through the prereqs and stuff too, just to be sure.

Your menuconfig target settings should look like this:

Target System (Atheros AR7xxx/AR9xxx)  --->
Subtarget (Generic)  --->
Target Profile (NETGEAR WPN824N)  --->

By removing the ./tmp directory and rerunning make menuconfig, I was able to get ./bin/ar71xx/openwrt-ar71xx-generic-wpn824n-squashfs-factory-NA.img to build.

I am able to get the router into recovery mode by sticking a pin into the hole in the back, powering the router on, and waiting for about 15 seconds. The lights start flashing, and then I'm able to transfer the image over TFTP. The router then appears to flash and reboot. Thus far, though, I seem to be unable to contact the router when it tries to boot off of this fimware.

Impossible to tell you what is wrong without some serial console output, unfortunately.  I don't think there are multiple revisions of this model, but perhaps there are slight differences.  I will attempt a flash on my remaining still-stock unit and see what happens then, maybe I can duplicate your failure.

I can tell you that it will come up far enough to respond to a few pings, but the replies are weird, truncated packets. So it replies to an ARP request and then receives and responds to the ping. I guess that's probably just the bootloader, though.

Yes, the corrupt replies are from the bootloader.