compiling kernel for D-Link DNS-325

This forum is for Marvell Kirkwood devices such as the GoFlex Home/Net, PogoPlug v1/v2, SheevaPlug, and ZyXEL devices.

compiling kernel for D-Link DNS-325

Postby tingyc » Sat Sep 22, 2012 1:08 pm

Hi All:

I had D-Link DNS-325 which is very similar to ZyXEL NSA320, and could boot to the latest ArchLinuxARM-armv5te rootfs by reference the installl process of NSA320 of this site. Thanks a lot! It's really a great help to me.

I then want to compile the kernel 3.1.10 (which is used in latest rootfs) on DNS-325 by using Arch Build System:
1: git clone git://github.com/archlinuxarm/PKGBUILDs.git PKGBUILDs
2: ABSROOT=. abs core/linux
3: cd PKGBUILDs/core/linux-kirkwood
4: makepkg

The whole building process takes about 6 hours on DNS-325, but the result is kernel 3.5.4 and it could be used to boot into the latest rootfs successively.

My two questions:
1: What are the pros and cons for using kernel 3.5.4 ?
2: How to compile kernel 3.1.10 by Arch Build System ?

Thanks in advance for your help.
tingyc
 
Posts: 3
Joined: Thu Sep 06, 2012 12:53 pm

Re: compiling kernel for D-Link DNS-325

Postby pepedog » Sat Sep 22, 2012 1:45 pm

Answer to 2. you picked up linux-kirkwood, maybe
cd PKGBUILDs/core/linux
which is for kirkwood with older uboot
pepedog
Developer
 
Posts: 2431
Joined: Mon Jun 07, 2010 3:30 pm
Location: London UK

Re: compiling kernel for D-Link DNS-325

Postby WarheadsSE » Sat Sep 22, 2012 3:40 pm

