OpenWrt Forum Archive

Topic: ZyXEL NBG-419N v2 support

The content of this topic has been archived between 27 Nov 2017 and 28 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hello,

I purchased new version of ZyXEL's NBG-419N.

The v2 version of the device looks identical to its predeseccors, and is *almost* able to boot AA and BB rc-3.

The kernel boots up nicely, but hangs to:

[    0.560000] VFS: Cannot open root device "(null)" or unknown-block(0,0)
[    0.570000] Please append a correct "root=" boot option; here are the available partitions:
[    0.590000] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

BB rc-3 however goes a bit further, producing only one additional line:

[    2.520000] rt305x-esw 10110000.esw: link changed 0x01

AA boot log: (openwrt-ramips-rt305x-nbg-419n-squashfs-sysupgrade.bin)

Automatic boot of image at addr 0x80800000 ...
## Booting image at 80800000 ...
   Image Name:   MIPS OpenWrt Linux-3.3.8
   Created:      2013-03-23  19:02:00 UTC
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    887001 Bytes = 866.2 kB
   Load Address: 80000000
   Entry Point:  80000000
   Verifying Checksum ... OK
   Uncompressing Kernel Image ... OK
No initrd
## Transferring control to Linux (at address 80000000) ...
## Giving linux memsize in MB, 64

Starting kernel ...

[    0.000000] Linux version 3.3.8 (blogic@Debian-60-squeeze-64-minimal) (gcc version 4.6.3 20120201 (prerelease) (Linaro GCC 4.6-2012.02) ) #1 Sat Mar 23 19:00:46 UTC 2013
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU revision is: 0001964c (MIPS 24KEc)
[    0.000000] Ralink RT3352 id:1 rev:6 running at 384.00 MHz
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 04000000 @ 00000000 (usable)
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Zone PFN ranges:
[    0.000000]   Normal   0x00000000 -> 0x00004000
[    0.000000] Movable zone start PFN for each node
[    0.000000] Early memory PFN ranges
[    0.000000]     0: 0x00000000 -> 0x00004000
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 16256
[    0.000000] Kernel command line:  board=NBG-419N console=ttyS1,57600 mtdparts=physmap-flash.0:192k(u-boot)ro,64k(u-boot-env)ro,64k(factory)ro,896k(kernel),2880k(rootfs),3776k@0x50000(firmware) rootfstype=squashfs,jffs2
[    0.000000] PID hash table entries: 256 (order: -2, 1024 bytes)
[    0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes.
[    0.000000] Primary data cache 16kB, 4-way, VIPT, no aliases, linesize 32 bytes
[    0.000000] Writing ErrCtl register=00078412
[    0.000000] Readback ErrCtl register=00078412
[    0.000000] Memory: 62160k/65536k available (2046k kernel code, 3376k reserved, 340k data, 176k init, 0k highmem)
[    0.000000] SLUB: Genslabs=9, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS:48
[    0.000000] console [ttyS1] enabled, bootconsole disabled
[    0.000000] console [ttyS1] enabled, bootconsole disabled
[    0.010000] Calibrating delay loop... 255.59 BogoMIPS (lpj=1277952)
[    0.090000] pid_max: default: 32768 minimum: 301
[    0.100000] Mount-cache hash table entries: 512
[    0.110000] NET: Registered protocol family 16
[    0.120000] MIPS: machine is ZyXEL NBG-419N
[    0.130000] gpiochip_add: registered GPIOs 0 to 23 on device: RT305X-GPIO0
[    0.140000] gpiochip_add: registered GPIOs 24 to 39 on device: RT305X-GPIO1
[    0.150000] gpiochip_add: registered GPIOs 40 to 51 on device: RT305X-GPIO2
[    0.180000] bio: create slab <bio-0> at 0
[    0.190000] Switching to clocksource MIPS
[    0.200000] NET: Registered protocol family 2
[    0.210000] IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.230000] TCP established hash table entries: 2048 (order: 2, 16384 bytes)
[    0.240000] TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
[    0.250000] TCP: Hash tables configured (established 2048 bind 2048)
[    0.270000] TCP reno registered
[    0.270000] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.280000] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.300000] NET: Registered protocol family 1
[    0.340000] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.350000] JFFS2 version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.370000] msgmni has been set to 121
[    0.380000] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 254)
[    0.400000] io scheduler noop registered
[    0.410000] io scheduler deadline registered (default)
[    0.420000] Serial: 8250/16550 driver, 16 ports, IRQ sharing enabled
[    0.430000] serial8250: ttyS0 at MMIO 0x10000500 (irq = 13) is a 16550A
[    0.440000] serial8250: ttyS1 at MMIO 0x10000c00 (irq = 20) is a 16550A
[    0.470000] physmap platform flash device: 00800000 at bf000000
[    0.480000] physmap-flash physmap-flash.0: map_probe failed
[    0.510000] ramips-wdt ramips-wdt: timeout value must be 0 < timeout <= 33, using 33
[    0.520000] TCP cubic registered
[    0.530000] NET: Registered protocol family 17
[    0.540000] Bridge firewalling registered
[    0.550000] 8021q: 802.1Q VLAN Support v1.8
[    0.560000] VFS: Cannot open root device "(null)" or unknown-block(0,0)
[    0.570000] Please append a correct "root=" boot option; here are the available partitions:
[    0.590000] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

BB rc-3 boot log: (openwrt-ramips-rt305x-nbg-419n-squashfs-sysupgrade.bin)

Automatic boot of image at addr 0x80800000 ...
## Booting image at 80800000 ...
   Image Name:   MIPS OpenWrt Linux-3.10.49
   Created:      2014-08-08   2:02:16 UTC
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    1054434 Bytes =  1 MB
   Load Address: 80000000
   Entry Point:  80000000
   Verifying Checksum ... OK
   Uncompressing Kernel Image ... OK
No initrd
## Transferring control to Linux (at address 80000000) ...
## Giving linux memsize in MB, 64

Starting kernel ...

[    0.000000] Linux version 3.10.49 (bb@builder1) (gcc version 4.8.3 (OpenWrt/Linaro GCC 4.8-2014.04 r42001) ) #1 Fri Aug 8 04:01:07 CEST 2014
[    0.000000] SoC Type: Ralink RT3352 id:1 rev:6
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU revision is: 0001964c (MIPS 24KEc)
[    0.000000] MIPS: machine is ZyXEL NBG-419N
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 04000000 @ 00000000 (usable)
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x00000000-0x03ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x00000000-0x03ffffff]
[    0.000000] Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes.
[    0.000000] Primary data cache 16kB, 4-way, VIPT, no aliases, linesize 32 bytes
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 16256
[    0.000000] Kernel command line: console=ttyS0,57600 rootfstype=squashfs,jffs2
[    0.000000] PID hash table entries: 256 (order: -2, 1024 bytes)
[    0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Writing ErrCtl register=00000000
[    0.000000] Readback ErrCtl register=00000000
[    0.000000] Memory: 61648k/65536k available (2284k kernel code, 3888k reserved, 575k data, 212k init, 0k highmem)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS:256
[    0.000000] CPU Clock: 384MHz
[    0.000000] Calibrating delay loop... 255.59 BogoMIPS (lpj=1277952)
[    0.070000] pid_max: default: 32768 minimum: 301
[    0.080000] Mount-cache hash table entries: 512
[    0.090000] pinctrl core: initialized pinctrl subsystem
[    0.100000] NET: Registered protocol family 16
[    0.120000] pinmux core: rt2880-pinmux does not support function sdram
[    0.130000] rt2880-pinmux pinctrl.1: invalid function sdram in map table
[    0.160000] bio: create slab <bio-0> at 0
[    0.170000] rt2880_gpio 10000600.gpio: registering 24 gpios
[    0.180000] rt2880_gpio 10000600.gpio: registering 24 irq handlers
[    0.190000] Switching to clocksource MIPS
[    0.200000] NET: Registered protocol family 2
[    0.210000] TCP established hash table entries: 512 (order: 0, 4096 bytes)
[    0.230000] TCP bind hash table entries: 512 (order: -1, 2048 bytes)
[    0.240000] TCP: Hash tables configured (established 512 bind 512)
[    0.250000] TCP: reno registered
[    0.260000] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.270000] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.280000] NET: Registered protocol family 1
[    0.290000] rt-timer 10000100.timer: maximum frequncy is 7812Hz
[    0.340000] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.350000] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.380000] msgmni has been set to 120
[    0.380000] io scheduler noop registered
[    0.390000] io scheduler deadline registered (default)
[    0.400000] Serial: 8250/16550 driver, 16 ports, IRQ sharing enabled
[    0.430000] 10000c00.uartlite: ttyS0 at MMIO 0x10000c00 (irq = 20) is a 16550A
[    0.450000] console [ttyS0] enabled, bootconsole disabled
[    0.450000] console [ttyS0] enabled, bootconsole disabled
[    0.470000] of-flash 1f000000.cfi: do_map_probe() failed
[    0.490000] eth0: done loading
[    0.500000] rt2880_wdt 10000120.watchdog: Initialized
[    0.520000] TCP: cubic registered
[    0.520000] NET: Registered protocol family 17
[    0.530000] Bridge firewalling registered
[    0.540000] 8021q: 802.1Q VLAN Support v1.8
[    0.550000] VFS: Cannot open root device "(null)" or unknown-block(0,0): error -6
[    0.570000] Please append a correct "root=" boot option; here are the available partitions:
[    0.580000] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[    2.520000] rt305x-esw 10110000.esw: link changed 0x01

I flashed AA once, but restored to stock FW due to crash.

The boot logs are produced by loading the image to SDRAM by tftp and executing it, by choosing '1' from ZyXEL's u-boot menu.

Could there be something to do in order to run AA or BB on the device?

The CPU architecture seems to be correct:

# cat /proc/cpuinfo
system type             : Ralink SoC
processor               : 0
cpu model               : MIPS 24K V4.12
BogoMIPS                : 255.48
wait instruction        : yes
microsecond timers      : yes
tlb_entries             : 32
extra interrupt vector  : yes
hardware watchpoint     : yes
ASEs implemented        : mips16 dsp
VCED exceptions         : not available
VCEI exceptions         : not available

Stock FW boot log:

U-Boot 1.1.3 (Mar  6 2012 - 17:34:10)

Board: Ralink APSoC DRAM:  64 MB
relocate_code Pointer at: 83fb0000
spi_wait_nsec: 3c
spi device id: c2 20 17 c2 20 (2017c220)
find flash: MX25L6405D
raspi_read: from:30000 len:1000
.raspi_read: from:30000 len:1000
.============================================
Ralink UBoot Version: 3.6.0.1_a3
--------------------------------------------
ASIC 3352_MP (Port5<->None)
DRAM_CONF_FROM: Boot-Strapping
DRAM_TYPE: DDR2
DRAM_SIZE: 512 Mbits
DRAM_WIDTH: 16 bits
DRAM_TOTAL_WIDTH: 16 bits
TOTAL_MEMORY_SIZE: 64 MBytes
Flash component: SPI Flash
Date:Mar  6 2012  Time:17:34:10
============================================
icache: sets:256, ways:4, linesz:32 ,total:32768
dcache: sets:128, ways:4, linesz:32 ,total:16384

 ##### The CPU freq = 384 MHZ ####
 estimate memory size =64 Mbytes
 uboot: NBG-419N v2 Power LED...on

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: Entr boot command line interface.
   6: To emergency.
   7: Load Boot Loader code then write to Flash via Serial.
   9: Load Boot Loader code then write to Flash via TFTP.
   a: Auto load system code then write to Flash via TFTP.
 0

3: System Boot system code via Flash.
## Booting image at bc050000 ...
raspi_read: from:50000 len:40
.   Image Name:   Linux Kernel Image
   Created:      2013-08-26   9:35:00 UTC
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    4007317 Bytes =  3.8 MB
   Load Address: 80000000
   Entry Point:  802aa000
raspi_read: from:50040 len:3d2595
..............................................................   Verifying Checksum ... OK
   Uncompressing Kernel Image ...
No initrd
## Transferring control to Linux (at address 802aa000) ...
## Giving linux memsize in MB, 64

Starting kernel ...


LINUX started...

 THIS IS ASIC

 The CPU frequency set to 384 MHz
CPU revision is: 0001964c
Determined physical RAM map:
 memory: 04000000 @ 00000000 (usable)
Built 1 zonelists.  Total pages: 16256
Primary instruction cache 32kB, physically tagged, 4-way, linesize 32 bytes.
Primary data cache 16kB, 4-way, linesize 32 bytes.
cause = c0808044, status = 11000000
PID hash table entries: 256 (order: 8, 1024 bytes)
calculating r4koff... 00177000(1536000)
CPU frequency 384.00 MHz
Using 192.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)
Mount-cache hash table entries: 512
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 2048 (order: 2, 16384 bytes)
TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
detected lzma initramfs
MX25L6405D(c2 2017c220) (8192 Kbytes)
mtd .name = raspi, .size = 0x00800000 (8M) .erasesize = 0x00010000 (64K) .numeraseregions = 0
mtd: partition "Kernel" extends beyond the end of device "raspi" -- size truncated to 0x7b0000
RT3xxx EHCI/OHCI init.
squashfs: LZMA suppport for slax.org by jro
fuse init (API version 7.8)
Ralink gpio driver initialized
RAMDISK driver initialized: 16 RAM disks of 16384K size 1024 blocksize
rdm_major = 253
Ralink APSoC Ethernet Driver Initilization. v2.1  256 rx/tx descriptors allocated, mtu = 1500!
MAC_ADRH -- : 0x0000107b
MAC_ADRL -- : 0xefc91f15
 kernel: NBG-419N v2 Power LED...on
RL this is patch v3
nf_conntrack version 0.5.0 (512 buckets, 4096 max 400 reserved)
ip_tables: (C) 2000-2006 Netfilter Core Team, Type=Restricted Cone


  2008/11/24 Kernel xt_register_target =======>

arp_tables: (C) 2002 David S. Miller
init started: BusyBox v1.12.1 (2013-08-26 17:16Algorithmics/MIPS FPU Emulator v1.5
:06 CST)
starting pid 628, tty '': '/etc_ro/rcS'
Welcome to
     _______  _______  ___     __  ____   _  _   ___
    |  ___  \|   __  ||   |   |__||    \ | || | /  /
    | |___| ||  |__| ||   |__  __ |     \| || |/  /
    |   _   /|   _   ||      ||  || |\     ||     \
    |__| \__\|__| |__||______||__||_| \____||_|\___\

                     =System Architecture Department=

ftpalg: Waiting for message from kernel

@@@ BssidNum @@@

@@@ BssidNum @@@
nvram flash is ok
NetUSB: module license 'Proprietary' taints kernel.
Symbol usb_register_driver is being used by a non-GPL module, which will not be allowed in the future
Please see the file Documentation/feature-removal-schedule.txt in the kernel source tree for more details.
Symbol usb_deregister is being used by a non-GPL module, which will not be allowed in the future
Please see the file Documentation/feature-removal-schedule.txt in the kernel source tree for more details.
kc   88 : run_telnetDBGDServer start
kc  225 : init_DebugD end
INFO1612: NetUSB 1.156 u10, 00020615 : Feb  7 2012 18:26:20
INFO1614: AUTH  ISOC
INFO1615:
INFO0076:  init proc : PAGE_SIZE 4096
INFO1586:  sleep to wait br0 to wake up
INFO02C7:  use dev Name br0 : fail
starting pid 693, tty '/dev/ttyS1': '/bin/sh'


BusyBox v1.12.1 (2013-08-26 17:16:06 CST) built-in shell (ash)
Enter 'help' for a list of built-in commands.

# Password for 'admin' changed
INFO02C7:  use dev Name br0 : fail
rmmod: ralink_wdt: No such file or directory
rmmod: cls: No such file or directory
rmmod: hw_nat: No such file or directory
rmmod: raeth: No such file or directory
insmod: bridge.ko: module not found
insmod: mii.ko: module not found
insmod: raeth.ko: module not found

phy_tx_ring = 0x03891000, tx_ring = 0xa3891000

phy_rx_ring0 = 0x03892000, rx_ring0 = 0xa3892000
MAC_ADRH -- : 0x0000107b
MAC_ADRL -- : 0xefc91f15
RT305x_ESW: Link Status Changed
CDMA_CSG_CFG = 81000007
GDMA1_FWD_CFG = C0710000
INFO02C7:  use dev Name br0 : fail

##### disable 1st wireless interface #####
rmmod: rt2860v2_ap_net: No such file or directory
rmmod: rt2860v2_ap: No such file or directory
rmmod: rt2860v2_ap_util: No such file or directory
rmmod: rt2860v2_sta_net: No such file or directory
rmmod: rt2860v2_sta: No such file or directory
rmmod: rt2860v2_sta_util: No such file or directory
insmod: rt2860v2_ap_util.ko: module not found


=== pAd = c0096000, size = 804440 ===

<-- RTMPAllocAdapterBlock, Status=0
insmod: rt2860v2_ap_net.ko: module not found
rmmod: nf_nat_pptp: No such file or directory
rmmod: nf_conntrack_pptp: No such file or directory
rmmod: nf_nat_proto_gre: No such file or directory
rmmod: nf_conntrack_proto_gre: No such file or directory
RX DESC a3213000  size = 2048
<-- RTMPAllocTxRxRingMemory, Status=0
Key1Str is Invalid key length(0) or Type(0)
Key2Str is Invalid key length(0) or Type(0)
Key3Str is Invalid key length(0) or Type(0)
Key4Str is Invalid key length(0) or Type(0)
1. Phy Mode = 9
2. Phy Mode = 9
3. Phy Mode = 9
RTMPSetPhyMode: channel is out of range, use first channel=0
MCS Set = ff ff 00 00 01
SYNC - BBP R4 to 20MHz.l
INFO02C7:  use dev Name br0 : fail
INFO02C7:  use dev Name br0 : fail
INFO02C7:  use dev Name br0 : fail
SYNC - BBP R4 to 20MHz.l
SYNC - BBP R4 to 20MHz.l
INFO02C7:  use dev Name br0 : fail
SYNC - BBP R4 to 20MHz.l
SYNC - BBP R4 to 20MHz.l
SYNC - BBP R4 to 20MHz.l
INFO02C7:  use dev Name br0 : fail
SYNC - BBP R4 to 20MHz.l
SYNC - BBP R4 to 20MHz.l
SYNC - BBP R4 to 20MHz.l
INFO02C7:  use dev Name br0 : fail
Main bssid = 10:7b:ef:c9:1f:14
<==== rt28xx_init, Status=0
0x1300 = 00064380
vconfig: ioctl error for rem: Invalid argument
vconfig: ioctl error for rem: Invalid argument
rmmod: 8021q: No such file or directory
insmod: 8021q.ko: module not found
vconfig: ioctl error for rem: Invalid argument
eth2.2: Setting MAC address to  10 7b ef c9 1f 15.
VLAN (eth2.2):  Underlying device (eth2) has same MAC, not checking promiscious mode.
ifconfig: ioctl 0x8913 failed: No such device
brctl: bridge br0: No such device or address
##### config RT3052 vlan partition (LLLLW) #####
switch reg write offset=14, value=405555
switch reg write offset=50, value=2001
switch reg write offset=98, value=7f3f
switch reg write offset=e4, value=3f
switch reg write offset=40, value=1001
switch reg write offset=44, value=1001
switch reg write offset=48, value=1002
switch reg write offset=70, value=ffff506f
done.
INFO02C7:  use dev Name br0 : fail
eth2.1: Setting MAC address to  10 7b ef c9 1f 14.
VLAN (eth2.1):  Setting underlying device (eth2) to promiscious mode.
==================Start Kill TimeTool Daemon!!!!!==================
CloneMAC mode is ...
Enter timetool
INFO02D0:  use dev Name br0
INFO158F:  sleep to wait br0 end.
INFO15A8:  UDP_BROAD 7417 tcpPort:20005
INFO02D0:  use dev Name br0
INFO14DF: tcpConnector() started...
ifconfig: ioctl 0x8914 failed: Cannot assign requested address
ifconfig: ioctl 0x8914 failed: Cannot assign requested address
cat: can't open '/etc/resolv.conf': No such file or directory
dhcp_DnsMode is 12...
INFO13BF: Bind to br0
killall: udhcpd: no process killed
Set: phy[0].reg[RT305x_ESW: Link Status Changed
0] = 3900
Set: phy[1].reg[0] = 3900
Set: phy[2].reg[0] = 3900
Set: phy[3].reg[0] = 3900
Set: phy[0].reg[0] = 3100
Set: phy[1].reg[0] = 3100
Set: phy[2].reg[0] = 3100
Set: phy[3].reg[0] = 3100

***** g_wl_interface = ra0 ******

ifconfig: ioctl 0x8913 failed: No such device
libupnp: using UDP SSDP_PORT = 1900
RT305x_ESW: Link Status Changed
iwpriv ra0 set IgmpSnEnable=1
Start  initInterRL debug: AQ_LAN_IP=c0a80101
net!!!!!   systeRL debug: AQ_SHIFT_COUNT=8
m[internet.sh] =RL debug: AQ_HTTP_PORT=50

v2 have some hardware diffs:
- rt3052->rt3352 (autodetected);
- parallel flash -> serial flash (so fail to mount rootfs);
- dwc_otg -> ehci/ohci.
Just for test you can try BB image for dlink dir-620 d1.

Hello,

and thank you so much for your quick reply.

I'm sorry, but it didn't work.

BB image for dlink dir-620 d1 booted, but didn't do more than produced a bunch of filesystem error messages, before crash:

[   22.990000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00590000: 0xc376 instead
[   23.010000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00590004: 0x369c instead
[   23.030000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00590008: 0xde58 instead
[   23.050000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0059000c: 0xd8e5 instead
[   23.070000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00590010: 0xb61d instead
[   23.090000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00590014: 0x6b49 instead
[   23.110000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00590018: 0x6d7c instead
[   23.120000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0059001c: 0x6f0c instead
[   23.140000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00590020: 0x0917 instead
[   23.160000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00590024: 0xbd37 instead
[   23.180000] jffs2: Further such events for this erase block will not be printed
[   23.300000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x005f0000: 0x2a74 instead
[   23.320000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x005f0004: 0x47e3 instead
[   23.340000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x005f0008: 0x8cf3 instead
[   23.360000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x005f000c: 0x32af instead
[   23.380000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x005f0010: 0xf0d3 instead
[   23.400000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x005f0014: 0xb750 instead
[   23.420000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x005f0018: 0x8370 instead
[   23.440000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x005f001c: 0x814d instead
[   23.450000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x005f0020: 0x4f6e instead
[   23.470000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x005f0024: 0xf76d instead
[   23.490000] jffs2: Further such events for this erase block will not be printed
[   23.620000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00600000: 0xf77e instead
[   23.630000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00600004: 0xd902 instead
[   23.650000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00600008: 0xd68f instead
[   23.670000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0060000c: 0x3fc6 instead
[   23.690000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00600010: 0xee99 instead
[   23.710000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00600014: 0x8ad6 instead
[   23.730000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00600018: 0xb6ed instead
[   23.750000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0060001c: 0xf64c instead
[   23.770000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00600020: 0xfd40 instead
[   23.790000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00600024: 0x24d5 instead
[   23.800000] jffs2: Further such events for this erase block will not be printed
[   23.930000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00610000: 0x18c2 instead
[   23.950000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00610004: 0x401b instead
[   23.960000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00610008: 0x3589 instead
[   23.980000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0061000c: 0x7a56 instead
[   24.000000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00610010: 0x717d instead
[   24.020000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00610014: 0xea78 instead
[   24.040000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00610018: 0x1273 instead
[   24.060000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0061001c: 0x1401 instead
[   24.080000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00610020: 0x249b instead
[   24.100000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00610024: 0x8525 instead
[   24.120000] jffs2: Further such events for this erase block will not be printed
[   24.240000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x006c0000: 0xb197 instead
[   24.260000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x006c0004: 0xe273 instead
[   24.280000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x006c0008: 0xdf3c instead
[   24.300000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x006c000c: 0xb01c instead
[   24.320000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x006c0010: 0xea13 instead
[   24.340000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x006c0014: 0xd3e8 instead
[   24.350000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x006c0018: 0x067f instead
[   24.370000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x006c001c: 0x54f2 instead
[   24.390000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x006c0020: 0xbe5a instead
[   24.410000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x006c0024: 0x6ca3 instead
[   24.430000] jffs2: Further such events for this erase block will not be printed
[   24.550000] jffs2: Cowardly refusing to erase blocks on filesystem with no valid JFFS2 nodes
[   24.570000] jffs2: empty_blocks 33, bad_blocks 0, c->nr_blocks 109
[   24.580000] VFS: Cannot open root device "(null)" or unknown-block(31,4): error -5
[   24.590000] Please append a correct "root=" boot option; here are the available partitions:
[   24.610000] 1f00             192 mtdblock0  (driver?)
[   24.620000] 1f01              64 mtdblock1  (driver?)
[   24.630000] 1f02              64 mtdblock2  (driver?)
[   24.640000] 1f03            7872 mtdblock3  (driver?)
[   24.650000] 1f04            7011 mtdblock4  (driver?)
[   24.660000] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(31,4)

However, by performing some additional searching, I found out that you are the man who already solved the problem some time ago.

According to the thread https://forum.openwrt.org/viewtopic.php?id=40634 a custom build for NBG-419N v2 was made, nbg-419nv2-sysupgrade.bin (and can still be downloaded)

I can confirm that the custom build can be flashed on the device, and it boots up nicely.

BusyBox v1.19.4 (2012-10-05 23:41:12 NOVST) built-in shell (ash)
Enter 'help' for a list of built-in commands.

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 ATTITUDE ADJUSTMENT (Bleeding Edge, r33624)
 -----------------------------------------------------
  * 1/4 oz Vodka      Pour all ingredients into mixing
  * 1/4 oz Gin        tin with ice, strain into glass.
  * 1/4 oz Amaretto
  * 1/4 oz Triple sec
  * 1/4 oz Peach schnapps
  * 1/4 oz Sour mix
  * 1 splash Cranberry juice
 -----------------------------------------------------
root@OpenWrt:/# 

But, regarding the thread, some patches were needed from ZyXEL in order to produce the working image?

However, I understood that NAND would be supported on BB by default?

Can you Serge recall how this custom build for v2 was made?

Also, with some googling, I found some posts regarding v2 patching, but I guess these are not valid anymore, as I got the impression that the OpenWRT build system has changed quite a lot.

http://pastebin.com/raw.php?i=Su918N9r

In addition, I also found something related to custom mtd layout: (at the very end, but not for v2 though)

http://ranosgrant.cocolog-nifty.com/ope … k-wnh.diff

I really don't know whether or not these are still valid, or how to implement these in order to produce a specific build for v2, but could someone please have a look once more, as Serge already succseeded producing a fully working image?

jama wrote:

But, regarding the thread, some patches were needed from ZyXEL in order to produce the working image?

Only for building factory image which may be flashed form original Zyxel firware.

Can you Serge recall how this custom build for v2 was made?

That patch was simple and incomplete (flash layout, factory image, wifi eeprom, leds and buttons) because of tester inactivity.

Also, with some googling, I found some posts regarding v2 patching, but I guess these are not valid anymore, as I got the impression that the OpenWRT build system has changed quite a lot.

Yes. Starting from BB no need to recompile kernel to add new device.

New test images
https://yadi.sk/d/1ZV0lKJwbTE65
Some comments:
1. AA image use custom kernel, so AA-release repo compatibility is lost (kernel modules may crash). But quick and stable smile.
2. BB image is fully compatible with BB rc3 repo.
I put dts-file. You may correct it and make new version of images for test.

Hello,

And thank you so much for your quick reply.

The AA build acts exactly as you said, i.e. kernel modules indeed do crash:

Please press Enter to activate this console. [    9.060000] Compat-drivers backport release: compat-drivers-2012-09-04-2-gddac993
[    9.070000] Backport based on wireless-testing.git master-2012-09-07
[    9.090000] compat.git: wireless-testing.git
[    9.130000] cfg80211: Calling CRDA to update world regulatory domain
[    9.140000] cfg80211: World regulatory domain updated:
[    9.150000] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
[    9.170000] cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[    9.180000] cfg80211:   (2457000 KHz - 2482000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
[    9.200000] cfg80211:   (2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
[    9.210000] cfg80211:   (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[    9.230000] cfg80211:   (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[    9.860000] usbcore: registered new interface driver usbfs
[    9.870000] usbcore: registered new interface driver hub
[    9.880000] usbcore: registered new device driver usb
[   10.630000] PPP generic driver version 2.4.2
[   10.640000] CPU 0 Unable to handle kernel paging request at virtual address 00000000, epc == 83087020, ra == 80160098
[   10.660000] Oops[#1]:
[   10.660000] Cpu 0
[   10.660000] $ 0   : 00000000 00000000 00000002 00000000
[   10.660000] $ 4   : 00000001 00000000 00000000 0000484b
[   10.660000] $ 8   : 00000000 80106470 00000000 00000000
[   10.660000] $12   : 00000019 801a0019 00000001 65762072
[   10.660000] $16   : 00000000 8383b28c 83084850 8306f000
[   10.660000] $20   : 0000000c 80292730 80230000 801ec054
[   10.660000] $24   : 00000000 80127c9c                  
[   10.660000] $28   : 830fe000 830ffd98 801ec074 80160098
[   10.660000] Hi    : 00000002
[   10.660000] Lo    : 00000000
[   10.660000] epc   : 83087020 0x83087020
[   10.660000]     Tainted: G           O
[   10.660000] ra    : 80160098 0x80160098
[   10.660000] Status: 1100a403    KERNEL EXL IE 
[   10.660000] Cause : 00800008
[   10.660000] BadVA : 00000000
[   10.660000] PrId  : 0001964c (MIPS 24KEc)
[   10.660000] Modules linked in: ppp_generic(+) slhc rt2800pci(O) rt2800lib(O) rt2x00soc(O) rt2x00pci(O) rt2x00lib(O) mac80211(O) usbcore usb_common nls_base crc_itu_t crc_ccitt eeprom_93cx6 cfg80211(O) compat(O) arc4 aes_generic crypto_algapi leds_gpio button_hotplug(O) gpio_keys_polled input_polldev input_core
[   10.660000] Process insmod (pid: 418, threadinfo=830fe000, task=839071e0, tls=77fb2440)
[   10.660000] Stack : 8391d7b8 00000000 00000000 83084850 00000000 80160098 83b47e40 83b43a00
[   10.660000]         00000000 80230000 83084850 00000000 83084850 80292a70 fffffff5 80230000
[   10.660000]         80260000 80160164 83080000 83087090 80260000 00000000 80230000 80230000
[   10.660000]         83087090 83084850 00000000 801601e0 83010010 00000004 83010000 830848d0
[   10.660000]         83080000 83087090 80260000 830870bc 830848d0 00000001 83084888 ffffffff
[   10.660000]         ...
[   10.660000] Call Trace:[<80160098>] 0x80160098
[   10.660000] [<80160164>] 0x80160164
[   10.660000] [<83080000>] 0x83080000
[   10.660000] [<83087090>] 0x83087090
[   10.660000] [<83087090>] 0x83087090
[   10.660000] [<801601e0>] 0x801601e0
[   10.660000] [<83080000>] 0x83080000
[   10.660000] [<83087090>] 0x83087090
[   10.660000] [<830870bc>] 0x830870bc
[   10.660000] [<83087090>] 0x83087090
[   10.660000] [<80000900>] 0x80000900
[   10.660000] [<8006bc60>] 0x8006bc60
[   10.660000] [<8002e4f4>] 0x8002e4f4
[   10.660000] [<80041df0>] 0x80041df0
[   10.660000] [<800662bc>] 0x800662bc
[   10.660000] [<80008a84>] 0x80008a84
[   10.660000] 
[   10.660000] 
[   10.660000] Code: 8c830214  10400003  24040001 <8c640000> 0082202b  00048036  24420001  00021080  00621821 
[   11.120000] ---[ end trace 6d1d71c0f4fc471d ]---
[   41.140000] ppp_async: gave up waiting for init of module ppp_generic.
[   41.150000] ppp_async: Unknown symbol ppp_channel_index (err -16)

The BB build does not work at all; the results are pretty much the same as with dir-620 d1 image:

[    6.420000] jffs2: Further such events for this erase block will not be printed
[    6.540000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00130000: 0x2873 instead
[    6.560000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00130004: 0xc6c2 instead
[    6.580000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00130008: 0xb2a4 instead
[    6.600000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0013000c: 0xe44a instead
[    6.620000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00130010: 0xaa2c instead
[    6.640000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00130014: 0x0818 instead
[    6.660000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00130018: 0xda90 instead
[    6.680000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0013001c: 0x8a53 instead
[    6.700000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00130020: 0x60b0 instead
[    6.720000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00130024: 0x2953 instead
[    6.730000] jffs2: Further such events for this erase block will not be printed
[    6.860000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00140000: 0x9e18 instead
[    6.880000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00140004: 0xaf0b instead
[    6.890000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00140008: 0x6f74 instead
[    6.910000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0014000c: 0x10f8 instead
[    6.930000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00140010: 0xdca7 instead
[    6.950000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00140014: 0x2772 instead
[    6.970000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00140018: 0xb6f8 instead
[    6.990000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0014001c: 0xcaa1 instead
[    7.010000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00140020: 0x1c73 instead
[    7.030000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00140024: 0xf576 instead
[    7.050000] jffs2: Further such events for this erase block will not be printed
[    7.170000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00150000: 0xd66d instead
[    7.190000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00150004: 0xd3fc instead
[    7.210000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00150008: 0x4af0 instead
[    7.230000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0015000c: 0xd70e instead
[    7.240000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00150010: 0x2884 instead
[    7.260000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00150014: 0x5e06 instead
[    7.280000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00150018: 0x3553 instead
[    7.300000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0015001c: 0xa598 instead
[    7.320000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00150020: 0xbfe6 instead
[    7.340000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00150024: 0x1d2e instead
[    7.360000] jffs2: Further such events for this erase block will not be printed
[    7.480000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00160000: 0x2524 instead
[    7.500000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00160004: 0x93dd instead
[    7.520000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00160008: 0x3ad4 instead
[    7.540000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0016000c: 0x0b6b instead
[    7.560000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00160010: 0x097b instead
[    7.580000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00160014: 0xdd9e instead
[    7.590000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00160018: 0xc8ec instead
[    7.610000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0016001c: 0x603f instead
[    7.630000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00160020: 0xd7b3 instead
[    7.650000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00160024: 0xc07f instead
[    7.670000] jffs2: Further such events for this erase block will not be printed
[    7.790000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00170000: 0x43a6 instead
[    7.810000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00170004: 0x0920 instead
[    7.830000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00170008: 0xbcca instead
[    7.850000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0017000c: 0x334c instead
[    7.870000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00170010: 0x021e instead
[    7.890000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00170014: 0xbe00 instead
[    7.910000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00170018: 0x59b1 instead
[    7.920000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0017001c: 0xa52c instead
[    7.940000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00170020: 0x8298 instead
[    7.960000] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00170024: 0xd8f5 instead
[    7.980000] jffs2: Further such events for this erase block will not be printed
[    8.020000] jffs2: Empty flash at 0x00172b38 ends at 0x00173570
[    8.150000] jffs2: Cowardly refusing to erase blocks on filesystem with no valid JFFS2 nodes
[    8.170000] jffs2: empty_blocks 86, bad_blocks 0, c->nr_blocks 110
[    8.180000] VFS: Cannot open root device "(null)" or unknown-block(31,4): error -5
[    8.200000] Please append a correct "root=" boot option; here are the available partitions:
[    8.220000] 1f00             192 mtdblock0  (driver?)
[    8.230000] 1f01              64 mtdblock1  (driver?)
[    8.240000] 1f02              64 mtdblock2  (driver?)
[    8.250000] 1f03            7872 mtdblock3  (driver?)
[    8.260000] 1f04            7053 mtdblock4  (driver?)
[    8.270000] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(31,4)

I'm not quite much a programmer, but I'll have a look about the .dts -file. I guess the least what I can do is to modify the mtd -layout, as in /proc/mtd. Might as well need to change something else to have the image itself produced?

I think that something wrong in your firmware installation procedure:
1. AA custom don't use rt2800pci module but in your log it presents in crash dump (my build use compat-drivers-2014-05-22 for wifi).
2. BB cann't find start of flash free space.
It looks like  old rootfs is used (from previous firmware installation).
How do you install firmware exactly? Serial console or emergency recovery?

Hello,

Yes, you're correct.

Instead of flasing the image directly to the device, I tested it first by loading it to SDRAM, by choosing '1' from the u-boot menu.

Apparently, this was not the correct approach.

By choosing '2', and confirming the action by responding 'y' to flash the image, I can confirm that both of the images do work.

And yes, I do have a serial console; I performed all the tasks over the serial console.

Could these patches/settings you made be included in BB, in order to have images for v2 in the future?

Thank you so much for your time, help and assistance. You're very kind.

Before send patch to developers I'd like  you to do some additional check:
1. leds and buttons (I take it from v1) works in v2 correctly.
2. Does v2 have usb-port populated? In my dts-file it's enabled by default.
3. Wifi work as expected.
And now you can test BB rc3 without restriction, AA with possible crash of AA repo kernel modules.

1. leds and buttons (I take it from v1) works in v2 correctly.

Leds do work as expected;

LAN & WAN leds go on and off when connecting/disconnecting a cable, and blink during traffic.
Wifi led goes on & off when enabling/disabling Wifi via LuCI.
Power led blinks during boot & FW flash. Stays on after boot is completed.

Some of the buttons do not work as expected;

The LED button works, but it's only function is to turn off all the leds.

WLAN button does not work at all. It's function is to switch Wifi on and off, but nothing happens.
Wifi can be enabled/disabled via LuCI regardless of the button position.

WPS button may not work. (And I have no means to test it, and I guess it's never implemented to OpenWRT?)

2. Does v2 have usb-port populated? In my dts-file it's enabled by default.

It does. By inserting a usb stick to the port, a message is displayed to console, as well as logged to syslog:

[  391.720000] usb 1-2: new full-speed USB device number 2 using ohci-platform

root@OpenWrt:/# dmesg | tail
[   25.810000] cfg80211:   (57240000 KHz - 65880000 KHz @ 2160000 KHz), (N/A, 4000 mBm), (N/A)
[   26.110000] br-lan: port 1(eth0.1) entered forwarding state
[   33.550000] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[   33.570000] device wlan0 entered promiscuous mode
[   33.610000] br-lan: port 2(wlan0) entered forwarding state
[   33.620000] br-lan: port 2(wlan0) entered forwarding state
[   33.630000] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[   35.620000] br-lan: port 2(wlan0) entered forwarding state
[  391.720000] usb 1-2: new full-speed USB device number 2 using ohci-platform
[  391.960000] usb 1-2: no of_node; not parsing pinctrl DT

And that's all what happens.

3. Wifi work as expected.

Wifi works as expected;

Wifi can be configured via LuCI, and a wireless device can receive an IP -address.
The status of the connected wireless devices can be seen on LuCI.

And now you can test BB rc3 without restriction, AA with possible crash of AA repo kernel modules.

Thanks, but I guess I'll stick with BB.

Kindly let me know if any additional information is needed. I'll do my best to help, and I'll reply as fast as I can.

Update:

I booted the device, and during the boot it asks you to specify debug level. I chose '4'.

After boot, by pressing the WPS -button, the following information is displayed:

procd: hotplug_handler_debug(403): {{"HOME":"\/","PATH":"\/sbin:\/bin:\/usr\/sbin:\/usr\/bin","SUBSYSTEM":"button","ACTION":"pressed","BUTTON":"wps","SEEN":"42949577","SEQNUM":"387"}}
procd: rule_handle_command(354): Command: execprocd: rule_handle_command(356):  /etc/rc.button/wpsprocd: rule_handle_command(357): 
procd: rule_handle_command(359): Message:procd: rule_handle_command(361):  HOME=/procd: rule_handle_command(361):  PATH=/sbin:/bin:/usr/sbin:/usr/binprocd: rule_handle_command(361):  SUBSYSTEM=buttonprocd: rule_handle_command(361):  ACTION=pressedprocd: rule_handle_command(361):  BUTTON=wpsprocd: rule_handle_command(361):  SEEN=42949577procd: rule_handle_command(361):  SEQNUM=387procd: rule_handle_command(362): 
procd: queue_next(280): Launched hotplug exec instance, pid=995
procd: rule_handle_command(354): Command: execprocd: rule_handle_command(356):  /sbin/hotplug-callprocd: rule_handle_command(356):  buttonprocd: rule_handle_command(357): 
procd: rule_handle_command(359): Message:procd: rule_handle_command(361):  HOME=/procd: rule_handle_command(361):  PATH=/sbin:/bin:/usr/sbin:/usr/binprocd: rule_handle_command(361):  SUBSYSTEM=buttonprocd: rule_handle_command(361):  ACTION=pressedprocd: rule_handle_command(361):  BUTTON=wpsprocd: rule_handle_command(361):  SEEN=42949577procd: rule_handle_command(361):  SEQNUM=387procd: rule_handle_command(362): 
procd: queue_proc_cb(285): Finished hotplug exec instance, pid=995
procd: queue_next(280): Launched hotplug exec instance, pid=996
procd: queue_proc_cb(285): Finished hotplug exec instance, pid=996
procd: hotplug_handler_debug(403): {{"HOME":"\/","PATH":"\/sbin:\/bin:\/usr\/sbin:\/usr\/bin","SUBSYSTEM":"button","ACTION":"released","BUTTON":"wps","SEEN":"0","SEQNUM":"388"}}
procd: rule_handle_command(354): Command: execprocd: rule_handle_command(356):  /etc/rc.button/wpsprocd: rule_handle_command(357): 
procd: rule_handle_command(359): Message:procd: rule_handle_command(361):  HOME=/procd: rule_handle_command(361):  PATH=/sbin:/bin:/usr/sbin:/usr/binprocd: rule_handle_command(361):  SUBSYSTEM=buttonprocd: rule_handle_command(361):  ACTION=releasedprocd: rule_handle_command(361):  BUTTON=wpsprocd: rule_handle_command(361):  SEEN=0procd: rule_handle_command(361):  SEQNUM=388procd: rule_handle_command(362): 
procd: queue_next(280): Launched hotplug exec instance, pid=997
procd: rule_handle_command(354): Command: execprocd: rule_handle_command(356):  /sbin/hotplug-callprocd: rule_handle_command(356):  buttonprocd: rule_handle_command(357): 
procd: rule_handle_command(359): Message:procd: rule_handle_command(361):  HOME=/procd: rule_handle_command(361):  PATH=/sbin:/bin:/usr/sbin:/usr/binprocd: rule_handle_command(361):  SUBSYSTEM=buttonprocd: rule_handle_command(361):  ACTION=releasedprocd: rule_handle_command(361):  BUTTON=wpsprocd: rule_handle_command(361):  SEEN=0procd: rule_handle_command(361):  SEQNUM=388procd: rule_handle_command(362): 
procd: queue_proc_cb(285): Finished hotplug exec instance, pid=997
procd: queue_next(280): Launched hotplug exec instance, pid=998
procd: queue_proc_cb(285): Finished hotplug exec instance, pid=998

Nothing is printed if you press WLAN or LED button.

I used BB all the time.

(Last edited by jama on 13 Sep 2014, 16:43)

Base image need additional kernel modules to mount stick. So opkg update && opkg install,
at least kmod-scsi, kmod-sd_mod, kmod-usb-storage, kmod-fs-vfat, kmod-nls-cp1251 ( for me:))

leds:
"power" - defined - works
"wps" - defined - ?
"wifi" - define - works
Any other leds? usb?

button:                                                                                                                                                                                 
"reset" - defined - ? - see /etc/rc.button - predefined action exists                                                                                                                   
"wps" - defined  - works                                                                                                                                                                 
"wlan" or "rfkill" - undefined - need to find - see /etc/rc.button - predefined action exists                                                                                           
"led" - undefined -  works smile - possibly hardware button?                                                                                                                               
Any other?                                                                                                                                                                               
                                                                                                                                                                                         
Current state of leds and buttons

cat /sys/kernel/debug/gpio

To check gpio if unreserved (e.g. gpio7)
for led:

echo 7 >/sys/class/gpio/export
echo out >/sys/class/gpio/gpio7/direction
echo 1 >>/sys/class/gpio/gpio7/value

for button:
"in" to direction and see high/low current state while pressed/released
Good luck!

Base image need additional kernel modules to mount stick. So opkg update && opkg install,
at least kmod-scsi, kmod-sd_mod, kmod-usb-storage, kmod-fs-vfat, kmod-nls-cp1251 ( for me:))

Thanks. I installed the packages, and it worked like a charm. The system deteced the usb stick as in any other linux, and I was able to mount it.


Regarding the leds: (from left to right, all leds in front panel)

power    - works
lan[1-4] - works
wan      - works
wifi     - works
wan      - works
wps      - does not work
usb      - does not work

Buttons:

root@OpenWrt:~# ls -al /etc/rc.button/
drwxr-xr-x    2 root     root            71 Aug 12 18:23 .
drwxr-xr-x    1 root     root             0 Sep 13 20:44 ..
-rwxr-xr-x    1 root     root            77 Aug  5 11:09 failsafe
-rwxr-xr-x    1 root     root            71 Aug  5 11:09 power
-rwxr-xr-x    1 root     root           281 Aug  5 11:09 reset
-rwxr-xr-x    1 root     root           522 Aug  5 11:09 rfkill

reset    - works; resets the device (and reboots)
wps    - the system is aware of the button, but nothing happens when pressed. (Debug dumps some info, however)
wlan    - is 'rfkill', as you already guessed. Nothing happens.
led    - I'd say is nothing more than a hardware button.

No any other buttons.

for button:
"in" to direction and see high/low current state while pressed/released
Good luck!

Current state of leds and buttons

root@OpenWrt:~# cat /sys/kernel/debug/gpio
GPIOs 0-23, platform/10000600.gpio, 10000600.gpio:
 gpio-0   (wps                 ) in  hi
 gpio-9   (nbg-419n:green:power) out lo
 gpio-10  (reset               ) in  hi
 gpio-14  (nbg-419n:green:wps  ) out hi

And, if I press wps

root@OpenWrt:~# cat /sys/kernel/debug/gpio
GPIOs 0-23, platform/10000600.gpio, 10000600.gpio:
 gpio-0   (wps                 ) in  lo
 gpio-9   (nbg-419n:green:power) out lo
 gpio-10  (reset               ) in  hi
 gpio-14  (nbg-419n:green:wps  ) out hi

To check gpio if unreserved (e.g. gpio7) for led:

I ran the following scipt: (while usb stick in)

root@OpenWrt:~# i=0; while [ $i -lt 24 ] ; do echo -n "$i : " ; echo $i >/sys/class/gpio/export ; i=`expr $i + 1` ; done ; echo
0 : ash: write error: Device or resource busy
1 : 2 : 3 : ash: write error: Invalid argument
4 : ash: write error: Invalid argument
5 : ash: write error: Invalid argument
6 : ash: write error: Invalid argument
7 : 8 : 9 : ash: write error: Device or resource busy
10 : ash: write error: Device or resource busy
11 : 12 : 13 : 14 : ash: write error: Device or resource busy
15 : ash: write error: Invalid argument
16 : ash: write error: Invalid argument
17 : 18 : 19 : 20 : 21 : 22 : 23 : 

syslog:

[   91.300000] rt2880-pinmux pinctrl.1: pin 3 is not set to gpio mux
[   91.310000] rt2880-pinmux pinctrl.1: request() failed for pin 3
[   91.330000] rt2880-pinmux pinctrl.1: pin-3 (pio:3) status -22
[   91.350000] rt2880-pinmux pinctrl.1: pin 4 is not set to gpio mux
[   91.360000] rt2880-pinmux pinctrl.1: request() failed for pin 4
[   91.370000] rt2880-pinmux pinctrl.1: pin-4 (pio:4) status -22
[   91.390000] rt2880-pinmux pinctrl.1: pin 5 is not set to gpio mux
[   91.410000] rt2880-pinmux pinctrl.1: request() failed for pin 5
[   91.420000] rt2880-pinmux pinctrl.1: pin-5 (pio:5) status -22
[   91.440000] rt2880-pinmux pinctrl.1: pin 6 is not set to gpio mux
[   91.450000] rt2880-pinmux pinctrl.1: request() failed for pin 6
[   91.470000] rt2880-pinmux pinctrl.1: pin-6 (pio:6) status -22
[   91.580000] rt2880-pinmux pinctrl.1: pin 15 is not set to gpio mux
[   91.590000] rt2880-pinmux pinctrl.1: request() failed for pin 15
[   91.600000] rt2880-pinmux pinctrl.1: pin-15 (pio:15) status -22
[   91.630000] rt2880-pinmux pinctrl.1: pin 16 is not set to gpio mux
[   91.640000] rt2880-pinmux pinctrl.1: request() failed for pin 16
[   91.650000] rt2880-pinmux pinctrl.1: pin-16 (pio:16) status -22

Then

i=0; while [ $i -lt 24 ] ; do echo -n "$i : " ; echo out >/sys/class/gpio/gpio$i/direction ; i=`expr $i + 1` ; done ; echo

And pop; the usb led is on.

Which after

i=0; while [ $i -lt 24 ] ; do echo -n "$i : " ; echo 1 >>/sys/class/gpio/gpio$i/value ; i=`expr $i + 1` ; done ; echo

Turns off the usb led.

No affect in any other leds - reagrdless of the state of the buttons.

Of which 13 is the usb led.


syslog also contains the following:

[    5.600000] usb usb1: no of_node; not parsing pinctrl DT
[    5.600000] hub 1-0:1.0: no of_node; not parsing pinctrl DT
[    5.600000] hub 1-0:1.0: USB hub found
[    5.610000] hub 1-0:1.0: 2 ports detected
[    5.620000] leds-gpio gpio-leds.4: pins are not configured from the driver

So current state
gpio: 0 - wps, 1, 2 , (3,4,5,6 - reserved SPI flash) 7,8, 9 - power, 10 - reset, 11, 12, 13 - usb led, 14 - wps led,
(15,16 - reserved serial console),17,18,19,20,21,22,23

unknown: 1,2,7,8,11,12,17,18,19,20,21,22,23
Switch all unknown into in-direction and see state while wlan-button pressed/released. I really want rfkill button smile

check wps/usb led:

echo 1 >/sys/class/leds/nbg-149n:green:wps/brightness
echo 1 >/sys/class/leds/nbg-149n:green:usb/brightness

Files updated:
NBG-419N2.dts - add usb led
openwrt-ramips-rt305x-nbg419v2-bb-rc3-squashfs-sysupgrade.v2.bin - only add usb led in kernel
openwrt-ramips-rt305x-nbg419v2-bb-rc3-squashfs-sysupgrade.v3.bin - make changed in rootfs for  wlan & usb leds

openwrt-ramips-rt305x-nbg419v2-bb-rc3-squashfs-sysupgrade.v2.bin - only add usb led in kernel

root@OpenWrt:/# echo 1 >/sys/class/leds/nbg-149n:green:wps/brightness
/bin/ash: can't create /sys/class/leds/nbg-149n:green:wps/brightness: nonexistent directory
root@OpenWrt:/# echo 1 >/sys/class/leds/nbg-149n:green:usb/brightness
/bin/ash: can't create /sys/class/leds/nbg-149n:green:usb/brightness: nonexistent directory

ls /sys/class/leds
nbg-419n:green:power     nbg-419n:green:wps       rt2800soc-phy0::quality
nbg-419n:green:usb       rt2800soc-phy0::assoc    rt2800soc-phy0::radio

root@OpenWrt:/# ls /sys/class/leds/nbg-419n:green:wps
brightness      max_brightness  trigger
device          subsystem       uevent

echo 1 >/sys/class/leds/nbg-419n:green:usb/brightness

Turns the usb led on. Inserting (and even mounting) a usb stick won't turn the led on.

echo 1 >/sys/class/leds/nbg-419n:green:wps/brightness

Turns the wps led on. Nothing happens if you press the wps button.

Enabling/disabling wifi via LuCI turns wlan led on/off (as well as the wifi itself....).

- - - - -

openwrt-ramips-rt305x-nbg419v2-bb-rc3-squashfs-sysupgrade.v3.bin - make changed in rootfs for  wlan & usb leds

root@OpenWrt:/# echo 1 >/sys/class/leds/nbg-149n:green:wps/brightness
bash: /sys/class/leds/nbg-149n:green:wps/brightness: No such file or directory
root@OpenWrt:/# echo 1 >/sys/class/leds/nbg-149n:green:usb/brightness
bash: /sys/class/leds/nbg-149n:green:usb/brightness: No such file or directory

root@OpenWrt:/# ls /sys/class/leds
nbg-419n:green:power     nbg-419n:green:wps       rt2800soc-phy0::quality
nbg-419n:green:usb       rt2800soc-phy0::assoc    rt2800soc-phy0::radio

root@OpenWrt:/# ls /sys/class/leds/nbg-419n:green:wps
brightness      max_brightness  trigger
device          subsystem       uevent

echo 1 >/sys/class/leds/nbg-419n:green:wps/brightness

Turns the wps led on. Nothing happens if you press the wps button.

echo 1 >/sys/class/leds/nbg-419n:green:usb/brightness

Turns the usb led on. Inserting (and even mounting) a usb stick won't turn the led on.

echo 1 > /sys/class/leds/rt2800soc-phy0::radio/brighteness

Turns the wlan led on.

- - - - -

openwrt-ramips-rt305x-nbg419v2-bb-rc3-squashfs-sysupgrade.v3.bin - make changed in rootfs for  wlan & usb leds

Switch all unknown into in-direction and see state while wlan-button pressed/released. I really want rfkill button

root@OpenWrt:~# for i in 1 2 7 8 11 12 17 18 19 20 21 22 23 ; do echo $i >/sys/class/gpio/export ; done
root@OpenWrt:~# for i in 1 2 7 8 11 12 17 18 19 20 21 22 23 ; do echo in >/sys/class/gpio/gpio$i/direction ; done

WLAN button is 'ON', (button pressed) WIFI is ENABLED:

root@OpenWrt:~# for i in 1 2 7 8 11 12 17 18 19 20 21 22 23 ; do echo -n "$i : " ; cat /sys/class/gpio/gpio$i/value ; done ; echo
1 : 1
2 : 1
7 : 1
8 : 0
11 : 1
12 : 1
17 : 1
18 : 1
19 : 1
20 : 1
21 : 0
22 : 1
23 : 1

WLAN button is 'OFF', (button released) WIFI is DISABLED:

root@OpenWrt:~# for i in 1 2 7 8 11 12 17 18 19 20 21 22 23 ; do echo -n "$i : " ; cat /sys/class/gpio/gpio$i/value ; done ; echo
1 : 1
2 : 1
7 : 1
8 : 0
11 : 1
12 : 0
17 : 1
18 : 1
19 : 1
20 : 1
21 : 0
22 : 1
23 : 1

So, it's 12.....?

Next test version
openwrt-ramips-rt305x-nbg419v2-bb-rc3-squashfs-sysupgrade.v4.bin - added /etc/rc.button/wps script as sample (without real function, only on/off wps led), added rfkill button.
BTW, wlan buttton has fixed position?

Hello,

LED and WLAN buttons both have fixed positions, so I guess those should be called on/off switches instead... wink

A picture can describe more than a thousand words:

RESET push button, WLAN & LED on/off switches:
http://www.zyxel.ch/assets/global/image … 2_7305.jpg

WPS push button:
http://www.kiwi-electronics.nl/image/ca … 00x533.jpg

The script for wps button does not work correctly. To test, I changed it to:

#!/bin/sh

logger "${BUTTON} is ${ACTION}"

#if [ "${ACTION}" = "released" ] then 
#       echo 0>/sys/class/leds/nbg-419n:green:wps/brightness
#else 
        echo 1 >/sys/class/leds/nbg-419n:green:wps/brightness
#fi 

which turns the led on, (but not off anymore).

Now the rfkill button need to pressed a few times before wifi stays enabled. (I guess the script interprets it as a push button.)
LuCI is also able to determine the wifi status.

However, it looks that if wifi was enabled, then it will be enabled after reboot, even the button is switched to 'OFF' position (in the u-boot section).
By switching to ON first, and then OFF, the wifi will be diabled again.

The usb led does not lit if a usb stick is inserted to the usb port.

openwrt-ramips-rt305x-nbg419v2-bb-rc3-squashfs-sysupgrade.v5.bin - fixed wlan switch I hope

Hello again, and thank you.

openwrt-ramips-rt305x-nbg419v2-bb-rc3-squashfs-sysupgrade.v5.bin - fixed wlan switch I hope

I performed the following group of tests:

Power off the device. Switch WLAN button to 'OFF' position. Connect power. Wait boot to complete. Switch WLAN button to 'ON' position.

Please press Enter to activate this console.
[   12.390000] NET: Registered protocol family 10
[   12.420000] nf_conntrack version 0.5.0 (966 buckets, 3864 max)
[   12.440000] ip6_tables: (C) 2000-2006 Netfilter Core Team
[   12.480000] Linux video capture interface: v2.00
[   12.510000] Loading modules backported from Linux version master-2014-05-22-0-gf2032ea
[   12.520000] Backport generated by backports.git backports-20140320-37-g5c33da0
[   12.550000] ip_tables: (C) 2000-2006 Netfilter Core Team
[   12.600000] usbcore: registered new interface driver uvcvideo
[   12.620000] USB Video Class driver (1.1.1)
[   12.660000] xt_time: kernel timezone is -0000
[   12.720000] cfg80211: Calling CRDA to update world regulatory domain
[   12.770000] cfg80211: World regulatory domain updated:
[   12.780000] cfg80211:  DFS Master region: unset
[   12.780000] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time)
[   12.800000] cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
[   12.820000] cfg80211:   (2457000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
[   12.840000] cfg80211:   (2474000 KHz - 2494000 KHz @ 20000 KHz), (N/A, 2000 mBm), (N/A)
[   12.850000] cfg80211:   (5170000 KHz - 5250000 KHz @ 160000 KHz), (N/A, 2000 mBm), (N/A)
[   12.870000] cfg80211:   (5250000 KHz - 5330000 KHz @ 160000 KHz), (N/A, 2000 mBm), (0 s)
[   12.880000] cfg80211:   (5490000 KHz - 5730000 KHz @ 160000 KHz), (N/A, 2000 mBm), (0 s)
[   12.900000] cfg80211:   (5735000 KHz - 5835000 KHz @ 80000 KHz), (N/A, 2000 mBm), (N/A)
[   12.920000] cfg80211:   (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 0 mBm), (N/A)
[   12.970000] PPP generic driver version 2.4.2
[   12.980000] NET: Registered protocol family 24
[   13.040000] ieee80211 phy0: rt2x00_set_rt: Info - RT chipset 3352, rev 0200 detected
[   13.050000] ieee80211 phy0: rt2x00_set_rf: Info - RF chipset 000c detected
[   17.090000] rt305x-esw 10110000.esw: link changed 0x00
[   18.730000] rt305x-esw 10110000.esw: link changed 0x11
procd: - init complete -
[   23.440000] device eth0.1 entered promiscuous mode
[   23.450000] device eth0 entered promiscuous mode
[   23.470000] br-lan: port 1(eth0.1) entered forwarding state
[   23.480000] br-lan: port 1(eth0.1) entered forwarding state
[   25.480000] br-lan: port 1(eth0.1) entered forwarding state



BusyBox v1.22.1 (2014-08-05 13:22:56 CEST) built-in shell (ash)
Enter 'help' for a list of built-in commands.

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 BARRIER BREAKER (14.07-rc3, r42056)
 -----------------------------------------------------
  * 1/2 oz Galliano         Pour all ingredients into
  * 4 oz cold Coffee        an irish coffee mug filled
  * 1 1/2 oz Dark Rum       with crushed ice. Stir.
  * 2 tsp. Creme de Cacao
 -----------------------------------------------------
root@OpenWrt:/# [  150.950000] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[  150.960000] device wlan0 entered promiscuous mode
[  151.000000] br-lan: port 2(wlan0) entered forwarding state
[  151.010000] br-lan: port 2(wlan0) entered forwarding state
[  151.020000] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[  153.010000] br-lan: port 2(wlan0) entered forwarding state
[  161.220000] device wlan0 left promiscuous mode
[  161.230000] br-lan: port 2(wlan0) entered disabled state
[  165.960000] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[  165.970000] device wlan0 entered promiscuous mode
[  166.010000] br-lan: port 2(wlan0) entered forwarding state
[  166.020000] br-lan: port 2(wlan0) entered forwarding state
[  166.030000] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[  168.020000] br-lan: port 2(wlan0) entered forwarding state

It 'jumps' a little, i.e. goes 'forwarding state', then 'disabled state', before finally staying at 'forwarding state'.

Power off the device. Keep WLAN button in 'ON' position. Power on the device.

Please press Enter to activate this console.
[   12.390000] NET: Registered protocol family 10
[   12.420000] nf_conntrack version 0.5.0 (966 buckets, 3864 max)
[   12.440000] ip6_tables: (C) 2000-2006 Netfilter Core Team
[   12.480000] Linux video capture interface: v2.00
[   12.510000] Loading modules backported from Linux version master-2014-05-22-0-gf2032ea
[   12.520000] Backport generated by backports.git backports-20140320-37-g5c33da0
[   12.550000] ip_tables: (C) 2000-2006 Netfilter Core Team
[   12.600000] usbcore: registered new interface driver uvcvideo
[   12.620000] USB Video Class driver (1.1.1)
[   12.660000] xt_time: kernel timezone is -0000
[   12.710000] cfg80211: Calling CRDA to update world regulatory domain
[   12.720000] cfg80211: World regulatory domain updated:
[   12.730000] cfg80211:  DFS Master region: unset
[   12.740000] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time)
[   12.760000] cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
[   12.780000] cfg80211:   (2457000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
[   12.790000] cfg80211:   (2474000 KHz - 2494000 KHz @ 20000 KHz), (N/A, 2000 mBm), (N/A)
[   12.810000] cfg80211:   (5170000 KHz - 5250000 KHz @ 160000 KHz), (N/A, 2000 mBm), (N/A)
[   12.820000] cfg80211:   (5250000 KHz - 5330000 KHz @ 160000 KHz), (N/A, 2000 mBm), (0 s)
[   12.840000] cfg80211:   (5490000 KHz - 5730000 KHz @ 160000 KHz), (N/A, 2000 mBm), (0 s)
[   12.860000] cfg80211:   (5735000 KHz - 5835000 KHz @ 80000 KHz), (N/A, 2000 mBm), (N/A)
[   12.870000] cfg80211:   (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 0 mBm), (N/A)
[   12.970000] PPP generic driver version 2.4.2
[   12.990000] NET: Registered protocol family 24
[   13.040000] ieee80211 phy0: rt2x00_set_rt: Info - RT chipset 3352, rev 0200 detected
[   13.060000] ieee80211 phy0: rt2x00_set_rf: Info - RF chipset 000c detected
[   17.110000] rt305x-esw 10110000.esw: link changed 0x00
[   18.720000] rt305x-esw 10110000.esw: link changed 0x10
[   18.850000] rt305x-esw 10110000.esw: link changed 0x11
procd: - init complete -
[   23.470000] device eth0.1 entered promiscuous mode
[   23.480000] device eth0 entered promiscuous mode
[   23.500000] br-lan: port 1(eth0.1) entered forwarding state
[   23.510000] br-lan: port 1(eth0.1) entered forwarding state
[   25.510000] br-lan: port 1(eth0.1) entered forwarding state
[   30.840000] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[   30.860000] device wlan0 entered promiscuous mode
[   30.930000] br-lan: port 2(wlan0) entered forwarding state
[   30.940000] br-lan: port 2(wlan0) entered forwarding state
[   30.950000] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[   32.940000] br-lan: port 2(wlan0) entered forwarding state



BusyBox v1.22.1 (2014-08-05 13:22:56 CEST) built-in shell (ash)
Enter 'help' for a list of built-in commands.

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 BARRIER BREAKER (14.07-rc3, r42056)
 -----------------------------------------------------
  * 1/2 oz Galliano         Pour all ingredients into
  * 4 oz cold Coffee        an irish coffee mug filled
  * 1 1/2 oz Dark Rum       with crushed ice. Stir.
  * 2 tsp. Creme de Cacao
 -----------------------------------------------------
root@OpenWrt:/# 

It works fine.

Then,

While still powered on, switch WLAN button to 'OFF' position. Wait a sec. Switch WLAN button to 'ON' position.

root@OpenWrt:/# [  114.430000] device wlan0 left promiscuous mode
[  114.440000] br-lan: port 2(wlan0) entered disabled state
[  141.210000] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[  141.220000] device wlan0 entered promiscuous mode
[  141.260000] br-lan: port 2(wlan0) entered forwarding state
[  141.270000] br-lan: port 2(wlan0) entered forwarding state
[  141.280000] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[  143.270000] br-lan: port 2(wlan0) entered forwarding state
[  151.480000] device wlan0 left promiscuous mode
[  151.490000] br-lan: port 2(wlan0) entered disabled state
[  156.220000] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[  156.230000] device wlan0 entered promiscuous mode
[  156.270000] br-lan: port 2(wlan0) entered forwarding state
[  156.280000] br-lan: port 2(wlan0) entered forwarding state
[  156.290000] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[  158.280000] br-lan: port 2(wlan0) entered forwarding state

So, the button works as it's supposed to work. Jumping is a minor issue, and can only be seen on console.

Now, if you want to be perfect, and nothing more than absolutely perfect, and you're most certain about it, keep reading. Otherwise, please close your eyes and hide from the evil world.

And, don't blame me. smile I don't work here. smile I have family to support. smile I'm (still) too young to die. smile

However, to test it in a bit more detail, I performed the following tests in order, while keeping the device powered on:

Turn Wifi OFF via LuCI, while button is set to 'ON' position. -> Wifi changes to 'disabled state'.

Switch WLAN button to 'OFF' position. -> Wifi stays at 'disabled state'.

Turn Wifi ON via LuCI, while button is set to 'OFF' position. -> Wifi changes to 'forwarding state'.

Switch WLAN button to 'ON' position. -> Wifi changes to 'disabled state' before returning to 'forwarding state'. (As in dump above)

Turn Wifi OFF via LuCI, while button is set to 'ON' position. -> Wifi changes to 'disabled state'.

Switch WLAN button to 'OFF' position. -> Wifi stays at 'disabled state'.

Turn Wifi ON via LuCI, while button is set to 'OFF' position. -> Wifi changes to 'forwarding state'.

Turn Wifi OFF via LuCI, while button is set to 'OFF' position. -> Wifi changes to 'disabled state'.

Switch button to 'ON' position. -> Nothing happens. <--- BUG

So, there's some logical error.

I guess the only way to solve this would be reading the state of the WLAN button from registers, and act accordingly.

In my opinion, the WLAN button state (on/off) should be honoured over LuCI. I.e., if the WLAN button is switched to 'ON' position, then, and only then the wifi could be disabled/enabled via LuCI, and with command-line tools. Otherwise no. Also, regardelss of the situation, if the WLAN button is switched on, the wifi should be enabled as well.

Update:
I rebooted the device while WLAN switch set to 'OFF' position, and chose '4' as debug level.

When switching the WLAN to 'ON' position, the following information is dumped to console:

procd: hotplug_handler_debug(403): {{"HOME":"\/","PATH":"\/sbin:\/bin:\/usr\/sbin:\/usr\/bin","SUBSYSTEM":"button","ACTION":"pressed","BUTTON":"rfkill","TYPE":"switch","SEEN":"54","SEQNUM":"428"}}
procd: rule_handle_command(354): Command: execprocd: rule_handle_command(356):  /etc/rc.button/rfkillprocd: rule_handle_command(357): 
procd: rule_handle_command(359): Message:procd: rule_handle_command(361):  HOME=/procd: rule_handle_command(361):  PATH=/sbin:/bin:/usr/sbin:/usr/binprocd: rule_handle_command(361):  SUBSYSTEM=buttonprocd: rule_handle_command(361):  ACTION=pressedprocd: rule_handle_command(361):  BUTTON=rfkillprocd: rule_handle_command(361):  TYPE=switchprocd: rule_handle_command(361):  SEEN=54procd: rule_handle_command(361):  SEQNUM=428procd: rule_handle_command(362): 
procd: queue_next(280): Launched hotplug exec instance, pid=1082
procd: rule_handle_command(354): Command: execprocd: rule_handle_command(356):  /sbin/hotplug-callprocd: rule_handle_command(356):  buttonprocd: rule_handle_command(357): 
procd: rule_handle_command(359): Message:procd: rule_handle_command(361):  HOME=/procd: rule_handle_command(361):  PATH=/sbin:/bin:/usr/sbin:/usr/binprocd: rule_handle_command(361):  SUBSYSTEM=buttonprocd: rule_handle_command(361):  ACTION=pressedprocd: rule_handle_command(361):  BUTTON=rfkillprocd: rule_handle_command(361):  TYPE=switchprocd: rule_handle_command(361):  SEEN=54procd: rule_handle_command(361):  SEQNUM=428procd: rule_handle_command(362): 
procd: queue_proc_cb(285): Finished hotplug exec instance, pid=1082
procd: queue_next(280): Launched hotplug exec instance, pid=1101
procd: queue_proc_cb(285): Finished hotplug exec instance, pid=1101
procd: hotplug_handler_debug(403): {{"ACTION":"remove","DEVPATH":"\/devices\/10180000.wmac\/net\/wlan0\/queues\/tx-3","SUBSYSTEM":"queues","SEQNUM":"429"}}
procd: hotplug_handler_debug(403): {{"ACTION":"remove","DEVPATH":"\/devices\/10180000.wmac\/net\/wlan0\/queues\/tx-2","SUBSYSTEM":"queues","SEQNUM":"430"}}
procd: hotplug_handler_debug(403): {{"ACTION":"remove","DEVPATH":"\/devices\/10180000.wmac\/net\/wlan0\/queues\/tx-1","SUBSYSTEM":"queues","SEQNUM":"431"}}
procd: hotplug_handler_debug(403): {{"ACTION":"remove","DEVPATH":"\/devices\/10180000.wmac\/net\/wlan0\/queues\/tx-0","SUBSYSTEM":"queues","SEQNUM":"432"}}
procd: hotplug_handler_debug(403): {{"ACTION":"remove","DEVPATH":"\/devices\/10180000.wmac\/net\/wlan0","SUBSYSTEM":"net","DEVTYPE":"wlan","INTERFACE":"wlan0","IFINDEX":"3","SEQNUM":"433"}}
procd: rule_handle_command(354): Command: execprocd: rule_handle_command(356):  /sbin/hotplug-callprocd: rule_handle_command(356):  netprocd: rule_handle_command(357): 
procd: rule_handle_command(359): Message:procd: rule_handle_command(361):  ACTION=removeprocd: rule_handle_command(361):  DEVPATH=/devices/10180000.wmac/net/wlan0procd: rule_handle_command(361):  SUBSYSTEM=netprocd: rule_handle_command(361):  DEVTYPE=wlanprocd: rule_handle_command(361):  INTERFACE=wlan0procd: rule_handle_command(361):  IFINDEX=3procd: rule_handle_command(361):  SEQNUM=433procd: rule_handle_command(362): 
procd: queue_next(280): Launched hotplug exec instance, pid=1125
procd: queue_proc_cb(285): Finished hotplug exec instance, pid=1125
procd: hotplug_handler_debug(403): {{"ACTION":"add","DEVPATH":"\/devices\/10180000.wmac\/net\/wlan0","SUBSYSTEM":"net","DEVTYPE":"wlan","INTERFACE":"wlan0","IFINDEX":"7","SEQNUM":"434"}}
procd: rule_handle_command(354): Command: execprocd: rule_handle_command(356):  /sbin/hotplug-callprocd: rule_handle_command(356):  netprocd: rule_handle_command(357): 
procd: rule_handle_command(359): Message:procd: rule_handle_command(361):  ACTION=addprocd: rule_handle_command(361):  DEVPATH=/devices/10180000.wmac/net/wlan0procd: rule_handle_command(361):  SUBSYSTEM=netprocd: rule_handle_command(361):  DEVTYPE=wlanprocd: rule_handle_command(361):  INTERFACE=wlan0procd: rule_handle_command(361):  IFINDEX=7procd: rule_handle_command(361):  SEQNUM=434procd: rule_handle_command(362): 
procd: queue_next(280): Launched hotplug exec instance, pid=1152
procd: hotplug_handler_debug(403): {{"ACTION":"add","DEVPATH":"\/devices\/10180000.wmac\/net\/wlan0\/queues\/tx-0","SUBSYSTEM":"queues","SEQNUM":"435"}}
procd: hotplug_handler_debug(403): {{"ACTION":"add","DEVPATH":"\/devices\/10180000.wmac\/net\/wlan0\/queues\/tx-1","SUBSYSTEM":"queues","SEQNUM":"436"}}
procd: hotplug_handler_debug(403): {{"ACTION":"add","DEVPATH":"\/devices\/10180000.wmac\/net\/wlan0\/queues\/tx-2","SUBSYSTEM":"queues","SEQNUM":"437"}}
procd: hotplug_handler_debug(403): {{"ACTION":"add","DEVPATH":"\/devices\/10180000.wmac\/net\/wlan0\/queues\/tx-3","SUBSYSTEM":"queues","SEQNUM":"438"}}
procd: queue_proc_cb(285): Finished hotplug exec instance, pid=1152

(Last edited by jama on 16 Sep 2014, 20:46)

Sorry, I was out for some days. Now I'm back.
But returning to our rams...
All scenarios of use wlan-button may be simply inplemented in userspace and don't concern kernel configuration. I prefer software (Luci) way. As example think of case where no physical access (only remote access) to device.
And finally if all works I'll make patch in two or three days.

Hello,

no problem at all. I hope you had time to relax, and fun.

In my opinion, everything works as supposed, except the USB led. It does not lit if something is inserted in the USB port.

However, and still, in my opinion,

As example think of case where no physical access (only remote access) to device.

Possess a security risk. Anyone having a remote access to the device, may turn the wifi on, regardless of the switch.

But let's not make a big issue about this one. It's enough that people are aware of such possibility.

Hmm..usb led...
Just install kmod-ledtrig-usbdev
Or
openwrt-ramips-rt305x-nbg419v2-bb-rc3-squashfs-sysupgrade.v6.bin - kmod-ledtrig-usbdev added

Hello,

and sorry for a bit late reply. Had some problems with the computer itself...

Just install kmod-ledtrig-usbdev

Won't work ??

root@OpenWrt:/# opkg install kmod-ledtrig-usbdev
Package kmod-ledtrig-usbdev (3.10.49-1) installed in root is up to date.
Collected errors:
 * pkg_get_installed_files: Failed to open //usr/lib/opkg/info/kmod-ledtrig-usbdev.list: No such file or directory.

???

openwrt-ramips-rt305x-nbg419v2-bb-rc3-squashfs-sysupgrade.v6.bin - kmod-ledtrig-usbdev added

Does not work either.

In additition to this, I installed i.e.

opkg update
opkg install kmod-scsi-core kmod-scsi-generic kmod-sdhci kmod-fs-vfat kmod-usb-storage kmod-usb-storage-extras kmod-usb-core kmod-usb-ohci
opkg install kmod-nls-cp437 kmod-nls-iso8859-1
opkg install bash 

as usual, and the USB stick works, but the led won't lit.

[   92.940000] usb 1-2: new full-speed USB device number 2 using ohci-platform
[   93.180000] usb 1-2: no of_node; not parsing pinctrl DT
[   93.180000] usb-storage 1-2:1.0: no of_node; not parsing pinctrl DT
[   93.180000] usb-storage 1-2:1.0: USB Mass Storage device detected
[   93.210000] scsi0 : usb-storage 1-2:1.0
[   94.220000] scsi 0:0:0:0: Direct-Access     BUFFALO  ClipDrive        1.11 PQ: 0 ANSI: 2
[   94.240000] sd 0:0:0:0: no of_node; not parsing pinctrl DT
[   94.250000] sd 0:0:0:0: Attached scsi generic sg0 type 0
[   94.260000] sd 0:0:0:0: [sda] 1032192 512-byte logical blocks: (528 MB/504 MiB)
[   94.280000] sd 0:0:0:0: [sda] Write Protect is on
[   94.290000] sd 0:0:0:0: [sda] Mode Sense: 03 00 80 00
[   94.300000] sd 0:0:0:0: [sda] No Caching mode page found
[   94.310000] sd 0:0:0:0: [sda] Assuming drive cache: write through
[   94.360000] sd 0:0:0:0: [sda] No Caching mode page found
[   94.370000] sd 0:0:0:0: [sda] Assuming drive cache: write through
[   94.390000]  sda: sda1
[   94.440000] sd 0:0:0:0: [sda] No Caching mode page found
[   94.450000] sd 0:0:0:0: [sda] Assuming drive cache: write through
[   94.460000] sd 0:0:0:0: [sda] Attached SCSI removable disk
root@OpenWrt:/# mount /dev/sda1 /mnt
root@OpenWrt:/# ls /mnt/
DRIVERS                 Photos                  x.txt.txt
Documents

??

Please, check that ledtrig-usbdev is loaded. Then show /etc/config/system and
cat /sys/class/leds/nbg-419n:green:usb/trigger
cat /sys/class/leds/nbg-419n:green:usb/device_name

Must be:
- system contain something like

config led 'led_usb'
option name 'USB'
option sysfs 'nbg-419n:green:usb'
option trigger 'usbdev'
option dev '1-1'
option interval 50

config led 'led_wifi'
option name 'wifi'
option sysfs 'rt2800pci-phy0::radio'
option trigger 'netdev'
option dev 'wlan0'
option mode 'link tx rx'

- trigger [usbdev]
- device_name "1-1"

Else
echo "usbdev" > /sys/class/leds/nbg-419n:green:usb/trigger
echo "1-1" > /sys/class/leds/nbg-419n:green:usb/device_name
(usb led must work upto reboot)
add upper code to /etc/config/system and reboot if not present. (usb and wifi leds will work after reboot)

I hope it fix the problem.
openwrt-ramips-rt305x-nbg419v2-bb-rc3-squashfs-sysupgrade.v7.bin - fixed kmod-ledtrig-usbdev add

Hello,

Please, check that ledtrig-usbdev is loaded. Then show /etc/config/system and
cat /sys/class/leds/nbg-419n:green:usb/trigger
cat /sys/class/leds/nbg-419n:green:usb/device_name

root@OpenWrt:/# lsmod |grep usb
ledtrig_usbdev          1952  0 
ums_usbat               7344  0 
usb_common              1160  1 usbcore
usb_storage            35976 10 ums_usbat
usbcore               107099 14 ums_usbat
root@OpenWrt:/#  lsmod |grep led
leds_gpio               2944  0 
ledtrig_usbdev          1952  0 
root@OpenWrt:/# cat /etc/config/system

config system
        option hostname 'OpenWrt'
        option timezone 'UTC'

config timeserver 'ntp'
        list server '0.openwrt.pool.ntp.org'
        list server '1.openwrt.pool.ntp.org'
        list server '2.openwrt.pool.ntp.org'
        list server '3.openwrt.pool.ntp.org'
        option enable_server '0'

config led 'led_wifi_led'
        option name 'wifi'
        option sysfs 'rt2800pci-phy0::radio'
        option trigger 'netdev'
        option dev 'wlan0'
        option mode 'link tx rx'

config led 'led_usb'
        option name 'USB'
        option sysfs 'nbg-419n:green:usb'
        option trigger 'usbdev'
        option dev '1-1'
        option interval '50'
root@OpenWrt:/# cat /sys/class/leds/nbg-419n:green:usb/trigger
none pwmtimer timer default-on netdev [usbdev] phy0rx phy0tx phy0assoc phy0radio 
root@OpenWrt:/# cat /sys/class/leds/nbg-419n:green:usb/device_name
1-1

Why the usbdev is in brackets....?

echo "usbdev" > /sys/class/leds/nbg-419n:green:usb/trigger
echo "1-1" > /sys/class/leds/nbg-419n:green:usb/device_name

Produced nothing. The led won't lit.

I tried everything with both, v6 and v7, including several boots, even with the USB stick in during the reboots.

Change "1-1" to "1-2".

Hello,

I can confirm that the suggested methods work; the usb led works as expected.

Insert a USB stick and issue:

root@(none):/# echo "1-2" > /sys/class/leds/nbg-419n:green:usb/device_name

and the USB light is lit.

Now, remove USB stick, and the led turns off.

Insert the USB stick again, and the led is lit.

In '/etc/config/system', change:

config led 'led_usb'
        option name 'USB'
        option sysfs 'nbg-419n:green:usb'
        option trigger 'usbdev'
        option dev '1-1'
        option interval '50'

to:

config led 'led_usb'
        option name 'USB'
        option sysfs 'nbg-419n:green:usb'
        option trigger 'usbdev'
        option dev '1-2'
        option interval '50'

and remove the USB stick and reboot.

After the reboot, when inserting a USB stick, the usb led is lit, as well as turns off upon removal of the stick.

Done. Thanks.
Have a nice weekend.