dns323.randomhacking.net
Overview

The D-Link DNS323 is based on a Marvell 88F5181 (Revision A1) or 88F5182 (Revision B1).

Marvell hired Nicolas Pitre and Lennert Buytenhek to add Orion platform support to the Linux kernel, so since version 2.6.25 there has been mainline kernel support for the SoC the DNS323 uses.

Herbert Valerio Riedel added the original board support for revision A1, and Matt Palmer added support for revision B1.

The LM75 temperature sensor driver was updated to the new style I2C driver bindings by David Brownell, I tweaked Matt Palmer's updated version of Herbert Valerio Riedel's G760A fan controller driver to use the new style I2C driver bindings, and Martin Michlmayr submitted and further tweaked it for inclusion in mainline.

Erik Benada has fixed power off and the LEDs for revision B1, and I have fixed the LEDs for revision A1.

Meanwhile, Matt Palmer updated the Debian installer to support the DNS323.

This all means we have a Debian netboot firmware image for the DNS323, that can be flashed via the stock web interface, that lets us install Debian.

Debian Installation

Simply use the DNS323 web interface to upload netboot.img as a firmware update, then proceed as any other Debian netboot installation.

Martin Michlmayr has already written an excellent installation guide, so I won't duplicate that here.

Once you have Debian installed, you may find that the LEDs do not work correctly with the current Debian lenny kernel, in which case, you can add deb http://dns323.randomhacking.net/debian/ lenny main to /etc/apt/sources.list and apt-get update and apt-get install linux-image-2.6.32-dns323-orion5x. You will probably also want to apt-get remove linux-image-2.6-orion5x so that apt-get upgrade will not install another kernel.

If you have a revision A1 DNS323, your LEDs probably still do not work correctly, to fix this you can save ledoptions to /etc/modprobe.d/ and update-initramfs -u.

You can also apt-get install dns323d a simple configurable fan, button and LED control daemon.

You might also want to apt-get install smartmontools and save 05leds to /etc/smartmontools/run.d/ (make sure it's executable), this will cause smartd to light the amber LEDs if drive failure is detected.

Serial

fig 1

fig 2

fig 3

fig 4

fig 5

fig 6

fig 7

Fig 1 shows the main board, with the serial header CON4, circled in yellow. The pin assignment is
GNDRXTX3.3V
as pictured.

Fig 2 shows an FT232RL based USB-TTL adapter, available from eBay, with a small piece of scrap metal glued to the back of the USB port, and a short lead attached to a molex 51021-0400 4 way receptacle housing, available from RS and Digi-Key. You also need the corresponding 50058-8000 crimp terminals, also available from RS and Digi-Key.

Fig 3 shows the back plate with an additional hole cut in the middle to accomodate the USB-TTL adapter. You don't have to worry about being too neat here, as it won't be visible when assembled.

Fig 4 shows the back plate reassembled with the fan, SATA connectors, and USB-TTL adapter. I chose to bolt the USB-TTL adapter to the plate, as it could conceivably be pushed in if glued.

Fig 5 shows the back plate reattached to the main board, and the USB-TTL adapter plugged in.

Fig 6 shows the assembly reinserted into the casing.

Fig 7 shows the rear of the casing, fully reassembled. You will need to enlarge the existing hole in the center of the back panel to accommodate the USB port. I would recommend using needle files here, and taking your time.

I am using CKermit (apt-get install ckermit on a Debian based system) with this .kermrc.

JTAG

fig 1

fig 2

fig 3

Fig 1 shows the main board, with the JTAG header CON5, circled in yellow. The pin assignment is
TCKSRST
TCKTDO
TMSGND
TDIGND
TRSTVCC
as pictured. You will need to solder a 2mm pitch 2x5 pin header, available from RS and Digi-Key. Make sure to solder the pin header to the bottom of the board, or the board will not fit back in the case.

If you have a revision B1, you will also need to bridge R199 and solder 47K 0402 SMD resistors at R200, R201 and R202.

Fig 2 shows an air-wired wiggler type cable constructed according to the schematic here, which is also listed as fig 3 above for convenience.

Alternatively, you could purchase a USB JTAG adapter, such as the Amontec JTAGKey Tiny. I happened to have all of the required parts for the wiggler type cable lying around, otherwise I would have probably gone with this option.

You will need openocd-r1193.tar.bz2, which is modified to support writing to the Spansion flash the DNS323 uses, and openocd.cfg, which should configure OpenOCD for the DNS323.