====== DNS-321 ====== The DNS-321 is often considered the little brother of the DNS-323. It has a slightly slower CPU (400 vs 500), no USB port, but it does have more flash (16mb vs 8mb). Here is some info gathered from a unit with hardware version A2 running firmware 1.03. Please note that it appears that units labeled version A2 on the outside are labled as A1 on the motherboard itself. \\ ===== Hardware ===== {{ dns-321.jpg| DNS-321}} ^ CPU | 400 MHz Marvell 88f5182-a2 | ^ RAM | 64 MB | ^ Flash | 16 MB Micron M29W128GH | ^ LAN | Gigabit | ^ Kernel | 2.6.22.7 | ^ Samba | 3.0.28 | ^ U-boot | 1.1.1 | \\ ===== Pictures ===== {{hardware:dns321-flashchip.jpg?w=120&h=90|Flash}} {{hardware:dns321-processor.jpg?w=120&h=90|CPU}} {{hardware:dns321-ram.jpg?w=120&h=90|RAM Module}} ===== Serial Console ===== {{ hardware:dns321-serial.jpg?w=120&h=90|Flash}} A serial port is available for advanced troubleshooting and flash recovery. A simple cable can be made using a nokia ca-42 cable as described [[http://buffalo.nas-central.org/wiki/Use_a_Nokia_Serial_Cable_on_an_ARM9_Linkstation|here]]. The cables can be purchased on eBay quite cheap. Other options for building a serial cable are available [[http://dns323.kood.org/hardware%3Aserial|here]]. Pinout: ^Pin 1^Pin 2^Pin 3^Pin 4^ |3.3V|RX|TX|GND|\\ Serial breakout code: 5784468 \\ U-boot autoboot stop: + <1>\\ ==== Recovery via serial ==== Some info was taken from [[http://www.cyrius.com/debian/orion/d-link/dns-323/recovery.html|here]]: The following is done with Ubuntu 12.04 1. Install the splitdns323fw package. $ sudo apt-get install dns323-firmware-tools 2. Then download the 1.03 FW package from D-Link: ftp://ftp.dlink.com/Multimedia/dns321/Firmware/ 3. Unzip it. Then split the firmware (in the directory you unzipped it): $ splitdns323fw -k 103kernel -i 103initrd -d 103defaults dns321_fw_103 4. If kermit is not installed do it now: $ sudo apt-get install ckermit 5. Setup your kermit config file, save the following as a .kermrc file in your home folder (note: the line "set line" will need to be set to your serial port): $ gedit ~/.kermrc set line /dev/ttyACM0 set speed 115200 set carrier-watch off set flow-control none set handshake none set prefixing all set streaming off set parity none 6. Run kermit, start this initally with the dns-321 box already running and your cable connected: $sudo kermit 7. Once inside kermit hit the key to get to the console. Hit a couple times. !!if you are running stock firmware type 5784468 and hit !! 8. You should now be at a # prompt: # 9. Now enter the reboot command. Be prepared to do the next step quickly as you will only have 3 or so seconds to complete it.. # reboot 10. You will now see something similar to this USB 0: host mode USB 1: host mode Net: egiga0 [PRIME] Hit any key to stop autoboot: press + <1> this will exit the autoboot sequence. 11. At this point you should be at a boot prompt similar to the following: Marvell>> 12. Now you can enter a multitude of commands here (? shows all commands available). For recovery purposes we only need three commands, see #13, #15 and #17. 13. Flash the kernel image via uboot: Marvell>> loadb k you will get this in response: ## Ready for binary (kermit) download to 0x00400000 at 115200 bps.. at this point you will need to hit +<\> then then you will need to upload the kernel file send 103kernel you should now see a screen showing transfer status. Once it completes (it will take a good 5 minutes or so) move on to #14 . 14. Verify that the kernel was sent successfully: hit to go to the console and make sure the image in 13 was accepted ok. You should see Kernel Size = 1554936 Copy to Flash... done note: Size might be different! 15. Flash the ramdisk image via uboot: Marvell>> loadb r you will get this in response: ## Ready for binary (kermit) download to 0x00400000 at 115200 bps.. at this point you will need to hit +<\> then then you will need to upload the ramdisk file send 103initrd you should now see a screen showing transfer status. Once it completes (it will take a good 15 minutes or so) move on to #16 . 16. Verify that the ramdisk was sent successfully: hit to go to the console and make sure the image in 15 was accepted ok. You should see: Ramdisk Size = 8935844 Copy to Flash... done note: Size might be different! 17. Congrats your now back to stock! To start booting you new flash image type: Marvell>> boot ===== Alternative Firmware ===== Alt-f, an alternative firmware available for the DNS-323, now has experimental support for the DNS-321. For more information please check the thread on the google groups for Alt-f (link blocked). Search for "flashed DNS-321". ===== Outputs ===== == U-Boot == ** LOADER ** ** MARVELL BOARD: DB-88F5182-DDR2 LE U-Boot 1.1.1 (Feb 20 2009 - 16:05:55) Marvell version: 2.2.2.Chopper.04 U-Boot code: 00200000 -> 0026FFF0 BSS: -> 0027BC90 Soc: 88F5182 A2 (DDR2) CPU running @ 400Mhz SysClock = 200Mhz , TClock = 166Mhz DRAM CS[0] base 0x00000000 size 64MB DRAM Total size 64MB [16384kB@ff000000] Flash: 16 MB Addresses 4M - 0M are saved for the U-Boot usage. Mem malloc Initialization (4M - 3M): Done advanced CPU : ARM926 (Rev 0) 88F5182 A2 streaming disabled USB 0: host mode USB 1: host mode Net: egiga0 [PRIME] Hit any key to stop autoboot: 0 Marvell>> \\ == dmesg == ## Booting image at ff040000 ... Image Name: Linux-2.6.22.7 Created: 2009-08-10 9:41:56 UTC Image Type: ARM Linux Kernel Image (uncompressed) Data Size: 1554872 Bytes = 1.5 MB Load Address: 00008000 Entry Point: 00008000 Verifying Checksum ... OK OK ## Loading Ramdisk Image at ff1c0000 ... Image Name: Ramdisk Created: 2009-08-17 2:18:25 UTC Image Type: ARM Linux RAMDisk Image (gzip compressed) Data Size: 8935780 Bytes = 8.5 MB Load Address: 00800000 Entry Point: 00800000 Verifying Checksum ... OK Starting kernel ... Uncompressing Linux...................................................................................................... done, booting the kernel. Linux version 2.6.22.7 (jack@SWTEST1) (gcc version 3.4.4 (release) (CodeSourcery ARM 2005q3-2)) #15 Mon Aug 10 17:41:46 CST 2009 CPU: ARM926EJ-S [41069260] revision 0 (ARMv5TEJ), cr=a0053177 Machine: Feroceon Using UBoot passing parameters structure Memory policy: ECC disabled, Data cache writeback CPU0: D VIVT write-back cache CPU0: I cache: 32768 bytes, associativity 1, 32 byte lines, 1024 sets CPU0: D cache: 32768 bytes, associativity 1, 32 byte lines, 1024 sets Built 1 zonelists. Total pages: 16256 Kernel command line: root=/dev/ram console=ttyS0,115200 :::DB88FXX81:egiga0:none PID hash table entries: 256 (order: 8, 1024 bytes) Console: colour dummy device 80x30 Dentry cache hash table entries: 8192 (order: 3, 32768 bytes) Inode-cache hash table entries: 4096 (order: 2, 16384 bytes) Memory: 64MB 0MB 0MB 0MB = 64MB total Memory: 52912KB available (2908K code, 193K data, 120K init) Mount-cache hash table entries: 512 CPU: Testing write buffer coherency: ok NET: Registered protocol family 16 Sys Clk = 200000000, Tclk = 166666667 CPU Interface ------------- SDRAM_CS0 ....base 00000000, size 64MB SDRAM_CS1 ....base 10000000, size 256MB SDRAM_CS2 ....base 20000000, size 256MB SDRAM_CS3 ....base 30000000, size 256MB PEX0_MEM ....base e0000000, size 128MB PEX0_IO ....base f2000000, size 1MB PCI0_MEM ....base e8000000, size 128MB PCI0_IO ....base f2100000, size 1MB INTER_REGS ....base f1000000, size 1MB DEVICE_CS0 ....no such DEVICE_CS1 ....no such DEVICE_CS2 ....no such DEV_BOOCS ....base ff000000, size 16MB CRYPT_ENG ....base f0000000, size 64KB Marvell Development Board (LSP Version 3.0.5_NAS_GDP_p9)-- DB-88F5182-DDR2 Soc: 88F5182 A2 Detected Tclk 166666667 and SysClk 200000000 Marvell USB EHCI Host controller #0: c10b1600 Marvell USB EHCI Host controller #1: c10b1400 PCI: bus0: Fast back to back transfers enabled SCSI subsystem initialized usbcore: registered new interface driver usbfs usbcore: registered new interface driver hub usbcore: registered new device driver usb Time: orion_clocksource clocksource has been installed. NET: Registered protocol family 2 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) TCP: Hash tables configured (established 2048 bind 2048) TCP reno registered checking if image is initramfs...it isn't (no cpio magic); looks like an initrd Freeing initrd memory: 8726K RTC registered Use the XOR engines (acceleration) for enhancing the following functions: o RAID 5 Xor calculation o kernel memcpy o kenrel memzero o copy user to/from kernel buffers Number of XOR engines to use: 2 VFS: Disk quotas dquot_6.5.1 Dquot-cache hash table entries: 1024 (order 0, 4096 bytes) squashfs: version 3.3 (2007/10/31) Phillip Lougher io scheduler noop registered io scheduler anticipatory registered (default) Serial: 8250/16550 driver $Revision: 1.1.1.1 $ 4 ports, IRQ sharing disabled serial8250.0: ttyS0 at MMIO 0xf1012000 (irq = 3) is a 16550A serial8250.0: ttyS1 at MMIO 0xf1012100 (irq = 4) is a 16550A RAMDISK driver initialized: 16 RAM disks of 18432K size 1024 blocksize loop: module loaded Marvell Ethernet Driver 'mv_ethernet': o Uncached descriptors in DRAM o DRAM SW cache-coherency o TCP segmentation offload enabled o Checksum offload enabled o Marvell ethtool proc enabled o Rx desc: 128 o Tx desc: 256 o Loading network interface 'egiga0' PPP generic driver version 2.4.2 PPP Deflate Compression module registered PPP BSD Compression module registered PPP MPPE Compression module registered NET: Registered protocol family 24 Intergrated Sata device found scsi0 : Marvell SCSI to SATA adapter scsi1 : Marvell SCSI to SATA adapter NFTL driver: nftlcore.c $Revision: 1.1.1.1 $, nftlmount.c $Revision: 1.1.1.1 $ flash VppMin = "181" , VppMax = "197" cfi_flash_0: Found 1 x16 devices at 0x0 in 8-bit bank Amd/Fujitsu Extended Query Table at 0x0040 cfi_flash_0: CFI does not contain boot bank location. Assuming top. number of CFI chips: 1 cfi_cmdset_0002: Disabling erase-suspend-program due to code brokenness. Creating 6 MTD partitions on "cfi_flash_0": 0x00000000-0x00020000 : "MTD1" 0x00020000-0x00040000 : "MTD2" 0x00040000-0x001c0000 : "Linux Kernel" 0x001c0000-0x00bc0000 : "File System" 0x00f80000-0x01000000 : "u-boot" 0x00bc0000-0x00f80000 : "Module" ehci_marvell ehci_marvell.4523: Marvell Orion EHCI ehci_marvell ehci_marvell.4523: new USB bus registered, assigned bus number 1 ehci_marvell ehci_marvell.4523: irq 17, io base 0xf1050100 ehci_marvell ehci_marvell.4523: USB 2.0 started, EHCI 1.00, driver 10 Dec 2004 usb usb1: configuration #1 chosen from 1 choice hub 1-0:1.0: USB hub found hub 1-0:1.0: 1 port detected ehci_marvell ehci_marvell.167817: Marvell Orion EHCI ehci_marvell ehci_marvell.167817: new USB bus registered, assigned bus number 2 ehci_marvell ehci_marvell.167817: irq 12, io base 0xf10a0100 ehci_marvell ehci_marvell.167817: USB 2.0 started, EHCI 1.00, driver 10 Dec 2004 usb usb2: configuration #1 chosen from 1 choice hub 2-0:1.0: USB hub found hub 2-0:1.0: 1 port detected mice: PS/2 mouse device common for all mice md: linear personality registered for level -1 md: raid0 personality registered for level 0 md: raid1 personality registered for level 1 device-mapper: ioctl: 4.11.0-ioctl (2006-10-12) initialised: dm-devel@redhat.com dm_crypt using the OCF package. TCP cubic registered NET: Registered protocol family 1 NET: Registered protocol family 17 md: Autodetecting RAID arrays. md: autorun ... md: ... autorun DONE. RAMDISK: Compressed image found at block 0 EXT2-fs warning: mounting unchecked fs, running e2fsck is recommended VFS: Mounted root (ext2 filesystem). Freeing init memory: 120K init started: BusyBox v1.00-pre1 (2009.02.11-09:07+0000) multi-call binary init started: BusyBox v1.00-pre1 (2009.02.11-09:07+0000) multi-call binary Starting pid 261, console /dev/ttyS0: '/etc/rc.sh' ** Mounting /etc/fstab umount: proc: not mounted umount: proc: not mounted umount: /image.cfs: not mounted umount: /image.cfs: not mounted Check MTD block device V2.05.12242008 MTDC: Mount MTD1 done. MTDC: Mount MTD2 done. Error: Can't open file /sys/mtd1/version.txt in mtd1. MTDC: Backup files from MTD1 to MTD2. ** copy mtd1 files cp: /sys/mtd1/firmwareupdate: No such file or directory cp: /sys/mtd1/MountError: No such file or directory cp: /sys/mtd1/exports: No such file or directory mv: /sys/mtd1/udhcpd.leases: No such file or directory mv: /sys/mtd1/firmwareupdate: No such file or directory mv: /sys/mtd1/restore: No such file or directory mv: /sys/mtd1/format_ok: No such file or directory mv: /sys/mtd1/pls_sync: No such file or directory mv: /sys/mtd1/pls_chmod_a2: No such file or directory mv: /sys/mtd1/pls_chmod_b2: No such file or directory mv: /sys/mtd1/spare_dsk: No such file or directory mv: /sys/mtd1/std_raid1: No such file or directory mv: /sys/mtd1/old_prescan_version: No such file or directory cp: /sys/mtd1/ftpgroup: No such file or directory cp: /sys/mtd1/ez-ipupdate.cache: No such file or directory ** link lib ** ** link web ** ** link /usr/bin ** ** link /usr/sbin ** cp: /sys/crfs/default/server-key-nopassword.pem: No such file or directory mode: 16384 -o offset: 0 -f frequency: 0 maxerror: 16384000 esterror: 16384000 status: 64 ( UNSYNC ) -p timeconstant: 2 precision: 1 tolerance: 33554432 -t tick: 10000 time.tv_sec: 1351718500 time.tv_usec: 964351 return value: 5 (clock not synchronized) : getRTC time= 12/10/31 21:21:41 ** set loopback interface MAC = egiga0: mac address changed Jumbo Fram enable Set mtu 9000 egiga0: Ilegal MTU value 9000, rounding MTU to: 9004 egiga0: change mtu 1500 (buffer-size 1520) to 9004 (buffer-size 9024) ** Activate Gigabit Interface egiga0: link down ** execute rc.init.sh Setting hostname .... NASbox egiga0: link up, full duplex, speed 1 Gbps hd verify v1.21.08122009 can not detect hd normal mode Set Timezone=08 cmd =cp /sys/crfs/sbin/zoneinfo/08Mountain /etc/localtime get IP = 192.168.5.5 crond[622]: crond 2.3.2 dillon, started, log level 8 check button V2.67.07242009 1.03(1.19.0817.2009) 08/17/2009 SIOCADDRT: File exists mfg_search version 1.01.1103.2008 mfg_search kill -9 `pidof mfg_Chopper` 2>/dev/null local ip c0a80505 (192.168.5.5) netmask ffffff00 (255.255.255.0) init socket OK kill: Usage: kill [-s sigspec | -signum | -sigspec] [pid | job]... or kill -l [exitstatus] DLINK321 UPnP AV / MediaServer v2.03 (2009-08-11 10:58:39 CST) No CodePage UUID[uuid:39457473-0645-7145-5ec9-00265a7a9a5e] ** Get MAC Addr set_fan_speed()-->h Set fan to high speed op_server v2.01.06012006 crond[665]: crond 2.3.2 dillon, started, log level 8 Starting pid 676, console /dev/ttyS0: '/bin/sh' BusyBox v1.00-pre1 (2009.02.11-09:07+0000) Built-in shell (ash) Enter 'help' for a list of built-in commands. crond[714]: crond 2.3.2 dillon, started, log level 8 \\ == /proc/cpuinfo == Processor : ARM926EJ-S rev 0 (v5l) BogoMIPS : 266.24 Features : swp half thumb fastmult edsp CPU implementer : 0x41 CPU architecture: 5TEJ CPU variant : 0x0 CPU part : 0x926 CPU revision : 0 Cache type : write-back Cache clean : cp15 c7 ops Cache lockdown : format C Cache format : Harvard I size : 32768 I assoc : 1 I line length : 32 I sets : 1024 D size : 32768 D assoc : 1 D line length : 32 D sets : 1024 Hardware : Feroceon Revision : 0000 Serial : 0000000000000000 \\ == /proc/meminfo == MemTotal: 61828 kB MemFree: 18800 kB Buffers: 21152 kB Cached: 11176 kB SwapCached: 0 kB Active: 8596 kB Inactive: 28588 kB SwapTotal: 0 kB SwapFree: 0 kB Dirty: 4 kB Writeback: 0 kB AnonPages: 4892 kB Mapped: 1488 kB Slab: 4572 kB SReclaimable: 892 kB SUnreclaim: 3680 kB PageTables: 132 kB NFS_Unstable: 0 kB Bounce: 0 kB CommitLimit: 30912 kB Committed_AS: 11816 kB VmallocTotal: 450560 kB VmallocUsed: 17012 kB VmallocChunk: 425980 kB \\ == /proc/mtd == dev: size erasesize name mtd0: 00020000 00020000 "MTD1" mtd1: 00020000 00020000 "MTD2" mtd2: 00180000 00020000 "Linux Kernel" mtd3: 00a00000 00020000 "File System" mtd4: 00080000 00020000 "u-boot" mtd5: 003c0000 00020000 "Module" \\