And if you can come up with installation procedure (that's fairly tested), we could even add it to the list. Seems it needs to need a proper config patch too.
Core Developer
Remember: Arch Linux ARM is entirely community donation supported!
WarheadsSE
Developer
 
Posts: 6807
Joined: Mon Oct 18, 2010 2:12 pm

Re: compiling kernel for D-Link DNS-325

Postby tingyc » Sun Sep 23, 2012 12:11 am

HI all:

Here are my steps to run archilinux on DNS-325, just for reference.

1: format SATA HDD with 1st EXT2 partition(label boot,size 16M), and 2nd EXT3 Partiton(label rootfs, size 16G)

2: download rootfs from http://us.mirror.archlinuxarm.org/os/Ar ... est.tar.gz

3: mount rootfs partition to /media/rootfs, and extract archlinux-arm rootfs to it by
sudo tar -zxvf ArchLinuxARM-armv5te-latest.tar.gz -C /media/rootfs

4: mount boot partition to /media/boot, and copy kernel to it by
sudo cp -p /media/rootfs/boot/uImage /media/boot

5: umount SATA HDD and put it into left slot of DNS-325

6: Need 3.3V Serial UART (speed 115200) to connect to DNS-325, search WWW for location and pin-out

7: power-on DNS-325, press 'space' and '1' key to interrupt u-boot on terminal program like putty or screen

8: Set Machine Type to boot archlinux-arm kernel, just do it once
set arcNumber 1680
set mainlineLinux yes
save
reset

9: press 'space' and '1' key to interrupt u-boot again
setenv bootargs 'console=ttyS0,115200 root=/dev/sda2 ro rootwait loglevel=8'
ide reset; ext2load ide 0:1 0x800000 /uImage; bootm 0x800000

10: done, you are going to archilinux arm

11: if you want to boot origianl firmware, interrupt u-boot again
set mainlineLinux no
save
reset

12: if you want to boot archlinux-arm without serial-console, then bootarg and bootcmd should be flashed back to u-boot environment, do it carefully

13: This modification could be done by changing fun_plug script, but I have not try it.


And Here is the serial console log of second boot ....

$this->bbcode_second_pass_code('', ' ** MARVELL BOARD: DB-88F6281A-BP LE

U-Boot 1.1.4 (May 16 2011 - 10:40:38) Marvell version: 3.4.14.DNS-325.03

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

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

DRAM CAS Latency = 5 tRP = 5 tRAS = 18 tRCD=6
DRAM CS[0] base 0x00000000 size 256MB
DRAM Total size 256MB 16bit width
Flash: 0 kB
Addresses 8M - 0M are saved for the U-Boot usage.
Mem malloc Initialization (8M - 7M): Done
NAND:128 MB

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

Marvell>> printenv
bootargs=root=/dev/ram console=ttyS0,115200 :::DB88FXX81:egiga0:none
bootcmd=nand read.e 0xa00000 0x100000 0x300000;nand read.e 0xf00000 0x600000 0x300000;bootm 0xa00000 0xf00000
baudrate=115200
loads_echo=0
ipaddr=2.66.66.201
serverip=2.66.66.32
rootpath=/mnt/ARM_FS/
netmask=255.255.255.0
console=console=ttyS0,115200 mtdparts=nand_mtd:0xc0000@0(uboot)ro,0x7f00000@0x100000(root)
CASset=min
MALLOC_len=1
ethprime=egiga0
bootargs_root=root=/dev/nfs rw
bootargs_end=:::DB88FXX81:eth0:none
image_name=uImage
standalone=fsload 0x2000000 $(image_name);setenv bootargs $(console) root=/dev/mtdblock0 rw ip=$(ipaddr):$(serverip)$(bootargs_end) $(mvPhoneConfig); bootm 0x2000000;
ethaddr=00:50:43:46:2a:2c
ethmtu=1500
mvPhoneConfig=mv_phone_config=dev0:fxs,dev1:fxs
mvNetConfig=mv_net_config=(00:11:88:0f:62:81,0:1:2:3),mtu=1500
usb0Mode=host
yuk_ethaddr=00:00:00:EE:51:81
nandEcc=1bit
netretry=no
rcvrip=169.254.100.100
loadaddr=0x02000000
autoload=no
ethact=egiga0
arcNumber=1680
stdin=serial
stdout=serial
stderr=serial
mainlineLinux=yes
enaMonExt=no
enaCpuStream=no
enaWrAllo=no
pexMode=RC
disL2Cache=no
setL2CacheWT=yes
disL2Prefetch=yes
enaICPref=yes
enaDCPref=yes
sata_dma_mode=yes
netbsd_en=no
vxworks_en=no
bootdelay=1
disaMvPnp=no
enaAutoRecovery=yes

Environment size: 1255/131068 bytes

Marvell>> setenv bootargs 'console=ttyS0,115200 root=/dev/sda2 ro rootwait loglevel=8'
Marvell>> ide reset; ext2load ide 0:1 0x800000 /uImage; bootm 0x800000

Reset IDE:
Marvell Serial ATA Adapter
Integrated Sata device found
[0 0 0]: Enable DMA mode
Device 0 @ 0 0:
Model: HITACHI HTS723232A7A364 Firm: EC2ZB70B Ser#: E3834563HD7JVN
Type: Hard Disk
Supports 48-bit addressing
Capacity: 305245.3 MB = 298.0 GB (625142448 x 512)


2856016 bytes read
## Booting image at 00800000 ...
Image Name: Linux-3.1.10-13-ARCH
Created: 2012-08-20 15:46:58 UTC
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 2855952 Bytes = 2.7 MB
Load Address: 00008000
Entry Point: 00008000
Verifying Checksum ... OK
OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.
[ 0.000000] Initializing cgroup subsys cpuset
[ 0.000000] Initializing cgroup subsys cpu
[ 0.000000] Linux version 3.1.10-13-ARCH (nobody@fermium) (gcc version 4.7.1 20120721 (prerelease) (GCC) ) #1 PREEMP Mon Aug 20 15:46:18 UTC 2012
[ 0.000000] CPU: Feroceon 88FR131 [56251311] revision 1 (ARMv5TE), cr=00053977
[ 0.000000] CPU: VIVT data cache, VIVT instruction cache
[ 0.000000] Machine: Marvell DB-88F6281-BP Development Board
[ 0.000000] Memory policy: ECC disabled, Data cache writeback
[ 0.000000] On node 0 totalpages: 65536
[ 0.000000] free_area_init_node: node 0, pgdat c058c780, node_mem_map c065d000
[ 0.000000] Normal zone: 512 pages used for memmap
[ 0.000000] Normal zone: 0 pages reserved
[ 0.000000] Normal zone: 65024 pages, LIFO batch:15
[ 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: 65024
[ 0.000000] Kernel command line: console=ttyS0,115200 root=/dev/sda2 ro rootwait loglevel=8
[ 0.000000] PID hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.000000] Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
[ 0.000000] Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
[ 0.000000] allocated 1048576 bytes of page_cgroup
[ 0.000000] please try 'cgroup_disable=memory' option if you don't want memory cgroups
[ 0.000000] Memory: 256MB = 256MB total
[ 0.000000] Memory: 252320k/252320k available, 9824k reserved, 0K highmem
[ 0.000000] Virtual kernel memory layout:
[ 0.000000] vector : 0xffff0000 - 0xffff1000 ( 4 kB)
[ 0.000000] fixmap : 0xfff00000 - 0xfffe0000 ( 896 kB)
[ 0.000000] DMA : 0xffc00000 - 0xffe00000 ( 2 MB)
[ 0.000000] vmalloc : 0xd0800000 - 0xfe800000 ( 736 MB)
[ 0.000000] lowmem : 0xc0000000 - 0xd0000000 ( 256 MB)
[ 0.000000] modules : 0xbf000000 - 0xc0000000 ( 16 MB)
[ 0.000000] .text : 0xc0008000 - 0xc0529b6c (5255 kB)
[ 0.000000] .init : 0xc052a000 - 0xc0555000 ( 172 kB)
[ 0.000000] .data : 0xc0556000 - 0xc058ef70 ( 228 kB)
[ 0.000000] .bss : 0xc058ef94 - 0xc065cb0c ( 823 kB)
[ 0.000000] SLUB: Genslabs=13, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[ 0.000000] Preemptible hierarchical RCU implementation.
[ 0.000000] NR_IRQS:114
[ 0.000000] sched_clock: 32 bits at 200MHz, resolution 5ns, wraps every 21474ms
[ 0.000000] Console: colour dummy device 80x30
[ 18.734307] Calibrating delay loop... 1185.38 BogoMIPS (lpj=5926912)
[ 18.824241] pid_max: default: 32768 minimum: 301
[ 18.824364] Security Framework initialized
[ 18.824388] AppArmor: AppArmor disabled by boot time parameter
[ 18.824452] Mount-cache hash table entries: 512
[ 18.824836] Initializing cgroup subsys cpuacct
[ 18.824862] Initializing cgroup subsys memory
[ 18.824898] Initializing cgroup subsys devices
[ 18.824910] Initializing cgroup subsys freezer
[ 18.824920] Initializing cgroup subsys net_cls
[ 18.824930] Initializing cgroup subsys blkio
[ 18.824952] Initializing cgroup subsys perf_event
[ 18.825047] CPU: Testing write buffer coherency: ok
[ 18.826318] devtmpfs: initialized
[ 18.828183] NET: Registered protocol family 16
[ 18.828825] Kirkwood: MV88F6281-A1, TCLK=200000000.
[ 18.828839] Feroceon L2: Enabling L2
[ 18.828875] Feroceon L2: Cache support initialised.
[ 18.829396] initial MPP regs: 21111111 11113311 55551111 00000000 00000000 00000000 00000000
[ 18.829425] final MPP regs: 21111111 11113311 55551111 00000000 00000000 00000000 00000000
[ 18.829965] Kirkwood PCIe port 0:
[ 18.829973] link down, ignoring
[ 18.834478] bio: create slab <bio-0> at 0
[ 18.834840] vgaarb: loaded
[ 18.835110] SCSI subsystem initialized
[ 18.835267] libata version 3.00 loaded.
[ 18.835483] usbcore: registered new interface driver usbfs
[ 18.835580] usbcore: registered new interface driver hub
[ 18.835683] usbcore: registered new device driver usb
[ 18.836241] Switching to clocksource orion_clocksource
[ 18.844245] Switched to NOHz mode on CPU #0
[ 18.845180] FS-Cache: Loaded
[ 18.855078] NET: Registered protocol family 2
[ 18.855325] IP route cache hash table entries: 2048 (order: 1, 8192 bytes)
[ 18.856049] TCP established hash table entries: 8192 (order: 4, 65536 bytes)
[ 18.856235] TCP bind hash table entries: 8192 (order: 3, 32768 bytes)
[ 18.856370] TCP: Hash tables configured (established 8192 bind 8192)
[ 18.856381] TCP reno registered
[ 18.856394] UDP hash table entries: 256 (order: 0, 4096 bytes)
[ 18.856417] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[ 18.856657] NET: Registered protocol family 1
[ 18.856693] PCI: CLS 0 bytes, default 32
[ 18.857278] audit: initializing netlink socket (disabled)
[ 18.857313] type=2000 audit(0.120:1): initialized
[ 18.940716] VFS: Disk quotas dquot_6.5.2
[ 18.940980] Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[ 18.943252] JFFS2 version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
[ 18.944569] aufs 3.1-20111107
[ 18.944590] msgmni has been set to 492
[ 18.945945] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 253)
[ 18.945960] io scheduler noop registered
[ 18.945969] io scheduler deadline registered
[ 18.946057] io scheduler cfq registered (default)
[ 18.946122] mv_xor_shared mv_xor_shared.0: Marvell shared XOR driver
[ 18.946155] mv_xor_shared mv_xor_shared.1: Marvell shared XOR driver
[ 18.986312] mv_xor mv_xor.0: Marvell XOR: ( xor cpy )
[ 19.026326] mv_xor mv_xor.1: Marvell XOR: ( xor fill cpy )
[ 19.066314] mv_xor mv_xor.2: Marvell XOR: ( xor cpy )
[ 19.106314] mv_xor mv_xor.3: Marvell XOR: ( xor fill cpy )
[ 19.111415] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
[ 19.132114] serial8250.0: ttyS0 at MMIO 0xf1012000 (irq = 33) is a 16550A
[ 19.664268] console [ttyS0] enabled
[ 19.673901] brd: module loaded
[ 19.680020] loop: module loaded
[ 19.683491] sata_mv sata_mv.0: version 1.28
[ 19.687846] sata_mv sata_mv.0: slots 32 ports 2
[ 19.694113] scsi0 : sata_mv
[ 19.697337] scsi1 : sata_mv
[ 19.700365] ata1: SATA max UDMA/133 irq 21
[ 19.704478] ata2: SATA max UDMA/133 irq 21
[ 19.709442] NAND device: Manufacturer ID: 0xec, Chip ID: 0xf1 (Samsung NAND 128MiB 3,3V 8-bit)
[ 19.718325] Scanning device for bad blocks
[ 19.727637] Bad eraseblock 69 at 0x0000008a0000
[ 19.767000] Bad eraseblock 537 at 0x000004320000
[ 19.795110] Bad eraseblock 853 at 0x000006aa0000
[ 19.811846] Bad eraseblock 1016 at 0x000007f00000
[ 19.817112] Creating 3 MTD partitions on "orion_nand":
[ 19.822282] 0x000000000000-0x000000100000 : "u-boot"
[ 19.828273] 0x000000100000-0x000000500000 : "uImage"
[ 19.834075] 0x000000500000-0x000008000000 : "root"
[ 19.840567] mv643xx_eth: MV-643xx 10/100/1000 ethernet driver version 1.4
[ 19.847525] mv643xx_eth smi: probed
[ 19.853122] mv643xx_eth_port mv643xx_eth_port.0: eth0: port 0 with MAC address 00:50:43:46:2a:2c
[ 19.862091] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 19.868728] orion-ehci orion-ehci.0: Marvell Orion EHCI
[ 19.874036] orion-ehci orion-ehci.0: new USB bus registered, assigned bus number 1
[ 19.906294] orion-ehci orion-ehci.0: irq 19, io mem 0xf1050000
[ 19.926288] orion-ehci orion-ehci.0: USB 2.0 started, EHCI 1.00
[ 19.932817] hub 1-0:1.0: USB hub found
[ 19.936625] hub 1-0:1.0: 1 port detected
[ 19.941055] Initializing USB Mass Storage driver...
[ 19.946041] usbcore: registered new interface driver usb-storage
[ 19.952116] USB Mass Storage support registered.
[ 19.956869] usbcore: registered new interface driver libusual
[ 19.962959] mousedev: PS/2 mouse device common for all mice
[ 19.968840] rtc-mv rtc-mv: rtc core: registered rtc-mv as rtc0
[ 19.974827] sdhci: Secure Digital Host Controller Interface driver
[ 19.981054] sdhci: Copyright(c) Pierre Ossman
[ 19.985651] mmc0: mvsdio driver initialized, using GPIO 38 for card detection
[ 19.992893] sdhci-pltfm: SDHCI platform and OF driver helper
[ 19.998811] usbcore: registered new interface driver r8712u
[ 20.005304] GRE over IPv4 demultiplexor driver
[ 20.009757] TCP cubic registered
[ 20.013184] NET: Registered protocol family 17
[ 20.017759] lib80211: common routines for IEEE802.11 drivers
[ 20.023469] lib80211_crypt: registered algorithm 'NULL'
[ 20.029764] Registering the dns_resolver key type
[ 20.036626] Gating clock of unused units
[ 20.040661] before: 0x00c7c1dd
[ 20.043734] after: 0x00c7c1d9
[ 20.047372] registered taskstats version 1
[ 20.052229] console [netcon0] enabled
[ 20.055927] netconsole: network logging started
[ 20.060599] rtc-mv rtc-mv: setting system clock to 2012-09-23 07:16:01 UTC (1348384561)
[ 20.226299] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl F300)
[ 20.266329] ata1.00: ATA-8: HITACHI HTS723232A7A364, EC2ZB70B, max UDMA/100
[ 20.273329] ata1.00: 625142448 sectors, multi 0: LBA48 NCQ (depth 31/32)
[ 20.336329] ata1.00: configured for UDMA/100
[ 20.356594] scsi 0:0:0:0: Direct-Access ATA HITACHI HTS72323 EC2Z PQ: 0 ANSI: 5
[ 20.365269] sd 0:0:0:0: [sda] 625142448 512-byte logical blocks: (320 GB/298 GiB)
[ 20.373134] sd 0:0:0:0: Attached scsi generic sg0 type 0
[ 20.378755] sd 0:0:0:0: [sda] Write Protect is off
[ 20.383576] sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
[ 20.389136] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[ 20.532233] sda: sda1 sda2 sda3 sda4
[ 20.537387] sd 0:0:0:0: [sda] Attached SCSI disk
[ 20.736292] ata2: SATA link down (SStatus 0 SControl F300)
[ 20.763368] EXT4-fs (sda2): mounting ext3 file system using the ext4 subsystem
[ 20.791385] EXT4-fs (sda2): mounted filesystem with ordered data mode. Opts: (null)
[ 20.799161] VFS: Mounted root (ext3 filesystem) readonly on device 8:2.
[ 20.831924] devtmpfs: mounted
[ 20.835416] Freeing init memory: 172K
INIT: version 2.88 booting

> Arch Linux ARM

> http://archlinuxarm.org/

------------------------------
:: Adjusting system time and setting kernel time zone [DONE]
:: Starting udev daemon [[ 22.085994] systemd-udevd[84]: starting vesion 189
DONE]
:: Triggering udev uevents [DONE]
:: Loading user-specified modules [BUSY] [ 22.401783] RPC: Registered named UNX socket transport module.
[ 22.434580] RPC: Registered udp transport module.
[ 22.461768] RPC: Registered tcp transport module.
[ 22.483061] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 22.883766] FS-Cache: Netfs 'nfs' registered for caching
[DONE]
:: Waiting for udev uevents to be processed [DONE]
:: Configuring virtual consoles [DONE]
:: Bringing up loopback interface [DONE]
:: Checking filesystems [BUSY] home: clean, 71783/18006016 files, 145749/71994367 blocks
[DONE]
:: Remounting root and API filesystems [BUSY] [ 23.709168] EXT4-fs (sda2): re-mountd. Opts: user_xattr,barrier=1,nodelalloc,data=ordered
[DONE]
:: Mounting local filesystems [BUSY] [ 23.903967] EXT4-fs (sda3): mounted ilesystem with ordered data mode. Opts: errors=remount-ro
[DONE]
:: Activating swap [DONE]
:: Configuring time zone [DONE]
:: Initializing random seed [DONE]
:: Removing leftover files [DONE]
:: Setting hostname: alarm [DONE]
:: Saving dmesg log [DONE]
INIT: Entering runlevel: 3
:: Starting Syslog-NG [DONE]
:: Starting network [BUSY] [ 28.553314] mv643xx_eth_port mv643xxeth_port.0: eth0: link up, 1000 Mb/s, full duplex, flow control disabled
[DONE]
:: Mounting network filesystems [DONE]
:: Starting crond daemon [DONE]
:: Starting Secure Shell Daemon [BUSY] [ 36.831066] NET: Registered protocolfamily 10
[DONE]
:: Starting rpcbind [DONE]
:: Starting rpc.statd daemon [DONE]
:: Mounting pipefs filesystem [BUSY] [ 38.001514] Installing knfsd (copyriht (C) 1996 okir@monad.swb.de).
[DONE]
:: Starting rpc.idmapd daemon [DONE]
:: Mounting nfsd filesystem [DONE]
:: Exporting all directories [DONE]
:: Starting rpc.nfsd daemon [BUSY] [ 38.586776] NFSD: Using /var/lib/nfsv4recovery as the NFSv4 state recovery directory
[ 38.601826] NFSD: starting 90-second grace period
[DONE]
:: Starting rpc.mountd daemon [DONE]

Arch Linux 3.1.10-13-ARCH (ttyS0)

alarm login: [ 47.526333] eth0: no IPv6 routers present

Arch Linux 3.1.10-13-ARCH (ttyS0)

alarm login: root
Password:
Last login: Sat Sep 22 17:21:45 on ttyS0
[root@alarm ~]#')
tingyc
 
Posts: 3
Joined: Thu Sep 06, 2012 12:53 pm

Re: compiling kernel for D-Link DNS-325

Postby WarheadsSE » Sun Sep 23, 2012 2:49 am

Ah, fun_plug. I wrote a modified version for the NSA320. Have a look a the usb_keyfunc.sh.2 in the handy dandy tarball :P
Core Developer
Remember: Arch Linux ARM is entirely community donation supported!
WarheadsSE
Developer
 
Posts: 6807
Joined: Mon Oct 18, 2010 2:12 pm

Re: compiling kernel for D-Link DNS-325

Postby Kurlon » Sun Sep 23, 2012 11:27 am

3.5 if it boots with your uboot is going to be the last easily supported kernel for kirkwoods without some HEAVY patching. For Pros, if you're using Displaylink USB/VGA adapters, they work much better under 3.5 than 3.1. :D
Kurlon
 
Posts: 132
Joined: Fri Jan 06, 2012 10:05 pm


Return to Marvell Kirkwood

Who is online

Users browsing this forum: No registered users and 400 guests

cron