DNS-320 and DNS-325

2,859 views
Skip to first unread message

GreatLord

unread,
Apr 19, 2011, 3:37:16 PM4/19/11
to Alt-F
Hi
I see u have done great work with doing own frimware for dns-323, I
wonder if u want help getting Alt-F to DNS-320 as well. in Dlink
source code it call DNS-320 as DNS323D1 in the linux kernel config
file configDNS323D1.

If not that case can u help me expain how to create a working
image.cfs, it seam the format is diffent againts DNS323.

I known how to compile uboot, linux kernel and uRamDisk and how to
glue thuse pices toghter with dlink socurecode compile envorment.

Joao Cardoso

unread,
Apr 25, 2011, 10:40:43 AM4/25/11
to Alt-F
I have already answered similar questions for other dlink boxes:

-Not until 0.1 is released
-Not until someone with ffp installed on a 320 tries to 'insmod' one
of fonz 'reloaded' kernel modules and post the *exact* command output
(the command will fail, no harm will happens)
-Not until someone experienced owning a 320 uncovers the box
"secrets".
-Not until someone offers me a 320 :)

Magnus Olsen

unread,
Apr 26, 2011, 7:12:52 AM4/26/11
to al...@googlegroups.com
Hi
I am willing to help u.
I own DNS-320 and using fonz

I have install modify kernel in my dns-320 and it working well.

Tell me step for step u need help with.

I can also give u access to my DNS-320
I do not have anything value on it yet.

if u mail me private at magnus at greatlord dot com I can give u
access to it.

Dlink have release the source code for DNS-320 as well
the kernel config is call DNS323D1

2011/4/25 Joao Cardoso <whoami...@gmail.com>:

> --
> You received this message because you are subscribed to the Google Groups "Alt-F" group.
> To post to this group, send email to al...@googlegroups.com.
> To unsubscribe from this group, send email to alt-f+un...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/alt-f?hl=en.
>
>

Joao Cardoso

unread,
Apr 26, 2011, 12:10:37 PM4/26/11
to Alt-F


On Apr 26, 12:12 pm, Magnus Olsen <mag...@greatlord.com> wrote:
> Hi
> I am willing to help u.
> I own DNS-320 and using fonz
>
> I have install modify kernel in my dns-320 and it working well.

So you have flashed the modified kernel?
The modified kernel was a recompilation of the dlink published kernel
source code? With what modifications? Are they publicly available?

