Welcome! Log In Create A New Profile

Advanced

U-Boot for Buffalo Linkstations

Posted by Markus Fuger 
Markus Fuger
U-Boot for Buffalo Linkstations
May 15, 2019 10:16AM
Hello everyone,

I am still having some older Buffalo Linkstations lying around that I like to set up similar to my other NSA325. Due to restricted hardware I only like to use those as NFS-servers for rsync on another location.

I would like to use the same debian from here:
https://forum.doozan.com/read.php?2,12096
and benefit from the up-to-date kernels as well as from the possibility to boot from USB.

So I do have some questions for the LS-XHL, LS-CHLv2:
- assuming that it would be able to compile and flash this u-boot version. Would it then be possible to boot from an USB-flash drive? - Having a simple one partition layout on the installed hard drive instead of the 4 partition layout required by the buffalo boot-loader and systems
- would it remove the limit of 2TB hard-drives? as stated on the first post or could there be some more component that limits that

To give some information of what I found using a fresh installed Debian Stretch using the Debian Installer: https://miniconf.debian.or.jp/assets/files/Debian%20Installer%20for%20Buffalo%20Linkstation%20NAS.pdf

This is the output of dmesg of the LS-CHLv2
[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 4.9.0-9-marvell (debian-kernel@lists.debian.org) (gcc version 6.3.0 20170516 (Debian 6.3.0-18+deb9u1) ) #1 Debian 4.9.168-1+deb9u2 (2019-05-13)
[    0.000000] CPU: Feroceon 88FR131 [56251311] revision 1 (ARMv5TE), cr=0005397f
[    0.000000] CPU: VIVT data cache, VIVT instruction cache
[    0.000000] OF: fdt:Machine model: Buffalo Linkstation LS-XHL
[    0.000000] Memory policy: Data cache writeback
[    0.000000] On node 0 totalpages: 16384
[    0.000000] free_area_init_node: node 0, pgdat c0596e1c, node_mem_map c3f78000
[    0.000000]   Normal zone: 128 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 16384 pages, LIFO batch:3
[    0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[    0.000000] pcpu-alloc: [0] 0
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 16256
[    0.000000] Kernel command line: console=ttyS0,115200 root=/dev/sda2 rw initrd=0x00800040,12M panic=5 BOOTVER=0.21
[    0.000000] PID hash table entries: 256 (order: -2, 1024 bytes)
[    0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Memory: 46548K/65536K available (3794K kernel code, 397K rwdata, 1132K rodata, 292K init, 245K bss, 18988K reserved, 0K cma-reserved, 0K highmem)
[    0.000000] Virtual kernel memory layout:
                   vector  : 0xffff0000 - 0xffff1000   (   4 kB)
                   fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
                   vmalloc : 0xc4800000 - 0xff800000   ( 944 MB)
                   lowmem  : 0xc0000000 - 0xc4000000   (  64 MB)
                   pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
                   modules : 0xbf000000 - 0xbfe00000   (  14 MB)
                     .text : 0xc0008000 - 0xc03bcc60   (3796 kB)
                     .init : 0xc04f9000 - 0xc0542000   ( 292 kB)
                     .data : 0xc0542000 - 0xc05a5770   ( 398 kB)
                      .bss : 0xc05a5770 - 0xc05e2d7c   ( 246 kB)
[    0.000000] NR_IRQS:16 nr_irqs:16 16
[    0.000000] clocksource: orion_clocksource: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 11467562657 ns
[    0.000015] sched_clock: 32 bits at 166MHz, resolution 6ns, wraps every 12884901885ns
[    0.000850] Console: colour dummy device 80x30
[    0.000898] Calibrating delay loop... 595.96 BogoMIPS (lpj=1191936)
[    0.028102] pid_max: default: 32768 minimum: 301
[    0.028391] Security Framework initialized
[    0.028417] Yama: disabled by default; enable with sysctl kernel.yama.*
[    0.028664] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.028696] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.030365] CPU: Testing write buffer coherency: ok
[    0.030524] ftrace: allocating 17012 entries in 34 pages
[    0.098699] Setting up static identity map for 0x8200 - 0x823c
[    0.099125] mvebu-soc-id: MVEBU SoC ID=0x6281, Rev=0x2
[    0.104618] devtmpfs: initialized
[    0.114199] VFP support v0.3: not present
[    0.114488] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[    0.114532] futex hash table entries: 256 (order: -1, 3072 bytes)
[    0.114928] pinctrl core: initialized pinctrl subsystem
[    0.116837] NET: Registered protocol family 16
[    0.117436] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.119934] cpuidle: using governor ladder
[    0.119960] cpuidle: using governor menu
[    0.120658] Feroceon L2: Enabling L2
[    0.120724] Feroceon L2: Cache support initialised.
[    0.121160] [Firmware Info]: /ocp@f1000000/ethernet-controller@72000/ethernet0-port@0: local-mac-address is not set
[    0.121332] [Firmware Info]: /ocp@f1000000/ethernet-controller@76000/ethernet1-port@0: local-mac-address is not set
[    0.129353] No ATAGs?
[    0.138796] clocksource: Switched to clocksource orion_clocksource
[    0.163587] VFS: Disk quotas dquot_6.6.0
[    0.163720] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[    0.177802] NET: Registered protocol family 2
[    0.179342] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    0.179389] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    0.179426] TCP: Hash tables configured (established 1024 bind 1024)
[    0.179522] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.179561] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.179863] NET: Registered protocol family 1
[    0.179921] PCI: CLS 0 bytes, default 32
[    0.180331] Unpacking initramfs...
[    0.775952] Initramfs unpacking failed: junk in compressed archive
[    0.824423] Freeing initrd memory: 12292K
[    0.825633] audit: initializing netlink subsys (disabled)
[    0.825744] audit: type=2000 audit(0.788:1): initialized
[    0.826388] workingset: timestamp_bits=30 max_order=14 bucket_order=0
[    0.826540] zbud: loaded
[    0.829474] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 251)
[    0.829720] io scheduler noop registered
[    0.829855] io scheduler cfq registered (default)
[    0.831961] kirkwood-pinctrl f1010000.pin-controller: registered pinctrl driver
[    0.835204] mv_xor f1060800.xor: Marvell shared XOR driver
[    0.873207] mv_xor f1060800.xor: Marvell XOR (Registers Mode): ( xor cpy intr )
[    0.873508] mv_xor f1060900.xor: Marvell shared XOR driver
[    0.909188] mv_xor f1060900.xor: Marvell XOR (Registers Mode): ( xor cpy intr )
[    0.909833] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
[    0.911597] console [ttyS0] disabled
[    0.911689] f1012000.serial: ttyS0 at MMIO 0xf1012000 (irq = 26, base_baud = 10416666) is a 16550A
[    1.234350] random: fast init done
[    1.389999] console [ttyS0] enabled
[    1.397270] mousedev: PS/2 mouse device common for all mice
[    1.403336] rtc-mv f1010300.rtc: retrieved alarm date/time is not valid.
[    1.410378] rtc-mv f1010300.rtc: rtc core: registered f1010300.rtc as rtc0
[    1.417567] i2c /dev entries driver
[    1.422770] ledtrig-cpu: registered to indicate activity on CPUs
[    1.429485] NET: Registered protocol family 17
[    1.434987] registered taskstats version 1
[    1.439181] zswap: loaded using pool lzo/zbud
[    1.446211] rtc-mv f1010300.rtc: setting system clock to 2019-05-15 13:52:24 UTC (1557928344)
[    1.456735] Freeing unused kernel memory: 292K
[    1.461210] This architecture does not have kernel memory protection.
[    1.633392] random: systemd-udevd: uninitialized urandom read (16 bytes read)
[    1.655879] random: systemd-udevd: uninitialized urandom read (16 bytes read)
[    1.666017] random: udevadm: uninitialized urandom read (16 bytes read)
[    2.044845] SCSI subsystem initialized
[    2.121506] libata version 3.00 loaded.
[    2.125174] sata_mv f1080000.sata: version 1.28
[    2.125476] sata_mv f1080000.sata: slots 32 ports 1
[    2.164932] scsi host0: sata_mv
[    2.174427] ata1: SATA max UDMA/133 irq 33
[    2.658864] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl F300)
[    2.669794] ata1.00: ATA-8: Hitachi HTS545050B9A300, PB4OC60G, max UDMA/133
[    2.676772] ata1.00: 976773168 sectors, multi 0: LBA48 NCQ (depth 31/32)
[    2.690323] ata1.00: configured for UDMA/133
[    2.695445] scsi 0:0:0:0: Direct-Access     ATA      Hitachi HTS54505 C60G PQ: 0 ANSI: 5
[    2.735137] sd 0:0:0:0: [sda] 976773168 512-byte logical blocks: (500 GB/466 GiB)
[    2.745568] sd 0:0:0:0: [sda] Write Protect is off
[    2.750415] sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
[    2.750603] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    2.820143]  sda: sda1 sda2 sda3 sda4
[    2.832919] sd 0:0:0:0: [sda] Attached SCSI disk
[    4.023160] EXT4-fs (sda2): mounted filesystem with ordered data mode. Opts: (null)
[    5.534223] NET: Registered protocol family 10
[    5.563986] ip_tables: (C) 2000-2006 Netfilter Core Team
[    5.584700] random: crng init done
[    5.588101] random: 7 urandom warning(s) missed due to ratelimiting
[    5.658887] systemd[1]: systemd 232 running in system mode. (+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN)
[    5.677680] systemd[1]: Detected architecture arm.
[    5.714836] systemd[1]: Set hostname to <LS-CHL>.
[    7.187950] systemd[1]: Listening on Syslog Socket.
[    7.207584] systemd[1]: Listening on udev Control Socket.
[    7.227526] systemd[1]: Listening on /dev/initctl Compatibility Named Pipe.
[    7.251503] systemd[1]: Listening on Journal Socket (/dev/log).
[    7.272941] systemd[1]: Created slice System Slice.
[    7.292753] systemd[1]: Created slice system-getty.slice.
[    7.317382] systemd[1]: Mounting Debug File System...
[    7.711238] RPC: Registered named UNIX socket transport module.
[    7.717359] RPC: Registered udp transport module.
[    7.722082] RPC: Registered tcp transport module.
[    7.726801] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    7.860257] EXT4-fs (sda2): re-mounted. Opts: errors=remount-ro
[    7.979610] Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
[    9.127658] systemd-journald[128]: Received request to flush runtime journal from PID 1
[   10.453803] input: gpio_keys as /devices/platform/gpio_keys/input/input0
[   10.532770] gpio-fan gpio_fan: GPIO fan initialized
[   10.674916] m25p80 spi0.0: m25p40 (512 Kbytes)
[   10.722926] 3 ofpart partitions found on MTD device spi0.0
[   10.728681] Creating 3 MTD partitions on "spi0.0":
[   10.749068] orion_wdt: Initial timeout 25 sec
[   10.838907] 0x000000000000-0x000000060000 : "uboot"
[   10.904607] 0x000000060000-0x000000070000 : "dtb"
[   10.921710] libphy: Fixed MDIO Bus: probed
[   10.968870] 0x000000070000-0x000000080000 : "uboot_env"
[   10.979025] sd 0:0:0:0: Attached scsi generic sg0 type 0
[   10.994993] usbcore: registered new interface driver usbfs
[   11.036059] usbcore: registered new interface driver hub
[   11.079262] marvell-cesa f1030000.crypto: CESA device successfully registered
[   11.113678] usbcore: registered new device driver usb
[   11.130059] mv643xx_eth: MV-643xx 10/100/1000 ethernet driver version 1.4
[   11.172077] libphy: orion_mdio_bus: probed
[   11.200495] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[   11.303602] ehci-orion: EHCI orion driver
[   11.355202] orion-ehci f1050000.ehci: EHCI Host Controller
[   11.407948] orion-ehci f1050000.ehci: new USB bus registered, assigned bus number 1
[   11.417894] mv643xx_eth_port mv643xx_eth_port.1 eth0: port 0 with MAC address 00:24:a5:55:90:23
[   11.495164] orion-ehci f1050000.ehci: irq 30, io mem 0xf1050000
[   11.590901] orion-ehci f1050000.ehci: USB 2.0 started, EHCI 1.00
[   11.651212] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[   11.658040] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[   11.665281] usb usb1: Product: EHCI Host Controller
[   11.670177] usb usb1: Manufacturer: Linux 4.9.0-9-marvell ehci_hcd
[   11.676371] usb usb1: SerialNumber: f1050000.ehci
[   11.943506] hub 1-0:1.0: USB hub found
[   11.980757] hub 1-0:1.0: 1 port detected
[   13.037850] Adding 524284k swap on /dev/sda3.  Priority:-1 extents:1 across:524284k FS
[   14.932890] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[   15.117573] NFSD: starting 90-second grace period (net c05902c8)
[   17.179161] mv643xx_eth_port mv643xx_eth_port.1 eth0: link up, 1000 Mb/s, full duplex, flow control disabled
[   17.189047] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready


quite similar for the LS-XHL
[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 4.9.0-9-marvell (debian-kernel@lists.debian.org) (gcc version 6.3.0 20170516 (Debian 6.3.0-18+deb9u1) ) #1 Debian 4.9.168-1+deb9u2 (2019-05-13)
[    0.000000] CPU: Feroceon 88FR131 [56251311] revision 1 (ARMv5TE), cr=0005317f
[    0.000000] CPU: VIVT data cache, VIVT instruction cache
[    0.000000] OF: fdt:Machine model: Buffalo Linkstation LS-XHL
[    0.000000] Memory policy: Data cache writeback
[    0.000000] On node 0 totalpages: 16384
[    0.000000] free_area_init_node: node 0, pgdat c0596e1c, node_mem_map c3f78000
[    0.000000]   Normal zone: 128 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 16384 pages, LIFO batch:3
[    0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[    0.000000] pcpu-alloc: [0] 0
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 16256
[    0.000000] Kernel command line: console=ttyS0,115200 root=/dev/sda2 rw initrd=0x00800040,12M panic=5 BOOTVER=0.10
[    0.000000] PID hash table entries: 256 (order: -2, 1024 bytes)
[    0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Memory: 46548K/65536K available (3794K kernel code, 397K rwdata, 1132K rodata, 292K init, 245K bss, 18988K reserved, 0K cma-reserved, 0K highmem)
[    0.000000] Virtual kernel memory layout:
                   vector  : 0xffff0000 - 0xffff1000   (   4 kB)
                   fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
                   vmalloc : 0xc4800000 - 0xff800000   ( 944 MB)
                   lowmem  : 0xc0000000 - 0xc4000000   (  64 MB)
                   pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
                   modules : 0xbf000000 - 0xbfe00000   (  14 MB)
                     .text : 0xc0008000 - 0xc03bcc60   (3796 kB)
                     .init : 0xc04f9000 - 0xc0542000   ( 292 kB)
                     .data : 0xc0542000 - 0xc05a5770   ( 398 kB)
                      .bss : 0xc05a5770 - 0xc05e2d7c   ( 246 kB)
[    0.000000] NR_IRQS:16 nr_irqs:16 16
[    0.000000] clocksource: orion_clocksource: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 9556302233 ns
[    0.000009] sched_clock: 32 bits at 200MHz, resolution 5ns, wraps every 10737418237ns
[    0.000519] Console: colour dummy device 80x30
[    0.000552] Calibrating delay loop... 1191.93 BogoMIPS (lpj=2383872)
[    0.020065] pid_max: default: 32768 minimum: 301
[    0.020232] Security Framework initialized
[    0.020249] Yama: disabled by default; enable with sysctl kernel.yama.*
[    0.020397] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.020417] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.021498] CPU: Testing write buffer coherency: ok
[    0.021600] ftrace: allocating 17012 entries in 34 pages
[    0.057665] Setting up static identity map for 0x8200 - 0x823c
[    0.057927] mvebu-soc-id: MVEBU SoC ID=0x6281, Rev=0x2
[    0.061444] devtmpfs: initialized
[    0.067396] VFP support v0.3: not present
[    0.067583] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[    0.067612] futex hash table entries: 256 (order: -1, 3072 bytes)
[    0.067864] pinctrl core: initialized pinctrl subsystem
[    0.069109] NET: Registered protocol family 16
[    0.069519] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.071120] cpuidle: using governor ladder
[    0.071138] cpuidle: using governor menu
[    0.071503] Feroceon L2: Enabling L2
[    0.071546] Feroceon L2: Cache support initialised.
[    0.071819] [Firmware Info]: /ocp@f1000000/ethernet-controller@72000/ethernet0-port@0: local-mac-address is not set
[    0.071920] [Firmware Info]: /ocp@f1000000/ethernet-controller@76000/ethernet1-port@0: local-mac-address is not set
[    0.076615] No ATAGs?
[    0.082199] clocksource: Switched to clocksource orion_clocksource
[    0.096881] VFS: Disk quotas dquot_6.6.0
[    0.096966] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[    0.105318] NET: Registered protocol family 2
[    0.106270] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    0.106300] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    0.106323] TCP: Hash tables configured (established 1024 bind 1024)
[    0.106387] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.106410] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.106598] NET: Registered protocol family 1
[    0.106635] PCI: CLS 0 bytes, default 32
[    0.106891] Unpacking initramfs...
[    0.421734] Initramfs unpacking failed: junk in compressed archive
[    0.457006] Freeing initrd memory: 12292K
[    0.457770] audit: initializing netlink subsys (disabled)
[    0.457846] audit: type=2000 audit(0.436:1): initialized
[    0.458304] workingset: timestamp_bits=30 max_order=14 bucket_order=0
[    0.458400] zbud: loaded
[    0.460166] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 251)
[    0.460320] io scheduler noop registered
[    0.460399] io scheduler cfq registered (default)
[    0.461582] kirkwood-pinctrl f1010000.pin-controller: registered pinctrl driver
[    0.463498] mv_xor f1060800.xor: Marvell shared XOR driver
[    0.491541] mv_xor f1060800.xor: Marvell XOR (Registers Mode): ( xor cpy intr )
[    0.491737] mv_xor f1060900.xor: Marvell shared XOR driver
[    0.519521] mv_xor f1060900.xor: Marvell XOR (Registers Mode): ( xor cpy intr )
[    0.519936] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
[    0.520992] console [ttyS0] disabled
[    0.521052] f1012000.serial: ttyS0 at MMIO 0xf1012000 (irq = 26, base_baud = 12500000) is a 16550A
[    0.999129] console [ttyS0] enabled
[    1.004876] mousedev: PS/2 mouse device common for all mice
[    1.010728] rtc-mv f1010300.rtc: invalid RTC date, resetting to January 1st, 2013
[    1.018325] rtc-mv f1010300.rtc: retrieved alarm date/time is not valid.
[    1.025268] rtc-mv f1010300.rtc: rtc core: registered f1010300.rtc as rtc0
[    1.032382] i2c /dev entries driver
[    1.036908] ledtrig-cpu: registered to indicate activity on CPUs
[    1.043396] NET: Registered protocol family 17
[    1.048482] registered taskstats version 1
[    1.052670] zswap: loaded using pool lzo/zbud
[    1.058696] rtc-mv f1010300.rtc: setting system clock to 2013-01-01 20:12:23 UTC (1357071143)
[    1.068497] Freeing unused kernel memory: 292K
[    1.072985] This architecture does not have kernel memory protection.
[    1.177233] random: systemd-udevd: uninitialized urandom read (16 bytes read)
[    1.194881] random: systemd-udevd: uninitialized urandom read (16 bytes read)
[    1.202589] random: udevadm: uninitialized urandom read (16 bytes read)
[    1.450774] SCSI subsystem initialized
[    1.502422] libata version 3.00 loaded.
[    1.504584] sata_mv f1080000.sata: version 1.28
[    1.504790] sata_mv f1080000.sata: slots 32 ports 1
[    1.534378] scsi host0: sata_mv
[    1.537849] ata1: SATA max UDMA/133 irq 33
[    2.018295] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl F300)
[    2.029149] ata1.00: ATA-8: Hitachi HTS545050B9A300, PB4OC60G, max UDMA/133
[    2.036170] ata1.00: 976773168 sectors, multi 0: LBA48 NCQ (depth 31/32)
[    2.049634] ata1.00: configured for UDMA/133
[    2.054480] scsi 0:0:0:0: Direct-Access     ATA      Hitachi HTS54505 C60G PQ: 0 ANSI: 5
[    2.078644] sd 0:0:0:0: [sda] 976773168 512-byte logical blocks: (500 GB/466 GiB)
[    2.087921] sd 0:0:0:0: [sda] Write Protect is off
[    2.092776] sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
[    2.092890] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    2.161770]  sda: sda1 sda2 sda3 sda4
[    2.171209] sd 0:0:0:0: [sda] Attached SCSI disk
[    2.298215] random: fast init done
[    5.612567] EXT4-fs (sda2): mounted filesystem with ordered data mode. Opts: (null)
[    5.719696] random: crng init done
[    5.723126] random: 7 urandom warning(s) missed due to ratelimiting
[    6.604879] systemd[1]: System time before build time, advancing clock.
[    6.874622] NET: Registered protocol family 10
[    6.905414] ip_tables: (C) 2000-2006 Netfilter Core Team
[    7.008198] systemd[1]: systemd 232 running in system mode. (+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN)
[    7.026845] systemd[1]: Detected architecture arm.
[    7.068088] systemd[1]: Set hostname to <LS-CHL>.
[    8.400801] systemd[1]: Listening on Syslog Socket.
[    8.418645] systemd[1]: Listening on RPCbind Server Activation Socket.
[    8.442633] systemd[1]: Listening on Journal Socket (/dev/log).
[    8.462625] systemd[1]: Listening on udev Kernel Socket.
[    8.482817] systemd[1]: Started Dispatch Password Requests to Console Directory Watch.
[    8.507311] systemd[1]: Set up automount Arbitrary Executable File Formats File System Automount Point.
[    8.534663] systemd[1]: Listening on /dev/initctl Compatibility Named Pipe.
[    8.978522] RPC: Registered named UNIX socket transport module.
[    8.984508] RPC: Registered udp transport module.
[    8.989242] RPC: Registered tcp transport module.
[    8.993975] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    9.041216] EXT4-fs (sda2): re-mounted. Opts: errors=remount-ro
[    9.166362] Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
[    9.865723] systemd-journald[131]: Received request to flush runtime journal from PID 1
[   10.783744] input: gpio_keys as /devices/platform/gpio_keys/input/input0
[   10.845702] orion_wdt: Initial timeout 21 sec
[   10.903137] usbcore: registered new interface driver usbfs
[   10.919943] usbcore: registered new interface driver hub
[   10.943593] usbcore: registered new device driver usb
[   10.973529] m25p80 spi0.0: m25p40 (512 Kbytes)
[   10.994869] 3 ofpart partitions found on MTD device spi0.0
[   11.000443] Creating 3 MTD partitions on "spi0.0":
[   11.014126] gpio-fan gpio_fan: GPIO fan initialized
[   11.063367] libphy: Fixed MDIO Bus: probed
[   11.070865] 0x000000000000-0x000000060000 : "uboot"
[   11.103873] sd 0:0:0:0: Attached scsi generic sg0 type 0
[   11.132678] 0x000000060000-0x000000070000 : "dtb"
[   11.193727] 0x000000070000-0x000000080000 : "uboot_env"
[   11.201340] marvell-cesa f1030000.crypto: CESA device successfully registered
[   11.232327] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[   11.266098] mv643xx_eth: MV-643xx 10/100/1000 ethernet driver version 1.4
[   11.301592] ehci-orion: EHCI orion driver
[   11.315295] libphy: orion_mdio_bus: probed
[   11.416600] orion-ehci f1050000.ehci: EHCI Host Controller
[   11.458300] orion-ehci f1050000.ehci: new USB bus registered, assigned bus number 1
[   11.487746] mv643xx_eth_port mv643xx_eth_port.1 eth0: port 0 with MAC address 00:24:a5:55:57:be
[   11.562463] orion-ehci f1050000.ehci: irq 30, io mem 0xf1050000
[   11.634276] orion-ehci f1050000.ehci: USB 2.0 started, EHCI 1.00
[   11.662756] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[   11.669616] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[   11.676954] usb usb1: Product: EHCI Host Controller
[   11.681873] usb usb1: Manufacturer: Linux 4.9.0-9-marvell ehci_hcd
[   11.688105] usb usb1: SerialNumber: f1050000.ehci
[   11.905440] hub 1-0:1.0: USB hub found
[   11.954030] hub 1-0:1.0: 1 port detected
[   12.357185] Adding 524284k swap on /dev/sda3.  Priority:-1 extents:1 across:524284k FS
[   13.470374] NFSD: starting 90-second grace period (net c05902c8)
[   13.567458] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[   15.782909] mv643xx_eth_port mv643xx_eth_port.1 eth0: link up, 1000 Mb/s, full duplex, flow control disabled
[   15.792826] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready

here is what: cat /proc/mtd for LS-CHLv2 (and LS-XHL)
dev:    size   erasesize  name
mtd0: 00060000 00010000 "uboot"
mtd1: 00010000 00010000 "dtb"
mtd2: 00010000 00010000 "uboot_env"

output of grep -a --null-data U-Boot /dev/mtd0 for LS-CHLv2
U-Boot 1.1.4 (Mar 15 2011 - 14:53:08) Marvell version: 3.4.25If U-Boot Endiannes is going to change (LE->BE or BE->LE), Then Env parameters should be overriden..
U-Boot
** Invalid partition type "%.32s" (expect "U-Boot")
U-Boot code: %08lX -> %08lX  BSS: -> %08lX
Addresses %dM - 0M are saved for the U-Boot usage.

and LS-XHL
U-Boot 1.1.4 (Jul 24 2009 - 19:21:56) Marvell version: 3.4.16If U-Boot Endiannes is going to change (LE->BE or BE->LE), Then Env parameters should be overriden..
U-Boot
** Invalid partition type "%.32s" (expect "U-Boot")
U-Boot code: %08lX -> %08lX  BSS: -> %08lX
Addresses %dM - 0M are saved for the U-Boot usage.


and this is cat /dev/mtd2 for LS-CHLv2
▒q▒baudrate=115200loads_echo=0ipaddr=192.168.11.150serverip=192.168.11.1rootpath=/mnt/ARM_FS/netmask=255.255.255.0eth1addr=00:24:A5:55:90:11stdin=serialstdout=serialstderr=serialconsole=console=ttyS0,115200mainlineLinux=noCASset=minenaMonExt=noenaCpuStream=noenaWrAllo=nopexMode=RCdisL2Cache=nosetL2CacheWT=yesdisL2Prefetch=yesenaICPref=yesenaDCPref=yessata_dma_mode=yesMALLOC_len=1bootargs_root=root=/dev/sda2 rw initrd=0x00800040,12M panic=5bootargs_end=:::DB88FXX81:eth0:noneimage_name=uImagebuffalo_ver=BOOTVER=0.21kernel=uImage.buffaloinitrd=initrd.buffalobootcommon=setenv bootargs $console $bootargs_root $bootargs_func $buffalo_ver $mtdparts $tftpboot $nandboot; bootm 0x00100000 0x00800000tftpbootcmd=tftp 0x00100000 $kernel; tftp 0x00800000 $initrd; setenv tftpboot tftpboot=yes; run bootcommonidebootcmd=ext2load ide 0:1 0x00100000 /$kernel; ext2load ide 0:1 0x00800000 /$initrd; run bootcommonbootorder=idebootcmd=for i in $bootorder; do run ${i}bootcmd; donebootdelay=3disaMvPnp=noethaddr=00:50:43:42:06:0bethmtu=1500eth1mtu=1500mvNetConfig=mv_net_config=(00:11:88:0f:62:81,0:1:2:3),mtu=1500usb0Mode=hostnetretry=norcvrip=169.254.100.100loadaddr=0x02000000autoload=noenaAutoRecovery=y

and LS-XHLv2
I▒bootdelay=3baudrate=115200loads_echo=0ipaddr=192.168.11.150serverip=192.168.11.1rootpath=/mnt/ARM_FS/netmask=255.255.255.0eth1addr=00:24:A5:55:57:11

(the kernel does not create an /etc/fw_env.config


Here is why I believe that basically it should be possible:
configs in the git repo:
https://github.com/mibodhi/u-boot-kirkwood/blob/2017.07-kirkwood-tld-1/configs/lschlv2_defconfig
https://github.com/mibodhi/u-boot-kirkwood/blob/2017.07-kirkwood-tld-1/configs/lsxhl_defconfig
and here the README:
https://github.com/mibodhi/u-boot-kirkwood/blob/697f50bf18e71406db8fa9b4bf08344ae6640146/board/buffalo/lsxl/README
though I did not compile the u-boot.kwb file yet - I still would not know if I could flash it - since
the size of the u-boot part itself seems smaller then in this thread
all mtd parts together would have sufficient size - but I do not know how to handle the 3 different parts of mtd0-mtd2

Any help is welcome. I can provide more Information when needed.



Edited 1 time(s). Last edit at 05/15/2019 12:57PM by bodhi.
Re: U-Boot for Buffalo Linkstations
May 15, 2019 01:14PM
Markus,

Here is why I believe that basically it should be possible: 
configs in the git repo: 
https://github.com/mibodhi/u-boot-kirkwood/blob/2017.07-kirkwood-tld-1/configs/lschlv2_defconfig 
https://github.com/mibodhi/u-boot-kirkwood/blob/2017.07-kirkwood-tld-1/configs/lsxhl_defconfig

This SPI flash is quite small, but perhaps the mainline u-boot is also small enough.
[   10.973529] m25p80 spi0.0: m25p40 (512 Kbytes)

Let me look at the source code when I have a chance, and answer other questions.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: U-Boot for Buffalo Linkstations
May 16, 2019 02:38AM
Markus,

My thoughts:

1. Debian-4.12.1-kirkwood-tld-1-rootfs-bodhi.tar.bz2 should work with these 2 boxes.

2. Mainline U-boot-2017.07 should give you what you want (works with > 2TB HDD)

3. The SPI mtds can be redefined to 1 512K mtd that is enough space for u-boot and its envs.

4. You need serial console to start working on booting Debian and/or u-boot.

5. You need to test new u-boot using kwboot through serial console before flashing.

=======

However, sorry I don't think I have time to guide you building u-boot and flashing. Actually, I have a policy that I will not do that because the time it'd take away from helping users in the this forum. Unless, you already know how to do that and then ask me questions that I can help get you through the hurdles.


1. I could build it myself and let you test it with kwboot. And this will be a slow process.

2. You could boot the Debian rootfs with stock u-boot. Does this limit you to smaller HDD <= 2TB?

-bodhi
===========================
Forum Wiki
bodhi's corner
Markus Fuger
Re: U-Boot for Buffalo Linkstations
May 16, 2019 03:21AM
Thanks for your quick replies!

@2TB: at the moment I am using 2TB drives but thought to upgrade soon - but I could stick with those for some time anyway

@serial console: I will look of how easy/difficult it is to add it to the boards - since I have limited time too, this might take some time anyways.

@build: If there is no special trick/patch to apply to your git repo to build the kwb files for the Linkstation, I could do that myself easily

@help and flash: If I have achieved all the steps before I will come back to you here, since I have no experience in "redefining the SPI to 1 mtd" - I guess the other steps will be similar as the original instruction - apart from the addresses. That's what I would like to double-check with you.

For the moment - Thanks for all your work here!
Markus
Re: U-Boot for Buffalo Linkstations
May 16, 2019 03:36AM
Markus,

> @2TB: at the moment I am using 2TB drives but
> thought to upgrade soon - but I could stick with
> those for some time anyway

Mianline u-boot 2017.07 for these 2 boxes can take care of that. It is already configured to accept GPT partition.

>
> @serial console: I will look of how easy/difficult
> it is to add it to the boards - since I have
> limited time too, this might take some time
> anyways.

Look at the Wiki thread . Especially the bold one.

Quote

Serial Console & JTAG console

Repair Pogo E02 with Raspberry PI (JTAG) and OpenOCD
Serial Port connector - what are people using to make it work
Serial Console hookup - GoFlex Net (external link)
Serial Console hookup - Pogoplug E02 and Pogoplug Pro V3 (external link)
OSX Serial/Net Console
Use Phone Jack - Phone Jack Serial Console Pics
Adding serial connector to Pogoplug Mobile (external link)
WD Mycloud EX2100/4100 Serial Console pic1, also pic2, pic3
Dreamplug Serial Console
How to unbrick your box using serial console with kwboot
kwboot on Mac OSX 10
Unbrick a Pogoplug Pro v3 OXNAS by flashing u-boot in serial console

>
> @build: If there is no special trick/patch to
> apply to your git repo to build the kwb files for
> the Linkstation, I could do that myself easily

Nope. Build straight from mainline. No special patch needed.

>
> @help and flash: If I have achieved all the steps
> before I will come back to you here, since I have
> no experience in "redefining the SPI to 1 mtd" - I
> guess the other steps will be similar as the
> original instruction - apart from the addresses.
> That's what I would like to double-check with
> you.
>

"redefining the SPI to 1 mtd" is quite easy. Once you got it going and ready. I'll show you how to do that.

====

Using serial console and kwboot the new u-boot.kwb is most important task to do.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: U-Boot for Buffalo Linkstations
May 17, 2019 10:24AM
Some notes:

Debian does have an installer updated for Buster RC1 which would get you a more modern kernel:
http://ftp.debian.org/debian/dists/testing/main/installer-armel/current/images/kirkwood/network-console/buffalo/

By the time Buffalo started using Kirkwood SoCs they also began disconnecting the serial headers on most of their devices. There are some old instructions for enabling it (via solme soldering) for one of your devices though I'm not sure if that would give you Rx/Tx or just Tx:
https://web.archive.org/web/20160829014742/http://buffalo.nas-central.org/wiki/Serial_and_JTAG_port_LS-XHL

Buffalo has largely stopped posting their customized uboot source, instead re-posting unmodified copies from the uboot project or nothing at all. Fortunately this device is from back when they did post their uboot source:
https://opensource.buffalo.jp/ls-x-165.html

I've not worked with either of these specific models but most of the Buffalo Kirkwood devices I've worked with handled >2tb drives just fine. What issues have you run into trying to set up larger drives? If that particular uboot won't load GPT partitions you might still be able to make it work by using a hybrid MBR:
https://www.rodsbooks.com/gdisk/hybrid.html

I would think even if the device didn't want to boot off your GPT partitions or even didn't recognize sectors beyond 2TB in most cases you'd be able to get Debian Running using a smaller MBR and then experiment with writing to the rest of the Disk from within Debian and figure out whether there are any sata chipset issues (i really doubt it) or if it's just a matter of getting the partition table sorted out to be bootable.

I've never tried re-flashing uboot on any of these devices but that's mostly because I've had a lot of success getting them working without resorting to that.
Re: U-Boot for Buffalo Linkstations
May 17, 2019 05:23PM
What 1000001101000 described is certainly a good approach, if there is no new u-boot, or no other way to make it a simple set up.

====

Using stock u-boot to load kernel files from HDD (if the necessary commands are available).

This should allow GPT partition table on the disk (it does not really come in to play). Once the kernel is running, it will recognize GPT.

See option 2 in this post here:
https://forum.doozan.com/read.php?2,76314,84339#msg-84339

So you just partition the disk in a way that allow you to store kernel files in raw sector. And the rootfs Debian-4.12.1-kirkwood-tld-1-rootfs-bodhi.tar.bz2 can be on a GPT partition.

-bodhi
===========================
Forum Wiki
bodhi's corner



Edited 1 time(s). Last edit at 05/17/2019 05:35PM by bodhi.
Re: U-Boot for Buffalo Linkstations
May 17, 2019 06:01PM
if you really want to avoid a separate /boot partition you could probably setup your rootfs on the first partition and then symlink uImage.buffalo and initrd.buffalo to /.

the relevant uboot command is usually something similar to "ext2load ide 0:1 0x1200000 /uImage.buffalo" which only cares that the expected file is in the root of the first partition. I mean, you could also alter the boot commands however you wanted but that would make it impossible to go back to the stick firmware in the future.... or make the device impossible to boot without a serial console if you messed something up. I haven't dug too far into that path on the linkstations. The main reason for that is that this version of ext2load only supports ext2/3 and prefer to have my rootfs as ext4, it also makes it easier to switch back and forth between distros for some of my testing.

One thing I have discovered playing around with these devices is that ext2load on these older uboot versions does not seem to like large filesystems, if your goal is to make one big 2tb partition it probably won't boot successfully. I haven't really experimented to find out what that limit is, I just know 1gb works and is more than enough for /boot.
Markus Fuger
Re: U-Boot for Buffalo Linkstations
June 01, 2019 11:25AM
Hello everyone,

thanks for all of your the input! I knew the nas-central page before, but since my soldering skills are a bit limited, I liked to avoid that step in the beginning.

@2TB: ex explained before - for now I do not have any restrictions, cause the HDDs I am using at the moment are that size. But I like to perhaps update soon - if everything is set up as expected. I could then try to follow the given instructions.

The reason why I liked to have the USB-boot is, that those NAS will be kind of a "cold" storage and only for regular (but not too frequent) backup from another NAS. Therefore I liked to spin-down the hard-disks whenever not in use, but still have the Buffalo Linkstation available. I just believe that due to logs and other things the hard-disk won't hold as often as it could.

My first try therefore has been (before soldering) to create an USB-flash drive with the same partition as the hard-disk (changing from UIDs to disk-labels of course and removing the files from the hard-disk). This approach did not work - it could not boot from USB. I added those settings to the uboot envs before.

fw_setenv bootorder ide usb tftp
fw_setenv bootargs_root_usb 'root=/dev/sdb1 rw initrd=0x00800040,12M panic=5'
fw_setenv bootcommon_usb 'setenv bootargs $console $bootargs_root_usb $bootargs_func $buffalo_ver $mtdparts $tftpboot $nandboot; bootm 0x00100000 0x00800000'
fw_setenv usbbootcmd 'usb start; ext2load usb 0:1 0x00100000 /$kernel; ext2load usb 0:1 0x00800000 /$initrd; run bootcommon_usb'

load_initrd=ext2load usb 0:1 0x1100000 /boot/uInitrd
load_uimage=ext2load usb 0:1 0x800000 /boot/uImage
PS: I used the same offsets from the working ide boot since I too used the same uImage.buffalo and initrd.buffalo


Another step - I did not try yet (but early next week) is, to keep uImage.buffalo and initrd.buffalo on the first partition of the hard-disk and the rootfs onto the USB-perhaps I am more successful this way. Since I believe that the kernel will anyway be in memory - there should not be any further hard-disk access from the system.

I then really soldered the pins onto my LS-CHLv2 and this is the output:
Addresses 8M - 0M are saved for the U-Boot usage.
Mem malloc Initialization (8M - 7M): Done
[512kB@f8000000] Flash: 512 kB

CPU : Marvell Feroceon (Rev 1)

Streaming disabled
Write allocate disabled

Module 1 is RGMII

USB 0: host mode
MacicKey = 0x00
buffalo_IsStopAtUbootStatus > MagicKey = 0x00
bfSetMagicKey > Changed to 0x5c from 0x00
HDD0 Power ON

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

MAC Address : 00:1D:73:A4:A5:EF
MAC Address read from block device 0 :

4017568 bytes read
Booting from Device 0
Net:   egiga0, egiga1
hit any key to switch tftp boot.
Hit any key to stop autoboot:  0
Hit any key to stop autoboot:  0
BUFFALO


I too ran some commands in the uboot menu:
BUFFALO>> help
?       - alias for 'help'
barled - control bar led (LS-AVL)
base    - print or set address offset
boot    - boot default, i.e., run 'bootcmd'
bootd   - boot default, i.e., run 'bootcmd'
bootext2    dev:boot_part1,boot_part2 addr boot_image linux_dev_name
bootm   - boot application image from memory
bootp   - boot image via network using BootP/TFTP protocol
bubt    - Burn an image on the Boot Flash.
chpart  - change active partition
cmp     - memory compare
cmpm    - Compare Memory
cp      - memory copy
cpumap - Display CPU memory mapping settings.
crc32   - checksum calculation
date    - get/set/reset date & time
dclk    - Display the MV device CLKs.
diskboot- boot from IDE device
echo    - echo args to console
erase   - erase FLASH memory
exit    - exit script
ext2load- load binary file from a Ext2 filesystem
ext2ls  - list files in a directory (default /)
fatinfo - print information about filesystem
fatload - load binary file from a dos filesystem
fatls   - list files in a directory (default /)
fi      - Find value in the memory.
flinfo  - print FLASH memory information
fsinfo  - print information about filesystems
fsload  - load binary file from a filesystem image
g       - start application at cached address 'addr'(default addr 0x40000)
go      - start application at address 'addr'
help    - print online help
ide     - IDE sub-system
iminfo  - print header information for application image
ir      - reading and changing MV internal register values.
ledbc - change the led's brightness control. (LS-AVL)
loop    - infinite loop on address range
ls      - list files in a directory (default /)
map     - Diasplay address decode windows
md      - memory display
mm      - memory modify (auto-incrementing)
mmcinit - init mmc card
mtdparts- define flash/nand partitions
mtest   - simple RAM test
mw      - memory write (fill)
nm      - memory modify (constant address)
phyRead - Read PCI-E Phy register
pciePhyWrite    - Write PCI-E Phy register
phyRead - Read Phy register
phyWrite        - Write Phy register
phy_ident - print phy identping - send ICMP ECHO_REQUEST to network host
printenv- print environment variables
protect - enable or disable FLASH write protection
rarpboot- boot image via network using RARP/TFTP protocol
rcvr    - Satrt recovery process (Distress Beacon with TFTP server)
reset   - Perform RESET of the CPU
resetenv        - Return all environment variable to default.
run     - run commands in an environment variable
saveenv - save environment variables to persistent storage
setenv  - set environment variables
sflash  - read, write or erase the external SPI Flash.
sg      - scanning the PHYs status
sw_reg  - change/read the SW's register value. (LS-AVL)
switchRegRead   - Read switch register
switchRegWrite  - Write switch register
test    - minimal test like /bin/sh
tftpboot- boot image via network using TFTP protocol
usb     - USB sub-system
usbboot - boot from USB device
version - print monitor version

BUFFALO>> printenv
baudrate=115200
loads_echo=0
ipaddr=192.168.11.150
serverip=192.168.11.1
rootpath=/mnt/ARM_FS/
netmask=255.255.255.0
eth1addr=00:1D:73:A4:A5:EF
console=console=ttyS0,115200
CASset=min
MALLOC_len=1
bootargs_root=root=/dev/sda2 rw initrd=0x00800040,12M panic=5
bootargs_end=:::DB88FXX81:eth0:none
image_name=uImage
ethaddr=00:50:43:46:2c:2a
ethmtu=1500
eth1mtu=1500
mvNetConfig=mv_net_config=(00:11:88:0f:62:81,0:1:2:3),mtu=1500
usb0Mode=host
netretry=no
rcvrip=169.254.100.100
loadaddr=0x02000000
autoload=no
stdin=serial
stdout=serial
stderr=serial
mainlineLinux=no
enaMonExt=no
enaCpuStream=no
enaWrAllo=no
pexMode=RC
disL2Cache=no
setL2CacheWT=yes
disL2Prefetch=yes
enaICPref=yes
enaDCPref=yes
sata_dma_mode=yes
buffalo_ver=BOOTVER=0.22
kernel=uImage.buffalo
initrd=initrd.buffalo
bootcommon=setenv bootargs $console $bootargs_root $bootargs_func $buffalo_ver $mtdparts $tftpboot $nandboot; bootm 0x00100000 0x00800000
tftpbootcmd=tftp 0x00100000 $kernel; tftp 0x00800000 $initrd; setenv tftpboot tftpboot=yes; run bootcommon
bootorder=ide
bootcmd=for i in $bootorder; do run ${i}bootcmd; done
bootdelay=3
disaMvPnp=no
enaAutoRecovery=yes
pcieTune=no
filesize=3D4DA0
idebootcmd=ext2load ide 0:1 0x00800000 /initrd.buffalo; ext2load ide 0:1 0x00100000 /uImage.buffalo; setenv bootargs $console $bootargs_root $bootargs_func $buffalo_ver $mtdparts $tftpboot $nandboot; bootm 0x00100000 0x00800000
ethact=egiga0

Environment size: 1411/65532 bytes

even with a USB-Flash drive (2GB) with a single ext2 GPT partition it says no storage device found - I guess that's too the reason why I could not boot from the flash drive as I tried before
BUFFALO>> usb start
(Re)start USB...
USB:   scanning bus for devices... 1 USB Device(s) found
Waiting for storage device(s) to settle before scanning...
0 Storage Device(s) found

BUFFALO>> usbboot

** No boot device **

BUFFALO>> usb info 0
config for device 0
*** NO Device avaiable ***

BUFFALO>> usb info 1
config for device 1
1: Hub,  USB Revision 2.0
 - Marvell EHCI
 - Class: Hub
 - PacketSize: 64  Configurations: 1
 - Vendor: 0x0000  Product 0x0000 Version 1.0
   Configuration: 1
   - Interfaces: 1 Self Powered 0mA
     Interface: 0
     - Alternate Settings 0, Endpoints: 1
     - Class Hub
     - Endpoint 1 In Interrupt MaxPacket 8 Interval 255ms

BUFFALO>> flinfo

Bank # 1:
Flash Base Address  : 0xf8000000
Flash Model         : ST M25P40
Manufacturer ID     : 0x20
Device Id           : 0x2013
Sector Size         : 64K
Number of sectors   : 8
Page Size           : 256
Write Protection    : Off

BUFFALO>> map

CPU Interface
-------------
SDRAM_CS0 ....base 00000000, size  64MB
SDRAM_CS1 ....disable
SDRAM_CS2 ....disable
SDRAM_CS3 ....disable
PEX0_MEM ....base 90000000, size 256MB
PEX0_IO ....base f0000000, size  16MB
INTER_REGS ....base f1000000, size   1MB
NFLASH_CS ....base f9000000, size   8MB
SPI_CS ....base f8000000, size  16MB
BOOT_ROM_CS ....base fff80000, size 512KB
DEV_BOOTCS ....base fff80000, size 512KB
CRYPT_ENG ....base fb000000, size  64KB

AHB To MBUS Bridge:
-------------------
win0 - PEX0_MEM base 90000000, ....size 256MB
win1 - NFLASH_CS base f9000000, ....size   8MB
win2 - PEX0_IO base f0000000, ....size  16MB
win3 - SPI_CS base f8000000, ....size  16MB
win4 - BOOT_ROM_CS base fff80000, ....size 512KB
win5 - disable
win6 - disable
win7 - CRYPT_ENG base fb000000, ....size  64KB
win8 - INTER_REGS base f1000000, ....size   1MB

PEX0:
-----

Pex Bars

Internal Regs Bar0.... base d0000000, size   1MB
DRAM Bar1............. base 00000000, size   1GB
Devices Bar2.......... base f0000000, size 256MB

Pex Decode Windows

win0 - SDRAM_CS0 base 00000000, ....size 256MB
win1 - SDRAM_CS1 base 10000000, ....size 256MB
win2 - SDRAM_CS2 base 20000000, ....size 256MB
win3 - SDRAM_CS3 base 30000000, ....size 256MB
win4 - target unknown base f0000000, ....size 128MB
win5 - NFLASH_CS base f8000000, ....size 128MB
default win - target unknown
Expansion ROM - NFLASH_CS

USB:
----
Device 0:
win0 - SDRAM_CS0 base 00000000, size  64MB
win1 - PEX0_MEM base 90000000, size 256MB
win2 - disable
win3 - disable

ETH 0:
----
win0 - SDRAM_CS0 base 00000000, ....size  64MB
win1 - NFLASH_CS base f9000000, ....size   8MB
win2 - SPI_CS base f8000000, ....size  16MB
win3 - BOOT_ROM_CS base fff80000, ....size 512KB
win4 - disable
win5 - disable

ETH 1:
----
win0 - SDRAM_CS0 base 00000000, ....size  64MB
win1 - NFLASH_CS base f9000000, ....size   8MB
win2 - SPI_CS base f8000000, ....size  16MB
win3 - BOOT_ROM_CS base fff80000, ....size 512KB
win4 - disable
win5 - disable

XOR 0:
----
win0 - NFLASH_CS base f9000000, size   8MB
win1 - PEX0_MEM base 90000000, size 256MB
win2 - SDRAM_CS0 base 0, size  64MB
win3 - SPI_CS base f8000000, size  16MB
win4 - CRYPT_ENG base fb000000, size  64KB
win5 - disable
win6 - disable
win7 - disable

XOR 1:
----
win0 - NFLASH_CS base f9000000, size   8MB
win1 - PEX0_MEM base 90000000, size 256MB
win2 - SDRAM_CS0 base 0, size  64MB
win3 - SPI_CS base f8000000, size  16MB
win4 - CRYPT_ENG base fb000000, size  64KB
win5 - disable
win6 - disable
win7 - disable

SATA 0:
----
win0 - SDRAM_CS0 base 00000000, ....size  64MB
win1 - PEX0_MEM base 90000000, ....size 256MB
win2 - disable
win3 - disable

SATA 1:
----
win0 - SDRAM_CS0 base 00000000, ....size  64MB
win1 - PEX0_MEM base 90000000, ....size 256MB
win2 - disable
win3 - disable

If any further information is needed - I would be happy to provide those.
Unfortunately I tried the same with the LS-XHL - but somehow it seems I messed up the soldering job - cause I can't get any output.

Perhaps someone could give me some steps to try the new u-boot at least on the LS-CHLv2 - where the UART-soldering worked.
Re: U-Boot for Buffalo Linkstations
June 01, 2019 01:04PM
I’ve done similar things with some of the newer linkstation/terastation devices with a built in usb boot option, it’s nice having all 4 drive bays available for running hdd diagnostics when booting from usb.

One non-uboot solution for your use case would be to keep /boot on your hard drive and keep your rootfs on the usb. That would allow you spin the drive down as you describe since you’ll only need /boot at boot or when updating the kernel. I do something similar on a pc that can’t boot from nvme

Otherwise other folks on this forum can help with trying to replace uboot.

There’s a blog out there where someone did this with some device that are older and newer than yours:
https://sites.google.com/site/shihsung/home
Re: U-Boot for Buffalo Linkstations
June 01, 2019 05:10PM
Markus,

> The reason why I liked to have the USB-boot is,
> that those NAS will be kind of a "cold" storage
> and only for regular (but not too frequent) backup
> from another NAS. Therefore I liked to spin-down
> the hard-disks whenever not in use, but still have
> the Buffalo Linkstation available. I just believe
> that due to logs and other things the hard-disk
> won't hold as often as it could.

USB rootfs is how I set up most of my NAS.

The way you set up the USB booting envs is little bit problematic (hard to debug, and I suspect that in current form it will not do what you want). You should separate the USB boot from the tftp boot in different commands.

fw_setenv bootcommon_usb 'setenv bootargs $console $bootargs_root_usb $mtdparts; bootm 0x00100000 0x00800000'
fw_setenv usb_bootcmd 'usb start; ext2load usb 0:1 0x00100000 /$kernel; ext2load usb 0:1 0x00800000 /$initrd; run bootcommon_usb'
and then do the same for tftp
fw_setenv bootcommon_tftp   xxxxxxxx
fw_setenv tftp_bootcmd         xxxxxxxxx

and set up bootcmd in serial console to test first before setting it permanently later in Debian:

setenv bootcmd 'run usb_bootcmd; run tftp_bootcmd'

> even with a USB-Flash drive (2GB) with a single
> ext2 GPT partition it says no storage device found
> - I guess that's too the reason why I could not
> boot from the flash drive as I tried before

Don't use GPT partition during testing. Because stock u-boot might not recognize it.

> 0 Storage Device(s) found

When you see the above message, it could be either:

1. The USB power is not enabled.
2. stock u-boot does not recognize GPT

Number 1 is apparently the case here. You can ony see the USB hub here, but there is no drive.

Quote

BUFFALO>> usb start
(Re)start USB...
USB: scanning bus for devices... 1 USB Device(s) found
Waiting for storage device(s) to settle before scanning...
0 Storage Device(s) found

BUFFALO>> usbboot

** No boot device **

BUFFALO>> usb info 0
config for device 0
*** NO Device avaiable ***

BUFFALO>> usb info 1
config for device 1
1: Hub, USB Revision 2.0
- Marvell EHCI
- Class: Hub
- PacketSize: 64 Configurations: 1
- Vendor: 0x0000 Product 0x0000 Version 1.0
Configuration: 1
- Interfaces: 1 Self Powered 0mA
Interface: 0
- Alternate Settings 0, Endpoints: 1
- Class Hub
- Endpoint 1 In Interrupt MaxPacket 8 Interval 255ms

Manufacturer sometime disabled USB or HDD on purpose. They want us to boot with kernel in flash to make it more resilient. And then the kernel will mount the rootfs, which could be in flash or disk drive.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: U-Boot for Buffalo Linkstations
June 01, 2019 05:13PM
So you will need to find the "poke" command that in u-boot you can turn on the USB power.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: U-Boot for Buffalo Linkstations
June 01, 2019 05:19PM
Let me upload the binary for you to try kwboot.

You will need GPL source to looking for USB power GPIO. Or try brute force each one in Debian

-bodhi
===========================
Forum Wiki
bodhi's corner



Edited 1 time(s). Last edit at 06/01/2019 05:20PM by bodhi.
Re: U-Boot for Buffalo Linkstations
June 01, 2019 05:25PM
On the Linux box that you have serial console connected to the lsxhl. The kwboot version in you current Linux box should be good enough to use.

Run kwboot this way:

kwboot -t -B 115200 /dev/ttyUSB0 -b u-booot.2017.07-tld-1.lsxhl.mtd0.kwb -p
And then power up the Buffalo box.

See if it will be loaded and executed. If it does, interrupt count down and

printenv

And please post the log here.

-bodhi
===========================
Forum Wiki
bodhi's corner



Edited 3 time(s). Last edit at 06/01/2019 05:35PM by bodhi.
Attachments:
open | download - u-booot.2017.07-tld-1.lsxhl.mtd0.kwb (320 KB)
Re: U-Boot for Buffalo Linkstations
June 01, 2019 11:04PM
The mainline device tree for the device lists mpp11 for usb power
Re: U-Boot for Buffalo Linkstations
June 02, 2019 12:47AM
@1000001101000,

> The mainline device tree for the device lists
> mpp11 for usb power

That's made it easier to have a stock u-boot solution!

@Markus

I've looked at this box current mtds definition vs mainline. You can keep it the same, no need to redefine it with the mainline u-boot. Look like it is a drop-in replacement.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: U-Boot for Buffalo Linkstations
June 02, 2019 01:28AM
These devices are back from the days that Buffalo posted their modified u-boot/kernel source code too:
https://opensource.buffalo.jp/ls-x-165.html
Markus Fuger
Re: U-Boot for Buffalo Linkstations
June 04, 2019 03:10AM
Hello bodhi and 1000001101000,

you two guys are great! Thanks for all your efforts and fast responses! Unfortunately I messed up my Linux-machine so it will take me some days to try all the suggested things. Furthermore I am by far not as experienced with the deep insides of Linux booting and u-boot - so I like to be sure what I am doing, before messing ob something.

@lsxhl.mtd0.kwb: As I have written I managed to get the UART connection for the LS-CHLv2 (but not the LS-XHL) - the hardware difference between these two machines is a slightly faster CPU (600 MHz vs 1200 MHz) and more memory (64MB vs 256MB) for the XHL:
https://web.archive.org/web/20160818111418/http://buffalo.nas-central.org/wiki/Category:LS-CHLv2 (this mentions some 128 MB ROM too - but I am not sure if even any stock firmware made use of it)
https://web.archive.org/web/20160818083412/http://buffalo.nas-central.org/wiki/Category:LS-XHL

So here is my question: can I still use the lsxhl.mtd0.kwb for trying with the LS-CHLv2 (where I have the UART connection). If not would it be possible to send me the lschlv2 version of the kwb file too?

Thanks a lot in advance!
Markus Fuger
Re: U-Boot for Buffalo Linkstations
June 04, 2019 03:15AM
@GPT vs MBR: I used GPT throughout all my tests since it was mentioned on many places on the old nas-central pages as well as here:
https://miniconf.debian.or.jp/assets/files/Debian%20Installer%20for%20Buffalo%20Linkstation%20NAS.pdf (page 9/19)
It too worked if I used GPT on the hard disk - that's why my intention has been not to change too many variables and therefore used GPT on the USB-flash drive too.
Re: U-Boot for Buffalo Linkstations
June 04, 2019 03:21PM
Markus,

Quote

So here is my question: can I still use the lsxhl.mtd0.kwb for trying with the LS-CHLv2 (where I have the UART connection). If not would it be possible to send me the lschlv2 version of the kwb file too?

It'll probably will work during booting. But not entirely appropriate for it when it comes to the point where u-boot hands off params data to kernel. So I'll upload the LS-CHLv2 image for you later today.

Quote

It too worked if I used GPT on the hard disk - that's why my intention has been not to change too many variables and therefore used GPT on the USB-flash drive too.]

Yes, that's valid approach, if this stock u-boot can read GPT. However, GPT or MBR is really transparent to u-boot after u-boot initializes the disk drive. There is no difference in the envs. So you can use either GPT or MBR.

Usually we use MBR on USB drives because it actually eliminates more unknowns in u-boot (it always works in all versions). Only if you think you might plug in a USB enclosure HDD that could be > 2TB, then GPT is a must have.

-bodhi
===========================
Forum Wiki
bodhi's corner



Edited 1 time(s). Last edit at 06/04/2019 07:15PM by bodhi.
Re: U-Boot for Buffalo Linkstations
June 04, 2019 07:12PM
Here is the lschlv2 u-boot image.

-bodhi
===========================
Forum Wiki
bodhi's corner
Attachments:
open | download - uboot.2017.07-tld-1.lschlv2.mtd0.kwb (320 KB)
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: