Welcome! Log In Create A New Profile

Advanced

Debian on Synology RS816 (Armada 385)

Posted by zifxify 
Re: Debian on Synology RS816 (Armada 385)
June 04, 2020 01:43AM
bonk1990,

> Ah, I don't know if that matters but I have DS116.
> But steps will be the same i think.

If you did the USB installation OK, then this will be the same. I forgot what your boot log looks like, but I think it is the same stock u-boot for RS816 and DS116.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian on Synology RS816 (Armada 385)
December 12, 2020 02:50PM
bodhi Wrote:
-------------------------------------------------------
> bonk1990,
>
> > Yes. Will SSD be fine?
> > I have to restore original mtd first.
>
> Yes it would be OK. But don't start yet! let me
> take sometime to get oriented back to this box,
> and revise the instruction. And then you would
> start the installation with original mtds.

Hi, have you found time for this? It is important to me because I have no idea how to upgrade kernel since in section I 5b I had to flash kernel permanently to mtd2.
Re: Debian on Synology RS816 (Armada 385)
December 12, 2020 02:59PM
bonk1990,

I forgot about this! I think I accidentally closed a browser tab a while ago so lost track of this. I'll take a look.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian on Synology RS816 (Armada 385)
December 12, 2020 03:42PM
Great, thank you for your help.
RS816 Installation Instruction with HDD rootfs
December 13, 2020 03:31PM
Old HDD installation Instrrcution was removed to avoid confusion.

Please see the final HDD installation Instruction here:

https://forum.doozan.com/read.php?2,76314,113639#msg-113639

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



Edited 5 time(s). Last edit at 01/01/2021 08:34PM by bodhi.
Re: RS816 Installation Instruction with HDD rootfs
December 13, 2020 03:36PM
bonk1990,

Above is the installation instruction. You are the tester for this!

So the testing ground rules is: perform each step and if you see any error or abnormal behavior, stop and post before proceed to the next step. Don't try to replace any Step with something equivalence that you think it will work.

And please post the entire serial console log (and also the Steps performed while not in serial console). Please do this whenever you stop for question, or at the end of a successful installation.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian on Synology RS816 (Armada 385)
December 14, 2020 05:27PM
2.a. Zero out the first 50MiB of the HDD
root@debian:/dev# dd if=/dev/zero of=/dev/sdb bs=1MiB count=50
50+0 records in
50+0 records out
52428800 bytes (52 MB, 50 MiB) copied, 1.50373 s, 34.9 MB/s

2.b. Create a single partition that starts at 50MiB using fdisk.
Command (m for help): n
Partition type
   p   primary (0 primary, 0 extended, 4 free)
   e   extended (container for logical partitions)
Select (default p): p
Partition number (1-4, default 1):
First sector (2048-62533295, default 2048): 51200
Last sector, +/-sectors or +/-size{K,M,G,T,P} (51200-62533295, default 62533295):

Created a new partition 1 of type 'Linux' and of size 29.8 GiB.

Command (m for help): w
The partition table has been altered.
Calling ioctl() [  241.465085][ T3057]  sdb: sdb1
to re-read partition table.
Syncing disks.

Format this partition with ext3 (or ext4), and label it rootfs.
root@debian:~# mkfs.ext3 -L rootfs /dev/sdb1
mke2fs 1.44.5 (15-Dec-2018)
Discarding device blocks: done
Creating filesystem with 7810262 4k blocks and 1954064 inodes
Filesystem UUID: 4b90cabe-42ad-4361-92ea-d99cac38310b
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
        4096000

Allocating group tables: done
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

3.b. Install the rootfs on this partition
root@debian:/media/sdb1# tar -xjf /tmp/Debian-5.2.9-mvebu-tld-1-rootfs-bodhi.tar.bz2
root@debian:/media/sdb1# sync
root@debian:/media/sdb1# cd boot
root@debian:/media/sdb1/boot# cp -a zImage-5.2.9-mvebu-tld-1 zImage.fdt
root@debian:/media/sdb1/boot# cat dts/armada-385-synology-ds116.dtb  >> zImage.fdt
root@debian:/media/sdb1/boot# mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n Linux-5.2.9-mvebu-tld-1 -d zImage.fdt uImage
Image Name:   Linux-5.2.9-mvebu-tld-1
Created:      Mon Dec 14 15:19:58 2020
Image Type:   ARM Linux Kernel Image (uncompressed)
Data Size:    5075421 Bytes = 4956.47 KiB = 4.84 MiB
Load Address: 00008000
Entry Point:  00008000
root@debian:/media/sdb1/boot# sync


3.c. Write uImage and uInitrd to raw sectors.
root@debian:/media/sdb1/boot# dd if=uImage of=/dev/sdb bs=1MiB seek=10
4+1 records in
4+1 records out
5075485 bytes (5.1 MB, 4.8 MiB) copied, 0.0305527 s, 166 MB/s
root@debian:/media/sdb1/boot# dd if=uInitrd of=/dev/sdb bs=1MiB seek=20
9+1 records in
9+1 records out
9488618 bytes (9.5 MB, 9.0 MiB) copied, 0.0480669 s, 197 MB/s
root@debian:/media/sdb1/boot# sync

4. Booting with the HDD rootfs
BootROM - 1.73
Booting from SPI flash


General initialization - Version: 1.0.0
AVS selection from EFUSE disabled (Skip reading EFUSE values)
Detected Device ID 6820
High speed PHY - Version: 2.0

Init Synology board board SerDes lanes topology details:
 | Lane # | Speed|    Type     |
 ------------------------------|
 |   0    |  0   |  SGMII0     |
 |   1    |  6   |  SATA0      |
 |   4    |  5   |  USB3 HOST0 |
 |   5    |  5   |  USB3 HOST1 |
 -------------------------------
High speed PHY - Ended Successfully
DDR3 Training Sequence - Ver TIP-1.46.0
WARNING:Wrong configuration for pup #1 CS mask and CS mirroring for all pups should be the same
WARNING:Wrong configuration for pup #3 CS mask and CS mirroring for all pups should be the same
DDR3 Training Sequence - Switching XBAR Window to FastPath Window
DDR3 Training Sequence - Ended Successfully
Not detected suspend to RAM indication
BootROM: Image checksum verification PASSED

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


U-Boot 2013.01-g6cc0a6d (Jan 29 2016 - 17:30:11) Marvell version: 2015_T1.0p16

Board: SYNO-DS116
SoC:   MV88F6820 Rev A0
       running 2 CPUs
CPU:   ARM Cortex A9 MPCore (Rev 1) LE
       CPU 0
       CPU    @ 1866 [MHz]
       L2     @ 933 [MHz]
       TClock @ 200 [MHz]
       DDR3    @ 933 [MHz]
       DDR3 32 Bit Width,FastPath Memory Access, DLB Enabled, ECC Disabled
DRAM:  1 GiB
MMC:   mv_sdh: 0
SF: Detected MX25L6405D with page size 64 KiB, total 8 MiB
USB3.0 0: Host Mode
USB3.0 1: Host Mode

Map:   Code:                    0x3ff3b000:0x3ffc949c
       BSS:                     0x3ffefa88
       Stack:                   0x3fa2af20
       Heap:                    0x3fa2b000:0x3ff3b000
       U-Boot Environment:      0x007e0000:0x007f0000 (SPI)

Board configuration detected:

Synology Model: DS116

Net:
|  port  | Interface | PHY address  |
|--------|-----------|--------------|
| egiga0 |   SGMII   |     0x01     |
egiga0 [PRIME]
Press Ctrl+C to abort autoboot in 3 second
Marvell>> setenv load_image_addr 0x02000000
Marvell>> setenv load_initrd_addr 0x3000000
Marvell>> setenv load_image 'echo loading uImage from raw HDD ...; scsi device 0; scsi read $load_image_addr 0x5000 0x2F00'
Marvell>> setenv load_initrd 'echo loading uInitrd from raw HDD ...; scsi device 0; scsi read $load_initrd_addr 0xA000 0x4F00'
Marvell>> setenv set_bootargs 'setenv bootargs "console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts earlyprintk=serial"'
Marvell>> setenv bootcmd_exec 'echo Booting Debian ...; run set_bootargs; setenv fdt_skip_update yes; setenv initrd_high 0xffffffff; run load_image; run load_initrd; bootm $load_image_addr $load_initrd_addr'
Marvell>> setenv bootcmd 'scsi init; run bootcmd_exec; echo Booting Stock OS ...; run bootspi'
Marvell>> boot
AHCI init for unit0
SATA link 0 timeout.
SATA link 1 timeout.