For me to create a "reloaded" kernel module that all dns-320 users can
use, I need a box with dlink standard firmware :(

> Tell me step for step u need help with.

For a start, I need the

dmesg
uname -a
cat /proc/mtd
cat /proc/cpuinfo
gunzip -c /proc/config.gz # if it exists

commands output.
Latter on I would need a listing of relevant itens found in /sys/
class, if it exists.

Do you know what devices the box uses, such as rtc, fan, temperature,
gpio inputs and outputs?

If I found that Alt-F, as it is now, has any possibilities to run in
the 320, I can supply a kernel module to try reloading Alt-F. But,
most likely, devices will be different, and no fan/leds/buttons, etc
will be available.

Most likely (99.9% sure) a serial port will be needed, do you have
one?

This is only exploratory, as my current plans are to fix bugs and
release 0.1.

> I can also give u access to my DNS-320
> I do not have anything value on it yet.

Thanks. For now lets just evaluate the project feasibility.

> Dlink have release the source code for DNS-320 as well
> the kernel config is call DNS323D1

I have not examined it.
For current kernels, to add support for the 320 we have to write a
file with all box hardware details.
For the 323 it is arch/arm/mach-orion5x/dns323-setup.c in the kernel
source tree. Lots of details we don't know, and they might not be easy
to discover, even with dlink kernel source code (depends on how
heavily modified it is)

Magnus Olsen

unread,
Apr 26, 2011, 2:58:37 PM4/26/11
to al...@googlegroups.com
Hi

> So you have flashed the modified kernel?
Yes, my own build

> The modified kernel was a recompilation of the dlink published kernel
> source code?

Yes

>With what modifications?
I need it usb support for some usb hardware (3G USB modem, few other thing)

>Are they publicly available?
The kernel I did build with my changes no. But how I did it, yes I did
add my build script at http://wiki.dns323.info/dns-320

> Most likely (99.9% sure) a serial port will be needed, do you have
> one?

No

I have flash in no modify kernel now in dns320 version 1.0
Dlink orignal firmware.

Yes I want try out alt-f on my dnlink dns-320, and I do not care about
the fan and tempatrure now
under devloping of alt-f to dns-320

This is what I getting from standard dlink dns-320 firmware without
custom settings.

/ # dmesg
Linux version 2.6.22.18 (wyc@SWTEST3) (gcc version 4.2.1) #22 Mon Aug
30 19:09:34 CST 2010
CPU: ARM926EJ-S [56251311] revision 1 (ARMv5TE), cr=00053977
Machine: Feroceon-KW
Using UBoot passing parameters structure
Memory policy: ECC disabled, Data cache writeback
On node 0 totalpages: 32768
DMA zone: 256 pages used for memmap
DMA zone: 0 pages reserved
DMA zone: 32512 pages, LIFO batch:7
Normal zone: 0 pages used for memmap
CPU0: D VIVT write-back cache
CPU0: I cache: 16384 bytes, associativity 4, 32 byte lines, 128 sets
CPU0: D cache: 16384 bytes, associativity 4, 32 byte lines, 128 sets
Built 1 zonelists. Total pages: 32512
Kernel command line: root=/dev/ram console=ttyS0,115200 :::DB88FXX81:egiga0:none
PID hash table entries: 512 (order: 9, 2048 bytes)
Console: colour dummy device 80x30
Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
Memory: 128MB 0MB 0MB 0MB = 128MB total
Memory: 123776KB available (4028K code, 246K data, 124K init)
Calibrating delay loop... 796.26 BogoMIPS (lpj=3981312)
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
NET: Registered protocol family 16

CPU Interface
-------------
SDRAM_CS0 ....base 00000000, size 128MB
SDRAM_CS1 ....disable
SDRAM_CS2 ....disable
SDRAM_CS3 ....disable
PEX0_MEM ....base e8000000, size 128MB
PEX0_IO ....base f2000000, size 1MB
INTER_REGS ....base f1000000, size 1MB
NFLASH_CS ....base fa000000, size 2MB
SPI_CS ....base f4000000, size 16MB
BOOT_ROM_CS ....no such
DEV_BOOTCS ....no such
CRYPT_ENG ....base f0000000, size 2MB

Marvell Development Board (LSP Version KW_LSP_4.3.4_patch30)--
DB-88F6281A-BP Soc: 88F6281 A1 LE

Detected Tclk 166666667 and SysClk 200000000
MV Buttons Device Load
Marvell USB EHCI Host controller #0: c0fb3600
PEX0 interface detected no Link.
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
NET: Registered protocol family 2
Time: kw_clocksource clocksource has been installed.
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 4096 (order: 3, 32768 bytes)
TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
TCP: Hash tables configured (established 4096 bind 4096)
TCP reno registered
checking if image is initramfs...it isn't (no cpio magic); looks like an initrd
Freeing initrd memory: 1594K
cpufreq: Init kirkwood cpufreq driver
cpufreq: High frequency: 800000KHz - Low frequency: 200000KHz
cpufreq: Setting CPU Frequency to 800000 KHz
cpufreq: Setting PowerSaveState to off
XOR registered 1 NET_DMA over 4 channels
XOR 2nd invalidate WA enabled
cesadev_init(c00119d8)
mvCesaInit: sessions=640, queue=64, pSram=f0000000
Warning: TS unit is powered off.
MV Buttons Driver Load
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
squashfs: LZMA suppport for slax.org by jro
Installing knfsd (copyright (C) 1996 ok...@monad.swb.de).
JFFS2 version 2.2. (NAND) é 2001-2006 Red Hat, Inc.
SGI XFS with large block numbers, no debug enabled
io scheduler noop registered
io scheduler anticipatory registered (default)
Serial: 8250/16550 driver $Revision: 1.7 $ 4 ports, IRQ sharing disabled
serial8250.0: ttyS0 at MMIO 0xf1012000 (irq = 33) is a 16550A
serial8250.0: ttyS1 at MMIO 0xf1012100 (irq = 34) is a 16550A
RAMDISK driver initialized: 16 RAM disks of 10240K size 1024 blocksize
loop: module loaded
Loading Marvell Ethernet Driver:
o Cached descriptors in DRAM
o DRAM SW cache-coherency
o Single RX Queue support - ETH_DEF_RXQ=0
o Single TX Queue support - ETH_DEF_TXQ=0
o TCP segmentation offload enabled
o LRO support supported
o Receive checksum offload enabled
o Transmit checksum offload enabled
o Network Fast Processing (Routing) supported
o Driver ERROR statistics enabled
o Driver INFO statistics enabled
o Proc tool API enabled
o SKB Reuse supported
o SKB Recycle supported
o Rx descripors: q0=128
o Tx descripors: q0=532
o Loading network interface(s):
o register under egiga0 platform
o egiga0, ifindex = 1, GbE port = 0

Warning: Giga 1 is Powered Off

mvFpRuleDb (c7d5d000): 1024 entries, 4096 bytes
Integrated Sata device found
scsi0 : Marvell SCSI to SATA adapter
scsi1 : Marvell SCSI to SATA adapter
scsi 1:0:0:0: Direct-Access WDC WD15EADS-00P8B0 01.0 PQ: 0 ANSI: 5
scsi 1:0:0:0: Attached scsi generic sg0 type 0
NFTL driver: nftlcore.c $Revision: 1.1.1.1 $, nftlmount.c $Revision: 1.1.1.1 $
NAND device: Manufacturer ID: 0xec, Chip ID: 0xf1 (Samsung NAND 128MiB
3,3V 8-bit)
Scanning device for bad blocks
Using static partition definition
Creating 6 MTD partitions on "nand_mtd":
0x00000000-0x00100000 : "u-boot"
0x00100000-0x00600000 : "uImage"
0x00600000-0x00b00000 : "ramdisk"
0x00b00000-0x07100000 : "image"
0x07100000-0x07b00000 : "mini firmware"
0x07b00000-0x08000000 : "config"
ehci_marvell ehci_marvell.70059: Marvell Orion EHCI
ehci_marvell ehci_marvell.70059: new USB bus registered, assigned bus number 1
ehci_marvell ehci_marvell.70059: irq 19, io base 0xf1050100
ehci_marvell ehci_marvell.70059: 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
ohci_hcd: 2006 August 04 USB 1.1 'Open' Host Controller (OHCI) Driver
USB Universal Host Controller Interface driver v3.0
mice: PS/2 mouse device common for all mice
i2c /dev entries driver
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-d...@redhat.com
dm_crypt using the OCF package.
cpufreq: Setting CPU Frequency to 800000 KHz
cpufreq: Setting PowerSaveState to off
usb 1-1: new full speed USB device using ehci_marvell and address 2
usb 1-1: configuration #1 chosen from 1 choice
usbcore: registered new interface driver usbhid
drivers/hid/usbhid/hid-core.c: v2.6:USB HID core driver
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: 124K
sd 1:0:0:0: [sda] 2930277168 512-byte hardware sectors (1500302 MB)
sd 1:0:0:0: [sda] Write Protect is off
sd 1:0:0:0: [sda] Mode Sense: 23 00 10 00
sd 1:0:0:0: [sda] Write cache: enabled, read cache: enabled, supports
DPO and FUA
sd 1:0:0:0: [sda] 2930277168 512-byte hardware sectors (1500302 MB)
sd 1:0:0:0: [sda] Write Protect is off
sd 1:0:0:0: [sda] Mode Sense: 23 00 10 00
sd 1:0:0:0: [sda] Write cache: enabled, read cache: enabled, supports
DPO and FUA
sda: sda1 sda2 sda4
sd 1:0:0:0: [sda] Attached SCSI disk
usbcore: registered new interface driver usblp
drivers/usb/class/usblp.c: v0.13: USB Printer Device Class driver
egiga0: mac address changed
egiga0: link up, full duplex, speed 100 Mbps
egiga0: started
kjournald starting. Commit interval 5 seconds
EXT3 FS on sda4, internal journal
EXT3-fs: mounted filesystem with ordered data mode.
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
kjournald starting. Commit interval 5 seconds
EXT3 FS on sda2, internal journal
EXT3-fs: recovery complete.
EXT3-fs: mounted filesystem with ordered data mode.
md: md0 stopped.
md: bind<sda1>
raid1: raid set md0 active with 1 out of 2 mirrors
Adding 530040k swap on /dev/md0. Priority:-1 extents:1 across:530040k
NTFS driver 2.1.28 [Flags: R/O MODULE].
usbcore: deregistering interface driver usb-storage

/ # uname -a
Linux dlink-FFAFAB 2.6.22.18 #22 Mon Aug 30 19:09:34 CST 2010 armv5tejl unknown

/ # cat /proc/mtd
dev: size erasesize name
mtd0: 00100000 00020000 "u-boot"
mtd1: 00500000 00020000 "uImage"
mtd2: 00500000 00020000 "ramdisk"
mtd3: 06600000 00020000 "image"
mtd4: 00a00000 00020000 "mini firmware"
mtd5: 00500000 00020000 "config"

/ # cat /proc/cpuinfo
Processor : ARM926EJ-S rev 1 (v5l)
BogoMIPS : 796.26
Features : swp half thumb fastmult edsp
CPU implementer : 0x56
CPU architecture: 5TE
CPU variant : 0x2
CPU part : 0x131
CPU revision : 1
Cache type : write-back
Cache clean : cp15 c7 ops
Cache lockdown : format C
Cache format : Harvard
I size : 16384
I assoc : 4
I line length : 32
I sets : 128
D size : 16384
D assoc : 4
D line length : 32
D sets : 128

Hardware : Feroceon-KW
Revision : 0000
Serial : 0000000000000000

/ # gunzip -c /proc/config.gz
gunzip: /proc/config.gz: No such file or directory


2011/4/26 Joao Cardoso <whoami...@gmail.com>:

Joao Cardoso

unread,
Apr 27, 2011, 1:33:30 PM4/27/11
to Alt-F
Thanks for the info.

As is, Alt-F will not run on the 320/325, as they use a Kirkwood SoC
and NAND as a flash device, for which support is not compiled in.

Sometime in the future I can compile support for them, but without a
serial (RS232) port it is almost impossible to diagnose thinks when
booting fails.

Meanwhile I can build and make available a "reloaded" kernel module
for the 320 if you run 'modinfo' on one of its kernel modules and post
the output.

You can build Alt-F yourself, just follow the Wiki HoWToBuild
http://code.google.com/p/alt-f/w/list instructions; after succeeding
with the build, you can then add kirkwood and NAND support to the
kernel configuration (using the command 'make O=$BLDDIR linux26-
menuconfig') and rebuild. After that, study the fun_plug script and
with the help of the "reloaded" kernel module that I will provide you
can try to reload Alt-F blindly -- chances that it will fail are high.


Magnus Olsen

unread,
Apr 28, 2011, 5:05:54 AM4/28/11
to al...@googlegroups.com
Hi
modinfo did not exists in ffp so I did run it in chroot debian and
copy one of the kernel module
to the hd

root@dlink-FFAFAB:/# modinfo /mnt/HD/HD_a2/usblp.ko
filename: /mnt/HD/HD_a2/usblp.ko
license: GPL
description: USB Printer Device Class driver
author: Michael Gee, Pavel Machek, Vojtech Pavlik, Randy
Dunlap, Pete Zaitcev, David Paschal
alias: usb:v04B8p0202d*dc*dsc*dp*ic*isc*ip*
alias: usb:v*p*d*dc*dsc*dp*ic07isc01ip03*
alias: usb:v*p*d*dc*dsc*dp*ic07isc01ip02*
alias: usb:v*p*d*dc*dsc*dp*ic07isc01ip01*
alias: usb:v*p*d*dc07dsc01dp03ic*isc*ip*
alias: usb:v*p*d*dc07dsc01dp02ic*isc*ip*
alias: usb:v*p*d*dc07dsc01dp01ic*isc*ip*
depends:
vermagic: 2.6.22.18 mod_unload ARMv5
parm: proto_bias:Favourite protocol number (int)
root@dlink-FFAFAB:/#

I will build serial port cable for DNS-320, But I do not known when I
get time buying the part I need.

Next Issue is the build of alt-f did not run out of the box,
the mklibs 0.1.31 does not longer exists at debian ftp I did change
mkprepare.sh so it
did download it from
https://launchpad.net/ubuntu/+archive/primary/+files/mklibs_0.1.31.tar.gz

I am building the firmware on my dns-320 now inside chrooted debian.

I will let u known how it goes. can u tell me how to reload the alt-f
without flashing it ?
test se if it works without flashing it ?

2011/4/27 Joao Cardoso <whoami...@gmail.com>:

Magnus Olsen

unread,
Apr 28, 2011, 8:48:40 AM4/28/11
to al...@googlegroups.com
Hi I found this
http://packages.debian.org/en/squeeze/linux-image-2.6.32-5-kirkwood
it seam debian have a linux kernel for kirkwood

2011/4/28 Magnus Olsen <olsen....@gmail.com>:

Joao Cardoso

unread,
Apr 28, 2011, 11:04:24 AM4/28/11
to al...@googlegroups.com
On Thursday, April 28, 2011 10:05:54 Magnus Olsen wrote:
> Hi
> modinfo did not exists in ffp so I did run it in chroot debian and
> copy one of the kernel module
> to the hd
>
> root@dlink-FFAFAB:/# modinfo /mnt/HD/HD_a2/usblp.ko
> filename: /mnt/HD/HD_a2/usblp.ko
...
> vermagic: 2.6.22.18 mod_unload ARMv5

Attached is a reloaded-2.6.22.18.ko kernel module that should enable reloading
any kernels/initrd (not only Alt-F kernel/initramfs) for the dns-320/325.

To use it, it must be loaded using 'insmod', using the arguments given by
'modinfo'

# /sbin/modinfo reloaded/alt-f/reloaded-2.6.22.18.ko filename:
reloaded/alt-f/reloaded-2.6.22.18.ko
license: GPL


depends:
vermagic: 2.6.22.18 mod_unload ARMv5

parm: kernel:Kernel image file (string)
parm: initrd:initrd file (string)
parm: cmdline:Kernel command line (string)
parm: machtype:Machine type (see linux/arch/arm/tools/mach-types)
(int)


Alt-F fun_plug uses it at its end like this:

insmod reloaded-$KV.ko machtype=$machtype kernel=$kernel initrd=$initrd
cmdline=\"$cmdline\"

You have to research to find the correct machtype id.

The execution of the module loads the new kernel without any cleanup of the
currently running kernel, so most of the work done by fun_plug is to stop
running processes in order to free memory, unmount (or mount read-only) all
mounted filesystems.

So, if not using a serial-rs232 connection, you will be disconnected from the
box and will not see the kernel booting errors.

Don't use this with disks with valuable data on them!

> I will build serial port cable for DNS-320, But I do not known when I
> get time buying the part I need.
>
> Next Issue is the build of alt-f did not run out of the box,
> the mklibs 0.1.31 does not longer exists at debian ftp I did change
> mkprepare.sh so it
> did download it from
> https://launchpad.net/ubuntu/+archive/primary/+files/mklibs_0.1.31.tar.gz

Currently mklibs is not used at all, you can replace 0.1.31 by 0.1.32 or just
comment/remove the relevant building code.



> I am building the firmware on my dns-320 now inside chrooted debian.

You mean you don't have a linux box? It will be veeery slooow... better for
you to install a virtual machine on your OS and install a linux distro on it.

> I will let u known how it goes. can u tell me how to reload the alt-f
> without flashing it ?

See above, just 'insmod' the kernel module, no flashing is involved.

BTW, 2.6.22 has kexec support, which is much more reliable than "reloading".
To use kexec you need to compile kexec-tools for the target (dns-320) and
enable kexec support from the running kernel. Alt-F have kexec enabled and
kexec-tools built-in.

> test se if it works without flashing it ?

if you just execute 'insmod reloaded-2.6.22.18.lo' either you get an error,
and that is probably my fault building the module, or your box will freeze,
meaning that the modules was correctly loaded and executed (but without the
correct arguments it will fail)

> Hi I found this
> http://packages.debian.org/en/squeeze/linux-image-2.6.32-5-kirkwood
> it seam debian have a linux kernel for kirkwood

Debian has it all :)

But the kernel is highly modularized and does not runs from flash.

I believe that Dwight Hubbard had success reloading Debian directly (from
disk), take a look at posts from "dhub" at
http://forum.dsmg600.info/viewforum.php?id=3

reloaded-2.6.22.18.ko

Magnus Olsen

unread,
Apr 28, 2011, 5:09:09 PM4/28/11
to al...@googlegroups.com
I am building everthing on my vbox debian machine now. It did take too
long time.
I did hope it was finish when I did come home. I will post status
within few days.
it will take few day for testing. Btw I can compile in kexec support
for dlink that is no problem and flash in it.


2011/4/28 Joao Cardoso <whoami...@gmail.com>:

Antonıo

unread,
Jun 18, 2011, 11:39:56 AM6/18/11
to Alt-F
Hello,

I also I have a DNS320 and would like to reload a newer kernel. I
found this thread very interesting, but unfortunately it looks dead
now - let's try to revive it a bit ;-)

So this is what I did: to begin with, I tried to reload a 22.6.22.18
kernel compiled by me with basically the same configuration published
by DLink.

This is the command used to "reload":

# insmod reloaded-2.6.22.18.ko machtype=1680 kernel=zImage
initrd=ramdisk_el.gz

The system hanged instantly at the insmod command. I tried all
meaningful (at least to me) machine types, with the same result.
Eventually I decided to open the box and connect to the serial console
and collect the log below.

It seems that the reload module finds and loads both the zImage and
the ramdisk, but eventually it fails with a kernel panic.

Any ideas?

=============================================================================
reloaded for DNS-323, 2007 t...@fonz.de
zImage: 2145984 bytes
loaded 131072 of 2145984 bytes at c2800000 / 02800000
[...snip...]
loaded 48832 of 2145984 bytes at c2b80000 / 02b80000
zImage: OK (17 segments)
ramdisk_el.gz: 1626491 bytes
loaded 131072 of 1626491 bytes at c2ba0000 / 02ba0000
[...snip...]
loaded 53627 of 1626491 bytes at c26a0000 / 026a0000
ramdisk_el.gz: OK (13 segments)
dns323_machtype = 1680
CMDLINE: root=/dev/ram console=ttyS0,115200 :::DB88FXX81:egiga0:none
MEM: start 00000000 size 128MB
INITRD: start 00800000 size 1626491
dns323_taglist = 3fe5000 (c3fe5000)
copying 2160 bytes reboot code from bf00d00c to c3ff1000
dns323_reboot_start = 3ff1000
Reloading...
Unable to handle kernel paging request at virtual address 00052971
pgd = c3808000
[00052971] *pgd=03fa6031, *pte=00000000, *ppte=00000000
Internal error: Oops: 17 [#1]
Modules linked in: reloaded usblp sd_mod reg
CPU: 0 Not tainted (2.6.22.18 #22)
PC is at strnlen+0x20/0x34
LR is at vsnprintf+0x314/0x5c4
pc : [<c02dfd0c>] lr : [<c02e0fe0>] psr: a00000d3
sp : c3fa3d98 ip : c3fa3da8 fp : c3fa3da4
r10: 00000000 r9 : c04516ec r8 : ffffffff
r7 : c3fa3e14 r6 : c04512ec r5 : bf00d878 r4 : 00052971
r3 : c00cd192 r2 : 00052971 r1 : fffffffe r0 : 00052971
Flags: NzCv IRQs off FIQs off Mode SVC_32 Segment kernel
Control: 00052979 Table: 03808000 DAC: 00000017
Process insmod (pid: 4214, stack limit = 0xc3fa2268)
Stack: (0xc3fa3d98 to 0xc3fa4000)
3d80: c3fa3df4
c3fa3da8
3da0: c02e0fe0 c02dfcfc c7ea5000 00000004 c3fa3ddc c3fa3dc0 c0162f58
00000400
3dc0: c04512ec bf00e6e8 ffffff9c c04512c4 bf00d878 c3fe5000 00000004
fffffff2
3de0: 00000000 00052971 c3fa3e0c c3fa3df8 c0117ae0 c02e0cdc 00000004
c3fa3e14
3e00: c3fa3ef4 c3fa3e20 bf00e498 c0117ab8 bf00e6e7 00052971 fffffff2
c059f9a8
3e20: c38a8db8 08000000 007a285d 00000000 00800002 c33f81ed 00000001
00000000
3e40: 00000000 00000000 0018d17b 00000000 4dfcbb3d 00000000 4ded4e8a
00000000
3e60: 4ded4e8a 00000000 00001000 c0437870 00000c78 00000000 007a28ec
00000000
3e80: 00800002 c38a81ed 00000001 00000000 00000000 00000000 0020bec0
00000000
3ea0: 4dfcbb3d 00000000 4ded4ee2 00000000 4ded4ee2 00000000 00001000
c3ff1870
3ec0: 00000000 00000000 bf00fde0 c33fde14 c33fdc00 bf00fde0 c33fde48
0000001b
3ee0: 0000001b c8942000 c3fa3fa4 c3fa3ef8 c0136b44 bf011010 00000000
c5384580
3f00: c3fa3f24 00011008 00000000 00000000 00000000 00000000 00000000
00000000
3f20: 00000000 00000000 00000000 00000000 00000000 00000000 0000000c
c8945ab0
3f40: c2dd3b60 00000000 c8944ec0 c8944da8 00000000 00000084 00000084
c89449df
3f60: c8944f10 bf00fdec c8944ee8 00000019 00000000 00000000 beda9f0d
00000000
3f80: 00008000 beda9f0d 00000080 c002d708 c3fa2000 00000000 00000000
c3fa3fa8
3fa0: c002d560 c0135958 00000000 00008000 00011040 000040f6 00011008
00000001
3fc0: 00000000 00008000 beda9f0d 00000080 00011008 beda9f06 00011040
beda9ce4
3fe0: 00000003 beda9cac 00008980 400f3934 60000010 00011040 ffffffff
ffffffff
Backtrace:
[<c02dfcec>] (strnlen+0x0/0x34) from [<c02e0fe0>] (vsnprintf
+0x314/0x5c4)
[<c02e0ccc>] (vsnprintf+0x0/0x5c4) from [<c0117ae0>] (panic+0x3c/
0x118)
[<c0117aa4>] (panic+0x0/0x118) from [<bf00e498>] (load_file+0x7c/0x1bc
[reloaded])
r3:c059f9a8 r2:fffffff2 r1:00052971 r0:bf00e6e7
[<bf011000>] (reloaded_init+0x0/0x38c [reloaded]) from [<c0136b44>]
(sys_init_module+0x11fc/0x12)
[<c0135948>] (sys_init_module+0x0/0x12b4) from [<c002d560>]
(ret_fast_syscall+0x0/0x2c)
Code: ea000000 e2800001 e2511001 3a000002 (e5d03000)
Unable to handle kernel paging request at virtual address e59f3080
Unable to handle kernel paging request at virtual address e24cb00c
pgd = c3808000
[e24cb00c] *pgd=00000000
Internal error: Oops: 5 [#2]
Modules linked in: reloaded usblp sd_mod reg
CPU: 0 Not tainted (2.6.22.18 #22)
PC is at rb_next+0x30/0x64
LR is at __remove_hrtimer+0x28/0x40
pc : [<c02df2b0>] lr : [<c012d924>] psr: a0000093
sp : c3fa3870 ip : c3fa3880 fp : c3fa387c
r10: 4dfcc040 r9 : 00000000 r8 : 00000001
r7 : c04357f8 r6 : 00000002 r5 : c3a5df28 r4 : c04357f8
r3 : 01312d00 r2 : e24cb004 r1 : c04357f8 r0 : e24cb004
Flags: NzCv IRQs off FIQs on Mode SVC_32 Segment user
Control: 0005397f Table: 03808000 DAC: 00000015
Process insmod (pid: 4214, stack limit = 0xc3fa2268)
Stack: (0xc3fa3870 to 0xc3fa4000)
3860: c3fa389c c3fa3880 c012d924
c02df290
3880: c0589d60 c3a5df28 c04357f8 c04357f8 c3fa38d4 c3fa38a0 c012db90
c012d90c
38a0: c3fa38e4 c3fa38b0 c013139c c0455e40 c0455be8 0000000a 00000046
c04517ee
38c0: a0000013 c7e233f4 c3fa38fc c3fa38d8 c01204b4 c012da9c c3fa38f4
c3fa38e8
38e0: 00000011 c0455be8 0000000a 00000046 c3fa391c c3fa3900 c002cb50
c01204a8
3900: 00000001 c0435c50 00000000 00000046 c3fa392c c3fa3920 c002cae8
c002cb00
3920: c3fa394c c3fa3930 c0027048 c002cab0 ffffffff 0000001f 00000002
00000046
3940: c3fa3a04 c3fa3950 c002cfd0 c0027010 00003396 00003396 c04516f8
c04516f8
3960: ffffffff c3fa3b30 c3fa3a24 00000046 c04517ee a0000013 c7e233f4
c3fa3a04
3980: 00000001 c3fa3998 c01180c8 c01185bc 20000013 ffffffff c3fa39c4
c3fa39a8
39a0: c0345f14 c030e1ec c2c179d0 60000013 c7dd2180 00000001 c3fa39ec
c3fa39c8
39c0: c0455866 a00000d3 c0465094 00000060 c3fa3a04 c3fa39e0 c030a538
e59f3080
39e0: c3fa3b30 c4eec3e0 00000005 e59f3080 60000013 c7e233f4 c3fa3a1c
c3fa3a08
3a00: c0118610 c0118314 c3fa3a2c c3fa3a24 c3fa3a4c c3fa3a30 c00ecaf0
c01185fc
3a20: c00a0107 c00a00f8 e59f3080 c00a00f8 00000000 c0432238 00000005
c3fa3b30
3a40: c3fa3a64 c3fa3a50 c00ecd98 c00ecab0 c04517c4 c4eec3e0 c3fa3a7c
c3fa3a68
3a60: c00ece38 c00ecd44 ffffffff c0432238 c3fa3b2c c3fa3a80 c0027238
c00ecdcc
3a80: c0346bbc c03418a4 00000001 c0455c00 0000000a 08d0bf43 c0f96ba0
c0f7fbe0
3aa0: c012f254 c012ffb8 03b5e770 fffffffa c0fca580 c0450720 c3fa3adc
c3fa3ac8
3ac0: c013dd44 c013dbcc c0f96ba0 c0f7fc00 00000001 00000000 c3fa3afc
c3fa3ae8
3ae0: c017ef70 c013dcdc c0f96ba0 c0f99a34 c3fa3b0c c3fa3b00 c017ef90
c017ef34
3b00: beda9fff c380afb0 c3fa3b24 ffffffff c3fa3b64 c7cea040 e59f3040
1cda0a80
3b20: c3fa3bb4 c3fa3b30 c002cf8c c002720c 1e0b3780 00989663 00989680
c0435580
3b40: c0fca580 00000001 c7cea040 e59f3040 1cda0a80 00989663 c7e233f4
c3fa3bb4
3b60: c3fa3b78 c3fa3b78 c0032854 c0032854 20000013 ffffffff c3fa3ba4
c3fa3b88
3b80: c011c5c8 c011be24 4dfcc040 020d349d 00000000 c3fa3ba8 c3fa3bcc
c3fa3ba8
3ba0: c016eb04 c011c57c c3fa3c14 c3fa3bb8 c012f254 c012ffb8 002478fb
fffffffa
3bc0: 00000006 00000004 c3fa3bd0 c0114bbc 1ba8dd80 00989663 1c417400
00989663
3be0: c7e232e0 bf00f884 c3fa3be8 c3fa3be8 c3fa3c5c c3fa3c00 c012f254
c012ffb8
3c00: 001fde70 fffffffa 00000009 00000004 c3fa3c18 c0114bbc 1d72a100
00989663
3c20: 1e0b3780 00989663 c7e232e0 0018d17b c3fa3c30 c3fa3c30 c01150a4
c7e232e0
3c40: 00000000 c0457a38 c3fa3c7c c3fa3c58 c0120424 c0120168 c3fa3c7c
a0000013
3c60: c0120a84 00000000 00000100 000005dc c3fa3cc4 c3fa3c80 c031acbc
c0120398
3c80: c0432c90 00000000 00000000 c7dee800 00000000 c3fa3ca0 c013139c
c0455e40
3ca0: c0465094 00000020 c3fa3cd4 c3fa3cb8 c030cd2c c0309ed4 0000000c
c030cc98
3cc0: c0454ef3 c0465094 c3fa3cfc c3fa3cd8 c0307444 c030cca8 c0465094
0000000d
3ce0: c0454ef3 a0000093 c0465094 00000060 c3fa3d24 c3fa3d00 c030a538
c0309ed4
3d00: c044326c 00003343 00003350 00003350 60000093 60000013 c3fa3d44
c3fa3d28
3d20: c0117c18 c030a44c 00003350 c0434944 c0434944 00003350 c3fa3d5c
c3fa3d48
3d40: c0117cb0 c0117bcc 00003350 00003350 c3fa3d84 c3fa3d60 c01180c8
c0117eb8
3d60: c3ff1000 bf00d878 c3fa3e14 00000010 c04517b8 0018d17b c3fa3df4
c3fa3d88
3d80: c01185a8 c0117f04 0000d17b 000200d0 00000010 c04ede20 0000000d
bf00f884
3da0: c3fa3dc4 c0437ad0 00000000 c059f120 000000d0 c046d780 c0437ad0
00000000
3dc0: c3fa3e04 c3fa3dd0 c01576c8 c3ff1000 bf00d878 c3fe5000 c3fe5014
00000004
3de0: 00000000 0018d17b c3fa3e0c c3fa3df8 c0118610 c0118314 c3fa3e1c
c3fa3e14
3e00: c3fa3ef4 c3fa3e20 bf0112e4 c01185fc bf00e8de 00003340 c043497c
bf0112f8
3e20: c38a8db8 08000000 007a285d 00000000 00800002 c33f81ed 00000001
00000000
3e40: 00000000 00000000 0018d17b 00000000 4dfcbb3d 00000000 4ded4e8a
00000000
3e60: 4ded4e8a 00000000 00001000 c0437870 00000c78 00000000 007a28ec
00000000
3e80: 00800002 c38a81ed 00000001 00000000 00000000 00000000 0020bec0
00000000
3ea0: 4dfcbb3d 00000000 4ded4ee2 00000000 4ded4ee2 00000000 00001000
c3ff1870
3ec0: 00000000 00000000 bf00fde0 c33fde14 c33fdc00 bf00fde0 c33fde48
0000001b
3ee0: 0000001b c8942000 c3fa3fa4 c3fa3ef8 c0136b44 bf011010 00000000
c5384580
3f00: c3fa3f24 00011008 00000000 00000000 00000000 00000000 00000000
00000000
3f20: 00000000 00000000 00000000 00000000 00000000 00000000 0000000c
c8945ab0
3f40: c2dd3b60 00000000 c8944ec0 c8944da8 00000000 00000084 00000084
c89449df
3f60: c8944f10 bf00fdec c8944ee8 00000019 00000000 00000000 beda9f0d
00000000
3f80: 00008000 beda9f0d 00000080 c002d708 c3fa2000 00000000 00000000
c3fa3fa8
3fa0: c002d560 c0135958 00000000 00008000 00011040 000040f6 00011008
00000001
3fc0: 00000000 00008000 beda9f0d 00000080 00011008 beda9f06 00011040
beda9ce4
3fe0: 00000003 beda9cac 00008980 400f3934 60000010 00011040 ffffffff
ffffffff
Backtrace:
[<c02df280>] (rb_next+0x0/0x64) from [<c012d924>] (__remove_hrtimer
+0x28/0x40)
[<c012d8fc>] (__remove_hrtimer+0x0/0x40) from [<c012db90>]
(hrtimer_run_queues+0x104/0x1a8)
r7:c04357f8 r6:c04357f8 r5:c3a5df28 r4:c0589d60
[<c012da8c>] (hrtimer_run_queues+0x0/0x1a8) from [<c01204b4>]
(run_timer_softirq+0x1c/0x1e8)
[<c0120498>] (run_timer_softirq+0x0/0x1e8) from [<c002cb50>]
(__do_softirq+0x60/0xc8)
r7:00000046 r6:0000000a r5:c0455be8 r4:00000011
[<c002caf0>] (__do_softirq+0x0/0xc8) from [<c002cae8>] (irq_exit
+0x48/0x50)
r7:00000046 r6:00000000 r5:c0435c50 r4:00000001
[<c002caa0>] (irq_exit+0x0/0x50) from [<c0027048>]
(__exception_text_start+0x48/0x60)
[<c0027000>] (__exception_text_start+0x0/0x60) from [<c002cfd0>]
(__irq_svc+0x30/0x180)
Exception stack(0xc3fa3950 to 0xc3fa3998)
3940: 00003396 00003396 c04516f8
c04516f8
3960: ffffffff c3fa3b30 c3fa3a24 00000046 c04517ee a0000013 c7e233f4
c3fa3a04
3980: 00000001 c3fa3998 c01180c8 c01185bc 20000013
ffffffff
r7:00000046 r6:00000002 r5:0000001f r4:ffffffff
[<c0118304>] (vprintk+0x0/0x2e4) from [<c0118610>] (printk+0x28/0x30)
[<c01185e8>] (printk+0x0/0x30) from [<c00ecaf0>] (__do_kernel_fault
+0x50/0x7c)
r3:c00a00f8 r2:e59f3080 r1:c00a00f8 r0:c00a0107
[<c00ecaa0>] (__do_kernel_fault+0x0/0x7c) from [<c00ecd98>]
(do_bad_area+0x64/0x70)
r7:c3fa3b30 r6:00000005 r5:c0432238 r4:00000000
[<c00ecd34>] (do_bad_area+0x0/0x70) from [<c00ece38>]
(do_translation_fault+0x7c/0x88)
[<c00ecdbc>] (do_translation_fault+0x0/0x88) from [<c0027238>]
(do_DataAbort+0x3c/0xa0)
r5:c0432238 r4:ffffffff
[<c00271fc>] (do_DataAbort+0x0/0xa0) from [<c002cf8c>] (__dabt_svc
+0x4c/0x60)
Exception stack(0xc3fa3b30 to 0xc3fa3b78)
3b20: 1e0b3780 00989663 00989680
c0435580
3b40: c0fca580 00000001 c7cea040 e59f3040 1cda0a80 00989663 c7e233f4
c3fa3bb4
3b60: c3fa3b78 c3fa3b78 c0032854 c0032854 20000013
ffffffff
r8:1cda0a80 r7:e59f3040 r6:c7cea040 r5:c3fa3b64 r4:ffffffff
[<c012ffa8>] (clocksource_get_next+0x0/0x58) from [<c012f254>]
(update_wall_time+0x4ac/0x604)
[<c0114bac>] (task_running_tick+0x1e4/0x28c) from [<c3fa3c18>]
(0xc3fa3c18)
Backtrace aborted due to bad frame pointer <00000009>
Code: 089da800 e5920004 e3500000 0a000005 (e5902008)
Kernel panic - not syncing: Fatal exception in interrupt

Joao Cardoso

unread,
Jun 18, 2011, 2:28:45 PM6/18/11
to Alt-F


On Jun 18, 4:39 pm, Antonıo <antonio.schif...@gmail.com> wrote:
> Hello,
>
> I also I have a DNS320 and would like to reload a newer kernel. I
> found this thread very interesting, but unfortunately it looks dead
> now - let's try to revive it a bit ;-)
>
> So this is what I did: to begin with, I tried to reload a 22.6.22.18
> kernel compiled by me with basically the same configuration published
> by DLink.
>
> This is the command used to "reload":
>
> # insmod reloaded-2.6.22.18.ko machtype=1680 kernel=zImage
> initrd=ramdisk_el.gz
>
> The system hanged instantly at the insmod command. I tried all
> meaningful (at least to me) machine types, with the same result.
> Eventually I decided to open the box and connect to the serial console
> and collect the log below.
>
> It seems that the reload module finds and loads both the zImage and
> the ramdisk, but eventually it fails with a kernel panic.
>
> Any ideas?

Perhaps you should start building your own "reloaded" module, get the
original sources from

http://www.inreto.de/dns323/reloaded/dns323-reloaded-0.7.167/dns323-reloaded-0.7.167.tar.gz

The 2.6.22.18 module I posted is a patched version of these sources,
namely "don't use panic() on fail, load initrd at 0x600000".
Notice that the default value for the initrd is 0x800000, and that is
what appears in the log.
It was compiled from a vanilla 2.6.22.18 kernel tree, you could create
the module using DLink distributed kernel (not that I think that it
makes a difference)

Can you check if the DLink firmware kernel has kexec support
(CONFIG_KEXEC) builtin ? That would simplify things alot.

You can also try the DNS-320/325 Discussion on http://forum.dsmg600.info/index.php,
fonz, the "reloaded" author, might be listening there.

Obviously the error is: "Unable to handle kernel paging request at
virtual address 00052971", and might be caused by a different physical
memory layout, or some differences in the SoC, Orion vs Kirwood. The
core of the reload method is far ahead of my knowledge.

The initial loading of the zImage and ramdisk succeeds, but that is
pretty trivial, the problem arises in the reloading code itself, that
deals with the CPU and MMU

Please keep us informed of any progress.

Sorry

> =========================================================================== ==

Antonıo

unread,
Jun 18, 2011, 7:23:04 PM6/18/11
to Alt-F
Unfortunately the kernel does not have kexec support built in.
One possibility would be flashing a modified kernel with kexec
support; I built one with the DLink devel environment, but As the risk
of bricking the device is high, I would like to test the new kernel
before flashing it; however, for some reason I haven't been able to
interrupt the U-Boot boot sequence from the console.

BTW, I paste below the initial boot messages for reference (this is
from a DNS320 with firmware 2.0.).

====================================================================================

** MARVELL BOARD: DB-88F6281A-BP LE

U-Boot 1.1.4 (Jun 7 2010 - 10:33:37) Marvell version:
3.4.14.DNS320_02

U-Boot code: 00600000 -> 0067FFF0 BSS: -> 006CEE80

Soc: MV88F6281 Rev 3 (DDR2)
CPU running @ 800Mhz L2 running @ 400Mhz
SysClock = 200Mhz , TClock = 166Mhz

DRAM CAS Latency = 3 tRP = 3 tRAS = 8 tRCD=3
DRAM CS[0] base 0x00000000 size 128MB
DRAM Total size 128MB 16bit width
Flash: 0 kB
Addresses 8M - 0M are saved for the U-Boot usage.
Mem malloc Initialization (8M - 7M): Done
NAND:128 MB
*** Warning - bad CRC or NAND, using default environment


CPU : Marvell Feroceon (Rev 1)

Streaming disabled
Write allocate disabled


USB 0: host mode
PEX 0: interface detected no Link.
Net: egiga0 [PRIME]
Hit any key to stop autoboot: 0

NAND read: device 0 offset 0x100000, size 0x300000
load addr .... =a00000

3145728 bytes read: OK

NAND read: device 0 offset 0x600000, size 0x300000
load addr .... =f00000

3145728 bytes read: OK
## Booting image at 00a00000 ...
Image Name: Linux-2.6.22.18
Created: 2010-11-15 9:49:59 UTC
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 2196588 Bytes = 2.1 MB
Load Address: 00008000
Entry Point: 00008000
Verifying Checksum ... OK
OK
## Loading Ramdisk Image at 00f00000 ...
Image Name: Ramdisk
Created: 2010-12-06 7:00:10 UTC
Image Type: ARM Linux RAMDisk Image (gzip compressed)
Data Size: 1563868 Bytes = 1.5 MB
Load Address: 00e00000
Entry Point: 00e00000
Verifying Checksum ... OK

Starting kernel ...

Joao Cardoso

unread,
Jun 19, 2011, 5:23:39 PM6/19/11
to al...@googlegroups.com

On Sunday, June 19, 2011 00:23:04 Antonıo wrote:

> Unfortunately the kernel does not have kexec support built in.

> One possibility would be flashing a modified kernel with kexec

> support; I built one with the DLink devel environment, but As the risk

> of bricking the device is high, I would like to test the new kernel

> before flashing it; however, for some reason I haven't been able to

> interrupt the U-Boot boot sequence from the console.


Have you tried the dns323 procedure?

http://wiki.dns323.info/howto:uboot


Type the two keys SPACE and 1 before the monitor 3 second timeout.


Can you open a login sh using the serial console? In the dns323, it works by typing at the serial connection to get shell acess:


5784468


All this was discovered reading the DLink delivered/modified GPL sources (uboot and busybox)


I remember to read somewhere that not all DNS models enable uboot access, e.g., the dns323-revC1 hardware seems to not support it.

> BTW, I paste below the initial boot messages for reference (this is

> from a DNS320 with firmware 2.0.).


Can you put it in the 320 wiki? perhaps togetther with dmesg output? http://wiki.dns323.info/dns-320



Antonıo

unread,
Jun 19, 2011, 6:26:16 PM6/19/11
to Alt-F
> Have you tried the dns323 procedure?http://wiki.dns323.info/howto:uboot
>
> Type the two keys SPACE and 1 before the monitor 3 second timeout.

Thanks for the hint... Now yes and... it works!

> Can you open a login sh using the serial console? In the dns323, it works by
> typing at the serial connection to get shell acess:
>
>                 5784468

Yes, it is the same on the DNS320, as correctly suggested by the wiki.

> All this was discovered reading the DLink delivered/modified GPL sources
> (uboot and busybox)
>
> I remember to read somewhere that not all DNS models enable uboot access,
> e.g., the dns323-revC1 hardware seems to not support it.

It turns out that the DNS320 does give access to U-Boot and that the
version supplied is NOT a stripped down version as in the DNS323!
>
> > BTW, I paste below the initial boot messages for reference (this is
> > from a DNS320 with firmware 2.0.).
>
> Can you put it in the 320 wiki? perhaps togetther with dmesg output?  http://wiki.dns323.info/dns-320

Good idea, I will add some info to the wiki too. BRB!

Joao Cardoso

unread,
Jun 20, 2011, 11:09:19 AM6/20/11
to al...@googlegroups.com
On Sunday, June 19, 2011 23:26:16 Antonıo wrote:
> > Have you tried the dns323 procedure?http://wiki.dns323.info/howto:uboot
> >
> > Type the two keys SPACE and 1 before the monitor 3 second timeout.
>
> Thanks for the hint... Now yes and... it works!
>
> > Can you open a login sh using the serial console? In the dns323, it works
> > by typing at the serial connection to get shell acess:
> >
> > 5784468
>
> Yes, it is the same on the DNS320, as correctly suggested by the wiki.
>
> > All this was discovered reading the DLink delivered/modified GPL sources
> > (uboot and busybox)
> >
> > I remember to read somewhere that not all DNS models enable uboot access,
> > e.g., the dns323-revC1 hardware seems to not support it.
>
> It turns out that the DNS320 does give access to U-Boot and that the
> version supplied is NOT a stripped down version as in the DNS323!

Good it is working now. Can we expect a kexec enabled kernel?

Just to rule things out, do you mind to try the attached
reloaded-2.6.22.18.ko?
It is the result of compiling fonz's original dns323-reloaded-0.7.167, in
contrary to the previously posted one, which has some patches applied.

If it still does not works, then you could add in the wiki that fonz's
"reloaded" modules does not work in the box, saving other people time and
distress. (and if it works, saying people how to use it, mainly the mach id to
use)

reloaded-2.6.22.18.ko

Antonıo

unread,
Jun 20, 2011, 7:51:45 PM6/20/11
to Alt-F
>  reloaded-2.6.22.18.ko
> 21KViewDownload

Even with this new module, it hangs more or less in the same way.
Maybe because of wrong machine ID?
I tried 526, 859, 1680 and 2097 (sheevaplug). No way.

[...snip...]
Reloading...
Unable to handle kernel paging request at virtual address 00052971
pgd = c4180000
[00052971] *pgd=04791031, *pte=00000000, *ppte=00000000
Internal error: Oops: 17 [#1]
[...snip...]

The good news is that I succeeded in booting a self-compiled WITH
kexec support and booted it from my first (or second?) disk. As I said
before, the U-Boot compiled in has lot of features - including support
for ide, usb, ext2 and ethernet. So I copied the uImage to /dev/HD/
HD_b2 and changed the boot command to
'ide reset; ext2load ide 0:2 0xa00000 /uImage; nand read.e 0xf00000
0x600000 0x300000;bootm 0xa00000 0xf00000'

# dmesg
Linux version 2.6.22.18 (antonio@othello64) (gcc version 4.2.1) #22
Sun Jun 19 01:35:12 CEST 2011
CPU: ARM926EJ-S [56251311] revision 1 (ARMv5TE), cr=00053977
Machine: Feroceon-KW
Using UBoot passing parameters structure
...

Next step will be to kexec a newer kernel, or maybe try to boot it
directly from HD.

Antonıo

unread,
Jun 20, 2011, 8:01:01 PM6/20/11
to Alt-F
Of course, above I meant "I copied it to /mnt/HD/HD_b2".
For some obscure reason, the U-Boot only sees one disk at the "ide
reset" command and it is the second disk according to linux.
Also forgot to say that I issued a saveenv command and now the DNS320
always boots from disk.

Antonıo

unread,
Jul 18, 2011, 6:30:25 PM7/18/11
to Alt-F
Hi

After some days off, I am back to my DNS320 hacking.
The good news is that I just succeeded in compiling and booting a
working kernel (plain 2.6.39.3) from HD with the original U-Boot. Now
I have to prepare a good ramdisk for this kernel, but I think the most
difficult part is done. Will try this in the next days.

Joao Cardoso

unread,
Jul 19, 2011, 9:56:09 AM7/19/11
to al...@googlegroups.com
Good news!

What cross-toolchain have you used?

The kernel configuration was based on the kirkwood_defconfig one? Significative changes made? Can you post it?

You can only boot it from u-boot? Not from the command line?
Now that you have a working kernel you could try to compile "reloaded" as an external module? So that other people without a serial connection could use it.

And about leds and buttons? Do you have any info about them?

I have a 100€ donation, I'm considering if I would buy a dns-321 or raise more funds and buy a 320/325 instead. What people think that would be more useful?




Antonio Schifano

unread,
Jul 19, 2011, 7:35:09 PM7/19/11
to al...@googlegroups.com
On 19/07/11 15:56, Joao Cardoso wrote:
> Good news!
>
> What cross-toolchain have you used?
I have used the ubuntu/linaro toolchain; from dmesg:

Linux version 2.6.39.3 (antonio@othello64) (gcc version 4.5.2
(Ubuntu/Linaro 4.5.2-8ubuntu3) ) #4 Wed Jul 20 00:20:46 CEST 2011


> The kernel configuration was based on the kirkwood_defconfig one?
> Significative changes made? Can you post it?

I started from it, and configured extra options with a 'make
oldconfig'. Today I changed a few more options to include things that
were left out (like the rtc clock and the xor engine). I attach the
.config to this message.


>
> You can only boot it from u-boot? Not from the command line?

I haven't tried to 'reload' it. So far, I boot it from HD with uBoot,
by setting mainlineLinux=yes and arcNumber=1680.


> Now that you have a working kernel you could try to compile
> "reloaded" as an external module? So that other people without a
> serial connection could use it.

Will try. However, I am facing a rather annoying problem: the vanilla
kernel behaves like uBoot: it only recognises one of the disks. Both
sata interfaces are detected, but then it gives the following message:

ata2: SATA link down (SStatus 0 SControl F300)

> And about leds and buttons? Do you have any info about them?

Not (yet).
> I have a 100� donation, I'm considering if I would buy a dns-321 or

> raise more funds and buy a 320/325 instead. What people think that
> would be more useful?

I vote for a 320/325 (surprise!) :-)

.config-2.6.39.3

Michael Groh

unread,
Oct 19, 2011, 12:05:59 PM10/19/11
to al...@googlegroups.com
Hello Antonio Schifano,

a friend of mine just got a DNS-320, so i wanted to ask if you made
any progress with an alternative firmware for it :)

Thanks, and have a nice day,

Michael

2011/7/20 Antonio Schifano <antonio....@gmail.com>:


> On 19/07/11 15:56, Joao Cardoso wrote:
>>
>> Good news!
>>
>> What cross-toolchain have you used?
>
> I have used the ubuntu/linaro toolchain; from dmesg:
>
> Linux version 2.6.39.3 (antonio@othello64) (gcc version 4.5.2 (Ubuntu/Linaro
> 4.5.2-8ubuntu3) ) #4 Wed Jul 20 00:20:46 CEST 2011
>
>
>> The kernel configuration was based on the kirkwood_defconfig one?
>> Significative changes made? Can you post it?
>
> I started from it, and configured extra options with a 'make oldconfig'.
> Today I changed a few more options to include things that were left out
> (like the rtc clock and the xor engine). I attach the .config to this
> message.
>>
>> You can only boot it from u-boot? Not from the command line?
>
> I haven't tried to 'reload' it. So far, I boot it from HD with uBoot, by
> setting mainlineLinux=yes and arcNumber=1680.
>>
>> Now that you have a working kernel you could try to compile "reloaded" as
>> an external module? So that other people without a serial connection could
>> use it.
>
> Will try. However, I am facing a rather annoying problem: the vanilla kernel
> behaves like uBoot: it only recognises one of the disks. Both sata
> interfaces are detected, but then it gives the following message:
>
> ata2: SATA link down (SStatus 0 SControl F300)
>
>> And about leds and buttons? Do you have any info about them?
>
> Not (yet).
>>

>> I have a 100€ donation, I'm considering if I would buy a dns-321 or raise


>> more funds and buy a 320/325 instead. What people think that would be more
>> useful?
>
> I vote for a 320/325 (surprise!) :-)
>

Magnus Olsen

unread,
Nov 21, 2011, 4:52:04 AM11/21/11
to al...@googlegroups.com
I got lite time over and working on DNS320 again.

Here is my plan
1. Figout the firmware header and how it is made by merge (DONE)
2. Compare Linux kernel source code againts DNS320 kernel code (in progress)
3. Create patch for offical linux kernel againts dlink 320 kernel code (todo)
4. Try load new kernel in dlink320 (todo)
5. Release the patch if anyone have been created.

Here is my program for extract, show contain, merge firmware,
we do not need to use dlink own merge program for dns320 any longer,
I have not tested -m option yet it should work.
all other option haven been tested by me.
-x
-cmp
-mf
-s

#include <stdio.h>
#include <stdlib.h>

#define UINT32 unsigned int
#define BYTE unsigned char
#define ALGIN4(_x) (_x + (4 - (_x % 4)))
typedef struct {
/* 0x00 - 0x03 */ UINT32 uImageOffset;
/* 0x04 - 0x07 */ UINT32 uImageLenght;
/* 0x08 - 0x0B */ UINT32 uRamDiskOffset;
/* 0x0C - 0x0F */ UINT32 uRamDiskLenght;
/* 0x10 - 0x13 */ UINT32 ImageOffset;
/* 0x14 - 0x17 */ UINT32 ImageLenght;
/* 0x18 - 0x1B */ UINT32 DefaultOffset;
/* 0x1C - 0x1F */ UINT32 DefaultLenght;
/* 0x20 - 0x23 */ UINT32 uImageChecksum;
/* 0x24 - 0x27 */ UINT32 uRamDiskChecksum;
/* 0x28 - 0x2B */ UINT32 ImageChecksum;
/* 0x2C - 0x2F */ UINT32 DefaultChecksum;
/* 0x30 - 0x30 */ BYTE magic_0; // always set 0x55 same as DNS-323
/* 0x31 - 0x31 */ BYTE magic_1; // always set 0xAA same as DNS-323
/* 0x32 - 0x3A */ BYTE strModelName[9]; // always contain string
DNS323D1U with no terminateor \0 same as DNS-323
/* 0x3B - 0x3B */ BYTE magic_2; // always set 0xAA same as DNS-323
/* 0x3C - 0x3C */ BYTE productId; // always set 0x00 same as DNS-323
/* 0x3D - 0x3D */ BYTE customId; // always set 0x08
/* 0x3E - 0x3E */ BYTE modelId; // always set 0x07
/* 0x3F - 0x3F */ BYTE hardwareId; // always set 0x01
/* 0x40 - 0x40 */ BYTE subId; // always set 0x00
/* 0x41 - 0x7B */ BYTE Reseverd[59]; // not in use
/* 0x7C - 0x7F */ UINT32 NextOffset; // next offset;
} DLINK_DNS320_FIRMWARE_HEAD_128BYTE;

void showFirmware(char *flashfilename, int extract_frimware, char
*kernelfilename, char *ramdiskfilename, char *imagefilename, char *
configfilename );
int pack_firmware(char *flashfilename, char *kernelfilename, char
*ramdiskfilename, char *imagefilename, char * configfilename );

void firmware_unpack_extract(char *inFileName, char *outFileName,
UINT32 inFileOffset, UINT32 dataLenght);
UINT32 firmware_calc_checksum(char *inFileName);
int calc_checksum(char *filename);
int check_size(char *filename, UINT32 *file_size, UINT32 max_size);
char * strtolower(const char *ret);
int compare(char *filename1, char *filename2);


char *strtolower(const char *ret)
{
char *s = ret;
for ( s = ret;*s != 0; s++)
{
if (*s != 0)
{ *s = tolower(*s); }
}
return ret;
}

int main(int argc, char **argv)
{
int showHelp = 1;

if (argc == 3)
{
strtolower(argv[1]);
if ( strcmp("-s",argv[1]) == 0)
{ showFirmware(argv[2], 0, "", "", "", "" ); showHelp--; }

if ( strcmp("-x",argv[1]) == 0)
{ showFirmware(argv[2], 1, "uImage", "uRamDisk", "image.cfs",
"default.tar.gz" ); showHelp--; }

if ( strcmp("-mf",argv[1]) == 0)
{ pack_firmware(argv[2],"uImage", "uRamDisk", "image.cfs",
"default.tar.gz"); showHelp--; }

}

if (argc == 4)
{
strtolower(argv[1]);
if ( strcmp("-cmp",argv[1]) == 0)
{ compare(argv[2], argv[3]); showHelp--; }
}

if (argc == 8)
{
strtolower(argv[1]);
if ( strcmp("-m",argv[1]) == 0)
{
strtolower(argv[6]);
if ( strcmp("-f",argv[6]) == 0)
{ pack_firmware(argv[7],argv[2], argv[3], argv[4],
argv[5]); showHelp--; }
}

if ( strcmp("-x",argv[1]) == 0)
{
strtolower(argv[3]);
if ( strcmp("-o",argv[3]) == 0)
{ showFirmware(argv[2], 1, argv[4], argv[5], argv[6],
argv[7] ); showHelp--; }
}
}

if (showHelp)
{
printf("Copyright 2011 by Magnus Olsen (mag...@greatlord.com)\n");
printf("This program are under licen GPL 2.0\n\n");
printf("Merge kernel (uImage) + ramdisk (uRamDisk) + image
(image.cfs) and\nconfig (default.tar.gz) to a flash image for dlink
DNS320\n\n");
printf("dns320flash -m kernel ramdisk image config -f
dlink320firmware\n\n\n");
printf("dns320flash -mf dlink320firmware dlink320firmware\n\n\n");
printf("Extract flash image to kernel (uImage) + ramdisk
(uRamDisk) + \nimage (image.cfs) and config (default.tar.gz) for dlink
DNS320\n\n");
printf("dns320flash -x dlink320firmware -o kernel ramdisk
image config\n");
printf("dns320flash -x dlink320firmware \n\n\n");
printf("Show flash image contains for dlink DNS320\n\n");
printf("dns320flash -s dlink320firmware\n\n\n");
}

return 0;
}

void showFirmware(char *flashfilename, int extract_frimware, char
*kernelfilename, char *ramdiskfilename, char *imagefilename, char *
configfilename )
{
int read_byte;
FILE *fp;
char str[10];
DLINK_DNS320_FIRMWARE_HEAD_128BYTE dnsHeader;


fp = fopen(flashfilename,"rb");
if (fp)
{
memset( &dnsHeader,0,sizeof(DLINK_DNS320_FIRMWARE_HEAD_128BYTE));
read_byte = fread(&dnsHeader, 1,
sizeof(DLINK_DNS320_FIRMWARE_HEAD_128BYTE),fp);
fclose(fp);

if (read_byte != sizeof(DLINK_DNS320_FIRMWARE_HEAD_128BYTE))
{
printf("not vaild firmware for DNS320");
exit(0);
}

memcpy(&str,dnsHeader.strModelName,9);
str[9] = 0;

if ( (dnsHeader.magic_0 != 0x55) ||
(dnsHeader.magic_1 != 0xAA) ||
(dnsHeader.magic_2 != 0xAA) ||
(dnsHeader.productId != 0x00) ||
(dnsHeader.customId != 0x08) ||
(dnsHeader.modelId != 0x07) ||
(dnsHeader.hardwareId != 0x01) ||
(dnsHeader.subId != 0x00) ||
(strcmp(str,"DNS323D1U") != 0) )
{
printf("not vaild firmware for DNS320");
exit(0);
}

printf("magic_0 : %02x\n",dnsHeader.magic_0);
printf("magic_1 : %02x\n",dnsHeader.magic_1);
printf("string : %s\n",str);
printf("magic_2 : %02x\n",dnsHeader.magic_2);
printf("productId : %02x\n",dnsHeader.productId);
printf("customId : %02x\n",dnsHeader.customId);
printf("modelId : %02x\n",dnsHeader.modelId);
printf("hardwareId : %02x\n",dnsHeader.hardwareId);
printf("subId : %02x\n",dnsHeader.subId);
printf("Next_offset : %08x\n\n",dnsHeader.NextOffset);

printf("Kernel (uImage) Offset head : %08x\n",dnsHeader.uImageOffset);
printf("Kernel (uImage) Lenght head : %08x\n",dnsHeader.uImageLenght);
printf("Kernel (uImage) Checksum head :
%08x\n",dnsHeader.uImageChecksum);


if (extract_frimware)
{
firmware_unpack_extract(flashfilename, kernelfilename,
dnsHeader.uImageOffset, dnsHeader.uImageLenght);
printf("Kernel (uImage) Checksum file :
%08x\n\n",calc_checksum(kernelfilename));
}
else
{ printf("\n"); }

printf("uRamDisk Offset head :
%08x\n",dnsHeader.uRamDiskOffset);
printf("uRamDisk Lenght head :
%08x\n",dnsHeader.uRamDiskLenght);
printf("uRamDisk Checksum head :
%08x\n",dnsHeader.uRamDiskChecksum);
if (extract_frimware)
{

firmware_unpack_extract(flashfilename, ramdiskfilename,
dnsHeader.uRamDiskOffset, dnsHeader.uRamDiskLenght);
printf("uRamDisk Checksum file :
%08x\n\n",calc_checksum(ramdiskfilename));
}
else
{ printf("\n"); }


printf("image Offset head : %08x\n",dnsHeader.ImageOffset);
printf("image Lenght head : %08x\n",dnsHeader.ImageLenght);
printf("image Checksum head :
%08x\n",dnsHeader.ImageChecksum);

if (extract_frimware)
{
firmware_unpack_extract(flashfilename, imagefilename,
dnsHeader.ImageOffset, dnsHeader.ImageLenght);
printf("image Checksum file :
%08x\n\n",calc_checksum(imagefilename));
}
else
{ printf("\n"); }

printf("Default Offset head :
%08x\n",dnsHeader.DefaultOffset);
printf("Default Lenght head :
%08x\n",dnsHeader.DefaultLenght);
printf("Default Checksum head :
%08x\n",dnsHeader.DefaultChecksum);


if (extract_frimware)
{
firmware_unpack_extract(flashfilename, configfilename,
dnsHeader.DefaultOffset, dnsHeader.DefaultLenght);
printf("Default Checksum file :
%08x\n\n",calc_checksum(configfilename));
}
else
{ printf("\n"); }


}

}

void firmware_unpack_extract(char *inFileName, char *outFileName,
UINT32 inFileOffset, UINT32 dataLenght)
{
FILE *read_fp;
FILE *save_fp;
BYTE *ch;
UINT32 lenght = 0;
printf("Extracting %s from %s\n",outFileName, inFileName);
read_fp = fopen(inFileName,"rb");
if (read_fp)
{
fseek(read_fp,inFileOffset, SEEK_SET);
save_fp = fopen(outFileName,"wb+");
if (save_fp)
{
while(lenght<dataLenght)
{
fread(&ch,1,1,read_fp);
fwrite(&ch,1,1,save_fp);
lenght++;
}
printf("writing done\n");
fclose(save_fp);
}
fclose(read_fp);
}
}

int pack_firmware(char *flashfilename, char *kernelfilename, char
*ramdiskfilename, char *imagefilename, char * configfilename )
{
FILE *fp_read;
FILE *fp_save;
int i, kernelSize,ramdiskSize, imageSize, configSize;
UINT32 byte;
DLINK_DNS320_FIRMWARE_HEAD_128BYTE dnsHeader;

memset(&dnsHeader,0,sizeof(DLINK_DNS320_FIRMWARE_HEAD_128BYTE));


if ( check_size(kernelfilename, &dnsHeader.uImageLenght,
0x00300000) == -1)
{ return -1; }

if ( check_size(ramdiskfilename, &dnsHeader.uRamDiskLenght,
0x00300000) == -1)
{ return -1; }

if ( check_size(configfilename, &dnsHeader.DefaultLenght,
0x00300000) == -1)
{ return -1; }

if ( check_size(imagefilename, &dnsHeader.ImageLenght,
0x04000000) == -1)
{ return -1; }

// Setup header id
dnsHeader.magic_0 = 0x55;
dnsHeader.magic_1 = 0xAA;
dnsHeader.magic_2 = 0xAA;
dnsHeader.productId = 0x00;
dnsHeader.customId = 0x08;
dnsHeader.modelId = 0x07;
dnsHeader.hardwareId = 0x01;
dnsHeader.subId = 0x00;
memcpy(dnsHeader.strModelName,"DNS323D1U",9);

// Setup header checksum
dnsHeader.uImageChecksum = calc_checksum(kernelfilename);
dnsHeader.uRamDiskChecksum = calc_checksum(ramdiskfilename);
dnsHeader.DefaultChecksum = calc_checksum(configfilename);
dnsHeader.ImageChecksum = calc_checksum(imagefilename);

// Fix Algin issue for header
kernelSize = dnsHeader.uImageLenght;
ramdiskSize = dnsHeader.uRamDiskLenght;
imageSize = dnsHeader.ImageLenght;
configSize = dnsHeader.DefaultLenght;

if ((dnsHeader.uImageLenght % 4) != 0)
{ dnsHeader.uImageLenght = ALGIN4(dnsHeader.uImageLenght); }

if ((dnsHeader.uRamDiskLenght % 4) != 0)
{ dnsHeader.uRamDiskLenght = ALGIN4(dnsHeader.uRamDiskLenght); }

if ((dnsHeader.ImageLenght % 4) != 0)
{ dnsHeader.ImageLenght = ALGIN4(dnsHeader.ImageLenght); }

if ((dnsHeader.DefaultLenght % 4) != 0)
{ dnsHeader.DefaultLenght = ALGIN4(dnsHeader.DefaultLenght); }

// Setup header Offset
dnsHeader.uImageOffset = sizeof(DLINK_DNS320_FIRMWARE_HEAD_128BYTE);
dnsHeader.uRamDiskOffset =
sizeof(DLINK_DNS320_FIRMWARE_HEAD_128BYTE) + dnsHeader.uImageLenght;
dnsHeader.ImageOffset = sizeof(DLINK_DNS320_FIRMWARE_HEAD_128BYTE)
+ dnsHeader.uImageLenght + dnsHeader.uRamDiskLenght ;

dnsHeader.DefaultOffset =
sizeof(DLINK_DNS320_FIRMWARE_HEAD_128BYTE) + dnsHeader.uImageLenght +
dnsHeader.uRamDiskLenght + dnsHeader.ImageLenght ;
// print out info
printf("Kernel (uImage) Offset : %08x\n",dnsHeader.uImageOffset);
printf("Kernel (uImage) Lenght : %08x\n",dnsHeader.uImageLenght);
printf("Kernel (uImage) Checksum : %08x\n\n",dnsHeader.uImageChecksum);
printf("uRamDisk Offset : %08x\n",dnsHeader.uRamDiskOffset);
printf("uRamDisk Lenght : %08x\n",dnsHeader.uRamDiskLenght);
printf("uRamDisk Checksum : %08x\n\n",dnsHeader.uRamDiskChecksum);
printf("image Offset : %08x\n",dnsHeader.ImageOffset);
printf("image Lenght : %08x\n",dnsHeader.ImageLenght);
printf("image Checksum : %08x\n\n",dnsHeader.ImageChecksum);
printf("Default Offset : %08x\n",dnsHeader.DefaultOffset);
printf("Default Lenght : %08x\n",dnsHeader.DefaultLenght);
printf("Default Checksum : %08x\n\n",dnsHeader.DefaultChecksum);

if ( (fp_save = fopen(flashfilename,"wb+")) == 0)
{
printf("Error : Can not merge firmware\n");
return -1;
}

fwrite(&dnsHeader,1,sizeof(DLINK_DNS320_FIRMWARE_HEAD_128BYTE),fp_save);

if ( (fp_read = fopen(kernelfilename,"rb")) == 0)
{
printf("Error : Can not merge firmware\n");
return -1;
}
for(i=0;i<dnsHeader.uImageLenght/4;i++)
{
fread(&byte,1,4,fp_read);
fwrite(&byte,1,4,fp_save);
}
fclose(fp_read);

if ( (fp_read = fopen(ramdiskfilename,"rb")) == 0)
{
printf("Error : Can not merge firmware\n");
return -1;
}
for(i=0;i<dnsHeader.uRamDiskLenght/4;i++)
{
fread(&byte,1,4,fp_read);
fwrite(&byte,1,4,fp_save);
}
fclose(fp_read);

if ( (fp_read = fopen(imagefilename,"rb")) == 0)
{
printf("Error : Can not merge firmware\n");
return -1;
}
for(i=0;i<dnsHeader.ImageLenght/4;i++)
{
fread(&byte,1,4,fp_read);
fwrite(&byte,1,4,fp_save);
}

fclose(fp_read);

if ( (fp_read = fopen(configfilename,"rb")) == 0)
{
printf("Error : Can not merge firmware\n");
return -1;
}

for(i=0;i<dnsHeader.DefaultLenght/4;i++)
{
fread(&byte,1,4,fp_read);
fwrite(&byte,1,4,fp_save);
}
fclose(fp_read);


fclose(fp_save);

return 0;
}


int check_size(char *filename, UINT32 *file_size, UINT32 max_size)
{
FILE *fp_read;

if ((fp_read = fopen(filename,"rb")) )
{
fseek(fp_read,0,SEEK_END);
*file_size = ftell(fp_read);
if ( *file_size >= max_size )
{
printf("\nMake firmware error\n");
printf("Ramdisk sizes can not more than %d byte",max_size);
return -1;
}
fclose(fp_read);
}
else
{
printf("Can not open file uImage\n");
}
return 0;
}


int calc_checksum(char *filename)
{
FILE *fp_read;
UINT32 chk_sum = 0;
int byte,size,filesize;

if (!(fp_read = fopen(filename,"rb")))
{
printf("Error: Can't open %s file !\n", filename);
return 0;
}

fseek(fp_read, 0, SEEK_END);
filesize = ftell(fp_read);
fseek(fp_read, 0, SEEK_SET);

for(size=0;size<filesize;size+=4)
{
byte = 0;
fread(&byte, 1, 4, fp_read);
chk_sum ^= byte;
}

fclose(fp_read);
return chk_sum;
}

int compare(char *filename1, char *filename2)
{
FILE *fp_read1;
FILE *fp_read2;
int file1_size;
int file2_size;
int i;

if ((fp_read1 = fopen(filename1,"rb")) == 0)
{ printf("Error : Can not open file %s\n",filename1); return -1; }

if ((fp_read2 = fopen(filename2,"rb")) == 0)
{ printf("Error : Can not open file %s\n",filename2);
fclose(fp_read1); return -1; }

fseek(fp_read1,0,SEEK_END);
fseek(fp_read2,0,SEEK_END);

file1_size = ftell(fp_read1);
file2_size = ftell(fp_read2);

fseek(fp_read1,0,SEEK_SET);
fseek(fp_read2,0,SEEK_SET);

if (file1_size != file2_size)
{
printf("Error : File %s and file %s does not have same
filesize\n",filename1,filename2);
fclose(fp_read1);
fclose(fp_read2);
return -1;
}

for (i=0;i<file1_size;i++)
{
if ( fgetc(fp_read1) != fgetc(fp_read2) )
{
printf("Error : Byte are not same\n");
printf("FileOffset : %08lx\n",ftell(fp_read1));
fclose(fp_read1);
fclose(fp_read2);
return -1;
}

}
fclose(fp_read1);
fclose(fp_read2);
return 0;
}

2011/10/19 Michael Groh <schnitz...@gmail.com>:

Joao Cardoso

unread,
Nov 25, 2011, 2:49:26 PM11/25/11
to al...@googlegroups.com


On Monday, November 21, 2011 9:52:04 AM UTC, GreatLord wrote:
I got lite time over and working on DNS320 again.

Here is my plan
1. Figout the firmware header and how it is made by merge (DONE)
2. Compare Linux kernel source code againts DNS320 kernel code (in progress)
3. Create patch for offical linux kernel againts dlink 320 kernel code (todo)


You migh be interested in the "[PATCH] mach-kirkwood: Add support for D-Link DNS-325" posted 14/10/2011 on the linux.ports.arm.kernel newsgroup.
It is for the DNS-325, but it looks like the hardware is the same (apart from CPU speed and RAM amount).

Antonio Schifano

unread,
Nov 26, 2011, 11:20:09 AM11/26/11
to al...@googlegroups.com
Wow, thanks for the pointer! Indeed it seems to work on my DNS320
(patched kernel 3.1.2).


Antonıo

unread,
Nov 26, 2011, 7:37:50 PM11/26/11
to al...@googlegroups.com
Here there is also an updated version of the patch that adds support for reset button and power recovery. 

http://article.gmane.org/gmane.linux.ports.arm.kernel/137460/match=dns325

Antonıo

unread,
Nov 29, 2011, 1:11:08 PM11/29/11
to Alt-F
Hi Michael,

No big progress till a couple of days ago, when Joao sent the link to
the new kernel patch for the DNS-325 that works also on the 320.
There is still an issue with the temperature sensor to be solved
though.

Sorry for the late reply, I realized only now about your message.

Best regards,
Antonio

On 19 Ott, 18:05, Michael Groh <schnitzelkuc...@gmail.com> wrote:
> Hello Antonio Schifano,
>
> a friend of mine just got a DNS-320, so i wanted to ask if you made
> any progress with an alternative firmware for it :)
>
> Thanks, and have a nice day,
>
> Michael
>

> 2011/7/20 Antonio Schifano <antonio.schif...@gmail.com>:

cunnilinux

unread,
Aug 27, 2012, 3:21:42 PM8/27/12
to al...@googlegroups.com
for those who might be interested.

DNS-320/325 are supported in current mainline kernels (3.5.x).

(System type --> Marvell Kirkwood implementations --> D-Link Kirkwood-based NAS (flattened device tree).

i.e. no more patching.
everything works, including LEDs, temperature sensor, etc.

to utilize the advantage of hardware crypto engine, one should additionally use cryptodev-linux module 
( http://home.gna.org/cryptodev-linux/ )
(at least, this is the only solution working for me).

currently i run arch linux on my DNS-325 natively.

p.s. btw, DNS-323 also supported (system type is Orion, so it can be found in Orion implementations).

Magnus Olsen

unread,
Aug 28, 2012, 3:00:01 AM8/28/12
to al...@googlegroups.com

Can u write instal guide how u did instal arch for 320

--
You received this message because you are subscribed to the Google Groups "Alt-F" group.
To post to this group, send email to al...@googlegroups.com.
To unsubscribe from this group, send email to alt-f+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/alt-f/-/JY8oNv7i3CkJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

cunnilinux

unread,
Aug 28, 2012, 12:25:21 PM8/28/12
to al...@googlegroups.com


Вівторок, 28 серпня 2012 р. 10:00:03 UTC+3 користувач GreatLord написав:

Can u write instal guide how u did instal arch for 320

well, here is a brief one.
in general, the procedure is the same as for debian that is described here:

you must obtain serial console access (i used Nokia DKU-5 option described here:
but YMMV)
(this step requires soldering and will void your warranty).

then, you must build a kernel for DNS-320/325.
note that linux-kirkwood kernel from archlinuxarm does not have DNS-320/325 support enabled, so it’s pointless to try it.

and finally, you have to prepare an arch partition on SATA HDD or some kind of USB storage. it should contain latest arch linux filesystem for ARMv5TE downloaded from here:

then boot your kernel passing a correct root partition to it, and you’re in business.
to boot arch permanently, you have to flash your kernel as described in debian guide.
other necessary post-install preparations for handling buttons and controlling temperature/fan are also described there.

p.s. if you need a bare kernel config to start with, i can put mine somewhere.

Magnus Olsen

unread,
Aug 28, 2012, 6:46:07 PM8/28/12
to al...@googlegroups.com
Hi
If u can provide a base config for that kernel is good for me.
I can later make it to a flash firmware with arch later.
I am building my own flash image for DNS-320 from scrach.


2012/8/28 cunnilinux <cunni...@gmail.com>

--
You received this message because you are subscribed to the Google Groups "Alt-F" group.
To post to this group, send email to al...@googlegroups.com.
To unsubscribe from this group, send email to alt-f+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/alt-f/-/APQhN37jGzoJ.

Gabriel Nicolae

unread,
Sep 13, 2012, 8:25:45 AM9/13/12
to al...@googlegroups.com
please somebody can help me compile the damn thing...

compiling kernel 2.6.22.18 - gcc version 4.2.1

drivers/ata/built-in.o: In function `swap_buf_le16':
sata_mv.csad.text.swap_buf_le16+0x0): multiple definition of `swap_buf_le16'
drivers/scsi/built-in.o:sg.csad.text.swap_buf_le16+0x0): first defined here
make[1]: *** [drivers/built-in.o] Error 1
make: *** [drivers] Error 2


Also the kernel 3.5.3 without any patch fails to boot - using gcc version 4.4.5 (Debian 4.4.5-8)


Marvell_DNS320>> bootm
## Booting image at 02000000 ...
   Image Name:   Linux-3.5.3
   Created:      2012-09-11  10:30:40 UTC

   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2142408 Bytes =  2 MB

   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.

Error: unrecognized/unsupported machine ID (r1 = 0x0000020f).

Available machine support:

ID (hex)        NAME
ffffffff        Marvell Kirkwood (Flattened Device Tree)

Please check your kernel config and/or bootloader.
-----------------
on this page : http://jamie.lentin.co.uk/devices/dlink-dns325/
it says :
# For DNS-320...
setenv arcNumber 3985
setenv mainlineLinux yes



somhow i got 3.5.2 boot working with patch but it stops...

i2c /dev entries driver
gpio-fan gpio-fan: GPIO fan initialized
cpuidle: using governor ladder
cpuidle: using governor menu
oprofile: hardware counters not available
oprofile: using timer interrupt.
TCP: cubic registered
NET: Registered protocol family 17
lib80211: common routines for IEEE802.11 drivers
Key type dns_resolver registered
VFP support v0.3: not present
input: gpio-keys as /devices/platform/gpio-keys/input/input0


Thanks !
Reply all
Reply to author
Forward
0 new messages