D-Link DIR-320 H/W Ver.: B1
Supported Versions
| Version/Model | S/N | OpenWrt Version Supported | Model Specific Notes |
|---|---|---|---|
| B1/B2 | - | Bleeding Edge trunk r35307 (unofficial) and Attitude Adjustment |
Hardware Highlights
| CPU | Ram | Flash | Network | USB | Serial | JTag |
|---|---|---|---|---|---|---|
| RaLink RT5350 SoC | 32Mbytes | 8Mbytes | 4 x 1 | Yes | Yes | Yes |
Installation
Flash Layout
Please check out the article Flash Layout. It contains an example and a couple of explanations.
OEM easy installation
Is not possible now.
OEM installation using the TFTP method
RaLink 5xxx U-Boot may download a firmware from TFTP server to RAM and boot it. Next you may write image to flash using standard "Upgrade" procedure.
See also →generic.flashing.tftp
Specific values you need
| Bootloader TFTP client IPv4 address | 192.168.0.1 |
| Bootloader MAC address (special) | 00:AA:BB:CC:DD:10 |
| Firmware TFTP image | |
| TFTP Transfer Window | ? sec |
| TFTP Window Start | 1 sec |
| TFTP Server Required IP Address | 192.168.0.2 |
Upgrading OpenWrt
- Get the firmware from here
- Plug off power cable
- Press and hold "reset" button
- Plug on power cable, wait for 15 seconds
- Setup your network manually: IP 192.168.0.2 MASK 255.255.255.0
- Enter web interface 192.168.0.1
- Chose your .bin file and submit reflashing
- Setup your network to get options by DHCP
- Wait until power led will light
Bootlogs
OEM bootlog
Console output at boot:
U-Boot 1.1.3 (Mar 31 2011 - 13:19:43)
Board: Ralink APSoC DRAM: 32 MB
rt2880 uboot v0.00e04 05/25/2006
SERIAL_CLOCK_DIVISOR =16
kaiker,,CONFIG_BAUDRATE =57600
SDRAM SIZE:02000000
Top of RAM usable for U-Boot at: 82000000
Reserving 319k for U-Boot at: 81fb0000
Reserving 260k for malloc() at: 81f6f000
Reserving 44 Bytes for Board Info at: 81f6efd4
Reserving 36 Bytes for Global Data at: 81f6efb0
Reserving 128k for boot params() at: 81f4efb0
Stack Pointer at: 81f4ef98
relocate_code Pointer at: 81fb0000
Now running in RAM - U-Boot at: 81fb0000
monitor_flash_len =124244
...
spi_wait_nsec: 42
spi device id: ef 40 17 0 0 (40170000)
find flash: W25Q64BV
raspi_read: from:30000 len:1000
.raspi_read: from:30000 len:1000
.Before: 3000
reg 2000
After: 3000
============================================
Ralink UBoot Version: 3.5.2.0
--------------------------------------------
ASIC 5350_MP (Port5<->None)
DRAM_CONF_FROM: Boot-Strapping
DRAM_TYPE: SDRAM
DRAM_SIZE: 256 Mbits
DRAM_WIDTH: 16 bits
DRAM_TOTAL_WIDTH: 16 bits
TOTAL_MEMORY_SIZE: 32 MBytes
Flash component: SPI Flash
Date:Mar 31 2011 Time:13:19:43
============================================
icache: sets:256, ways:4, linesz:32 ,total:32768
dcache: sets:128, ways:4, linesz:32 ,total:16384
##### The CPU freq = 360 MHZ ####
estimate memory size =32 Mbytes
raspi_read: from:40004 len:6
.
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.
7: Load Boot Loader code then write to Flash via Serial.
9: Load Boot Loader code then write to Flash via TFTP.
You choosed 4
raspi_read: from:40004 len:6
4: System Enter Boot Command Line Interface.
U-Boot 1.1.3 (Mar 31 2011 - 13:19:43)
RT5350 # printenv
bootcmd=tftp
baudrate=57600
ethaddr="00:AA:BB:CC:DD:10"
ramargs=setenv bootargs root=/dev/ram rw
addip=setenv bootargs $(bootargs) ip=$(ipaddr):$(serverip):$(gatewayip):$(netmask):$(hostname):$(netdev):off
addmisc=setenv bootargs $(bootargs) console=ttyS0,$(baudrate) ethaddr=$(ethaddr) panic=1
flash_self=run ramargs addip addmisc;bootm $(kernel_addr) $(ramdisk_addr)
kernel_addr=BFC40000
u-boot=u-boot.bin
load=tftp 8A100000 $(u-boot)
u_b=protect off 1:0-1;era 1:0-1;cp.b 8A100000 BC400000 $(filesize)
loadfs=tftp 8A100000 root.cramfs
u_fs=era bc540000 bc83ffff;cp.b 8A100000 BC540000 $(filesize)
test_tftp=tftp 8A100000 root.cramfs;run test_tftp
ethact=Eth0 (10/100-M)
filesize=35f87d
fileaddr=80800000
ipaddr=192.168.0.1
serverip=192.168.0.2
autostart=no
bootfile=firmware.tftp
bootargs=mem=32M console=ttyS1,57600n8
bootdelay=10
stdin=serial
stdout=serial
stderr=serial
Environment size: 875/4092 bytes
RT5350 # reset
-blah-blah-blah
3: System Boot system code via Flash.
## Booting image at bc050000 ...
raspi_read: from:50000 len:40
. Image Name: MIPS OpenWrt Linux-2.6.39.4
Created: 2011-11-20 4:14:31 UTC
Image Type: MIPS Linux Kernel Image (lzma compressed)
Data Size: 2423308 Bytes = 2.3 MB
Load Address: 80000000
Entry Point: 80000000
raspi_read: from:50040 len:24fa0c
Verifying Checksum ... OK
Uncompressing Kernel Image ... OK
No initrd
## Transferring control to Linux (at address 80000000) ...
## Giving linux memsize in MB, 32
Kernel log messages (syslog):
Jan 1 00:00:16 syslogd started: BusyBox v1.12.1
Jan 1 00:00:16 resident: init lan
Jan 1 00:00:16 resident: start ipoe on br0
Jan 1 00:00:16 resident: ip_is_up on br0
Jan 1 00:00:16 resident: start dhcp+dns on br0
Jan 1 00:00:16 kernel: [17179569.380000] TCP: Hash tables configured (established 1024 bind 1024)
Jan 1 00:00:16 kernel: [17179569.384000] TCP reno registered
Jan 1 00:00:16 kernel: [17179569.400000] deice id : ef 40 17 0 0 (40170000)
Jan 1 00:00:16 kernel: [17179569.404000] W25Q64BV(ef 40170000) (8192 Kbytes)
Jan 1 00:00:16 kernel: [17179569.408000] mtd .name = raspi, .size = 0x00800000 (8M) .erasesize = 0x00010000 (64K) .numeraseregions = 0
Jan 1 00:00:16 kernel: [17179569.412000] Creating 7 MTD partitions on "raspi":
Jan 1 00:00:16 kernel: [17179569.416000] 0x00000000-0x00800000 : "ALL"
Jan 1 00:00:16 kernel: [17179569.420000] 0x00000000-0x00030000 : "Bootloader"
Jan 1 00:00:16 kernel: [17179569.424000] 0x00030000-0x00040000 : "Config"
Jan 1 00:00:16 kernel: [17179569.428000] 0x00040000-0x00050000 : "Factory"
Jan 1 00:00:16 kernel: [17179569.432000] 0x00050000-0x00130000 : "Kernel"
Jan 1 00:00:16 kernel: [17179569.436000] 0x00130000-0x00000000 : "RootFS"
Jan 1 00:00:16 kernel: [17179569.440000] 0x00050000-0x00000000 : "Linux"
Jan 1 00:00:16 kernel: [17179569.444000] Load Ralink DFS Timer Module
Jan 1 00:00:16 kernel: [17179569.448000] RT3xxx EHCI/OHCI init.
Jan 1 00:00:16 kernel: [17179569.456000] squashfs: version 3.4 (2008/08/26) Phillip Lougher
Jan 1 00:00:16 kernel: [17179569.456000] squashfs: LZMA suppport for slax.org by jro
Jan 1 00:00:16 kernel: [17179569.460000] io scheduler noop registered (default)
Jan 1 00:00:16 kernel: [17179569.496000] Ralink gpio driver initialized
Jan 1 00:00:16 kernel: [17179569.888000] HDLC line discipline: version $Revision: 1.1.1.1 $, maxframe=4096
Jan 1 00:00:16 kernel: [17179569.892000] N_HDLC line discipline registered.
Jan 1 00:00:16 kernel: [17179569.896000] Serial: 8250/16550 driver $Revision: 1.7 $ 2 ports, IRQ sharing disabled
Jan 1 00:00:16 kernel: [
Jan 1 00:00:16 kernel: 17179569.900000] serial8250: ttyS0 at I/O 0xb0000500 (irq = 37) is a 16550A
Jan 1 00:00:16 kernel: [17179569.904000] serial8250: ttyS1 at I/O 0xb0000c00 (irq = 12) is a 16550A
Jan 1 00:00:16 kernel: [17179569.912000] loop: loaded (max 8 devices)
Jan 1 00:00:16 kernel: [17179569.916000] rdm_major = 254
Jan 1 00:00:16 kernel: [17179569.920000] PPP generic driver version 2.4.2
Jan 1 00:00:16 kernel: [17179569.924000] PPP Deflate Compression module registered
Jan 1 00:00:16 kernel: [17179569.928000] PPP BSD Compression module registered
Jan 1 00:00:16 kernel: [17179569.932000] PPP MPPE Compression module registered
Jan 1 00:00:16 kernel: [17179569.936000] NET: Registered protocol family 24
Jan 1 00:00:16 kernel: [17179569.940000] PPPoL2TP kernel driver, V0.17
Jan 1 00:00:16 kernel: [17179569.944000] PPTP driver version 0.8.5
Jan 1 00:00:16 kernel: [17179569.964000] block2mtd: version $Revision: 1.1.1.1 $
Jan 1 00:00:16 kernel: [17179569.968000] Initializing USB Mass Storage driver...
Jan 1 00:00:16 kernel: [17179569.972000] usbcore: registered new interface driver usb-storage
Jan 1 00:00:16 kernel: [17179569.976000] USB Mass Storage support registered.
Jan 1 00:00:16 kernel: [17179569.980000] usbcore: registered new interface driver usbhid
Jan 1 00:00:16 kernel: [17179569.984000] drivers/usb/input/hid-core.c: v2.6:USB HID core driver
Jan 1 00:00:16 kernel: [17179569.988000] GACT probability on
Jan 1 00:00:16 kernel: [17179569.992000] Mirror/redirect action on
Jan 1 00:00:16 kernel: [17179569.996000] Simple TC action Loaded
Jan 1 00:00:16 kernel: [17179570.000000] u32 classifier
Jan 1 00:00:16 kernel: [17179570.004000] Performance counters on
Jan 1 00:00:16 kernel: [17179570.008000] input device check on
Jan 1 00:00:16 kernel: [17179570.012000] Actions configured
Jan 1 00:00:16 kernel: [17179570.016000] nf_conntrack version 0.5.0 (256 buckets, 2048 max)
Jan 1 00:00:16 kernel: [17179570.020000] ip_tables: (C) 2000-2006 Netfilter Core Team, Type=Restricted Cone
Jan 1 00:00:16 kernel: [17179570.028000] ipt_time loading
Jan 1 00:00:16 kernel: [17179570.032000] arp_tables: (C) 2002 David S. Miller
Jan 1 00:00:16 kernel: [17179570.036000] TCP cubic registered
Jan 1 00:00:16 kernel: [17179570.040000] NET: Registered protocol family 1
Jan 1 00:00:16 kernel: [17179570.044000] NET: Registered protocol family 17
Jan 1 00:00:16 kernel: [17179570.048000] Ebtables v2.0 registered
Jan 1 00:00:16 kernel: [17179570.052000] 802.1Q VLAN Support v1.8 Ben Greear
Jan 1 00:00:16 kernel: [17179570.056000] All bugs added by David S. Miller
Jan 1 00:00:16 kernel: [17179570.068000] VFS: Mounted root (squashfs filesystem) readonly.
Jan 1 00:00:16 kernel: [17179570.072000] Freeing unused kernel memory: 112k freed
Jan 1 00:00:16 kernel: [17179570.824000] Algorithmics/MIPS FPU Emulator v1.5
Jan 1 00:00:16 kernel: [17179571.172000] tun: Universal TUN/TAP device driver, 1.6
Jan 1 00:00:16 kernel: [17179571.176000] tun: (C) 1999-2004 Max Krasnyansky
Jan 1 00:00:16 kernel: [17179572.088000] NTFS driver 2.1.28 [Flags: R/W MODULE].
Jan 1 00:00:16 kernel: [17179576.860000] MAC_ADRH -- : 0x00000000
Jan 1 00:00:16 kernel: [17179576.864000] MAC_ADRL -- : 0x00000000
Jan 1 00:00:16 kernel: [17179576.868000] Ralink APSoC Ethernet Driver Initilization. v2.0 256 rx/tx descriptors allocated, mtu = 1500!
Jan 1 00:00:16 kernel: [17179576.872000] MAC_ADRH -- : 0x0000000c
Jan 1 00:00:16 kernel: [17179576.876000] MAC_ADRL -- : 0x43305077
Jan 1 00:00:16 kernel: [17179576.884000] PROC INIT OK!
Jan 1 00:00:16 kernel: [17179577.972000] MAC_ADRH -- : 0x0000b8a3
Jan 1 00:00:16 kernel: [17179577.976000] MAC_ADRL -- : 0x86ae521a
Jan 1 00:00:16 kernel: [17179577.984000]
Jan 1 00:00:16 kernel: [17179577.984000] phy_tx_ring = 0x01d7f000, tx_ring = 0xa1d7f000
Jan 1 00:00:16 kernel: [17179577.984000]
Jan 1 00:00:16 kernel: [17179577.984000] phy_rx_ring0 = 0x01e20000, rx_ring0 = 0xa1e20000
Jan 1 00:00:16 kernel: [17179577.988000] RT305x_ESW: Link Status Changed
Jan 1 00:00:16 kernel: [17179578.476000] RT305x_ESW: Link Status Changed
Jan 1 00:00:16 kernel: [17179579.248000] rt2860v2_ap: module license 'unspecified' taints kernel.
Jan 1 00:00:16 kernel: [17179579.296000]
Jan 1 00:00:16 kernel: [17179579.296000]
Jan 1 00:00:16 kernel: [17179579.296000] === pAd = c01b2000, size = 631688 ===
Jan 1 00:00:16 kernel: [17179579.296000]
Jan 1 00:00:16 kernel: [17179579.300000] <-- RTMPAllocAdapterBlock, Status=0
Jan 1 00:00:16 kernel: [17179581.316000] RX DESC a1907000 size = 2048
Jan 1 00:00:16 kernel: [17179581.324000] <-- RTMPAllocTxRxRingMemory, Status=0
Jan 1 00:00:16 kernel: [17179581.660000] Key1Str is Invalid key length(0) or Type(1)
Jan 1 00:00:16 kernel: [17179581.664000] Key2Str is Invalid key length(0) or Type(1)
Jan 1 00:00:16 kernel: [17179581.668000] Key3Str is Invalid key length(0) or Type(1)
Jan 1 00:00:16 kernel: [17179581.672000] Key4Str is Invalid key le
Jan 1 00:00:16 kernel: ngth(0) or Type(1)
Jan 1 00:00:16 kernel: [17179581.708000] 1. Phy Mode = 9
Jan 1 00:00:16 kernel: [17179581.712000] 2. Phy Mode = 9
Jan 1 00:00:16 kernel: [17179581.716000] 3. Phy Mode = 9
Jan 1 00:00:16 kernel: [17179581.720000] MCS Set = ff 00 00 00 01
Jan 1 00:00:16 kernel: [17179581.736000] SYNC - BBP R4 to 20MHz.l
Jan 1 00:00:16 kernel: [17179584.604000] Main bssid = b8:a3:86:ae:52:1a
Jan 1 00:00:16 kernel: [17179584.608000] <==== rt28xx_init, Status=0
Jan 1 00:00:16 kernel: [17179584.636000] 0x1300 = 00064380
Jan 1 00:00:16 kernel: [17179584.744000] eth2.4: dev_set_promiscuity(master, 1)
Jan 1 00:00:16 kernel: [17179584.748000] device eth2 entered promiscuous mode
Jan 1 00:00:16 kernel: [17179584.752000] device eth2.4 entered promiscuous mode
Jan 1 00:00:16 kernel: [17179584.756000] eth2.3: dev_set_promiscuity(master, 1)
Jan 1 00:00:16 kernel: [17179584.760000] device eth2.3 entered promiscuous mode
Jan 1 00:00:16 kernel: [17179584.764000] eth2.2: dev_set_promiscuity(master, 1)
Jan 1 00:00:16 kernel: [17179584.768000] device eth2.2 entered promiscuous mode
Jan 1 00:00:16 kernel: [17179584.772000] eth2.1: dev_set_promiscuity(master, 1)
Jan 1 00:00:16 kernel: [17179584.776000] device eth2.1 entered promiscuous mode
Jan 1 00:00:16 kernel: [17179584.780000] device ra0 entered promiscuous mode
Jan 1 00:00:16 kernel: [17179584.784000] br0: port 5(ra0) entering learning state
Jan 1 00:00:16 kernel: [17179584.788000] br0: port 4(eth2.1) entering learning state
Jan 1 00:00:16 kernel: [17179584.792000] br0: port 3(eth2.2) entering learning state
Jan 1 00:00:16 kernel: [17179584.796000] br0: port 2(eth2.3) entering learning state
Jan 1 00:00:16 kernel: [17179584.800000] br0: port 1(eth2.4) entering learning state
Jan 1 00:00:16 dnsmasq[800]: started, version 2.40 cachesize 512
Jan 1 00:00:16 dnsmasq[800]: compile time options: no-IPv6 GNU-getopt no-RTC no-MMU no-ISC-leasefile no-DBus no-I18N TFTP
Jan 1 00:00:16 dnsmasq[800]: DHCP, IP range 192.168.0.2 -- 192.168.0.100, lease time 1d
Jan 1 00:00:16 dnsmasq[800]: read /tmp/hosts - 2 addresses
Jan 1 00:00:16 dnsmasq[800]: read /etc/ethers - 0 addresses
Jan 1 00:00:17 resident: init wan
Jan 1 00:00:17 kernel: [17179585.716000] eth2.5: Setting MAC address to b8 a3 86 ae 52 1b.
Jan 1 00:00:17 resident: start ipoe on eth2.5
Jan 1 00:00:17 udhcpc[830]: udhcp client (v0.9.8) started
Jan 1 00:00:17 event: path = /var/lock/eth2.5.lock
Jan 1 00:00:17 event: send event
Jan 1 00:00:17 udhcpc[830]: Sending discover...
Jan 1 00:00:17 resident: Out init_device
Jan 1 00:00:18 udhcpc[830]: Lease of 172.21.0.56 obtained, lease time 600
Jan 1 00:00:18 kernel: [17179586.868000] rt3xxx-ehci rt3xxx-ehci: Ralink EHCI Host Controller
Jan 1 00:00:18 kernel: [17179586.876000] rt3xxx-ehci rt3xxx-ehci: new USB bus registered, assigned bus number 1
Jan 1 00:00:18 kernel: [17179586.904000] rt3xxx-ehci rt3xxx-ehci: irq 18, io mem 0x101c0000
Jan 1 00:00:18 kernel: [17179586.908000] rt3xxx-ehci rt3xxx-ehci: USB 0.0 started, EHCI 1.00, driver 10 Dec 2004
Jan 1 00:00:18 kernel: [17179586.912000] usb usb1: Product: Ralink EHCI Host Controller
Jan 1 00:00:18 kernel: [17179586.916000] usb usb1: Manufacturer: Linux 2.6.21 ehci_hcd
Jan 1 00:00:18 kernel: [17179586.920000] usb usb1: SerialNumber: rt3xxx
Jan 1 00:00:18 kernel: [17179586.936000] usb usb1: configuration #1 chosen from 1 choice
Jan 1 00:00:18 kernel: [17179586.944000] hub 1-0:1.0: USB hub found
Jan 1 00:00:18 kernel: [17179586.948000] hub 1-0:1.0: 1 port detected
Jan 1 00:00:18 kernel: [17179587.152000] rt3xxx-ohci rt3xxx-ohci: RT3xxx OHCI Controller
Jan 1 00:00:18 kernel: [17179587.160000] rt3xxx-ohci rt3xxx-ohci: new USB bus registered, assigned bus number 2
Jan 1 00:00:18 kernel: [17179587.164000] rt3xxx-ohci rt3xxx-ohci: irq 18, io mem 0x101c1000
Jan 1 00:00:18 kernel: [17179587.228000] usb usb2: Product: RT3xxx OHCI Controller
Jan 1 00:00:18 kernel: [17179587.232000] usb usb2: Manufacturer: Linux 2.6.21 ohci_hcd
Jan 1 00:00:18 kernel: [17179587.236000] usb usb2: SerialNumber: rt3xxx-ohci
Jan 1 00:00:18 kernel: [17179587.252000] usb usb2: configuration #1 chosen from 1 choice
Jan 1 00:00:19 kernel: [17179587.260000] hub 2-0:1.0: USB hub found
Jan 1 00:00:19 kernel: [17179587.264000] hub 2-0:1.0: 1 port detected
Jan 1 00:00:19 resident: ip_is_down on eth2.5
Jan 1 00:00:24 resident: ip_is_up on eth2.5
Jan 1 00:00:24 resident: update dns
Jan 1 00:00:24 dnsmasq[800]: read /tmp/hosts - 2 addresses
Jan 1 00:00:24 dnsmasq[800]: read /etc/ethers - 0 addresses
Jan 1 00:00:24 dnsmasq[800]: using nameserver 172.21.0.2#53
Jan 1 00:00:24 resident: update ntpclient
Jan 1 00:00:24 resident: update rip
Jan 1 00:00:24 resident: update igmp
Jan 1 00:00:24 kernel: [17179592.720000] eth2.5: dev_set_allmulti(master, 1)
Jan 1 00:00:31 kernel: [17179599.788000] br0: topology change detected, propagating
Jan 1 00:00:31 kernel: [17179599.792000] br0: port 5(ra0) entering forwarding state
Jan 1 00:00:31 kernel: [17179599.796000] br0: topology change detected, propagating
Jan 1 00:00:31 kernel: [17179599.800000] br0: port 4(eth2.1) entering forwarding state
Jan 1 00:00:31 kernel: [17179599.804000] br0: topology change detected, propagating
Jan 1 00:00:31 kernel: [17179599.808000] br0: port 3(eth2.2) entering forwarding state
Jan 1 00:00:31 kernel: [17179599.812000] br0: topology change detected, propagating
Jan 1 00:00:31 kernel: [17179599.816000] br0: port 2(eth2.3) entering forwarding state
Jan 1 00:00:31 kernel: [17179599.820000] br0: topology change detected, propagating
Jan 1 00:00:31 kernel: [17179599.824000] br0: port 1(eth2.4) entering forwarding state
Jan 1 00:00:48 kernel: [17179617.120000] RT305x_ESW: Link Status Changed
Jan 1 00:00:51 kernel: [17179619.472000] RT305x_ESW: Link Status Changed
OpenWrt bootlog
[ 0.000000] Linux version 3.7.3 (vbox@vbox-VirtualBox) (gcc version 4.6.4 20121210 (prerelease) (Linaro GCC 4.6-2012.12) ) #22 Thu Jan 31 08:57:31 MSK 2013
[ 0.000000] prom: fw_arg0=00000001, fw_arg1=81f4efb0, fw_arg2=01f4f3b0, fw_arg3=00000000
[ 0.000000] env= (null) is not in RAM, skipping
[ 0.000000] env= (null) is not in RAM, skipping
[ 0.000000] bootconsole [early0] enabled
[ 0.000000] CPU revision is: 0001964c (MIPS 24KEc)
[ 0.000000] Ralink RT5350 id:1 rev:3 running at 360.00 MHz
[ 0.000000] Determined physical RAM map:
[ 0.000000] memory: 02000000 @ 00000000 (usable)
[ 0.000000] Initrd not found or empty - disabling initrd
[ 0.000000] Zone ranges:
[ 0.000000] Normal [mem 0x00000000-0x01ffffff]
[ 0.000000] Movable zone start for each node
[ 0.000000] Early memory node ranges
[ 0.000000] node 0: [mem 0x00000000-0x01ffffff]
[ 0.000000] On node 0 totalpages: 8192
[ 0.000000] free_area_init_node: node 0, pgdat 802b0530, node_mem_map 81000000
[ 0.000000] Normal zone: 64 pages used for memmap
[ 0.000000] Normal zone: 0 pages reserved
[ 0.000000] Normal zone: 8128 pages, LIFO batch:0
[ 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] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[ 0.000000] pcpu-alloc: [0] 0
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 8128
[ 0.000000] Kernel command line: board=DIR-320-B1 console=ttyS1,57600 mtdparts=spi0.0:192k(u-boot)ro,64k(u-boot-env)ro,64k(factory)ro,1024k(kernel),6848k(rootfs),7872k@0x50000(firmware) rootfstype=squashfs,jffs2
[ 0.000000] PID hash table entries: 128 (order: -3, 512 bytes)
[ 0.000000] Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
[ 0.000000] Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
[ 0.000000] __ex_table already sorted, skipping sort
[ 0.000000] Writing ErrCtl register=00000006
[ 0.000000] Readback ErrCtl register=00000006
[ 0.000000] Memory: 29308k/32768k available (2225k kernel code, 3460k reserved, 529k data, 188k 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.010000] Calibrating delay loop... 239.61 BogoMIPS (lpj=1198080)
[ 0.080000] pid_max: default: 32768 minimum: 301
[ 0.080000] Mount-cache hash table entries: 512
[ 0.090000] NET: Registered protocol family 16
[ 0.100000] MIPS: machine is D-Link DIR-320 B1
[ 0.130000] bio: create slab
Basic configuration
→ Basic configuration After flashing, proceed with this.
Specific Configuration
Interfaces
The default network configuration is:
| Interface Name | Description | Default configuration |
|---|---|---|
| br-lan | LAN & WiFi | 192.168.1.1/24 |
| vlan0 (eth0.0) | LAN ports (1 to 4) | None |
| vlan1 (eth0.1) | WAN port | DHCP |
| wl0 | WiFi | Disabled |
Switch Ports (for VLANs)
Numbers 0-3 are Ports 1-4 as labeled on the unit, number 4 is the Internet (WAN) on the unit, 5 is the internal connection to the CPU of router. Don't be fooled: Port 1 on the unit is number 3 when configuring VLANs. vlan0 = eth0.0, vlan1 = eth0.1 and so on.
| Port | Switch port |
|---|---|
| Internet (WAN) | 4 |
| LAN 1 | 3 |
| LAN 2 | 2 |
| LAN 3 | 1 |
| LAN 4 | 0 |
Failsafe mode
Buttons
→ hardware.button on howto use and configure the hardware button(s).
The D-Link DIR-320NRU has two buttons. They are Reset and WiFi Protected Setup (WPS).
| BUTTON | Event |
|---|---|
| Reset | reset |
| WPS | ? |
Hardware
Info
| Architecture: | MIPS |
| Vendor: | Ralink |
| Bootloader: | U-Boot |
| CPU/Speed | MIPS 24K V4.12 model "RT5350F" 360 Mhz |
| Flash-Chip: | SPI Winbond |
| Flash size: | 8192 KiB |
| RAM: | 32 MiB |
| Wireless: | (Integrated into CPU) 2.4ghz 802.11bgn |
| Ethernet: | (Integrated into CPU) 100 mbit/s w/vlan support swconfig |
| Internet: | Ethernet and 3g/LTE via USB stick |
| USB: | Yes 1 x 2.0 |
| Serial: | Yes |
| JTAG: | Yes |
Photos
D-Link DIR-320 H/W Ver. B1, trading name "DIR-320NRU"
Front:
Photo of front of the casing
Back:
Photo of back of the casing
Opening the case
Note: This will void your warranty!
To remove the cover: - remove (unglue) the warranty sticker; - unglue two ribbon puds; - unscrew two screws; - __safety__ remove cover.
Serial
→ port.serial general information about the serial port, serial port cable, etc.
How to connect to the Serial Port of DIR-320NRU:
Photo of PCB with markings |
Pins from top to bottom:
- TX
- Ground
- VCC (3.3V)
- key
- RX
Serial console jack don't soldered on plant, place of jack are empty.
Warning: console port are serial 3.3 V, if you want connect router to PC RS232, it is need to use serial 3.3V to 5V converter.
Note: Serial port speed is 57600 bod
JTAG
→ port.jtag general information about the JTAG port, JTAG cable, etc.
How to connect to the JTAG Port of this specific device:
Debricking
Take solderer into hands :) and connect to console port on the board of the router using serial 3.3V to serial 5V converter. Next insert power jack into router and wait for U-boot:
…
##### The CPU freq = 360 MHZ #### estimate memory size =32 Mbytes raspi_read: from:40004 len:6 . 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. 7: Load Boot Loader code then write to Flash via Serial. 9: Load Boot Loader code then write to Flash via TFTP.Press "4" and next you may type command for bootloader.
You choosed 4 raspi_read: from:40004 len:6 4: System Enter Boot Command Line Interface. U-Boot 1.1.3 (Mar 31 2011 - 13:19:43) RT5350 #
Default values for the load firmware via tftp:
RT5350 # printenv bootcmd=tftp baudrate=57600 ethaddr="00:AA:BB:CC:DD:10" ramargs=setenv bootargs root=/dev/ram rw addip=setenv bootargs $(bootargs) ip=$(ipaddr):$(serverip):$(gatewayip):$(netmask):$(hostname):$(netdev):off addmisc=setenv bootargs $(bootargs) console=ttyS0,$(baudrate) ethaddr=$(ethaddr) panic=1 flash_self=run ramargs addip addmisc;bootm $(kernel_addr) $(ramdisk_addr) kernel_addr=BFC40000 u-boot=u-boot.bin load=tftp 8A100000 $(u-boot) u_b=protect off 1:0-1;era 1:0-1;cp.b 8A100000 BC400000 $(filesize) loadfs=tftp 8A100000 root.cramfs u_fs=era bc540000 bc83ffff;cp.b 8A100000 BC540000 $(filesize) test_tftp=tftp 8A100000 root.cramfs;run test_tftp ethact=Eth0 (10/100-M) filesize=35f87d fileaddr=80800000 ipaddr=192.168.0.1 serverip=192.168.0.2 autostart=no bootfile=firmware.tftp bootargs=mem=32M console=ttyS1,57600n8 bootdelay=10 stdin=serial stdout=serial stderr=serial Environment size: 875/4092 bytes RT5350 #
Bootloader Mods
Hardware mods
Notes
Run custom script with OEM firmware
- Official firmware contain bug in the config parser: inline code execution are allowed. Confiuration files placed in the directory
/etc/default(simlink of/tmp/etc/default). You may telnet to router and insert your script call using`/path/to/script.sh`into some config file, next save your changes to NVRAM. Look a shell code example in the russian article.
Original part of /etc/default/config.json
"dmz": {
"enable": true,
"ip": "192.168.0.2"
},
Modified part of /etc/default/config.json:
"dmz": {
"enable": true,
"ip": "`/etc/default/shaper.sh`"
},
echo Set DMZ Host to 9.9.9.9 via WebIF and run me again! echo Use /etc/default/DMZ.txt to set DMZ Host IP sed -i s/9.9.9.9/"\`\/etc\/default\/shaper.sh\`"/g /etc/default/config.json saveconfig
A program /usr/sbin/saveconfig writes configuration data to NVRAM. At boot a program /usr/sbin/loadconfig load a NVRAM and write config files into /etc/default/.
See also
toh/d-link/dir-320_revb1.txt · Last modified: 2013/03/25 16:51 by xakep666


Photo of PCB with markings