Error: SCSI Controller(s) 1B4B:9215 1B4B:9235 not found
scanning bus for devices...
Found 0 device(s).
Booting Debian ...
loading uImage from raw HDD ...

SCSI device 0:
    Device 0: not available

SCSI read: device -1 block # 20480, count 12032 ... scsi_ahci: Error: buffer too small.
12032 blocks read: OK
loading uInitrd from raw HDD ...

SCSI device 0:
    Device 0: not available

SCSI read: device -1 block # 40960, count 20224 ... scsi_ahci: Error: buffer too small.
20224 blocks read: OK
Wrong Image Format for bootm command
ERROR: can't get kernel image!
Booting Stock OS ...

Rest of stock log
Booting Stock OS ...
SF: Detected MX25L6405D with page size 64 KiB, total 8 MiB
## Booting kernel from Legacy Image at 02000000 ...
   Image Name:   Linux-3.10.105
   Created:      2020-05-11  20:43:07 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2565112 Bytes = 2.4 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
## Loading init Ramdisk from Legacy Image at 03000000 ...
   Image Name:   synology_armada38x_ds116 25426
   Created:      2020-05-11  22:11:30 UTC
   Image Type:   ARM Linux RAMDisk Image (uncompressed)
   Data Size:    3499193 Bytes = 3.3 MiB
   Load Address: 08000000
   Entry Point:  08000000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 01000000
   Booting using the fdt blob at 0x01000000
   Loading Kernel Image ... OK
OK
   Loading Device Tree to 00ff9000, end 00fffa9f ... OK

   Skipping Device Tree update ('fdt_skip_update' = yes)

Limit DDR size at 3GB due to power of 2 requirement of Address decoding

Starting kernel ...

