Welcome! Log In Create A New Profile

Advanced

Flashing u-boot WD EX4100

Posted by eep 
eep
Flashing u-boot WD EX4100
October 17, 2024 11:56AM
Hello,

I've managed to mangle up u-boot on this WD EX4100 by trying to flash "u-boot-a38x-Yellowstone_2014T30p6_bodhi-tld-6-nand-uart.bin" from within uboot.
My ultimate goal was to run Debian on this box. I wasn't able to boot into rootfs made with Debian-6.6.2-mvebu-tld-1-rootfs-bodhi.tar.bz2 (I think because USB power doesn't work in stock u-boot for this box?)

Prior to breaking the stock uboot, I made ecc/oob and nonecc/nonoob backups of all the flash partitions. I'm also able to kwboot with the same uboot-tld6.bin, and the box will boot fine into stock WD firmware using this method.

How can I flash the uboot-tld-6 to NAND from inside kwbooted uboot-tld6 ?
How do I restore the saved nand dumps (since my previous attempt fails, and box can only be booted with kwboot).

My brain has been turned to mush from fighting with this box for so many days now, and trying to make sense of the 30+ pages from saschadd and hmartin's threads, so any help appreciated.


Logs below:
Log1) Boot Debian from rootfs, fail
Log2) Flash uboot-tld6 using nand write, fail
Log3) Kwboot log (where I am now)


Log1: Boot Debian from rootfs, fail
## Booting image at 02000000 ...
## Booting kernel from Legacy Image at 02000000 ...
   Image Name:   Linux-6.6.2-mvebu-tld-1
   Created:      2024-10-12  19:07:40 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    5197128 Bytes = 5 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
## Loading init Ramdisk from Legacy Image at 02900000 ...
   Image Name:   initramfs-6.6.2-mvebu-tld-1
   Created:      2023-12-12  22:03:52 UTC
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    5257109 Bytes = 5 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK
stopping USB..

Starting kernel ...

