Terastation TS-XL

From Buffalo NAS Wiki
Revision as of 19:19, 22 January 2024 by I000001101000 (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Specs

Terastation TS-XL

CPU 800MHz Marvell MV78100
Memory 512MB
Bays 4
Network 2x 10/100/1000 Mbps
Sata 4x SATA II Marvell 88SX7042
NAND Flash 512MB
SPI Flash
USB 2.0 2x (Back)
Fan Yes
Power Internal AC 100-240V, universal 50/60Hz

Stock Firmware Installation

Install Firmware from NAND

If blank drives are inserted the device will boot from it's internal NAND and eventually go into EM mode. Once the device is in EM mode the firmware can be installed using tsupdater in debug mode, see Enable Debug mode for LSUpdater/TSUpdater.

Other Methods

This device is much less flexible about what partitions/filesystems it will attempt to boot from. I recommend installing from NAND so that the device will build appropriate partitions for you. It is possible to install via TFTP or loading files directly if desired.

Custom Firmware/Operating System installation

See Installing Debian on MV78100 Devices (TS-WXL, TS-XL,TS-RXL)

Device Notes

The serial port on the front of the device is connected to the console (UART0). Normally input is disabled but it can be enabled by sending the serialmode_console (0x0f) micon command (twice for some reason), see MiconV2 Interface. Once enabled it remains enabled across reboots until the device is powered off or the serialmode_ups (0x10) command.

# micro-evtd -s 000f,000f
0
0

# cat serial_console.py 
#!/usr/bin/python3

import libmicon

mcu = libmicon.micon_api("/dev/ttyS1",1)
mcu.send_write_cmd(0,0x0F)
mcu.send_write_cmd(0,0x0F)
mcu.port.close()
quit()

# ./serial_console.py 
Sending Preamble...
sending :  000ff1 	checksum:  0 	length:  0
response:  010f00f0 	checksum:  0 	length:  1 	response code: 0x0

sending :  000ff1 	checksum:  0 	length:  0
response:  010f00f0 	checksum:  0 	length:  1 	response code: 0x0


source: https://memo205.wordpress.com/tag/buffalo/

Caption text
Setting Value
Speed 115200
Bits 8
Parity N
Stop Bits 1
Flow Control off


Although it's possible to change uboot environment variables from within the stock firmware, changing the bootcmd does not seem to affect the boot process for some reason. I attempted to change the location that uboot loads the initrd image and confirmed the change persisted through a reboot but the console output shows that it still loads from the default address. see below for a workaround.


U-boot max file sizes

The stock U-boot will crash if you try to load a kernel image larger than (somewhere between 4-6MB, still looking for actual limit).

The stock U-boot loads the initrd after the kernel but earlier in memory. this means that if the initrd is larger than 23mb it will overlap the kernel. If you create an initrd uboot image with 23mb of padding at the beginning followed by a copy of the kernel (to re-write it in the proper location) you can then append a larger initrd image (provided you hardcode the new offset into your kernel's cmdline).

Partition table notes

The stock firmware partitions the disks using GPT partition tables. It writes the MAC address of eth0 to 0x28 of the beginning of the disk when formatting a disk, it then checks this at boot time to determine whether the disk is "owned" by this device. The boot loader does not seem to do anything differently if this doesn't match or is missing but I have not tested it extensively.

00000000  01 00 00 00 00 00 00 00  20 00 00 00 00 00 00 00  |........ .......|
00000010  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000020  00 00 00 00 00 00 00 00  30 30 3a 31 64 3a 37 33  |........00:1d:73|
00000030  3a 66 66 3a 34 66 3a 66  62 00 00 00 00 00 00 00  |:ff:4f:fb.......|
00000040  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|

boot partition requirements

The boot files are loaded using u-boot's ext2load function with hardcoded parameters. To boot successfully the boot partition must be:

  • the first partition on the disk
  • either a regular partition or part of a raid1 array using metadata version 0.9
  • formatted using the ext2 or ext3 filesystem
  • have an inode size of 128 bytes (newer distros have started using 256 as the default)
  • relatively small, 1GB is usually more than enough for /boot (I have not yet experimented to determine the max allowable size)

The filesystem can be created with:

mkfs.ext3 -I 128 /dev/sdx1

Pictures

lspci output

00:00.0 Host bridge: Marvell Technology Group Ltd. MV78100 [Discovery Innovation] ARM SoC (rev 01)
	Subsystem: Marvell Technology Group Ltd. MV78100 [Discovery Innovation] ARM SoC
	Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr+ Stepping- SERR+ FastB2B- DisINTx+
	Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
	Latency: 0, Cache Line Size: 32 bytes
	Interrupt: pin A routed to IRQ 0
	Capabilities: [40] Power Management version 2
		Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
		Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
	Capabilities: [50] MSI: Enable- Count=1/1 Maskable- 64bit+
		Address: 0000000000000000  Data: 0000
	Capabilities: [60] Express (v1) Root Port (Slot-), MSI 00
		DevCap:	MaxPayload 128 bytes, PhantFunc 0
			ExtTag- RBE+
		DevCtl:	CorrErr- NonFatalErr- FatalErr- UnsupReq-
			RlxdOrd- ExtTag- PhantFunc- AuxPwr- NoSnoop-
			MaxPayload 128 bytes, MaxReadReq 512 bytes
		DevSta:	CorrErr- NonFatalErr- FatalErr- UnsupReq- AuxPwr- TransPend-
		LnkCap:	Port #0, Speed 2.5GT/s, Width x4, ASPM L0s L1, Exit Latency L0s <256ns, L1 unlimited
			ClockPM+ Surprise- LLActRep- BwNot- ASPMOptComp-
		LnkCtl:	ASPM Disabled; RCB 128 bytes, Disabled- CommClk-
			ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
		LnkSta:	Speed 2.5GT/s, Width x4
			TrErr- Train- SlotClk+ DLActive- BWMgmt- ABWMgmt-
		RootCap: CRSVisible-
		RootCtl: ErrCorrectable- ErrNon-Fatal- ErrFatal- PMEIntEna- CRSVisible-
		RootSta: PME ReqID 0000, PMEStatus- PMEPending-
	Capabilities: [100 v1] Advanced Error Reporting
		UESta:	DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
		UEMsk:	DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
		UESvrt:	DLP+ SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF+ MalfTLP+ ECRC- UnsupReq- ACSViol-
		CESta:	RxErr- BadTLP- BadDLLP- Rollover- Timeout- AdvNonFatalErr-
		CEMsk:	RxErr- BadTLP- BadDLLP- Rollover- Timeout- AdvNonFatalErr+
		AERCap:	First Error Pointer: 00, ECRCGenCap- ECRCGenEn- ECRCChkCap- ECRCChkEn-
			MultHdrRecCap- MultHdrRecEn- TLPPfxPres- HdrLogCap-
		HeaderLog: 4a000001 00080004 00000024 78103601
		RootCmd: CERptEn- NFERptEn- FERptEn-
		RootSta: CERcvd- MultCERcvd- UERcvd- MultUERcvd-
			 FirstFatal- NonFatalMsg- FatalMsg- IntMsg 0
		ErrorSrc: ERR_COR: 0000 ERR_FATAL/NONFATAL: 0000

00:01.0 SCSI storage controller: Marvell Technology Group Ltd. 88SX7042 PCI-e 4-port SATA-II (rev 02)
	Subsystem: Marvell Technology Group Ltd. 88SX7042 PCI-e 4-port SATA-II
	Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr+ Stepping- SERR+ FastB2B- DisINTx-
	Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
	Latency: 0, Cache Line Size: 32 bytes
	Interrupt: pin A routed to IRQ 32
	Region 0: Memory at c0000000 (64-bit, non-prefetchable) [size=1M]
	Region 2: I/O ports at 1000 [size=256]
	Capabilities: [40] Power Management version 2
		Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
		Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
	Capabilities: [50] MSI: Enable- Count=1/1 Maskable- 64bit+
		Address: 0000000000000000  Data: 0000
	Capabilities: [60] Express (v1) Legacy Endpoint, MSI 00
		DevCap:	MaxPayload 256 bytes, PhantFunc 0, Latency L0s <256ns, L1 <1us
			ExtTag- AttnBtn- AttnInd- PwrInd- RBE- FLReset-
		DevCtl:	CorrErr- NonFatalErr- FatalErr- UnsupReq-
			RlxdOrd- ExtTag- PhantFunc- AuxPwr- NoSnoop-
			MaxPayload 128 bytes, MaxReadReq 512 bytes
		DevSta:	CorrErr- NonFatalErr- FatalErr- UnsupReq- AuxPwr- TransPend-
		LnkCap:	Port #0, Speed 2.5GT/s, Width x4, ASPM L0s, Exit Latency L0s <256ns
			ClockPM- Surprise- LLActRep- BwNot- ASPMOptComp-
		LnkCtl:	ASPM Disabled; RCB 128 bytes, Disabled- CommClk-
			ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
		LnkSta:	Speed 2.5GT/s, Width x4
			TrErr- Train- SlotClk+ DLActive- BWMgmt- ABWMgmt-
	Capabilities: [100 v1] Advanced Error Reporting
		UESta:	DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
		UEMsk:	DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
		UESvrt:	DLP+ SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF+ MalfTLP+ ECRC- UnsupReq- ACSViol-
		CESta:	RxErr- BadTLP- BadDLLP- Rollover- Timeout- AdvNonFatalErr-
		CEMsk:	RxErr- BadTLP- BadDLLP- Rollover- Timeout- AdvNonFatalErr-
		AERCap:	First Error Pointer: 00, ECRCGenCap- ECRCGenEn- ECRCChkCap- ECRCChkEn-
			MultHdrRecCap- MultHdrRecEn- TLPPfxPres- HdrLogCap-
		HeaderLog: 00000000 00000000 00000000 00000000
	Kernel driver in use: sata_mv

lsusb output

/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=orion-ehci/1p, 480M
    ID 1d6b:0002 Linux Foundation 2.0 root hub
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=orion-ehci/1p, 480M
    ID 1d6b:0002 Linux Foundation 2.0 root hub

U-Boot output

CPU =  MV78

Checking DATA BUS OK!
Checking ADDRESS BUS OK!

Checking DATA BUS
Checking ADDRESS BUS
BUFFALO U-BOOT Start !!! 
 ** LOADER **
 ** BUFFALO BOARD: DB-MV78100-A-BP LE (CFG_ENV_ADDR=fff80000)


U-Boot 1.1.4 (Sep 29 2014 - 16:22:36) Marvell version: 3.3.5
Buffalo Version: 2.11-1.02

U-Boot code: 00600000 -> 0066FFF0  BSS: -> 00684D30

Soc: MV78100 A0 (DDR2)
CPU running @ 800Mhz L2 running @ 266Mhz
SysClock = 400Mhz , TClock = 166Mhz 

DRAM CAS Latency = 5 tRP = 6 tRAS = 18 tRCD=6
DRAM CS[0] base 0x00000000   size 512MB 
DRAM Total size 512MB  64bit width
[512kB@fff80000] Flash: 512 kB
Addresses 8M - 0M are saved for the U-Boot usage.
Mem malloc Initialization (8M - 7M): Done
NAND:512 MB

CPU 0: ARM926 (Rev 0)

Streaming enabled 
Write allocate disabled
FPU initialized to Run Fast Mode.
enaDCPref <NULL>
enaICPref <NULL>
setL2CacheWT no
setL2Size256K no
disL2Ecc no
disL2Prefetch yes
disL2Cache no
env finished


USB 0: host mode
USB 1: host mode
USB 2: host mode
PCI 0: PCI Express Root Complex Interface
PEX interface detected Link X4
PEX 4: interface detected no Link.
Net:   egiga0 [PRIME], egiga1
buffalo_change_power_status > Read 0x5c(swpoff_uboot_passed)
buffalo_change_power_status > Writing 0x5c(swpoff_uboot_passed)

Marvell Serial ATA Adapter
Integrated Sata device found
Found adapter at bus 0, device 1 ... Scanning channels
[1 0 0]: Enable DMA mode
  Device 2 @ 1 0:
Model: SanDisk SSD U100 16GB                    Firm: 10.56.14 Ser#: 132059411324        
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 15272.0 MB = 14.9 GB (31277232 x 512)

MAC Address on eth0  : 00:1d:73:df:0e:3a

Signature version    : 268482810.12374158
Signature MACAddress : �����u�����

   This is not my HDD!!!
   Anyway load images...

4114176 bytes read
   Image Name:   kernel 6.1.27
   Created:      2023-06-13  19:45:13 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    4114112 Bytes =  3.9 MB
   Load Address: 00008000
   Entry Point:  00008000

5423710 bytes read
   Image Name:   ramdisk 6.1.27
   Created:      2023-06-13  19:45:14 UTC
   Image Type:   ARM Linux RAMDisk Image (uncompressed)
   Data Size:    5423646 Bytes =  5.2 MB
   Load Address: 00000000
   Entry Point:  00000000


** Something is wrong, because of dev_desc->blksz is 0!!!
disk1 is not found!


** Something is wrong, because of dev_desc->blksz is 0!!!
disk2 is not found!


** Something is wrong, because of dev_desc->blksz is 0!!!
disk3 is not found!

 ***** Debug *****
diskinfo[0].IsMyDisk = 0
diskinfo[0].uImage_date = 1686685513
diskinfo[0].initrd_date = 1686685514
diskinfo[1].IsMyDisk = 0
diskinfo[1].uImage_date = 0
diskinfo[1].initrd_date = 0
diskinfo[2].IsMyDisk = 0
diskinfo[2].uImage_date = 0
diskinfo[2].initrd_date = 0
diskinfo[3].IsMyDisk = 0
diskinfo[3].uImage_date = 0
diskinfo[3].initrd_date = 0

All disks are don't have signature or not mine!
newest_fw_dev is updated to 2

Booting from Device 2 
hit any key to switch tftp boot.
Hit any key to stop autoboot:  0 
Hit any key to stop autoboot:  0 

4114176 bytes read

5423710 bytes read
<<stop_sound>>
## Booting image at 02000000 ...
   Image Name:   kernel 6.1.27
   Created:      2023-06-13  19:45:13 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    4114112 Bytes =  3.9 MB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
OK
call do_bootm_linux
## Loading Ramdisk Image at 00900000 ...
   Image Name:   ramdisk 6.1.27
   Created:      2023-06-13  19:45:14 UTC
   Image Type:   ARM Linux RAMDisk Image (uncompressed)
   Data Size:    5423646 Bytes =  5.2 MB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK

Starting kernel ...


DMESG output


U-Boot env

bootargs=console=ttyS0,115200 mtdparts=physmapped-flash.0:32m(root)
baudrate=115200
loads_echo=0
ipaddr=192.168.11.150
serverip=192.168.11.1
rootpath=/mnt/ARM_FS/
netmask=255.255.255.0
fw_image_base=0x0
fw_image_size=0x0
console=console=ttyS0,115200
CASset=min
MALLOC_len=1
ethprime=egiga0
bootargs_end=:::DB78xx0:eth0:none
standalone=fsload 0x2000000 $(image_name);setenv bootargs $(console) root=/dev/mtdblock0 rw ip=$(ipaddr):$(serverip)$(bootargs_end); bootm 0x2000000;
ethmtu=1500
eth1mtu=1500
ethact=egiga0
ethaddr=00:1D:73:E7:A5:67
eth1addr=00:1D:73:E7:A5:68
stdin=serial
stdout=serial
stderr=serial
mainlineLinux=no
enaMonExt=no
enaFlashBuf=yes
enaCpuStream=yes
enaWrAllo=no
enaFPU=yes
pexMode=RC
disL2Cache=no
setL2CacheWT=no
disL2Prefetch=yes
setL2Size256K=no
disL2Ecc=no
sata_dma_mode=yes
netbsd_en=no
vxworks_en=no
buffalo_ver=BOOTVER=2.11
buffalo_minor_ver=BOOT_MINOR_VER=1.02
build_time=16:22:33
initrd=initrd.buffalo
kernel=uImage.buffalo
bootargs_base=console=ttyS0,115200
bootargs_root=root=/dev/sda2 rw initrd=0x00900040,15M panic=5
def_tftp=tftp 0x02000000 $(kernel); tftp 0x00900000 $(initrd); setenv bootargs $(bootargs_base) $(bootargs_root) $(buffalo_ver) tftpboot=yes; bootm 0x02000000 0x00900000
bootdelay=3
disaMvPnp=no
usb0Mode=host
usb1Mode=host
usb2Mode=host
EnableNandBoot=1
bootcmd= ext2load ide 2:1 0x02000000 /$(kernel); ext2load ide 2:1 0x00900000 /$(initrd); setenv bootargs $(bootargs_base) $(bootargs_root) $(buffalo_ver); bootm 0x02000000 0x00900000

Buffalo Resources