Uncompressing Linux... done, booting the kernel.
[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Initializing cgroup subsys cpuset
[    0.000000] Initializing cgroup subsys cpu
[    0.000000] Initializing cgroup subsys cpuacct
[    0.000000] Linux version 3.10.105 (root@build4) (gcc version 4.9.3 20150311 (prerelease) (crosstool-NG 1.20.0) ) #25426 SMP Tue May 12 04:42:24 CST 2020
[    0.000000] CPU: ARMv7 Processor [414fc091] revision 1 (ARMv7), cr=10c53c7d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] Machine: Marvell Armada 380/381/382/383/384/385/388 (Device Tree), model: Synology DS116
[    0.000000] Memory policy: ECC disabled, Data cache writealloc
[    0.000000] PERCPU: Embedded 7 pages/cpu @80ede000 s7168 r8192 d13312 u32768
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 260096
[    0.000000] Kernel command line: console=ttyS0,115200 ip=off initrd=0x3000000 root=/dev/sda1 rw syno_hw_version=DS116 hd_power_on_seq=1 ihd_num=1 netif_num=1 syno_hdd_enable=15 flash_size=8
[    0.000000] Synology Hardware Version: DS116-j
[    0.000000] Internal HD num: 1
[    0.000000] Internal netif num: 1
[    0.000000] SYNO GPIO hdd enable pin: 15
[    0.000000] PID hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
[    0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
[    0.000000] allocated 2097152 bytes of page_cgroup
[    0.000000] please try 'cgroup_disable=memory' option if you don't want memory cgroups
[    0.000000] Memory: 1024MB = 1024MB total
[    0.000000] Memory: 1026988k/1026988k available, 21588k reserved, 0K highmem
[    0.000000] Virtual kernel memory layout:
[    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
[    0.000000]     fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
[    0.000000]     vmalloc : 0xc0800000 - 0xfff00000   (1015 MB)
[    0.000000]     lowmem  : 0x80000000 - 0xc0000000   (1024 MB)
[    0.000000]     modules : 0x7f000000 - 0x80000000   (  16 MB)
[    0.000000]       .text : 0x80008000 - 0x805fb18c   (6093 kB)
[    0.000000]       .init : 0x805fc000 - 0x80635c00   ( 231 kB)
[    0.000000]       .data : 0x80636000 - 0x8066cbc0   ( 219 kB)
[    0.000000]        .bss : 0x8066cbc0 - 0x806d2d84   ( 409 kB)
[    0.000000] Hierarchical RCU implementation.
[    0.000000] NR_IRQS:16 nr_irqs:16 16
[    0.000000]
[    0.000000]   LSP version: linux-3.10.70-2015_T1.1p7
[    0.000000]
[    0.000000] sched_clock: 32 bits at 25MHz, resolution 40ns, wraps every 171798ms
[    0.000000] L310 cache controller enabled
[    0.000000] l2x0: 16 ways, CACHE_ID 0x410054c9, AUX_CTRL 0x16070000, Cache size: 1048576 B
[    0.000330] Calibrating delay loop... 3719.16 BogoMIPS (lpj=18595840)
[    0.060016] pid_max: default: 32768 minimum: 301
[    0.060054] Security Framework initialized
[    0.060062] AppArmor: AppArmor initialized
[    0.060076] Mount-cache hash table entries: 512
[    0.060333] Initializing cgroup subsys memory
[    0.060345] Disabling memory control group subsystem
[    0.060348] Initializing cgroup subsys devices
[    0.060351] Initializing cgroup subsys freezer
[    0.060354] Initializing cgroup subsys blkio
[    0.060371] CPU: Testing write buffer coherency: ok
[    0.060459] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[    0.060462] Calibrating local timer... 933.17MHz.
[    0.120034] Setting up static identity map for 0x8047d180 - 0x8047d1d8
[    0.120135] mvebu-pmsu: Initializing Power Management Service Unit
[    0.120161] Initializing CPU Reset module
[    0.120648] CPU1: Booted secondary processor
[    0.180030] CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
[    0.180074] Brought up 2 CPUs
[    0.180080] SMP: Total of 2 processors activated (7445.70 BogoMIPS).
[    0.180082] CPU: All CPU(s) started in SVC mode.
[    0.180298] devtmpfs: initialized
[    0.182025] mvebu-soc-id: MVEBU SoC ID=0x6820, Rev=0x4
[    0.182163] xor: measuring software checksum speed
[    0.279990]    arm4regs  :  3314.800 MB/sec
[    0.379973]    8regs     :  2284.400 MB/sec
[    0.479955]    32regs    :  2324.000 MB/sec
[    0.479958] xor: using function: arm4regs (3314.800 MB/sec)
[    0.479962] pinctrl core: initialized pinctrl subsystem
[    0.480172] regulator-dummy: no parameters
[    0.480292] NET: Registered protocol family 16
[    0.480718] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.482279] irq: Cannot allocate irq_descs @ IRQ194, assuming pre-allocated
[    0.482537] irq: Cannot allocate irq_descs @ IRQ226, assuming pre-allocated
[    0.484635] hw-breakpoint: found 5 (+1 reserved) breakpoint and 1 watchpoint registers.
[    0.484639] hw-breakpoint: maximum watchpoint size is 4 bytes.
[    0.490005] bio: create slab <bio-0> at 0
[    0.659991] raid6: int32x1  gen()   279 MB/s
[    0.830030] raid6: int32x1  xor()   226 MB/s
[    0.999927] raid6: int32x2  gen()   384 MB/s
[    1.169959] raid6: int32x2  xor()   259 MB/s
[    1.339962] raid6: int32x4  gen()   385 MB/s
[    1.509790] raid6: int32x4  xor()   274 MB/s
[    1.679810] raid6: int32x8  gen()   425 MB/s
[    1.849735] raid6: int32x8  xor()   272 MB/s
[    1.849738] raid6: using algorithm int32x8 gen() (425 MB/s)
[    1.849740] raid6: .... xor() 272 MB/s, rmw enabled
[    1.849743] raid6: using intx1 recovery algorithm
[    1.849874] mvebu-pcie pcie-controller.3: PCIe0.0: link down
[    1.849891] mvebu-pcie pcie-controller.3: PCIe1.0: link down
[    1.849983] mvebu-pcie pcie-controller.3: PCI host bridge to bus 0000:00
[    1.849990] pci_bus 0000:00: root bus resource [io  0x1000-0xfffff]
[    1.849994] pci_bus 0000:00: root bus resource [mem 0xe0000000-0xe7ffffff]
[    1.849999] pci_bus 0000:00: root bus resource [bus 00-ff]
[    1.850182] PCI: bus0: Fast back to back transfers disabled
[    1.850187] pci 0000:00:01.0: bridge configuration invalid ([bus 00-00]), reconfiguring
[    1.850192] pci 0000:00:02.0: bridge configuration invalid ([bus 00-00]), reconfiguring
[    1.850262] PCI: bus1: Fast back to back transfers enabled
[    1.850333] PCI: bus2: Fast back to back transfers enabled
[    1.850354] pci 0000:00:01.0: PCI bridge to [bus 01]
[    1.850360] pci 0000:00:02.0: PCI bridge to [bus 02]
[    1.850366] PCI: enabling device 0000:00:01.0 (0140 -> 0143)
[    1.850370] PCI: enabling device 0000:00:02.0 (0140 -> 0143)
[    1.850768] SCSI subsystem initialized
[    1.851621] Switching to clocksource armada_370_xp_clocksource
[    1.851768] AppArmor: AppArmor Filesystem Enabled
[    1.852607] NET: Registered protocol family 2
[    1.852868] TCP established hash table entries: 8192 (order: 4, 65536 bytes)
[    1.852923] TCP bind hash table entries: 8192 (order: 4, 65536 bytes)
[    1.852974] TCP: Hash tables configured (established 8192 bind 8192)
[    1.853005] TCP: reno registered
[    1.853011] UDP hash table entries: 512 (order: 2, 16384 bytes)
[    1.853027] UDP-Lite hash table entries: 512 (order: 2, 16384 bytes)
[    1.853107] NET: Registered protocol family 1
[    1.853226] RPC: Registered named UNIX socket transport module.
[    1.853230] RPC: Registered udp transport module.
[    1.853233] RPC: Registered tcp transport module.
[    1.853235] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    1.853313] Trying to unpack rootfs image as initramfs...
[    2.722298] Freeing initrd memory: 3412K (83001000 - 83356000)
[    2.722468] hw perfevents: enabled with ARMv7 Cortex-A9 PMU driver, 7 counters available
[    2.723779] Initialise module verification
[    2.723808] audit: initializing netlink socket (disabled)
[    2.723826] type=2000 audit(2.720:1): initialized
[    2.724766] VFS: Disk quotas dquot_6.5.2
[    2.724807] Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[    2.725026] NFS: Registering the id_resolver key type
[    2.725044] Key type id_resolver registered
[    2.725047] Key type id_legacy registered
[    2.725065] msgmni has been set to 2012
[    2.725514] async_tx: api initialized (async)
[    2.725519] Key type asymmetric registered
[    2.725522] Asymmetric key parser 'x509' registered
[    2.725668] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 254)
[    2.725674] io scheduler noop registered
[    2.725685] io scheduler cfq registered (default)
[    2.726337] armada-38x-pinctrl f1018000.pinctrl: registered pinctrl driver
[    2.726739] mv_xor f1060800.xor: Marvell shared XOR driver
[    2.761868] mv_xor f1060800.xor: Marvell XOR (Descriptor Mode): ( xor cpy intr pq )
[    2.791902] mv_xor f1060800.xor: freeing 1 in use descriptors!
[    2.791911] mv_xor f1060800.xor: Marvell XOR (Descriptor Mode): ( intr crc32c )
[    2.792785] mv_xor f1060900.xor: Marvell shared XOR driver
[    2.831863] mv_xor f1060900.xor: Marvell XOR (Descriptor Mode): ( xor cpy intr pq )
[    2.861885] mv_xor f1060900.xor: freeing 1 in use descriptors!
[    2.861893] mv_xor f1060900.xor: Marvell XOR (Descriptor Mode): ( intr crc32c )
[    2.863119] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
[    2.884648] f1012000.serial: ttyS0 at MMIO 0xf1012000 (irq = 44) is a 16550A
[    3.698659] console [ttyS0] enabled
[    3.722584] f1012100.serial: ttyS1 at MMIO 0xf1012100 (irq = 45) is a 16550A
[    3.737116] brd: module loaded
[    3.740185] Loading iSCSI transport class v2.0-870.
[    3.747113] ahci_mv f10a8000.sata: AHCI 0001.0000 32 slots 2 ports 6 Gbps 0x3 impl platform mode
[    3.755951] ahci_mv f10a8000.sata: flags: 64bit ncq sntf led only pmp fbs pio slum part sxs
[    3.765864] scsi0 : ahci_mv_platform
[    3.769886] scsi1 : ahci_mv_platform
[    3.773844] ata1: SATA max UDMA/133 mmio [mem 0xf10a8000-0xf10a9fff] port 0x100 irq 58
[    3.781816] ata2: SATA max UDMA/133 mmio [mem 0xf10a8000-0xf10a9fff] port 0x180 irq 58
[    7.331645] ata1: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
[    7.337956] ata1.00: ATA-9: ADATA SP600, 2.9, max UDMA/100
[    7.343470] ata1.00: 62533296 sectors, multi 16: LBA48 NCQ (depth 31/32)
[    7.350196] ata1.00: SN:2E4420025531
[    7.353937] ata1.00: configured for UDMA/100
[    7.358232] ata1.00: Find SSD disks. [ADATA SP600]
[    7.363289] scsi 0:0:0:0: Direct-Access     ADATA    SP600                    2.9  PQ: 0 ANSI: 5
[    7.372789] sd 0:0:0:0: [sda] 62533296 512-byte logical blocks: (32.0 GB/29.8 GiB)
[    7.380511] sd 0:0:0:0: [sda] Write Protect is off
[    7.385369] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    7.395042]  sda: sda1
[    7.398067] sd 0:0:0:0: [sda] Attached SCSI disk
[    7.721645] ata2: SATA link down (SStatus 0 SControl 300)
[    7.727065] ata2: No present pin info for SATA link down event
[    7.735277] m25p80 spi0.0: mx25l6405d (8192 Kbytes)
[    7.740186] Searching for RedBoot partition table in spi0.0 at offset 0x7f0000
[    7.843363] 6 RedBoot partitions found on MTD device spi0.0
[    7.848958] Creating 6 MTD partitions on "spi0.0":
[    7.853794] 0x000000000000-0x0000000f0000 : "RedBoot"
[    7.859728] 0x0000000f0000-0x0000003c0000 : "zImage"
[    7.865597] 0x0000003c0000-0x0000007d0000 : "rd.gz"
[    7.871309] 0x0000007d0000-0x0000007e0000 : "vendor"
[    7.876685] vender Mac0 address : 00:11:32:57:6a:d0
[    7.881582] vender Mac1 doesn't set ucSum:0x00 Buf:0x00 Sum:0.
[    7.887448] vender Mac2 doesn't set ucSum:0x00 Buf:0x00 Sum:0.
[    7.893306] vender Mac3 doesn't set ucSum:0x00 Buf:0x00 Sum:0.
[    7.899162] serial number='xxx'
[    7.903811] 0x0000007e0000-0x0000007f0000 : "RedBoot Config"
[    7.910633] 0x0000007f0000-0x000000800000 : "FIS directory"
[    7.919512] SoC: model = 0x6820, revision = 0x4
[    7.924137] mvPncVirtBase = 0xc0c00000, pncTcamSize = 1024
[    7.929643]   o 3 Giga ports supported
[    7.933412]   o SKB recycle supported for SWF (Disabled)
[    7.938742]   o NETA acceleration mode 4
[    7.942681]   o BM supported for CPU: 4 BM pools
[    7.947314]   o PnC supported (Enabled)
[    7.951162]   o RX Queue support: 8 Queues * 512 Descriptors
[    7.956844]   o TX Queue support: 8 Queues * 1024 Descriptors
[    7.962614]   o GSO supported
[    7.965590]   o GRO supported
[    7.968567]   o Receive checksum offload supported
[    7.973376]   o Transmit checksum offload supported
[    7.978271]   o Driver ERROR statistics enabled
[    7.982818]   o Driver INFO statistics enabled
[    7.987276]   o Driver DEBUG statistics enabled
[    7.991823]
[    7.994190] port #0: is_sgmii=1, is_rgmii=0, phy_addr=1
[    7.999458]   o Loading network interface(s) for port #0: cpu_mask=0x3, tx_csum_limit=9800
[    8.007773]
[    8.009268]   o Port 0 is connected to Linux netdevice
[    8.017782]     o eth0, ifindex = 2, GbE port = 0
[    8.022532]     o eth0, phy chipid = 1410dd0, Support WOL = 32
[    8.031827]  giga p=0: mtu=1500, mac=00:50:43:02:02:01 (platform)
[    8.037944]
[    8.039816] libphy: orion_mdio_bus: probed
[    8.045897] mdio_bus f1072004.mdio-mi: cannot get PHY at address 0
[    8.053217] mvebu-rtc f10a3800.rtc: rtc core: registered f10a3800.rtc as rtc0
[    8.111797] i2c /dev entries driver
[    8.126650] armada_thermal f10e4078.thermal: Overheat threshold between 92..107
[    8.134456] md: linear personality registered for level -1
[    8.139965] md: raid0 personality registered for level 0
[    8.145308] md: raid1 personality registered for level 1
[    8.150641] md: raid10 personality registered for level 10
[    8.156322] md: raid6 personality registered for level 6
[    8.161662] md: raid5 personality registered for level 5
[    8.166995] md: raid4 personality registered for level 4
[    8.172508] device-mapper: ioctl: 4.25.0-ioctl (2013-06-26) initialised: dm-devel@redhat.com
[    8.180981] cpuidle: using governor ladder
[    8.185307] armada-cesa-ocf f109d000.crypto: mv_get_cesa_resources: Total CESA HW channels supported 2
[    8.194660] armada-cesa-ocf f109d000.crypto: mv_get_cesa_resources: CESA feature: chain(0)
[    8.203118] mvCesaInit: channels=2, session=640, queue=256
[    8.216794] armada-cesa-ocf f109d000.crypto: cesa_ocf_probe: CESA driver operate in ocf(0) mode
[    8.226140] cesadev_init(8061aaf4)
[    8.230121] TCP: cubic registered
[    8.233467] NET: Registered protocol family 17
[    8.237964] Key type dns_resolver registered
[    8.242309] VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 4
[    8.250021] Registering suspend init for this board failed
[    8.257609] Loading module verification blacklist certificates
[    8.263488] Loading module verification certificates
[    8.268511] MODSIGN: Loaded cert 'Synology SDG kernel module signing key: 7bd0b0d6bcd31651c22ce3978bdc8c8bdc417329'
[    8.282692] MODSIGN: Loaded cert 'Synology Root Certification Authority: f2c075361f168425f8b5ef31b796406c3aab2089'
[    8.293110] MODSIGN: Loaded cert 'Synology Kernel Module Signing Certification Authority: 600839b5d127e0e11d817a31f0575d323a7c0e28'
[    8.305006] MODSIGN: Loaded cert 'Synology kernel module signing key: 4646ce54489669338118a3b1286da156ac366fa5'
[    8.315146] registered taskstats version 1
[    8.319284] regulator-dummy: disabling
[    8.323293] Freeing unused kernel memory: 228K (805fc000 - 80635000)
START /linuxrc.syno
Insert basic USB modules...
:: Loading module usb-common ... [  OK  ]
:: Loading module usbcore[    8.447941] usbcore: registered new interface driver usbfs
[    8.454415] usbcore: registered new interface driver hub
[    8.460757] usbcore: registered new device driver usb
 ... [  OK  ]