[    0.000000][    T0] Booting Linux on physical CPU 0x0
[    0.000000][    T0] Linux version 6.6.2-mvebu-tld-1 (root@tldDebian) (gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for D3
[    0.000000][    T0] CPU: ARMv7 Processor [414fc091] revision 1 (ARMv7), cr=10c5387d
[    0.000000][    T0] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000][    T0] OF: fdt: Machine model: WD My Cloud EX4100
[    0.000000][    T0] Memory policy: Data cache writealloc
[    0.000000][    T0] Zone ranges:
[    0.000000][    T0]   Normal   [mem 0x0000000000000000-0x000000002fffffff]
[    0.000000][    T0]   HighMem  [mem 0x0000000030000000-0x000000007fffffff]
[    0.000000][    T0] Movable zone start for each node
[    0.000000][    T0] Early memory node ranges
[    0.000000][    T0]   node   0: [mem 0x0000000000000000-0x000000007fffffff]
[    0.000000][    T0] Initmem setup node 0 [mem 0x0000000000000000-0x000000007fffffff]
[    0.000000][    T0] percpu: Embedded 29 pages/cpu s25364 r8192 d85228 u118784
[    0.000000][    T0] Kernel command line: root=/dev/ram console=ttyS0,115200
[    0.000000][    T0] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes, linear)
[    0.000000][    T0] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    0.000000][    T0] Built 1 zonelists, mobility grouping on.  Total pages: 522560
[    0.000000][    T0] mem auto-init: stack:off, heap alloc:on, heap free:off
[    0.000000][    T0] Memory: 2053708K/2097152K available (10240K kernel code, 873K rwdata, 3492K rodata, 1024K init, 314K bss, 4)
[    0.000000][    T0] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=2, Nodes=1
[    0.000000][    T0] rcu: Preemptible hierarchical RCU implementation.
[    0.000000][    T0] rcu:     RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=2.
[    0.000000][    T0]  Trampoline variant of Tasks RCU enabled.
[    0.000000][    T0]  Tracing variant of Tasks RCU enabled.
[    0.000000][    T0] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
[    0.000000][    T0] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=2
[    0.000000][    T0] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[    0.000000][    T0] L2C: DT/platform modifies aux control register: 0x06070000 -> 0x16070000
[    0.000000][    T0] L2C-310 enabling early BRESP for Cortex-A9
[    0.000000][    T0] L2C-310 full line of zeros enabled for Cortex-A9
[    0.000000][    T0] L2C-310 D prefetch enabled, offset 1 lines
[    0.000000][    T0] L2C-310 dynamic clock gating enabled, standby mode enabled
[    0.000000][    T0] L2C-310 Coherent cache controller enabled, 16 ways, 1024 kB
[    0.000000][    T0] L2C-310 Coherent: CACHE_ID 0x410054c9, AUX_CTRL 0x56070001
[    0.000000][    T0] rcu: srcu_init: Setting srcu_struct sizes based on contention.
[    0.000001][    T0] sched_clock: 64 bits at 800MHz, resolution 1ns, wraps every 4398046511103ns
[    0.000015][    T0] clocksource: arm_global_timer: mask: 0xffffffffffffffff max_cycles: 0xb881274fa3, max_idle_ns: 440795210636s
[    0.000032][    T0] Switching to timer-based delay loop, resolution 1ns
[    0.000219][    T0] Ignoring duplicate/late registration of read_current_timer delay
[    0.000224][    T0] clocksource: armada_370_xp_clocksource: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 76450417870 ns
[    0.000507][    T0] kfence: initialized - using 2097152 bytes for 255 objects at 0x(ptrval)-0x(ptrval)
[    0.000776][    T0] Console: colour dummy device 80x30
[    0.000804][    T0] Calibrating delay loop (skipped), value calculated using timer frequency.. 1600.00 BogoMIPS (lpj=8000000)
[    0.000814][    T0] CPU: Testing write buffer coherency: ok
[    0.000840][    T0] CPU0: Spectre v2: using BPIALL workaround
[    0.000844][    T0] pid_max: default: 32768 minimum: 301
[    0.003553][    T0] LSM: initializing lsm=capability,integrity
[    0.004323][    T0] Mount-cache hash table entries: 2048 (order: 1, 8192 bytes, linear)
[    0.004331][    T0] Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes, linear)
[    0.007802][    T1] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[    0.008500][    T1] RCU Tasks: Setting shift to 1 and lim to 1 rcu_task_cb_adjust=1.
[    0.008613][    T1] RCU Tasks Trace: Setting shift to 1 and lim to 1 rcu_task_cb_adjust=1.
[    0.008705][    T1] Setting up static identity map for 0x100000 - 0x100060
[    0.008804][    T1] mvebu-soc-id: MVEBU SoC ID=0x6828, Rev=0x4
[    0.008907][    T1] mvebu-pmsu: Initializing Power Management Service Unit
[    0.009025][    T1] rcu: Hierarchical SRCU implementation.
[    0.009029][    T1] rcu:     Max phase no-delay instances is 1000.
[    0.009588][    T1] smp: Bringing up secondary CPUs ...
[    0.009936][    T1] Booting CPU 1
[    0.010086][    T0] CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
[    0.010098][    T0] CPU1: Spectre v2: using BPIALL workaround
[    0.010201][    T1] smp: Brought up 1 node, 2 CPUs
[    0.010208][    T1] SMP: Total of 2 processors activated (3200.00 BogoMIPS).
[    0.010213][    T1] CPU: All CPU(s) started in SVC mode.
[    0.011177][    T1] devtmpfs: initialized
[    0.014316][    T1] VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 4
[    0.014554][    T1] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.014572][    T1] futex hash table entries: 512 (order: 3, 32768 bytes, linear)
[    0.016346][    T1] prandom: seed boundary self test passed
[    0.017672][    T1] prandom: 100 self tests passed
[    0.017677][    T1] pinctrl core: initialized pinctrl subsystem
[    0.018842][    T1] NET: Registered PF_NETLINK/PF_ROUTE protocol family
[    0.019416][    T1] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.021646][    T1] audit: initializing netlink subsys (disabled)
[    0.021805][   T30] audit: type=2000 audit(0.020:1): state=initialized audit_enabled=0 res=1
[    0.022215][    T1] thermal_sys: Registered thermal governor 'step_wise'
[    0.022262][    T1] cpuidle: using governor ladder
[    0.022279][    T1] cpuidle: using governor menu
[    0.022374][    T1] hw-breakpoint: found 5 (+1 reserved) breakpoint and 1 watchpoint registers.
[    0.022380][    T1] hw-breakpoint: maximum watchpoint size is 4 bytes.
[    0.022517][    T1] mvebu-pmsu: CPU hotplug support is currently broken on Armada 38x: disabling
[    0.022525][    T1] mvebu-pmsu: CPU idle is currently broken on Armada 38x: disabling
[    0.024533][    T1] platform soc: Fixed dependency cycle(s) with /soc/internal-regs/interrupt-controller@d000
[    0.200157][    T1] raid6: int32x8  gen()   319 MB/s
[    0.370141][    T1] raid6: int32x4  gen()   333 MB/s
[    0.540105][    T1] raid6: int32x2  gen()   551 MB/s
[    0.710105][    T1] raid6: int32x1  gen()   637 MB/s
[    0.710108][    T1] raid6: using algorithm int32x1 gen() 637 MB/s
[    0.880104][    T1] raid6: .... xor() 247 MB/s, rmw enabled
[    0.880108][    T1] raid6: using intx1 recovery algorithm
[    0.881139][    T1] SCSI subsystem initialized
[    0.881421][    T1] usbcore: registered new interface driver usbfs
[    0.881447][    T1] usbcore: registered new interface driver hub
[    0.881474][    T1] usbcore: registered new device driver usb
[    0.881693][    T1] pps_core: LinuxPPS API ver. 1 registered
[    0.881697][    T1] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    0.881709][    T1] PTP clock support registered
[    0.882924][    T1] vgaarb: loaded
[    0.883229][    T1] clocksource: Switched to clocksource arm_global_timer
[    0.886097][    T1] VFS: Disk quotas dquot_6.6.0
[    0.886245][    T1] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[    0.893055][    T1] NET: Registered PF_INET protocol family
[    0.893207][    T1] IP idents hash table entries: 16384 (order: 5, 131072 bytes, linear)
[    0.894434][    T1] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes, linear)
[    0.894504][    T1] Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    0.894531][    T1] TCP established hash table entries: 8192 (order: 3, 32768 bytes, linear)
[    0.894597][    T1] TCP bind hash table entries: 8192 (order: 5, 131072 bytes, linear)
[    0.894717][    T1] TCP: Hash tables configured (established 8192 bind 8192)
[    0.894988][    T1] MPTCP token hash table entries: 1024 (order: 2, 16384 bytes, linear)
[    0.895145][    T1] UDP hash table entries: 512 (order: 2, 16384 bytes, linear)
[    0.895167][    T1] UDP-Lite hash table entries: 512 (order: 2, 16384 bytes, linear)
[    0.895492][    T1] NET: Registered PF_UNIX/PF_LOCAL protocol family
[    0.895992][    T1] RPC: Registered named UNIX socket transport module.
[    0.895998][    T1] RPC: Registered udp transport module.
[    0.896001][    T1] RPC: Registered tcp transport module.
[    0.896003][    T1] RPC: Registered tcp-with-tls transport module.
[    0.896006][    T1] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.896015][    T1] PCI: CLS 0 bytes, default 64
[    0.896193][   T29] Trying to unpack rootfs image as initramfs...
[    0.913649][    T1] hw perfevents: enabled with armv7_cortex_a9 PMU driver, 7 counters available
[    0.915463][    T1] Initialise system trusted keyrings
[    0.915561][    T1] Key type blacklist registered
[    0.916408][    T1] workingset: timestamp_bits=14 max_order=19 bucket_order=5
[    0.916445][    T1] zbud: loaded
[    0.922008][    T1] NFS: Registering the id_resolver key type
[    0.922038][    T1] Key type id_resolver registered
[    0.922042][    T1] Key type id_legacy registered
[    0.922135][    T1] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[    0.922145][    T1] nfs4flexfilelayout_init: NFSv4 Flexfile Layout Driver Registering...
[    1.003088][    T1] xor: measuring software checksum speed
[    1.006907][    T1]    arm4regs        :  2609 MB/sec
[    1.011825][    T1]    8regs           :  2003 MB/sec
[    1.016580][    T1]    32regs          :  2081 MB/sec
[    1.016587][    T1] xor: using function: arm4regs (2609 MB/sec)
[    1.016602][    T1] async_tx: api initialized (async)
[    1.016614][    T1] Key type asymmetric registered
[    1.016617][    T1] Asymmetric key parser 'x509' registered
[    1.016839][    T1] bounce: pool size: 64 pages
[    1.017220][    T1] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 245)
[    1.017507][    T1] io scheduler bfq registered
[    1.025931][    T1] armada-38x-pinctrl f1018000.pinctrl: registered pinctrl driver
[    1.027051][    T1] gpio gpiochip0: Static allocation of GPIO base is deprecated, use dynamic allocation.
[    1.027424][    T1] debugfs: Directory 'f1018100.gpio' with parent 'regmap' already present!
[    1.028036][    T1] gpio gpiochip1: Static allocation of GPIO base is deprecated, use dynamic allocation.
[    1.028382][    T1] debugfs: Directory 'f1018140.gpio' with parent 'regmap' already present!
[    1.030000][    T1] mv_xor f1060800.xor: Marvell shared XOR driver
[    1.047134][   T29] Freeing initrd memory: 5136K
[    1.084137][    T1] mv_xor f1060800.xor: Marvell XOR (Descriptor Mode): ( xor cpy intr )
[    1.086397][    T1] mv_xor f1060900.xor: Marvell shared XOR driver
[    1.144091][    T1] mv_xor f1060900.xor: Marvell XOR (Descriptor Mode): ( xor cpy intr )
[    1.221061][    T1] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
[    1.224851][    T1] printk: console [ttyS0] disabled
[    1.245732][    T1] f1012000.serial: ttyS0 at MMIO 0xf1012000 (irq = 39, base_baud = 12500000) is a 16550A
[    1.245777][    T1] printk: console [ttyS0] enabled
[    2.317461][    T1] f1012100.serial: ttyS1 at MMIO 0xf1012100 (irq = 40, base_baud = 12500000) is a 16550A
[    2.328893][    T1] ahci-mvebu f10a8000.sata: supply ahci not found, using dummy regulator
[    2.337416][    T1] ahci-mvebu f10a8000.sata: supply phy not found, using dummy regulator
[    2.345691][    T1] ahci-mvebu f10a8000.sata: supply target not found, using dummy regulator
[    2.354342][    T1] ahci-mvebu f10a8000.sata: AHCI 0001.0000 32 slots 2 ports 6 Gbps 0x3 impl platform mode
[    2.364147][    T1] ahci-mvebu f10a8000.sata: flags: 64bit ncq sntf led only pmp fbs pio slum part sxs
[    2.375110][    T1] scsi host0: ahci-mvebu
[    2.380123][    T1] scsi host1: ahci-mvebu
[    2.384567][    T1] ata1: SATA max UDMA/133 mmio [mem 0xf10a8000-0xf10a9fff] port 0x100 irq 41
[    2.393244][    T1] ata2: SATA max UDMA/133 mmio [mem 0xf10a8000-0xf10a9fff] port 0x180 irq 41
[    2.402175][    T1] ahci-mvebu f10e0000.sata: supply ahci not found, using dummy regulator
[    2.410697][    T1] ahci-mvebu f10e0000.sata: supply phy not found, using dummy regulator
[    2.418992][    T1] ahci-mvebu f10e0000.sata: supply target not found, using dummy regulator
[    2.427611][    T1] ahci-mvebu f10e0000.sata: AHCI 0001.0000 32 slots 2 ports 6 Gbps 0x3 impl platform mode
[    2.437417][    T1] ahci-mvebu f10e0000.sata: flags: 64bit ncq sntf led only pmp fbs pio slum part sxs
[    2.448335][    T1] scsi host2: ahci-mvebu
[    2.453150][    T1] scsi host3: ahci-mvebu
[    2.457600][    T1] ata3: SATA max UDMA/133 mmio [mem 0xf10e0000-0xf10e1fff] port 0x100 irq 42
[    2.466269][    T1] ata4: SATA max UDMA/133 mmio [mem 0xf10e0000-0xf10e1fff] port 0x180 irq 42
[    2.476397][    T1] nand: device found, Manufacturer ID: 0xad, Chip ID: 0xdc
[    2.483507][    T1] nand: Hynix H27U4G8F2DTR-BC
[    2.488059][    T1] nand: 512 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
[    2.496676][    T1] Bad block table found at page 262080, version 0x01
[    2.503552][    T1] Bad block table found at page 262016, version 0x01
[    2.510263][    T1] nand_read_bbt: bad block at 0x000001040000
[    2.516135][    T1] nand_read_bbt: bad block at 0x000007f20000
[    2.522001][    T1] nand_read_bbt: bad block at 0x00000ff00000
[    2.527865][    T1] nand_read_bbt: bad block at 0x00000ff20000
[    2.533739][    T1] nand_read_bbt: bad block at 0x000016140000
[    2.539695][    T1] 8 fixed-partitions partitions found on MTD device pxa3xx_nand-0
[    2.547406][    T1] Creating 8 MTD partitions on "pxa3xx_nand-0":
[    2.553536][    T1] 0x000000000000-0x000000500000 : "U-Boot"
[    2.560480][    T1] 0x000000500000-0x000000f00000 : "uImage"
[    2.567310][    T1] 0x000000a00000-0x000001900000 : "uRamdisk"
[    2.574206][    T1] 0x000000f00000-0x00001d700000 : "image.cfs"
[    2.582212][    T1] 0x00001c800000-0x000039f00000 : "rescue_fw"
[    2.588186][    T1] mtd: partition "rescue_fw" extends beyond the end of device "pxa3xx_nand-0" -- size truncated to 0x3800000
[    2.600899][    T1] 0x00001d700000-0x00003c200000 : "config"
[    2.606609][    T1] mtd: partition "config" extends beyond the end of device "pxa3xx_nand-0" -- size truncated to 0x2900000
[    2.618987][    T1] 0x00001eb00000-0x00003e000000 : "reserve1"
[    2.624872][    T1] mtd: partition "reserve1" extends beyond the end of device "pxa3xx_nand-0" -- size truncated to 0x1500000
[    2.637469][    T1] 0x00001f500000-0x00003f400000 : "reserve2"
[    2.643355][    T1] mtd: partition "reserve2" extends beyond the end of device "pxa3xx_nand-0" -- size truncated to 0xb00000
[    2.657238][    T1] spi-nor spi0.0: unrecognized JEDEC id bytes: ff ff ff ff ff ff
[    2.665228][    T1] wireguard: WireGuard 1.0.0 loaded. See www.wireguard.com for information.
[    2.673810][    T1] wireguard: Copyright (C) 2015-2019 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
[    2.699390][    T1] hwmon hwmon0: temp1_input not attached to any thermal zone
[    2.716460][    T1] hwmon hwmon1: temp1_input not attached to any thermal zone
[    2.723793][  T679] ata1: SATA link down (SStatus 0 SControl 300)
[    2.729968][  T690] ata2: SATA link down (SStatus 0 SControl 300)
[    2.737431][    T1] mvneta_bm f10c8000.bm: Buffer Manager for network controller enabled
[    2.751261][    T1] mvneta f1070000.ethernet eth0: Using random mac address 2a:17:74:6d:7a:95
[    2.765451][    T1] mvneta f1030000.ethernet eth1: Using random mac address 42:26:6f:a6:0a:05
[    2.774692][    T1] usbcore: registered new interface driver smsc75xx
[    2.781496][    T1] orion-ehci f1058000.usb: EHCI Host Controller
[    2.787780][    T1] orion-ehci f1058000.usb: new USB bus registered, assigned bus number 1
[    2.796205][    T1] orion-ehci f1058000.usb: irq 46, io mem 0xf1058000
[    2.807849][  T699] ata3: SATA link down (SStatus 0 SControl 300)
[    2.814017][  T709] ata4: SATA link down (SStatus 0 SControl 300)
[    2.823244][    T1] orion-ehci f1058000.usb: USB 2.0 started, EHCI 1.00
[    2.830066][    T1] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 6.06
[    2.839112][    T1] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    2.847077][    T1] usb usb1: Product: EHCI Host Controller
[    2.852675][    T1] usb usb1: Manufacturer: Linux 6.6.2-mvebu-tld-1 ehci_hcd
[    2.859763][    T1] usb usb1: SerialNumber: f1058000.usb
[    2.865729][    T1] hub 1-0:1.0: USB hub found
[    2.870221][    T1] hub 1-0:1.0: 1 port detected
[    2.875907][    T1] xhci-hcd f10f0000.usb3: xHCI Host Controller
[    2.881960][    T1] xhci-hcd f10f0000.usb3: new USB bus registered, assigned bus number 2
[    2.890280][    T1] xhci-hcd f10f0000.usb3: hcc params 0x0a000990 hci version 0x100 quirks 0x0000000000000010
[    2.900284][    T1] xhci-hcd f10f0000.usb3: irq 47, io mem 0xf10f0000
[    2.907199][    T1] xhci-hcd f10f0000.usb3: xHCI Host Controller
[    2.913260][    T1] xhci-hcd f10f0000.usb3: new USB bus registered, assigned bus number 3
[    2.921489][    T1] xhci-hcd f10f0000.usb3: Host supports USB 3.0 SuperSpeed
[    2.928695][    T1] usb usb2: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 6.06
[    2.937712][    T1] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    2.945678][    T1] usb usb2: Product: xHCI Host Controller
[    2.951277][    T1] usb usb2: Manufacturer: Linux 6.6.2-mvebu-tld-1 xhci-hcd
[    2.958364][    T1] usb usb2: SerialNumber: f10f0000.usb3
[    2.964350][    T1] hub 2-0:1.0: USB hub found
[    2.968841][    T1] hub 2-0:1.0: 1 port detected
[    2.973914][    T1] usb usb3: We don't know the algorithms for LPM for this host, disabling LPM.
[    2.982835][    T1] usb usb3: New USB device found, idVendor=1d6b, idProduct=0003, bcdDevice= 6.06
[    2.991854][    T1] usb usb3: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    2.999815][    T1] usb usb3: Product: xHCI Host Controller
[    3.005475][    T1] usb usb3: Manufacturer: Linux 6.6.2-mvebu-tld-1 xhci-hcd
[    3.012556][    T1] usb usb3: SerialNumber: f10f0000.usb3
[    3.018478][    T1] hub 3-0:1.0: USB hub found
[    3.022975][    T1] hub 3-0:1.0: 1 port detected
[    3.028354][    T1] xhci-hcd f10f8000.usb3: xHCI Host Controller
[    3.034422][    T1] xhci-hcd f10f8000.usb3: new USB bus registered, assigned bus number 4
[    3.042711][    T1] xhci-hcd f10f8000.usb3: hcc params 0x0a000990 hci version 0x100 quirks 0x0000000000000010
[    3.052731][    T1] xhci-hcd f10f8000.usb3: irq 48, io mem 0xf10f8000
[    3.059336][    T1] xhci-hcd f10f8000.usb3: xHCI Host Controller
[    3.065422][    T1] xhci-hcd f10f8000.usb3: new USB bus registered, assigned bus number 5
[    3.073662][    T1] xhci-hcd f10f8000.usb3: Host supports USB 3.0 SuperSpeed
[    3.080860][    T1] usb usb4: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 6.06
[    3.089877][    T1] usb usb4: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    3.097845][    T1] usb usb4: Product: xHCI Host Controller
[    3.103450][    T1] usb usb4: Manufacturer: Linux 6.6.2-mvebu-tld-1 xhci-hcd
[    3.110530][    T1] usb usb4: SerialNumber: f10f8000.usb3
[    3.116685][    T1] hub 4-0:1.0: USB hub found
[    3.121179][    T1] hub 4-0:1.0: 1 port detected
[    3.126277][    T1] usb usb5: We don't know the algorithms for LPM for this host, disabling LPM.
[    3.135258][    T1] usb usb5: New USB device found, idVendor=1d6b, idProduct=0003, bcdDevice= 6.06
[    3.144275][    T1] usb usb5: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    3.152229][    T1] usb usb5: Product: xHCI Host Controller
[    3.157894][    T1] usb usb5: Manufacturer: Linux 6.6.2-mvebu-tld-1 xhci-hcd
[    3.164989][    T1] usb usb5: SerialNumber: f10f8000.usb3
[    3.170933][    T1] hub 5-0:1.0: USB hub found
[    3.175486][    T1] hub 5-0:1.0: 1 port detected
[    3.181020][    T1] usbcore: registered new interface driver usblp
[    3.187461][    T1] usbcore: registered new interface driver usb-storage
[    3.194664][    T1] mousedev: PS/2 mouse device common for all mice
[    3.202593][    T1] armada38x-rtc f10a3800.rtc: registered as rtc0
[    3.208919][    T1] armada38x-rtc f10a3800.rtc: setting system clock to 2024-10-15T00:58:53 UTC (1728953933)
[    3.219687][    T1] i2c_dev: i2c /dev entries driver
[    3.224953][    T1] mv64xxx_i2c f1011000.i2c: can't get pinctrl, bus recovery not supported
[    3.233784][    T1] mv64xxx_i2c f1011100.i2c: can't get pinctrl, bus recovery not supported
[    3.246166][    T1] orion_wdt: Initial timeout 171 sec
[    3.251907][    T1] device-mapper: uevent: version 1.0.3
[    3.257668][    T1] device-mapper: ioctl: 4.48.0-ioctl (2023-03-01) initialised: dm-devel@redhat.com
[    3.266883][  T105] usb 2-1: new high-speed USB device number 2 using xhci-hcd
[    3.273621][    T1] device-mapper: multipath round-robin: version 1.2.0 loaded
[    3.281410][    T1] device-mapper: multipath queue-length: version 0.2.0 loaded
[    3.288846][    T1] device-mapper: multipath service-time: version 0.3.0 loaded
[    3.296346][    T1] device-mapper: dm-log-userspace: version 1.3.0 loaded
[    3.303330][    T1] sdhci: Secure Digital Host Controller Interface driver
[    3.310239][    T1] sdhci: Copyright(c) Pierre Ossman
[    3.315429][    T1] sdhci-pltfm: SDHCI platform and OF driver helper
[    3.323843][    T1] marvell-cesa f1090000.crypto: CESA device successfully registered
[    3.332482][    T1] hid: raw HID events driver (C) Jiri Kosina
[    3.338840][    T1] usbcore: registered new interface driver usbhid
[    3.345160][    T1] usbhid: USB HID core driver
[    3.351770][    T1] NET: Registered PF_INET6 protocol family
[    3.358673][    T1] Segment Routing with IPv6
[    3.363056][    T1] RPL Segment Routing with IPv6
[    3.367858][   T26] mmc0: SDHCI controller on f10d8000.sdhci [f10d8000.sdhci] using ADMA
[    3.376058][    T1] In-situ OAM (IOAM) with IPv6
[    3.380806][    T1] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
[    3.388930][    T1] NET: Registered PF_PACKET protocol family
[    3.394886][    T1] 8021q: 802.1Q VLAN Support v1.8
[    3.399881][    T1] Key type dns_resolver registered
[    3.405029][    T1] ThumbEE CPU extension supported.
[    3.410039][    T1] Registering SWP/SWPB emulation handler
[    3.443110][    T1] registered taskstats version 1
[    3.448078][    T1] Loading compiled-in X.509 certificates
[    3.465384][  T105] usb 2-1: New USB device found, idVendor=045b, idProduct=0209, bcdDevice= 1.00
[    3.465575][    T1] Key type .fscrypt registered
[    3.474374][  T105] usb 2-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[    3.479091][    T1] Key type fscrypt-provisioning registered
[    3.488144][  T105] hub 2-1:1.0: USB hub found
[    3.493613][    T1] Key type big_key registered
[    3.497186][  T105] hub 2-1:1.0: 4 ports detected
[    3.522763][    T1] Key type encrypted registered
[    3.529905][    T1] clk: Disabling unused clocks
[    3.536480][    T1] Freeing unused kernel image (initmem) memory: 1024K
[    3.573813][    T1] Checked W+X mappings: passed, no W+X pages found
[    3.580206][    T1] Run /init as init process
Loading, please wait...
[    3.613490][   T10] usb 3-1: new SuperSpeed USB device number 2 using xhci-hcd
[    3.645136][   T10] usb 3-1: New USB device found, idVendor=045b, idProduct=0210, bcdDevice= 1.00
[    3.654092][   T10] usb 3-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[    3.663555][   T10] hub 3-1:1.0: USB hub found
[    3.668793][   T10] hub 3-1:1.0: 4 ports detected
Starting systemd-udevd version 252.19-1~deb12u1
[    4.253483][ T1352] mtdblock: MTD device 'U-Boot' is NAND, please consider using UBI block devices instead.
[    4.263767][ T1346] mtdblock: MTD device 'uRamdisk' is NAND, please consider using UBI block devices instead.
[    4.264512][ T1345] mtdblock: MTD device 'uImage' is NAND, please consider using UBI block devices instead.
[    4.289412][ T1351] mtdblock: MTD device 'rescue_fw' is NAND, please consider using UBI block devices instead.
[    4.299083][ T1349] mtdblock: MTD device 'reserve2' is NAND, please consider using UBI block devices instead.
[    4.302095][ T1350] mtdblock: MTD device 'config' is NAND, please consider using UBI block devices instead.
[    4.319595][ T1349] mtdblock: MTD device 'reserve1' is NAND, please consider using UBI block devices instead.
[    4.325177][ T1354] mtdblock: MTD device 'image.cfs' is NAND, please consider using UBI block devices instead.
Begin: Loading essential drivers ... done.
Begin: Running /scripts/init-premount ... done.
Begin: Mounting root file system ... Begin: Running /scripts/local-top ... done.
Begin: Running /scripts/local-premount ... done.
Begin: Waiting for root file system ... Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
done.
Gave up waiting for root file system device.  Common problems:
 - Boot args (cat /proc/cmdline)
   - Check rootdelay= (did the system wait long enough?)
 - Missing modules (cat /proc/modules; ls /dev)
ALERT!  /dev/ram does not exist.  Dropping to a shell!


Log2: Flash uboot-tld6 using nand write, fail
resetting ...

BootROM - 1.73
Booting from NAND flash

mvBoardIdGet: TWSI Read for Marvell Board ID failed (57)
        Using default board ID



General initialization - Version: 1.0.0
Detected Device ID 6828
High speed PHY - Version: 2.0

Initialize DB-88F6820-BP board topology
board SerDes lanes topology details:
 | Lane #  | Speed |  Type       |
 --------------------------------
 |   0    |  06   |  SATA0      |
 |   1    |  00   |  SGMII1     |
 |   2    |  06   |  SATA1      |
 |   3    |  06   |  SATA3      |
 |   4    |  05   |  USB3 HOST0 |
 |   5    |  06   |  SATA2      |
 --------------------------------
High speed PHY - Ended Successfully
DDR3 Training Sequence - Ver TIP-1.26.0
mvSysEnvGetTopologyUpdateInfo: TWSI Read failed
DDR3 1 Training Sequence - Switching XBAR Window to FastPath Window
DDR3 Training Sequence - Ended Successfully
BootROM: Image checksum verification PASSED

 __   __                      _ _
|  \/  | __ _ _ ____   _____| | |
| |\/| |/ _` | '__\ \ / / _ \ | |
| |  | | (_| | |   \ V /  __/ | |
|_|  |_|\__,_|_|    \_/ \___|_|_|
         _   _     ____              _
        | | | |   | __ )  ___   ___ | |_
        | | | |___|  _ \ / _ \ / _ \| __|
        | |_| |___| |_) | (_) | (_) | |_
         \___/    |____/ \___/ \___/ \__|
 ** LOADER **


U-Boot 2013.01_v1.06 (Jan 08 2015 - 10:04:46) Marvell version: 2014_T3.0p6

mvBoardSatRRead: Error: Read from S@R failed
mvBoardSatRRead: Error: Read from S@R failed
mvBoardSatRRead: Error: Read from S@R failed
Board: DB-88F6820-BP
SoC:   MV88F6828 Rev A0
       running 2 CPUs
CPU:   ARM Cortex A9 MPCore (Rev 1) LE
       CPU 0
       CPU    @ 1600 [MHz]
       L2     @ 800 [MHz]
       TClock @ 200 [MHz]
       DDR    @ 800 [MHz]
       DDR 32 Bit Width, FastPath Memory Access, DLB Enabled, ECC Disabled
DRAM:  2 GiB

Map:   Code:                    0x7fece000:0x7ff95d44
       BSS:                     0x7ffef254
       Stack:                   0x7f9cdf20
       Heap:                    0x7f9ce000:0x7fece000
raise: Signal # 8 caught
raise: Signal # 8 caught
       U-Boot Environment:      0x00000000:0x00080000 (NAND)

NAND:  ID: dcad ,512 MiB
MMC:   mv_sdh: 0
USB2.0 0: Host Mode
USB3.0 0: Host Mode
USB3.0 1: Host Mode
Board configuration detected:
Creating 1 MTD partitions on "nand0":
0x00001f500000-0x00001ff00000 : "mtd=7"
UBI: attaching mtd1 to ubi0
UBI: physical eraseblock size:   131072 bytes (128 KiB)
UBI: logical eraseblock size:    126976 bytes
UBI: smallest flash I/O unit:    2048
UBI: VID header offset:          2048 (aligned 2048)
UBI: data offset:                4096
UBI: attached mtd1 to ubi0
UBI: MTD device name:            "mtd=7"
UBI: MTD device size:            10 MiB
UBI: number of good PEBs:        80
UBI: number of bad PEBs:         0
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:             32
UBI: total number of reserved PEBs: 48
UBI: number of PEBs reserved for bad PEB handling: 2
UBI: max/mean erase counter: 4/1
UBIFS: mounted UBI device 0, volume 0, name "reserve2"
UBIFS: mounted read-only
UBIFS: file system size:   4063232 bytes (3968 KiB, 3 MiB, 32 LEBs)
UBIFS: journal size:       1015809 bytes (992 KiB, 0 MiB, 6 LEBs)
UBIFS: media format:       w4/r0 (latest is w4/r0)
UBIFS: default compressor: LZO
UBIFS: reserved for root:  200807 bytes (196 KiB)
Loading file '/mac_addr' to addr 0x02000000 with size 36 (0x00000024)...
Done
lan mac_addr :  00 90 a9 e7 b6 2c
Set lan 0 WakeOnLan ok
Set lan 1 WakeOnLan ok
MicroP Enable HD
Enable HD1
Enable HD2
Enable HD3
Enable HD4
Net:
|  port  | Interface | PHY address  |
|--------|-----------|--------------|
| egiga0 |   RGMII   |     0x00     |
| egiga1 |   SGMII   |     0x01     |
egiga0 [PRIME], egiga1
Hit any key to stop autoboot:  0
Marvell>> 111111111111111<INTERRUPT>
Marvell>> usb start
(Re)start USB...
USB0:   Port (usbActive) : 0    Interface (usbType = 3) : USB XHCI 1.00
scanning bus 0 for devices... 4 USB Device(s) found
       scanning usb for storage devices... 1 Storage Device(s) found
       scanning usb for ethernet devices... 0 Ethernet Device(s) found
Marvell>> ext4load usb 0:1 0x0800000 boot/uboot6.bin
956160 bytes read in 511 ms (1.8 MiB/s)
Marvell>> nand erase 0x0 0x60000

NAND erase: device 0 offset 0x0, size 0x60000
Erasing at 0x40000 -- 100% complete.
OK
Marvell>> nand write 0x0800000 0x0 0x60000

NAND write: device 0 offset 0x0, size 0x60000
 393216 bytes written: OK
Marvell>> reset
resetting ...

BootROM - 1.73
Booting from NAND flashBootROM: Bad header at offset 00000000
BootROM: Bad header at offset 00010000
BootROM: Bad header at offset 00020000
BootROM: Bad header at offset 00030000
BootROM: Bad header at offset 00040000
BootROM: Bad header at offset 00050000
BootROM: Bad header at offset 00060000
BootROM: Bad header at offset 00070000
BootROM: Bad header at offset 00080000
BootROM: Bad header at offset 00090000
BootROM: Bad header at offset 000A0000
BootROM: Bad header at offset 000B0000
BootROM: Bad header at offset 000C0000
BootROM: Bad header at offset 000D0000
BootROM: Bad header at offset 000E0000
BootROM: Bad header at offset 000F0000
BootROM: Bad header at offset 00100000
BootROM: Bad header at offset 00110000
BootROM: Bad header at offset 00120000
BootROM: Bad header at offset 00130000
BootROM: Bad header at offset 00140000
BootROM: Bad header at offset 00150000
BootROM: Bad header at offset 00160000
BootROM: Bad header at offset 00170000
BootROM: Bad header at offset 00180000
BootROM:
Trying Uart ot



Log3: Kwboot log (where I am now)
ex@cd:~ $ ./kwboot -t -B 115200 /dev/ttyS0 -b uboot6.bin -s 0 -q 1 -t
kwboot version 2024.04-rc3-00001-g0861eab8ec-dirty
Detected kwbimage v1 with UART boot signature
Sending boot message. Please reboot the target...-
Sending boot image header (71552 bytes)...
  0 % [......................................................................]
 12 % [......................................................................]
 25 % [......................................................................]
 37 % [......................................................................]
 50 % [......................................................................]
 62 % [......................................................................]
 75 % [......................................................................]
 87 % [..................................................................... ]
Done
Sending boot image data (884608 bytes)...
  0 % [......................................................................]
  1 % [......................................................................]
  2 % [......................................................................]
  3 % [......................................................................]
  4 % [......................................................................]
  5 % [......................................................................]
  6 % [......................................................................]
  7 % [......................................................................]
  8 % [......................................................................]
  9 % [......................................................................]
 10 % [......................................................................]
 11 % [......................................................................]
 12 % [......................................................................]
 13 % [......................................................................]
 14 % [......................................................................]
 15 % [......................................................................]
 16 % [......................................................................]
 17 % [......................................................................]
 18 % [......................................................................]
 19 % [......................................................................]
 20 % [......................................................................]
 21 % [......................................................................]
 22 % [......................................................................]
 23 % [......................................................................]
 24 % [......................................................................]
 25 % [......................................................................]
 26 % [......................................................................]
 27 % [......................................................................]
 28 % [......................................................................]
 29 % [......................................................................]
 30 % [......................................................................]
 31 % [......................................................................]
 32 % [......................................................................]
 33 % [......................................................................]
 34 % [......................................................................]
 35 % [......................................................................]
 36 % [......................................................................]
 37 % [......................................................................]
 38 % [......................................................................]
 39 % [......................................................................]
 40 % [......................................................................]
 41 % [......................................................................]
 42 % [......................................................................]
 43 % [......................................................................]
 44 % [......................................................................]
 45 % [......................................................................]
 46 % [......................................................................]
 47 % [......................................................................]
 48 % [......................................................................]
 49 % [......................................................................]
 50 % [......................................................................]
 51 % [......................................................................]
 52 % [......................................................................]
 53 % [......................................................................]
 54 % [......................................................................]
 55 % [......................................................................]
 56 % [......................................................................]
 57 % [......................................................................]
 58 % [......................................................................]
 59 % [......................................................................]
 60 % [......................................................................]
 61 % [......................................................................]
 62 % [......................................................................]
 63 % [......................................................................]
 64 % [......................................................................]
 65 % [......................................................................]
 66 % [......................................................................]
 67 % [......................................................................]
 68 % [......................................................................]
 69 % [......................................................................]
 70 % [......................................................................]
 71 % [......................................................................]
 72 % [......................................................................]
 73 % [......................................................................]
 74 % [......................................................................]
 75 % [......................................................................]
 76 % [......................................................................]
 78 % [......................................................................]
 79 % [......................................................................]
 80 % [......................................................................]
 81 % [......................................................................]
 82 % [......................................................................]
 83 % [......................................................................]
 84 % [......................................................................]
 85 % [......................................................................]
 86 % [......................................................................]
 87 % [......................................................................]
 88 % [......................................................................]
 89 % [......................................................................]
 90 % [......................................................................]
 91 % [......................................................................]
 92 % [......................................................................]
 93 % [......................................................................]
 94 % [......................................................................]
 95 % [......................................................................]
 96 % [......................................................................]
 97 % [......................................................................]
 98 % [......................................................................]
 99 % [...................................................                   ]
Done
Finishing transfer
[Type Ctrl-\ + c to quit]

 __   __                      _ _
|  \/  | __ _ _ ____   _____| | |
| |\/| |/ _` | '__\ \ / / _ \ | |
| |  | | (_| | |   \ V /  __/ | |
|_|  |_|\__,_|_|    \_/ \___|_|_|
         _   _     ____              _
        | | | |   | __ )  ___   ___ | |_
        | | | |___|  _ \ / _ \ / _ \| __|
        | |_| |___| |_) | (_) | (_) | |_
         \___/    |____/ \___/ \___/ \__|
 ** LOADER **


U-Boot 2013.01_v1.06 (Jun 30 2017 - 16:08:19) Marvell version: 2014_T3.0p6 - bodhi-tld-6

mvBoardSatRRead: Error: Read from S@R failed
mvBoardSatRRead: Error: Read from S@R failed
mvBoardSatRRead: Error: Read from S@R failed
Board: DB-88F6820-BP
SoC:   MV88F6828 Rev A0
       running 2 CPUs
CPU:   ARM Cortex A9 MPCore (Rev 1) LE
       CPU 0
       CPU    @ 1600 [MHz]
       L2     @ 800 [MHz]
       TClock @ 200 [MHz]
       DDR    @ 800 [MHz]
       DDR 32 Bit Width, FastPath Memory Access, DLB Enabled, ECC Disabled
DRAM:  2 GiB

Map:   Code:                    0x7fece000:0x7ff960f0
       BSS:                     0x7ffef654
       Stack:                   0x7f9cdf20
       Heap:                    0x7f9ce000:0x7fece000
       U-Boot Environment:      0x00100000:0x00180000 Address: 0x00100000(NAND)

NAND:  ID: dcad ,512 MiB
MMC:   mv_sdh: 0
bootcmd: run bootcmd_custom; setenv bootargs root=/dev/ram console=ttyS0,115200; nand read.e 0xa00000 0x500000 0x500000;nand read.e 0xf00000 0xa00000 0x500000;bootm 0xa00000 0xf00000
USB2.0 0: Host Mode
USB3.0 0: Host Mode
USB3.0 1: Host Mode
Board configuration detected:
Creating 1 MTD partitions on "nand0":
0x00001f500000-0x00001ff00000 : "mtd=7"
UBI: attaching mtd1 to ubi0
UBI: physical eraseblock size:   131072 bytes (128 KiB)
UBI: logical eraseblock size:    126976 bytes
UBI: smallest flash I/O unit:    2048
UBI: VID header offset:          2048 (aligned 2048)
UBI: data offset:                4096
UBI: attached mtd1 to ubi0
UBI: MTD device name:            "mtd=7"
UBI: MTD device size:            10 MiB
UBI: number of good PEBs:        80
UBI: number of bad PEBs:         0
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:             32
UBI: total number of reserved PEBs: 48
UBI: number of PEBs reserved for bad PEB handling: 2
UBI: max/mean erase counter: 4/1
UBIFS: mounted UBI device 0, volume 0, name "reserve2"
UBIFS: mounted read-only
UBIFS: file system size:   4063232 bytes (3968 KiB, 3 MiB, 32 LEBs)
UBIFS: journal size:       1015809 bytes (992 KiB, 0 MiB, 6 LEBs)
UBIFS: media format:       w4/r0 (latest is w4/r0)
UBIFS: default compressor: LZO
UBIFS: reserved for root:  200807 bytes (196 KiB)
Loading file '/mac_addr' to addr 0x02000000 with size 36 (0x00000024)...
Done
lan mac_addr :  00 90 a9 e7 b6 2c
Set lan 0 WakeOnLan ok
Set lan 1 WakeOnLan ok
MicroP Enable HD
Enable HD1
Enable HD2
Enable HD3
Enable HD4
Net:
|  port  | Interface | PHY address  |
|--------|-----------|--------------|
| egiga0 |   RGMII   |     0x00     |
| egiga1 |   SGMII   |     0x01     |
egiga0 [PRIME], egiga1
Hit any key to stop autoboot:  0
Marvell>> printenv
CASset=max
MALLOC_len=5
MPmode=SMP
autoload=no
baudrate=115200
boot_order=hd_scr usb_scr mmc_scr hd_img usb_img mmc_img pxe net_img net_scr
bootargs=root=/dev/ram console=ttyS0,115200
bootargs_dflt=$console $nandEcc $mtdparts $bootargs_root nfsroot=$serverip:$rootpath ip=$ipaddr:$serverip$bootargs_end $mvNetConfig video=dovefb:lcd0:$lcd0_params clcd.lcd0_enable=$lcd0_enable clcd.lcd_panel=$lcd_panel
bootargs_end=:10.4.50.254:255.255.255.0:Armada38x:eth0:none
bootargs_root=root=/dev/nfs rw
bootcmd=run bootcmd_custom; setenv bootargs root=/dev/ram console=ttyS0,115200; nand read.e 0xa00000 0x500000 0x500000;nand read.e 0xf00000 0xa00000 0x500000;bootm 0xa00000 0xf00000
bootcmd_auto=stage_boot $boot_order
bootcmd_fdt=tftpboot 0x2000000 $image_name;tftpboot $fdtaddr $fdtfile;setenv bootargs $console $nandEcc $mtdparts $bootargs_root nfsroot=$serverip:$rootpath ip=$ipaddr:$serverip$bootargs_end $mvNetConfig video=dovefb:lcd0:$lcd0_params clcd.lcd0_enable=$lcd0_enable clcd.lcd_panel=$lcd_panel; bootz 0x2000000 - $fdtaddr;
bootcmd_fdt_boot=tftpboot 0x2000000 $image_name; setenv bootargs $console $nandEcc $mtdparts $bootargs_root nfsroot=$serverip:$rootpath ip=$ipaddr:$serverip$bootargs_end $mvNetConfig video=dovefb:lcd0:$lcd0_params clcd.lcd0_enable=$lcd0_enable clcd.lcd_panel=$lcd_panel; bootz 0x2000000 - $fdtaddr;
bootcmd_fdt_edit=tftpboot $fdtaddr $fdtfile; fdt addr $fdtaddr; setenv bootcmd $bootcmd_fdt_boot
bootcmd_lgcy=tftpboot 0x2000000 $image_name; setenv bootargs $bootargs_dflt; bootm 0x2000000;
bootdelay=1
cacheShare=no
console=console=ttyS0,115200
device_partition=0:1
disaMvPnp=no
eeeEnable=no0
enaClockGating=no
enaCpuStream=no
enaFPU=yes
enaMonExt=no
enaWrAllo=no
eth1addr=00:50:43:12:22:20
eth1mtu=1500
eth2addr=00:50:43:12:01:20
eth2mtu=1500
eth3addr=00:50:43:22:01:12
eth3mtu=1500
ethact=egiga0
ethaddr=00:50:43:01:22:20
ethmtu=1500
ethprime=egiga0
fdt_addr=2040000
fdt_skip_update=no
fdtaddr=0x1000000
fdtfile=armada-38x-modular.dtb
filesize=24
ide_path=/
image_name=uImage
initrd_name=uInitrd
ipaddr=2.66.66.203
kernel_addr_r=2080000
lcd0_enable=0
lcd0_params=640x480-16@60
lcd_panel=0
loadaddr=0x02000000
loads_echo=0
mtddevname=u-boot
mtddevnum=0
mtdids=nand0=armada-nand
mtdparts=mtdparts=armada-nand:5m(u-boot)ro,5m@5m(kernel),5m@10m(uRamdisk),441m@15m(image.cfs),15m@456m(rescue_fw),20m@471m(config),10m@491m(reserve1),10m@501m(reserve2)
mvNetConfig=mv_net_config=4,(00:50:43:11:11:11,0:1:2:3),mtu=1500
mv_pon_addr=00:50:43:20:01:12
nandEcc=nfcConfig=4bitecc
netbsd_en=no
netmask=255.255.255.0
netretry=no
partition=nand0,0
pcieTune=no
pexMode=RC
pxe_files_load=:default.arm-armadaxp-db:default.arm-armadaxp:default.arm
pxefile_addr_r=3100000
ramdisk_addr_r=2880000
rootpath=/srv/nfs/
sata_delay_reset=0
sata_dma_mode=yes
script_addr_r=3000000
script_name=boot.scr
serverip=2.66.66.32
standalone=fsload 0x2000000 $image_name;setenv bootargs $console $nandEcc $mtdparts root=/dev/mtdblock0 rw ip=$ipaddr:$serverip$bootargs_end; bootm 0x2000000;
stderr=serial
stdin=serial
stdout=serial
usb0Mode=host
usbActive=0
usbType=3
vxworks_en=no
yuk_ethaddr=00:00:00:EE:51:81

~4eep
Re: Flashing u-boot WD EX4100
October 17, 2024 02:54PM
eep,

Quote

Prior to breaking the stock uboot, I made ecc/oob and nonecc/nonoob backups of all the flash partitions. I'm also able to kwboot with the same uboot-tld6.bin, and the box will boot fine into stock WD firmware using this method.

How can I flash the uboot-tld-6 to NAND from inside kwbooted uboot-tld6 ?
How do I restore the saved nand dumps (since my previous attempt fails, and box can only be booted with kwboot).

Basically, run kwboot and boot into USB Debian rootfs. And flash the backup (nonecc/nonoob) for u-boot partition to mtd0, while inside Debian.

So kwboot and post this entire serial boot log (from kwboot command to the Debian login prompt). Also login and post
cat /proc/mtd

=====

Please list the MTD backup files in both format:
ls -lh <backup mtd files>
and
ls -l <backup mtd files>

And if you have saved the log of your MTDs backup session, post that too.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
eep
Re: Flashing u-boot WD EX4100
October 17, 2024 05:01PM
Hi bodhi, thanks for replying!

Quote
bodhi
Basically, run kwboot and boot into USB Debian rootfs. And flash the backup (nonecc/nonoob) for u-boot partition to mtd0, while inside Debian.
In all of my attempts, I've never got a Debian login prompt (Log1 in my previous post shows the furthest I've got with the 6.6.2 debian rootfs).
When trying to boot into Debian, the unit would fall back to initramfs shell, as shown in the first log.
I'd checked /dev/ from the initramfs shell, and there were no storage devices that I could see (other than the mtd for the NAND flash) - ie., no usb sda device, no /dev/disk directory.
I tried this many times, following instructions closely, but all my attempts failed (hence the attempted wiping stock uboot to try and upgrade to tld-6 on the NAND =))

I can try and boot into the stock WD firmware again, or re-do the steps of making the rootfs and post that log, if it helps.

=====

Here is a list of the backups, and a partial log- (done within WD stock firmware some time ago).

list of MTD backup files in both formats:
root@cd:~/nand-bak# ls -lh ecc-oob/
total 507M
-rwxr-xr-x 1 root root 5.2M Oct 17 18:24 mtd0.bin
-rwxr-xr-x 1 root root 5.2M Oct 17 18:24 mtd1.bin
-rwxr-xr-x 1 root root 5.2M Oct 17 18:24 mtd2.bin
-rwxr-xr-x 1 root root 455M Oct 17 18:24 mtd3.bin
-rwxr-xr-x 1 root root  16M Oct 17 18:24 mtd4.bin
-rwxr-xr-x 1 root root  21M Oct 17 18:24 mtd5.bin
root@cd:~/nand-bak# ls -l ecc-oob/
total 518500
-rwxr-xr-x 1 root root   5406720 Oct 17 18:24 mtd0.bin
-rwxr-xr-x 1 root root   5406720 Oct 17 18:24 mtd1.bin
-rwxr-xr-x 1 root root   5406720 Oct 17 18:24 mtd2.bin
-rwxr-xr-x 1 root root 476872704 Oct 17 18:24 mtd3.bin
-rwxr-xr-x 1 root root  16220160 Oct 17 18:24 mtd4.bin
-rwxr-xr-x 1 root root  21626880 Oct 17 18:24 mtd5.bin
root@cd:~/nand-bak# ls -lh no-ecc-oob/
total 492M
-rwxr-xr-x 1 root root 5.0M Oct 17 18:24 mtd0.bin
-rwxr-xr-x 1 root root 5.0M Oct 17 18:24 mtd1.bin
-rwxr-xr-x 1 root root 5.0M Oct 17 18:24 mtd2.bin
-rwxr-xr-x 1 root root 441M Oct 17 18:24 mtd3.bin
-rwxr-xr-x 1 root root  15M Oct 17 18:24 mtd4.bin
-rwxr-xr-x 1 root root  20M Oct 17 18:24 mtd5.bin
root@cd:~/nand-bak# ls -l no-ecc-oob/
total 502788
-rwxr-xr-x 1 root root   5242880 Oct 17 18:24 mtd0.bin
-rwxr-xr-x 1 root root   5242880 Oct 17 18:24 mtd1.bin
-rwxr-xr-x 1 root root   5242880 Oct 17 18:24 mtd2.bin
-rwxr-xr-x 1 root root 462422016 Oct 17 18:24 mtd3.bin
-rwxr-xr-x 1 root root  15728640 Oct 17 18:24 mtd4.bin
-rwxr-xr-x 1 root root  20971520 Oct 17 18:24 mtd5.bin


Log of mtd backup session (appears I didn't save the whole log...)
root@Library nand-bak # cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00500000 00020000 "U-Boot"
mtd1: 00500000 00020000 "uImage"
mtd2: 00500000 00020000 "uRamdisk"
mtd3: 1b900000 00020000 "image.cfs"
mtd4: 00f00000 00020000 "rescue fw"
mtd5: 01400000 00020000 "config"
mtd6: 00a00000 00020000 "reserve1"
mtd7: 00a00000 00020000 "reserve2"
root@Library nand-bak # uname -a
Linux Library 3.10.39 #1 SMP Thu Aug 29 21:08:46 PDT 2019 2014T30p5 Build-gitef2d83a armv7l GNU/Linux
root@Library nand-bak # nanddump --noecc --omitoob -f mtd0.bin /dev/mtd0
Block size 131072, page size 2048, OOB size 64
Dumping data starting at 0x00000000 and ending at 0x00500000...
root@Library nand-bak # nanddump --noecc --omitoob -f mtd1.bin /dev/mtd1
Block size 131072, page size 2048, OOB size 64
Dumping data starting at 0x00000000 and ending at 0x00500000...
root@Library nand-bak # nanddump --noecc --omitoob -f mtd2.bin /dev/mtd2
Block size 131072, page size 2048, OOB size 64
Dumping data starting at 0x00000000 and ending at 0x00500000...
root@Library nand-bak # nanddump --noecc --omitoob -f mtd3.bin /dev/mtd3
Block size 131072, page size 2048, OOB size 64
Dumping data starting at 0x00000000 and ending at 0x1b900000...
root@Library nand-bak # nanddump --noecc --omitoob -f mtd4.bin /dev/mtd4
Block size 131072, page size 2048, OOB size 64
Dumping data starting at 0x00000000 and ending at 0x00f00000...
root@Library nand-bak # nanddump --noecc --omitoob -f mtd5.bin /dev/mtd5
Block size 131072, page size 2048, OOB size 64
Dumping data starting at 0x00000000 and ending at 0x01400000...
root@Library nand-bak # nanddump --noecc --omitoob -f mtd6.bin /dev/mtd6
open flash: No such file or directory
root@Library nand-bak # nanddump --noecc --omitoob -f mtd7.bin /dev/mtd7
open flash: No such file or directory
root@Library nand-bak # ls /dev/mtd
mtd0       mtd2       mtd4       mtd6ro     mtdblock2  mtdblock6
mtd0ro     mtd2ro     mtd4ro     mtd7ro     mtdblock3  mtdblock7
mtd1       mtd3       mtd5       mtdblock0  mtdblock4
mtd1ro     mtd3ro     mtd5ro     mtdblock1  mtdblock5
root@Library nand-bak # ls -alh
drwxr-xr-x    2 root     root        4.0K Mar  4 19:34 .
drwxrwxrwx    6 root     root        4.0K Mar  4 19:30 ..
-rw-r--r--    1 root     root        1.6K Mar  4 19:34 log.txt
-rw-r--r--    1 root     root        5.0M Mar  4 19:32 mtd0.bin
-rw-r--r--    1 root     root        5.0M Mar  4 19:32 mtd1.bin
-rw-r--r--    1 root     root        5.0M Mar  4 19:32 mtd2.bin
-rw-r--r--    1 root     root      441.0M Mar  4 19:33 mtd3.bin
-rw-r--r--    1 root     root       15.0M Mar  4 19:33 mtd4.bin
-rw-r--r--    1 root     root       20.0M Mar  4 19:33 mtd5.bin
root@Library nand-bak #


Logs/files seen above were made some months ago.
Earlier this week I'd taken another set of MTD backups from inside uboot (again both ecc/oob and non-ecc/oob), though I didn't save a log of this. Below is a file list of those also, they appear to be identical to the old ones:



root@cd:~/ex4100-mtd-backup# ls -l *
eccoob:
total 518504
-rw-r--r-- 1 root root   5406720 Oct 17 18:03 mtd0
-rw-r--r-- 1 root root   5406720 Oct 17 18:03 mtd1
-rw-r--r-- 1 root root   5406720 Oct 17 18:03 mtd2
-rw-r--r-- 1 root root 476872704 Oct 17 18:03 mtd3
-rw-r--r-- 1 root root  16220160 Oct 17 18:03 mtd4
-rw-r--r-- 1 root root  21626880 Oct 17 18:03 mtd5
-rw-r--r-- 1 root root       307 Oct 17 18:03 proc_mtd.txt

nonecc_nonoob:
total 502788
-rw-r--r-- 1 root root   5242880 Oct 17 18:03 mtd0
-rw-r--r-- 1 root root   5242880 Oct 17 18:03 mtd1
-rw-r--r-- 1 root root   5242880 Oct 17 18:03 mtd2
-rw-r--r-- 1 root root 462422016 Oct 17 18:03 mtd3
-rw-r--r-- 1 root root  15728640 Oct 17 18:03 mtd4
-rw-r--r-- 1 root root  20971520 Oct 17 18:03 mtd5
root@cd:~/ex4100-mtd-backup# ls -lh *
eccoob:
total 507M
-rw-r--r-- 1 root root 5.2M Oct 17 18:03 mtd0
-rw-r--r-- 1 root root 5.2M Oct 17 18:03 mtd1
-rw-r--r-- 1 root root 5.2M Oct 17 18:03 mtd2
-rw-r--r-- 1 root root 455M Oct 17 18:03 mtd3
-rw-r--r-- 1 root root  16M Oct 17 18:03 mtd4
-rw-r--r-- 1 root root  21M Oct 17 18:03 mtd5
-rw-r--r-- 1 root root  307 Oct 17 18:03 proc_mtd.txt

nonecc_nonoob:
total 492M
-rw-r--r-- 1 root root 5.0M Oct 17 18:03 mtd0
-rw-r--r-- 1 root root 5.0M Oct 17 18:03 mtd1
-rw-r--r-- 1 root root 5.0M Oct 17 18:03 mtd2
-rw-r--r-- 1 root root 441M Oct 17 18:03 mtd3
-rw-r--r-- 1 root root  15M Oct 17 18:03 mtd4
-rw-r--r-- 1 root root  20M Oct 17 18:03 mtd5
root@cd:~/ex4100-mtd-backup#


~eep
Re: Flashing u-boot WD EX4100
October 17, 2024 10:28PM
eep,

> I can try and boot into the stock WD firmware
> again, or re-do the steps of making the rootfs and
> post that log, if it helps.

I think you are very close to booting Debian using kwboot. The USB drive somehow was not recognized by the kernel as a USB storage device. Try using a different USB thumb drive.

And yes, I think posting the log of the making of the rootfs would be helpful (you'll never know, we've all been there, just a tiny typo caused everything go bad :).

After and if we exhaust all possiblities with the rootfs. It's a good idea to go back to stock u-boot. You can also kwboot this backup:
> root@cd:~/nand-bak# ls -lh no-ecc-oob/

> -rwxr-xr-x 1 root root 5.0M Oct 17 18:24 mtd0.bin
> -rwxr-xr-x 1 root root   5242880 Oct 17 18:24 mtd0.bin

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
eep
Re: Flashing u-boot WD EX4100
October 18, 2024 02:41PM
bodhi,
Of course you are right =) Thanks for your encouragement!

Between issues with different USB sticks, USB UART adapter issues (no buffer flushing), my bad soldering on the EX4100 board, using many old kwboot binaries for different archs and without basic terminal support, (openrd, raspi4, raspi zero w, amd64), forgetting that minicom is running in a different terminal tab (this will quietly prevent kwboot handshake from succeeding)... I nearly tossed the ex4100 out the window =))

I went to re-do all of the steps again so I could post the session log, and found out where I went wrong, which was trying to boot without an uInitrd (was following the 16 Dec 2023 Rootfs Debian-6.6.2-mvebu-tld-1-rootfs-bodhi instructions, and stopped reading after Step5).... d'oh!! Since correcting this latest bonehead mistake, I've finally booted into Debian from the USB rootfs I originally created, just by adding the mkimage step for uInitrd.

From Debian I was also able to write your tld6 uboot binary into mtd0, eliminating the need to kwboot the EX4100 NAS. I haven't got fw_printenv to work from within Debian (either because I haven't followed all the steps in the original posts, or possibly due to my erasing some of the NAND previously:
Marvell>> ext4load usb 0:1 0x0800000 boot/uboot6.bin
956160 bytes read in 511 ms (1.8 MiB/s)
Marvell>> nand erase 0x0 0x60000

NAND erase: device 0 offset 0x0, size 0x60000
Erasing at 0x40000 -- 100% complete.
OK
Marvell>> nand write 0x0800000 0x0 0x60000

NAND write: device 0 offset 0x0, size 0x60000
 393216 bytes written: OK
Marvell>> reset
resetting ...
(this did not work out as I'd expected, but all looks well now =)


I also find that I need to fsck the USB after 1-3 reboots due to filesystem corruption issues. I'll try other drives (each of the 4 USB drives I've tried are passed by the "badblocks" utility). Don't know whether this is a limitation I should expect of ext3/USB as rootfs in general, as I haven't tried rootfs on SATA boot or anything else just yet.

Since I've been saving log/session of all this work , I figure I should make a detailed and up-to-date instructions for this box and post them here for others. Eventually I intend on trying to build a modern DENX uboot for the WD EX4100, and make it as close to a "real computer" as possible (ie. like my OpenRD Ultimate box). Any further advice/experience on this would be highly appreciated!

I will update this thread and make a new post with a complete set of instructions so that all the info is in one place, once I've put the hardware back together and test SATA booting/writing the rootfs to NAND.

Thank you again =)
~eep
Re: Flashing u-boot WD EX4100
October 18, 2024 04:37PM
eep,

> I've finally booted into Debian from the
> USB rootfs I originally created

Congrats!

>
> From Debian I was also able to write your tld6
> uboot binary into mtd0, eliminating the need to
> kwboot the EX4100 NAS.

Cool!

> I haven't got fw_printenv
> to work from within Debian (either because I
> haven't followed all the steps in the original
> posts, or possibly due to my erasing some of the
> NAND previously

Yes, there is more to be done with the u-boot envs and the MTDs, in the kernel bootargs, and /etc/fw_env.config.

Please post a complete serial boot log and also

cat /etc/fw_env.config
cat /proc/mtd


> I also find that I need to fsck the USB after 1-3
> reboots due to filesystem corruption issues. I'll
> try other drives (each of the 4 USB drives I've
> tried are passed by the "badblocks" utility).
> Don't know whether this is a limitation I should
> expect of ext3/USB as rootfs in general, as I
> haven't tried rootfs on SATA boot or anything else
> just yet.

This is probalby related to power off issue (I can't remember if we resolved it, it was too long ago).

Ext3 is very resilient, whenever I'm lazy I just turn off power on a test box running Ext3 rootfs (instead of shutdown -h now), and it came back recovering the journal, and boot flawlessly.

I usually sync at least once before reboot or shutdown.
sync
shutdown -r now
or
shutdown -h now

>
> Since I've been saving log/session of all this
> work , I figure I should make a detailed and
> up-to-date instructions for this box and post them
> here for others.

> I will update this thread and make a new post with
> a complete set of instructions so that all the
> info is in one place, once I've put the hardware
> back together and test SATA booting/writing the
> rootfs to NAND.

Yes! that would be a great contribution. saschad was supposed to do it, but I guess life events had prevented that.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 1 time(s). Last edit at 10/18/2024 04:46PM by bodhi.
eep
Re: Flashing u-boot WD EX4100
October 19, 2024 10:28AM
bodhi,

Thank you for the continued support !
Sorry I haven't saved all of the serial logs you asked for this time , have been busy on other tests , though mine appear to be the same as what saschadd was posting. When I am finished documenting the instructions I'll have a thorough session log to post.

Quick update:

Updated fw_env.config to what was shown on uboot startup, and confirmed fw_printenv and fw_setenv works from inside Debian.

Updated kernel to your latest, configured to boot using systemd, using a swap of ~3GB (limitation of this 8GB USB 2.0 flash drive )), has been running well! No longer find any filesystem corruption issues or fallback to initramfs due to filesystem inconsistency.

Was able to kwboot my backup of mtd0 (stock uboot), the 2024 kwboot utility works much better than old... absolutely no trouble kwboot this box now!

Have not been able to get the 2nd GbE port to handshake DHCP (though admittedly didn't try very hard, updated /etc/network interfaces and ran dhclient for eth1, will look at this more later)

Was able to revert mtd0 to stock from backup, (write the nanddump to flash from inside uboot) , but only by loading with tftp. It appears that many USB bugs plague these Marvell uboots. fat32, ext2/ext3, memory address, doesn't matter, I saw the below consistently, and eventually stopped experimenting with it. This did "work" once! Ie. from my original Log1, I was able to load from USB. The data, it appears, was totally corrupt (from the same log). Therefore I stick with tftp.
====================================================================
Hit any key to stop autoboot:  0 
Marvell>> usb reset  
(Re)start USB...
USB0:   Port (usbActive) : 0    Interface (usbType = 3) : USB XHCI 1.00
scanning bus 0 for devices... 4 USB Device(s) found
       scanning usb for storage devices... 1 Storage Device(s) found
       scanning usb for ethernet devices... 0 Ethernet Device(s) found
Marvell>> fatls usb 0:1 
            system volume information/
  5242880   mtd0_older
  5242880   mtd0_newer

2 file(s), 1 dir(s)

Marvell>> fatload usb 0:1 0x0800000 mtd0_older
reading mtd0_older
WARN halted endpoint, queueing URB anyway.
Unexpected XHCI event TRB, skipping... (7fa41f30 00000000 13000000 03008401)
BUG: failure at xhci-ring.c:500/abort_td()!
BUG!
resetting ...

BootROM - 1.73
Booting from NAND flash
====================================================================
egiga0 [PRIME], egiga1
Hit any key to stop autoboot:  0 
Marvell>> usb start   
(Re)start USB...
USB0:   Port (usbActive) : 0    Interface (usbType = 3) : USB XHCI 1.00
scanning bus 0 for devices... 4 USB Device(s) found
       scanning usb for storage devices... 1 Storage Device(s) found
       scanning usb for ethernet devices... 0 Ethernet Device(s) found
Marvell>> ext2ls usb 0:1   
<DIR>       4096 .
<DIR>       4096 ..
<DIR>      16384 lost+found
         5242880 factorymtd0
Marvell>> ext2load usb 0:1 0x0800000 factorymtd0 
WARN halted endpoint, queueing URB anyway.
Unexpected XHCI event TRB, skipping... (7fa434d0 00000000 13000000 03008400)
BUG: failure at xhci-ring.c:500/abort_td()!
BUG!
resetting ...

BootROM - 1.73
Booting from NAND flash
====================================================================

Also noticed (tried multiple USB drives) odd behaviour (directories are mixed up) from these uboots when using ext4:
Environment size: 4093/524284 bytes
Marvell>> usb start
(Re)start USB...
USB0:   Port (usbActive) : 0    Interface (usbType = 3) : USB XHCI 1.00
scanning bus 0 for devices... 4 USB Device(s) found
       scanning usb for storage devices... 1 Storage Device(s) found
       scanning usb for ethernet devices... 0 Ethernet Device(s) found
Marvell>> usb storage
  Device 0: Vendor: Western  Rev: PMAP Prod: WD Elements 1078
            Type: Removable Hard Disk
            Capacity: 29568.0 MB = 28.8 GB (60555264 x 512)
Marvell>> ext4ls usb 0:1 /
<DIR>       4096 .
<DIR>       4096 ..
<DIR>      16384 lost+found
       308944121 bodhi-deb662-tld1.tar.bz2
<DIR>          0 etc
<DIR>       4096 mnt
<SYM>          8 sbin
<DIR>       4096 root
<DIR>          0 dev
<DIR>       4096 usr
<DIR>       4096 srv
<DIR>       4096 boot
<DIR>          0 media
<DIR>          0 proc
<DIR>          0 var
<DIR>          0 run
<SYM>          7 bin
<DIR>       4096 opt
<DIR>          0 tmp
<SYM>          7 lib
<DIR>          0 home
<DIR>       4096 sys
Marvell>> ext4ls usb 0:1 /boot/
<DIR>          0 .
<DIR>       4096 ..
               0 logrotate.conf
<DIR>          0 cron.weekly
<DIR>          0 modules-load.d
               0 subgid-
               0 inputrc
<DIR>          0 initramfs-tools
               0 mailcap.order
<DIR>          0 logcheck
<DIR>          0 init
<DIR>          0 kernel
<DIR>          0 insserv
<DIR>          0 terminfo
               0 host.conf
               0 hosts.allow
<DIR>          0 calendar
               0 group-
               0 issue.net
               0 fw_env.config
               0 adduser.conf
<DIR>          0 udev
<DIR>          0 gtk-2.0
               0 adjtime
               0 sysctl.conf
               0 crontab
<SYM>          0 mtab
<DIR>          0 nfs.conf.d
               0 issue
               0 motd
               0 idmapd.conf
               0 deluser.conf
<DIR>          0 ca-certificates
<DIR>          0 dbus-1
               0 ethertypes
               0 mke2fs.conf
               0 e2scrub.conf
<DIR>          0 X11
               0 shadow
<SYM>          0 localtime
               0 gshadow
<DIR>          0 perl
               0 hosts.deny
               0 netconfig
               0 ld.so.conf
               0 resolv.conf
<DIR>          0 ntpsec
<DIR>          0 sysctl.d
<DIR>          0 python3
               0 profile
<DIR>          0 fonts
               0 services
<DIR>          0 ufw
               0 xattr.conf
               0 rc.local
               0 debian_version
               0 rsyslog.conf
               0 hosts
               0 adduser.conf.update-old
<DIR>          0 profile.d
<DIR>          0 cron.daily
<DIR>          0 rc5.d
<DIR>          0 sv
               0 subuid-
               0 passwd-
               0 ntp.conf.dpkg-dist
<DIR>          0 rc0.d
<DIR>          0 vim
               0 ntp.conf
<DIR>          0 cron.d
<DIR>          0 ld.so.conf.d
<DIR>          0 rcS.d
               0 insserv.conf
               0 protocols
<DIR>          0 runit
               0 wgetrc
<DIR>          0 bash_completion.d
               0 group
<DIR>          0 ssl
<DIR>          0 gss
<DIR>          0 security
               0 passwd
<DIR>          0 resolvconf
               0 mime.types
<DIR>          0 NetworkManager
<DIR>          0 request-key.d
<SYM>          0 rmt
               0 machine-id
<DIR>          0 ssh
               0 subuid
<DIR>          0 systemd
<DIR>          0 modprobe.d
<DIR>          0 apt
<DIR>          0 python
<DIR>          0 python3.11
               0 pam.conf
               0 rc.shutdown
               0 gai.conf
               0 modules
<DIR>          0 cron.hourly
               0 hostname
               0 nfs.conf
<DIR>          0 tmpfiles.d
               0 shells
               0 subgid
<DIR>          0 iproute2
<DIR>          0 apparmor.d
               0 .pwd.lock
<DIR>          0 python2.7
               0 debconf.conf
<DIR>          0 letsencrypt
<DIR>          0 selinux
               0 ca-certificates.conf.dpkg-old
<DIR>          0 rc1.d
               0 networks
<DIR>          0 dhcp
<DIR>          0 rc2.d
               0 ca-certificates.conf
<DIR>          0 xdg
               0 ucf.conf
               0 group.org
<DIR>          0 rc4.d
               0 inittab
               0 shadow-
<DIR>          0 keyutils
<DIR>          0 rc3.d
<DIR>          0 avahi
<DIR>          0 binfmt.d
               0 ld.so.cache
               0 gshadow-
               0 shadow.org
<DIR>          0 libnl-3
               0 request-key.conf
               0 locale.alias
<DIR>          0 skel
               0 mailcap
<DIR>          0 opt
<DIR>          0 update-motd.d
               0 exports
<DIR>          0 init.d
               0 libaudit.conf
               0 rpc
               0 bindresvport.blacklist
               0 fstab
<DIR>          0 groff
<DIR>          0 cron.monthly
               0 environment
<DIR>          0 cron.yearly
               0 staff-group-for-usr-local
               0 nsswitch.conf
               0 manpath.config
               0 locale.gen
               0 nanorc
<DIR>          0 alternatives
<DIR>          0 pam.d
<DIR>          0 network
<DIR>          0 ldap
<DIR>          0 rc6.d
               0 login.defs
               0 timezone
<SYM>          0 os-release
<DIR>          0 dpkg
<DIR>          0 insserv.conf.d
               0 kernel-img.conf
               0 pmount.allow
<DIR>          0 apparmor
               0 passwd.org
<DIR>          0 default
               0 bash.bashrc
<DIR>          0 logrotate.d
Marvell>> ext4ls usb 0:1 /etc
Marvell>> ext4ls usb 0:1 root
<DIR>          0 .
<DIR>       4096 ..
<DIR>          0 sshd
               0 ntpd.pid
<DIR>          0 blkid
<DIR>          0 avahi-daemon
               0 sshd.pid
<DIR>          0 dbus
               0 utmp
<DIR>          0 lock
<DIR>          0 network
Marvell>> ext4ls usb 0:1 usr
<DIR>       4096 .
<DIR>       4096 ..
<DIR>        494 dts
            4096 vmlinuz-6.6.2-mvebu-tld-1
            4096 linux-image-6.6.2-mvebu-tld-1_1_armhf.deb
             611 System.map-6.6.2-mvebu-tld-1
             711 config-6.6.2-mvebu-tld-1
             767 initrd.img-6.6.2-mvebu-tld-1
             798 uImage
            4096 linux-headers-6.6.2-mvebu-tld-1_1_armhf.deb
            1922 zImage-6.6.2-mvebu-tld-1
            2448 uImage.orig
            4096 zImage.fdt
             372 6.6.2-mvebu-tld-1
<DIR>         14 old_images
Marvell>>
Due to the above behaviour, uboot won't load /boot/uImage or /boot/uInitrd, though it may be possible to 'trick' uboot by setting for example, /usr/uInitrd and /usr/uImage within environment, probably this issue won't persist into Linux kernel..? Not sure if I'll bother to spend the time to test this. As you say, ext3 is fine, and I'd rather try build a mainline uboot.


Haven't tested the 3 buttons yet, but no reason to think they don't work. Also haven't tested anything on SATA RAID, or even with the RAID expansion board plugged into the armada mainboard (I removed the mainboard for ease of soldering the UART pins, and the way I had everything wired up proved a bit messy to do, though I can see how it can be improved). I'll be testing this shortly also, no reason to suspect issues, based on the older posts.

Now that I'm back to 100% stock on mtd/NAND, I'll re-assemble the NAS and start writing a complete instructions.

Eventually I'd like to build a mainline uboot for this box (ie. using the WD open source as reference, but with new features such as GPT working). Maybe this will also fix some of the annoying USB bugs. Any tips on this future endeaveour highly appreciated =))

Thanks again;
~eep
Re: Flashing u-boot WD EX4100
October 19, 2024 02:44PM
eep,

> though mine appear to be the same as what saschadd was posting

Could you point me to where saschad posted this?

> Due to the above behaviour, uboot won't load
> /boot/uImage or /boot/uInitrd

The issue with USB likely to have to do with the u-boot envs. These Marvell u-boot are similar in the Armada 38x boxes. Look like they came from the same Marvell code base.

Are the USB ports on this box USB 3.0 or a mix of 2.0 and 3.0?

Try playing with the envs and port usage.
usbActive=0
usbType=3

For example set usbActive to 1 (i.e. port 1), usbType to 2 (i.e USB 2.0), or some combination of these 4 values.

> Now that I'm back to 100% stock on mtd/NAND, I'll
> re-assemble the NAS and start writing a complete
> instructions.

If one of USB ports work well, then that should be the way to load kernel files.

> Eventually I'd like to build a mainline uboot for
> this box (ie. using the WD open source as
> reference, but with new features such as GPT
> working). Maybe this will also fix some of the
> annoying USB bugs. Any tips on this future
> endeaveour highly appreciated =))

Unfortunately, my long standing policy is myself not getting into discussion about how to build or develop new u-boot or kernel. It'll take too much of my free time! I can only help unbricking boxes and answering installation questions.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
eep
Re: Flashing u-boot WD EX4100
October 20, 2024 02:45PM
bodhi,

Quote
bodhi
eep,

> though mine appear to be the same as what saschadd was posting

Could you point me to where saschad posted this?
I meant I figured out the changes to be made by "studying" your/his experiments in the original 16pg thread from 2017. Now that I'm a bit more familiar with Doozan boards and the posts, I see there are generic instructions posted to update fw_env.config.

Quote
bodhi
> Due to the above behaviour, uboot won't load
> /boot/uImage or /boot/uInitrd

The issue with USB likely to have to do with the u-boot envs.
When I ext4ls /usr , and it returns directory listing for /boot, you are saying it's issue of uboot envs?? Pardon my ignorance, just making sure we're on the same page/talking about the same issue

Quote

Are the USB ports on this box USB 3.0 or a mix of 2.0 and 3.0?
They are all USB 3.0 ports

Quote

If one of USB ports work well, then that should be the way to load kernel files.
Each of the three USB3.0 ports works perfectly on my ex4100, inside and outside uboot. Using your Yellowstone-tld6 uboot, there's no difference whether I use front, or either of the two rear for anything, in all of my testing (I've been testing a LOT over last week))

I'm not happy with the marvell armada BSP U-boot, it is missing many bugfixes patches, and features.
Ie: The only write-to-filesystem command that exists is "ext4write", and this uboot version is missing an important patch from mainline, so ext4write is worse-than-useless, it will destroy superblock and corrupt data).
To write a thorough instructions for the box I'd like to (am in progress of) build a better uboot, first. I know I can use the WD GPL source to build the same old marvell uboot with more features, and apply (some) patches manually, but if I spend much time to do this, why not instead spend the time to make mainline U-Boot for the box ??


Quote

Unfortunately, my long standing policy is myself not getting into discussion about how to build or develop new u-boot or kernel. It'll take too much of my free time! I can only help unbricking boxes and answering installation questions.
Understandable! I thank you for all the time you've spent on this unit specifically, and on the NAS community already!


~eep
Re: Flashing u-boot WD EX4100
October 20, 2024 04:05PM
eep,

> Each of the three USB3.0 ports works perfectly on
> my ex4100, inside and outside uboot. Using your
> Yellowstone-tld6 uboot, there's no difference
> whether I use front, or either of the two rear for
> anything, in all of my testing (I've been testing
> a LOT over last week))

Cool! then this tld-6 u-boot is good enough to boot Debian. So it's depending on what your goal is.

> I'm not happy with the marvell armada BSP U-boot,
> it is missing many bugfixes patches, and features.

Yeah, it was built just to boot the stock FW. Likely WD did not care about quality of the boot loader, and paid a minimum amount of money to Marvell to get the BSP..

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
eep
Re: Flashing u-boot WD EX4100
October 27, 2024 04:09PM
bodhi,

It was too time consuming to remake mainline uboot for this deprecated(I think?) board, what with all the changes in the last 12 yrs to the DENX project.

I had a few issues with your tld-6 patched uboot binary, namely that it requires UART, requires manually pasting uboot env variables, and may have required a recompilation to customize some boot options. Therefore I made some modifications based on your patch.

The changes work pretty well, and provide robust functionality, without even the need of UART - I leverage the fact that EX2100/EX4100 has the following nifty bit of code within stock WD uboot, allowing updating uboot by holding down USB pushbutton on reset.
    /* Push usb button */
    if ( load_kernel_count == 1 )
    {
      if ( find_usb_storage == 0 )
      {
        printf("### Can not find USB storage ###\n");
      }
      else
      {
        fs_set_blk_dev("usb", "0:1", 1);
        len_read = fs_read("/EX4100/u-boot.bin", 0x1000000, 0, 0);
        if ( len_read > 0 )
        {
          printf("### Update u-boot ###\n");
          run_command("bubt /EX4100/u-boot.bin nand usb; reset;",0);
        }
        else
          printf("### Can not find u-boot file ###\n");
      }
    }

Basically... Backup all mtd, make a USB as per instructions... plug it in.. it will update WD u-boot to the modified one, and reboot into new rootfs on the 2nd partition of the USB using the bootscr (also allows restore). The USB looks like this:
wipefs -a /dev/sdd1 /dev/sdd
parted -s /dev/sdd \ mktable msdos \ mkpart primary fat32 1MiB 1% \ mkpart primary ext3 1% 100%
mkfs.vfat -F 32 -n NEWBOOT /dev/sdd1 && mkfs.ext3 -L rootfs /dev/sdd2
...
NAME                MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS    FSTYPE      VENDOR   LABEL
sdd                   8:48   1   7.5G  0 disk                            SanDisk
├─sdd1                8:49   1    75M  0 part /mnt/sdd1      vfat                 NEWBOOT
└─sdd2                8:50   1   7.4G  0 part                ext3                 rootfs

...
/mnt/sdd1
└── EX4100
    ├── boot.scr
    ├── boot.script
    ├── mtd0.bin
    └── u-boot.bin
boot.scr is the binary version of the bootscript (created via mkimage).
boot.script is the editable version (must be "compiled" via mkimage to use)
mtd0.bin is my original flash backup of the WD stock u-boot partition
u-boot.bin is a compiled version of the patched bootloader, ie. your old tld-6 patch with mainly this change:
+  run_command("usb reset; fatload usb 0:1 0x2000000 /EX4100/boot.scr; source", 0);

The second partition of the USB (/dev/sdd2 in this case) holds your Debian rootfs.
Edited to add, for fw_printenv:
sed -i 's/0x0000/0x100000/g' /mnt/sdd2/etc/fw_env.config 
sed -i 's/mtd1/mtd0/g' /mnt/sdd2/etc/fw_env.config


I've uploaded the patch here for curiosity, in case you want to see the changes to WD GPL src.
f58126c93a396ac4866c72ff9f2398d0a7e9060a0c36fb7b5c051446c4e38c04  ex4100-uboot-bins.tar.gz
ex4100-uboots/
ex4100-uboots/EX4100/
ex4100-uboots/EX4100/README.txt
ex4100-uboots/EX4100/boot.script
ex4100-uboots/EX4100/boot.scr.default
ex4100-uboots/EX4100/boot.scr
ex4100-uboots/u-boot-a38x-Yellowstone_2014T30p6_bodhi-tld-6-eep-2024-10-27-nand.bin.sha256
ex4100-uboots/u-boot-a38x-Yellowstone_2014T30p6_QA-nand.bin.sha256
ex4100-uboots/u-boot-a38x-Yellowstone_2014T30p6_bodhi-tld-6-eep-2024-10-27-nand.bin
ex4100-uboots/u-boot-a38x-Yellowstone_2014T30p6_QA-nand.bin
ex4100-uboots/my.patch


Edited to add: In future I'd like to add netconsole to this, persistent MAC (this box keeps files with gbe0/gbe1 WD macaddrs and the WD s/n within stock NAND reserve) and using a script can also have staged boot (right now that's up to reader to implement). Any recommendations from you? Any chance you have a newer uboot than this WD/marvell src to which to apply this patch?

I'm ready to post a complete set of instructions for both u-boot and Debian for this box (the ex2100 works the same), and want to delete this thread, because my questions/findings above are basically just noise, and contribute almost nothing to future readers.
I indend to put these files (as well as the binaries and some further instructions) into a new Topic on these boards. Can you delete this Topic? Should I delete my messages, or at least Edit them, so that the first post is the instructions?

Thanks,

~eep



Edited 3 time(s). Last edit at 10/27/2024 06:28PM by eep.
Attachments:
open | download - my.patch (5.3 KB)
open | download - boot.script (2.8 KB)
open | download - ex4100-uboot-bins.tar.gz (926.5 KB)
Re: Flashing u-boot WD EX4100
October 27, 2024 08:28PM
eep,

> I had a few issues with your tld-6 patched uboot
> binary, namely that it requires UART, requires
> manually pasting uboot env variables, and may have
> required a recompilation to customize some boot
> options. Therefore I made some modifications based
> on your patch.
> The changes work pretty well, and provide robust
> functionality, without even the need of UART

Still, in the instruction, you should recommend serial console connected, so the installation progress can be observed by the installer. And in case something goes wrong in the process, eg. bad flash, the log is needed recover the botched installation.

> leverage the fact that EX2100/EX4100 has the
> following nifty bit of code within stock WD uboot,
> allowing updating uboot by holding down USB
> pushbutton on reset.

Nice!

Updating u-boot by flashing it manually in Debian is a step-by-step process where you can stop it when you see error, and recover from it in a tech user friendly environment, i.e. Linux shell. Doing it in u-boot automatic process is really for end users. But I'm not against doing it with the USB push button. Even tech users sometime don't care to see how this is done.

> Basically... Backup all mtd, make a USB as per
> instructions... plug it in.. it will update WD
> u-boot to the modified one, and reboot into new
> rootfs on the 2nd partition of the USB using the
> bootscr (also allows restore).

> Edited to add: In future I'd like to add
> netconsole to this, persistent MAC (this box keeps
> files with gbe0/gbe1 WD macaddrs and the WD s/n
> within stock NAND reserve)

Persistent MAC address is an inherent problem with this old stock u-boot and other Marvell u-boots similar to it. The Debian rootfs has a script that work around the problem. There are many ways to do this. I chose to do it in a script for educational purposed.

Quote

Updated 16 Dec 2023:

Rootfs Debian-6.6.2-mvebu-tld-1-rootfs-bodhi.tar.bz2 has been uploaded.

Basic Debian bookworm armhf rootfs for most MVEBU Armada NAS:

.....

Note 6. Persistent MAC address (Optional):

To enable the network dynamic IP to stay consistent after each reboot, and also for faster boot. In this rootfs, a script is executed during kernel booting (in /etc/rc.local), to detect if a local MAC address was assigned during boot, and then set the persistent MAC address to what is currently defined in u-boot env ethaddr.

/root/set_persistent_mac_address

To keep using the kernel generated local MAC address (if local MAC address was generated in your box) then chmod this script to non-executable.
chmod -x /root/set_persistent_mac_address

Further improvement: after releasing this rootfs, I realized I've forgot to implement an improvement for this. Please see here for more info.

> Any chance you have a newer uboot than this
> WD/marvell src to which to apply this patch?

Not sure I have time to roll another u-boot. I'll have to see.

> I'm ready to post a complete set of instructions
> for both u-boot and Debian for this box (the
> ex2100 works the same), and want to delete this
> thread, because my questions/findings above are
> basically just noise, and contribute almost
> nothing to future readers.
> I indend to put these files (as well as the
> binaries and some further instructions) into a new
> Topic on these boards.

That would be great to do in a brand new thread.

> Can you delete this Topic?
> Should I delete my messages, or at least Edit
> them, so that the first post is the instructions?

I think we should keep this. It's a working thread that have good info. You can include a link in the installtion post, if you'd like, and I'll edit this thread to tell people to go to the installation thread (in 1st and last post). And then close the thread. That way we can reopen it later. If there is no activity in the future, it'll be dormant.

Thanks!

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: