Welcome! Log In Create A New Profile

Advanced

2024.10 U-Boot Kirkwood - DNS-325

Posted by bodhi 
2024.10 U-Boot Kirkwood - DNS-325
April 09, 2025 04:33PM
2024.10 U-Boot Kirkwood - DNS-325

=========================================
Update 09 Apr 2025

Download at Dropbox

I have not uploaded the tarball to Dropbox yet. For now, please download the tarball attached to this post.

uboot.2024.10-tld-1.dns325.bodhi.tar
md5:
191129892f36f5e6538e86ffccd07fa9
sha256:
4f6eefbc570019b47f6db83a963876d6c213d221b59c07d6cdd874020f8830bd

This tarball contains 5 files:
uboot.2024.10-tld-1.dns325.kwb
uboot.2024.10-tld-1.dns325.environment
uboot.2024.10-tld-1.dns325.environment.img
uboot.2024.10-tld-1.dns325.boot.cmd
uboot.2024.10-tld-1.dns325.boot.scr

A. Preparation

A.1. UART booting

It is strongly recommmended that you try to run kwboot to test this boot image with UART booting before flashing to NAND. This is the rescue path when and if the flashing goes wrong for some reason. See example here. And to download latest ARM kwboot binary for UART booting see here.

A.2. Flashing tools

If you are running an OS (eg. stock FW) that does not provide mtd-utils and uboot-tools (fw_setenv, fw_printenv, flash_erase, nandwrite), you can download the NAND and U-Boot tools binaries here in this thread.

B. Flashing Instruction:

1. Setup fw_env.config

U-Boot envs config should be defined as followed in your /etc/fw_env.config

cat /etc/fw_env.config
 # MTD device name	Device offset	Env. size	Flash sector size	Number of sectors 
/dev/mtd0 0xc0000 0x20000 0x20000

If you don't have /etc/fw_env.config file in your system then go ahead and create this file:
echo "/dev/mtd0 0xc0000 0x20000 0x20000" > /etc/fw_env.config

- And your mtd partitions should be (mtd0 is where u-boot is)

cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00100000 00020000 "uboot"
. . .
If your mtd0 is size 1MB (0x00100000 hex) or greater then it's OK. The other mtds are not relevant to u-boot, so should be kept as is.

2. Backup mtd0 and envs

Save your current uBoot image in mtd0, and save your current u-boot envs with fw_printenv. Copy these files to a persistent storage.

2.1 Dumping NAND mtd0:
nanddump --noecc --omitoob -f mtd0.dns325 /dev/mtd0

2.2. Save envs:
fw_printenv > current_envs.txt
It's OK if this step fails. For most stock OS, there is no fw_printenv. And also it will fail for the first time installation of this u-boot.

Howver, it's important to list the current envs (eg. in serial console) and copy them to a note file (current_envs.txt). This will be used in Step 7.

3. Check for bad blocks

Be sure there is no bad block in the first 1M of your NAND. This is very important, if there is bad block in the first 1M (blocks 0 to 7), don't flash u-boot, because you will almost certainly soft-brick your box.

Example of bad block in mtd0:
dmesg | grep -i 'bad'

[    2.413231] Scanning device for bad blocks
[    2.417731] Bad eraseblock 3 at 0x000000060000

This bad eraseblock 3 is the 4th block which resides within mtd0 first 1M (block 0 to block 7). Please stop at this step and post question in this thread for a workaround.

4. Extract the archive to /tmp (or any folder of your own choosing)

cd /tmp
tar xf uboot.2024.10-tld-1.dns325.bodhi.tar

5. Flash u-boot image to NAND

Be extra careful with the next 2 commands, you should see output that look like below in those steps. If there is error, then do not reboot, post your problem here so we can help.

Also note that the recent version of Debian flash_erase and nandwrite will print seemingly incomplete results.

Erase 4 blocks
flash_erase /dev/mtd0 0 4
Expected output:
Erase Total 4 Units 
Performing Flash Erase of length 131072 at offset 0x60000 done

Write the image
nandwrite /dev/mtd0 uboot.2024.10-tld-1.dns325.kwb

Expected output:
Writing data to block 0 at offset 0x0 
Writing data to block 1 at offset 0x20000 
Writing data to block 2 at offset 0x40000 
Writing data to block 3 at offset 0x60000

6. Flash default u-boot envs image

Be extra careful with the next 2 commands, you should see output that look like below. If there is error, then do not reboot, post your problem here so we can help.

Erase 1 block
flash_erase /dev/mtd0 0xc0000 1
Expected output:
Erase Total 1 Units
Performing Flash Erase of length 131072 at offset 0xc0000 done

Write the image
nandwrite -s 786432 /dev/mtd0 /tmp/uboot.2024.10-tld-1.dns325.environment.img
Expected output:
Writing data to block 6 at offset 0xc0000

7. Restore MAC address and other envs

Restore the MAC address using the saved envs in current_envs.txt. Or find the MAC address on the sticker outside the case. Replace xx:xx:xx:xx:xx:xx with the real values.

fw_setenv ethaddr 'xx:xx:xx:xx:xx:xx'
For sanity check, list you envs again
fw_printenv

You also want to restore other specific information such as ipaddr (IP address of this box, if you use static IP).

Don't reboot if there is error while listing U-Boot envs. Post at the forum for help.

8. (Optional) Activate netconsole

TBD

9. Reboot

Upon reboot, in either serial console or netconsole, U-Boot banner should show:

U-Boot 2024.10-tld-1 (Apr 08 2025 - 13:52:33 -0700)
D-Link DNS-325

DONE installation.


C. NOTE

C.1 Distro Boot

See this post for how to use Distro Boot Script: TBD.

C2. uEnv.txt

TBD

END of NOTE.

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



Edited 1 time(s). Last edit at 04/11/2025 02:06PM by bodhi.
Attachments:
open | download - uboot.2024.10-tld-1.dns325.bodhi.tar (650 KB)
Re: 2024.10 U-Boot Kirkwood - DNS-325
April 10, 2025 11:51AM
There were a few things that differed from the expected results in the flashing instructions. Only one real error. That was in the command to dump mtd0. The rest are inconsiquential but since they differed from the instructions I thought I'd list them and let you decide how/if to handle it.

section 2.1  command is incorrect; missing '-f' before output filename
section 2.2  problem dumping uEnv; command yielded:
                        root@fulla:~# fw_printenv > current_envs.txt
                                              Cannot read environment, using default
                                              Cannot read default environment from file
                        root@fulla:~# 
section 5      slightly different output from flash_erase; output was:
                         root@fulla:~# flash_erase /dev/mtd0 0 4
                                               Erasing 128 Kibyte @ 60000 -- 100 % complete 
                         root@fulla:~#
                         I believe my flash_erase came from the Debian package mtd-tools rather than the one posted on this                      
                         board. Similar for u-boot env erase

                         output of nandwrite of the environment was different:
                         root@fulla:~# nandwrite -s 786432 /dev/mtd0 /mnt/usb/root/test\ new\ uboot/uboot.2024.10-tld-1.dns325.environment.img
                                                Writing data to block 6 at offset 0xc0000
                                                Written 62 blocks containing only 0xff bytes
                                                Those block may be incorrectly treated as empty!

                         A diff of uboot.2024.10-tld-1.dns325.environment.img and output of fw_printenv showed no differences

All is well regarding boot. Since I have a permanently attached usb/serial cable I'm not really interested in netconsole so I didn't test it. I will if you want me to. My second box got declared e-waste. Besides not detecting the hard drives, it ended up with scads (>100) mtd bad blocks. C'est la vie. Wish it would wake on lan but now I'm getting greedy. ;)

U-Boot 2024.10-tld-1 (Apr 08 2025 - 13:52:33 -0700)
D-Link DNS-325

SoC:   Kirkwood 88F6281_A1
Model: D-Link DNS-325 NAS (Rev A1)
DRAM:  256 MiB
Core:  15 devices, 11 uclasses, devicetree: separate
NAND:  128 MiB
Loading Environment from NAND... OK
In:    serial
Out:   serial
Err:   serial
Net:   eth0: ethernet-controller@72000
Hit any key to stop autoboot:  0 
Initializing devices...
resetting USB...
Bus ehci@50000: USB EHCI 1.00
scanning bus ehci@50000 for devices... 1 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found
resetting USB...
Bus ehci@50000: USB EHCI 1.00
scanning bus ehci@50000 for devices... 1 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found
Loading envs from usb 0...
** Bad device specification usb 0 **
Couldn't find partition usb 0:1
Can't set block device
Loading envs from usb 1...
** Bad device specification usb 1 **
Couldn't find partition usb 1:1
Can't set block device
Loading envs from usb 2...
** Bad device specification usb 2 **
Couldn't find partition usb 2:1
Can't set block device
Loading envs from usb 3...
** Bad device specification usb 3 **
Couldn't find partition usb 3:1
Can't set block device
Loading envs from sata 0...
Failed to load '/boot/uEnv.txt'
Loading envs from sata 1...
Can't set block device
Loading envs from sata 2...
** Bad device specification sata 2 **
Couldn't find partition sata 2:1
Can't set block device
Loading envs from sata 3...
** Bad device specification sata 3 **
Couldn't find partition sata 3:1
Can't set block device
running scan_disk ...
Scan device usb
resetting USB...
Bus ehci@50000: USB EHCI 1.00
scanning bus ehci@50000 for devices... 1 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found
resetting USB...
Bus ehci@50000: USB EHCI 1.00
scanning bus ehci@50000 for devices... 1 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found
device usb 0:1
** Bad device specification usb 0 **
Couldn't find partition usb 0:1
Can't set block device
device usb 1:1
** Bad device specification usb 1 **
Couldn't find partition usb 1:1
Can't set block device
device usb 2:1
** Bad device specification usb 2 **
Couldn't find partition usb 2:1
Can't set block device
device usb 3:1
** Bad device specification usb 3 **
Couldn't find partition usb 3:1
Can't set block device
Scan device sata
device sata 0:1
1 bytes read in 40 ms (0 Bytes/s)
Found bootable drive on sata 0
loading uImage ...
6000008 bytes read in 41 ms (139.6 MiB/s)
loading uInitrd ...
8021534 bytes read in 66 ms (115.9 MiB/s)
loading DTB /boot/dts/kirkwood-dns325.dtb ...
13091 bytes read in 18 ms (710 KiB/s)
## Booting kernel from Legacy Image at 00800000 ...
   Image Name:   Linux-6.13.8-kirkwood-tld-1
   Created:      2025-04-09  15:22:55 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    5999944 Bytes = 5.7 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
## Loading init Ramdisk from Legacy Image at 02100000 ...
   Image Name:   initramfs-6.13.8-kirkwood-tld-1
   Created:      2025-04-09  15:22:56 UTC
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    8021470 Bytes = 7.6 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 01c00000
   Booting using the fdt blob at 0x1c00000
Working FDT set to 1c00000


Starting kernel ...

   Loading Kernel Image to 8000
   Loading Ramdisk to 0f3b3000, end 0fb595de ... OK
   Loading Device Tree to 0f3ac000, end 0f3b2322 ... OK
Working FDT set to f3ac000

Starting kernel ...

[    0.000000][    T0] Booting Linux on physical CPU 0x0
[    0.000000][    T0] Linux version 6.13.8-kirkwood-tld-1 (root@tldDebian) (gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40) #1 PREEMPT Mon Mar 24 14:30:26 PDT 2025
[    0.000000][    T0] CPU: Feroceon 88FR131 [56251311] revision 1 (ARMv5TE), cr=0005397f
[    0.000000][    T0] CPU: VIVT data cache, VIVT instruction cache
[    0.000000][    T0] OF: fdt: Machine model: D-Link DNS-325 NAS (Rev A1)
[    0.000000][    T0] Memory policy: Data cache writeback
[    0.000000][    T0] Zone ranges:
[    0.000000][    T0]   Normal   [mem 0x0000000000000000-0x000000000fffffff]
[    0.000000][    T0] Movable zone start for each node
[    0.000000][    T0] Early memory node ranges
[    0.000000][    T0]   node   0: [mem 0x0000000000000000-0x000000000fffffff]
[    0.000000][    T0] Initmem setup node 0 [mem 0x0000000000000000-0x000000000fffffff]
[    0.000000][    T0] OF: reserved mem: Reserved memory: No reserved-memory node in the DT
[    0.000000][    T0] Kernel command line: console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 mtdparts=orion_nand:1M(u-boot),5M(kernel),-(rootfs) 
[    0.000000][    T0] 
[    0.000000][    T0] printk: log buffer data + meta data: 131072 + 409600 = 540672 bytes
[    0.000000][    T0] Dentry cache hash table entries: 32768 (order: 5, 131072 bytes, linear)
[    0.000000][    T0] Inode-cache hash table entries: 16384 (order: 4, 65536 bytes, linear)
[    0.000000][    T0] Built 1 zonelists, mobility grouping on.  Total pages: 65536
[    0.000000][    T0] mem auto-init: stack:off, heap alloc:on, heap free:off
[    0.000000][    T0] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000][    T0] rcu: Preemptible hierarchical RCU implementation.
[    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 Tasks: Setting shift to 0 and lim to 1 rcu_task_cb_adjust=1 rcu_task_cpu_ids=1.
[    0.000000][    T0] RCU Tasks Trace: Setting shift to 0 and lim to 1 rcu_task_cb_adjust=1 rcu_task_cpu_ids=1.
[    0.000000][    T0] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[    0.000000][    T0] rcu: srcu_init: Setting srcu_struct sizes based on contention.
[    0.000000][    T0] clocksource: orion_clocksource: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 9556302233 ns
[    0.000003][    T0] sched_clock: 32 bits at 200MHz, resolution 5ns, wraps every 10737418237ns
[    0.000106][    T0] Switching to timer-based delay loop, resolution 5ns
[    0.000987][    T0] Console: colour dummy device 80x30
[    0.001090][    T0] Calibrating delay loop (skipped), value calculated using timer frequency.. 400.00 BogoMIPS (lpj=2000000)
[    0.001123][    T0] CPU: Testing write buffer coherency: ok
[    0.001268][    T0] pid_max: default: 32768 minimum: 301
[    0.010061][    T0] LSM: initializing lsm=capability
[    0.012610][    T0] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.012652][    T0] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.051587][    T1] Setting up static identity map for 0x100000 - 0x100058
[    0.051976][    T1] mvebu-soc-id: MVEBU SoC ID=0x6281, Rev=0x3
[    0.052581][    T1] rcu: Hierarchical SRCU implementation.
[    0.052600][    T1] rcu:     Max phase no-delay instances is 1000.
[    0.054532][    T1] Memory: 229412K/262144K available (11264K kernel code, 1639K rwdata, 5400K rodata, 1024K init, 451K bss, 31104K reserved, 0K cma-reserved)
[    0.056544][    T1] devtmpfs: initialized
[    0.067833][    T1] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.067881][    T1] futex hash table entries: 256 (order: -1, 3072 bytes, linear)
[    0.075513][    T1] prandom: seed boundary self test passed
[    0.079783][    T1] prandom: 100 self tests passed
[    0.079802][    T1] pinctrl core: initialized pinctrl subsystem
[    0.084444][    T1] NET: Registered PF_NETLINK/PF_ROUTE protocol family
[    0.085409][    T1] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.087060][    T1] audit: initializing netlink subsys (disabled)
[    0.088490][   T23] audit: type=2000 audit(0.080:1): state=initialized audit_enabled=0 res=1
[    0.090678][    T1] thermal_sys: Registered thermal governor 'step_wise'
[    0.090890][    T1] cpuidle: using governor ladder
[    0.090977][    T1] cpuidle: using governor menu
[    0.091681][    T1] Feroceon L2: Enabling L2
[    0.091724][    T1] Feroceon L2: Cache support initialised.
[    0.096165][    T1] /ocp@f1000000/pin-controller@10000: Fixed dependency cycle(s) with /ocp@f1000000/pin-controller@10000/pmx-temp-alarm
[    0.096206][    T1] /ocp@f1000000/pin-controller@10000: Fixed dependency cycle(s) with /ocp@f1000000/pin-controller@10000/pmx-fan-tacho
[    0.096243][    T1] /ocp@f1000000/pin-controller@10000: Fixed dependency cycle(s) with /ocp@f1000000/pin-controller@10000/pmx-present-sata1
[    0.096278][    T1] /ocp@f1000000/pin-controller@10000: Fixed dependency cycle(s) with /ocp@f1000000/pin-controller@10000/pmx-present-sata0
[    0.096313][    T1] /ocp@f1000000/pin-controller@10000: Fixed dependency cycle(s) with /ocp@f1000000/pin-controller@10000/pmx-power-back-on
[    0.104645][    T1] No ATAGs?
[    0.490129][    T1] raid6: int32x8  gen()   109 MB/s
[    0.830120][    T1] raid6: int32x4  gen()   106 MB/s
[    1.170128][    T1] raid6: int32x2  gen()   135 MB/s
[    1.510122][    T1] raid6: int32x1  gen()    96 MB/s
[    1.510135][    T1] raid6: using algorithm int32x2 gen() 135 MB/s
[    1.850122][    T1] raid6: .... xor() 86 MB/s, rmw enabled
[    1.850134][    T1] raid6: using intx1 recovery algorithm
[    1.851984][    T1] SCSI subsystem initialized
[    1.852804][    T1] usbcore: registered new interface driver usbfs
[    1.852913][    T1] usbcore: registered new interface driver hub
[    1.852987][    T1] usbcore: registered new device driver usb
[    1.853334][    T1] pps_core: LinuxPPS API ver. 1 registered
[    1.853346][    T1] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    1.853379][    T1] PTP clock support registered
[    1.860191][    T1] vgaarb: loaded
[    1.861011][    T1] clocksource: Switched to clocksource orion_clocksource
[    1.870038][    T1] VFS: Disk quotas dquot_6.6.0
[    1.881471][    T1] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[    1.882706][    T1] netfs: FS-Cache loaded
[    1.917708][    T1] NET: Registered PF_INET protocol family
[    1.918047][    T1] IP idents hash table entries: 4096 (order: 3, 32768 bytes, linear)
[    1.931381][    T1] tcp_listen_portaddr_hash hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    1.931628][    T1] Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    1.932661][    T1] TCP established hash table entries: 2048 (order: 1, 8192 bytes, linear)
[    1.932716][    T1] TCP bind hash table entries: 2048 (order: 2, 16384 bytes, linear)
[    1.932772][    T1] TCP: Hash tables configured (established 2048 bind 2048)
[    1.933425][    T1] MPTCP token hash table entries: 512 (order: 0, 6144 bytes, linear)
[    1.933682][    T1] UDP hash table entries: 256 (order: 1, 8192 bytes, linear)
[    1.933730][    T1] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear)
[    1.934718][    T1] NET: Registered PF_UNIX/PF_LOCAL protocol family
[    1.936065][    T1] RPC: Registered named UNIX socket transport module.
[    1.936082][    T1] RPC: Registered udp transport module.
[    1.936088][    T1] RPC: Registered tcp transport module.
[    1.936094][    T1] RPC: Registered tcp-with-tls transport module.
[    1.936100][    T1] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    1.936123][    T1] PCI: CLS 0 bytes, default 32
[    1.946887][   T36] Trying to unpack rootfs image as initramfs...
[    3.330411][   T36] Freeing initrd memory: 7836K
[    3.948735][    T1] Initialise system trusted keyrings
[    3.948873][    T1] Key type blacklist registered
[    3.949370][    T1] workingset: timestamp_bits=14 max_order=16 bucket_order=2
[    3.949458][    T1] zbud: loaded
[    3.965328][    T1] NFS: Registering the id_resolver key type
[    3.965382][    T1] Key type id_resolver registered
[    3.965392][    T1] Key type id_legacy registered
[    3.965588][    T1] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[    3.965646][    T1] nfs4flexfilelayout_init: NFSv4 Flexfile Layout Driver Registering...
[    3.966907][    T1] fuse: init (API version 7.41)
[    4.245345][    T1] xor: measuring software checksum speed
[    4.248336][    T1]    arm4regs        :  1103 MB/sec
[    4.253300][    T1]    8regs           :   662 MB/sec
[    4.256782][    T1]    32regs          :   945 MB/sec
[    4.256791][    T1] xor: using function: arm4regs (1103 MB/sec)
[    4.256807][    T1] async_tx: api initialized (async)
[    4.256824][    T1] Key type asymmetric registered
[    4.256833][    T1] Asymmetric key parser 'x509' registered
[    4.310273][    T1] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 247)
[    4.310784][    T1] io scheduler bfq registered
[    4.500890][    T1] kirkwood-pinctrl f1010000.pin-controller: registered pinctrl driver
[    4.503477][    T1] gpio gpiochip0: Static allocation of GPIO base is deprecated, use dynamic allocation.
[    4.505088][    T1] gpio gpiochip1: Static allocation of GPIO base is deprecated, use dynamic allocation.
[    4.508143][    T1] ledtrig-cpu: registered to indicate activity on CPUs
[    4.509063][    T1] mv_xor f1060800.xor: Marvell shared XOR driver
[    4.552919][    T1] mv_xor f1060800.xor: Marvell XOR (Registers Mode): ( xor cpy intr )
[    4.557470][    T1] mv_xor f1060900.xor: Marvell shared XOR driver
[    4.602944][    T1] mv_xor f1060900.xor: Marvell XOR (Registers Mode): ( xor cpy intr )
[    4.607925][    T1] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
[    4.610680][    T1] printk: legacy console [ttyS0] disabled
[    4.611672][    T1] f1012000.serial: ttyS0 at MMIO 0xf1012000 (irq = 27, base_baud = 12500000) is a 16550A
[    4.611757][    T1] printk: legacy console [ttyS0] enabled
[    5.547349][    T1] loop: module loaded
[    5.552596][    T1] sata_mv f1080000.sata: slots 32 ports 2
[    5.563462][    T1] scsi host0: sata_mv
[    5.569015][    T1] scsi host1: sata_mv
[    5.573408][    T1] ata1: SATA max UDMA/133 irq 28 lpm-pol 0
[    5.579113][    T1] ata2: SATA max UDMA/133 irq 28 lpm-pol 0
[    5.586305][    T1] nand: device found, Manufacturer ID: 0xec, Chip ID: 0xf1
[    5.593497][    T1] nand: Samsung NAND 128MiB 3,3V 8-bit
[    5.598845][    T1] nand: 128 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
[    5.607311][    T1] Scanning device for bad blocks
[    5.615135][    T1] Bad eraseblock 30 at 0x0000003c0000
[    5.665187][    T1] Bad eraseblock 494 at 0x000003dc0000
[    5.721686][    T1] 3 cmdlinepart partitions found on MTD device orion_nand
[    5.728695][    T1] Creating 3 MTD partitions on "orion_nand":
[    5.734594][    T1] 0x000000000000-0x000000100000 : "u-boot"
[    5.741328][    T1] 0x000000100000-0x000000600000 : "kernel"
[    5.747851][    T1] 0x000000600000-0x000008000000 : "rootfs"
[    5.756221][    T1] wireguard: WireGuard 1.0.0 loaded. See www.wireguard.com for information.
[    5.764903][    T1] wireguard: Copyright (C) 2015-2019 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
[    5.803391][    T1] mv643xx_eth: MV-643xx 10/100/1000 ethernet driver version 1.4
[    6.061063][   T56] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl F300)
[    6.072702][   T56] ata1.00: ATA-8: TOSHIBA HDWA130, MZ6OACF0, max UDMA/133
[    6.079723][   T56] ata1.00: 5860533168 sectors, multi 0: LBA48 NCQ (depth 31/32)
[    6.094180][   T56] ata1.00: configured for UDMA/133
[    6.109909][   T22] scsi 0:0:0:0: Direct-Access     ATA      TOSHIBA HDWA130  ACF0 PQ: 0 ANSI: 5
[    6.120778][   T36] sd 0:0:0:0: [sda] 5860533168 512-byte logical blocks: (3.00 TB/2.73 TiB)
[    6.130075][   T36] sd 0:0:0:0: [sda] 4096-byte physical blocks
[    6.136231][   T36] sd 0:0:0:0: [sda] Write Protect is off
[    6.141946][   T36] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    6.151948][   T36] sd 0:0:0:0: [sda] Preferred minimum I/O size 4096 bytes
[    6.242741][   T36]  sda: sda1 sda2
[    6.247191][   T36] sd 0:0:0:0: [sda] Attached SCSI disk
[    6.442507][    T1] mv643xx_eth_port mv643xx_eth_port.0 eth0: port 0 with MAC address c8:be:19:00:72:4d
[    6.452864][    T1] orion-ehci f1050000.ehci: EHCI Host Controller
[    6.459124][    T1] orion-ehci f1050000.ehci: new USB bus registered, assigned bus number 1
[    6.467889][    T1] orion-ehci f1050000.ehci: irq 31, io mem 0xf1050000
[    6.491053][    T1] orion-ehci f1050000.ehci: USB 2.0 started, EHCI 1.00
[    6.498285][    T1] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 6.13
[    6.507344][    T1] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    6.515333][    T1] usb usb1: Product: EHCI Host Controller
[    6.520944][    T1] usb usb1: Manufacturer: Linux 6.13.8-kirkwood-tld-1 ehci_hcd
[    6.528404][    T1] usb usb1: SerialNumber: f1050000.ehci
[    6.534982][    T1] hub 1-0:1.0: USB hub found
[    6.539525][    T1] hub 1-0:1.0: 1 port detected
[    6.545359][    T1] usbcore: registered new interface driver usb-storage
[    6.553126][    T1] rtc-mv f1010300.rtc: is a wakeup source
[    6.559588][    T1] rtc-mv f1010300.rtc: registered as rtc0
[    6.565341][    T1] rtc-mv f1010300.rtc: setting system clock to 2025-04-10T16:23:14 UTC (1744302194)
[    6.576078][    T1] i2c_dev: i2c /dev entries driver
[    6.584080][    T1] device-mapper: uevent: version 1.0.3
[    6.590141][    T1] device-mapper: ioctl: 4.48.0-ioctl (2023-03-01) initialised: dm-devel@lists.linux.dev
[    6.600622][    T1] device-mapper: multipath round-robin: version 1.2.0 loaded
[    6.607991][    T1] device-mapper: multipath queue-length: version 0.2.0 loaded
[    6.615402][    T1] device-mapper: multipath service-time: version 0.3.0 loaded
[    6.622807][   T58] ata2: SATA link up 3.0 Gbps (SStatus 123 SControl F300)
[    6.630225][    T1] device-mapper: dm-log-userspace: version 1.3.0 loaded
[    6.638336][    T1] sdhci: Secure Digital Host Controller Interface driver
[    6.645394][   T58] ata2.00: ATA-8: TOSHIBA HDWA130, MZ6OACF0, max UDMA/133
[    6.652441][    T1] sdhci: Copyright(c) Pierre Ossman
[    6.657746][    T1] hid: raw HID events driver (C) Jiri Kosina
[    6.663663][   T58] ata2.00: 5860533168 sectors, multi 0: LBA48 NCQ (depth 31/32)
[    6.671826][    T1] drop_monitor: Initializing network drop monitor service
[    6.680710][    T1] NET: Registered PF_INET6 protocol family
[    6.689846][    T1] Segment Routing with IPv6
[    6.694614][    T1] RPL Segment Routing with IPv6
[    6.699455][   T58] ata2.00: configured for UDMA/133
[    6.705105][   T12] scsi 1:0:0:0: Direct-Access     ATA      TOSHIBA HDWA130  ACF0 PQ: 0 ANSI: 5
[    6.714179][    T1] In-situ OAM (IOAM) with IPv6
[    6.719000][    T1] NET: Registered PF_PACKET protocol family
[    6.726803][   T36] sd 1:0:0:0: [sdb] 5860533168 512-byte logical blocks: (3.00 TB/2.73 TiB)
[    6.736383][    T1] Key type dns_resolver registered
[    6.741479][   T36] sd 1:0:0:0: [sdb] 4096-byte physical blocks
[    6.747528][   T36] sd 1:0:0:0: [sdb] Write Protect is off
[    6.771304][   T36] sd 1:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    6.784857][   T36] sd 1:0:0:0: [sdb] Preferred minimum I/O size 4096 bytes
[    6.792778][    T1] registered taskstats version 1
[    6.797780][    T1] Loading compiled-in X.509 certificates
[    6.842032][    T1] Key type .fscrypt registered
[    6.846716][    T1] Key type fscrypt-provisioning registered
[    6.860066][    T1] Key type big_key registered
[    6.893009][   T36]  sdb: sdb1 sdb2
[    6.901880][   T36] sd 1:0:0:0: [sdb] Attached SCSI disk
[    7.100175][    T1] Key type encrypted registered
[    7.149026][  T109] "cryptomgr_test" (109) uses obsolete ecb(arc4) skcipher
[    7.243975][    T1] clk: Disabling unused clocks
[    7.282128][    T1] Freeing unused kernel image (initmem) memory: 1024K
[    7.289816][    T1] Checked W+X mappings: passed, no W+X pages found
[    7.328000][    T1] Run /init as init process
Loading, please wait...
Starting systemd-udevd version 252.36-1~deb12u1
[   12.451078][    C0] random: crng init done
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: Will now check root file system ... fsck from util-linux 2.38.1
[/sbin/fsck.ext4 (1) -- /dev/sda1] fsck.ext4 -a -C0 /dev/sda1 
rootfs: clean, 23118/524288 files, 280539/2097152 blocks
done.
[   23.366847][  T201] EXT4-fs (sda1): mounted filesystem aa63b545-bc4e-4bc8-b1af-a7b1a1c29ebd ro with ordered data mode. Quota mode: none.
done.
Begin: Running /scripts/local-bottom ... done.
Begin: Running /scripts/init-bottom ... done.
INIT: version 3.06 booting
INIT: No inittab.d directory found
Using makefile-style concurrent boot in runlevel S.
Setting hostname to 'fulla'...done.
Files under mount point '/run/lock' will be hidden. ... (warning).
Starting hotplug events dispatcher: systemd-udevd.
Synthesizing the initial hotplug events (subsystems)...done.
Synthesizing the initial hotplug events (devices)...done.
Waiting for /dev to be fully populated...[   26.614269][  T380] gpio-fan gpio_fan: GPIO fan initialized
[   26.694174][  T379] input: gpio_keys as /devices/platform/gpio_keys/input/input0
[   26.987385][  T383] lm75 0-0048: supply vs not found, using dummy regulator
[   27.051790][  T383] hwmon hwmon1: temp1_input not attached to any thermal zone
[   27.132897][  T380] orion_wdt: Initial timeout 21 sec
[   27.138105][  T383] lm75 0-0048: hwmon1: sensor 'lm75'
[   27.272294][  T379] marvell-cesa f1030000.crypto: CESA device successfully registered
[   27.606848][  T377] sd 0:0:0:0: Attached scsi generic sg0 type 0
[   27.681520][  T377] sd 1:0:0:0: Attached scsi generic sg1 type 0
done.
Activating swap:swapon: /dev/sdb1: found signature [pagesize=4096, signature=swap]
swapon: /dev/sdb1: pagesize=4096, sw[   30.066656][  T531] Adding 8388604k swap on /dev/sdb1.  Priority:-2 extents:1 across:8388604k 
apsize=8589934592, devsize=8589934592
swapon /dev/sdb1
.
[   30.221334][  T538] EXT4-fs (sda1): re-mounted aa63b545-bc4e-4bc8-b1af-a7b1a1c29ebd r/w. Quota mode: none.
Will now check all file systems.
Checking all file systems.
LABEL=rootfs is mounted
/dev/mapper/fulla_jbod-fulla_pool is not mounted
[/sbin/fsck.ext4 (1) -- /media/pool] fsck.ext4 -y -C0 /dev/mapper/fulla_jbod-fulla_pool 
e2fsck 1.47.0 (5-Feb-2023)
/dev/mapper/fulla_jbod-fulla_pool: clean, 11/182620160 files, 11802965/1460936704 blocks
Done checking file systems.
Log is being saved in /var/log/fsck/checkfs if that location is writable.
Cleaning up temporary files...Cleaning /tmp...
done.
 /tmp.
[   43.543257][  T775] EXT4-fs (dm-0): mounted filesystem 1688440d-0c1f-4c88-be66-7aa8f6c4efea r/w with ordered data mode. Quota mode: none.
Will now mount local filesystems:.
Will now activate swapfile swap, if any:swapon: /dev/sdb1: already active -- ignored
done.
Checking minimum space in /tmp...done.
Cleaning up temporary files....
Starting Setting kernel variables: sysctl.
Initializing random number generator...done.
Configuring network interfaces...Internet Systems Consortium DHCP Client 4.4.3-P1
Copyright 2004-2022 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/eth0/c8:be:19:00:72:4d
Sending on   LPF/eth0/c8:be:19:00:72:4d
Sending on   Socket/fallback
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 8
[   47.778258][    C0] mv643xx_eth_port mv643xx_eth_port.0 eth0: link up, 1000 Mb/s, full duplex, flow control disabled
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 11
DHCPOFFER of 192.168.0.20 from 192.168.0.1
DHCPREQUEST for 192.168.0.20 on eth0 to 255.255.255.255 port 67
DHCPACK of 192.168.0.20 from 192.168.0.1
bound to 192.168.0.20 -- renewal in 37835 seconds.
done.
Starting RPC port mapper daemon: rpcbind.
Starting NFS common utilities: statd idmapd.
Cleaning up temporary files....
INIT: Entering runlevel: 2
Using makefile-style concurrent boot in runlevel 2.
Starting busybox' syslogd implementation : syslogdStarting /sbin/syslogd...
1053 (syslogd)
.
Starting system message bus: dbus.
Starting Avahi mDNS/DNS-SD Daemon: avahi-daemon.
Not starting NFS kernel daemon: no exports ... (warning).
Starting NTP server: ntpd2025-04-10T12:24:08 ntpd[1099]: INIT: ntpd ntpsec-1.2.2: Starting
2025-04-10T12:24:08 ntpd[1099]: INIT: Command line: /usr/sbin/ntpd -p /var/run/ntpd.pid -g -u 104:106
.
Starting NTP server: ntpd.
Starting busybox' klogd implementation : klogdStarting /sbin/klogd...
1071 (klogd)
.
Starting OpenBSD Secure Shell server: sshd.
Running local boot scripts (/etc/rc.local)
.

Debian GNU/Linux 12 fulla ttyS0

fulla login: 

Re: 2024.10 U-Boot Kirkwood - DNS-325
April 10, 2025 04:10PM
Sparks,

Thanks for testing!

> There were a few things that differed from the
> expected results in the flashing instructions.
> Only one real error. That was in the command to
> dump mtd0. The rest are inconsiquential but since
> they differed from the instructions I thought I'd
> list them and let you decide how/if to handle it.
>
> section 2.1 command is incorrect; missing '-f'
> before output filename

Yes, indeed -f is missing.

> section 2.2 problem dumping uEnv; command
> yielded:
> root@fulla:~# fw_printenv
> > current_envs.txt
>
> Cannot read environment, using default
>
> Cannot read default environment from file

That's OK. Note that I have a caveat, but did not mention that this could also happen in the new rootfs before flashing the envs image. I should add that.

Quote

For most stock OS, there is no fw_printenv. So it's OK if this step fails. Howver, it's important to list the current envs (eg. in serial console) and copy them to a note file (current_envs.txt). This will be used in Step 7.

> section 5 slightly different output from
> flash_erase; output was:
> root@fulla:~# flash_erase
> /dev/mtd0 0 4
>
> Erasing 128 Kibyte @ 60000 -- 100 % complete
> root@fulla:~#
> I believe my flash_erase
> came from the Debian package mtd-tools rather than
> the one posted on this
> board.

This is something I've made a note to look into. It is OK, the current flash_erase output is misleading.

> Writing data to block 6 at offset 0xc0000
>
> Written 62 blocks containing only 0xff bytes
>
> Those block may be incorrectly treated as empty!

Yeah, all because of the recent version of nandwrite output more and sometime misleading info. u-boot does not care what appear in the empty space so 0's or ff's are irrelevant.

> All is well regarding boot. Since I have a
> permanently attached usb/serial cable I'm not
> really interested in netconsole so I didn't test
> it. I will if you want me to. My second box got
> declared e-waste. Besides not detecting the hard
> drives, it ended up with scads (>100) mtd bad
> blocks. C'est la vie.

Run kwboot on this second box. If the new u-boot can detect HDD/SSD drive at the prompt, then you could boot it with no mtdparts, using uEnv.txt or boot.scr. As long as there is no mtdparts in bootargs, the kernel will not try to scan NAND. So it still can be used, not e-waste! The only drawback is each time you want to reboot or cold start, you need to use serial console to run kwboot.

> Wish it would wake on lan
> but now I'm getting greedy. ;)

This topic is in my backlog. In general, Kirkwood SoCs has WOL, but I have not looked into the 6281 SoCs WOL yet.

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