Debian squeeze on NSA-320

Marvell Kirkwood based
AA666
Posts: 7
Joined: Sun May 08, 2011 3:17 pm

Debian squeeze on NSA-320

Post by AA666 » Thu Jun 23, 2011 11:11 pm

Some time ago I have patched and compiled mainline kernel 2.6.36.6 and successfully installed Debian squeeze on my NSA-320 box.
In case if you interested I have created short guide and links to necessary files.

What is currently supported/tested with mainline kernel:
- Supported filesystems - EXT2,3,4 (no XFS)
- Network adapter - tested only at 1Gb speed (only 8-wire patch cable works)
- Buttons (accessible as input-devices, shutdown by power button works)
- LEDs (accessible via /sys/class/leds, with hardware accelerated blink)
- Hardware monitoring (FAN speed and Temp(*C) available in /proc/mcu, I created shell script to show it)
- HDD activity LEDs (algorithm not perfect)
- SATA - ok
- USB - no printing support
- Crypto engine - not tested

First of all backup all your files from NAS to some other location, because XFS not supported by new kernel and you will lose everything on HDDs.

Connect NAS and tftp server to gigabit ethernet via 8-wire patch cords.
You can install and configure tftp server as described in section 4 here:
http://www.zyxel.com/support/knowledge_ ... 9534.shtml

Download and put on tftp server following files:
http://downloads.zyxel.nas-central.org/ ... e-2.6.38.6
http://ftp.nl.debian.org/debian/dists/s ... /initrd.gz
http://downloads.zyxel.nas-central.org/ ... g-2.6.38.6

Connect serial interface to the box, power on box and press any key to stop standard booting process:

Code: Select all

         __  __                      _ _
        |  \/  | __ _ _ ____   _____| | |
        | |\/| |/ _` | '__\ \ / / _ \ | |
        | |  | | (_| | |   \ V /  __/ | |
        |_|  |_|\__,_|_|    \_/ \___|_|_|
 _   _     ____              _
| | | |   | __ )  ___   ___ | |_ 
| | | |___|  _ \ / _ \ / _ \| __| 
| |_| |___| |_) | (_) | (_) | |_ 
 \___/    |____/ \___/ \___/ \__| 
 ** MARVELL BOARD: RD-88F6281A LE 

U-Boot 1.1.4 (Mar 18 2010 - 23:12:09) Marvell version: 3.4.19

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

Soc: 88F6281 A1 (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 CS[1] base 0x10000000   size 256MB 
DRAM Total size 512MB  16bit width
Addresses 10M - 0M are saved for the U-Boot usage.
Mem malloc Initialization (10M - 7M): Done
NAND:128 MB
Flash:  0 kB

CPU : Marvell Feroceon (Rev 1)
//---  stateButtonBit = 3, recovery ---//
Kernel address is 0xc80000.
Erasing Nand...Writing to Nand... done

Streaming disabled 
Write allocate disabled

Module 0 is RGMII
Module 1 is TDM

USB 0: host mode
PEX 0: interface detected no Link.
Net:   egiga0, egiga1 [PRIME]
Hit any key to stop autoboot:
Enter tftp server IP address (in my case 192.168.0.5):
setenv serverip 192.168.0.5

Enter box IP address (if you don't have dhcp server on your network):
setenv ipaddr 192.168.0.20

Correct netmask if needed:
setenv netmask 255.255.255.0

Prepare u-boot for mainline kernel:
setenv mainlineLinux yes
setenv arcNumber 3339
saveenv
reset

After reset hit any key to stop autoboot process.

Load new kernel from tftp server:
tftpboot 0x800000 uImage-2.6.38.6

Code: Select all

Using egiga0 device
TFTP from server 192.168.0.5; our IP address is 192.168.0.20
Filename 'uImage-2.6.38.6'.
Load address: 0x800000
Loading: *#################################################################
	 #####################
done
Bytes transferred = 1433648 (15e030 hex)
Load Debian installer:
tftpboot 0xb00000 initrd.gz

Code: Select all

Using egiga0 device
TFTP from server 192.168.0.5; our IP address is 192.168.0.20
Filename 'initrd.gz'.
Load address: 0xb00000
Loading: *#################################################################
	 #################################################################
	 ########################
done
Bytes transferred = 9437184 (900000 hex)
Prepare boot environment:
setenv bootargs 'console=ttyS0,115200 root=/dev/ram initrd=0xb00000,0x900000 ramdisk=32768'

Boot new kernel with Debian installer:
bootm 0x800000

The box will load new kernel and start Debian installation process.

In case if Debian installer unable to see your HDD(s) during installation - you can start shell from installer menu and create dev nodes for disks and partitions manually:
mknod /dev/sda b 8 0
mknod /dev/sda1 b 8 1
mknod /dev/sda2 b 8 2

In case if you have 2 disks:
mknod /dev/sdb b 8 16
mknod /dev/sdb1 b 8 17
mknod /dev/sdb2 b 8 18

If you successfully installed Debian - reboot box and interrupt autoboot process.

Load new kernel from tftp server:
tftpboot 0x800000 uImage-2.6.38.6

Load initrd:
tftpboot 0xb00000 initrd.img-2.6.38.6

Next, try to boot and mount root filesystem.
If you installed root filesystem into /dev/sda2:
setenv bootargs 'console=ttyS0,115200 root=/dev/sda2 initrd=0xb00000,0x5d6e00 ramdisk=8192'

If you installed root filesystem on RAID device md0
setenv bootargs 'console=ttyS0,115200 root=/dev/md0 initrd=0xb00000,0x5d6e00 ramdisk=8192'

bootm 0x800000

In case if you successfully booted into installed Debian, you can put kernel and initrd into nand flash.

Make backup of old kernel and initrd:
cat /dev/mtdblock7 > /mtd7
cat /dev/mtdblock8 > /mtd8

Reboot box and interrupt autoboot.

Download kernel from tftp server and save it into nand kernel_2 partition:
tftpboot 0x800000 uImage-2.6.38.6
nand erase 0x4640000 0x300000
nand write.e 0x800000 0x4640000 0x300000

Download initrd and save it into nand rootfs_2 partition:
tftpboot 0xb00000 initrd.img-2.6.38.6
nand erase 0x5040000 0x600000
nand write.e 0xb00000 0x5040000 0x600000

Following command depands on where you installed Debian.
In case if it on md0:
setenv bootargs 'console=ttyS0,115200 root=/dev/md0 initrd=/dev/mtdblock8 ramdisk=8192'

In case if it on sda2:
setenv bootargs 'console=ttyS0,115200 root=/dev/sda2 initrd=/dev/mtdblock8 ramdisk=8192'

Prepare boot command
setenv bootcmd 'nand read.e 0x2000000 0x04640000 0x400000; bootm 0x2000000'

saveenv

And try to boot:
boot

And box should load your new kernel with just installed Debian squeeze.


Here is a script to show current temperature and FAN speed:
/usr/local/sbin/hw

Code: Select all

#!/bin/bash
for line in `cat /proc/mcu` ; do
    case $line in
        'MagicNumber:'*)
            if [ ${line#MagicNumber:} != 85 ] ; then
                exit
            fi
        ;;
        'Rpss:'*)
            declare -i fan1=${line#Rpss:}
            declare -i fan=1000/$fan1*60
            echo fan1=$fan rpm
        ;;
        'Temperature:'*)
            temp1=${line#Temperature:}
            temp=${temp1:0:2}.${temp1:2:1}
            echo temp1=$temp *C
        ;;
    esac
done
Ii is possible to shutdown the box by pressing power button.
Install input-event-daemon and put following to /etc/input-event-daemon.conf:
[Global]
listen = /dev/input/event0
[Keys]
POWER = shutdown -h now

Here is dmesg from my box:

Code: Select all

Linux version 2.6.38.6 (root@nsa320) (gcc version 4.4.5 (Debian 4.4.5-8) ) #1 Thu Jun 16 20:58:40 EEST 2011
CPU: Feroceon 88FR131 [56251311] revision 1 (ARMv5TE), cr=00053977
CPU: VIVT data cache, VIVT instruction cache
Machine: Zyxel NSA-320
Memory policy: ECC disabled, Data cache writeback
On node 0 totalpages: 131072
free_area_init_node: node 0, pgdat c03dce1c, node_mem_map c03fb000
  Normal zone: 1024 pages used for memmap
  Normal zone: 0 pages reserved
  Normal zone: 130048 pages, LIFO batch:31
pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
pcpu-alloc: [0] 0
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 130048
Kernel command line: console=ttyS0,115200 root=/dev/md0 initrd=/dev/mtdblock8 ramdisk=8192
PID hash table entries: 2048 (order: 1, 8192 bytes)
Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
Memory: 512MB = 512MB total
Memory: 515680k/515680k available, 8608k reserved, 0K highmem
Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
    DMA     : 0xffc00000 - 0xffe00000   (   2 MB)
    vmalloc : 0xe0800000 - 0xfe800000   ( 480 MB)
    lowmem  : 0xc0000000 - 0xe0000000   ( 512 MB)
    modules : 0xbf000000 - 0xc0000000   (  16 MB)
      .init : 0xc0008000 - 0xc002a000   ( 136 kB)
      .text : 0xc002a000 - 0xc03bf000   (3668 kB)
      .data : 0xc03c0000 - 0xc03dd4e0   ( 118 kB)
NR_IRQS:114
sched_clock: 32 bits at 200MHz, resolution 5ns, wraps every 21474ms
Calibrating delay loop... 1199.30 BogoMIPS (lpj=5996544)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
devtmpfs: initialized
NET: Registered protocol family 16
Kirkwood: MV88F6281-A1, TCLK=200000000.
Feroceon L2: Enabling L2
Feroceon L2: Cache support initialised.
initial MPP regs: 21111111 01003311 33331100 33003333 00000533 20202000 00000000
  final MPP regs: 21111111 00003311 33031100 33003333 00000533 00000000 00000000
USB power enabled
Power-off GPIO enabled
Kirkwood PCIe port 0:
link down, ignoring
bio: create slab <bio-0> at 0
SCSI subsystem initialized
libata version 3.00 loaded.
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
Switching to clocksource orion_clocksource
NET: Registered protocol family 2
IP route cache hash table entries: 4096 (order: 2, 16384 bytes)
TCP established hash table entries: 16384 (order: 5, 131072 bytes)
TCP bind hash table entries: 16384 (order: 4, 65536 bytes)
TCP: Hash tables configured (established 16384 bind 16384)
TCP reno registered
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
NET: Registered protocol family 1
PCI: CLS 0 bytes, default 32
NetWinder Floating Point Emulator V0.97 (double precision)
NTFS driver 2.1.30 [Flags: R/W].
msgmni has been set to 1007
Block layer SCSI generic (bsg) driver version 0.4 loaded (major 253)
io scheduler noop registered
io scheduler cfq registered (default)
Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
serial8250.0: ttyS0 at MMIO 0xf1012000 (irq = 33) is a 16550A
console [ttyS0] enabled
brd: module loaded
loop: module loaded
Loading iSCSI transport class v2.0-870.
iscsi: registered transport (tcp)
sata_mv sata_mv.0: version 1.28
sata_mv sata_mv.0: slots 32 ports 2
scsi0 : sata_mv
scsi1 : sata_mv
ata1: SATA max UDMA/133 irq 21
ata2: SATA max UDMA/133 irq 21
NAND device: Manufacturer ID: 0xec, Chip ID: 0xf1 (Samsung NAND 128MiB 3,3V 8-bit)
Scanning device for bad blocks
Bad eraseblock 72 at 0x000000900000
Bad eraseblock 268 at 0x000002180000
Bad eraseblock 344 at 0x000002b00000
Bad eraseblock 522 at 0x000004140000
Bad eraseblock 868 at 0x000006c80000
Creating 9 MTD partitions on "orion_nand":
0x000000000000-0x000000100000 : "uboot"
0x000000100000-0x000000180000 : "uboot_env"
0x000000180000-0x000000200000 : "key_store"
0x000000200000-0x000000280000 : "info"
0x000000280000-0x000000c80000 : "etc"
0x000000c80000-0x000001680000 : "kernel_1"
0x000001680000-0x000004640000 : "rootfs1"
0x000004640000-0x000005040000 : "kernel_2"
0x000005040000-0x000008000000 : "rootfs2"
MV-643xx 10/100/1000 ethernet driver version 1.4
mv643xx_eth smi: probed
net eth0: port 0 with MAC address 50:67:f0:a3:1c:22
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
orion-ehci orion-ehci.0: Marvell Orion EHCI
orion-ehci orion-ehci.0: new USB bus registered, assigned bus number 1
orion-ehci orion-ehci.0: irq 19, io mem 0xf1050000
orion-ehci orion-ehci.0: USB 2.0 started, EHCI 1.00
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
gpio_set_debounce: gpio-46 status -22
gpio_set_debounce: gpio-37 status -22
gpio_set_debounce: gpio-36 status -22
input: gpio-keys as /devices/platform/gpio-keys/input/input0
i2c /dev entries driver
rtc-pcf8563 0-0051: chip found, driver version 0.4.3
rtc-pcf8563 0-0051: rtc core: registered rtc-pcf8563 as rtc0
Orion Watchdog Timer: Initial timeout 21 sec
md: linear personality registered for level -1
md: raid0 personality registered for level 0
md: raid1 personality registered for level 1
mv_xor_shared mv_xor_shared.0: Marvell shared XOR driver
mv_xor_shared mv_xor_shared.1: Marvell shared XOR driver
mv_xor mv_xor.0: Marvell XOR: ( xor cpy )
mv_xor mv_xor.1: Marvell XOR: ( xor fill cpy )
mv_xor mv_xor.2: Marvell XOR: ( xor cpy )
mv_xor mv_xor.3: Marvell XOR: ( xor fill cpy )
Registered led device: nsa320:green:System
Registered led device: nsa320:yellow:System
Registered led device: nsa320:green:SATA1
Registered led device: nsa320:red:SATA1
Registered led device: nsa320:green:SATA2
Registered led device: nsa320:red:SATA2
Registered led device: nsa320:green:USB
Registered led device: nsa320:green:Copy
Registered led device: nsa320:red:Copy
TCP cubic registered
NET: Registered protocol family 17
Registering the dns_resolver key type
Gating clock of unused units
before: 0x00dfc3dd
 after: 0x00c7c1c9
rtc-pcf8563 0-0051: setting system clock to 2011-06-16 19:09:55 UTC (1308251395)
usb 1-1: new high speed USB device using orion-ehci and address 2
ata1: SATA link up 3.0 Gbps (SStatus 123 SControl F300)
ata1.00: ATA-8: Hitachi HDS5C3020ALA632, ML6OA580, max UDMA/133
ata1.00: 3907029168 sectors, multi 0: LBA48 NCQ (depth 31/32)
hub 1-1:1.0: USB hub found
hub 1-1:1.0: 4 ports detected
ata1.00: configured for UDMA/133
scsi 0:0:0:0: Direct-Access     ATA      Hitachi HDS5C302 ML6O PQ: 0 ANSI: 5
sd 0:0:0:0: [sda] 3907029168 512-byte logical blocks: (2.00 TB/1.81 TiB)
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
 sda: sda1 sda2 sda3
sd 0:0:0:0: [sda] Attached SCSI disk
usb 1-1.4: new high speed USB device using orion-ehci and address 3
ata2: SATA link up 3.0 Gbps (SStatus 123 SControl F300)
ata2.00: ATA-8: Hitachi HDS5C3020ALA632, ML6OA580, max UDMA/133
ata2.00: 3907029168 sectors, multi 0: LBA48 NCQ (depth 31/32)
scsi2 : usb-storage 1-1.4:1.0
ata2.00: configured for UDMA/133
scsi 1:0:0:0: Direct-Access     ATA      Hitachi HDS5C302 ML6O PQ: 0 ANSI: 5
sd 1:0:0:0: [sdb] 3907029168 512-byte logical blocks: (2.00 TB/1.81 TiB)
sd 1:0:0:0: [sdb] Write Protect is off
sd 1:0:0:0: [sdb] Mode Sense: 00 3a 00 00
sd 1:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
 sdb: sdb1 sdb2 sdb3
sd 1:0:0:0: [sdb] Attached SCSI disk
md: Waiting for all devices to be available before autodetect
md: If you don't use raid, use raid=noautodetect
md: Autodetecting RAID arrays.
md: Scanned 4 and added 4 devices.
md: autorun ...
md: considering sdb3 ...
md:  adding sdb3 ...
md: sdb2 has different UUID to sdb3
md:  adding sda3 ...
md: sda2 has different UUID to sdb3
md: created md1
md: bind<sda3>
md: bind<sdb3>
md: running: <sdb3><sda3>
bio: create slab <bio-1> at 1
md/raid1:md1: active with 2 out of 2 mirrors
md1: detected capacity change from 0 to 1975720411136
md: considering sdb2 ...
md:  adding sdb2 ...
md:  adding sda2 ...
md: created md0
md: bind<sda2>
md: bind<sdb2>
md: running: <sdb2><sda2>
md/raid1:md0: active with 2 out of 2 mirrors
md0: detected capacity change from 0 to 24157552640
md: ... autorun DONE.
 md0: unknown partition table
EXT4-fs (md0): mounted filesystem with ordered data mode. Opts: (null)
VFS: Mounted root (ext2 filesystem) on device 9:0.
devtmpfs: mounted
Freeing init memory: 136K
scsi 2:0:0:0: Direct-Access     ST925031 5AS                   PQ: 0 ANSI: 2 CCS
udev[444]: starting version 164
sd 2:0:0:0: [sdc] 488397168 512-byte logical blocks: (250 GB/232 GiB)
sd 2:0:0:0: [sdc] Write Protect is off
sd 2:0:0:0: [sdc] Mode Sense: 00 38 00 00
sd 2:0:0:0: [sdc] Asking for cache data failed
sd 2:0:0:0: [sdc] Assuming drive cache: write through
sd 2:0:0:0: [sdc] Asking for cache data failed
sd 2:0:0:0: [sdc] Assuming drive cache: write through
 sdc: sdc1
sd 2:0:0:0: [sdc] Asking for cache data failed
sd 2:0:0:0: [sdc] Assuming drive cache: write through
sd 2:0:0:0: [sdc] Attached SCSI disk
 md1: unknown partition table
Adding 506012k swap on /dev/sdb1.  Priority:-1 extents:1 across:506012k
EXT4-fs (md0): re-mounted. Opts: (null)
EXT4-fs (md0): re-mounted. Opts: errors=remount-ro,commit=30
EXT4-fs (md1): mounted filesystem with ordered data mode. Opts: errors=remount-ro,commit=30
eth0: link up, 1000 Mb/s, full duplex, flow control disabled
sshd (1191): /proc/1191/oom_adj is deprecated, please use /proc/1191/oom_score_adj instead.
ISO 9660 Extensions: Microsoft Joliet Level 1
ISOFS: changing to secondary root

Mijzelf
Posts: 6207
Joined: Mon Jun 16, 2008 10:45 am

Re: Debian squeeze on NSA-320

Post by Mijzelf » Sat Jun 25, 2011 9:37 am

Hey, this is great! Can you give some more information about that kernel? What did you have to change to which vanilla kernel?
Can you say something about that /proc/mcu, is it 'pointing to' some i2c device?

AA666
Posts: 7
Joined: Sun May 08, 2011 3:17 pm

Re: Debian squeeze on NSA-320

Post by AA666 » Sun Jun 26, 2011 11:15 am

Mijzelf wrote:Hey, this is great! Can you give some more information about that kernel? What did you have to change to which vanilla kernel?
Can you say something about that /proc/mcu, is it 'pointing to' some i2c device?
I have downloaded vanilla 2.6.38.6 (it was about a month ago) and created new machine setup for NSA-320. There are lot of examples for other kirkwood/orion based devices in the kernel sources. Also, I'm ported MCU driver from old Zyxel kernel, changed sata_mv to blink sata leds on hdd activity, patched gpio-leds and maybe some other minor things.

/proc/mcu is output from gpio connected Holtek HT46R065 MCU. For some reason Zyxel have changed i2c-way to this gpio-way for hw monitoring chip.

term
Posts: 6
Joined: Sat Feb 19, 2011 9:12 am

Re: Debian squeeze on NSA-320

Post by term » Tue Jul 12, 2011 6:50 am

I've tried your kernel and it works like a charm, great work! Though I'd really like to see your kernel .config and patches. I really need the ability to compile a few modules!

AA666
Posts: 7
Joined: Sun May 08, 2011 3:17 pm

Re: Debian squeeze on NSA-320

Post by AA666 » Thu Dec 29, 2011 9:22 pm

Patch against vanilla 2.6.38.6 and .config located at link below
http://downloads.zyxel.nas-central.org/ ... 8.6-nsa320

davygravy
Posts: 5
Joined: Sun Mar 08, 2009 5:36 pm

Re: Debian squeeze on NSA-320

Post by davygravy » Thu Apr 26, 2012 3:38 am

I picked up the NSA320 for $80 from Buy.com, and I have to say that I'm happy with it. It is a great price for 512MB and 2 SATA bays.

I booted it into the stock firmware just once, so I could make a copy of all the boot log information, and also so I could print out the U-Boot env vars (original).

I've now flashed it with a customized/scripted U-Boot that has allows me to boot from either SATA port, as well as from any attached USB drive.

I also rolled a nice wide Debian 3.3.2 kernel (thanks to psch2's git sources) and put together a very, very bare/basic support tarball, containing:
  • directions for install
    U-Boot for NAND on the NSA320
    rootfs_image.img file - ready to copy to /dev/sda1 & boot; contains working Debian system + kernel
    kernel config (for reference)

Download and enjoy. Use at your own risk, YMMV.

Link: QuickStart package for NSA320 (about 150MB, directions inside the tarball)

rray
Posts: 8
Joined: Fri Jul 06, 2012 10:11 am

Re: Debian squeeze on NSA-320

Post by rray » Tue Jul 10, 2012 6:31 pm

I picked up your QuickStart package for NSA320. I would like to try your bootloader without installing.
Can you offer any suggestions?

NSA320>> setenv ipaddr 192.168.1.120; setenv serverip 192.168.1.101
NSA320>> tftp 0x800000 uboot.NAND-NSA320-IDEfixedv4-scripted.kwb
egiga1 no link
Using egiga0 device
TFTP from server 192.168.1.101; our IP address is 192.168.1.120
Filename 'uboot.NAND-NSA320-IDEfixedv4-scripted.kwb'.
Load address: 0x800000
Loading: #################################################################
######################################
done
Bytes transferred = 524288 (80000 hex)
NSA320>> go 0x800000
## Starting application at 0x00800000 ...
data abort
pc : [<00800008>] lr : [<00631378>]
sp : 005ff26c ip : ffffffff fp : 005ffadf
r10: 005ff6df r9 : 00000000 r8 : 005fffc4
r7 : 005ff68c r6 : 00000001 r5 : 005ff690 r4 : 00800000
r3 : 00000020 r2 : f1012000 r1 : 005ff690 r0 : 00000001
Flags: nZCv IRQs off FIQs off Mode SVC_32
Resetting CPU ...

lcapriotti
Posts: 11
Joined: Wed Jul 11, 2012 12:31 pm

Re: Debian squeeze on NSA-320

Post by lcapriotti » Wed Jul 11, 2012 1:27 pm

can debian be achieved without the serial cable on a brand new box?

davygravy1
Posts: 9
Joined: Sat Apr 14, 2012 6:49 pm

Re: Debian squeeze on NSA-320

Post by davygravy1 » Wed Jul 11, 2012 2:39 pm

Personally, I wouldn't try it without the serial cable. If something even minor prevents it from booting, serial is the only way to get it up and running again, probably. Serial = cheap effective insurance.

@ rray: try go 0x800200

remember that for kirkwood, the first 512 bytes (or 0x200 in hex) are for the header (kirkwood specific... not sure what other SoC's use this scheme)

lcapriotti
Posts: 11
Joined: Wed Jul 11, 2012 12:31 pm

Re: Debian squeeze on NSA-320

Post by lcapriotti » Wed Jul 11, 2012 2:59 pm

is there a way to restore the original firmware after having gone this way all through?

davygravy1
Posts: 9
Joined: Sat Apr 14, 2012 6:49 pm

Re: Debian squeeze on NSA-320

Post by davygravy1 » Wed Jul 11, 2012 6:32 pm

theoretically, it should be possible, first getting valid copies of contents of each mtdN device... and then restoring it ... never did it on this box...

Mijzelf
Posts: 6207
Joined: Mon Jun 16, 2008 10:45 am

Re: Debian squeeze on NSA-320

Post by Mijzelf » Wed Jul 11, 2012 7:38 pm

lcapriotti wrote:can debian be achieved without the serial cable on a brand new box?
There is a script for the 310. However, I suppose it has to be changed a bit for the 320, in which case you'll still need a serial cable.

rray
Posts: 8
Joined: Fri Jul 06, 2012 10:11 am

Re: Debian squeeze on NSA-320

Post by rray » Thu Jul 12, 2012 11:24 am

I am trying to get the original install procedure to run but no luck so far. It never loads


U-Boot 2011.12 (May 03 2012 - 17:04:23)
ZyXEL NSA320 2-Bay Power Media Server

SoC: Kirkwood 88F6281_A1
DRAM: 512 MiB
WARNING: Caches not enabled
NAND: 128 MiB
*** Warning - bad CRC, using default environment

In: serial
Out: serial
Err: serial
Net: egiga0
MV88E1318 PHY initialized on egiga0
Using egiga0 device
ping failed; host 192.168.11.149 is not alive
Hit any key to stop autoboot: 0
NSA320> setenv netmask 255.255.255.0
NSA320> setenv serverip 192.168.1.101
NSA320> setenv ipaddr 192.168.1.120
NSA320> setenv arcNumber 3339
NSA320> tftpboot 0x800000 uImage-2.6.38.6
Using egiga0 device
TFTP from server 192.168.1.101; our IP address is 192.168.1.120
Filename 'uImage-2.6.38.6'.
Load address: 0x800000
Loading: #################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#########################################
done
Bytes transferred = 1870120 (1c8928 hex)
NSA320> tftpboot 0xb00000 initrd.gz
Using egiga0 device
TFTP from server 192.168.1.101; our IP address is 192.168.1.120
Filename 'initrd.gz'.
Load address: 0xb00000
Loading: #################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
########################
done
Bytes transferred = 9437184 (900000 hex)
NSA320> setenv bootargs 'console=ttyS0,115200 root=/dev/ram initrd=0xb00000,0x900000 ramdisk=32768'
NSA320> bootm 0x800000
## Booting kernel from Legacy Image at 00800000 ...
Image Name: Linux-2.6.38.6
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 1870056 Bytes = 1.8 MiB
Load Address: 00008000
Entry Point: 00008000
Verifying Checksum ... OK
Loading Kernel Image ... OK
OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.

davygravy1
Posts: 9
Joined: Sat Apr 14, 2012 6:49 pm

Re: Debian squeeze on NSA-320

Post by davygravy1 » Thu Jul 12, 2012 2:47 pm

rray, I was never able to get the original procedure to work...

I came up w/ my own, and packaged everything into a basic support tarball... see above in this thread... look for Quickstart ... note that this involves a U-Boot change...

rray
Posts: 8
Joined: Fri Jul 06, 2012 10:11 am

Re: Debian squeeze on NSA-320

Post by rray » Fri Jul 13, 2012 6:39 pm

I used kwboot to load your uboot.NAND-NSA320-IDEfixedv4-scripted.kwb from your NSA320quickstart. Then restored all environment variables I had saved from when the machine was new. Tried to boot and got nowhere. One thing I notice is that your uboot disables the cache and the original uboot enables it. Also notice that uboot reports an uncompressed kernel yet continues to uncompress it.

NSA320> boot

NAND read: device 0 offset 0xc80000, size 0xa00000
10485760 bytes read: OK
## Booting kernel from Legacy Image at 02000000 ...
Image Name: Linux-2.6.31.8
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 5909960 Bytes = 5.6 MiB
Load Address: 00008000
Entry Point: 00008000
Verifying Checksum ... OK
Loading Kernel Image ... OK
OK

Starting kernel ...

Uncompressing Linux............................................................................................................................................................................................................................................................................... done, booting the kernel.

Post Reply