Seagate BlackArmor NAS 220

Hm,well I think we can introduce it for just this device
Will make new images in the evening

Here are new versions
https://drive.google.com/drive/folders/1MFm3As_UFoQ7Q4yFAvNbv9Qf_zlAsfnT?usp=sharing

Thanks for enabling dhcp this time - it saves me a lot of time :wink:
... sysupgrade required -F switch ->the image still cannot be confirmed, but when it finished I got:

## Booting kernel from Legacy Image at 00800000 ...
   Image Name:   ARM OpenWrt Linux-4.14.48
   Created:      2018-06-08   8:53:57 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2098408 Bytes = 2 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 4.14.48 (robimarko@localhost.localdomain) (gcc version 7.3.0 (OpenWrt GCC 7.3.0 r7165-72cdc9b5b2)) #0 Fri Jun 8 08:53:57 2018
[    0.000000] CPU: Feroceon 88FR131 [56251311] revision 1 (ARMv5TE), cr=0005397f
[    0.000000] CPU: VIVT data cache, VIVT instruction cache
[    0.000000] OF: fdt: Machine model: Seagate Blackarmor NAS220
[    0.000000] Memory policy: Data cache writeback
[    0.000000] random: get_random_bytes called from start_kernel+0x70/0x41c with crng_init=0
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 32512
[    0.000000] Kernel command line: console=ttyS0,115200 mtdparts=orion_nand:0xa0000@0x0(uboot),0x010000@0xa0000(env),0x500000@0xc0000(uimage),0x1a40000@0x5c0000(rootfs) ubi.mtd=3 root=ubi0:rootfs rootfstype=ubifs
[    0.000000] PID hash table entries: 512 (order: -1, 2048 bytes)
[    0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
[    0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.000000] Memory: 122272K/131072K available (4490K kernel code, 156K rwdata, 1184K rodata, 1024K init, 209K bss, 8800K reserved, 0K cma-reserved)
[    0.000000] Virtual kernel memory layout:
[    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
[    0.000000]     fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
[    0.000000]     vmalloc : 0xc8800000 - 0xff800000   ( 880 MB)
[    0.000000]     lowmem  : 0xc0000000 - 0xc8000000   ( 128 MB)
[    0.000000]     modules : 0xbf000000 - 0xc0000000   (  16 MB)
[    0.000000]       .text : 0xc0008000 - 0xc0562858   (5483 kB)
[    0.000000]       .init : 0xc0700000 - 0xc0800000   (1024 kB)
[    0.000000]       .data : 0xc0800000 - 0xc08272e0   ( 157 kB)
[    0.000000]        .bss : 0xc08272e0 - 0xc085ba5c   ( 210 kB)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[    0.000000] clocksource: orion_clocksource: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 11467562657 ns
[    0.000014] sched_clock: 32 bits at 166MHz, resolution 6ns, wraps every 12884901885ns
[    0.000062] Switching to timer-based delay loop, resolution 6ns
[    0.000179] Calibrating delay loop (skipped), value calculated using timer frequency.. 333.33 BogoMIPS (lpj=1666666)
[    0.000215] pid_max: default: 32768 minimum: 301
[    0.000422] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.000454] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.001176] CPU: Testing write buffer coherency: ok
[    0.002293] Setting up static identity map for 0x100000 - 0x10003c
[    0.002703] mvebu-soc-id: MVEBU SoC ID=0x6281, Rev=0x3
[    0.008164] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.008203] futex hash table entries: 256 (order: -1, 3072 bytes)
[    0.008332] pinctrl core: initialized pinctrl subsystem
[    0.009670] NET: Registered protocol family 16
[    0.010380] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.011872] cpuidle: using governor ladder
[    0.012483] Feroceon L2: Enabling L2
[    0.012545] Feroceon L2: Cache support initialised.
[    0.012936] [Firmware Info]: /ocp@f1000000/ethernet-controller@72000/ethernet0-port@0: local-mac-address is not set
[    0.018458] No ATAGs?
[    0.039992] SCSI subsystem initialized
[    0.040965] usbcore: registered new interface driver usbfs
[    0.041055] usbcore: registered new interface driver hub
[    0.041140] usbcore: registered new device driver usb
[    0.043656] clocksource: Switched to clocksource orion_clocksource
[    0.044751] NET: Registered protocol family 2
[    0.045522] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    0.045555] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    0.045583] TCP: Hash tables configured (established 1024 bind 1024)
[    0.045701] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.045734] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.045948] NET: Registered protocol family 1
[    0.047475] Crashlog allocated RAM at address 0x3f00000
[    0.050436] workingset: timestamp_bits=30 max_order=15 bucket_order=0
[    0.056755] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.056773] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.065807] io scheduler noop registered
[    0.065826] io scheduler deadline registered (default)
[    0.067423] kirkwood-pinctrl f1010000.pin-controller: registered pinctrl driver
[    0.101429] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
[    0.102712] console [ttyS0] disabled
[    0.102818] f1012000.serial: ttyS0 at MMIO 0xf1012000 (irq = 26, base_baud = 10416666) is a 16550A
[    0.586462] console [ttyS0] enabled
[    0.591528] sata_mv f1080000.sata: slots 32 ports 2
[    0.600970] scsi host0: sata_mv
[    0.604806] scsi host1: sata_mv
[    0.608148] ata1: SATA max UDMA/133 irq 33
[    0.612229] ata2: SATA max UDMA/133 irq 33
[    0.616984] nand: device found, Manufacturer ID: 0xec, Chip ID: 0x75
[    0.623312] nand: Samsung NAND 32MiB 3,3V 8-bit
[    0.627863] nand: 32 MiB, SLC, erase size: 16 KiB, page size: 512, OOB size: 16
[    0.635173] Scanning device for bad blocks
[    0.867525] 4 cmdlinepart partitions found on MTD device orion_nand
[    0.873788] Creating 4 MTD partitions on "orion_nand":
[    0.878909] 0x000000000000-0x0000000a0000 : "uboot"
[    0.884600] 0x0000000a0000-0x0000000b0000 : "env"
[    0.889952] 0x0000000c0000-0x0000005c0000 : "uimage"
[    0.895852] 0x0000005c0000-0x000002000000 : "rootfs"
[    0.902680] mtd: device 3 (rootfs) set to be root filesystem
[    0.908545] mtdsplit: no squashfs found in "rootfs"
[    0.914106] libphy: Fixed MDIO Bus: probed
[    0.918531] libphy: orion_mdio_bus: probed
[    0.926850] mv643xx_eth: MV-643xx 10/100/1000 ethernet driver version 1.4
[    0.936015] mv643xx_eth_port mv643xx_eth_port.0 eth0: port 0 with MAC address 00:10:75:07:9b:7c
[    0.944820] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    0.951320] ehci-orion: EHCI orion driver
[    0.955589] orion-ehci f1050000.ehci: EHCI Host Controller
[    0.961082] orion-ehci f1050000.ehci: new USB bus registered, assigned bus number 1
[    0.968922] orion-ehci f1050000.ehci: irq 30, io mem 0xf1050000
[    1.003677] orion-ehci f1050000.ehci: USB 2.0 started, EHCI 1.00
[    1.010406] hub 1-0:1.0: USB hub found
[    1.014429] hub 1-0:1.0: 1 port detected
[    1.018985] usbcore: registered new interface driver usb-storage
[    1.025527] rtc-mv f1010300.rtc: rtc core: registered f1010300.rtc as rtc0
[    1.032481] i2c /dev entries driver
[    1.037558] orion_wdt: Initial timeout 25 sec
[    1.048527] marvell-cesa f1030000.crypto: CESA device successfully registered
[    1.056883] NET: Registered protocol family 10
[    1.063553] Segment Routing with IPv6
[    1.067351] NET: Registered protocol family 17
[    1.071833] 8021q: 802.1Q VLAN Support v1.8
[    1.080365] ubi0: attaching mtd3
[    1.256327] ata1: SATA link down (SStatus 0 SControl F300)
[    1.375130] ubi0: scanning is finished
[    1.384363] usb 1-1: new high-speed USB device number 2 using orion-ehci
[    1.400853] ubi0: attached mtd3 (name "rootfs", size 26 MiB)
[    1.406544] ubi0: PEB size: 16384 bytes (16 KiB), LEB size: 15872 bytes
[    1.413143] ubi0: min./max. I/O unit sizes: 512/512, sub-page size 256
[    1.419667] ubi0: VID header offset: 256 (aligned 256), data offset: 512
[    1.426359] ubi0: good PEBs: 1680, bad PEBs: 0, corrupted PEBs: 0
[    1.432423] ubi0: user volume: 3, internal volumes: 1, max. volumes count: 92
[    1.439547] ubi0: max/mean erase counter: 2/1, WL threshold: 4096, image sequence number: 2948113276
[    1.448658] ubi0: available PEBs: 0, total reserved PEBs: 1680, PEBs reserved for bad PEB handling: 40
[    1.458995] block ubiblock0_1: created from ubi0:1(rootfs)
[    1.464797] rtc-mv f1010300.rtc: setting system clock to 2018-06-08 14:35:22 UTC (1528468522)
[    1.473868] ubi0: background thread "ubi_bgt0d" started, PID 948
[    1.586363] ata2: SATA link down (SStatus 0 SControl F300)
[    1.591989] VFS: Cannot open root device "ubi0:rootfs" or unknown-block(31,3): error -2
[    1.599992] Please append a correct "root=" boot option; here are the available partitions:
[    1.608336] 1f00             640 mtdblock0
[    1.608342]  (driver?)
[    1.614871] 1f01              64 mtdblock1
[    1.614875]  (driver?)
[    1.621382] 1f02            5120 mtdblock2
[    1.621386]  (driver?)
[    1.627916] 1f03           26880 mtdblock3
[    1.627920]  (driver?)
[    1.634445] fe00            1550 ubiblock0_1
[    1.634450]  (driver?)
[    1.641133] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(31,3)
[    1.650443] Rebooting in 1 seconds..

ubifs volumes still cannot be mounted from the kernel.
I also tried to "ubifsmount" from uboot, but no luck:

nas220> ubi part rootfs
ubi0: detaching mtd1
ubi0: mtd1 is detached
ubi0: attaching mtd1
ubi0: scanning is finished
ubi0: attached mtd1 (name "mtd=3", size 26 MiB)
ubi0: PEB size: 16384 bytes (16 KiB), LEB size: 15872 bytes
ubi0: min./max. I/O unit sizes: 512/512, sub-page size 256
ubi0: VID header offset: 256 (aligned 256), data offset: 512
ubi0: good PEBs: 1680, bad PEBs: 0, corrupted PEBs: 0
ubi0: user volume: 3, internal volumes: 1, max. volumes count: 92
ubi0: max/mean erase counter: 2/1, WL threshold: 4096, image sequence number: 2948113276
ubi0: available PEBs: 0, total reserved PEBs: 1680, PEBs reserved for bad PEB handling: 40
nas220> ubi info
UBI: MTD device name:            "mtd=3"
UBI: MTD device size:            26 MiB
UBI: physical eraseblock size:   16384 bytes (16 KiB)
UBI: logical eraseblock size:    15872 bytes
UBI: number of good PEBs:        1680
UBI: number of bad PEBs:         0
UBI: smallest flash I/O unit:    512
UBI: VID header offset:          256 (aligned 256)
UBI: data offset:                512
UBI: max. allowed volumes:       92
UBI: wear-leveling threshold:    4096
UBI: number of internal volumes: 1
UBI: number of user volumes:     3
UBI: available PEBs:             0
UBI: total number of reserved PEBs: 1680
UBI: number of PEBs reserved for bad PEB handling: 40
UBI: max/mean erase counter: 2/1
nas220> ubifsmount ubi0:rootfs
UBIFS error (ubi0:1 pid 0): ubifs_read_node: bad node type (4 but expected 6)
UBIFS error (ubi0:1 pid 0): ubifs_read_node: bad node at LEB 0:0, LEB mapping status 1
Not a node, first 24 bytes:Error reading superblock on volume 'ubi0:rootfs' errno=-22!
ubifsmount - mount UBIFS volume

Usage:
ubifsmount <volume-name>
    - mount 'volume-name' volume
nas220> ubifsmount ubi0:1
UBIFS error (pid: 1): cannot open "ubi0:1", error -19Error reading superblock on volume 'ubi0:1' errno=-19!
ubifsmount - mount UBIFS volume

Usage:
ubifsmount <volume-name>
    - mount 'volume-name' volume

I guess I could manually create those volumes from uboot, then format them from initram and "copy" the required files manually ? I will give a try in Monday.

Is it possible for you to avoid ubi (as the chip probably needs specific alignment options) and create a quashfs image like those in https://downloads.openwrt.org/releases/17.01.4/targets/kirkwood/generic/ ?
I could use any of those by simply writing kernel and root files from sysupgrade.bin in uimage and rootfs nand partitions.

Hm,I dont understand why sysupgrade does not match the device as supported.
Well,I can hardcode kernel and rootfs but I doubt that will get merged

What exactly does sysupgrade in order to verify the image? I see it creates a .meta file which probably compares with something in the initrd image or uboot enviroment settings ?

Let's start from the beginning;
In https://downloads.openwrt.org/releases/17.01.4/targets/kirkwood/generic/ I only see squashfs - not ubi/ubfs images. What is the deal with ubi? I see that in 15.05 images, apart from ubifs, there is specific openwrt-supplied u-boot for each device so patching uboot may also be necessary for 15.05 - but as this is no longer updated, I don't see why we should bother with uboot and ubi.
As the sysupgrade script does not touch uboot env setting, are there any specific bootargs we shall include, which sysupgrade takes for granded? eg:

Kernel command line: console=ttyS0,115200 mtdparts=orion_nand:0xa0000@0x0(uboot),0x010000@0xa0000(env),0x500000@0xc0000(uimage),0x1a40000@0x5c0000(rootfs) ubi.mtd=3 root=ubi0:rootfs rootfstype=ubifs

this says to kernel that the rootfs is ubifs... is that true? All other 17.01 images where autodetected as squashfs... I had to use it only for testing 15.05 images.

For the newer 17.01 images, I just extracted kernel and root files from sysupgrade, then nand write them directly into uimage and rootfs partitions and everything worked like a charm, apart from eth0 ofcourse...
I cannot do that with your images... they don't get recognised by the kernel.

As I strongly believe that we should pursue this only if it is going to merge (what is the point otherwise?) lets stay with the standards...
As a last course of action I can give you ssh access to a spare orangepi ,I have, connected to the nas220 in the same subnet, so you can try whatever you want, what do you say?

Sysupgrade check metadata to confirm that advertised supperted boards match the current one.

ubi is later addition to stop hardcoding kernel and rootfs partitions.
It could as well be that OpenWrt generated u-boot is needed as it includes some default bootargs.

I am really busy so this has gotta wait some time if I dont catch some free time on evenings.

Hi @robimarko I am hoping to cobble together build for this device. I have hacked my way to a ramips image but not a kirkwood. Would you be open to sharing the code you had to build these images that I could use as a start?

Thanks

Unfortunately, I deleted the branch with source code a month ago.

No worries. Thanks for the quick reply. Did you basically patch in the DTS that you linked above? Any other tips you can remember?

Sorry, but I worked on many devices later so I dont remember.
But from what I remember Kirkwood is pretty much fully upstream and a lot of devices already have upstream DTS files that you patch to include proper partitions, add stuff like mwlwifi if they use it and fix bugs

This info helps. Thank you

@pancyber and I have been working to get an image running on this device. At this point we have a sketchy image that will boot up with all the main bits including ethernet. It is using a custom u-boot and there are several "tuning opportunities".

I have a couple questions and I expect @pancyber may also.

At this point this is just pulling a DTS for this device from upstream and patching in partitions basically. I looks like from various links a custom u-boot is needed for ubi. Couple of questions. I am not an expert in openwrt builds by any means, but looks like several of the NAS devices in the kirkwood target also build custom u-boot package. Some build "second stage" bins, which as I understand it leave the first stock u-boot in place and set it to load the second stage u-boot which in turn loads openwrt. Now the questions

  1. Can you guys think of a reason a newer u-boot (as single stage) would not load the stock firmware if someone wanted to revert back?
  2. What's the benefit of a second stage u-boot? Seems like it would leave the stock u-boot in place, but if the answer to question 1 is "no" I don't see the need.

If anyone is interested in the code here is what we are working with currently

Also we have more detail if anyone is looking for it, like stock bootlogs and @pancyber has a great list of how to get this on the device. Just ask and we can post.

Hi kapieyow,

Thank you for your work.
I have compiled correctly an image using your repository, but i'm not able to flash and start it correctly on my device.
Can you share your printenv ?
I have modified mine a lot of time, so i'm not sure it is correct...
Thank you

I messaged @ramponis and realized I had more information that may be helpful for others that I had not posted. This post is to include that.

First off, please consider the code for this device "experimental" at best. Use at your own risk. I worked with @pancyber last year and he was able to get it running on the device and provided a detailed list of instructions of setup below. Also @ramponis has followed these and has it running also. There are known issues with it, but it is a start.

My original intent with this effort was to work to solidify this starting point and ultimately PR it as a supported device. Unfortunately I have not found time to complete it. If anyone would like to run with it, please feel free to send me questions.

Setup steps

All the credit on these steps goes to @pancyber who got it to work and wrote these instructions

What I did (its a complete recap - all the work that has to be done to an unmodified unit :

Used the information from https://wiki.ccc-ffm.de/projekte:diverses:seagate_blackarmor_nas_220_debian 1 to connect to nas220 serial port (some soldering was required)
I replaced it's u-boot with a version I compiled using the info from the link above (current version 2019.01 does not work properly, issues with usb and ethernet) NOTE that original u-boot does not support ubi so this guide will not work.
You can tftpboot it and then write it to nand 0x00

registered those environment variables:

autoload=no
autostart=no
baudrate=115200
bootargs=console=ttyS0,115200
bootcmd=ubi part ubi; ubi readvol 0x800000 kernel; bootm
bootdelay=3
ethact=egiga0
ethaddr=     #mac address as written on chassis
fdtcontroladdr=7b27608
fileaddr=800000
filesize=207400
ipaddr=172.16.1.193
mtddevname=uboot
mtddevnum=0
mtdids=nand0=orion_nand
mtdparts=mtdparts=orion_nand:0xa0000@0x0(uboot),0x010000@0xa0000(env),0x1f40000@0xc0000(ubi)
partition=nand0,0
serverip=         #an ip address for nas220 to easily upload images by tftp
stderr=serial
stdin=serial
stdout=serial

Actually you only need to change mtdparts, bootcmd, and ethaddr, all others should be in place already. Don't forget to saveenv before rebooting.

Formated "ubi" nand segment as ubi by typing "ubi part ubi" at the command prompt

Booted the initram version of the 2nd sketchy image you had created for testing

Downloaded sysupgrade.bin version to /tmp and used sysupgrade command to "burn" it to ubi nand partition.

Reset and wait about 12sec (as bootcmd envvar is set, u-boot loads kernel from ubi and fires it up)

Full bootlog

U-Boot 2018.05 (May 31 2018 - 15:39:02 +0300)
NAS 220

SoC:   Kirkwood 88F6281_A1
DRAM:  128 MiB
WARNING: Caches not enabled
NAND:  32 MiB
Loading Environment from NAND... OK
In:    serial
Out:   serial
Err:   serial
Net:   egiga0
88E1116 Initialized on egiga0
IDE:   ide_preinit failed
Hit any key to stop autoboot:  0
ubi0: attaching mtd1
ubi0: scanning is finished
ubi0: attached mtd1 (name "mtd=2", size 31 MiB)
ubi0: PEB size: 16384 bytes (16 KiB), LEB size: 15872 bytes
ubi0: min./max. I/O unit sizes: 512/512, sub-page size 256
ubi0: VID header offset: 256 (aligned 256), data offset: 512
ubi0: good PEBs: 2000, bad PEBs: 0, corrupted PEBs: 0
ubi0: user volume: 3, internal volumes: 1, max. volumes count: 92
ubi0: max/mean erase counter: 2/1, WL threshold: 4096, image sequence number: 0
ubi0: available PEBs: 1312, total reserved PEBs: 688, PEBs reserved for bad PEB handling: 40
Read 0 bytes from volume kernel to 800000
No size specified -> Using max size (2126848)
## Booting kernel from Legacy Image at 00800000 ...
   Image Name:   ARM OpenWrt Linux-4.14.95
   Created:      2019-01-24  21:54:13 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2118262 Bytes = 2 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 4.14.95 (kip@dev-ub-openwrt) (gcc version 7.4.0 (OpenWrt GCC 7.4.0 r9133-e906a75e67)) #0 Thu Jan 24 21:54:13 2019
[    0.000000] CPU: Feroceon 88FR131 [56251311] revision 1 (ARMv5TE), cr=0005397f
[    0.000000] CPU: VIVT data cache, VIVT instruction cache
[    0.000000] OF: fdt: Machine model: Seagate Blackarmor NAS220
[    0.000000] Memory policy: Data cache writeback
[    0.000000] random: get_random_bytes called from start_kernel+0x70/0x420 with crng_init=0
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 32512
[    0.000000] Kernel command line: console=ttyS0,115200
[    0.000000] PID hash table entries: 512 (order: -1, 2048 bytes)
[    0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
[    0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.000000] Memory: 122284K/131072K available (4540K kernel code, 157K rwdata, 1192K rodata, 1024K init, 201K bss, 8788K reserved, 0K cma-reserved)
[    0.000000] Virtual kernel memory layout:
[    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
[    0.000000]     fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
[    0.000000]     vmalloc : 0xc8800000 - 0xff800000   ( 880 MB)
[    0.000000]     lowmem  : 0xc0000000 - 0xc8000000   ( 128 MB)
[    0.000000]     modules : 0xbf000000 - 0xc0000000   (  16 MB)
[    0.000000]       .text : 0xc0008000 - 0xc056f180   (5533 kB)
[    0.000000]       .init : 0xc0700000 - 0xc0800000   (1024 kB)
[    0.000000]       .data : 0xc0800000 - 0xc0827440   ( 158 kB)
[    0.000000]        .bss : 0xc0827440 - 0xc0859b9c   ( 202 kB)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[    0.000000] clocksource: orion_clocksource: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 11467562657 ns
[    0.000013] sched_clock: 32 bits at 166MHz, resolution 6ns, wraps every 12884901885ns
[    0.000061] Switching to timer-based delay loop, resolution 6ns
[    0.000177] Calibrating delay loop (skipped), value calculated using timer frequency.. 333.33 BogoMIPS (lpj=1666666)
[    0.000211] pid_max: default: 32768 minimum: 301
[    0.000446] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.000476] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.001328] CPU: Testing write buffer coherency: ok
[    0.002521] Setting up static identity map for 0x100000 - 0x10003c
[    0.002928] mvebu-soc-id: MVEBU SoC ID=0x6281, Rev=0x3
[    0.008421] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.008461] futex hash table entries: 256 (order: -1, 3072 bytes)
[    0.008593] pinctrl core: initialized pinctrl subsystem
[    0.009931] NET: Registered protocol family 16
[    0.010566] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.012084] cpuidle: using governor ladder
[    0.012639] Feroceon L2: Enabling L2
[    0.012702] Feroceon L2: Cache support initialised.
[    0.013097] [Firmware Info]: /ocp@f1000000/ethernet-controller@72000/ethernet0-port@0: local-mac-address is not set
[    0.018698] No ATAGs?
[    0.042046] SCSI subsystem initialized
[    0.043048] usbcore: registered new interface driver usbfs
[    0.043138] usbcore: registered new interface driver hub
[    0.043219] usbcore: registered new device driver usb
[    0.045869] clocksource: Switched to clocksource orion_clocksource
[    0.046971] NET: Registered protocol family 2
[    0.047739] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    0.047774] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    0.047803] TCP: Hash tables configured (established 1024 bind 1024)
[    0.047922] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.047955] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.048159] NET: Registered protocol family 1
[    0.049778] Crashlog allocated RAM at address 0x3f00000
[    0.052864] workingset: timestamp_bits=30 max_order=15 bucket_order=0
[    0.059253] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.059272] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.069076] io scheduler noop registered
[    0.069095] io scheduler deadline registered (default)
[    0.070702] kirkwood-pinctrl f1010000.pin-controller: registered pinctrl driver
[    0.104934] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
[    0.106271] console [ttyS0] disabled
[    0.106374] f1012000.serial: ttyS0 at MMIO 0xf1012000 (irq = 26, base_baud = 10416666) is a 16550A
[    0.580681] console [ttyS0] enabled
[    0.585759] sata_mv f1080000.sata: slots 32 ports 2
[    0.595381] scsi host0: sata_mv
[    0.599264] scsi host1: sata_mv
[    0.602592] ata1: SATA max UDMA/133 irq 33
[    0.606712] ata2: SATA max UDMA/133 irq 33
[    0.611448] nand: device found, Manufacturer ID: 0xec, Chip ID: 0x75
[    0.617814] nand: Samsung NAND 32MiB 3,3V 8-bit
[    0.622333] nand: 32 MiB, SLC, erase size: 16 KiB, page size: 512, OOB size: 16
[    0.629637] Scanning device for bad blocks
[    0.862177] 3 fixed-partitions partitions found on MTD device orion_nand
[    0.868866] Creating 3 MTD partitions on "orion_nand":
[    0.873986] 0x000000000000-0x0000000a0000 : "uboot"
[    0.879702] 0x0000000a0000-0x0000000b0000 : "uboot-env"
[    0.885622] 0x0000000c0000-0x000000b80000 : "ubi"
[    0.892206] libphy: Fixed MDIO Bus: probed
[    0.896685] libphy: orion_mdio_bus: probed
[    0.904747] mv643xx_eth: MV-643xx 10/100/1000 ethernet driver version 1.4
[    0.913954] mv643xx_eth_port mv643xx_eth_port.0 eth0: port 0 with MAC address 00:10:75:07:9b:7c
[    0.922763] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    0.929289] ehci-orion: EHCI orion driver
[    0.933545] orion-ehci f1050000.ehci: EHCI Host Controller
[    0.939088] orion-ehci f1050000.ehci: new USB bus registered, assigned bus number 1
[    0.946914] orion-ehci f1050000.ehci: irq 30, io mem 0xf1050000
[    0.975886] orion-ehci f1050000.ehci: USB 2.0 started, EHCI 1.00
[    0.982630] hub 1-0:1.0: USB hub found
[    0.986665] hub 1-0:1.0: 1 port detected
[    0.991207] usbcore: registered new interface driver usb-storage
[    0.997750] rtc-mv f1010300.rtc: rtc core: registered f1010300.rtc as rtc0
[    1.004704] i2c /dev entries driver
[    1.009809] orion_wdt: Initial timeout 25 sec
[    1.021206] marvell-cesa f1030000.crypto: CESA device successfully registered
[    1.029566] NET: Registered protocol family 10
[    1.036234] Segment Routing with IPv6
[    1.039979] NET: Registered protocol family 17
[    1.044445] 8021q: 802.1Q VLAN Support v1.8
[    1.053034] UBI: auto-attach mtd2
[    1.056411] ubi0: attaching mtd2
[    1.177750] ubi0: scanning is finished
[    1.194718] ubi0: attached mtd2 (name "ubi", size 10 MiB)
[    1.200152] ubi0: PEB size: 16384 bytes (16 KiB), LEB size: 15872 bytes
[    1.206770] ubi0: min./max. I/O unit sizes: 512/512, sub-page size 256
[    1.213272] ubi0: VID header offset: 256 (aligned 256), data offset: 512
[    1.219962] ubi0: good PEBs: 688, bad PEBs: 0, corrupted PEBs: 0
[    1.225966] ubi0: user volume: 3, internal volumes: 1, max. volumes count: 92
[    1.233067] ubi0: max/mean erase counter: 2/1, WL threshold: 4096, image sequence number: 0
[    1.241397] ubi0: available PEBs: 0, total reserved PEBs: 688, PEBs reserved for bad PEB handling: 40
[    1.251607] block ubiblock0_1: created from ubi0:1(rootfs)
[    1.257116] ubiblock: device ubiblock0_1 (rootfs) set to be root filesystem
[    1.264344] rtc-mv f1010300.rtc: setting system clock to 2019-02-22 11:05:41 UTC (1550833541)
[    1.273427] ata1: SATA link down (SStatus 0 SControl F300)
[    1.279419] ubi0: background thread "ubi_bgt0d" started, PID 944
[    1.425885] usb 1-1: new high-speed USB device number 2 using orion-ehci
[    1.607244] ata2: SATA link down (SStatus 0 SControl F300)
[    1.620584] VFS: Mounted root (squashfs filesystem) readonly on device 254:0.
[    1.632041] Freeing unused kernel memory: 1024K
[    1.641699] hub 1-1:1.0: USB hub found
[    1.647222] hub 1-1:1.0: 4 ports detected
[    1.743352] random: fast init done
[    2.119165] init: Console is alive
[    2.122771] init: - watchdog -
[    2.262536] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[    2.269981] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[    2.279799] init: - preinit -
[    2.936375] random: jshn: uninitialized urandom read (4 bytes read)
[    3.041228] random: jshn: uninitialized urandom read (4 bytes read)
[    3.080659] random: jshn: uninitialized urandom read (4 bytes read)
[    3.186146] mv643xx_eth_port mv643xx_eth_port.0 eth0: link up, 1000 Mb/s, full duplex, flow control disabled
[    3.195992] mv643xx_eth_port mv643xx_eth_port.0 eth0: link down
[    3.203715] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
Press the [f] key and hit [enter] to enter failsafe mode
Press the [1], [2], [3] or [4] key and hit [enter] to select the debug level
[    6.201158] mv643xx_eth_port mv643xx_eth_port.0 eth0: link up, 1000 Mb/s, full duplex, flow control disabled
[    6.211038] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[    6.470026] UBIFS (ubi0:2): background thread "ubifs_bgt0_2" started, PID 1019
[    6.477636] UBIFS (ubi0:2): recovery needed
[    6.588412] UBIFS (ubi0:2): recovery completed
[    6.592937] UBIFS (ubi0:2): UBIFS: mounted UBI device 0, volume 2, name "rootfs_data"
[    6.600770] UBIFS (ubi0:2): LEB size: 15872 bytes (15 KiB), min./max. I/O unit sizes: 512 bytes/512 bytes
[    6.610316] UBIFS (ubi0:2): FS size: 6650368 bytes (6 MiB, 419 LEBs), journal size 333312 bytes (0 MiB, 21 LEBs)
[    6.620462] UBIFS (ubi0:2): reserved for root: 314112 bytes (306 KiB)
[    6.626895] UBIFS (ubi0:2): media format: w4/r0 (latest is w5/r0), UUID 042FC9F7-5D9A-4EF4-B83A-292B4F3A9917, small LPT model
[    6.644427] mount_root: switching to ubifs overlay
[    6.667593] urandom-seed: Seeding with /etc/urandom.seed
[    6.781977] procd: - early -
[    6.784996] procd: - watchdog -
[    7.726877] procd: - watchdog -
[    7.730299] procd: - ubus -
[    7.808753] urandom_read: 3 callbacks suppressed
[    7.808762] random: ubusd: uninitialized urandom read (4 bytes read)
[    7.820518] random: ubusd: uninitialized urandom read (4 bytes read)
[    7.827330] random: ubusd: uninitialized urandom read (4 bytes read)
[    7.834911] procd: - init -
Please press Enter to activate this console.
[    8.103908] kmodloader: loading kernel modules from /etc/modules.d/*
[    8.114747] ip6_tables: (C) 2000-2006 Netfilter Core Team
[    8.132168] ip_tables: (C) 2000-2006 Netfilter Core Team
[    8.144503] nf_conntrack version 0.5.0 (2048 buckets, 8192 max)
[    8.194369] xt_time: kernel timezone is -0000
[    8.207895] PPP generic driver version 2.4.2
[    8.214566] NET: Registered protocol family 24
[    8.222643] kmodloader: done loading kernel modules from /etc/modules.d/*
[   13.510400] br-lan: port 1(eth0) entered blocking state
[   13.515616] br-lan: port 1(eth0) entered disabled state
[   13.521215] device eth0 entered promiscuous mode
[   13.556199] IPv6: ADDRCONF(NETDEV_UP): br-lan: link is not ready
[   15.782578] mv643xx_eth_port mv643xx_eth_port.0 eth0: link up, 1000 Mb/s, full duplex, flow control disabled
[   15.792459] br-lan: port 1(eth0) entered blocking state
[   15.797703] br-lan: port 1(eth0) entered forwarding state
[   15.804959] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready



BusyBox v1.30.0 () built-in shell (ash)

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 OpenWrt SNAPSHOT, r9133-e906a75e67
 .....................................................
  ruined by kapieyow                  build: nas220-2
 -----------------------------------------------------
=== WARNING! =====================================
There is no root password defined on this device!
Use the "passwd" command to set up a new password
in order to prevent unauthorized SSH logins.
--------------------------------------------------
root@OpenWrt:/#

It took a while, but I finally have this device supported officially. It's in the snapshot builds now. Definitely use these over any older branches I had out there.

The significant adds from some of the early images are:

  • A new version of u-boot is included
  • New u-boot defaults the env vars it needs except MAC. See install notes.
  • Added LEDs
  • Added buttons
  • Added fan control via the adt7476 chip. So no cron.
2 Likes

Hi,
I tried to use the official installation Tutorial.

But after I get serial access, some commands are not working.
Where is my mistake?

         __  __                      _ _
        |  \/  | __ _ _ ____   _____| | |
        | |\/| |/ _` | '__\ \ / / _ \ | |
        | |  | | (_| | |   \ V /  __/ | |
        |_|  |_|\__,_|_|    \_/ \___|_|_|
 _   _     ____              _
| | | |   | __ )  ___   ___ | |_
| | | |___|  _ \ / _ \ / _ \| __|
| |_| |___| |_) | (_) | (_) | |_
 \___/    |____/ \___/ \___/ \__|  ** uboot_ver:v0.2.0 **

 ** MARVELL BOARD: LASSEN LE

U-Boot 1.1.4 (Sep  9 2010 - 15:00:08) Marvell version: 3.4.18

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

Soc: 88F6192 A1 (DDR2)
CPU running @ 800Mhz L2 running @ 400Mhz
SysClock = 200Mhz , TClock = 166Mhz

DRAM CAS Latency = 3 tRP = 3 tRAS = 8 tRCD=3
DRAM CS[0] base 0x00000000   size 128MB
DRAM Total size 128MB  16bit width
Found ADT7473, program PWM1 ... OK
Addresses 8M - 0M are saved for the U-Boot usage.
Mem malloc Initialization (8M - 7M): Done
NAND:32 MB

Marvell Serial ATA Adapter
Integrated Sata device found


CPU : Marvell Feroceon (Rev 1)
Scanning partition header:
Found sign PrEr at c0000
Found sign KrNl at 2c0000
Found sign RoOt at 540000

Streaming disabled
Write allocate disabled


USB 0: host mode
PEX 0: interface detected no Link.
Net:   egiga0 [PRIME]
Hit any key to stop autoboot:  0
--------------------------------------------------------------------------
Marvell>> version
--------------------------------------------------------------------------
U-Boot 1.1.4 (Sep  9 2010 - 15:00:08) Marvell version: 3.4.18
--------------------------------------------------------------------------
Marvell>> tftpboot 0x2000000 u-boot.kwb
--------------------------------------------------------------------------
Using egiga0 device
TFTP from server 10.4.50.5; our IP address is 10.4.50.165
Filename 'u-boot.kwb'.
Load address: 0x2000000
Loading: #################################################################
         ############################################
done
Bytes transferred = 557684 (88274 hex)
--------------------------------------------------------------------------
Marvell>> nand erase.part uboot
--------------------------------------------------------------------------
Usage:
nand                   - NAND sub-system
--------------------------------------------------------------------------
Marvell>> nand write 0x2000000 0x0 ${filesize}
--------------------------------------------------------------------------
NAND write: device 0 offset 0x0, size 0x88274
nand_write_ecc: Attempt to write not page aligned data
 0 bytes written: ERROR
--------------------------------------------------------------------------
Marvell>> nand info
--------------------------------------------------------------------------
Device 0: NAND 32MB 3,3V 8-bit, sector size 16 KB
--------------------------------------------------------------------------

Here are some additional Informations:

Device: Seagate Blackarmor NAS220 (PN: 9SR5AH-500)
OpenWRT-Files: https://downloads.openwrt.org/releases/21.02.3/targets/kirkwood/generic/

  • /u-boot-nas220/u-boot.kwb
  • /openwrt-21.02.3-kirkwood-seagate_blackarmor-nas220-initramfs-uImage
  • /openwrt-21.02.3-kirkwood-seagate_blackarmor-nas220-squashfs-factory.bin
  • /openwrt-21.02.3-kirkwood-seagate_blackarmor-nas220-squashfs-sysupgrade.bin
    TFTP-Server: http://tftpd32.jounin.net

Layout-Infos from "printenv":

console=console=ttyS0,115200 mtdparts=nand_mtd:0x000a0000@0x0(uboot),0x00010000@0x000a0000(param),0x00200000@0x000c0000(preroot),0x00280000@0x002c0000(uimage),0x01a00000@0x00540000(rootfs),0x000c0000@0x01f40000(misc),32m@0x0(flash)
bootcmd_f=nand reset; nand read.e 0x800000 0x000c4000 0x00198200; check_crc32 PrEr;
bootcmd=nand reset; nand read.e 0x800000 0x000c4000 0x00198200; check_crc32 PrEr; nand reset; nand read.e 0x40000 0x002c4000 0x00226600; check_crc32 KrNl; setenv bootargs $(console) $(bootargs_root);  bootm 0x40000;

Hi, are you installing from a Linux machine? If so, or you have access to one, you can use the debrick instructions to boot the new uboot via serial and then follow the uboot update guide from there.

As long as you can kwboot you’re pretty safe from ever bricking a Kirkwood

Hi BlueTarg,

It has been a while. It has been a while since I worked on this device. I had a slightly different version of
the stock u-boot (v0.1.7 / 1.1.4 Aug 17 2009) but I doubt that is the issue. Do I understand correctly that the nand erase and nand write commands didn't work and you are still able to boot into u-boot?

If so I wonder if we should have you use the hex offsets to those commands. It is possible I used commands that work in the newer u-boot (after upgrade) but do not in the older one. I can get you the hex offsets if you give me a bit. I want to triple check our mtdparts align etc.

Hi,
yes I tried to update u-boot with Win10/Putty/PL-2303TA.
I saved the complete printenv, but the nand erase.part uboot command didn't works for me and so the nand write 0x2000000 0x0 ${filesize} also fails.
I guess nand erase 0x0 0x000a0000 would do it, but I didn't trieed it.

I was successful over the kwboot-debrick tutorial with ubuntu 20.04:

sudo -i # become root
apt update && apt install -y tftpd-hpa u-boot-tools # install TFTP Server and kwboot
systemctl status tftpd-hpa # check deamon
cat /etc/default/tftpd-hpa # check config
cd $(grep -i ^TFTP_DIRECTORY /etc/default/tftpd-hpa | cut -f2 -d'"') # change to Server Directory
# get files
wget https://downloads.openwrt.org/releases/21.02.3/targets/kirkwood/generic/u-boot-nas220/u-boot.kwb
wget https://downloads.openwrt.org/releases/21.02.3/targets/kirkwood/generic/openwrt-21.02.3-kirkwood-seagate_blackarmor-nas220-initramfs-uImage
wget https://downloads.openwrt.org/releases/21.02.3/targets/kirkwood/generic/openwrt-21.02.3-kirkwood-seagate_blackarmor-nas220-squashfs-factory.bin
wget https://downloads.openwrt.org/releases/21.02.3/targets/kirkwood/generic/openwrt-21.02.3-kirkwood-seagate_blackarmor-nas220-squashfs-sysupgrade.bin
reboot

The important thing was, that I already saved the printenv, because in the debrick u-boot, the environment is empty.

For short:

kwboot -t -B 115200 /dev/ttyUSB0 -b u-boot.kwb -p
setenv ethaddr <your MAC>
saveenv
tftpboot 0x2000000 u-boot.kwb

The rest of the original tutorial works fine.
In addition to that I added an 8GB thumbdrive for Extroot.