OpenWrt Forum Archive

Topic: WRT310N: OpenWrt Userspace with DD-WRT Kernel

The content of this topic has been archived on 14 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I finally got my WRT310N debricked and am still determined to make OpenWrt run on this thing.  OpenWrt isn't fat, bloated, doesn't give me a GUI I don't care for, and is for the most part, a full-blown Linux distribution with its own package manager and init system.  What's not to like?

BUT

While DD-WRT runs fine on this rig, Kamikaze 8.09 RC2 bricked it.  I'm assuming there's kernel error somewhere as even TFTP didn't work until I erased the NVRAM and OS from the router's flash (JTAG); the only thing left in tact was the CFE.  Is there a way to hybrid an OpenWrt userspace with a DD-WRT kernel?

Has anyone found a console serial port header on this router?  I see a JTAG, but no serial?  Or is it the funky J81 header?

It looks to me that this has a serial port on the motherboard that is exposed via the WAN ethernet port.  I've heard of this on newer Linksys routers.  There are contact pads you can see inside the WAN port on the bottom.  Linksys has some special cable for diagnostics to get in this way.  If you look close, you can actually see TX RX and GND printed on the circuit board.

(Last edited by RoundSparrow on 7 Feb 2009, 19:47)

ok, continuity tester reveals the pad on the underside of the board is a duplication of the labeled serial port underside of WAN ethernet jack.

This is the 5 gold pads on the UNDERSIDE of the board, near the  broadcom bcm4705 chip.  the pad says "B2" in very tiny print.

pin 2 - TX
pin 3 - RX
pin 5 - GND

Here is console boot of dd-wrt build from today.

CFE version 1.0.37 for BCM947XX (32bit,SP,LE)
Build Date: Thu Jan  3 14:20:25 CST 2008 (root@linux)
Copyright (C) 2000,2001,2002,2003 Broadcom Corporation.

Initializing Arena
Initializing PCI. [normal]
PCI: Initializing host
PCI bus 0 slot 0/0: vendor 0x14e4 product 0x0800 (flash memory, rev 0x02)
PCI bus 0 slot 1/0: vendor 0x14e4 product 0x471f (ethernet network, rev 0x02)
PCI bus 0 slot 2/0: vendor 0x14e4 product 0x471a (USB serial bus, interface 0x10, rev 0x02)
PCI bus 0 slot 2/1: vendor 0x14e4 product 0x471a (USB serial bus, interface 0x20, rev 0x02)
PCI bus 0 slot 3/0: vendor 0x14e4 product 0x471b (USB serial bus, rev 0x02)
PCI bus 0 slot 4/0: vendor 0x14e4 product 0x0804 (PCI bridge, rev 0x02)
PCI bus 0 slot 5/0: vendor 0x14e4 product 0x0816 (MIPS processor, rev 0x02)
PCI bus 0 slot 6/0: vendor 0x14e4 product 0x471d (IDE mass storage, rev 0x02)
PCI bus 0 slot 7/0: vendor 0x14e4 product 0x4718 (network/computing crypto, rev 0x02)
PCI bus 0 slot 8/0: vendor 0x14e4 product 0x080f (RAM memory, rev 0x02)
PCI bus 0 slot 9/0: vendor 0x14e4 product 0x471e (class 0xfe, subclass 0x00, rev 0x02)
Initializing Devices.

No DPN
This is a Parallel Flash
Boot partition size = 262144(0x40000)
Partition information:
boot    #00   00000000 -> 0003FFFF  (262144)
trx     #01   00040000 -> 0004001B  (28)
os      #02   0004001C -> 003F7FFF  (3899364)
nvram   #03   003F8000 -> 003FFFFF  (32768)
Partition information:
boot    #00   00000000 -> 0003FFFF  (262144)
trx     #01   00040000 -> 003F7FFF  (3899392)
nvram   #02   003F8000 -> 003FFFFF  (32768)
Reset switch via GPIO 8 ...
PCI bus 0 slot 1/0: pci_map_mem: attempt to map 64-bit region tag=0x800 @ addr=18010004
PCI bus 0 slot 1/0: pci_map_mem: addr=0x18010004 pa=0x18010000
ge0: BCM5750 Ethernet at 0x18010000
CPU type 0x2901A: 300MHz
Total memory: 32768 KBytes

Total memory used by CFE:  0x80700000 - 0x807A2600 (665088)
Initialized Data:          0x80737980 - 0x8073A880 (12032)
BSS Area:                  0x8073A880 - 0x8073C600 (7552)
Local Heap:                0x8073C600 - 0x807A0600 (409600)
Stack Area:                0x807A0600 - 0x807A2600 (8192)
Text (code) segment:       0x80700000 - 0x80737980 (227712)
Boot area (physical):      0x007A3000 - 0x007E3000
Relocation Factor:         I:00000000 - D:00000000

Boot version: v4.7
The boot is CFE
mac_init(): Find mac [00:22:6b:58:10:0d] in location 0
Nothing...
CMD: [ifconfig eth0 -addr=192.168.1.1 -mask=255.255.255.0]
eth0: Link speed: 1000BaseT FDX
Device eth0:  hwaddr 00-22-6B-58-10-0D, ipaddr 192.168.1.1, mask 255.255.255.0
        gateway not set, nameserver not set
CMD: [go;]
Check CRC of image1
  Len:     0x3A0000     (3801088)       (0xBC040000)
  Offset0: 0x1C         (28)            (0xBC04001C)
  Offset1: 0x9A8        (2472)  (0xBC0409A8)
  Offset2: 0xE2C00      (928768)        (0xBC122C00)
  Header CRC:    0x645859E
  Calculate CRC: 0x645859E
Image 1 is OK
Try to load image 1.
Waiting for 5 seconds to upgrade ...
CMD: [load -raw -addr=0x807a2600 -max=0x770000 :]
Loader:raw Filesys:tftp Dev:eth0 File:: Options:(null)
Loading: _tftpd_open(): retries=0/5
_tftpd_open(): retries=1/5
_tftpd_open(): retries=2/5
_tftpd_open(): retries=3/5
_tftpd_open(): retries=4/5
Failed.
Could not load :: Timeout occured
CMD: [boot -raw -z -addr=0x80001000 -max=0x770000 flash0.os:]
Loader:raw Filesys:raw Dev:flash0.os File: Options:(null)
Loading: .. 3856 bytes read
Entry at 0x80001000
Closing network.
eth0: cannot clear 1400/00000002
Starting program at 0x80001000
CPU revision is: 0002901a
Linux version 2.4.37 (root@dd-wrt) (gcc version 3.4.6 (OpenWrt-2.0)) #3367 Sat Feb 7 01:30:41 CET 2009
Setting the PFC to its default value
Determined physical RAM map:
 memory: 02000000 @ 00000000 (usable)
On node 0 totalpages: 8192
zone(0): 8192 pages.
zone(1): 0 pages.
zone(2): 0 pages.
Kernel command line: root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200
CPU: BCM4785 rev 2 at 300 MHz
Using 150.000 MHz high precision timer.
Calibrating delay loop... 299.82 BogoMIPS
Dentry cache hash table entries: 4096 (order: 3, 32768 bytes)
Inode cache hash table entries: 2048 (order: 2, 16384 bytes)
Mount cache hash table entries: 512 (order: 0, 4096 bytes)
Buffer cache hash table entries: 1024 (order: 0, 4096 bytes)
Page-cache hash table entries: 8192 (order: 3, 32768 bytes)
Checking for 'wait' instruction...  unavailable.
POSIX conformance testing by UNIFIX
PCI: Initializing host
PCI: Ignoring BAR0-1 of IDE controller 00:06.0
PCI: Fixing up bus 0
PCI: Fixing up bridge
PCI: Setting latency timer of device 01:00.0 to 64
PCI: Fixing up bus 1
Initializing RT netlink socket
Starting kswapd
devfs: v1.12c (20020818) Richard Gooch (rgooch@atnf.csiro.au)
devfs: boot_options: 0x1
squashfs: version 3.0 (2006/03/15) Phillip Lougher
pty: 256 Unix98 ptys configured
Serial driver version 5.05c (2001-07-08) with MANY_PORTS SHARE_IRQ SERIAL_PCI enabled
ttyS00 at 0xb8000300 (irq = 2) is a 16550A
ttyS01 at 0xb8000400 (irq = 2) is a 16550A
PCI: Setting latency timer of device 01:01.0 to 64
PCI: Enabling device 01:01.0 (0004 -> 0006)
Overriding boardvendor: 0x14e4 instead of 0x14e4
Overriding boardtype: 0x46d instead of 0x4321
Universal TUN/TAP device driver 1.5 (C)1999-2002 Maxim Krasnyansky
Physically mapped flash: Found an alias at 0x400000 for the chip at 0x0
Physically mapped flash: Found an alias at 0x800000 for the chip at 0x0
Physically mapped flash: Found an alias at 0xc00000 for the chip at 0x0
Physically mapped flash: Found an alias at 0x1000000 for the chip at 0x0
Physically mapped flash: Found an alias at 0x1400000 for the chip at 0x0
Physically mapped flash: Found an alias at 0x1800000 for the chip at 0x0
Physically mapped flash: Found an alias at 0x1c00000 for the chip at 0x0
 Amd/Fujitsu Extended Query Table v1.3 at 0x0040
number of CFI chips: 1
cfi_cmdset_0002: Disabling fast programming due to code brokenness.
Flash device: 0x400000 at 0x1c000000
bootloader size: 262144
Physically mapped flash: Filesystem type: squashfs, size=0x2bcabb
partition size = 2872320
Creating 5 MTD partitions on "Physically mapped flash":
0x00000000-0x00040000 : "cfe"
0x00040000-0x003f0000 : "linux"
0x00122c00-0x003e0000 : "rootfs"
mtd: partition "rootfs" doesn't start on an erase block boundary -- force read-only
0x003f0000-0x00400000 : "nvram"
0x003e0000-0x003f0000 : "ddwrt"
sflash not supported on this router
Initializing Cryptographic API
IP Protocols: ICMP, UDP, TCP, IGMP
IP: routing cache hash table of 512 buckets, 4Kbytes
TCP: Hash tables configured (established 2048 bind 4096)
ip_conntrack version 2.1 (512 buckets, 4096 max) - 336 bytes per conntrack
ip_tables: (C) 2000-2002 Netfilter core team
ipt_random match loaded
netfilter PSD loaded - (c) astaro AG
ipt_osf: Startng OS fingerprint matching module.
ipt_IPV4OPTSSTRIP loaded
NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
802.1Q VLAN Support v1.8 Ben Greear <greearb@candelatech.com>
All bugs added by David S. Miller <davem@redhat.com>
VFS: Mounted root (squashfs filesystem) readonly.
Mounted devfs on /dev
starting Architecture code for broadcom
Booting device: Linksys WRT310N
loading bcm57xxlsys
bcm_robo_attach: Resetting 539x robo switch
dd-wrt already booted, use internal fixup
configure vlan1 (1 2 3 4 8*) instead of vlan0 for BCM5395
sh: can't create /proc/switch/eth0/reset: nonexistent directory
sh: can't create /proc/switch/eth1/reset: nonexistent directory
sh: can't create /proc/switch/eth0/vlan/1/ports: nonexistent directory
sh: can't create /proc/switch/eth0/vlan/1/ports: nonexistent directory
sh: can't create /proc/switch/eth0/vlan/2/ports: nonexistent directory
sh: can't create /proc/switch/eth0/vlan/2/ports: nonexistent directory
sh: can't create /proc/sys/net/ipv4/tcp_congestion_control: nonexistent directory
eth0: Operation not supported
wl0.1: No such device
wl0.2: No such device
wl0.3: No such device
nbw = 20
channel 6, val 20
800, 300, 6
spec 2B06
eth0: Numerical result out of range
eth0: Invalid argument
eth0: Invalid argument
eth0: Operation not supported
eth0: Operation not supported
br0: Bad file descriptor
br0: Bad file descriptor
eth0: Operation not supported
wl0.1: No such device
wl0.2: No such device
wl0.3: No such device
nbw = 20
channel 6, val 20
800, 300, 6
spec 2B06
eth0: Numerical result out of range
eth0: Invalid argument
eth0: Invalid argument
eth0: Operation not supported
eth0: Operation not supported
SIOCGIFFLAGS: No such device
SIOCGIFFLAGS: No such device
SIOCGIFFLAGS: No such device
SIOCGIFFLAGS: No such device
vlan2: Setting MAC address to  00 22 6b 58 10 0e.
sh: /tmp/.rc_startup: not found

DD-WRT v24 std (c) 2008 NewMedia-NET GmbH
Release: 02/07/09 (SVN revision: 11571)
�
DD-WRT login: root
Password: 
==========================================================
 
 ____  ___    __        ______ _____         ____  _  _ 
 | _ \| _ \   \ \      / /  _ \_   _| __   _|___ \| || | 
 || | || ||____\ \ /\ / /| |_) || |   \ \ / / __) | || |_ 
 ||_| ||_||_____\ V  V / |  _ < | |    \ V / / __/|__   _| 
 |___/|___/      \_/\_/  |_| \_\|_|     \_/ |_____|  |_| 
 
                       DD-WRT v24-sp2
                   http://www.dd-wrt.com
 
==========================================================
Jan  1 00:00:22 login[410]: root login on 'console'


BusyBox v1.13.2 (2009-02-07 01:27:49 CET) built-in shell (ash)
Enter 'help' for a list of built-in commands.

root@DD-WRT:~# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00040000 00010000 "cfe"
mtd1: 003b0000 00010000 "linux"
mtd2: 002bd400 00010000 "rootfs"
mtd3: 00010000 00010000 "nvram"
mtd4: 00010000 00010000 "ddwrt"
root@DD-WRT:~# uname -a
Linux DD-WRT 2.4.37 #3367 Sat Feb 7 01:30:41 CET 2009 mips unknown
root@DD-WRT:~#

(Last edited by RoundSparrow on 7 Feb 2009, 22:40)

Did you make your own cable to get the serial console or did you open up and solder onto the pads?

xboy wrote:

Did you make your own cable to get the serial console or did you open up and solder onto the pads?

I soldered onto the bottom pads (described in earlier message).  They are flat gold surface-mount pads.  ideal for some kind of contact pogo-pins.  I soldered solid Ethernet wire to the 3 pads, the hot glued over the wires to make sure they didn't fall off. I was able to put the case back together fine with this, the location of the pad had enough room for the wires and hot glue blob.

FYI:  It is possible to flip the board over and stand it upright without need to disconnect the antennas or antenna wires from the case.  Just take your time.

Also I didn't use a special bit for the security screws, I used a flat blade screwdriver that was the perfect size and fit right into the security screw head.  It has to be a near-perfect match, but I had a good set of small screwdrivers to try.

UPDATE:  The pads are similar to the Linksys 610N, there are detailed photos here: http://forum.openwrt.org/viewtopic.php?pid=76333#p76333  I personally used a $3.30 Nokia DKU-5 cable (off eBay) instead of more expensive MAX3232 solution.

(Last edited by RoundSparrow on 7 Feb 2009, 23:16)

So what's the main issue with getting OpenWrt to support this model?

The discussion might have continued from here.