Add support for Iomega Storcenter ix4-200d

after you have done the edit to the relevant files, you must do the usual steps for compiling from source,
make menuconfig
that will bring up a BIOS-like interface to select the device you want to build and what packages you want, then close and save
then you can build with
make
and go do something else for a little while since it has to compile the whole buildsystem environment first, and then the device. Any subsequent compile you run will only have to build the device kernel/packages so it will be faster

Hi,

That bootlog looks good to me, it has failed to boot as the sysupgrade image isn’t bootable.

You need to use the initramfs-uimage file to boot openwrt. Available here;
https://downloads.openwrt.org/releases/21.02.1/targets/kirkwood/generic/openwrt-21.02.1-kirkwood-iom_ix2-200-initramfs-uImage

The ix2 instructions I linked to set this out pretty clearly, boot initramfs then sysupgrade with the sysupgrade image.

If you are dead set on creating your own image the openwrt wiki has easy to follow instructions.
Image compilation guide; https://openwrt.org/docs/guide-developer/toolchain/use-buildsystem

Adding a new device (dtb etc); https://openwrt.org/docs/guide-developer/adding_new_device
You will likely get a working device by only changing the Makefile and adding the DTS. GPIO etc is not strictly necessary to boot and run, at least not for kirkwoods.

And here's a custom DTS; https://forum.doozan.com/read.php?2,22623,22673#msg-22673


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

 ** MARVELL BOARD: IX4-110 LE 

U-Boot 1.1.4 (Oct 15 2009 - 17:28:22) Marvell version: 3.4.18

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

Soc: 88F6281 A1 (DDR2)
CPU running @ 1200Mhz L2 running @ 400Mhz
SysClock = 400Mhz , TClock = 200Mhz 

DRAM CAS Latency = 5 tRP = 5 tRAS = 18 tRCD=6
DRAM CS[0] base 0x00000000   size 256MB 
DRAM CS[1] base 0x10000000   size 256MB 
DRAM Total size 512MB  16bit width
Found 0x20 i2c device
Set Power State as Always On
Addresses 8M - 0M are saved for the U-Boot usage.
Mem malloc Initialization (8M - 7M): Done
NAND:32 MB
Found ADT7473, program LED ...(led_volt=90)  OK
Found ADT7473, program thermal/Fan ...(pwm_min=0) (pwm_max=130) (therm=67) (temp_min=60)  OK

Marvell Serial ATA Adapter
Integrated Sata device found
[0 1 0]: Enable DMA mode (6)
  Device 1 @ 0 1:
Model: ST3500412AS                              Firm: CC37     Ser#:             9VV54CX3
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 476940.0 MB = 465.7 GB (976773168 x 512)


CPU : Marvell Feroceon (Rev 1)
Found initrd at 0x2d4000

Streaming disabled 
Write allocate disabled

Module 0 is RGMII
Module 1 is RGMII

USB 0: host mode
PEX 0: PCI Express Root Complex Interface
PEX interface detected Link X1
SCSI:  AHCI 0001.0000 32 slots 3 ports 3 Gbps 0x7 impl IDE mode
flags: 64bit ncq stag led pmp slum part 
scanning bus for devices...
Net:   egiga0 [PRIME], egiga1
Hit any key to stop autoboot:  0 
Marvell>> 
Marvell>> setenv mainlineLinux yes
Marvell>> setenv arcNumber 1682
Marvell>> setenv console 'console=ttyS0,115200n8'
Marvell>> setenv mtdparts 'mtdparts=orion_nand:0x100000@0x000000(u-boot)ro,0x20000@0xA0000(u-boot environment)ro,0x300000@0x100000(kernel),0x1C00000@0x400000(ubi)'
Marvell>> setenv bootargs_root 'root='
Marvell>> setenv bootcmd 'setenv bootargs ${console} ${mtdparts} ${bootargs_root}; nand read.e 0x800000 0x100000 0x300000; bootm 0x00800000'
Marvell>> # saveenv
Unknown command '#' - try 'help'
Marvell>> setenv serverip 192.168.4.201
Marvell>> setenv ipaddr 192.168.4.205
Marvell>> 
Marvell>> tftpboot 0x00800000 openwrt-21.02.1-kirkwood-iom_ix2-200-initramfs-uImage
Using egiga0 device
TFTP from server 192.168.4.201; our IP address is 192.168.4.205
Filename 'openwrt-21.02.1-kirkwood-iom_ix2-200-initramfs-uImage'.
Load address: 0x800000
Loading: #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         ####################
done
Bytes transferred = 4425314 (438662 hex)
Marvell>> bootm 0x00800000
## Booting image at 00800000 ...
   Image Name:   ARM OpenWrt Linux-5.4.154
   Created:      2021-10-24   9:01:35 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    4425250 Bytes =  4.2 MB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
OK

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 5.4.154 (builder@buildhost) (gcc version 8.4.0 (OpenWrt GCC 8.4.0 r16325-88151b8303)) #0 Sun Oct 24 09:01:35 2021
[    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: Iomega StorCenter ix2-200
[    0.000000] Memory policy: Data cache writeback
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 129920
[    0.000000] Kernel command line: console=ttyS0,115200n8 earlyprintk
[    0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 505472K/524288K available (5159K kernel code, 179K rwdata, 828K rodata, 7168K init, 211K bss, 18816K reserved, 0K cma-reserved)
[    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] random: get_random_bytes called from 0xc0700b9c with crng_init=0
[    0.000000] clocksource: orion_clocksource: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 9556302233 ns
[    0.000007] sched_clock: 32 bits at 200MHz, resolution 5ns, wraps every 10737418237ns
[    0.000033] Switching to timer-based delay loop, resolution 5ns
[    0.000103] Calibrating delay loop (skipped), value calculated using timer frequency.. 400.00 BogoMIPS (lpj=2000000)
[    0.000120] pid_max: default: 32768 minimum: 301
[    0.000320] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.000338] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.001154] CPU: Testing write buffer coherency: ok
[    0.001905] Setting up static identity map for 0x100000 - 0x10003c
[    0.002142] mvebu-soc-id: MVEBU SoC ID=0x6281, Rev=0x3
[    0.005592] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.005615] futex hash table entries: 256 (order: -1, 3072 bytes, linear)
[    0.005731] pinctrl core: initialized pinctrl subsystem
[    0.006835] NET: Registered protocol family 16
[    0.007184] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.008070] cpuidle: using governor ladder
[    0.008390] Feroceon L2: Enabling L2
[    0.008429] Feroceon L2: Cache support initialised.
[    0.012199] No ATAGs?
[    0.029861] SCSI subsystem initialized
[    0.030796] usbcore: registered new interface driver usbfs
[    0.030849] usbcore: registered new interface driver hub
[    0.030895] usbcore: registered new device driver usb
[    0.031044] workqueue: max_active 576 requested for napi_workq is out of range, clamping between 1 and 512
[    0.033644] clocksource: Switched to clocksource orion_clocksource
[    0.034283] thermal_sys: Registered thermal governor 'step_wise'
[    0.034497] NET: Registered protocol family 2
[    0.034642] IP idents hash table entries: 8192 (order: 4, 65536 bytes, linear)
[    0.035361] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes, linear)
[    0.035391] TCP established hash table entries: 4096 (order: 2, 16384 bytes, linear)
[    0.035442] TCP bind hash table entries: 4096 (order: 2, 16384 bytes, linear)
[    0.035491] TCP: Hash tables configured (established 4096 bind 4096)
[    0.035564] UDP hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.035585] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.035747] NET: Registered protocol family 1
[    0.035774] PCI: CLS 0 bytes, default 32
[    0.141386] workingset: timestamp_bits=14 max_order=17 bucket_order=3
[    0.146701] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.146711] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.153721] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 251)
[    0.157397] kirkwood-pinctrl f1010000.pin-controller: registered pinctrl driver
[    0.158259] mvebu-gpio f1010140.gpio: IRQ index 3 not found
[    0.158727] Serial: 8250/16550 driver, 16 ports, IRQ sharing enabled
[    0.160357] printk: console [ttyS0] disabled
[    0.160435] f1012000.serial: ttyS0 at MMIO 0xf1012000 (irq = 26, base_baud = 12500000) is a 16550A
[    0.557175] printk: console [ttyS0] enabled
[    0.561888] Loading iSCSI transport class v2.0-870.
[    0.568592] nand: device found, Manufacturer ID: 0xec, Chip ID: 0x75
[    0.575001] nand: Samsung NAND 32MiB 3,3V 8-bit
[    0.579551] nand: 32 MiB, SLC, erase size: 16 KiB, page size: 512, OOB size: 16
[    0.586919] Scanning device for bad blocks
[    0.804948] 4 fixed-partitions partitions found on MTD device orion_nand
[    0.811675] Creating 4 MTD partitions on "orion_nand":
[    0.816848] 0x000000000000-0x000000100000 : "u-boot"
[    0.822479] 0x0000000a0000-0x0000000c0000 : "u-boot environment"
[    0.829108] 0x000000100000-0x000000400000 : "kernel"
[    0.834767] 0x000000400000-0x000002000000 : "ubi"
[    0.841100] libphy: Fixed MDIO Bus: probed
[    0.845902] libphy: orion_mdio_bus: probed
[    0.854273] mdio_bus f1072004.mdio-bus-mii: MDIO device at address 11 is missing.
[    0.862094] mv643xx_eth: MV-643xx 10/100/1000 ethernet driver version 1.4
[    0.869810] rtc-mv f1010300.rtc: registered as rtc0
[    0.874801] i2c /dev entries driver
[    0.879185] watchdog: f1020300.watchdog-timer: driver supplied timeout (4294967295) out of range
[    0.888038] watchdog: f1020300.watchdog-timer: falling back to default timeout (21)
[    0.895889] orion_wdt: Initial timeout 21 sec
[    0.964838] marvell-cesa f1030000.crypto: CESA device successfully registered
[    0.972934] NET: Registered protocol family 10
[    0.978988] Segment Routing with IPv6
[    0.982736] NET: Registered protocol family 17
[    0.987273] bridge: filtering via arp/ip/ip6tables is no longer available by default. Update your scripts to load br_netfilter if you need this.
[    1.000430] 8021q: 802.1Q VLAN Support v1.8
[    1.007326] UBI error: no valid UBI magic found inside mtd3
[    1.012965] rtc-mv f1010300.rtc: setting system clock to 2021-12-13T05:56:35 UTC (1639374995)
[    1.042193] Freeing unused kernel memory: 7168K
[    1.046805] Run /init as init process
[    1.326723] init: Console is alive
[    1.330279] init: - watchdog -
[    1.340030] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[    1.348291] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    1.359632] ehci-fsl: Freescale EHCI Host controller driver
[    1.370241] ehci-orion: EHCI orion driver
[    1.374464] orion-ehci f1050000.ehci: EHCI Host Controller
[    1.380011] orion-ehci f1050000.ehci: new USB bus registered, assigned bus number 1
[    1.387863] orion-ehci f1050000.ehci: irq 30, io mem 0xf1050000
[    1.423668] orion-ehci f1050000.ehci: USB 2.0 started, EHCI 1.00
[    1.430288] hub 1-0:1.0: USB hub found
[    1.434302] hub 1-0:1.0: 1 port detected
[    1.443617] ehci-platform: EHCI generic platform driver
[    1.458612] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[    1.476190] init: - preinit -
[    1.641828] random: jshn: uninitialized urandom read (4 bytes read)
[    1.683528] random: jshn: uninitialized urandom read (4 bytes read)
[    1.712195] random: jshn: uninitialized urandom read (4 bytes read)
[    1.723696] usb 1-1: new high-speed USB device number 2 using orion-ehci
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
[    1.935760] hub 1-1:1.0: USB hub found
[    1.939867] hub 1-1:1.0: 4 ports detected
[    3.663644] random: fast init done
[    5.959851] procd: - early -
[    5.962805] procd: - watchdog -
[    6.507316] procd: - watchdog -
[    6.510719] procd: - ubus -
[    6.566376] procd: - init -
Please press Enter to activate this console.
[    6.889589] kmodloader: loading kernel modules from /etc/modules.d/*
[    6.964774] xt_time: kernel timezone is -0000
[    6.998791] PPP generic driver version 2.4.2
[    7.026236] NET: Registered protocol family 24
[    7.059157] kmodloader: done loading kernel modules from /etc/modules.d/*
[    7.135920] urngd: v1.0.2 started.
[    7.297310] random: crng init done
[    7.300725] random: 7 urandom warning(s) missed due to ratelimiting

BusyBox v1.33.1 (2021-10-24 09:01:35 UTC) built-in shell (ash)

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 OpenWrt 21.02.1, r16325-88151b8303
 -----------------------------------------------------
=== 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:/# ifconfig
lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:120 errors:0 dropped:0 overruns:0 frame:0
          TX packets:120 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:9360 (9.1 KiB)  TX bytes:9360 (9.1 KiB)

root@OpenWrt:/# 
root@OpenWrt:/# 
root@OpenWrt:/# dmesg
[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 5.4.154 (builder@buildhost) (gcc version 8.4.0 (OpenWrt GCC 8.4.0 r16325-88151b8303)) #0 Sun Oct 24 09:01:35 2021
[    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: Iomega StorCenter ix2-200
[    0.000000] Memory policy: Data cache writeback
[    0.000000] On node 0 totalpages: 131072
[    0.000000]   Normal zone: 1152 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 131072 pages, LIFO batch:31
[    0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[    0.000000] pcpu-alloc: [0] 0 
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 129920
[    0.000000] Kernel command line: console=ttyS0,115200n8 earlyprintk
[    0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 505472K/524288K available (5159K kernel code, 179K rwdata, 828K rodata, 7168K init, 211K bss, 18816K reserved, 0K cma-reserved)
[    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] random: get_random_bytes called from 0xc0700b9c with crng_init=0
[    0.000000] clocksource: orion_clocksource: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 9556302233 ns
[    0.000007] sched_clock: 32 bits at 200MHz, resolution 5ns, wraps every 10737418237ns
[    0.000033] Switching to timer-based delay loop, resolution 5ns
[    0.000103] Calibrating delay loop (skipped), value calculated using timer frequency.. 400.00 BogoMIPS (lpj=2000000)
[    0.000120] pid_max: default: 32768 minimum: 301
[    0.000320] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.000338] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.001154] CPU: Testing write buffer coherency: ok
[    0.001905] Setting up static identity map for 0x100000 - 0x10003c
[    0.002142] mvebu-soc-id: MVEBU SoC ID=0x6281, Rev=0x3
[    0.005592] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.005615] futex hash table entries: 256 (order: -1, 3072 bytes, linear)
[    0.005731] pinctrl core: initialized pinctrl subsystem
[    0.006835] NET: Registered protocol family 16
[    0.007184] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.008070] cpuidle: using governor ladder
[    0.008390] Feroceon L2: Enabling L2
[    0.008429] Feroceon L2: Cache support initialised.
[    0.012199] No ATAGs?
[    0.029861] SCSI subsystem initialized
[    0.030578] libata version 3.00 loaded.
[    0.030796] usbcore: registered new interface driver usbfs
[    0.030849] usbcore: registered new interface driver hub
[    0.030895] usbcore: registered new device driver usb
[    0.031044] workqueue: max_active 576 requested for napi_workq is out of range, clamping between 1 and 512
[    0.033644] clocksource: Switched to clocksource orion_clocksource
[    0.034283] thermal_sys: Registered thermal governor 'step_wise'
[    0.034497] NET: Registered protocol family 2
[    0.034642] IP idents hash table entries: 8192 (order: 4, 65536 bytes, linear)
[    0.035361] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes, linear)
[    0.035391] TCP established hash table entries: 4096 (order: 2, 16384 bytes, linear)
[    0.035442] TCP bind hash table entries: 4096 (order: 2, 16384 bytes, linear)
[    0.035491] TCP: Hash tables configured (established 4096 bind 4096)
[    0.035564] UDP hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.035585] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.035747] NET: Registered protocol family 1
[    0.035774] PCI: CLS 0 bytes, default 32
[    0.141386] workingset: timestamp_bits=14 max_order=17 bucket_order=3
[    0.146701] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.146711] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.153721] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 251)
[    0.157397] kirkwood-pinctrl f1010000.pin-controller: registered pinctrl driver
[    0.158259] mvebu-gpio f1010140.gpio: IRQ index 3 not found
[    0.158727] Serial: 8250/16550 driver, 16 ports, IRQ sharing enabled
[    0.160357] printk: console [ttyS0] disabled
[    0.160435] f1012000.serial: ttyS0 at MMIO 0xf1012000 (irq = 26, base_baud = 12500000) is a 16550A
[    0.557175] printk: console [ttyS0] enabled
[    0.561888] Loading iSCSI transport class v2.0-870.
[    0.568592] nand: device found, Manufacturer ID: 0xec, Chip ID: 0x75
[    0.575001] nand: Samsung NAND 32MiB 3,3V 8-bit
[    0.579551] nand: 32 MiB, SLC, erase size: 16 KiB, page size: 512, OOB size: 16
[    0.586919] Scanning device for bad blocks
[    0.804948] 4 fixed-partitions partitions found on MTD device orion_nand
[    0.811675] Creating 4 MTD partitions on "orion_nand":
[    0.816848] 0x000000000000-0x000000100000 : "u-boot"
[    0.822479] 0x0000000a0000-0x0000000c0000 : "u-boot environment"
[    0.829108] 0x000000100000-0x000000400000 : "kernel"
[    0.834767] 0x000000400000-0x000002000000 : "ubi"
[    0.841100] libphy: Fixed MDIO Bus: probed
[    0.845902] libphy: orion_mdio_bus: probed
[    0.854273] mdio_bus f1072004.mdio-bus-mii: MDIO device at address 11 is missing.
[    0.862094] mv643xx_eth: MV-643xx 10/100/1000 ethernet driver version 1.4
[    0.869810] rtc-mv f1010300.rtc: registered as rtc0
[    0.874801] i2c /dev entries driver
[    0.879185] watchdog: f1020300.watchdog-timer: driver supplied timeout (4294967295) out of range
[    0.888038] watchdog: f1020300.watchdog-timer: falling back to default timeout (21)
[    0.895889] orion_wdt: Initial timeout 21 sec
[    0.964838] marvell-cesa f1030000.crypto: CESA device successfully registered
[    0.972934] NET: Registered protocol family 10
[    0.978988] Segment Routing with IPv6
[    0.982736] NET: Registered protocol family 17
[    0.987273] bridge: filtering via arp/ip/ip6tables is no longer available by default. Update your scripts to load br_netfilter if you need this.
[    1.000430] 8021q: 802.1Q VLAN Support v1.8
[    1.007326] UBI error: no valid UBI magic found inside mtd3
[    1.012965] rtc-mv f1010300.rtc: setting system clock to 2021-12-13T05:56:35 UTC (1639374995)
[    1.042193] Freeing unused kernel memory: 7168K
[    1.046805] Run /init as init process
[    1.326723] init: Console is alive
[    1.330279] init: - watchdog -
[    1.340030] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[    1.348291] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    1.359632] ehci-fsl: Freescale EHCI Host controller driver
[    1.370241] ehci-orion: EHCI orion driver
[    1.374464] orion-ehci f1050000.ehci: EHCI Host Controller
[    1.380011] orion-ehci f1050000.ehci: new USB bus registered, assigned bus number 1
[    1.387863] orion-ehci f1050000.ehci: irq 30, io mem 0xf1050000
[    1.423668] orion-ehci f1050000.ehci: USB 2.0 started, EHCI 1.00
[    1.430288] hub 1-0:1.0: USB hub found
[    1.434302] hub 1-0:1.0: 1 port detected
[    1.443617] ehci-platform: EHCI generic platform driver
[    1.458612] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[    1.476190] init: - preinit -
[    1.641828] random: jshn: uninitialized urandom read (4 bytes read)
[    1.683528] random: jshn: uninitialized urandom read (4 bytes read)
[    1.712195] random: jshn: uninitialized urandom read (4 bytes read)
[    1.723696] usb 1-1: new high-speed USB device number 2 using orion-ehci
[    1.935760] hub 1-1:1.0: USB hub found
[    1.939867] hub 1-1:1.0: 4 ports detected
[    3.663644] random: fast init done
[    5.959851] procd: - early -
[    5.962805] procd: - watchdog -
[    6.507316] procd: - watchdog -
[    6.510719] procd: - ubus -
[    6.566376] procd: - init -
[    6.889589] kmodloader: loading kernel modules from /etc/modules.d/*
[    6.964774] xt_time: kernel timezone is -0000
[    6.998791] PPP generic driver version 2.4.2
[    7.026236] NET: Registered protocol family 24
[    7.059157] kmodloader: done loading kernel modules from /etc/modules.d/*
[    7.135920] urngd: v1.0.2 started.
[    7.297310] random: crng init done
[    7.300725] random: 7 urandom warning(s) missed due to ratelimiting
root@OpenWrt:/# 

well, it booted!
but I had no ethernet!

Can anyone help me to modify the needed files and build an image? please! :pleading_face:

Ok, that’s a start, but it looks like the ix2 dts doesn’t bring up the Ethernet interface.

You will need to create your own image using the custom ix4 dts I linked above.

Openwrt has good instructions on the wiki for building images. To make it super easy you could just replace the contents ix2 dts with the ix4 dts and build a hacked ix2 image.

@jdwl1o1 Thank you.

Yes, I will try to do it, but I asked for help at least on the files replacement because is a little bit confusing to me the part of which files and where are they to replace, specifically the file that later will be converted into a .patch...

I've never compiled an image, I've just used imagebuilder long time ago

if some of you can help me save and skip some of the steps will be really helpful to me!

Thanks!

you can see the original file that the current ix2 iomega device patch is editing in the first two lines of it https://github.com/openwrt/openwrt/blob/master/target/linux/kirkwood/patches-5.10/103-iomega-ix2-200.patch

--- a/arch/arm/boot/dts/kirkwood-iomega_ix2_200.dts
+++ b/arch/arm/boot/dts/kirkwood-iomega_ix2_200.dts

that will be a file in that folder in the Linux kernel source. For example see that folder in the Github here (but since Github is garbage and can't show more than 1000 files in the list it's truncating it so you don't see that file in the web interface, but it's there in the actual source) https://github.com/torvalds/linux/tree/master/arch/arm/boot/dts

As far as guidance, I can give you a rundown of what I think you should do, based off memory and off the wiki article, I can't guarantee it's all 100% correct or will work, but it still probably better than trying to figure it out on your own.

So the overview of what you need to do is:
download OpenWrt build system

installing quilt package in your Linux VM and configure it according to the article https://openwrt.org/docs/guide-developer/toolchain/use-patches-with-buildsystem#prepare_quilt_configuration

open a terminal inside the OpenWrt build system folder (called "openwrt")

git branch v21.02.1
(optional) Use git commands to switch to 21.02 release

make menuconfig
this opens a BIOS-like interface to select a ton of settings. Choose a device in the Kirkwood target (any device), then save your change and close

make target/linux/{clean,prepare} V=s QUILT=1
to open the linux kernel package for edit

cd something something
move down the folder tree to where the Linux kernel source has been unpacked for Kirkwood target.
An example Kirkwood kernel folder from my build system is

/openwrt/build_dir/target-arm_xscale_musl_eabi/linux-kirkwood/linux-5.10.79

yours might have a different kernel version number, but the rest should be the same.
You are now in the holy Linux source folder, Praise the Penguin.

quilt series
ask Quilt to list all patches it can apply to this target. It will show a lot of stuff and then eventually it will show the list of patches in here https://github.com/openwrt/openwrt/tree/master/target/linux/kirkwood/patches-5.10

quilt push 203-blackarmor-nas220.patch
ask quilt to apply all patches down to the very last one to the source.

quilt new platform/989-my_new_device.patch
asks quilt to create a new patch with that name. Note the number in front, it's supposed to be high so it is always ordered last, ordering is important.
the "platform/" at the beginning is to ask quilt to put the patch in /openwrt/target/linux/kirkwood/patches-5.10/, with "generic/" it will go in the folder of generic linux patches applied to all devices in OpenWrt (which is somewhere, but I don't remember where atm)

quilt edit /arch/arm/boot/dts/kirkwood-iomega_ix2_200.dts
This opens that file for editing.
Now if you want to do it quick-and-dirty you can just delete everything and replace it with the contents of kirkwood-iomega_ix4_200d.dts you got from above. You probably need to keep the same flash partitions/names from the ix2_200.dts I guess.
Otherwise you can edit a new dts file to create a new one, if you want to at least try to do this in a way that can be contributed to OpenWrt (which may or may not take many months of wait and review and edits to satisfy the reviewers)

Close the editor

quilt diff
show what changes you have done

quilt refresh
add the changes to the patch

cd ../../../..
go back to openwrt directory

make target/linux/update package/index V=s
copies over the patch you created. As said in the wiki, you can also simply copy the patch files over from the local work folder of quilt here (target/linux/<arch_name>//patches/generic or target/linux/<arch_name>//patches) to the source folder (target/linux/generic/patches-* or target/linux/<arch_name>/patches-*)

And now you should have that patch in the /openwrt/target/linux/kirkwood/patches-5.10/ folder

If you went for the "easy hack route" you have edited the kirkwood-iomega_ix2_200.dts file so you can just build that device from source as normal, but the dts will be for your device instead.

If you went for the "trying to do it properly" route, you now need to edit this file https://github.com/openwrt/openwrt/blob/master/target/linux/kirkwood/image/Makefile#L158 (just copy the existing code block for iomega_ix2 and change names)
edit this file about LED definitions to add the name of your device also here near the name of the other iomega https://github.com/openwrt/openwrt/blob/master/target/linux/kirkwood/base-files/etc/board.d/01_leds#L12
(optional, if you are a savage and want the default network to be DHCP instead of 192.168.1.1) edit this file about network interfaces with the name of your device https://github.com/openwrt/openwrt/blob/master/target/linux/kirkwood/base-files/etc/board.d/02_network#L24
(and listing here for the sake of completeness, there should be no need to edit the following file as only some devices need special treatment when doing sysupgrade. Since the iomega_ix2 does not need this yours won't need it either) https://github.com/openwrt/openwrt/blob/master/target/linux/kirkwood/base-files/lib/upgrade/platform.sh

I recently came across a ix4-200d, and wanted to blow some new life into this thread. I'm okay with building a new image with the modified .dts as @jdwl1o1 suggested. However, I'm unsure about the nand-layout.

The .dts from the Doozan-forum has the following layout:

&nand {                                    
        status = "okay";                   
                                           
        partition@0 {                      
                label = "u-boot";          
                reg = <0x0000000 0xb0000>;
                read-only;                 
        };

		partition@a0000 {
                label = "env";
                reg = <0xa0000 0x10000>;
                read-only;
        };
                                           
        partition@b0000 {                 
                label = "uImage";          
                reg = <0xb0000 0x224000>;
        };                
                                           
        partition@2d4000 {                 
                label = "uInitrd";          
                reg = <0x2d4000 0x224000>;
        };
};     

A newer .dts reference in that same thread (found here) has a different layout, and the author claims "added NAND partitions to properly handle the stock firmware's layout".

&nand {
        chip-delay = <40>;
        status = "okay";

        partition@0 {
                label = "u-boot";
                reg = <0x00000000 0x000a0000>;
                read-only;
        };

        partition@a0000 {
                label = "env";
                reg = <0x000a0000 0x00010000>;
        };

        partition@b0000 {
                label = "zImage";
                reg = <0x000b0000 0x00228000>;
        };

        partition@2d8000 {
                label = "initrd";
                reg = <0x002d8000 0x00300000>;
        };
};

How would I be able to verify the correct layout/code?

Check the bootlog and see what the factory image does - that will give you the default partitions.

Though if you’re not concerned with being able to return to stock then only the uboot and env partitions matter, you can partition the remaining nand however you like

1 Like

can someone share built image for flashing ?

Hey guys, any news on ix4-200d support?
@Goossens, did you manage to crack the nand-layout?
@braian87b, i didn't quite understand when you talked about uploading the image... did you manage to record affirmware on the nand?

I've created an image, based on the Doozan-forum DTS. It's currently missing GPIO for the buttons, and I'm not sure about the correct addresses of the LEDs. Network should work though, so we can refine from there.

I currently don't have access to the device myself, so use/test this at your own risk! You can get the image here

Installation instructions:

1. download initramfs-uImage and copy into tftp server
2. access uboot environment with serial cable and run
    ```
    setenv mainlineLinux yes
    setenv arcNumber 1682
    setenv console 'console=ttyS0,115200n8'
    setenv mtdparts 'mtdparts=orion_nand:0xb0000@0x0000000(u-boot)ro,0x10000@0xa0000(u-boot environment)ro,0x224000@0xb0000(kernel),0x224000@0x2d4000(ubi)'
    setenv bootargs_root 'root='
    setenv bootcmd 'setenv bootargs ${console} ${mtdparts} ${bootargs_root}; nand read.e 0x800000 0xb0000 0x224000; bootm 0x00800000'
    saveenv
    setenv serverip 192.168.1.1
    setenv ipaddr 192.168.1.2
    tftpboot 0x00800000 [initramfs-uImage filename]
    bootm 0x00800000
    ```
3. log into openwrt and sysupgrade to install into flash

Please let me know your feedback, also happy to get some help with the GPIO stuff.

Thanks for the file @Goossens

I didn't understand when it said "I don't currently have access to the device"... were you able to install openwrt on the nand? Is the network interface operational?

Forgive me for being cautious, I don't master the processes of building firmware and reverting to factory firmware.

After fiddling some more with the partition addressing, I now have a working image. Ethernet works (#1 as WAN and #2 as LAN), but LEDs and buttons are still WIP. This image is based on the 5.15 kernel and includes LuCI.

Installation instructions:

1. download initramfs-uImage and copy into tftp server
2. connect the tftp server to network port #1
3. access uboot environment with serial cable and run
    ```
    setenv mainlineLinux yes
    setenv arcNumber 1682
    setenv console 'console=ttyS0,115200n8'
    setenv mtdparts 'mtdparts=orion_nand:0x100000@0x000000(u-boot)ro,0x20000@0xA0000(u-boot environment)ro,0x300000@0x100000(kernel),0x1C00000@0x400000(ubi)'
    setenv bootargs_root 'root='
    setenv bootcmd 'setenv bootargs ${console} ${mtdparts} ${bootargs_root}; nand read.e 0x800000 0x100000 0x300000; bootm 0x00800000'
    saveenv
    setenv serverip 192.168.1.1
    setenv ipaddr 192.168.1.2
    tftpboot 0x00800000 [initramfs-uImage filename]
    bootm 0x00800000
    ```
4. connect to LAN on network port #2, log into openwrt and sysupgrade to install into flash

Note that once you boot into the initramfs-uImage, sysupgrade will give an error:

upgrade: Device marvell,rd88f6281-a not supported by this image
upgrade: Supported devices: iom,ix4-200d Image check failed.

Perform a forced upgrade, this is only a cosmetic error for now.

What I could use some help/feedback with:

  • GPIO addressing for buttons and LEDs.
  • Verification if all 4 HDD bays are recognized. I currently only have 2 disks at hand to test.

Download the image here, and please share any feedback.

1 Like

Due to a kernel-related issue with the Marvell 88SE6121 SATA controller, currently only trays numbered #3 and #4 work, #1 and #2 do not. Other than that, I've not encountered any bugs in my testing yet.

See:

https://bugzilla.kernel.org/show_bug.cgi?id=216094
https://lore.kernel.org/linux-ide/db6b48b7-d69a-564b-24f0-75fbd6a9e543@noerenberg.de

I'm still working on being able to trigger the LEDs, but I'm hitting a bit of a wall. The device uses a 74hc595 shift register driven by an SPI interface. Based on a lot of useful info from this thread, I've compiled my image with kmod-spi-gpio and kmod-gpio-nxp-74hc164.

This results in three entries in /sys/class/gpio, namely gpiochip0, gpiochip32 and gpiochip504. When I run this script for gpiochip504, I can actually toggle the LEDs on gpio 508, 509 and 511. Putting those in my DTS, however, does nothing.

I think I'm missing something with regards to addressing the correct gpiochip in my DTS, but I'm not sure which values to change. Maybe @robimarko has some insight?

The relevant part of the DTS file:

	spi3 {
		compatible = "spi-gpio";
		#address-cells = <0x1>;
		ranges;
		status = "okay";
		sck-gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
		mosi-gpios = <&gpio0 12 GPIO_ACTIVE_LOW>;
		cs-gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
		num-chipselects = <1>;
		#size-cells = <0>;

		gpio_spi: gpio_spi@0 {
			compatible = "fairchild,74hc595";
			reg = <0>;
			gpio-controller;
			#gpio-cells = <2>;
			registers-number = <1>;
			spi-max-frequency = <100000>;
		};
	};

	gpio-leds {
		compatible = "gpio-leds";

		led_status_white {
			label = "status:white";
			gpios = <&gpio_spi 508 GPIO_ACTIVE_LOW>;
		};

		led_status_red {
			label = "status:red";
			gpios = <&gpio_spi 509 GPIO_ACTIVE_LOW>;
		};

		led_power_white {
			label = "power:white";
			gpios = <&gpio_spi 511 GPIO_ACTIVE_HIGH>;
		};
	};

Offsets are wrong, you are confusing the sysfs entries with GPIO controller offsets, look up the base for that gpiochip and subtract that from your offsets to get the appropriate one

Thanks for your reply. I was thinking the same earlier, and tried the offset (504) for this DTS:

	spi3 {
		compatible = "spi-gpio";
		#address-cells = <0x1>;
		ranges;
		status = "okay";
		sck-gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
		mosi-gpios = <&gpio0 12 GPIO_ACTIVE_LOW>;
		cs-gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
		num-chipselects = <1>;
		#size-cells = <0>;

		gpio_spi: gpio_spi@0 {
			compatible = "fairchild,74hc595";
			reg = <0>;
			gpio-controller;
			#gpio-cells = <2>;
			registers-number = <1>;
			spi-max-frequency = <100000>;
		};
	};

	gpio-leds {
		compatible = "gpio-leds";

		led_status_white {
			label = "status:white";
			gpios = <&gpio_spi 4 GPIO_ACTIVE_LOW>;
		};

		led_status_red {
			label = "status:red";
			gpios = <&gpio_spi 5 GPIO_ACTIVE_LOW>;
		};

		led_power_white {
			label = "power:white";
			gpios = <&gpio_spi 7 GPIO_ACTIVE_HIGH>;
		};
	};

But that doesn't work either. How would the kernel know to bind gpio_spi to gpiochip504?

You are mixing the sysfs representation of GPIO-s and device one that is behind everything.
What do you mean by it doesnt work, LED-s dont get registered or?

Indeed the LEDs didn't register. But I have it working now, the initial DTS was correct (gpio_spi 4 / 5 / 7) but it also needed the kmod-mvsdio package. I now have a fully working image, I'll prepare a patch to add support.