OpenWrt Forum Archive

Topic: [WIP] OpenWrt on Netgear Stora

The content of this topic has been archived on 6 May 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi there!

I'm trying to install OpenWrt on a Netgear Stora low cost NAS. As far as I know, this is still untested.

For now, I've gained access to the bootloader through the serial console:
Bootloader (Marvell U-Boot)

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

U-Boot 1.1.4 (May 30 2011 - 09:26:20) Marvell version: 3.4.15

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

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

DRAM CAS Latency = 5 tRP = 5 tRAS = 18 tRCD=6
DRAM CS[0] base 0x00000000   size  64MB 
DRAM CS[1] base 0x04000000   size  64MB 
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:256 MB
CRC in Flash: 54317363, Calculated CRC: 54317363

CPU : Marvell Feroceon (Rev 1)

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:  0 
Marvell>> 
Marvell>>

U-Boot printenv

Marvell>> printenv
baudrate=115200
loads_echo=0
ipaddr=10.4.50.165
serverip=10.4.50.5
rootpath=/mnt/ARM_FS/
netmask=255.255.255.0
CASset=min
MALLOC_len=1
ethprime=egiga1
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;
ethmtu=1500
eth1addr=00:50:43:00:02:02
eth1mtu=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
loidaddr=0x02000000
autoload=no
bootargs_root=ubi.mtd=2,2048 root=ubi0:rootfs rootfstype=ubifs init=/linuxrc
console=console=ttyS0,115200
mainlineLiNux=no
fw_up=disable
bootcmd=nand read.e 0x800000 0x100000 0x300000; setenv bootargs $(console) $(bootargs_root); bootm 0x800000
ethaddr=E0:46:9A:84:28:BD
stdin=serial
stdout=serial
stderr=serial
mainlineLinux=no
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=3
disaMvPnp=no
hddPowerCtrl=no
loadaddr=0x02000000
enaAutoRecovery=no
ethact=egiga1

Environment size: 1257/131068 bytes

OS boot (HipServ OS d'Axentra - Linux 2.6.22 based)

Marvell>> boot

NAND read: device 0 offset 0x100000, size 0x300000

Bad block at 0x300000 in erase block from 0x300000 will be skipped
Reading data from 0x41f800 -- 100% complete.
 3145728 bytes read: OK
## Booting image at 00800000 ...
   Image Name:   Linux-2.6.22.18-Netgear
   Created:      2011-05-26  15:05:01 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2789276 Bytes =  2.7 MB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
OK

Starting kernel ...

Uncompressing Linux............................................................................................................................................................ done, booting the kernel.
Linux version 2.6.22.18-Netgear (mostafah@es5x86.axentra.com) (gcc version 4.2.1) #11 Thu May 26 11:04:55 EDT 2011
CPU: ARM926EJ-S [56251311] revision 1 (ARMv5TE), cr=00053977
Machine: Feroceon-KW
Using UBoot passing parameters structure
Memory policy: ECC disabled, Data cache writeback
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: console=ttyS0,115200 ubi.mtd=2,2048 root=ubi0:rootfs rootfstype=ubifs init=/linuxrc
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: 64MB 64MB 0MB 0MB = 128MB total
Memory: 124800KB available (4048K code, 268K data, 692K init)
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
NET: Registered protocol family 16

CPU Interface
-------------
SDRAM_CS0 ....base 00000000, size  64MB 
SDRAM_CS1 ....base 04000000, size  64MB 
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.2.7_patch21)-- RD-88F6281A  Soc: 88F6281 A1 LE

 Detected Tclk 200000000 and SysClk 333333333 
MV Buttons Device Load
Marvell USB EHCI Host controller #0: c063d600
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
RTC has been updated!!!
RTC registered
Use the XOR engines (acceleration) for enhancing the following functions:
  o RAID 5 Xor calculation
  o kernel memcpy
  o kenrel memzero
Number of XOR engines to use: 4
cesadev_init(c000eed0)
mvCesaInit: sessions=640, queue=64, pSram=f0000000
MV Buttons Driver Load
JFFS2 version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
io scheduler noop registered
io scheduler anticipatory registered (default)
Serial: 8250/16550 driver $Revision: 1.90 $ 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
loop: module loaded
Loading Marvell Ethernet Driver:
  o Cached descriptors in DRAM
  o DRAM SW cache-coherency
  o Multi RX Queue support - 4 RX queues
  o Multi TX Queue support - 2 TX Queues
  o TCP segmentation offload enabled
  o Receive checksum offload enabled
  o Transmit checksum offload enabled
  o Network Fast Processing (Routing) supported
  o Network Fast Processing (NAT) supported
  o Driver ERROR statistics enabled
  o Driver INFO statistics enabled
  o Proc tool API enabled
  o Gateway support enabled
     o Using Marvell Header Mode
     o L2 IGMP support
  o Rx descripors: q0=128 q1=128 q2=128 q3=128
  o Tx descripors: q0=532 q1=532
  o Loading network interface(s):
    o eth0, ifindex = 1, GbE port = 0
    o eth1, ifindex = 2, GbE port = 1

mvFpRuleDb (c7978000): 1024 entries, 4096 bytes
Intel(R) PRO/1000 Network Driver - version 7.3.20-k2-NAPI
Copyright (c) 1999-2006 Intel Corporation.
e100: Intel(R) PRO/100 Network Driver, 3.5.17-k4-NAPI
e100: Copyright(c) 1999-2006 Intel Corporation
Integrated Sata device found
scsi0 : Marvell SCSI to SATA adapter
scsi1 : Marvell SCSI to SATA adapter
NFTL driver: nftlcore.c $Revision: 1.98 $, nftlmount.c $Revision: 1.41 $
NAND device: Manufacturer ID: 0xec, Chip ID: 0xda (Samsung NAND 256MiB 3,3V 8-bit)
Scanning device for bad blocks
Bad eraseblock 24 at 0x00300000
Bad eraseblock 769 at 0x06020000
Bad eraseblock 901 at 0x070a0000
Bad eraseblock 1024 at 0x08000000
Bad eraseblock 1117 at 0x08ba0000
Bad eraseblock 1576 at 0x0c500000
Bad eraseblock 1826 at 0x0e440000
Using static partition definition
Creating 3 MTD partitions on "nand_mtd":
0x00000000-0x00100000 : "u-boot"
0x00100000-0x00700000 : "uImage"
0x00700000-0x10000000 : "root"
UBI: attaching mtd2 to ubi0
UBI: physical eraseblock size:   131072 bytes (128 KiB)
UBI: logical eraseblock size:    126976 bytes
UBI: smallest flash I/O unit:    2048
UBI: sub-page size:              512
UBI: VID header offset:          2048 (aligned 2048)
UBI: data offset:                4096
UBI: attached mtd2 to ubi0
UBI: MTD device name:            "root"
UBI: MTD device size:            249 MiB
UBI: number of good PEBs:        1986
UBI: number of bad PEBs:         6
UBI: max. allowed volumes:       128
UBI: wear-leveling threshold:    4096
UBI: number of internal volumes: 1
UBI: number of user volumes:     1
UBI: available PEBs:             0
UBI: total number of reserved PEBs: 1986
UBI: number of PEBs reserved for bad PEB handling: 38
UBI: max/mean erase counter: 1/0
UBI: background thread "ubi_bgt0d" started, PID 285
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
USB Universal Host Controller Interface driver v3.0
usb 1-1: new high speed USB device using ehci_marvell and address 2
usb 1-1: configuration #1 chosen from 1 choice
usbcore: registered new interface driver usblp
drivers/usb/class/usblp.c: v0.13: USB Printer Device Class driver
Initializing USB Mass Storage driver...
scsi2 : SCSI emulation for USB Mass Storage devices
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
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
raid6: int32x1     81 MB/s
raid6: int32x2     95 MB/s
raid6: int32x4    102 MB/s
raid6: int32x8     92 MB/s
raid6: using algorithm int32x4 (102 MB/s)
md: raid6 personality registered for level 6
md: raid5 personality registered for level 5
md: raid4 personality registered for level 4
raid5: measuring checksumming speed
   arm4regs  :   903.600 MB/sec
   8regs     :   629.200 MB/sec
   32regs    :   750.000 MB/sec
raid5: using function: arm4regs (903.600 MB/sec)
device-mapper: ioctl: 4.11.0-ioctl (2006-10-12) initialised: dm-devel@redhat.com
dm_crypt using the OCF package.
sdhci: Secure Digital Host Controller Interface driver
sdhci: Copyright(c) Pierre Ossman
usbcore: registered new interface driver usbhid
drivers/hid/usbhid/hid-core.c: v2.6:USB HID core driver
Netfilter messages via NETLINK v0.30.
nf_conntrack version 0.5.0 (1024 buckets, 8192 max)
mvFpNatDb (c7849000): 1024 entries, 4096 bytes
ip_tables: (C) 2000-2006 Netfilter Core Team
TCP cubic registered
NET: Registered protocol family 1
NET: Registered protocol family 17
NFP (fdb) init 256 entries, 1024 bytes
Bridge firewalling registered
802.1Q VLAN Support v1.8 Ben Greear <greearb@candelatech.com>
All bugs added by David S. Miller <davem@redhat.com>
md: Autodetecting RAID arrays.
md: autorun ...
md: ... autorun DONE.
Freeing init memory: 692K
Reset button not pressed
Proceeding normally.
UBIFS: recovery needed
UBIFS: recovery completed
UBIFS: mounted UBI device 0, volume 0, name "rootfs"
UBIFS: file system size:   239857664 bytes (234236 KiB, 228 MiB, 1889 LEBs)
UBIFS: journal size:       9023488 bytes (8812 KiB, 8 MiB, 72 LEBs)
UBIFS: media format:       4 (latest is 4)
UBIFS: default compressor: zlib
UBIFS: reserved for root:  0 bytes (0 KiB)
INIT: version 2.86 booting
                Welcome to HipServ
                Press 'I' to enter interactive startup.
System clock set to hardware clock.
Setting clock : Sat Oct 15 15:52:49 GMT-2 2011 [  OK  ]
Starting udev: [  OK  ]
Setting hostname axentraserver.localdomain:  [  OK  ]
Setting up Logical Volume Management:   No volume groups found
[  OK  ]
Checking filesystems
Checking all file systems.
[  OK  ]
Mounting local filesystems:  mount: sysfs already mounted or /sys busy
mount: according to mtab, /sys is already mounted on /sys
[FAILED]
Enabling /etc/fstab swaps:  [  OK  ]
INIT: Entering runlevel: 3
Entering non-interactive startup
HipServ startup:Alarm cleared.
[FAILED]
Starting netgear-lifecycle:[  OK  ]
Starting reset:  [  OK  ]
Bringing up loopback interface:  [  OK  ]
Bringing up interface eth0:  
Determining IP information for eth0... done.
/etc/init.d/iptables: line 42: /etc/sysconfig/networking/oe-profiles/default/ifcfg-eth0: No such file or directory
FATAL: Module ip_conntrack not found.
FATAL: Module iptable_nat not found.
FATAL: Module xt_tcpudp not found.
Flushing all current rules and user defined chains: [  OK  ]
Clearing all current rules and user defined chains: [  OK  ]
Applying iptables firewall rules: 
[  OK  ]
[  OK  ]
check_igd.pl: no process killed
[  OK  ] igd-daemon:[  OK  ]
Starting system logger: [  OK  ]
Starting kernel logger: [  OK  ]
Starting locator:[  OK  ]
Starting system message bus: [  OK  ]
Starting sshd: [  OK  ]
Starting cups: [  OK  ]
Starting xinetd: [  OK  ]
Starting vsftpd for vsftpd: [  OK  ]
Starting backupagent: [  OK  ]
Starting httpd: [  OK  ]
Starting appserver: [  OK  ]
Starting crond: [  OK  ]
Starting AppleTalk services: 
  Starting cnid_metad:[  OK  ]
  Starting afpd:[  OK  ]

Starting SMB services: [  OK  ]
Starting NMB services: [  OK  ]
Starting OEone System Proxy: SPD starting....log level=1, uid=0

[  OK  ]
Starting access-patrol:[  OK  ]
Starting Avahi daemon... [  OK  ]
Starting minidlna.init:  Starting /usr/sbin/minidlna ... Media directory not accessible! [/home/0common/FamilyPhotos]
Media directory not accessible! [/home/0common/FamilyMusic]
Media directory not accessible! [/home/0common/FamilyDocuments]
Media directory not accessible! [/home/0common/FamilyVideos]

[  OK  ]
0
/etc/init.d/iptables: line 42: /etc/sysconfig/networking/oe-profiles/default/ifcfg-eth0: No such file or directory
FATAL: Module ip_conntrack not found.
FATAL: Module iptable_nat not found.
FATAL: Module xt_tcpudp not found.
Flushing all current rules and user defined chains: [  OK  ]
Clearing all current rules and user defined chains: [  OK  ]
Applying iptables firewall rules: 
[  OK  ]
Starting DAAP server: [  OK  ]
Starting mynetworkd:[  OK  ]
    HipServ - Checking if RAID needs to be rebuilt
         Starting RAID monitor
2260
        HipServ - Updating RAID lights
    HipServ - Bringing up iptables
    HipServ - Updating date...
Error : Temporary failure in name resolution
15 Oct 15:54:56 ntpdate[2386]: can't find host 0.pool.ntp.org

15 Oct 15:54:56 ntpdate[2386]: no servers can be used, exiting
        success
    HipServ - Checking for updates...
        success
    HipServ - Enabling swap
         *** WARNING: Could not start swapfile ***
    HipServ - Cleaning USB mountpoints
    HipServ - Mounting USB devices

    HipServ -  Checking for FTPS certificate
        HipServ - Found vsftpd key file
    HipServ - Starting spindownd: [  OK  ]
    HipServ - Starting usbreaderd: [  OK  ]
    HipServ -  Ensuring that table structures are up-to-date
HipServ - boot complete

axentraserver.localdomain login:

I do not have root access to the NAS: there are several documented procedures, but all of them require the NAS to be registered with the Neatger's dedicated web site. And, even if it's a brand new device, I would like to avoid that - call me paranoid if you want wink 

Anyway, here are some more data directly from wiki.openwtora.com:

http://www.openstora.com/wiki/index.php?title=How_to_install_your_custom_firmware wrote:

The original Stora have three partitions:

   1. -Original-U-BOOT (1Mb)
   2. -Original-Kernel (6Mb)
   3. -Original-ROOTFS (249Mb)

# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00100000 00020000 "u-boot"
mtd1: 00600000 00020000 "uImage"
mtd2: 0f900000 00020000 "root"

On the same page, there is the layout for a custom firmware:

http://www.openstora.com/wiki/index.php?title=How_to_install_your_custom_firmware wrote:

The custom firmware will be:

   1. -Original-U-BOOT (1Mb)
   2. -NEW-Kernel (4Mb)
   3. -NEW-ROOTFS (251Mb)

# cat /proc/mtd 
dev:    size   erasesize  name
mtd0: 00100000 00020000 "u-boot"
mtd1: 00400000 00020000 "uImage"
mtd2: 0fb00000 00020000 "root"

I didn't try yet to burn the flash. My hope was to be able to a least boot an alternate kernel from RAM. But with no luck:

Marvell>> usb start
(Re)start USB...
USB:   scanning bus for devices... 2 USB Device(s) found
       scanning bus for storage devices... 1 Storage Device(s) found
Marvell>> fatls usb 0:3
   935056   wnr854t-uimage 
  2490368   squashfs.img 
  2490368   wnr854t-squashfs.img 
  2426880   openwrt-kirkwood-rootfs.tar 
  1122376   openwrt-kirkwood-uimage 
  1245188   openwrt-kirkwood-sheevaplug-jffs2-64k.img 
   935016   openwrt-wrt350nv2-uimage 

7 file(s), 0 dir(s)

Marvell>> fatload usb 0:3 0x1100000 openwrt-wrt350nv2-uimage 
reading openwrt-wrt350nv2-uimage
...........................................................................................

935016 bytes read
Marvell>> setenv bootargs console=ttyS0,115200n8 
Marvell>> bootm 0x1100000
## Booting image at 01100000 ...
   Image Name:   Linux-3.0.3
   Created:      2011-10-15  23:23:23 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    934952 Bytes = 913 kB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.

***** Here the device appears to "hang".

Since I'm not even quite sure of the right target, I tried that both with orion and kirkwood uImage.

I fell a little bit stuck here, so I'll be glad for any hint or advice big_smile

Thanks in advance.

- Sylvain

Hi,

And thanks for the reply,

MBS wrote:

From what I understand, you can easily gain root access on serial console without registering with netgear: http://www.openstora.com/wiki/index.php … _Connected

No, no: it's a pity, but you must first create an account, and for that, the registration is mandatory:

http://www.openstora.com/wiki/index.php?title=Root_Access_Via_Serial_Console#Getting_Connected wrote:

Once you get the Linux login prompt, you can login using your regular account credentials as you do on mystora.com.

In fact, you just can't configure the device without Internet connection!

Anyway, since I have access to the bootloader, I should be able to boot an alternate firmware from there, without requiring any access to the root account of the original firmware.

But for now, any openwrt image I've tried to load and boot from RAM ends up (at best) in a hang after Uncompressing Linux... done, booting the kernel.. Here are the kind of commands I've been using:

Marvell>> usb start
Marvell>> fatload usb 0:3 0x800000 openwrt-wnr854t-uImage
Marvell>> setenv bootargs console=ttyS0,115200n8 
Marvell>> setenv arcNumber 1666
Marvell>> setenv mainlineLinux yes
Marvell>> saveenv
Marvell>> bootm 0x800000

But maybe it is just not possible to boot from RAM ?

(Last edited by sleroux on 16 Oct 2011, 20:51)

What about the tftp method? Seems like a custom image to give root access. Or, dump that mtd-partition containing the rootfs, extract and mount it, change /etc/shadow and either flash it back, or change the root= parameter in your bootargs to point to that changed rootfs.

Thanks again -  you've right: I didn't pay enough attention to the tftp/nfs method. I tried it this morning, but I didn't managed to have the kernel load the given root file system, mostly due to a problem with the NFS server configuration and/or boot arguments.

Anyway, having root access to the default netgear firmware is not a priority. The good news is I was able to load and boot the given kernel (Linux version 2.6.22.18-Netgear (root@ubuntu-desktop) (gcc version 4.2.1) #1 Tue Feb 16 10:54:25 PST 2010) on the neatgear stora. The next step will be to build and load (and boot) an openwrt kernel from RAM. But to be honest, I have no idea why  2.6.22.18-Netgear boots but not any stock openwrt kernel.


- Sylvain

Thank you for the pointer! I will try to compile a kernel from the netgear source.

- Sylvain

Hi,

I did success in compiling the netgear kernel by using the latest uclib/buildroot toolchain (http://buildroot.uclibc.org/downloads/b … 08.tar.bz2). The kernel loads and run smoothly on the Stora. It's a 2.6.22 kernel. And it appears to be the kernel shipped with the device.

More interesting, I was able to compile a 3.0.4 vanilla kernel from kernel.org using the same toolchain. It boots perfectly when loaded from RAM on the Stora too. I tinkered a lot the .config file, but I think the relevant options are:

CONFIG_ARM=y
CONFIG_MACH_DB88F6281_BP=y
CONFIG_PLAT_ORION=y
CONFIG_CPU_FEROCEON=y
# CONFIG_CPU_FEROCEON_OLD_ID is not set
CONFIG_ARCH_KIRKWOOD=y

I'm not quite sure if all of them are required.


So for now, I have several custom build kernel. But still no rootfs. Is there a way to build an openwrt firmware using one of these kernel? Each time I make a build from the root of my openwrt dev tree, it insists on building a new (non working) kernel from the sources.

- Sylvain.

Great success. But what I actually meant by looking how the kernel is treated by the sdk is if it gets compressed, and maybe how, if it gets a certain header or anything similar. It might help to invoke make with V=99 to get all messages. Besides that, it is also a good idea to dig into Makefiles and Kconfigs.

Hi,

I didn't make any significant progress since the other day.

Compiling the netgear kernel with V=1 does not show any peculiarity. I've build manually made a U-Boot image from vmlinux it boots and works (up to the kernel panic "Unable to mount root fs"):

sh$ make -j 9 CROSS_COMPILE=arm-unknown-linux-uclibcgnueabi- V=1
sh$ arm-unknown-linux-uclibcgnueabi-objcopy -O binary vmlinux vmlinux.bin
sh$ mkimage -A arm -O linux -T kernel -C none -a 0x8000 -e 0x8000 -n "Linux 2.6" -d vmlinux.bin  vmlinux.uimage
sh$ cp  vmlinux.uimage /srv/tftp/netgear-vmlinux.uimage

I tried to boot thel custom-build netgear kernel using the factory rootfs still present in flash. I used what I think is the same boot command as used by netgear, only loading my kernel throught tftp instead of using the one found on flash.

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

U-Boot 1.1.4 (May 30 2011 - 09:26:20) Marvell version: 3.4.15

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

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

DRAM CAS Latency = 5 tRP = 5 tRAS = 18 tRCD=6
DRAM CS[0] base 0x00000000   size  64MB 
DRAM CS[1] base 0x04000000   size  64MB 
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:256 MB
CRC in Flash: 87b70f51, Calculated CRC: 87b70f51

CPU : Marvell Feroceon (Rev 1)

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:  0 
Marvell>> tftpboot 0x800000 netgear-vmlinux.uimage
egiga1 no link
Using egiga0 device
TFTP from server 10.129.38.81; our IP address is 10.129.38.45
Filename 'netgear-vmlinux.uimage'.
Load address: 0x800000
Loading: #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         ############################################################
done
Bytes transferred = 4630188 (46a6ac hex)
Marvell>> setenv bootargs console=ttyS0,115200 panic=35 ubi.mtd=2,2048 root=/dev/mtdblock2 rootfstype=ubifs init=/linuxrc
Marvell>> bootm 0x800000
## Booting image at 00800000 ...
   Image Name:   Linux 2.6
   Created:      2011-10-19  18:30:33 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    4630124 Bytes =  4.4 MB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
OK

As you can see below, during the boot, the MTD/UBI subsystem reports many bad blocs (2048 - all of them?). As expected, the UBI rootfs cannot be loaded, and the whole process ends in a kernel panic:

Starting kernel ...

Linux version 2.6.22.18-Netgear (sylvain@kirkwood-dev) (gcc version 4.3.6 (Buildroot 2011.08) ) #3 Wed Oct 19 18:27:54 UTC 2011
CPU: ARM926EJ-S [56251311] revision 1 (ARMv5TE), cr=00053977
Machine: Feroceon-KW
Using UBoot passing parameters structure
Memory policy: ECC disabled, Data cache writeback
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: console=ttyS0,115200 panic=35 ubi.mtd=2,2048 root=/dev/mtdblock2 rootfstype=ubifs init=/linuxrc
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: 64MB 64MB 0MB 0MB = 128MB total
Memory: 125184KB available (4248K code, 272K data, 116K init)
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
NET: Registered protocol family 16

CPU Interface
-------------
SDRAM_CS0 ....base 00000000, size  64MB 
SDRAM_CS1 ....base 04000000, size  64MB 
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.2.7_patch21)-- RD-88F6281A  Soc: 88F6281 A1 LE

 Detected Tclk 200000000 and SysClk 333333333 
MV Buttons Device Load
Marvell USB EHCI Host controller #0: c05e0600
PEX0 interface detected no Link.
PCI: bus0: Fast back to back transfers enabled
SCSI Scattered Spinup:
SCSI Scattered Spinup Feature Status: Disabled
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
RTC has been updated!!!
RTC registered
Use the XOR engines (acceleration) for enhancing the following functions:
  o RAID 5 Xor calculation
  o kernel memcpy
  o kenrel memzero
Number of XOR engines to use: 4
cesadev_init(c000ca24)
mvCesaInit: sessions=640, queue=64, pSram=f0000000
MV Buttons Driver Load
squashfs: version 3.3 (2007/10/31) Phillip Lougher
squashfs: LZMA suppport for slax.org by jro
JFFS2 version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
io scheduler noop registered
io scheduler anticipatory registered (default)
Serial: 8250/16550 driver $Revision: 1.90 $ 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
Loading Marvell Ethernet Driver:
  o Cached descriptors in DRAM
  o DRAM SW cache-coherency
  o Multi RX Queue support - 4 RX queues
  o Multi TX Queue support - 2 TX Queues
  o TCP segmentation offload enabled
  o Receive checksum offload enabled
  o Transmit checksum offload enabled
  o Network Fast Processing (Routing) supported
  o Network Fast Processing (NAT) supported
  o Driver ERROR statistics enabled
  o Driver INFO statistics enabled
  o Proc tool API enabled
  o Gateway support enabled
     o Using Marvell Header Mode
     o L2 IGMP support
  o Rx descripors: q0=128 q1=128 q2=128 q3=128
  o Tx descripors: q0=532 q1=532
  o Loading network interface(s):
    o eth0, ifindex = 1, GbE port = 0
    o eth1, ifindex = 2, GbE port = 1

mvFpRuleDb (c79b6000): 1024 entries, 4096 bytes
Intel(R) PRO/1000 Network Driver - version 7.3.20-k2-NAPI
Copyright (c) 1999-2006 Intel Corporation.
e100: Intel(R) PRO/100 Network Driver, 3.5.17-k4-NAPI
e100: Copyright(c) 1999-2006 Intel Corporation
Integrated Sata device found
scsi0 : Marvell SCSI to SATA adapter
scsi1 : Marvell SCSI to SATA adapter
NFTL driver: nftlcore.c $Revision: 1.98 $, nftlmount.c $Revision: 1.41 $
NAND device: Manufacturer ID: 0xec, Chip ID: 0xda (Samsung NAND 256MiB 3,3V 8-bit)
Scanning device for bad blocks
Bad eraseblock 0 at 0x00000000
Bad eraseblock 1 at 0x00020000
Bad eraseblock 2 at 0x00040000
Bad eraseblock 3 at 0x00060000
Bad eraseblock 4 at 0x00080000
Bad eraseblock 5 at 0x000a0000
Bad eraseblock 6 at 0x000c0000
Bad eraseblock 7 at 0x000e0000
Bad eraseblock 8 at 0x00100000
Bad eraseblock 9 at 0x00120000
Bad eraseblock 10 at 0x00140000
Bad eraseblock 11 at 0x00160000
Bad eraseblock 12 at 0x00180000
Bad eraseblock 13 at 0x001a0000
Bad eraseblock 14 at 0x001c0000
Bad eraseblock 15 at 0x001e0000
Bad eraseblock 16 at 0x00200000
Bad eraseblock 17 at 0x00220000
Bad eraseblock 18 at 0x00240000
Bad eraseblock 19 at 0x00260000
Bad eraseblock 20 at 0x00280000
[ snip ]
 ... removed 2020 lines !
[ snip ]
Bad eraseblock 2040 at 0x0ff00000
Bad eraseblock 2041 at 0x0ff20000
Bad eraseblock 2042 at 0x0ff40000
Bad eraseblock 2043 at 0x0ff60000
Bad eraseblock 2044 at 0x0ff80000
Bad eraseblock 2045 at 0x0ffa0000
Bad eraseblock 2046 at 0x0ffc0000
Bad eraseblock 2047 at 0x0ffe0000
Using static partition definition
Creating 3 MTD partitions on "nand_mtd":
0x00000000-0x00100000 : "u-boot"
0x00100000-0x00700000 : "uImage"
0x00700000-0x10000000 : "root"
UBI: attaching mtd2 to ubi0
UBI: physical eraseblock size:   131072 bytes (128 KiB)
UBI: logical eraseblock size:    126976 bytes
UBI: smallest flash I/O unit:    2048
UBI: sub-page size:              512
UBI: VID header offset:          2048 (aligned 2048)
UBI: data offset:                4096
UBI error: ubi_io_read: error -74 while reading 64 bytes from PEB 589:0, read 64 bytes
UBI error: ubi_io_read: error -74 while reading 512 bytes from PEB 589:2048, read 512 bytes
UBI error: ubi_io_read: error -74 while reading 512 bytes from PEB 623:2048, read 512 bytes
UBI error: ubi_io_read: error -74 while reading 512 bytes from PEB 986:2048, read 512 bytes
UBI error: ubi_io_read: error -74 while reading 512 bytes from PEB 1263:2048, read 512 bytes
UBI error: ubi_io_read: error -74 while reading 512 bytes from PEB 1817:2048, read 512 bytes
UBI error: ubi_read_volume_table: the layout volume was not found
UBI error: ubi_init: cannot attach mtd2
UBI error: ubi_init: UBI error: cannot initialize UBI, error -22
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
USB Universal Host Controller Interface driver v3.0
usbcore: registered new interface driver usblp
drivers/usb/class/usblp.c: v0.13: USB Printer Device Class driver
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
mice: PS/2 mouse device common for all mice
i2c /dev entries driver
Linux telephony interface: v1.00
md: linear personality registered for level -1
md: raid0 personality registered for level 0
md: raid1 personality registered for level 1
raid6: int32x1     76 MB/s
raid6: int32x2     98 MB/s
raid6: int32x4    108 MB/s
raid6: int32x8     81 MB/s
raid6: using algorithm int32x4 (108 MB/s)
md: raid6 personality registered for level 6
md: raid5 personality registered for level 5
md: raid4 personality registered for level 4
raid5: measuring checksumming speed
   arm4regs  :   893.600 MB/sec
   8regs     :   670.000 MB/sec
   32regs    :   732.400 MB/sec
raid5: using function: arm4regs (893.600 MB/sec)
device-mapper: ioctl: 4.11.0-ioctl (2006-10-12) initialised: dm-devel@redhat.com
dm_crypt using the OCF package.
sdhci: Secure Digital Host Controller Interface driver
sdhci: Copyright(c) Pierre Ossman
usbcore: registered new interface driver usbhid
drivers/hid/usbhid/hid-core.c: v2.6:USB HID core driver
Advanced Linux Sound Architecture Driver Version 1.0.14 (Thu May 31 09:03:25 2007 UTC).
ALSA device list:
  #0: Marvell mv88fx_snd ALSA driver
Netfilter messages via NETLINK v0.30.
nf_conntrack version 0.5.0 (1024 buckets, 8192 max)
mvFpNatDb (c786c000): 1024 entries, 4096 bytes
ip_tables: (C) 2000-2006 Netfilter Core Team
TCP cubic registered
NET: Registered protocol family 1
NET: Registered protocol family 17
NFP (fdb) init 256 entries, 1024 bytes
Bridge firewalling registered
802.1Q VLAN Support v1.8 Ben Greear <greearb@candelatech.com>
All bugs added by David S. Miller <davem@redhat.com>
md: Autodetecting RAID arrays.
md: autorun ...
md: ... autorun DONE.
UBIFS error (pid 1): ubifs_get_sb: cannot open "/dev/root", error -22
List of all partitions:
1f00       1024 mtdblock0 (driver?)
1f01       6144 mtdblock1 (driver?)
1f02     254976 mtdblock2 (driver?)
No filesystem could mount root, tried:  ubifs
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(31,2)
Rebooting in 35 seconds..Reseting !!

Obviously something goes wrong here. Either my custom kernel is not exactly the same as the one sell with the product - and/or I must adapt the bootargs in order to boot that kernel with the supplied rootfs.

But what I actually meant by looking how the kernel is treated by the sdk is if it gets compressed, and maybe how, if it gets a certain header or anything similar. It might help to invoke make with V=99 to get all messages. Besides that, it is also a good idea to dig into Makefiles and Kconfigs.

When comparing the netgear provided kernel tree with the corresponding 2.6.22 from kernel.org, the most obvious difference is the presence of a lots of marvell specific targets:

sh$ diff netgear-make-targets linux-make-targets 
34c34
<                     (default: /home/sylvain/netgear/linux_kernel/usr)
---
>                     (default: /home/sylvain/vanilla-kernel/linux-2.6.22/usr)
87d86
<   db88f5281_vfp_defconfig  - Build for db88f5281_vfp
115,128d113
<   mv78xx0_be_defconfig     - Build for mv78xx0_be
<   mv78xx0_defconfig        - Build for mv78xx0
<   mv78xx0_routeonly_defconfig - Build for mv78xx0_routeonly
<   mv78xx0_z0_defconfig     - Build for mv78xx0_z0
<   mv88f5082_defconfig      - Build for mv88f5082
<   mv88f5181_defconfig      - Build for mv88f5181
<   mv88f5182_defconfig      - Build for mv88f5182
<   mv88f6082_defconfig      - Build for mv88f6082
<   mv88f6082_extra_defconfig - Build for mv88f6082_extra
<   mv88f6183_defconfig      - Build for mv88f6183
<   mv88f6183_nand_defconfig - Build for mv88f6183_nand
<   mv88f6281_be_gw_defconfig - Build for mv88f6281_be_gw
<   mv88f6281_defconfig      - Build for mv88f6281
<   mv88f6281_gw_defconfig   - Build for mv88f6281_gw
140,143d124
<   rd2_88f5181_defconfig    - Build for rd2_88f5181
<   rd2_88f5181L_defconfig   - Build for rd2_88f5181L
<   rd_88f5181L_fxo_defconfig - Build for rd_88f5181L_fxo
<   rd_88f6183_ap_defconfig  - Build for rd_88f6183_ap

By searching through the sources, I found many references to this specific board (MV RD-88F6281A LE):

netgear/linux_kernel$ fgrep -l -R  88F6281 *
arch/arm/mach-feroceon-kw/btns_device.c
arch/arm/mach-feroceon-kw/proc.c
arch/arm/mach-feroceon-kw/config/mvRules.mk
arch/arm/mach-feroceon-kw/sysmap.c
arch/arm/mach-feroceon-kw/kw_family/ctrlEnv/sys/mvCpuIf.h
arch/arm/mach-feroceon-kw/kw_family/ctrlEnv/sys/mvCpuIfInit.S
arch/arm/mach-feroceon-kw/kw_family/ctrlEnv/mvCtrlEnvLib.c
arch/arm/mach-feroceon-kw/kw_family/boardEnv/mvBoardEnvSpec.h
arch/arm/mach-feroceon-kw/kw_family/boardEnv/mvBoardEnvSpec.c
arch/arm/mach-feroceon-kw/kw_family/boardEnv/mvBoardEnvLib.c
arch/arm/mach-feroceon-kw/Kconfig
arch/arm/mach-feroceon-kw/core.c
arch/arm/configs/mv88f6281_be_gw_defconfig
arch/arm/configs/mv88f6281_defconfig
arch/arm/configs/mv88f6281_gw_defconfig
arch/arm/plat-feroceon/common/mvDeviceId.h
arch/arm/plat-feroceon/mv_drivers_lsp/mv_sata/mvLinuxIalHt.c
arch/arm/plat-feroceon/mv_hal/ddr2/mvDramIfBasicInit.S
arch/arm/plat-feroceon/Kconfig
build.log
config.default
config.stora
drivers/i2c/busses/Kconfig
fgrep: rpm/lib/modules/2.6.22.18-Netgear/source: No such file or directory
fgrep: rpm/lib/modules/2.6.22.18-Netgear/build: No such file or directory

There is no specific code for that board on the plain vanilla 2.6.22 kernel:

vanilla-kernel/linux-2.6.22$ fgrep -l -R  88F6281 *
# empty

By doing the same search on 3.0.4 it appears that some or all of this code has made its way into the official kernel tree between 2.6.22 and 3.0.4.

More interesting for us, there is some reference to it in openwrt Backfire:

 
 sh$ svn co svn://svn.openwrt.org/openwrt/branches/backfire
 sh$ cd backfire 
 sh$ fgrep -l -R  88F6281 *
target/linux/kirkwood/.svn/text-base/config-default.svn-base
target/linux/kirkwood/patches/.svn/text-base/004-cpuidle.patch.svn-base
target/linux/kirkwood/patches/004-cpuidle.patch
target/linux/kirkwood/config-default

When building that version of openwrt, buildroot offers the ARM Kirkwood option - but only for a generic target. I don't found any way in menuconfig to build for the specific 88F6281 board.
By looking into the kernel .config file, it appears that the default Kirkwood build is for the sheevaplug:

#
# Marvell Kirkwood Implementations
#
# CONFIG_MACH_DB88F6281_BP is not set
# CONFIG_MACH_RD88F6192_NAS is not set
# CONFIG_MACH_RD88F6281 is not set
CONFIG_MACH_SHEEVAPLUG=y
# CONFIG_MACH_TS219 is not set
CONFIG_PLAT_ORION=y

#
# Processor Type
#
CONFIG_CPU_32=y
CONFIG_CPU_FEROCEON=y

Ok, that's more or less all the data I have collected so far. I don't know yet how to do that, but I will try to build openwrt/backfire by manually setting the several CONFIG_ options specific to the 88F6281 board.

Thanks again for your time!

- Sylvain

I build openwrt by changing  target/linux/kirkwood/config-default

svn diff target/linux/kirkwood/config-default 
Index: target/linux/kirkwood/config-default
===================================================================
--- target/linux/kirkwood/config-default    (revision 28491)
+++ target/linux/kirkwood/config-default    (working copy)
@@ -94,7 +94,8 @@
 # CONFIG_MACH_DB88F6281_BP is not set
 # CONFIG_MACH_RD88F6192_NAS is not set
 # CONFIG_MACH_RD88F6281 is not set
-CONFIG_MACH_SHEEVAPLUG=y
+CONFIG_MACH_RD88F6281=y
+# CONFIG_MACH_SHEEVAPLUG is not set
 # CONFIG_MACH_TS219 is not set
 CONFIG_MISC_FILESYSTEMS=y
 CONFIG_MMC_BLOCK=m

The build went smoothly, but, as previously, it hangs[/] when booting the kernel:

Filename 'openwrt-kirkwood-uImage'.
Load address: 0x800000
Loading: #################################################################
         #################################################################
         ########################################
done
Bytes transferred = 866004 (d36d4 hex)
Marvell>> bootm 0x800000
## Booting image at 00800000 ...
   Image Name:   Linux-2.6.30.10
   Created:      2011-10-20  11:00:14 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    865940 Bytes = 845.6 kB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.

But I noticed an interesting thing: I have appended [i]panic=35 at the end of my bootargs. But the target never rebooted. So, I have two hypothesis:

  • The kernel don't boot at all. I was thinking that since the beginning.

  • The kernel does not honor the bootargs provided by U-Boot - neither panic= nor console=. That will explain why there's no more messages after "booting the kernel". Not even a kernel panic or a crash dump.

- Sylvain

still one more comment:

MBS wrote:

how the kernel is treated by the sdk is if it gets compressed

It seems to me, that, since I started, I was only able to boot uncompressed kernels! I had the feeling this could be important....

[EDIT]No, there is definitively something else: manually building an uncompressed image from build_dir/linux-kirkwood/linux.elf leads to exactly the same symptoms.

arm-unknown-linux-uclibcgnueabi-objcopy -O binary  vmlinux.elf openwrt-vmlinux.bin
mkimage -A arm -O linux -T kernel -C none -a 0x8000 -e 0x8000 -n "Linux 2.6" -d openwrt-vmlinux.bin openwrt-vmlinux.uimage
cp openwrt-vmlinux.uimage /srv/tftp/
Marvell>> tftpboot 0x800000 openwrt-vmlinux.uimage
Marvell>> bootm 0x800000
## Booting image at 00800000 ...
   Image Name:   Linux 2.6
   Created:      2011-10-20  12:50:27 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2406144 Bytes =  2.3 MB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
OK

Starting kernel ...
[...nothing else after that...]

- Sylvain

(Last edited by sleroux on 20 Oct 2011, 13:53)

Is V=1 the highest verbosity level available in netgears sdk?
Something else, that might be of help for you is this: https://dev.openwrt.org/ticket/9980
I would also recommend to build trunk instead of backfire.

Hi,

Is V=1 the highest verbosity level available in netgears sdk?

As of a SDK, this is mostly the kernel tree with some custom files tailored for the marvell platform. There's V=2 verbosity to show makefile dependencies. But I don't think this is interesting.

Something else, that might be of help for you is this: https://dev.openwrt.org/ticket/9980

I will take a look at that.

I would also recommend to build trunk instead of backfire.

Definitively! I made a "quick" survey this afternoon. Building several kernels from 2.6.20 and 3.0.3. It appears that it's only starting with version 2.6.39 that it boots out of the box on my netgear Stora. Maybe the support for that board is simply incomplete or broken until that.

- Sylvain.

I would also recommend to build trunk instead of backfire.

I switched on that version. That firmware does not boot neither on the stora.

If I am right, trunk is based on linux-2.6.37.6. I am currently in the process of incorporating some patches from  Bryan.McGuire. He says to have successfully build a working kernel for the Stora based on 2.6.34. The first tests seems to be encouraging: the patched kernel boots, but does not recognize the target platform as a MS2110/Stora:

Starting kernel ...


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

Available machine support:

ID (hex)        NAME
00000ab7        Netgear MS2110

Please check your kernel config and/or bootloader.

Maybe Netgear used several versions/revisions of that board in their products? Or, there is regional variation of the hardware (I use a french version of the Stora).


- Sylvain

kernel version mainly depends on the target in trunk. ar71xx totally switched to 2.6.39 the last time I updated. You can edit target/linux/kirkwood/Makefile, where it says LINUX_VERSION:=2.6.37.6
2.6.39.4 would be a valid version number.

MBS wrote:

You can edit target/linux/kirkwood/Makefile, where it says LINUX_VERSION:=2.6.37.6
2.6.39.4 would be a valid version number.

That's interesting.I will keep that as an option. But for now, I will stick with the trunk's version as is.

I have successfully backported some patches to support the Netgear Stora/MS2110 on 2.6.37.6. I have added target/linux/kirkwood/{patches/201-stora.patch,profiles/201-Stora.mk} in order to incorporate those patches in the build process of OpenWrt. The build went smoothly - visibly incorporating the required patches - but the resulting U-Boot image (bin/kirkwood/openwrt-kirkwood-uImage) does not boot. It hangs after the message Uncompressing Linux...

Marvell>> tftpboot 0x800000 openwrt-kirkwood-uImage
Using egiga0 device
TFTP from server 10.129.38.81; our IP address is 10.129.38.45
Filename 'openwrt-kirkwood-uImage'.
Load address: 0x800000
Loading: #################################################################
         #################################################################
         #################################################################
         #################
done
Bytes transferred = 1083432 (108828 hex)
Marvell>> bootm 0x800000
## Booting image at 00800000 ...
   Image Name:   Linux-2.6.37.6
   Created:      2011-10-21  20:45:54 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    1083368 Bytes =  1 MB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
OK

Starting kernel ...

Uncompressing Linux...

But, if I manually build an U-Boot image from the kernel vmlinux image found in arch/arm/kirkwood/boot, it boots (up to the usual kernel panic due to lack of rootfs):

sylvain@orion-dev:~/openwrt/trunk/build_dir/linux-kirkwood/linux-2.6.37.6$ mkimage -A arm -O linux -T kernel -C none -a 0x8000 -n "linux-2.6.37.6-openwrt" -d arch/arm/boot/Image vmlinux-2.6.37.6-openwrt.uimage
Image Name:   linux-2.6.37.6-openwrt
Created:      Mon Oct 24 09:44:11 2011
Image Type:   ARM Linux Kernel Image (uncompressed)
Data Size:    2873824 Bytes = 2806.47 kB = 2.74 MB
Load Address: 0x00008000
Entry Point:  0x00008000
Marvell>> tftpboot 0x800000 vmlinux-2.6.37.6-openwrt.uimage
egiga1 no link
Using egiga0 device
TFTP from server 10.129.38.81; our IP address is 10.129.38.45
Filename 'vmlinux-2.6.37.6-openwrt.uimage'.
Load address: 0x800000
Loading: #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         ##########################################
done
Bytes transferred = 2873888 (2bda20 hex)
Marvell>> bootm 0x800000
## Booting image at 00800000 ...
   Image Name:   linux-2.6.37.6-openwrt
   Created:      2011-10-24   9:45:31 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2873824 Bytes =  2.7 MB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
OK

Starting kernel ...

Linux version 2.6.37.6 (sylvain@orion-dev) (gcc version 4.5.4 20110808 (prerelease) (Linaro GCC 4.5-2011.08) ) #2 Fri Oct 21 20:45:51 UTC 2011
[...]
VFS: Cannot open root device "(null)" or unknown-block(0,0)
Please append a correct "root=" boot option; here are the available partitions:
1f00            1024 mtdblock0  (driver?)
1f01            4096 mtdblock1  (driver?)
1f02          257024 mtdblock2  (driver?)
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

I don't know if this is relevant, but I noticed that, according to the bootloader, the openwrt-kirkwood-uImage (openwrt build image) is uncompressed whereas obviously it is:

Marvell>> tftpboot 0x800000 openwrt-kirkwood-uImage
[...]
Marvell>> bootm 0x800000
## Booting image at 00800000 ...
   Image Name:   Linux-2.6.37.6
   Image Type:   ARM Linux Kernel Image (uncompressed)
#                                         ^^^^^^^^^^^^
   Data Size:    1083368 Bytes =  1 MB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
OK

Starting kernel ...

Uncompressing Linux...
^^^^^^^^^^^^^

For testing purpose, is there a way to use openwrt buildroot in order to build an uncompressed image?

- Sylvain

  • In addition to the previous message, it appears that using openwrt's buildroot to compile a kernel having CONFIG_DEBUG_LL=y produces a compressed kernel bootable on the Stora. If I remove CONFIG_DEBUG_LL, the kernel hangs at decompression...

  • Removing both CONFIG_KERNEL_DEBUG and CONFIG_DEBUG_LL leads to a bootable kernel too..

(Last edited by sleroux on 24 Oct 2011, 13:38)

Ok, bad news: I have bricked my Stora...

After many hours trying and testing different Kernel configurations, I went to the conclusion that the sources provided by Netgear are those of a different version than those found on my hardware. While booting, my stora reported U-Boot v15  whereas on the netgear SDK, I only have U-Boot labeled v14.

So I tried to upgrade both U-Boot and the Kernel with those I build myself from a recent release of the Kernel and U-Boot (the later supporting the Marvell rd6281a board on which the Stora is based). I was hoping a decent support of the board. Obviously, I was wrong ... and I lost the bootloader...

I don't have an external NAND programmer so, this is the end of the story ... and of my Stora sad

jtag cables and spi programmers are not too hard to build or buy. there is still some hope.

Hi,

Thanks MBS for continuing supporting me!

jtag cables and spi programmers are not too hard to build or buy.

Here is a picture of the board: http://www.chicoree.fr/pub/netgear-stora/board.jpg

I don't see any JTAG connector - and, as far as I can see, the corresponding pins on the µC are not accessible without desoldering the chip. I don't know about the SPI interface.

If I'm not wrong, you can see the NAND chip containing the faulty bootloader on the top-right of the picture (it's the one labeled Samsung k9f2g0). By searching through the datasheet I don't think there is a way to (re)program it without a proper programmer. But those are far more expensive than a JTAG or SPI interface cable.

[EDIT]There's some test points on the board. But I don't know if those are only for electrical testing - of if some of them allow on site programming of the device.

- Sylvain

(Last edited by sleroux on 31 Oct 2011, 20:59)

looks like a pretty tough quest.

I know this is a long time ago now....
but if you still have your Stora.

http://www.openstora.com/wiki/index.php … est_Points


Test Point    Function
TP2    JTAG nRST
TP3    JTAG TDI
TP4    JTAG TMS
TP5    JTAG TCLK
TP6    JTAG TDO      (although i wonder if this was meant to say TP7)

goodluck.
RD

sleroux, in case you still have your box, you can restore U-Boot without actually connecting to JTAG and/or the SPI flash chip. The SoC has an indesctrucable serial bootloader burned into the boot ROM, you can access it by sending a magic pattern while triggering the reset (or the whole power supply).
https://downloads.openwrt.org/attitude_ … ot-kwboot/
You need to compile the bootloader with a 512-byte KWB header specifically for your device — it contains DDR memory timings and other low-level stuff needed to initialize the hardware prior to running the U-Boot code. Also this header has a field which specifies the boot mode: NAND, NOR flash or UART. Set it to UART or pass the '-p' parameter to kwboot utility.

The discussion might have continued from here.