NSLU2 Memory Upgrade
Aus CaiaWiki
Wichtiger Hinweis : Diese Seite ist unvollständig und wird gerade überarbeitet.
Im Moment handelt es sich um ein Ansammlung von Notizen zu Schritten auf dem Weg zu einer NSLU2 mit 128MB RAM. Momentan gibt es allerdings ein "blocking issue" -> siehe Kapitel Debian Image for FatSlug.
Inhaltsverzeichnis |
Idee
Der Network Storage Link for USB 2.0 Disk Drives (NSLU2) oder einfach kurz Slug bietet die Möglichkeit, ein alternatives Linux zu installieren. Damit kann er als vollwertiger Server mit sehr geringem Stromverbrauch genutzt werden.
What you need
Zum Anschluss des seriellen Ports (J2) des Slugs bietet sich ein altes Datentransferkabel vom Siemens MC60 Mobiltelefon an.
Pinbelegung Siemens C55/MC60:
http://pinouts.ru/CellularPhones-P-W/siemens_c55_pinout.shtml
Update: Das MC60/C55 - Datenkabel funktioniert nicht als Levelkonverter für den Slug.
Daher wird ein Siemens S25 Datenkabel benötigt. Die Pinbelegung des S25 gibt es hier:
http://pinouts.ru/CellularPhones-P-W/siemens_c25_s25_pinout.shtml
Boot Meldungen
Nach dem Umbau des S25-Levelkonverters und Anschluß an den Slug kann man sich mit folgendem Befehl mit der seriellen Schnittstelle (115200 Baud, 8 Datenbits, no parity) des Slugs verbinden:
cu -l /dev/ttyS0 -s 115200
und erhält nachfolgende Bootmeldungen:
Ethernet eth0: MAC address 00:01:23:45:67:89 IP: 192.168.0.1/255.255.255.0, Gateway: 192.168.0.1 Default server: 0.0.0.0, DNS server IP: 0.0.0.0 RedBoot(tm) bootstrap and debug environment [ROMRAM] Red Hat certified release, version 1.92 - built 15:16:07, Feb 3 2004 Platform: IXDP425 Development Platform (XScale) Copyright (C) 2000, 2001, 2002, Red Hat, Inc. RAM: 0x00000000-0x02000000, 0x000723a0-0x01ff3000 available FLASH: 0x50000000 - 0x50800000, 64 blocks of 0x00020000 bytes each. == Executing boot script in 2.000 seconds - enter ^C to abort RedBoot> boot;exec 0x01d00000 have eRcOmM copy kernel code from flash to RAM copy ramdisk file from flash to RAM run kernel Using base address 0x01d00000 and length 0x000d39c8 Uncompressing Linux........................................................... done, booting the kernel. Linux version 2.4.22-xfs (root@sure_linux) (gcc version 3.2.1) #377 Fri Jul 2 09:02:32 CST 2004 CPU: XScale-IXP425/IXC1100 revision 1 Machine: Intel IXDP425 Development Platform Warning: bad configuration page, trying to continue Security risk: creating user accessible mapping for 0x60000000 at 0xff00f000 Security risk: creating user accessible mapping for 0x51000000 at 0xf1000000 On node 0 totalpages: 8192 zone(0): 8192 pages. zone(1): 0 pages. zone(2): 0 pages. Kernel command line: console=ttyS0,115200 root=/dev/ram0 initrd=0x01000000,10M mem=32M@0x00000000 Calibrating delay loop... 263.78 BogoMIPS Memory: 32MB = 32MB total Memory: 20204KB available (1454K code, 244K data, 236K init) Dentry cache hash table entries: 4096 (order: 3, 32768 bytes) Inode cache hash table entries: 2048 (order: 2, 16384 bytes) Mount cache hash table entries: 512 (order: 0, 4096 bytes) Buffer cache hash table entries: 1024 (order: 0, 4096 bytes) Page-cache hash table entries: 8192 (order: 3, 32768 bytes) POSIX conformance testing by UNIFIX PCI Autoconfig: Found Bus 0, Device 1, Function 0 PCI Autoconfig: BAR 0, Mem, size=0x1000, address=0x4bfff000 PCI Autoconfig: Found Bus 0, Device 1, Function 1 PCI Autoconfig: BAR 0, Mem, size=0x1000, address=0x4bffe000 PCI Autoconfig: Found Bus 0, Device 1, Function 2 PCI Autoconfig: BAR 0, Mem, size=0x100, address=0x4bffdf00 PCI: bus0: Fast back to back transfers disabled Linux NET4.0 for Linux 2.4 Based upon Swansea University Computer Society NET3.039 Initializing RT netlink socket Starting kswapd VFS: Disk quotas vdquot_6.5.1 Journalled Block Device driver loaded i2c-core.o: i2c core module i2c-dev.o: i2c /dev entries driver module i2c-core.o: driver i2c-dev dummy driver registered. i2c-algo-bit.o: i2c bit algorithm module version 2.6.1 (20010830) pty: 256 Unix98 ptys configured Serial driver version 5.05c (2001-07-08) with MANY_PORTS SHARE_IRQ SERIAL_PCI enabled ttyS00 at 0xff000003 (irq = 15) is a XScale UART ttyS01 at 0xff001003 (irq = 13) is a XScale UART RAMDISK driver initialized: 16 RAM disks of 16384K size 1024 blocksize SCSI subsystem driver Revision: 1.00 * host:<NULL> cfi_cmdset_0001: Erase suspend on write enabled Using buffer write method Using static MTD partitions. Creating 4 MTD partitions on "IXP425 Flash": 0x00000000-0x00040000 : "RedBoot " 0x00040000-0x00060000 : "System Configuration" 0x00060000-0x00160000 : "Kernel" 0x00160000-0x00800000 : "Ramdisk" usb.c: registered new driver hub pci probe begin ehci_hcd 00:01.2: NEC Corporation USB 2.0 ehci_hcd 00:01.2: irq 26, pci mem c3801f00 usb.c: new USB bus registered, assigned bus number 1 PCI: 00:01.2 PCI cache line size set incorrectly (0 bytes) by BIOS/FW. PCI: 00:01.2 PCI cache line size corrected to 32. ehci_hcd 00:01.2: USB 2.0 enabled, EHCI 1.00, driver 2003-Jun-19/2.4 hub.c: USB hub found hub.c: 5 ports detected pci probe ok host/usb-uhci.c: $Revision: 1.1 $ time 09:03:03 Jul 2 2004 host/usb-uhci.c: High bandwidth mode enabled host/usb-uhci.c: v1.275:USB Universal Host Controller Interface driver host/usb-ohci.c: USB OHCI at membase 0xc3809000, IRQ 28 host/usb-ohci.c: usb-00:01.0, NEC Corporation USB usb.c: new USB bus registered, assigned bus number 2 hub.c: USB hub found hub.c: 3 ports detected host/usb-ohci.c: USB OHCI at membase 0xc380f000, IRQ 27 host/usb-ohci.c: usb-00:01.1, NEC Corporation USB (#2) usb.c: new USB bus registered, assigned bus number 3 hub.c: USB hub found hub.c: 2 ports detected Initializing USB Mass Storage driver... usb.c: registered new driver usb-storage USB Mass Storage support registered. i2c-dev.o: Registered 'IXP425 I2C Adapter' as minor 0 i2c-core.o: adapter IXP425 I2C Adapter registered as adapter 0. NET4: Linux TCP/IP 1.0 for NET4.0 IP Protocols: ICMP, UDP, TCP, IGMP IP: routing cache hash table of 512 buckets, 4Kbytes TCP: Hash tables configured (established 2048 bind 4096) IP-Config: No network devices available. NET4: Unix domain sockets 1.0/SMP for Linux NET4.0. NetWinder Floating Point Emulator V0.97 (double precision) RAMDISK: Compressed image found at block 0 Freeing initrd memory: 10240K VFS: Mounted root (ext2 filesystem) readonly. Freeing init memory: 236K Insmod ixp400 Using /lib/modules/2.4.22-xfs/kernel/drivers/ixp400/ixp400.o Warning: loading ixp400 will taint the kernel: no license See http://www.tux.org/lkml/#export-tainted for information about tainted modules Module init. Insmod ixp425 Using /lib/modules/2.4.22-xfs/kernel/drivers/net/ixp425_eth.o ixp425_eth: Initializing IXP425 NPE Ethernet driver software v. 1.1 ixp425_eth: CPU clock speed (approx) = 0 MHz [error] ixEthMiiPhyScan : unexpected Mii PHY ID 00008201 ixp425_eth: ixp0 is using the PHY at address 0 ixp425_eth: ixp1 is using the PHY at address 1 ixp425_eth: ixEthMiiLinkStatus failed on PHY0. Can't determine the auto negotiated parameters. Using default values. BusyBox v0.60.4 (2004.07.01-03:05+0000) Built-in shell (ash) Enter 'help' for a list of built-in commands. # Creating ramfs for /var/lock/samba: Limit the space of log folder: Starting Hostname : OK Starting Modules : Using /lib/modules/pbuttons.o Using /lib/modules/2.4.22-xfs/kernel/drivers/char/x1226-rtc.o X1226: I2C based RTC driver. i2c-core.o: driver X1226 registered. X1226: found X1226 on IXP425 I2C Adapter i2c-core.o: client [X1226] registered to adapter [IXP425 I2C Adapter](pos. 0). atr is 20 enable_irq(22) unbalanced from c58b51bc Using /lib/modules/rbuttons.o Starting Modules : Setting LAN media type : Starting Set CGI_ds.conf: OK Restore time and timezone: 12/01/1999-08:23:31 OK Restore usrgrpshares: OK Generating telnet password: OK Starting WEB Server: OK OK Starting samba: Starting download: download uses obsolete (PF_INET,SOCK_PACKET) ixp425_eth: ixp0: Entering promiscuous mode device ixp0 entered promiscuous mode Starting INET Server: OK Creating ramfs for /tmp: Starting QuickSet Daemon : OK OK Starting Crond : Starting Rest Task : LKG36D0D6: boot complete! Checking quotas. This may take some time. OKDone. Turning on quota. Checking disk status :
Hinweis: Die MAC-Adresse wurde aus Sicherheitsgründen geändert.
32MB RAM Slug herunterfahren
Ein schwerer Schritt nach:
root@slug:/public/incoming/Sources4Slug/RedBoot/ > busybox uptime 19:03:26 up 253 days, 21:32, load average: 1.00, 1.02, 1.00
Allerdings sollte das hier (hoffentlich) bald anders aussehen:
root@slug:/public/incoming/Sources4Slug/RedBoot/ > free
total used free shared buffers
Mem: 30524 29420 1104 0 9452
Swap: 120480 48900 71580
Total: 151004 78320 72684
Linksys Firmware zurückflashen
Vor der Installation sollten alle HDDs/USB-Sticks etc. am Slug angeschlossen sein ...
Falls also nach der Unslung-Installation ein Zurückschreiben der Original Linksys Firmware notwendig sein sollte, hier die notwendigen Schritte:
1. Download der Linksys Firmware und entpacken.
2. Installation von upslug2 (in Ubuntu Edgy/Feisty in den univers Repositories)
3. Aktivieren des NSLU2-Upgrade-Modes
4. Start von
sudo upslug2 --image="/localhome/failback/incoming/NSLU2_V23R72.bin"
Auslesen des Original RedBoot Bootloaders
dd if=/dev/mtdblock0 of=redboot.bin
Überprüfung der MD5 sum vor der Übertragung zum PC:
md5sum redboot.bin e72c7b8b760f69395bbc793cedecb11a redboot.bin
Auf dem PC:
Ändern des SDR_CONFIG Registers an Adresse (Offset)
0x0020b0 von e3a01008 -> e3a0100a
und Überprüfung der MAC Adresse des Slugs an Adresse 0x3FFB0
Aufsetzen des tftpd Servers
sudo apt-get install tftpd-hpa netbase debconf
und daemon enablen
vi /etc/default/tftpd-hpa /etc/init.d/tftpd-hpa start cp /Transfer/FatSlug/redboot.bin /var/lib/tftpboot/
Hinweis: Im File /Transfer/FatSlug/redboot.bin ist das SDR_Config Register bereits angepasst. Original-Redboot-Loader = redboot_original.bin (!!)
Installation der Xmodem-Tools:
sudo apt-get install lrzsz
man sx man rx
Einrichten des TFTP Servers + Flashen des Bootloaders
Start/Stop:
/etc/init.d/tftpd-hpa start|stop
Konfiguration
/etc/default/tftpd-hpa
Check
netstat -uap
Starten des tftp-Servers
in.tftpd -l -a 192.168.0.2:69
RedBoot> load -r -v -b 0x01000000 -h 192.168.0.2 redboot.bin
liefert:
Using default protocol (TFTP) - Raw file loaded 0x01000000-0x0103ffff, assumed entry at 0x01000000
Danach unbedingt überprüfen:
RedBoot> cksum -b 0x01000000 -l 0x40000 POSIX cksum = 4161518743 262144 (0xf80bbc97 0x00040000)
Überprüfung der Checksum des Originals:
failback@caiacoa:/var/lib/tftpboot$ cksum redboot.bin 4161518743 262144 redboot.bin
Nachdem die Checksummen übereinstimmen, kann der Bootloader geflasht werden (high risk)
RedBoot> fis write -f 0x50000000 -b 0x01000000 -l 0x40000
* CAUTION * about to program FLASH
at 0x50000000..0x5003ffff from 0x01000000 - continue (y/n)? y
... Erase from 0x50000000-0x50040000: ..
Reboot!
Ergebnis: Der Slug bootet noch, allerdings erscheint beim Booten immer noch obige Meldung
Memory: 32MB = 32MB total
Auch kann der Linux-Kernel noch geladen werden. Ein Login via ssh ist möglich, allerdings liefern einige Befehle folgende Meldung:
# ps ps: Input/output error
Scheinbar funktioniert der Zugriff auf die angeschlossene USB-HDD nicht mehr.
To be continued ...
Kurz - Memo
Apex Compile
cp src/mach-ixp42x/debian-nslu2-arm_config .config
root@slug:/home/caiacoa/fatslug/Apex/apex-1.5.8/include/ > ln -s /opt/armeb/lib/gcc-lib/armv5b-softfloat-linux/3.3.5/include/stdarg.h stdarg.h
root@slug:/home/caiacoa/fatslug/Apex/apex-1.5.8/ > make
Danach befindet sich unter src/arch-arm/rom/ die neue apex.bin
slug@caiacoa:~$ cu -l /dev/ttyS0 -s 115200
Slug -> Power On
^C
RedBoot> ip_address -l 192.16.92.66
slug@caiacoa:~$ sudo in.tftpd -l -a 192.16.92.105:69 slug@caiacoa:~$ ls /var/lib/tftpboot/ redboot.bin redboot_original.bin
DOWNLOAD
RedBoot> load -r -v -b 0x01000000 -h 192.16.92.105 redboot_original.bin Using default protocol (TFTP) - Raw file loaded 0x01000000-0x0103ffff, assumed entry at 0x01000000
Checken
slug@caiacoa:~$ cksum /Transfer/FatSlug/redboot_original.bin
Flashen
RedBoot> fis write -f 0x50000000 -b 0x01000000 -l 0x40000
* CAUTION * about to program FLASH
at 0x50000000..0x5003ffff from 0x01000000 - continue (y/n)? y
... Erase from 0x50000000-0x50040000: ..
RedBoot> reset ... Resetting.+Ethernet eth0: MAC address 00:01:02:03:04:ee IP: 192.168.0.1/255.255.255.0, Gateway: 192.168.0.1 Default server: 0.0.0.0, DNS server IP: 0.0.0.0 RedBoot(tm) bootstrap and debug environment [ROMRAM] Red Hat certified release, version 1.92 - built 15:16:07, Feb 3 2004 Platform: IXDP425 Development Platform (XScale) Copyright (C) 2000, 2001, 2002, Red Hat, Inc. RAM: 0x00000000-0x02000000, 0x000723a0-0x01ff3000 available FLASH: 0x50000000 - 0x50800000, 64 blocks of 0x00020000 bytes each. == Executing boot script in 2.000 seconds - enter ^C to abort ^C
Misc
passwd (für public hdd access via Webinterface) liegt in /share/hdd/conf
Debian Image for FatSlug
Nachdem mir freundlicherweise Glenn ein fertig gepatchtes DebianInstaller Image für den FatSlag gemailt hat, konnte erfolgreich Debian installiert werden. Leider stürzt der FatSlug bei der Benutzung von mehr als 128MB (FatSlug starts to swap) zuverlässig ab. Ursache ist der auf der Kernel Bug Tracker List beschriebene Fehler
Bug 7760 "Page Allocation Failure on ixp4xx (nslu2) with 128MB RAM"
Leider gibt es noch keinen Bugfix dafür.
Problem ist u.a. auch hier beschrieben. Interessant dazu sind
Log aus dem NSLU2_General Channel vom 15.04.2007 und Log aus dem NSLU2_General Channel vom 22.04.2007.
Ich habe deshalb den Inhalt hier nochmal gesichert.
Links zu eventuellen Lösungsmöglichkeiten:
http://lists.arm.linux.org.uk/pipermail/linux-arm-kernel/2004-April/020851.html
Links
Hinweise, um evtl. weiterhin RedBoot benutzen zu können (I)
NSLU2 mit 128MB Speicher, incl. Bildern vom Umbau
Test an Image in RAM using RedBoot -Lesen! (III)
NSLU2 Probleme mit Drives < 10GB + USB Sticks
Disk Behaviour with Linksys R63 Firmware
Troubleshoot a drive missing condition