:: Loading module ehci-hcd[    8.503096] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
 ... [  OK  ]
:: Loading module xhci-hcd[    8.536712] xhci-hcd f10f0000.usb3: USB2 Vbus gpio 58
[    8.541848] xhci-hcd f10f0000.usb3: power control enabled
[    8.547276] xhci-hcd f10f0000.usb3: xHCI Host Controller
[    8.552634] xhci-hcd f10f0000.usb3: new USB bus registered, assigned bus number 1
[    8.560276] xhci-hcd f10f0000.usb3: irq 48, io mem 0xf10f0000
[    8.566577] hub 1-0:1.0: USB hub found
[    8.570357] hub 1-0:1.0: 1 port detected
[    8.574405] xhci-hcd f10f0000.usb3: USB3 Vbus gpio 58
[    8.579482] xhci-hcd f10f0000.usb3: power control enabled
[    8.584922] xhci-hcd f10f0000.usb3: xHCI Host Controller
[    8.590267] xhci-hcd f10f0000.usb3: new USB bus registered, assigned bus number 2
[    8.598484] hub 2-0:1.0: USB hub found
[    8.602289] hub 2-0:1.0: 1 port detected
[    8.606374] xhci-hcd f10f8000.usb3: USB2 Vbus gpio 59
[    8.611452] xhci-hcd f10f8000.usb3: power control enabled
[    8.616906] xhci-hcd f10f8000.usb3: xHCI Host Controller
[    8.622268] xhci-hcd f10f8000.usb3: new USB bus registered, assigned bus number 3
[    8.629948] xhci-hcd f10f8000.usb3: irq 49, io mem 0xf10f8000
[    8.636667] hub 3-0:1.0: USB hub found
[    8.640446] hub 3-0:1.0: 1 port detected
[    8.644522] xhci-hcd f10f8000.usb3: USB3 Vbus gpio 59
[    8.649599] xhci-hcd f10f8000.usb3: power control enabled
[    8.655046] xhci-hcd f10f8000.usb3: xHCI Host Controller
[    8.660389] xhci-hcd f10f8000.usb3: new USB bus registered, assigned bus number 4
[    8.668542] hub 4-0:1.0: USB hub found
[    8.672359] hub 4-0:1.0: 1 port detected
 ... [  OK  ]
:: Loading module ehci-orion[    8.716567] ehci-orion: EHCI orion driver
[    8.720693] orion-ehci f1058000.usb: failed to get Vbus gpio
[    8.726407] orion-ehci f1058000.usb: USB2 Vbus gpio -1
[    8.731566] orion-ehci f1058000.usb: power control disabled
[    8.737164] orion-ehci f1058000.usb: EHCI Host Controller
[    8.742598] orion-ehci f1058000.usb: new USB bus registered, assigned bus number 5
[    8.750240] orion-ehci f1058000.usb: irq 50, io mem 0xf1058000
[    8.771657] orion-ehci f1058000.usb: USB 2.0 started, EHCI 1.00
[    8.778517] hub 5-0:1.0: USB hub found
[    8.782316] hub 5-0:1.0: 1 port detected
 ... [  OK  ]
insmod: can't insert '/lib/modules/etxhci-hcd.ko': No such file or directory
Insert net driver([    8.824788] ds116_synobios: module license 'Synology Inc.' taints kernel.
Mindspeed only).[    8.832520] Disabling lock debugging due to kernel taint
..
[    8.839834] Synobios DS116 GPIO initialized
[    8.844284] 2020-12-14 23:23:19 UTC
[    8.847790] synobios: load, major number 201
[    8.852090] Brand: Synology
[    8.854911] Model: DS-116
[    8.857549] This is default settings: set group disks wakeup number to 1, spinup time deno 1
[    8.866052] synobios cpu_arch proc entry initialized
[    8.871035] synobios crypto_hw proc entry initialized
[    8.876112] synobios syno_platform proc entry initialized
[    8.881590] synobios open /dev/ttyS1 success
Starting /usr/syno/bin/synocfgen...
/usr/syno/bin/synocfgen returns 0
[    8.896735] synobios: unload
Partition Version=0
Partition layout is not DiskStation style.
NOT EXECUTE /sbin/e2fsck.
Mounting /dev/sda1 /[    8.959765] EXT3-fs error (device sda1): ext3_check_descriptors: Block bitmap for group 0 not in group (block 4277499151)!
tmpRoot
[    8.972024] EXT3-fs (sda1): error: group descriptors corrupted
mount: mounting /dev/sda1 on /tmpRoot failed: No such device
mount /dev/sda1 fail, returns
ls: /tmpRoot/usr/share/init/root-file-system.override: No such file or directory
ls: /tmpRoot/usr/share/init/hostname.override: No such file or directory
ls: /tmpRoot/usr/share/init/syslog-ng.override: No such file or directory
ls: /tmpRoot/usr/share/init/dsmupdate.override: No such file or directory
ls: /tmpRoot/usr/share/init/smallupdate.override: No such file or directory
ls: /tmpRoot/usr/share/init/rc.override: No such file or directory
mv: can't rename '/tmpRoot/.log.junior/init_health.logs': No such file or directory
Exit on error [3] init not health....
Mon Dec 14 23:23:19 UTC 2020
none /sys/kernel/debug debugfs rw,relatime 0 0
sys /sys sysfs rw,relatime 0 0
none /dev devtmpfs rw,relatime,size=513492k,nr_inodes=128373,mode=755 0 0
proc /proc proc rw,relatime 0 0
linuxrc.syno failed on 3
starting pid 925, tty '': '/etc/rc'
:: Starting /etc/rc
:: Mounting procfs ... [  OK  ]
:: Mounting tmpfs ... [  OK  ]
:: Mounting devtmpfs ... [  OK  ]
:: Mounting devpts ... [  OK  ]
:: Mounting sysfs ... [  OK  ]
swapon: can't stat '/dev/sda2': No such file or directory
:: Loading module fat ... [  OK  ]
:: Loading module vfat ... [  OK  ]
:: Loading module synobios[    9.457420] Synobios DS116 GPIO initialized
[    9.461849] 2020-12-14 23:23:19 UTC
[    9.465356] synobios: load, major number 201
[    9.469645] Brand: Synology
[    9.472475] Model: DS-116
[    9.475112] This is default settings: set group disks wakeup number to 1, spinup time deno 1
[    9.483608] synobios cpu_arch proc entry initialized
[    9.488592] synobios crypto_hw proc entry initialized
[    9.493668] synobios syno_platform proc entry initialized
[    9.499135] synobios open /dev/ttyS1 success
 ... [  OK  ]
[    9.618537] eth0: mac address changed
[    9.666330] pool #0: pkt_size=1536, buf_size=1600 - 2048 of 2048 buffers added
[    9.673817] eth0: link up
[    9.676496] eth0: started
[    9.676509] eth0:
[    9.676509] link up
[    9.676510] , full duplex
[    9.676511] , speed
[    9.676511] 1 Gbps
udhcpc (v1.16.1) started
eth0      Link encap:Ethernet  HWaddr 00:11:32:57:6A:D0
          inet addr:192.168.0.152  Bcast:192.168.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2 errors:0 dropped:0 overruns:0 frame:0
          TX packets:7 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1024
          RX bytes:694 (694.0 B)  TX bytes:1480 (1.4 KiB)
          Interrupt:193

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

:: Starting syslogd ... [  OK  ]
/etc/rc: line 280: /usr/syno/bin/syno_pstore_collect: not found
:: Starting scemd
[   17.523499] eth0:
[   17.525347] link up, full duplex
[   17.528604] , speed [   17.530803] 1 Gbps
:: Starting services in background
Starting findhostd in flash_rd...
Starting services in flash_rd...
Running /usr/syno/etc/rc.d/J01httpd.sh...
Starting httpd:80 in flash_rd...
Starting httpd:5000 in flash_rd...
Running /usr/syno/etc/rc.d/J03ssdpd.sh...
/usr/bin/minissd[   17.747064] EXT3-fs error (device sda1): ext3_check_descriptors: Block bitmap for group 0 not in group (block 4277499151)!
pd -i eth0
[   17.759526] EXT3-fs (sda1): error: group descriptors corrupted
(15): upnp:rootdevice
(51): uuid:upnp_SynologyNAS-001132576ad0::upnp:rootdevice
(57): Synology/synology_armada38x_ds116/6.2-25426/192.168.0.152
(46): http://192.168.0.152:5000/description-eth0.xml
Connected.
done.
/usr/syno/bin/reg_ssdp_service 192.168.0.152 001132576ad0 6.2-25426 synology_armada38x_ds116 eth0
Running /usr/syno/etc/rc.d/J04synoagentregisterd.sh...
Starting synoagentregisterd...
Running /usr/syno/etc/rc.d/J30DisableNCQ.sh...
Running /usr/syno/etc/rc.d/J80ADTFanControl.sh...
Running /usr/syno/etc/rc.d/J98nbnsd.sh...
Starting nbnsd...
Running /usr/syno/etc/rc.d/J99avahi.sh...
Starting Avahi mDNS/DNS-SD Daemon
cname_load_conf failed:/var/tmp/nginx/avahi-aliases.conf
:: Loading module usb-storage[   17.945574] usbcore: registered new interface driver usb-storage
 ... [  OK  ]
============ Date ============
Mon Dec 14 23:2
Mon Dec 14 23:23:28 2020

DiskStation login:



Edited 2 time(s). Last edit at 12/29/2020 05:16PM by bonk1990.
Re: Debian on Synology RS816 (Armada 385)
December 15, 2020 12:33AM
bonk1990,

Error: SCSI Controller(s) 1B4B:9215 1B4B:9235 not found
scanning bus for devices...
Found 0 device(s).

So the HDD was not detected. The rest does not matter.

Might be because it is a different u-boot from the RS816.
U-Boot 2013.01-g6cc0a6d (Jan 29 2016 - 17:30:11) Marvell version: 2015_T1.0p16

Board: SYNO-DS116
SoC:   MV88F6820 Rev A0
       running 2 CPUs

So repeat at Step 4 (Step 1 to Step 3 were OK).

But this time do each command step by step after interrupting serial console:

Marvell>> setenv load_image_addr 0x02000000
Marvell>> setenv load_initrd_addr 0x3000000
Marvell>> setenv load_image 'echo loading uImage from raw HDD ...; scsi device 0; scsi read $load_image_addr 0x5000 0x2F00'
Marvell>> setenv load_initrd 'echo loading uInitrd from raw HDD ...; scsi device 0; scsi read $load_initrd_addr 0xA000 0x4F00'
Marvell>> setenv set_bootargs 'setenv bootargs "console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts earlyprintk=serial"'
Marvell>> setenv bootcmd_exec 'echo Booting Debian ...; run set_bootargs; setenv fdt_skip_update yes; setenv initrd_high 0xffffffff; run load_image; run load_initrd; bootm $load_image_addr $load_initrd_addr'
Marvell>> setenv bootcmd 'scsi init; run bootcmd_exec; echo Booting Stock OS ...; run bootspi'

At this point, list the available commands:

help

And then try
ide reset

That was to see if this version of u-boot use ide command instead of scsi command.

If ide reset gives out error and if the disk was initialized. If not, try

scsi reset

And if we still see error, then most likely an extra step is needed to activate the HDD power.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian on Synology RS816 (Armada 385)
December 15, 2020 06:19AM
Marvell>> setenv load_image_addr 0x02000000
Marvell>> setenv load_initrd_addr 0x3000000
Marvell>> setenv load_image 'echo loading uImage from raw HDD ...; scsi device 0; scsi read $load_image_addr 0x5000 0x2F00'
Marvell>> setenv load_initrd 'echo loading uInitrd from raw HDD ...; scsi device 0; scsi read $load_initrd_addr 0xA000 0x4F00'
Marvell>> setenv set_bootargs 'setenv bootargs "console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts earlyprintk=serial"'
Marvell>> setenv bootcmd_exec 'echo Booting Debian ...; run set_bootargs; setenv fdt_skip_update yes; setenv initrd_high 0xffffffff; run load_image; run load_initrd; bootm $load_image_addr $load_initrd_addr'
Marvell>> setenv bootcmd 'scsi init; run bootcmd_exec; echo Booting Stock OS ...; run bootspi'
Marvell>> help
?       - alias for 'help'
Creset  - Creset        - Run 'reset' or boot command in a loop, while counting.

SatR    - Sample At Reset sub-system
WOLTest - WOLTest       - Wake On Lan u-boot testing

active_units- print active units on board
base    - print or set address offset
bdinfo  - print Board Info structure
boot    - boot default, i.e., run 'bootcmd'
bootd   - boot default, i.e., run 'bootcmd'
bootelf - Boot from an ELF image in memory
bootm   - boot application image from memory
bootp   - boot image via network using BOOTP/TFTP protocol
bootvx  - Boot vxWorks from an ELF image
bootz   - boot Linux zImage image from memory
cmp     - memory compare
coninfo - print console devices and information
cp      - memory copy
cpss_env- set cpss environment variables permanently

crc32   - checksum calculation
date    - get/set/reset date & time
ddrPhyRead- ddrPhyRead - Read DDR PHY register

ddrPhyWrite- ddrPhyWrite - Write DDR PHY register

dhcp    - boot image via network using DHCP/TFTP protocol
diskboot- diskboot- boot from IDE device

dma     - dma   - Perform DMA using the XOR engine

echo    - echo args to console
editenv - edit environment variable
eeprom  - EEPROM sub-system
env     - environment handling commands
exit    - exit script
false   - do nothing, unsuccessfully
fdt     - flattened device tree utility commands
flash_part_print- flash_part_print  - print spi/nand FLASH memory information

go      - start application at address 'addr'
help    - print command description/usage
i2c     - I2C sub-system
ide     - ide     - IDE sub-system

iminfo  - print header information for application image
imxtract- extract a part of a multi-image
ir      - ir    - reading and changing MV internal register values.

itest   - return true/false on integer compare
loadb   - load binary file over serial line (kermit mode)
loads   - load S-Record file over serial line
loadx   - load binary file over serial line (xmodem mode)
loady   - load binary file over serial line (ymodem mode)
loop    - infinite loop on address range
map     - map   - Display address decode windows

md      - memory display
me      - me    - PCIe master enable

mm      - memory modify (auto-incrementing address)
mmc     - MMC sub system
mmcinfo - display MMC info
mp      - mp    - map PCIe BAR

mtdburn - Burn a Linux image and Filesystem` on the NAND/SPI flash.

mtest   - simple RAM read/write test
mw      - memory write (fill)
nfs     - boot image via network using NFS protocol
nm      - memory modify (constant address)
pci     - list and access PCI Configuration Space
pciePhyRead- phyRead    - Read PCI-E Phy register

pciePhyWrite- pciePhyWrite      - Write PCI-E Phy register

phyRead - phyRead       - Read Phy register

phyWrite- phyWrite      - Write Phy register

ping    - send ICMP ECHO_REQUEST to network host
printenv- print environment variables
pxe     - commands to get and boot from pxe files
qsgmii_sel-  Select SFP or QSGMII modes on bc2.

rcvr    - rcvr  - Start recovery process (with TFTP server)

reset   - Perform RESET of the CPU
resetenv- resetenv      - Erase environment sector to reset all variables to default.

run     - run commands in an environment variable
saveenv - save environment variables to persistent storage
scsi    - SCSI sub-system
scsiboot- boot from SCSI device
se      - se    - PCIe Slave enable

setenv  - set environment variables
sf      - SPI flash sub-system
sg      - sg    - scanning the PHYs status

showvar - print local hushshell variables
sleep   - delay execution for some time
smiscan - smiscan - Scan for marvell smi devices.

source  - run script from memory
sp      - scan and detect all devices on PCI-e interface
sspi    - SPI utility command
switchCountersRead- switchCntPrint      - Read switch port counters.

switchPhyRegRead- - Read switch register

switchPhyRegWrite- - Write switch register

switchRegRead- switchRegRead    - Read switch register

switchRegWrite- switchRegWrite  - Write switch register

syno_pwoff- syno_pwoff    - bring the system down

syno_up - syno_up       - Send a character to microp

sysboot - command to get and boot from syslinux files
temp    - temp  - Display the device temperature.

tempCmd0- tempCmd - This command allocated for monitor extinction

tempCmd1- tempCmd - This command allocated for monitor extinction

tempCmd2- tempCmd - This command allocated for monitor extinction

tempCmd3- tempCmd - This command allocated for monitor extinction

test    - minimal test like /bin/sh
tftpboot- boot image via network using TFTP protocol
training- training      - prints the results of the DDR3 Training.

trainingStability- training     - prints the results of the DDR3 Training.

true    - do nothing, successfully
ts_report- ts_report    - report touch screen coordinate

ts_test - ts_test       - test touch screen

usb     - USB sub-system
usbboot - boot from USB device
version - print monitor, compiler and linker version
whoAmI  - - reading CPU ID

Marvell>> ide reset

Reset IDE:
Marvell Serial ATA Adapter
no device found

Marvell>> scsi reset

Reset SCSI
AHCI init for unit0
SATA link 0 timeout.
SATA link 1 timeout.

Error: SCSI Controller(s) 1B4B:9215 1B4B:9235 not found
scanning bus for devices...
Found 0 device(s).

Re: Debian on Synology RS816 (Armada 385)
December 15, 2020 03:42PM
U-Boot 2013.01-g6cc0a6d (Jan 29 2016 - 17:30:11) Marvell version: 2015_T1.0p16

Board: SYNO-DS116

Marvell>> ide reset
Reset IDE:
Marvell Serial ATA Adapter
no device found

Marvell>> scsi reset

Reset SCSI
AHCI init for unit0
SATA link 0 timeout.
SATA link 1 timeout.

Error: SCSI Controller(s) 1B4B:9215 1B4B:9235 not found
scanning bus for devices...
Found 0 device(s).

Apparently, this u-boot is similar to one on some other MVEBU NAS boxes, scsi command is supported, not ide.


And the behavior is also similar, most likely that the HDD power is probably not activated in u-boot (intentionally, so that the HDD cannot be accessed during u-boot booting).

Let's look back to other MVEBU boxes installation and find where the SATA power pokes and perhaps they can be used the same way.

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



Edited 1 time(s). Last edit at 12/15/2020 03:44PM by bodhi.
Re: Debian on Synology RS816 (Armada 385)
December 15, 2020 06:18PM
bonk1990,

Try to run the commands several times (to see if the disk was just slow coming up).


Interrup u-boot at count down, wait about 5 seconds

scsi reset

Repeat this several time, each time wait about 3 seconds.

Do the same test with
scsi init

----------

Warning: if the attempts with "scsi reset" and "scsi init" did not work, and you decide to poke the GPIO as below, make sure that the inserted HDD does not contain anything important. And no USB drive are plugged in.

Without the GPLsource for this DS116 box, we cannot really know for sure which GPIO is the one to activate HDD power.

This is the command that does the poke for NAS326. If the NAS326 (Armada 380) and this box (Armada 385) use the same GPIO for HDD power then it should work. But different manufacturers can potentially use different GPIO.

setenv sata_init 'mw.l f1018100 20420000; mw.l f1018140 003ca800; sleep 3; scsi init'

I don't recall which mw.l in the above command will activate the HDD power. I think it is the second one.

mw.l f1018140 003ca800

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian on Synology RS816 (Armada 385)
December 17, 2020 02:43PM
No luck
Marvell>> scsi reset

Reset SCSI
AHCI init for unit0
SATA link 0 timeout.
SATA link 1 timeout.

Error: SCSI Controller(s) 1B4B:9215 1B4B:9235 not found
scanning bus for devices...
Found 0 device(s).
Marvell>> scsi reset

Reset SCSI
Error: SCSI Controller(s) 1B4B:9215 1B4B:9235 not found
** scsi detection can run only once - please reset board before running detection again **

Marvell>> scsi init
AHCI init for unit0
SATA link 0 timeout.
SATA link 1 timeout.

Error: SCSI Controller(s) 1B4B:9215 1B4B:9235 not found
scanning bus for devices...
Found 0 device(s).
Marvell>> scsi init
Error: SCSI Controller(s) 1B4B:9215 1B4B:9235 not found
** scsi detection can run only once - please reset board before running detection again **


Marvell>> mw.l f1018100 20420000
Marvell>> mw.l f1018140 003ca800
Marvell>> scsi init
AHCI init for unit0
SATA link 0 timeout.
SATA link 1 timeout.

Error: SCSI Controller(s) 1B4B:9215 1B4B:9235 not found
scanning bus for devices...
Found 0 device(s).

is there a way to find gpio?
Re: Debian on Synology RS816 (Armada 385)
December 17, 2020 04:42PM
bonk1990,

1. Which DTB are you using to boot this box? perhaps there is a HDD power GPIO in the DTS.

2. FInd the GPL source for this DS116. It should have GPIOs specifically assigned to this box in there somewhere.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian on Synology RS816 (Armada 385)
December 17, 2020 04:59PM
armada-385-synology-ds116.dtb

	reg_sata0: pwr-sata0 {
		compatible = "regulator-fixed";
		regulator-name = "pwr_en_sata0";
		regulator-min-microvolt = <12000000>;
		regulator-max-microvolt = <12000000>;
		enable-active-high;
		regulator-boot-on;
		gpio = <&gpio0 15 GPIO_ACTIVE_HIGH>;
I have no idea how to use it in "mw.l" command.
Re: Debian on Synology RS816 (Armada 385)
December 17, 2020 10:32PM
bonk1990,

First dump the memory content of these 2 memory banks: GPIO0 address f1018100 and GPIO1 address f1018140

md.l f1018100 1
md.l f1018140 1

And then modify the content of the GPIO0 to turn on the bit 15 (right to left, 0 to 31).

You want to set that bit 15 to 1. Do this temporarily on a notepad, The result is xxx.

And then write the result xxx back to the memory address f1018100

mw.l f1018100 xxx

======

Example on the NAS326 thread to set GPIO 29 for HHD1 power:

https://forum.doozan.com/read.php?2,27108,30681#msg-30681


GPIO0:

0000 0000 0100 0010 0000 0000 0000 0000
0010 0000 0100 0010 0000 0000 0000 0000
  ^
 HDD1

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian on Synology RS816 (Armada 385)
December 18, 2020 08:43AM
Marvell>> md.l f1018100 1
f1018100: 00000000    ....
Marvell>> md.l f1018140 1
f1018140: 00040000    ....

So:
mw.l f1018100 00080000

But:
Marvell>> mw.l f1018100 00080000
Marvell>> scsi reset

Reset SCSI
AHCI init for unit0
SATA link 0 timeout.
SATA link 1 timeout.

Error: SCSI Controller(s) 1B4B:9215 1B4B:9235 not found
scanning bus for devices...
Found 0 device(s).


EDIT:
I have tried HDD. Power is off, there is no "clicking".



Edited 1 time(s). Last edit at 12/18/2020 09:07AM by bonk1990.
Re: Debian on Synology RS816 (Armada 385)
December 18, 2020 04:08PM
I have tested every bit.

This is correct command:
mw.l f1018100 00008000

So GPIO number 23... Don't know why, but it is.

Marvell>> mw.l f1018100 00008000
Marvell>> scsi reset

Reset SCSI
AHCI init for unit0
Target spinup took 0 ms.
SATA link 1 timeout.

Error: SCSI Controller(s) 1B4B:9215 1B4B:9235 not found
scanning bus for devices...
  Device 0: (0:0) Vendor: ATA Prod.: ST4000VN008-2DR1 Rev: SC60
            Type: Hard Disk
            Capacity: 3815447.8 MB = 3726.0 GB (7814037168 x 512)
Found 1 device(s).



Edited 1 time(s). Last edit at 12/18/2020 04:15PM by bonk1990.
Re: Debian on Synology RS816 (Armada 385)
December 18, 2020 05:27PM
My test:
Press Ctrl+C to abort autoboot in 3 second
Marvell>> mw.l f1018100 00008000
Marvell>> setenv load_image_addr 0x02000000
Marvell>> setenv load_initrd_addr 0x3000000
Marvell>> setenv load_image 'echo loading uImage from raw HDD ...; scsi device 0                  ; scsi read $load_image_addr 0x5000 0x2F00'
Marvell>> setenv load_initrd 'echo loading uInitrd from raw HDD ...; scsi device                   0; scsi read $load_initrd_addr 0xA000 0x4F00'
Marvell>> setenv set_bootargs 'setenv bootargs "console=ttyS0,115200 root=LABEL=                  rootfs rootdelay=10 $mtdparts earlyprintk=serial"'
Marvell>> setenv bootcmd_exec 'echo Booting Debian ...; run set_bootargs; setenv                   fdt_skip_update yes; setenv initrd_high 0xffffffff; run load_image; run load_in                  itrd; bootm $load_image_addr $load_initrd_addr'
Marvell>> setenv bootcmd 'scsi init; run bootcmd_exec; echo Booting Stock OS ...                  ; run bootspi'
Marvell>> boot
AHCI init for unit0
Target spinup took 0 ms.
SATA link 1 timeout.

Error: SCSI Controller(s) 1B4B:9215 1B4B:9235 not found
scanning bus for devices...
  Device 0: (0:0) Vendor: ATA Prod.: ADATA SP600 Rev: 2.9
            Type: Hard Disk
            Capacity: 30533.8 MB = 29.8 GB (62533296 x 512)
Found 1 device(s).
Booting Debian ...
loading uImage from raw HDD ...

SCSI device 0:
    Device 0: (0:0) Vendor: ATA Prod.: ADATA SP600 Rev: 2.9
            Type: Hard Disk
            Capacity: 30533.8 MB = 29.8 GB (62533296 x 512)
... is now current device

SCSI read: device 0 block # 20480, count 12032 ... 12032 blocks read: OK
loading uInitrd from raw HDD ...

SCSI device 0:
    Device 0: (0:0) Vendor: ATA Prod.: ADATA SP600 Rev: 2.9
            Type: Hard Disk
            Capacity: 30533.8 MB = 29.8 GB (62533296 x 512)
... is now current device

SCSI read: device 0 block # 40960, count 20224 ... 20224 blocks read: OK
## Booting kernel from Legacy Image at 02000000 ...
   Image Name:   Linux-5.2.9-mvebu-tld-1
   Created:      2020-12-18  23:22:08 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    5075421 Bytes = 4.8 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
## Loading init Ramdisk from Legacy Image at 03000000 ...
   Image Name:   initramfs-5.2.9-mvebu-tld-1
   Created:      2019-08-26  11:03:27 UTC
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    9488554 Bytes = 9 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... Bad Data CRC
Ramdisk image is corrupt or invalid
Booting Stock OS ...
Re: Debian on Synology RS816 (Armada 385)
December 19, 2020 12:24AM
bonk1990,

Quote

> AHCI init for unit0
> Target spinup took 0 ms.
> SATA link 1 timeout.
>
> Error: SCSI Controller(s) 1B4B:9215 1B4B:9235 not
> found
> scanning bus for devices...
> Device 0: (0:0) Vendor: ATA Prod.: ADATA SP600
> Rev: 2.9
> Type: Hard Disk
> Capacity: 30533.8 MB = 29.8 GB
> (62533296 x 512)
> Found 1 device(s).

Great progress!

So GPIO 23 is the correct one.

But is it really a 29.8 GB HDD?


Quote

> Booting Debian ...
> loading uImage from raw HDD ...
> 
> SCSI device 0:
>     Device 0: (0:0) Vendor: ATA Prod.: ADATA SP600
> Rev: 2.9
>             Type: Hard Disk
>             Capacity: 30533.8 MB = 29.8 GB
> (62533296 x 512)
> ... is now current device
> 
> SCSI read: device 0 block # 20480, count 12032 ...
> 12032 blocks read: OK
> loading uInitrd from raw HDD ...
> 
> SCSI device 0:
>     Device 0: (0:0) Vendor: ATA Prod.: ADATA SP600
> Rev: 2.9
>             Type: Hard Disk
>             Capacity: 30533.8 MB = 29.8 GB
> (62533296 x 512)
> ... is now current device
> 
> SCSI read: device 0 block # 40960, count 20224 ...
> 20224 blocks read: OK
> ## Booting kernel from Legacy Image at 02000000
> ...
>    Image Name:   Linux-5.2.9-mvebu-tld-1
>    Created:      2020-12-18  23:22:08 UTC
>    Image Type:   ARM Linux Kernel Image
> (uncompressed)
>    Data Size:    5075421 Bytes = 4.8 MiB
>    Load Address: 00008000
>    Entry Point:  00008000
>    Verifying Checksum ... OK
> ## Loading init Ramdisk from Legacy Image at
> 03000000 ...
>    Image Name:   initramfs-5.2.9-mvebu-tld-1
>    Created:      2019-08-26  11:03:27 UTC
>    Image Type:   ARM Linux RAMDisk Image (gzip
> compressed)
>    Data Size:    9488554 Bytes = 9 MiB
>    Load Address: 00000000
>    Entry Point:  00000000
>    Verifying Checksum ... Bad Data CRC
> Ramdisk image is corrupt or invalid
> Booting Stock OS ...
> 

So the load address needs to be adjusted in this u-boot. Let me think about it and look at the log and come back.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian on Synology RS816 (Armada 385)
December 19, 2020 01:23AM
I was testing with 4TB HDD because I wanted to hear that disk was powered up. After that I switch to 32GB SSD. It is correct size.
Re: Debian on Synology RS816 (Armada 385)
December 19, 2020 01:27AM
Boot procedure with USB and tftp works fine. And it is the same address?
setenv ipaddr 192.168.1.19
setenv serverip 192.168.1.20
setenv usb_setup 'setenv usbActive 1; setenv usbType 3; usb start;'                
setenv load_initrd_addr 0x3000000
setenv load_image_addr 0x02000000
setenv load_image 'echo loading uImage from tftpserver ...; tftpboot $load_image_addr uImage'
setenv load_initrd 'echo loading uInitrd from tftpserver ...; tftpboot $load_initrd_addr uInitrd'
setenv set_bootargs 'setenv bootargs "console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts earlyprintk=serial"'
setenv bootcmd_exec 'echo Booting Debian . . .; run usb_setup;  run set_bootargs; setenv fdt_skip_update yes; setenv initrd_high 0xffffffff; run load_image; run load_initrd; bootm $load_image_addr $load_initrd_addr'
setenv bootcmd 'run bootcmd_exec; run bootspi'
boot

Re: Debian on Synology RS816 (Armada 385)
December 19, 2020 02:05AM
bonk,

> Boot procedure with USB and tftp works fine. And
> it is the same address?

It looks the same addresses for both uImage and uInitrd as in USB boot envs.

So back track to your flashing uInitrd to the HDD. Double check that part to see if it was written to the correct location.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian on Synology RS816 (Armada 385)
December 19, 2020 07:28PM
I don't know what is wrong yet, but I have a question.
If (in future) i want to update kernel i need to zero first 50MB of HDD every time (every kernel update)? If i'm not wrong this command break partition table on HDD.

Second question: usb rootfs
How to update kernel? By this procedure?
cd /boot
dd if=uImage of=rs816.uImage.mtd2.kwb bs=7104k conv=sync
flashcp -v rs816.uImage.mtd2.kwb /dev/mtd2
Re: Debian on Synology RS816 (Armada 385)
December 19, 2020 09:38PM
bonk1990,

> If (in future) i want to update kernel i need to
> zero first 50MB of HDD every time (every kernel
> update)? If i'm not wrong this command break
> partition table on HDD.

You only need to overwrite the uImage and uInitrd at their locations.

> Second question: usb rootfs
> How to update kernel? By this procedure?
>
> cd /boot
> dd if=uImage of=rs816.uImage.mtd2.kwb bs=7104k
> conv=sync
> flashcp -v rs816.uImage.mtd2.kwb /dev/mtd2
>

Right, update the kernel while the system is running. That will give you new uImage in /boot. And then write it to flash like above.

=====

Now it's time to discuss the uInitrd loading. The installation procedure for both USB is a little bit incomplete. Because we did not write uInitrd to flash, and when you boot the box the 2nd time and after, it does not load unitrd. Instead we relies on the bootargs to tell the kernel that the rootfs is on /dev/sda1:

setenv set_bootargs 'setenv bootargs "console=ttyS0,115200 root=/dev/sda1 rootdelay=10 $mtdparts earlyprintk=serial"'

The USB installation was really written just enough to get you booting the USB rootfs. But in reality, the modules in initrd were not loaded automatically at boot time. And you cannot use the bootargs root=LABEL=rootfs to tell the kernel where the rootfs is in a flexible way.

With the HDD installation, we load both uImage and uInitrd, so the root=LABEL=rootfs works as intended.

So the best way to boot this box with stock u-boot is booting from the HDD raw sectors.

Of course, if we have the GPL source and rebuild stock u-boot to support USB and HDD, we will not need to use raw sectors.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian on Synology RS816 (Armada 385)
December 20, 2020 01:25AM
Re: Debian on Synology RS816 (Armada 385)
December 20, 2020 03:03AM
Re: Debian on Synology RS816 (Armada 385)
December 21, 2020 02:00AM
bodhi Wrote:
-------------------------------------------------------
> bonk,
>
> This looks promising:
>
> https://sourceforge.net/projects/dsgpl/files/Synology%20NAS%20GPL%20Source/24922branch/armada38x-source/u-boot-armada-2011.12.txz/download
>
> I've downloaded it. Will take a look.


No luck. It is for Armada XP and 370.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian on Synology RS816 (Armada 385)
December 21, 2020 02:21AM
To bad. Thanks for info.

Maybe u-boot-mv-3.6.0.txz? Maybe -mv means Marvell?
Re: Debian on Synology RS816 (Armada 385)
December 21, 2020 03:42AM
Regarding u-boot-mv-3.6.0.txz. mv means Marvell. But this is for the Kirkwood boxes.

Let me see if I can spend sometime later to look closer in the u-boot-armada-2011.12.txz. I found it quite strange that it is under armada38x-source:

https://sourceforge.net/projects/dsgpl/files/Synology%20NAS%20GPL%20Source/24922branch/armada38x-source/

but the RS816 and DS116 don't have a build script. Only other Synology boxes that use Armada 370 and XP have a build script.

And I guess you can also ask Synology to provide GPL source for your box u-boot. It is a custom build for u-boot 2013.01.

Quote

U-Boot 2013.01-g6cc0a6d (Jan 29 2016 - 17:30:11) Marvell version: 2015_T1.0p16

Board: SYNO-DS116

They are obligated to provide GPL source to the purchasers of their products.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian on Synology RS816 (Armada 385)
December 21, 2020 04:01AM
bodhi Wrote:
-------------------------------------------------------
> I found
> it quite strange that it is under
> armada38x-source:
>
> https://sourceforge.net/projects/dsgpl/files/Synology%20NAS%20GPL%20Source/24922branch/armada38x-source/
>
> but the RS816 and DS116 don't have a build script.
> Only other Synology boxes that use Armada 370 and
> XP have a build script.

Indeed, it is strange. In that location we can find:
u-boot-mv-3.6.0.txz
u-boot-mv-3.5.9.txz
u-boot-mv-3.5.3.txz
u-boot-mv-3.4.27.txz
u-boot-armada-2011.12.txz
u-boot-mv-3.4.4.txz
u-boot-1.3.3.txz

> And I guess you can also ask Synology to provide
> GPL source for your box u-boot. It is a custom
> build for u-boot 2013.01.

I have send a request do Synology.
Author:

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: