Debian on Synology DS216
April 08, 2024 04:46AM
Hi everyone,
I recently found a Synology DS216 and discovered that the software in it was really outdated, so i started to search if there was a way to put a fresh debian on it. Apparently no efforts has been put on this device so far, so i started to hack it by myself. Familiar with kirkwood device hacking, i found many interesting details about the MVEBU platforms on this forum.
I got it to boot your latest debian rootimage ("Debian-6.6.2-mvebu-tld-1-rootfs-bodhi.tar.bz2" at the time i write this) and so far what matters the most seems to work fine.
This topic will begin as a log for my findings, and the particularities of this device.

1 - UART TTL INTERFACE

The first step for me was to get a proper serial debug interface to deal with the stock marvell u-boot and inspect the stock bootlog. The device is fitted with a 6x2 2.0mm pitch 90° pin header one can access through a vent on the bottom of the case. It's very convenient and the pinout is quite consistent across Synology devices. On the PCB this header is labelled J4 and pins are numbered from 1 to 6.

5 3 1
6 4 2 -- PCB side

  1. 3.3V
  2. GND
  3. NC
  4. UART TX
  5. NC
  6. UART RX

Using a Nanjing Qinheng CH341B based interface in USB to UART mode and proper wiring (GND-->GND, TX-->RX, RX-->TX), i got the interface up and running with picocom set at a 115200 baud rate and default options (8N1), as usual with Marvell devices.


2 - STOCK BOOTLOG

I got the device with no drives, so both bays were unpopulated during this boot sequence.
BootROM - 1.73
Booting from SPI flash


General initialization - Version: 1.0.0
AVS selection from EFUSE disabled (Skip reading EFUSE values)
Overriding default AVS value to: 0x23
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      |
 |   2    |  6   |  SATA1      |
 |   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
BootROM: Image checksum verification PASSED

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


U-Boot 2013.01-g74a026b-dirty (Dec 30 2015 - 14:38:52) Marvell version: 2015_T1.0p16

Board: SYNO-DS216
SoC:   MV88F6820 Rev A0
       running 2 CPUs
CPU:   ARM Cortex A9 MPCore (Rev 1) LE
       CPU 0
       CPU    @ 1332 [MHz]
       L2     @ 666 [MHz]
       TClock @ 250 [MHz]
       DDR3    @ 666 [MHz]
       DDR3 32 Bit Width,FastPath Memory Access, DLB Enabled, ECC Disabled
DRAM:  512 MiB
MMC:   mv_sdh: 0
SF: Detected N25Q64 with page size 64 KiB, total 8 MiB
*** Warning - bad CRC, using default environment

USB2.0 0: Host Mode
USB3.0 0: Host Mode
USB3.0 1: Host Mode

Map:   Code:			0x1ff3b000:0x1ffc915c
       BSS:			0x1ffef688
       Stack:			0x1fa2af20
       Heap:			0x1fa2b000:0x1ff3b000
       U-Boot Environment:	0x007e0000:0x007f0000 (SPI)

Board configuration detected:

Synology Model: DS216

Net:   
|  port  | Interface | PHY address  |
|--------|-----------|--------------|
| egiga0 |   SGMII   |     0x01     |
egiga0 [PRIME]
Press Ctrl+C to abort autoboot in 3 second
(Re)start USB controller...
USB0:   Port (usbActive) : 0	Interface (usbType = 3) : USB XHCI 1.00
USB1:   Port (usbActive) : 1	Interface (usbType = 3) : USB XHCI 1.00
SF: Detected N25Q64 with page size 64 KiB, total 8 MiB
## Booting kernel from Legacy Image at 02000000 ...
   Image Name:   Linux-3.10.105
   Created:      2023-03-21  14:22:52 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2567672 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_ds216 25556
   Created:      2023-04-21  10:30:47 UTC
   Image Type:   ARM Linux RAMDisk Image (uncompressed)
   Data Size:    3527673 Bytes = 3.4 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 Ramdisk to 1f6cc000, end 1fa293f9 ... OK
   Loading Device Tree to 00ff9000, end 00fffa43 ... 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@build8) (gcc version 4.9.3 20150311 (prerelease) (crosstool-NG 1.20.0) ) #25556 SMP Tue Mar 21 22:22:28 CST 2023
[    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 DS216
[    0.000000] Memory policy: ECC disabled, Data cache writealloc
[    0.000000] PERCPU: Embedded 7 pages/cpu @80adf000 s7168 r8192 d13312 u32768
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 130048
[    0.000000] Kernel command line: console=ttyS0,115200 ip=off initrd=0x3000000 root=/dev/md0 rw HddHotplug=2 syno_hw_version=DS216 hd_power_on_seq=2 ihd_num=2 netif_num=1 syno_hdd_detect=39,40 syno_hdd_enable=26,27 flash_size=8
[    0.000000] Support HDD Hotplug.
[    0.000000] Synology Hardware Version: DS216-j
[    0.000000] Internal HD num: 2
[    0.000000] Internal netif num: 1
[    0.000000] SYNO GPIO hdd detect pin: 39 40 
[    0.000000] SYNO GPIO hdd enable pin: 26 27 
[    0.000000] PID hash table entries: 2048 (order: 1, 8192 bytes)
[    0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
[    0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
[    0.000000] allocated 1048576 bytes of page_cgroup
[    0.000000] please try 'cgroup_disable=memory' option if you don't want memory cgroups
[    0.000000] Memory: 512MB = 512MB total
[    0.000000] Memory: 508180k/508180k available, 16108k 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 : 0xa0800000 - 0xfff00000   (1527 MB)
[    0.000000]     lowmem  : 0x80000000 - 0xa0000000   ( 512 MB)
[    0.000000]     modules : 0x7f000000 - 0x80000000   (  16 MB)
[    0.000000]       .text : 0x80008000 - 0x805fc1bc   (6097 kB)
[    0.000000]       .init : 0x805fd000 - 0x80636c00   ( 231 kB)
[    0.000000]       .data : 0x80638000 - 0x8066ec80   ( 220 kB)
[    0.000000]        .bss : 0x8066ec80 - 0x806d4f84   ( 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.000442] Calibrating delay loop... 2655.84 BogoMIPS (lpj=13279232)
[    0.060027] pid_max: default: 32768 minimum: 301
[    0.060079] Security Framework initialized
[    0.060089] AppArmor: AppArmor initialized
[    0.060108] Mount-cache hash table entries: 512
[    0.060464] Initializing cgroup subsys memory
[    0.060481] Disabling memory control group subsystem
[    0.060485] Initializing cgroup subsys devices
[    0.060489] Initializing cgroup subsys freezer
[    0.060493] Initializing cgroup subsys blkio
[    0.060517] CPU: Testing write buffer coherency: ok
[    0.060632] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[    0.060666] Setting up static identity map for 0x8047e320 - 0x8047e378
[    0.060807] mvebu-pmsu: Initializing Power Management Service Unit
[    0.060841] Initializing CPU Reset module
[    0.061503] CPU1: Booted secondary processor
[    0.120603] CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
[    0.120664] Brought up 2 CPUs
[    0.120673] SMP: Total of 2 processors activated (5311.69 BogoMIPS).
[    0.120676] CPU: All CPU(s) started in SVC mode.
[    0.120971] devtmpfs: initialized
[    0.123422] mvebu-soc-id: MVEBU SoC ID=0x6820, Rev=0x4
[    0.123609] xor: measuring software checksum speed
[    0.220484]    arm4regs  :  2365.600 MB/sec
[    0.320384]    8regs     :  1630.400 MB/sec
[    0.420284]    32regs    :  1658.800 MB/sec
[    0.420288] xor: using function: arm4regs (2365.600 MB/sec)
[    0.420293] pinctrl core: initialized pinctrl subsystem
[    0.420577] regulator-dummy: no parameters
[    0.420740] NET: Registered protocol family 16
[    0.421330] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.423457] irq: Cannot allocate irq_descs @ IRQ194, assuming pre-allocated
[    0.423818] irq: Cannot allocate irq_descs @ IRQ226, assuming pre-allocated
[    0.426654] hw-breakpoint: found 5 (+1 reserved) breakpoint and 1 watchpoint registers.
[    0.426660] hw-breakpoint: maximum watchpoint size is 4 bytes.
[    0.433719] bio: create slab <bio-0> at 0
[    0.600197] raid6: int32x1  gen()   191 MB/s
[    0.769939] raid6: int32x1  xor()   132 MB/s
[    0.939855] raid6: int32x2  gen()   267 MB/s
[    1.109670] raid6: int32x2  xor()   168 MB/s
[    1.279466] raid6: int32x4  gen()   272 MB/s
[    1.449342] raid6: int32x4  xor()   191 MB/s
[    1.619127] raid6: int32x8  gen()   303 MB/s
[    1.788943] raid6: int32x8  xor()   193 MB/s
[    1.788946] raid6: using algorithm int32x8 gen() (303 MB/s)
[    1.788949] raid6: .... xor() 193 MB/s, rmw enabled
[    1.788953] raid6: using intx1 recovery algorithm
[    1.789125] mvebu-pcie pcie-controller.3: PCIe0.0: link down
[    1.789146] mvebu-pcie pcie-controller.3: PCIe1.0: link down
[    1.789267] mvebu-pcie pcie-controller.3: PCI host bridge to bus 0000:00
[    1.789276] pci_bus 0000:00: root bus resource [io  0x1000-0xfffff]
[    1.789282] pci_bus 0000:00: root bus resource [mem 0xe0000000-0xe7ffffff]
[    1.789288] pci_bus 0000:00: root bus resource [bus 00-ff]
[    1.789539] PCI: bus0: Fast back to back transfers disabled
[    1.789547] pci 0000:00:01.0: bridge configuration invalid ([bus 00-00]), reconfiguring
[    1.789553] pci 0000:00:02.0: bridge configuration invalid ([bus 00-00]), reconfiguring
[    1.789641] PCI: bus1: Fast back to back transfers enabled
[    1.789739] PCI: bus2: Fast back to back transfers enabled
[    1.789768] pci 0000:00:01.0: PCI bridge to [bus 01]
[    1.789776] pci 0000:00:02.0: PCI bridge to [bus 02]
[    1.789784] PCI: enabling device 0000:00:01.0 (0140 -> 0143)
[    1.789790] PCI: enabling device 0000:00:02.0 (0140 -> 0143)
[    1.790316] SCSI subsystem initialized
[    1.791427] Switching to clocksource armada_370_xp_clocksource
[    1.791623] AppArmor: AppArmor Filesystem Enabled
[    1.792718] NET: Registered protocol family 2
[    1.793076] TCP established hash table entries: 4096 (order: 3, 32768 bytes)
[    1.793119] TCP bind hash table entries: 4096 (order: 3, 32768 bytes)
[    1.793157] TCP: Hash tables configured (established 4096 bind 4096)
[    1.793179] TCP: reno registered
[    1.793185] UDP hash table entries: 256 (order: 1, 8192 bytes)
[    1.793197] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
[    1.793287] NET: Registered protocol family 1
[    1.793422] RPC: Registered named UNIX socket transport module.
[    1.793427] RPC: Registered udp transport module.
[    1.793431] RPC: Registered tcp transport module.
[    1.793434] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    1.793536] Trying to unpack rootfs image as initramfs...
[    3.058874] Freeing initrd memory: 3444K (9f6cc000 - 9fa29000)
[    3.059108] hw perfevents: enabled with ARMv7 Cortex-A9 PMU driver, 7 counters available
[    3.060581] Initialise module verification
[    3.060620] audit: initializing netlink socket (disabled)
[    3.060646] type=2000 audit(3.050:1): initialized
[    3.061939] VFS: Disk quotas dquot_6.5.2
[    3.061996] Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[    3.062298] NFS: Registering the id_resolver key type
[    3.062316] Key type id_resolver registered
[    3.062320] Key type id_legacy registered
[    3.062341] msgmni has been set to 999
[    3.062931] async_tx: api initialized (async)
[    3.062938] Key type asymmetric registered
[    3.062942] Asymmetric key parser 'x509' registered
[    3.063132] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 254)
[    3.063138] io scheduler noop registered
[    3.063152] io scheduler cfq registered (default)
[    3.064023] armada-38x-pinctrl f1018000.pinctrl: registered pinctrl driver
[    3.064576] mv_xor f1060800.xor: Marvell shared XOR driver
[    3.101850] mv_xor f1060800.xor: Marvell XOR (Descriptor Mode): ( xor cpy intr pq )
[    3.131789] mv_xor f1060800.xor: freeing 1 in use descriptors!
[    3.131800] mv_xor f1060800.xor: Marvell XOR (Descriptor Mode): ( intr crc32c )
[    3.132914] mv_xor f1060900.xor: Marvell shared XOR driver
[    3.171780] mv_xor f1060900.xor: Marvell XOR (Descriptor Mode): ( xor cpy intr pq )
[    3.201782] mv_xor f1060900.xor: freeing 1 in use descriptors!
[    3.201792] mv_xor f1060900.xor: Marvell XOR (Descriptor Mode): ( intr crc32c )
[    3.203392] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
[    3.225370] f1012000.serial: ttyS0 at MMIO 0xf1012000 (irq = 44) is a 16550A
[    4.043784] console [ttyS0] enabled
[    4.067802] f1012100.serial: ttyS1 at MMIO 0xf1012100 (irq = 45) is a 16550A
[    4.085227] brd: module loaded
[    4.088292] Loading iSCSI transport class v2.0-870.
[    4.095868] ahci_mv f10a8000.sata: AHCI 0001.0000 32 slots 2 ports 6 Gbps 0x3 impl platform mode
[    4.104703] ahci_mv f10a8000.sata: flags: 64bit ncq sntf led only pmp fbs pio slum part sxs 
[    4.115148] scsi0 : ahci_mv_platform
[    4.119315] scsi1 : ahci_mv_platform
[    4.123415] ata1: SATA max UDMA/133 mmio [mem 0xf10a8000-0xf10a9fff] port 0x100 irq 58
[    4.131352] ata2: SATA max UDMA/133 mmio [mem 0xf10a8000-0xf10a9fff] port 0x180 irq 58
[    4.481455] ata1: SATA link down (SStatus 0 SControl 300)
[    4.486869] ata1: Disk is not present for SATA link down event
[    4.841453] ata2: SATA link down (SStatus 0 SControl 300)
[    4.846864] ata2: Disk is not present for SATA link down event
[    4.855967] m25p80 spi0.0: n25q064 (8192 Kbytes)
[    4.860613] Searching for RedBoot partition table in spi0.0 at offset 0x7f0000
[    4.964712] 6 RedBoot partitions found on MTD device spi0.0
[    4.970297] Creating 6 MTD partitions on "spi0.0":
[    4.975138] 0x000000000000-0x0000000f0000 : "RedBoot"
[    4.981369] 0x0000000f0000-0x0000003c0000 : "zImage"
[    4.987545] 0x0000003c0000-0x0000007d0000 : "rd.gz"
[    4.993555] 0x0000007d0000-0x0000007e0000 : "vendor"
[    4.998978] vender Mac0 address : 00:11:32:64:7b:d6
[    5.003887] vender Mac1 doesn't set ucSum:0x00 Buf:0x00 Sum:0.
[    5.009733] vender Mac2 doesn't set ucSum:0x00 Buf:0x00 Sum:0.
[    5.015583] vender Mac3 doesn't set ucSum:0x00 Buf:0x00 Sum:0.
[    5.021429] serial number='1680NON568801'
[    5.026434] 0x0000007e0000-0x0000007f0000 : "RedBoot Config"
[    5.033508] 0x0000007f0000-0x000000800000 : "FIS directory"
[    5.043489] SoC: model = 0x6820, revision = 0x4
[    5.048094] mvPncVirtBase = 0xa0c00000, pncTcamSize = 1024
[    5.053613]   o 3 Giga ports supported
[    5.057369]   o SKB recycle supported for SWF (Disabled)
[    5.062729]   o NETA acceleration mode 4
[    5.066659]   o BM supported for CPU: 4 BM pools
[    5.071284]   o PnC supported (Enabled)
[    5.075131]   o RX Queue support: 8 Queues * 512 Descriptors
[    5.080801]   o TX Queue support: 8 Queues * 1024 Descriptors
[    5.086561]   o GSO supported
[    5.089532]   o GRO supported
[    5.092506]   o Receive checksum offload supported
[    5.097306]   o Transmit checksum offload supported
[    5.102196]   o Driver ERROR statistics enabled
[    5.106734]   o Driver INFO statistics enabled
[    5.111184]   o Driver DEBUG statistics enabled
[    5.115725] 
[    5.118218] port #0: is_sgmii=1, is_rgmii=0, phy_addr=1
[    5.123494]   o Loading network interface(s) for port #0: cpu_mask=0x3, tx_csum_limit=9800
[    5.131796] 
[    5.133289]   o Port 0 is connected to Linux netdevice
[    5.142853]     o eth0, ifindex = 2, GbE port = 0
[    5.147585]     o eth0, phy chipid = 1410dd0, Support WOL = 32
[    5.156853] 	giga p=0: mtu=1500, mac=00:50:43:02:02:01 (platform)
[    5.162973] 
[    5.164949] libphy: orion_mdio_bus: probed
[    5.170463] mdio_bus f1072004.mdio-mi: cannot get PHY at address 0
[    5.178039] mvebu-rtc f10a3800.rtc: rtc core: registered f10a3800.rtc as rtc0
[    5.241639] i2c /dev entries driver
[    5.645470] Syno_HddMon: Initialization completed.
[    5.660341] armada_thermal f10e4078.thermal: Overheat threshold between 92..107
[    5.668289] md: linear personality registered for level -1
[    5.673804] md: raid0 personality registered for level 0
[    5.679130] md: raid1 personality registered for level 1
[    5.684462] md: raid10 personality registered for level 10
[    5.690171] md: raid6 personality registered for level 6
[    5.695510] md: raid5 personality registered for level 5
[    5.700833] md: raid4 personality registered for level 4
[    5.706404] device-mapper: ioctl: 4.25.0-ioctl (2013-06-26) initialised: dm-devel@redhat.com
[    5.714877] cpuidle: using governor ladder
[    5.719252] armada-cesa-ocf f109d000.crypto: mv_get_cesa_resources: Total CESA HW channels supported 2
[    5.728599] armada-cesa-ocf f109d000.crypto: mv_get_cesa_resources: CESA feature: chain(0)
[    5.737097] mvCesaInit: channels=2, session=640, queue=256
[    5.753573] armada-cesa-ocf f109d000.crypto: cesa_ocf_probe: CESA driver operate in ocf(0) mode
[    5.763013] cesadev_init(8061baf4)
[    5.767162] TCP: cubic registered
[    5.770487] NET: Registered protocol family 17
[    5.775021] Key type dns_resolver registered
[    5.779379] VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 4
[    5.787099] Registering suspend init for this board failed
[    5.795323] Loading module verification blacklist certificates
[    5.801180] Loading module verification certificates
[    5.806237] MODSIGN: Loaded cert 'Synology SDG kernel module signing key: 7bd0b0d6bcd31651c22ce3978bdc8c8bdc417329'
[    5.821884] MODSIGN: Loaded cert 'Synology Root Certification Authority: f2c075361f168425f8b5ef31b796406c3aab2089'
[    5.832296] MODSIGN: Loaded cert 'Synology Kernel Module Signing Certification Authority: 600839b5d127e0e11d817a31f0575d323a7c0e28'
[    5.844184] MODSIGN: Loaded cert 'Synology kernel module signing key: 4646ce54489669338118a3b1286da156ac366fa5'
[    5.854313] registered taskstats version 1
[    5.858456] regulator-dummy: disabling
[    5.862531] Freeing unused kernel memory: 228K (805fd000 - 80636000)
START /linuxrc.syno
Insert basic USB modules...
:: Loading module usb-common ... [  OK  ]
:: Loading module usbcore[    6.040741] usbcore: registered new interface driver usbfs
[    6.047190] usbcore: registered new interface driver hub
[    6.060398] usbcore: registered new device driver usb
 ... [  OK  ]
:: Loading module ehci-hcd[    6.108754] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
 ... [  OK  ]
:: Loading module xhci-hcd[    6.152281] xhci-hcd f10f0000.usb3: failed to get Vbus gpio
[    6.157877] xhci-hcd f10f0000.usb3: USB2 Vbus gpio -1
[    6.162973] xhci-hcd f10f0000.usb3: power control disabled
[    6.168474] xhci-hcd f10f0000.usb3: xHCI Host Controller
[    6.173817] xhci-hcd f10f0000.usb3: new USB bus registered, assigned bus number 1
[    6.181550] xhci-hcd f10f0000.usb3: irq 48, io mem 0xf10f0000
[    6.189673] hub 1-0:1.0: USB hub found
[    6.193487] hub 1-0:1.0: 1 port detected
[    6.197559] xhci-hcd f10f0000.usb3: USB3 Vbus gpio -1
[    6.202644] xhci-hcd f10f0000.usb3: power control disabled
[    6.208148] xhci-hcd f10f0000.usb3: xHCI Host Controller
[    6.213501] xhci-hcd f10f0000.usb3: new USB bus registered, assigned bus number 2
[    6.223392] hub 2-0:1.0: USB hub found
[    6.227173] hub 2-0:1.0: 1 port detected
[    6.231268] xhci-hcd f10f8000.usb3: failed to get Vbus gpio
[    6.236902] xhci-hcd f10f8000.usb3: USB2 Vbus gpio -1
[    6.241989] xhci-hcd f10f8000.usb3: power control disabled
[    6.247495] xhci-hcd f10f8000.usb3: xHCI Host Controller
[    6.252857] xhci-hcd f10f8000.usb3: new USB bus registered, assigned bus number 3
[    6.263166] xhci-hcd f10f8000.usb3: irq 49, io mem 0xf10f8000
[    6.275373] hub 3-0:1.0: USB hub found
[    6.279155] hub 3-0:1.0: 1 port detected
[    6.283235] xhci-hcd f10f8000.usb3: USB3 Vbus gpio -1
[    6.288307] xhci-hcd f10f8000.usb3: power control disabled
[    6.293840] xhci-hcd f10f8000.usb3: xHCI Host Controller
[    6.299182] xhci-hcd f10f8000.usb3: new USB bus registered, assigned bus number 4
[    6.309589] hub 4-0:1.0: USB hub found
[    6.313389] hub 4-0:1.0: 1 port detected
 ... [  OK  ]
:: Loading module ehci-orion[    6.381079] ehci-orion: EHCI orion driver
[    6.385264] orion-ehci f1058000.usb: failed to get Vbus gpio
[    6.390946] orion-ehci f1058000.usb: USB2 Vbus gpio -1
[    6.396118] orion-ehci f1058000.usb: power control disabled
[    6.401711] orion-ehci f1058000.usb: EHCI Host Controller
[    6.407132] orion-ehci f1058000.usb: new USB bus registered, assigned bus number 5
[    6.414790] orion-ehci f1058000.usb: irq 50, io mem 0xf1058000
[    6.431465] orion-ehci f1058000.usb: USB 2.0 started, EHCI 1.00
[    6.438056] hub 5-0:1.0: USB hub found
[    6.441885] 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(Mindspeed only)...
[    6.501093] ds216_synobios: module license 'Synology Inc.' taints kernel.
[    6.507955] Disabling lock debugging due to kernel taint
[    6.514030] Synobios DS216 GPIO initialized
[    6.524179] correction with 0x00
[    6.579939] 2000-1-2 18:31:43 UTC
[    6.583273] synobios: load, major number 201
[    6.587555] Brand: Synology
[    6.590373] Model: DS-216
[    6.593014] This is default settings: set group disks wakeup number to 1, spinup time deno 1
[    6.601495] synobios cpu_arch proc entry initialized
[    6.606471] synobios crypto_hw proc entry initialized
[    6.611539] synobios syno_platform proc entry initialized
[    6.617017] synobios open /dev/ttyS1 success
Starting /usr/syno/bin/synocfgen...
/usr/syno/bin/synocfgen returns 0
[    6.636122] synobios: unload
Exit on error [1] DISK NOT INSTALLED...
Sun Jan  2 18:31:43 UTC 2000
none /sys/kernel/debug debugfs rw,relatime 0 0
sys /sys sysfs rw,relatime 0 0
none /dev devtmpfs rw,relatime,size=254088k,nr_inodes=63522,mode=755 0 0
proc /proc proc rw,relatime 0 0
linuxrc.syno failed on 1
starting pid 879, tty '': '/etc/rc'
:: Starting /etc/rc
:: Mounting procfs ... [  OK  ]
:: Mounting tmpfs ... [  OK  ]
:: Mounting devtmpfs ... [  OK  ]
:: Mounting devpts ... [  OK  ]
:: Mounting sysfs ... [  OK  ]
mdadm: error opening /dev/md1: No such file or directory
rc: Use all internal disk as swap.
rc: No internal disk installed.
swapon: can't stat '/dev/md1': No such file or directory
:: Loading module fat ... [  OK  ]
:: Loading module vfat ... [  OK  ]
[    7.259123] Synobios DS216 GPIO initialized
[    7.269323] correction with 0x00
[    7.325140] 2000-1-2 18:31:43 UTC
[    7.328463] synobios: load, major number 201
[    7.332762] Brand: Synology
[    7.335580] Model: DS-216
[    7.338214] This is default settings: set group disks wakeup number to 1, spinup time deno 1
[    7.346697] synobios cpu_arch proc entry initialized
[    7.351677] synobios crypto_hw proc entry initialized
[    7.356741] synobios syno_platform proc entry initialized
[    7.362221] synobios open /dev/ttyS1 success
mknod: /dev/synobios: File exists
Starting SW init...
/etc/rc: line 215: /usr/syno/bin/syno_le[    7.376504] synobios: unload
d_mask_on: not found
:: Loading module synobios[    8.086174] Synobios DS216 GPIO initialized
[    8.096324] correction with 0x00
[    8.152082] 2000-1-2 18:31:44 UTC
[    8.155407] synobios: load, major number 201
[    8.159688] Brand: Synology
[    8.162515] Model: DS-216
[    8.165151] This is default settings: set group disks wakeup number to 1, spinup time deno 1
[    8.173636] synobios cpu_arch proc entry initialized
[    8.178613] synobios crypto_hw proc entry initialized
[    8.183682] synobios syno_platform proc entry initialized
[    8.189157] synobios open /dev/ttyS1 success
 ... [  OK  ]
[    8.349367] eth0: mac address changed
[    8.413763] pool #0: pkt_size=1536, buf_size=1600 - 2048 of 2048 buffers added
[    8.421303] eth0: started
udhcpc (v1.16.1) started
eth0      Link encap:Ethernet  HWaddr 00:11:32:64:7B:D6  
          UP BROADCAST MULTICAST  MTU:1500  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:1024 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          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 305: /usr/syno/bin/syno_pstore_collect: not found
:: Starting scemd
:: 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/minissdpd -i eth0
eth0 not RUNNING
Running /usr/syno/etc/rc.d/J04synoagentregisterd.sh...
Starting synoagentregisterd...
Running /usr/syno/etc/rc.d/J30DisableNCQ.sh...
cat: can't open '/sys/block/sd*/device//model': No such file or directory
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[   16.583139] usbcore: registered new interface driver usb-storage
 ... [  OK  ]
============ Date ============
Sun Jan  2 18:31:52 UTC 2000
=
Sun Jan  2 18:31:53 2000

DiskStation login:

A first bootlog inspection shows the GPIOs used to enable power for the SATA hard drives:
[ 0.000000] SYNO GPIO hdd enable pin: 26 27

3 - GETTING DEBIAN UP AND RUNNING

Following the RS816/DS116 Installation Instruction Part II using the latest rootimage from Linux Kernel MVEBU package and Debian armhf rootfs, one can manage to get a debian up and running knowing a few specificities of the DS216.

Using the DS218j dtb, the device seems to work properly. Further tests are required and a separate dts/dtb for the DS216 may be required in the end in order to get everything working flawlessly.

Just like the Synology DS116, the bootcmd needs to be adjusted to activate the SATA power.
Dipping into how this line was adjusted for the DS116, one can find a great explanation.

Knowing the GPIOs used on the DS216 to enable HDD power thanks to the stock bootlog (GPIO0 26 and 27), I then adjusted the bootcmd accordingly:

setenv bootcmd 'mw.l f1018100 0C000000; scsi init; run bootcmd_exec; echo Booting Stock OS ...; run bootspi'

Here is the debian bootlog with the aforementioned configuration, both drive bays populated with different drives and ethernet unplugged:

Starting kernel ...

[    0.000000][    T0] Booting Linux on physical CPU 0x0
[    0.000000][    T0] Linux version 6.6.2-mvebu-tld-1 (root@tldDebian) (gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40) #1 SMP PREEMPT Mon Nov 20 18:44:27 PST 2023
[    0.000000][    T0] CPU: ARMv7 Processor [414fc091] revision 1 (ARMv7), cr=10c5387d
[    0.000000][    T0] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000][    T0] OF: fdt: Machine model: Synology DS218j
[    0.000000][    T0] printk: bootconsole [earlycon0] enabled
[    0.000000][    T0] Memory policy: Data cache writealloc
[    0.000000][    T0] Zone ranges:
[    0.000000][    T0]   Normal   [mem 0x0000000000000000-0x000000001fffffff]
[    0.000000][    T0]   HighMem  empty
[    0.000000][    T0] Movable zone start for each node
[    0.000000][    T0] Early memory node ranges
[    0.000000][    T0]   node   0: [mem 0x0000000000000000-0x000000001fffffff]
[    0.000000][    T0] Initmem setup node 0 [mem 0x0000000000000000-0x000000001fffffff]
[    0.000000][    T0] percpu: Embedded 29 pages/cpu s25364 r8192 d85228 u118784
[    0.000000][    T0] Kernel command line: console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 mtdparts=spi0.0:4m(boot),-(spi-rootfs) earlyprintk=serial
[    0.000000][    T0] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    0.000000][    T0] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes, linear)
[    0.000000][    T0] Built 1 zonelists, mobility grouping on.  Total pages: 129920
[    0.000000][    T0] mem auto-init: stack:off, heap alloc:on, heap free:off
[    0.000000][    T0] Memory: 495040K/524288K available (10240K kernel code, 873K rwdata, 3492K rodata, 1024K init, 314K bss, 29248K reserved, 0K cma-reserved, 0K highmem)
[    0.000000][    T0] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=2, Nodes=1
[    0.000000][    T0] rcu: Preemptible hierarchical RCU implementation.
[    0.000000][    T0] rcu: 	RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=2.
[    0.000000][    T0] 	Trampoline variant of Tasks RCU enabled.
[    0.000000][    T0] 	Tracing variant of Tasks RCU enabled.
[    0.000000][    T0] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
[    0.000000][    T0] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=2
[    0.000000][    T0] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[    0.000000][    T0] L2C: DT/platform modifies aux control register: 0x06070000 -> 0x16070000
[    0.000000][    T0] L2C-310 enabling early BRESP for Cortex-A9
[    0.000000][    T0] L2C-310 full line of zeros enabled for Cortex-A9
[    0.000000][    T0] L2C-310 D prefetch enabled, offset 1 lines
[    0.000000][    T0] L2C-310 dynamic clock gating enabled, standby mode enabled
[    0.000000][    T0] L2C-310 Coherent cache controller enabled, 16 ways, 1024 kB
[    0.000000][    T0] L2C-310 Coherent: CACHE_ID 0x410054c9, AUX_CTRL 0x56070001
[    0.000000][    T0] rcu: srcu_init: Setting srcu_struct sizes based on contention.
[    0.000001][    T0] sched_clock: 64 bits at 666MHz, resolution 1ns, wraps every 4398046511103ns
[    0.008681][    T0] clocksource: arm_global_timer: mask: 0xffffffffffffffff max_cycles: 0x999999d70a, max_idle_ns: 440795225152 ns
[    0.020388][    T0] Switching to timer-based delay loop, resolution 1ns
[    0.027204][    T0] Ignoring duplicate/late registration of read_current_timer delay
[    0.034933][    T0] clocksource: armada_370_xp_clocksource: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 76450417870 ns
[    0.046805][    T0] kfence: initialized - using 2097152 bytes for 255 objects at 0x(ptrval)-0x(ptrval)
[    0.056406][    T0] Console: colour dummy device 80x30
[    0.061558][    T0] Calibrating delay loop (skipped), value calculated using timer frequency.. 1332.00 BogoMIPS (lpj=6660000)
[    0.072836][    T0] CPU: Testing write buffer coherency: ok
[    0.078418][    T0] CPU0: Spectre v2: using BPIALL workaround
[    0.084143][    T0] pid_max: default: 32768 minimum: 301
[    0.092688][    T0] LSM: initializing lsm=capability,integrity
[    0.099428][    T0] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.107414][    T0] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.119916][    T1] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[    0.127032][    T1] RCU Tasks: Setting shift to 1 and lim to 1 rcu_task_cb_adjust=1.
[    0.134885][    T1] RCU Tasks Trace: Setting shift to 1 and lim to 1 rcu_task_cb_adjust=1.
[    0.143239][    T1] Setting up static identity map for 0x100000 - 0x100060
[    0.150217][    T1] mvebu-soc-id: MVEBU SoC ID=0x6820, Rev=0x4
[    0.156150][    T1] mvebu-pmsu: Initializing Power Management Service Unit
[    0.163144][    T1] rcu: Hierarchical SRCU implementation.
[    0.168622][    T1] rcu: 	Max phase no-delay instances is 1000.
[    0.175178][    T1] smp: Bringing up secondary CPUs ...
[    0.180803][    T1] Booting CPU 1
[    0.184266][    T0] CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
[    0.184277][    T0] CPU1: Spectre v2: using BPIALL workaround
[    0.196440][    T1] smp: Brought up 1 node, 2 CPUs
[    0.201228][    T1] SMP: Total of 2 processors activated (2664.00 BogoMIPS).
[    0.208271][    T1] CPU: All CPU(s) started in SVC mode.
[    0.214644][    T1] devtmpfs: initialized
[    0.223020][    T1] VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 4
[    0.231647][    T1] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.242306][    T1] futex hash table entries: 512 (order: 3, 32768 bytes, linear)
[    0.251912][    T1] prandom: seed boundary self test passed
[    0.259087][    T1] prandom: 100 self tests passed
[    0.263862][    T1] pinctrl core: initialized pinctrl subsystem
[    0.271301][    T1] NET: Registered PF_NETLINK/PF_ROUTE protocol family
[    0.278661][    T1] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.288547][    T1] audit: initializing netlink subsys (disabled)
[    0.294794][   T30] audit: type=2000 audit(0.250:1): state=initialized audit_enabled=0 res=1
[    0.295229][    T1] thermal_sys: Registered thermal governor 'step_wise'
[    0.303280][    T1] cpuidle: using governor ladder
[    0.314753][    T1] cpuidle: using governor menu
[    0.319523][    T1] hw-breakpoint: found 5 (+1 reserved) breakpoint and 1 watchpoint registers.
[    0.328202][    T1] hw-breakpoint: maximum watchpoint size is 4 bytes.
[    0.334863][    T1] mvebu-pmsu: CPU hotplug support is currently broken on Armada 38x: disabling
[    0.343627][    T1] mvebu-pmsu: CPU idle is currently broken on Armada 38x: disabling
[    0.354059][    T1] platform soc: Fixed dependency cycle(s) with /soc/internal-regs/interrupt-controller@d000
[    0.537095][    T1] raid6: int32x8  gen()   266 MB/s
[    0.707127][    T1] raid6: int32x4  gen()   277 MB/s
[    0.877079][    T1] raid6: int32x2  gen()   459 MB/s
[    1.047045][    T1] raid6: int32x1  gen()   531 MB/s
[    1.051993][    T1] raid6: using algorithm int32x1 gen() 531 MB/s
[    1.227072][    T1] raid6: .... xor() 205 MB/s, rmw enabled
[    1.232625][    T1] raid6: using intx1 recovery algorithm
[    1.239221][    T1] SCSI subsystem initialized
[    1.244066][    T1] usbcore: registered new interface driver usbfs
[    1.250295][    T1] usbcore: registered new interface driver hub
[    1.256309][    T1] usbcore: registered new device driver usb
[    1.262366][    T1] pps_core: LinuxPPS API ver. 1 registered
[    1.268018][    T1] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    1.277828][    T1] PTP clock support registered
[    1.283877][    T1] vgaarb: loaded
[    1.287685][    T1] clocksource: Switched to clocksource arm_global_timer
[    1.297981][    T1] VFS: Disk quotas dquot_6.6.0
[    1.302759][    T1] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[    1.318600][    T1] NET: Registered PF_INET protocol family
[    1.324312][    T1] IP idents hash table entries: 8192 (order: 4, 65536 bytes, linear)
[    1.333206][    T1] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes, linear)
[    1.342310][    T1] Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    1.350784][    T1] TCP established hash table entries: 4096 (order: 2, 16384 bytes, linear)
[    1.359244][    T1] TCP bind hash table entries: 4096 (order: 4, 65536 bytes, linear)
[    1.367115][    T1] TCP: Hash tables configured (established 4096 bind 4096)
[    1.374447][    T1] MPTCP token hash table entries: 512 (order: 1, 8192 bytes, linear)
[    1.382528][    T1] UDP hash table entries: 256 (order: 1, 8192 bytes, linear)
[    1.389751][    T1] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear)
[    1.397763][    T1] NET: Registered PF_UNIX/PF_LOCAL protocol family
[    1.404597][    T1] RPC: Registered named UNIX socket transport module.
[    1.411211][    T1] RPC: Registered udp transport module.
[    1.416590][    T1] RPC: Registered tcp transport module.
[    1.421976][    T1] RPC: Registered tcp-with-tls transport module.
[    1.428140][    T1] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    1.435255][    T1] PCI: CLS 0 bytes, default 64
[    1.440410][   T42] Trying to unpack rootfs image as initramfs...
[    1.447780][    T1] hw perfevents: enabled with armv7_cortex_a9 PMU driver, 7 counters available
[    1.459996][    T1] Initialise system trusted keyrings
[    1.465212][    T1] Key type blacklist registered
[    1.470955][    T1] workingset: timestamp_bits=14 max_order=17 bucket_order=3
[    1.478173][    T1] zbud: loaded
[    1.488297][    T1] NFS: Registering the id_resolver key type
[    1.494081][    T1] Key type id_resolver registered
[    1.498983][    T1] Key type id_legacy registered
[    1.503801][    T1] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[    1.511203][    T1] nfs4flexfilelayout_init: NFSv4 Flexfile Layout Driver Registering...
[    1.604737][    T1] xor: measuring software checksum speed
[    1.614771][    T1]    arm4regs        :  2172 MB/sec
[    1.625715][    T1]    8regs           :  1669 MB/sec
[    1.628471][   T42] Freeing initrd memory: 5136K
[    1.636479][    T1]    32regs          :  1733 MB/sec
[    1.641526][    T1] xor: using function: arm4regs (2172 MB/sec)
[    1.647433][    T1] async_tx: api initialized (async)
[    1.652486][    T1] Key type asymmetric registered
[    1.657261][    T1] Asymmetric key parser 'x509' registered
[    1.663146][    T1] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 245)
[    1.671590][    T1] io scheduler bfq registered
[    1.679736][    T1] armada-38x-pinctrl f1018000.pinctrl: registered pinctrl driver
[    1.689819][    T1] gpio gpiochip0: Static allocation of GPIO base is deprecated, use dynamic allocation.
[    1.699783][    T1] debugfs: Directory 'f1018100.gpio' with parent 'regmap' already present!
[    1.708888][    T1] gpio gpiochip1: Static allocation of GPIO base is deprecated, use dynamic allocation.
[    1.718850][    T1] debugfs: Directory 'f1018140.gpio' with parent 'regmap' already present!
[    1.728561][    T1] mvebu-pcie soc:pcie: host bridge /soc/pcie ranges:
[    1.735113][    T1] mvebu-pcie soc:pcie:      MEM 0x00f1080000..0x00f1081fff -> 0x0000080000
[    1.743561][    T1] mvebu-pcie soc:pcie:      MEM 0x00f1040000..0x00f1041fff -> 0x0000040000
[    1.752001][    T1] mvebu-pcie soc:pcie:      MEM 0x00f1044000..0x00f1045fff -> 0x0000044000
[    1.760447][    T1] mvebu-pcie soc:pcie:      MEM 0x00f1048000..0x00f1049fff -> 0x0000048000
[    1.768879][    T1] mvebu-pcie soc:pcie:      MEM 0xffffffffffffffff..0x00fffffffe -> 0x0100000000
[    1.777847][    T1] mvebu-pcie soc:pcie:       IO 0xffffffffffffffff..0x00fffffffe -> 0x0100000000
[    1.786790][    T1] mvebu-pcie soc:pcie:      MEM 0xffffffffffffffff..0x00fffffffe -> 0x0200000000
[    1.795746][    T1] mvebu-pcie soc:pcie:       IO 0xffffffffffffffff..0x00fffffffe -> 0x0200000000
[    1.804699][    T1] mvebu-pcie soc:pcie:      MEM 0xffffffffffffffff..0x00fffffffe -> 0x0300000000
[    1.813648][    T1] mvebu-pcie soc:pcie:       IO 0xffffffffffffffff..0x00fffffffe -> 0x0300000000
[    1.822596][    T1] mvebu-pcie soc:pcie:      MEM 0xffffffffffffffff..0x00fffffffe -> 0x0400000000
[    1.831537][    T1] mvebu-pcie soc:pcie:       IO 0xffffffffffffffff..0x00fffffffe -> 0x0400000000
[    1.841266][    T1] mvebu-pcie soc:pcie: PCI host bridge to bus 0000:00
[    1.847888][    T1] pci_bus 0000:00: root bus resource [bus 00-ff]
[    1.854052][    T1] pci_bus 0000:00: root bus resource [mem 0xf1080000-0xf1081fff] (bus address [0x00080000-0x00081fff])
[    1.864894][    T1] pci_bus 0000:00: root bus resource [mem 0xf1040000-0xf1041fff] (bus address [0x00040000-0x00041fff])
[    1.875733][    T1] pci_bus 0000:00: root bus resource [mem 0xf1044000-0xf1045fff] (bus address [0x00044000-0x00045fff])
[    1.886571][    T1] pci_bus 0000:00: root bus resource [mem 0xf1048000-0xf1049fff] (bus address [0x00048000-0x00049fff])
[    1.897470][    T1] pci_bus 0000:00: root bus resource [mem 0xe0000000-0xe7ffffff]
[    1.905028][    T1] pci_bus 0000:00: root bus resource [io  0x1000-0xeffff]
[    1.912125][    T1] pci 0000:00:02.0: [11ab:6820] type 01 class 0x060400
[    1.919322][    T1] pci 0000:00:03.0: [11ab:6820] type 01 class 0x060400
[    1.926468][    T1] pci 0000:00:04.0: [11ab:6820] type 01 class 0x060400
[    1.934540][    T1] PCI: bus0: Fast back to back transfers disabled
[    1.940812][    T1] pci 0000:00:02.0: bridge configuration invalid ([bus 00-00]), reconfiguring
[    1.949500][    T1] pci 0000:00:03.0: bridge configuration invalid ([bus 00-00]), reconfiguring
[    1.958184][    T1] pci 0000:00:04.0: bridge configuration invalid ([bus 00-00]), reconfiguring
[    1.967087][    T1] PCI: bus1: Fast back to back transfers enabled
[    1.973274][    T1] pci_bus 0000:01: busn_res: [bus 01-ff] end is updated to 01
[    1.980814][    T1] PCI: bus2: Fast back to back transfers enabled
[    1.986980][    T1] pci_bus 0000:02: busn_res: [bus 02-ff] end is updated to 02
[    1.994512][    T1] PCI: bus3: Fast back to back transfers enabled
[    2.000709][    T1] pci_bus 0000:03: busn_res: [bus 03-ff] end is updated to 03
[    2.008023][    T1] pci 0000:00:02.0: PCI bridge to [bus 01]
[    2.013670][    T1] pci 0000:00:03.0: PCI bridge to [bus 02]
[    2.019324][    T1] pci 0000:00:04.0: PCI bridge to [bus 03]
[    2.026347][    T1] mv_xor f1060800.xor: Marvell shared XOR driver
[    2.098707][    T1] mv_xor f1060800.xor: Marvell XOR (Descriptor Mode): ( xor cpy intr )
[    2.109453][    T1] mv_xor f1060900.xor: Marvell shared XOR driver
[    2.178708][    T1] mv_xor f1060900.xor: Marvell XOR (Descriptor Mode): ( xor cpy intr )
[    2.273003][    T1] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
[    2.284108][    T1] printk: console [ttyS0] disabled
[    2.310125][    T1] f1012000.serial: ttyS0 at MMIO 0xf1012000 (irq = 42, base_baud = 15625000) is a 16550A
[    2.319877][    T1] printk: console [ttyS0] enabled
[    2.319877][    T1] printk: console [ttyS0] enabled
[    2.329705][    T1] printk: bootconsole [earlycon0] disabled
[    2.329705][    T1] printk: bootconsole [earlycon0] disabled
[    2.380339][    T1] f1012100.serial: ttyS1 at MMIO 0xf1012100 (irq = 43, base_baud = 15625000) is a 16550A
[    2.392261][    T1] ahci-mvebu f10a8000.sata: supply ahci not found, using dummy regulator
[    2.400816][    T1] ahci-mvebu f10a8000.sata: supply phy not found, using dummy regulator
[    2.412375][    T1] spi-nor spi0.0: found n25q064, expected mx25l6405d
[    2.419270][    T1] spi-nor spi0.0: n25q064 (8192 Kbytes)
[    2.424736][    T1] 2 cmdlinepart partitions found on MTD device spi0.0
[    2.431414][    T1] Creating 2 MTD partitions on "spi0.0":
[    2.436925][    T1] 0x000000000000-0x000000400000 : "boot"
[    2.444276][    T1] 0x000000400000-0x000000800000 : "spi-rootfs"
[    2.452330][    T1] wireguard: WireGuard 1.0.0 loaded. See www.wireguard.com for information.
[    2.460934][    T1] wireguard: Copyright (C) 2015-2019 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
[    2.487095][    T1] hwmon hwmon0: temp1_input not attached to any thermal zone
[    2.495425][    T1] mdio_bus f1072004.mdio-mii: MDIO device at address 0 is missing.
[    2.504114][    T1] mvneta_bm f10c8000.bm: Buffer Manager for network controller enabled
[    2.516902][    T1] mvneta f1070000.ethernet eth0: Using random mac address 1a:9c:ee:0e:10:1a
[    2.525913][    T1] mvneta_bm f10c8000.bm: long pool cannot be shared by the ports
[    2.533545][    T1] mvneta f1034000.ethernet (unnamed net_device) (uninitialized): fail to obtain long pool for port
[    2.544125][    T1] mvneta f1034000.ethernet: use SW buffer management
[    2.552962][    T1] mvneta f1034000.ethernet eth1: Using random mac address 4e:69:44:10:fe:ed
[    2.562253][    T1] usbcore: registered new interface driver smsc75xx
[    2.570276][    T1] usbcore: registered new interface driver usblp
[    2.576578][    T1] usbcore: registered new interface driver usb-storage
[    2.583880][    T1] mousedev: PS/2 mouse device common for all mice
[    2.591982][    T1] armada38x-rtc f10a3800.rtc: registered as rtc0
[    2.598291][    T1] armada38x-rtc f10a3800.rtc: setting system clock to 1970-01-01T04:11:32 UTC (15092)
[    2.608657][    T1] i2c_dev: i2c /dev entries driver
[    2.614693][    T1] at24 0-0057: supply vcc not found, using dummy regulator
[    2.651107][    T1] gpio-fan gpio-fan: missing speed array entry for GPIO value 0x7
[    2.661743][    T1] orion_wdt: Initial timeout 171 sec
[    2.667560][    T1] device-mapper: uevent: version 1.0.3
[    2.673274][    T1] device-mapper: ioctl: 4.48.0-ioctl (2023-03-01) initialised: dm-devel@redhat.com
[    2.682753][    T1] device-mapper: multipath round-robin: version 1.2.0 loaded
[    2.690040][    T1] device-mapper: multipath queue-length: version 0.2.0 loaded
[    2.697378][    T1] device-mapper: multipath service-time: version 0.3.0 loaded
[    2.704822][    T1] device-mapper: dm-log-userspace: version 1.3.0 loaded
[    2.711939][    T1] sdhci: Secure Digital Host Controller Interface driver
[    2.718863][    T1] sdhci: Copyright(c) Pierre Ossman
[    2.724125][    T1] sdhci-pltfm: SDHCI platform and OF driver helper
[    2.732385][    T1] marvell-cesa f1090000.crypto: CESA device successfully registered
[    2.740741][    T1] hid: raw HID events driver (C) Jiri Kosina
[    2.747067][    T1] usbcore: registered new interface driver usbhid
[    2.753385][    T1] usbhid: USB HID core driver
[    2.759116][    T1] NET: Registered PF_INET6 protocol family
[    2.766065][    T1] Segment Routing with IPv6
[    2.770493][    T1] RPL Segment Routing with IPv6
[    2.775285][    T1] In-situ OAM (IOAM) with IPv6
[    2.780004][    T1] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
[    2.788224][    T1] NET: Registered PF_PACKET protocol family
[    2.794176][    T1] 8021q: 802.1Q VLAN Support v1.8
[    2.799151][    T1] Key type dns_resolver registered
[    2.804310][    T1] ThumbEE CPU extension supported.
[    2.809312][    T1] Registering SWP/SWPB emulation handler
[    2.845706][    T1] registered taskstats version 1
[    2.851038][    T1] Loading compiled-in X.509 certificates
[    2.871861][    T1] Key type .fscrypt registered
[    2.876508][    T1] Key type fscrypt-provisioning registered
[    2.882336][    T1] Key type big_key registered
[    2.904293][    T1] Key type encrypted registered
[    2.911922][   T25] ahci-mvebu f10a8000.sata: supply ahci not found, using dummy regulator
[    2.921771][   T25] ahci-mvebu f10a8000.sata: supply phy not found, using dummy regulator
[    2.931121][   T25] ahci-mvebu f10a8000.sata: masking port_map 0x3 -> 0x3
[    2.938023][   T25] ahci-mvebu f10a8000.sata: AHCI 0001.0000 32 slots 2 ports 6 Gbps 0x3 impl platform mode
[    2.947932][   T25] ahci-mvebu f10a8000.sata: flags: 64bit ncq sntf led only pmp fbs pio slum part sxs 
[    2.958993][   T25] scsi host0: ahci-mvebu
[    2.964007][   T25] scsi host1: ahci-mvebu
[    2.968498][   T25] ata1: SATA max UDMA/133 mmio [mem 0xf10a8000-0xf10a9fff] port 0x100 irq 54
[    2.977151][   T25] ata2: SATA max UDMA/133 mmio [mem 0xf10a8000-0xf10a9fff] port 0x180 irq 54
[    2.987406][   T25] usb_phy_generic usb3_0_phy: dummy supplies not allowed for exclusive requests
[    2.996756][   T25] usb_phy_generic usb3_1_phy: dummy supplies not allowed for exclusive requests
[    3.006006][   T25] xhci-hcd f10f0000.usb3: xHCI Host Controller
[    3.012076][   T25] xhci-hcd f10f0000.usb3: new USB bus registered, assigned bus number 1
[    3.020373][   T25] xhci-hcd f10f0000.usb3: hcc params 0x0a000990 hci version 0x100 quirks 0x0000000000000010
[    3.030375][   T25] xhci-hcd f10f0000.usb3: irq 46, io mem 0xf10f0000
[    3.036977][   T25] xhci-hcd f10f0000.usb3: xHCI Host Controller
[    3.043027][   T25] xhci-hcd f10f0000.usb3: new USB bus registered, assigned bus number 2
[    3.051261][   T25] xhci-hcd f10f0000.usb3: Host supports USB 3.0 SuperSpeed
[    3.058478][   T25] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 6.06
[    3.067475][   T25] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    3.075439][   T25] usb usb1: Product: xHCI Host Controller
[    3.081049][   T25] usb usb1: Manufacturer: Linux 6.6.2-mvebu-tld-1 xhci-hcd
[    3.088135][   T25] usb usb1: SerialNumber: f10f0000.usb3
[    3.094237][   T25] hub 1-0:1.0: USB hub found
[    3.098794][   T25] hub 1-0:1.0: 1 port detected
[    3.103943][   T25] usb usb2: We don't know the algorithms for LPM for this host, disabling LPM.
[    3.112876][   T25] usb usb2: New USB device found, idVendor=1d6b, idProduct=0003, bcdDevice= 6.06
[    3.121888][   T25] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    3.129914][   T25] usb usb2: Product: xHCI Host Controller
[    3.135511][   T25] usb usb2: Manufacturer: Linux 6.6.2-mvebu-tld-1 xhci-hcd
[    3.142604][   T25] usb usb2: SerialNumber: f10f0000.usb3
[    3.148661][   T25] hub 2-0:1.0: USB hub found
[    3.153153][   T25] hub 2-0:1.0: 1 port detected
[    3.158649][   T25] xhci-hcd f10f8000.usb3: xHCI Host Controller
[    3.164697][   T25] xhci-hcd f10f8000.usb3: new USB bus registered, assigned bus number 3
[    3.172989][   T25] xhci-hcd f10f8000.usb3: hcc params 0x0a000990 hci version 0x100 quirks 0x0000000000000010
[    3.183004][   T25] xhci-hcd f10f8000.usb3: irq 47, io mem 0xf10f8000
[    3.189717][   T25] xhci-hcd f10f8000.usb3: xHCI Host Controller
[    3.195758][   T25] xhci-hcd f10f8000.usb3: new USB bus registered, assigned bus number 4
[    3.204027][   T25] xhci-hcd f10f8000.usb3: Host supports USB 3.0 SuperSpeed
[    3.211298][   T25] usb usb3: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 6.06
[    3.220391][   T25] usb usb3: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    3.228365][   T25] usb usb3: Product: xHCI Host Controller
[    3.233976][   T25] usb usb3: Manufacturer: Linux 6.6.2-mvebu-tld-1 xhci-hcd
[    3.241074][   T25] usb usb3: SerialNumber: f10f8000.usb3
[    3.247152][   T25] hub 3-0:1.0: USB hub found
[    3.251742][   T25] hub 3-0:1.0: 1 port detected
[    3.256960][   T25] usb usb4: We don't know the algorithms for LPM for this host, disabling LPM.
[    3.265911][   T25] usb usb4: New USB device found, idVendor=1d6b, idProduct=0003, bcdDevice= 6.06
[    3.275016][   T25] usb usb4: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    3.283209][   T25] usb usb4: Product: xHCI Host Controller
[    3.288819][   T25] usb usb4: Manufacturer: Linux 6.6.2-mvebu-tld-1 xhci-hcd
[    3.295897][   T25] usb usb4: SerialNumber: f10f8000.usb3
[    3.301923][   T25] hub 4-0:1.0: USB hub found
[    3.306413][   T25] hub 4-0:1.0: 1 port detected
[    3.312494][    T1] clk: Disabling unused clocks
[    3.477705][ T1257] ata1: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
[    3.484638][ T1262] ata2: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
[    3.491584][ T1257] ata1.00: ATA-8: ST500LT012-1DG142, 1003YAM1, max UDMA/133
[    3.498777][ T1257] ata1.00: 976773168 sectors, multi 16: LBA48 NCQ (depth 32)
[    3.506059][ T1262] ata2.00: ATA-8: Hitachi HTS545050A7E380, GG2OA7A0, max UDMA/100
[    3.513769][ T1262] ata2.00: 976773168 sectors, multi 16: LBA48 NCQ (depth 32)
[    3.522225][ T1262] ata2.00: configured for UDMA/100
[    3.527242][ T1257] ata1.00: configured for UDMA/133
[    3.542816][ T1194] scsi 0:0:0:0: Direct-Access     ATA      ST500LT012-1DG14 YAM1 PQ: 0 ANSI: 5
[    3.553188][ T1287] sd 0:0:0:0: [sda] 976773168 512-byte logical blocks: (500 GB/466 GiB)
[    3.553799][   T42] scsi 1:0:0:0: Direct-Access     ATA      Hitachi HTS54505 A7A0 PQ: 0 ANSI: 5
[    3.561429][ T1287] sd 0:0:0:0: [sda] 4096-byte physical blocks
[    3.561473][ T1287] sd 0:0:0:0: [sda] Write Protect is off
[    3.572108][   T26] sd 1:0:0:0: [sdb] 976773168 512-byte logical blocks: (500 GB/466 GiB)
[    3.581877][   T26] sd 1:0:0:0: [sdb] 4096-byte physical blocks
[    3.590315][ T1287] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    3.595971][   T26] sd 1:0:0:0: [sdb] Write Protect is off
[    3.605778][ T1287] sd 0:0:0:0: [sda] Preferred minimum I/O size 4096 bytes
[    3.618352][   T26] sd 1:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    3.628256][   T26] sd 1:0:0:0: [sdb] Preferred minimum I/O size 4096 bytes
[    3.712950][   T26]  sdb: sdb1
[    3.716477][   T26] sd 1:0:0:0: [sdb] Attached SCSI removable disk
[    4.035873][ T1287]  sda: sda1 sda2 sda3 sda4
[    4.041529][ T1287] sd 0:0:0:0: [sda] Attached SCSI removable disk
[    4.049864][    T1] Freeing unused kernel image (initmem) memory: 1024K
[    4.088323][    T1] Checked W+X mappings: passed, no W+X pages found
[    4.094716][    T1] Run /init as init process
Loading, please wait...
Starting systemd-udevd version 252.19-1~deb12u1
Begin: Loading essential drivers ... done.
Begin: Running /scripts/init-premount ... done.
Begin: Mounting root file system ... Begin: Running /scripts/local-top ... done.
Begin: Running /scripts/local-premount ... done.
Begin: Will now check root file system ... fsck from util-linux 2.38.1
fsck: error 2 (No such file or directory) while executing fsck.ext4 for /dev/sdb1
fsck exited with status code 8
done.
Warning: File system check failed but did not detect errors
[   21.101420][ T1378] EXT4-fs (sdb1): mounted filesystem 92f11383-f1e4-44cb-a386-5bf287ad08ff ro with ordered data mode. Quota mode: none.
done.
Begin: Running /scripts/local-bottom ... done.
Begin: Running /scripts/init-bottom ... done.
INIT: version 3.06 booting
INIT: No inittab.d directory found
Using makefile-style concurrent boot in runlevel S.
Setting hostname to 'debian'...done.
Starting hotplug events dispatcher: systemd-udevd.
Synthesizing the initial hotplug events (subsystems)...done.
Synthesizing the initial hotplug events (devices)...done.
Waiting for /dev to be fully populated...[   24.343847][ T1561] sd 0:0:0:0: Attached scsi generic sg0 type 0
[   24.350259][ T1561] sd 1:0:0:0: Attached scsi generic sg1 type 0
done.
Activating swap:.
[   27.245964][ T1712] EXT4-fs (sdb1): re-mounted 92f11383-f1e4-44cb-a386-5bf287ad08ff ro. Quota mode: none.
Will now check root file system:[/sbin/fsck.ext3 (1) -- /] fsck.ext3 -y -C0 /dev/sdb1 
e2fsck 1.47.0 (5-Feb-2023)
rootfs: clean, 25883/30523392 files, 2395240/122083840 blocks
.
[   27.934033][ T1719] EXT4-fs (sdb1): re-mounted 92f11383-f1e4-44cb-a386-5bf287ad08ff r/w. Quota mode: none.
Will now check all file systems.
Checking all file systems.
LABEL=rootfs is mounted
Done checking file systems.
Log is being saved in /var/log/fsck/checkfs if that location is writable.
Cleaning up temporary files...Cleaning /tmp...done.
 /tmp.
Will now mount local filesystems:.
Will now activate swapfile swap, if any:done.
Checking minimum space in /tmp...done.
Cleaning up temporary files...
[   28.927743][    C0] random: crng init done
.
Starting Setting kernel variables: sysctl.
Initializing random number generator...done.
[   29.618522][ T2109] mvneta f1070000.ethernet eth0: PHY [f1072004.mdio-mii:01] driver [Marvell 88E1510] (irq=POLL)
[   29.629151][ T2109] mvneta f1070000.ethernet eth0: configuring for phy/sgmii link mode
Configuring network interfaces...Internet Systems Consortium DHCP Client 4.4.3-P1
Copyright 2004-2022 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/eth0/c2:90:9a:b0:fd:d6
Sending on   LPF/eth0/c2:90:9a:b0:fd:d6
Sending on   Socket/fallback
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 8
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 11
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 15
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 16
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 9
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 2
No DHCPOFFERS received.
No working leases in persistent database - sleeping.
done.
Starting RPC port mapper daemon: rpcbind.
Starting NFS common utilities: statd idmapd.
Cleaning up temporary files....
INIT: Entering runlevel: 2
Using makefile-style concurrent boot in runlevel 2.
Not starting NFS kernel daemon: no exports ... (warning).
Starting busybox' syslogd implementation : syslogdStarting /sbin/syslogd...
2249 (syslogd)
.
Starting NTP server: ntpd1969-12-31T20:12:44 ntpd[2289]: INIT: ntpd ntpsec-1.2.2: Starting
1969-12-31T20:12:44 ntpd[2289]: INIT: Command line: /usr/sbin/ntpd -p /var/run/ntpd.pid -g -u 104:109
.
Starting NTP server: ntpd1969-12-31T20:12:44 ntpd[2260]: INIT: ntpd ntpsec-1.2.2: Starting
1969-12-31T20:12:44 ntpd[2260]: INIT: Command line: /usr/sbin/ntpd -p /run/ntpd.pid -c /etc/ntpsec/ntp.conf -g -N -u ntpsec:ntpsec
.
Starting periodic command scheduler: cron.
Starting OpenBSD Secure Shell server: sshd.
Starting system message bus: dbus.
Starting Avahi mDNS/DNS-SD Daemon: avahi-daemon.
Starting busybox' klogd implementation : klogdStarting /sbin/klogd...
2270 (klogd)
.
Running local boot scripts (/etc/rc.local)
Cannot read environment, using default
Cannot read default environment from file
<13>Dec 31 20:12:47 root[2340]: Cannot read u-boot env ethaddr
.

Debian GNU/Linux 12 debian ttyS0

debian login:


4 - WHAT'S NEXT ?

Further testing is required to determine what works properly and what doesn't. A new dts/dtb will probably be required in the end for the DS216 to be perfectly supported (The SPI NOR is slightly different and there are a few other things that may need some editing). Any hint on what to look for or what to do next to improve this device support would be really appreciated. Also, it would be awesome if we could flash a mainline u-boot on it !
Thanks for the time you took to make these nice little devices useful again.

Best regards,
Robin.



Edited 3 time(s). Last edit at 04/08/2024 05:00AM by Robin.
Re: Debian on Synology DS216
April 08, 2024 02:41PM
Hi Robin,

Thanks for bringing up the DS216 box. Well done :) I'll add this to the support list.

RTC is working but,
[    2.598291][    T1] armada38x-rtc f10a3800.rtc: setting system clock to 1970-01-01T04:11:32 UTC (15092)
Perhaps the battery is dead? did you try to set the date and see if it will keep time correctly?

SPI flash is working OK.
[    2.412375][    T1] spi-nor spi0.0: found n25q064, expected mx25l6405d
[    2.419270][    T1] spi-nor spi0.0: n25q064 (8192 Kbytes)
[    2.424736][    T1] 2 cmdlinepart partitions found on MTD device spi0.0
[    2.431414][    T1] Creating 2 MTD partitions on "spi0.0":
[    2.436925][    T1] 0x000000000000-0x000000400000 : "boot"
[    2.444276][    T1] 0x000000400000-0x000000800000 : "spi-rootfs"
As long as it was detected correctly by the kernel like above, no need to do anything more. But if we want to make it perfect, then we'll modify the DTS.

HWmon

[    2.487095][    T1] hwmon hwmon0: temp1_input not attached to any thermal zone

Check the sys class
cat /sys/class/hwmon/hwmon1/fan1_input  # fan speed
cat /sys/class/hwmon/hwmon2/temp1_input   # this is the CPU temperature

For boxes with Armada 385 SoC, hwmon0 is usually reserved for the HDD. Usually we use hddtemp to get the temperature so we ignore this, but beware that in the latest Debian release, hddtemp is no longer available. So smartctl should be used to get the temperature of the disk drives.

You can install lm-sensors to let it manage the output of CPU temperature and Fan speed. I think lm-sensors output is better than DIY scripts.

LEDs and buttons

These should be tested to see the DS218j/RS816 GPIOs are the same in this box or not. If they don't work, then perhaps the info can be found in stock OS.

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



Edited 1 time(s). Last edit at 04/08/2024 04:13PM by bodhi.
Re: Debian on Synology DS216
April 08, 2024 04:13PM
Hi Bodhi,

Thanks for your quick reply. The original RTC battery was dead, I replaced it before the first boot and I didn't set the time since. I'll check tomorrow but it's probably nothing to be concerned about.

I felt like the SPI flash issue was indeed minor, if LEDs and Buttons requires us to edit a separate DTS for this box I'll look forward to refine this on the way.

Thanks for the hints about the HWmon issues, i'll dig into that tomorrow.

I'll check more carefully what works and what doesn't when it comes to LEDs and buttons. I think that some of those are handled by the separate PIC microcontroller but i might be wrong.

What about compiling a mainline u-boot on such a device, any hints ?

I will also try to add/improve/confirm support for a few other devices as I got my hands on a DS215j that looks similar to a DS214. I already got the stock bootlog on this one and I'll try a few things later. I also got a DS214 but sadly the UART remains silent, i don't know if it is known to be capricious but i got no luck so far.

Thanks for your time,
Robin.



Edited 1 time(s). Last edit at 04/08/2024 04:13PM by Robin.
Re: Debian on Synology DS216
April 08, 2024 09:55PM
bodhi Wrote:
-------------------------------------------------------
> For boxes with Armada 385 SoC, hwmon0 is usually
> reserved for the HDD. Usually we use hddtemp to
> get the temperature so we ignore this, but beware
> that in the latest Debian release, hddtemp is no
> longer available. So smartctl should be used to
> get the temperature of the disk drives.
>
> You can install lm-sensors to let it manage the
> output of CPU temperature and Fan speed. I think
> lm-sensors output is better than DIY scripts.
>
The correct replacement for hddtemp is the 'drivetemp' kernel module. Load the module as follows:
echo drivetemp > /etc/modules-load.d/drivetemp.conf

Then on the next boot the sensors command from lm-sensors will also report the drive temperature.

Ray



Edited 1 time(s). Last edit at 04/08/2024 09:56PM by rayknight.
Re: Debian on Synology DS216
April 08, 2024 10:49PM
> The correct replacement for hddtemp is the
> 'drivetemp' kernel module. Load the module as
> follows:
>
> echo drivetemp >
> /etc/modules-load.d/drivetemp.conf
>
>
> Then on the next boot the sensors command from
> lm-sensors will also report the drive
> temperature.
>

Ray,

Yes, I'm aware of drivetemp. I think it is not as good a simple solution as hddtemp. Please try it yourself to see what I mean.

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



Edited 1 time(s). Last edit at 04/08/2024 10:50PM by bodhi.
Re: Debian on Synology DS216
April 09, 2024 01:26AM
In any case, we should stop discussing hdd temp here before it gets out of topic of this thread.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian on Synology DS216
April 09, 2024 01:44AM
Robin,

> Thanks for your quick reply. The original RTC
> battery was dead, I replaced it before the first
> boot and I didn't set the time since. I'll check
> tomorrow but it's probably nothing to be concerned
> about.

OK.

>
> I felt like the SPI flash issue was indeed minor,
> if LEDs and Buttons requires us to edit a separate
> DTS for this box I'll look forward to refine this
> on the way.

We need a new DTS anyway to identify the hardware correctly. So please do create a new one.

> Thanks for the hints about the HWmon issues, i'll
> dig into that tomorrow.
>
> I'll check more carefully what works and what
> doesn't when it comes to LEDs and buttons. I think
> that some of those are handled by the separate PIC
> microcontroller but i might be wrong.

They are, it's common for the Armada SoC based Synology boards. So I think these will work:

serial@12100 {
                                /* A PIC16F1829 is connected to uart1 at 9600 bps,
                                 * and takes single-character orders :
                                 *   "1" : power off // already handled by the poweroff node
                                 *   "2" : short beep
                                 *   "3" : long beep
                                 *   "4" : turn the power LED ON
                                 *   "5" : flash the power LED
                                 *   "6" : turn the power LED OFF
                                 *   "7" : turn the status LED OFF
                                 *   "8" : turn the status LED ON
                                 *   "9" : flash the status LED
                                 *   "A" : flash the motherboard LED (D8)
                                 *   "B" : turn the motherboard LED OFF
                                 *   "C" : hard reset

Only the "Orange" LED is GPIO driven. But I'm not sure about the HDD LEDs.

>
> What about compiling a mainline u-boot on such a
> device, any hints ?

I could do that (hopefully) easily. Given I've done the DS116 u-boot, this should be quite similar.

>
> I will also try to add/improve/confirm support for
> a few other devices as I got my hands on a DS215j
> that looks similar to a DS214. I already got the
> stock bootlog on this one and I'll try a few
> things later. I also got a DS214 but sadly the
> UART remains silent, i don't know if it is known
> to be capricious but i got no luck so far.

DS214 is a different SoC (Armada XP). It's a bit older than this Armada 385. But the DS414 DTS should be a good one to use as reference.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian on Synology DS216
April 09, 2024 04:47AM
Okay, thank you all for the hints.

If it should be quite easy for you to compile u-boot for the DS216, that is some really good news !

I started to look at the DTS of the DS218j and DS116 and found something i'm not sure about. In "armada-385-synology-ds218j.dts" one can read:
                        ethernet@70000 {
				compatable = "marvell,neta";
				pinctrl-names = "default";
				phy = <&phy0>;
				phy-mode = "sgmii";
				buffer-manager = <&bm>;
				bm,pool-long = <0>;
				status = "okay";
			};

			ethernet@34000 {
				compatable = "marvell,neta";
				pinctrl-names = "default";
				phy = <&phy1>;
				phy-mode = "sgmii";
				buffer-manager = <&bm>;
				bm,pool-long = <0>;
				status = "okay";
			};

compatable sounds like a typo, not sure it has any effect as this line has been omitted in the DS116 DTS. I'm not sure if I should fix it or remove it for the DS216 DTS either.
Also the DS216 only has one ethernet interface and so does the DS218j, so one should probably be removed.

I will edit the dummy regulators to use GPIO0 26 and GPIO0 27.

I will also edit the SPI flash to :
compatible = "micron,n25q064", "jedec,spi-nor";
I checked in the manufacturer's datasheet, just like the macronix flash it also supports "fast read" and the 50MHz frequency seems wise as the chip supports it for all commands and it is wired close to the SoC with thin tracks (decent stray capacitance).

I'll dig into GPIOs this afternoon and edit the DTS accordingly.



Edited 4 time(s). Last edit at 04/09/2024 05:00AM by Robin.
Re: Debian on Synology DS216
April 09, 2024 09:56AM
RTC

It was indeed a non-issue. After setting the date and time, a full unplug and a fresh boot, hwclock returns the correct date and time.

HWmon

root@debian:~# ls /sys/class/hwmon/hwmon
hwmon0/ hwmon1/ 
root@debian:~# ls /sys/class/hwmon/     
.  ..  hwmon0  hwmon1
root@debian:~# ls /sys/class/hwmon/hwmon0
.   device  of_node  subsystem   temp1_input      uevent
..  name    power    temp1_crit  temp1_max_alarm
root@debian:~# ls /sys/class/hwmon/hwmon1
.  ..  device  name  power  subsystem  temp1_input  uevent
root@debian:~# cat /sys/class/hwmon/hwmon0/temp1_input 
21000
root@debian:~# cat /sys/class/hwmon/hwmon0/temp1_max_alarm 
0
root@debian:~# cat /sys/class/hwmon/hwmon0/temp1_crit      
100000
root@debian:~# cat /sys/class/hwmon/hwmon1/temp1_input 
39886

hwmon2 does not exist. It seems like hwmon1/temp1_input is the SoC temperature, and i'm not sure hwmon0/temp1_input is working as the value stays the very same. No fan input so far...


LEDs and GPIOs

I confirm that all commands of the PIC16F1829 work as intended through ttyS1.

HDD activity LEDs does not seem do be automatically triggered by accesses on the SATA HDDs, unlike the DS116. I will find the relevant GPIOs and add them to the DTS.

The orange LED shared with the "disk 1" indicator is indeed GPIO controlled, I will do some more testing to determine the pin involved.

EDIT:
It appears there is also an orange GPIO-triggered LED shared with the "disk 2" indicator. Strangely it seems like i have to trigger two GPIOs to control those LEDs, one being common to both.

Both front buttons do nothing in debian. I don't fully understand how those should be declared in the DTS files, any hints ?

The fan seems driven by other GPIOs, it stays at full speed under debian. I'll take some time to determine the three pins involved.

ETHERNET

Only eth0 is used on this device, and it works flawlessly.

USB

Both rear USB 3.0 ports remain unpowered. The front USB 2.0 is powered but debian won't detect any device plugged in it. I'll dig deeper into this later, but this seems also DTS related.

EDIT:
Setting GPIO1 to 00009440 from 00008440 before boot enables power on both USB 3.0 ports and attached devices works flawlessly under debian. If i count correctly, this means GPIO1 12 needs to be set as the dummy regulator pin for XHCI controller on the DTS.



Edited 6 time(s). Last edit at 04/09/2024 03:17PM by Robin.
Re: Debian on Synology DS216
April 09, 2024 03:26PM
> HWmon

> hwmon2 does not exist. It seems like
> hwmon1/temp1_input is the SoC temperature, and i'm
> not sure hwmon0/temp1_input is working as the
> value stays the very same. No fan input so far...

That's strange. There should be 3 hwmons. CPU, Fan, and Ethernet. But the order is not guaranteed to be the same for different boards. For example, the DS116:

ls -l /sys/class/hwmon/
lrwxrwxrwx  1 root root 0 Apr  8 19:45 hwmon0 -> ../../devices/platform/soc/soc:internal-regs/f1072004.mdio/mdio_bus/f1072004.mdio-mii/f1072004.mdio-mii:01/hwmon/hwmon0
lrwxrwxrwx  1 root root 0 Apr  8 19:45 hwmon1 -> ../../devices/platform/soc/soc:gpio-fan/hwmon/hwmon1
lrwxrwxrwx  1 root root 0 Apr  8 19:45 hwmon2 -> ../../devices/virtual/thermal/thermal_zone0/hwmon2

thermal_zone0 is CPU.
f1072004.mdio is Ethernet.
gpio-fan is of course, Fan.

>
> LEDs and GPIOs
>
> I confirm that all commands of the PIC16F1829 work
> as intended through ttyS1.
>
> HDD activity LEDs does not seem do be
> automatically triggered by accesses on the SATA
> HDDs, unlike the DS116. I will find the relevant
> GPIOs and add them to the DTS.
>
> The orange LED shared with the "disk 1" indicator
> is indeed GPIO controlled, I will do some more
> testing to determine the pin involved.
>
> Both front buttons do nothing in debian. I don't
> fully understand how those should be declared in
> the DTS files, any hints ?

Look in my patch linux-6.7.5-mvebu-tld-1.patch in the tarball linux-6.7.5-mvebu-tld-1-bodhi.tar.bz2. And find the armada-385-thecus-n2350.dts. There are 3 buttons defined in this DTS.

>
> The fan seems driven by other GPIOs, it stays at
> full speed under debian. I'll take some time to
> determine the three pins involved.
>

Very possible. Synology tend to have different Fan GPIOs among different boards. But first, try
echo 0 > /sys/class/hwmon/hwmonx/fan1_input  # where hwmonx is fan hwmon
echo 1 > /sys/class/hwmon/hwmonx/fan1_input  # where hwmonx is fan hwmon
echo 2 > /sys/class/hwmon/hwmonx/fan1_input  # where hwmonx is fan hwmon
(If there are 3 speeds)

> ETHERNET
>
> Only eth0 is used on this device, and it works
> flawlessly.
>
> USB
>
> Both rear USB 3.0 ports remain unpowered. The
> front USB 2.0 is powered but debian won't detect
> any device plugged in it. I'll dig deeper into
> this later, but this seems also DTS related.
>
> EDIT:
> Setting GPIO1 to 00009440 from 00008440 before
> boot enables power on both USB 3.0 ports and
> attached devices works flawlessly under debian. If
> i count correctly, this means GPIO1 12 needs to be
> set as the dummy regulator pin for XHCI controller
> on the DTS.

Cool!

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian on Synology DS216
April 09, 2024 03:53PM
Quote
bodhi
> > Both front buttons do nothing in debian. I
> don't
> > fully understand how those should be declared
> in
> > the DTS files, any hints ?
>
> Look in my patch linux-6.7.5-mvebu-tld-1.patch in
> the
> tarball
> linux-6.7.5-mvebu-tld-1-bodhi.tar.bz2
. And
> find the armada-385-thecus-n2350.dts. There are 3
> buttons defined in this DTS.

However, this box (and other Synology a385 boards) inputs are mostly handled by serial. So the buttons might not be GPIOs.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian on Synology DS216
April 10, 2024 11:19AM
HWMON

I think most of the issue is related to GPIO conflicts and/or bad definitions. I'll get back into this when debian will run a kernel with my edited DTB.

LEDs AND GPIOs

Okay so after a bit of trial and error, and time spent digging into the Synology GPL tarballs (especially synobios.txz), I finally determined the GPIO config for the DS216. I'll edit the DTS accordingly and do some more testing to validate my findings.

PIN BANK  BANK PIN DIRECTION ACTIVE STATE FUNCTION                   DTS DEFINITION  
6   GPIO0 6        INPUT     LOW          Copy button.               GPIO Button     
9   GPIO0 9        OUTPUT    HIGH         Enable HDD LEDs.                           
12  GPIO0 12       INPUT     HIGH         Model ID 0.                                
13  GPIO0 13       OUTPUT    HIGH         HDD 1 Fault LED.           GPIO LED        
14  GPIO0 14       OUTPUT    HIGH         HDD 2 Fault LED.           GPIO LED        
15  GPIO0 15       OUTPUT    HIGH         Fan High (MSB).            GPIO fan        
16  GPIO0 16       OUTPUT    HIGH         Enable ethernet PHY LED.                   
21  GPIO0 21       INPUT     HIGH         Model ID 1.                                
26  GPIO0 26       OUTPUT    HIGH         HDD1 power enable.         Dummy regulator 
27  GPIO0 27       OUTPUT    HIGH         HDD2 power enable.         Dummy regulator 
37  GPIO1 5        OUTPUT    HIGH         Fan Mid.                   GPIO fan        
38  GPIO1 6        OUTPUT    HIGH         Fan Low (LSB).             GPIO fan        
39  GPIO1 7        INPUT     LOW          HDD 1 present.                             
40  GPIO1 8        INPUT     LOW          HDD 2 present.                             
41  GPIO1 9        INPUT     ?            USB 3.0 overcurrent alarm.                 
42  GPIO1 10       OUTPUT    HIGH         Enable all LEDs.                           
43  GPIO1 11       INPUT     ?            USB 2.0 overcurrent alarm.                 
44  GPIO1 12       OUTPUT    HIGH         USB 3.0 power enable       Dummy regulator 
45  GPIO1 13       INPUT     HIGH         Model ID 2                                 
46  GPIO1 14       INPUT     ?            SD card insert interrupt.  NA              
47  GPIO1 15       OUTPUT    HIGH         USB 2.0 power enable.      Dummy regulator

The "SD card insert interrupt" does not require to be defined in the DTS as the SD card socket isn't soldered on the DS216 board. At first look, it seems like all required components are present except for the socket. I don't think a slow SD card slot would be that useful so I won't dig deeper into the hardware and software mods required to make it fully functional.

Apparently every other button or LED is controlled through the PIC and it's serial interface. The PIC seems to control the onboard CPLD to some extent and there seems to be way more commands available than those listed on the other Synology DTS. As any control logic would have to be done in userspace anyway, finding all available commands is quite out of the scope of this topic for now.



Edited 2 time(s). Last edit at 04/10/2024 11:58AM by Robin.
Re: Debian on Synology DS216
April 10, 2024 01:35PM
Robin,

I already read this post before you edited it. So I did not realize there was new info until I happen to browse previous posts (if I don't see the new post flag, I don't read it).


> I started to look at the DTS of the DS218j and
> DS116 and found something i'm not sure about. In
> "armada-385-synology-ds218j.dts" one can read:
>
>                         ethernet@70000 {
> 				compatable = "marvell,neta";
> 				pinctrl-names = "default";
> 				phy = <&phy0>;
> 				phy-mode = "sgmii";
> 				buffer-manager = <&bm>;
> 				bm,pool-long = <0>;
> 				status = "okay";
> 			};
> 
> 			ethernet@34000 {
> 				compatable = "marvell,neta";
> 				pinctrl-names = "default";
> 				phy = <&phy1>;
> 				phy-mode = "sgmii";
> 				buffer-manager = <&bm>;
> 				bm,pool-long = <0>;
> 				status = "okay";
> 			};
>
>
> compatable sounds like a typo, not sure it
> has any effect as this line has been omitted in
> the DS116 DTS. I'm not sure if I should fix it or
> remove it for the DS216 DTS either.
> Also the DS216 only has one ethernet interface and
> so does the DS218j, so one should probably be
> removed.

Yes, that was not good, a significant typo :)

Let me look at the DTS and come back on this Ethernet topic.

>
> I will edit the dummy regulators to use GPIO0 26
> and GPIO0 27.
>
> I will also edit the SPI flash to :
>
> compatible = "micron,n25q064", "jedec,spi-nor";
>
> I checked in the manufacturer's datasheet, just
> like the macronix flash it also supports "fast
> read" and the 50MHz frequency seems wise as the
> chip supports it for all commands and it is wired
> close to the SoC with thin tracks (decent stray
> capacitance).

You can take out the n25q064, "jedec,spi-nor" is enough. But if it works then it's OK. And yes, some of the SPI frequency in various DTS are not conservative, they are usually the max possible.

compatible = "jedec,spi-nor";

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian on Synology DS216
April 10, 2024 01:44PM
> I think most of the issue is related to GPIO
> conflicts and/or bad definitions. I'll get back
> into this when debian will run a kernel with my
> edited DTB.

Bad definition.


> LEDs AND GPIOs
>
> Okay so after a bit of trial and error, and time
> spent digging into the Synology GPL tarballs
> (especially synobios.txz), I finally determined
> the GPIO config for the DS216. I'll edit the DTS
> accordingly and do some more testing to validate
> my findings.
>
>
> PIN BANK  BANK PIN DIRECTION ACTIVE STATE FUNCTION
>                   DTS DEFINITION  
> 6   GPIO0 6        INPUT     LOW          Copy
> button.               GPIO Button     
> 9   GPIO0 9        OUTPUT    HIGH         Enable
> HDD LEDs.                           
> 12  GPIO0 12       INPUT     HIGH         Model ID
> 0.                                
> 13  GPIO0 13       OUTPUT    HIGH         HDD 1
> Fault LED.           GPIO LED        
> 14  GPIO0 14       OUTPUT    HIGH         HDD 2
> Fault LED.           GPIO LED        
> 15  GPIO0 15       OUTPUT    HIGH         Fan High
> (MSB).            GPIO fan        
> 16  GPIO0 16       OUTPUT    HIGH         Enable
> ethernet PHY LED.                   
> 21  GPIO0 21       INPUT     HIGH         Model ID
> 1.                                
> 26  GPIO0 26       OUTPUT    HIGH         HDD1
> power enable.         Dummy regulator 
> 27  GPIO0 27       OUTPUT    HIGH         HDD2
> power enable.         Dummy regulator 
> 37  GPIO1 5        OUTPUT    HIGH         Fan Mid.
>                   GPIO fan        
> 38  GPIO1 6        OUTPUT    HIGH         Fan Low
> (LSB).             GPIO fan        
> 39  GPIO1 7        INPUT     LOW          HDD 1
> present.                             
> 40  GPIO1 8        INPUT     LOW          HDD 2
> present.                             
> 41  GPIO1 9        INPUT     ?            USB 3.0
> overcurrent alarm.                 
> 42  GPIO1 10       OUTPUT    HIGH         Enable
> all LEDs.                           
> 43  GPIO1 11       INPUT     ?            USB 2.0
> overcurrent alarm.                 
> 44  GPIO1 12       OUTPUT    HIGH         USB 3.0
> power enable       Dummy regulator 
> 45  GPIO1 13       INPUT     HIGH         Model ID
> 2                                 
> 46  GPIO1 14       INPUT     ?            SD card
> insert interrupt.  NA              
> 47  GPIO1 15       OUTPUT    HIGH         USB 2.0
> power enable.      Dummy regulator 
>
>

Nice!

> The "SD card insert interrupt" does not require to
> be defined in the DTS as the SD card socket isn't
> soldered on the DS216 board. At first look, it
> seems like all required components are present
> except for the socket. I don't think a slow SD
> card slot would be that useful so I won't dig
> deeper into the hardware and software mods
> required to make it fully functional.

Right. If there is no SD card slot, I would not bother.

> Apparently every other button or LED is controlled
> through the PIC and it's serial interface. The PIC
> seems to control the onboard CPLD to some extent
> and there seems to be way more commands available
> than those listed on the other Synology DTS. As
> any control logic would have to be done in
> userspace anyway, finding all available commands
> is quite out of the scope of this topic for now.

Agree.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian on Synology DS216
April 10, 2024 02:08PM
Robin,

> > 				compatable = "marvell,neta";

Yes, you can take out the compatible property. It was a left over from the old style binding. There is no need to do this for Armada 385 SoC boards. And most likely that typo has screwed up the hwmon!

> > 			ethernet@34000 {

And yes, remove this 2nd ethernet node ethernet@34000.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian on Synology DS216
April 11, 2024 04:11PM
GOOD NEWS

After spending all day refining my DTS, almost everything works properly. USB 2.0 and 3.0 are both fixed, SATA ports are powered, SPI NOR flash works at a much higher frequency thanks to FAST READ. There is now only one ethernet interface, and many other little things have been improved significantly. Here are my current DTS and bootlog, if you find something i may have missed i'm all ears ;-)
Any hints concerning the way i could control the "enable hdd leds" and "enable all leds" GPIOs is welcome.
Thanks for your support, I couldn't have done that much in so little time without you guys.

EDIT: Quick note on HWmon as there are now three good looking nodes under debian. I'll check it out tomorrow but it seems like the issue is mostly solved.

Starting kernel ...

[    0.000000][    T0] Booting Linux on physical CPU 0x0
[    0.000000][    T0] Linux version 6.6.2-mvebu-tld-1 (root@tldDebian) (gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40) #1 SMP PREEMPT Mon Nov 20 18:44:27 PST 2023
[    0.000000][    T0] CPU: ARMv7 Processor [414fc091] revision 1 (ARMv7), cr=10c5387d
[    0.000000][    T0] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000][    T0] OF: fdt: Machine model: Synology DS216
[    0.000000][    T0] printk: bootconsole [earlycon0] enabled
[    0.000000][    T0] Memory policy: Data cache writealloc
[    0.000000][    T0] Zone ranges:
[    0.000000][    T0]   Normal   [mem 0x0000000000000000-0x000000001fffffff]
[    0.000000][    T0]   HighMem  empty
[    0.000000][    T0] Movable zone start for each node
[    0.000000][    T0] Early memory node ranges
[    0.000000][    T0]   node   0: [mem 0x0000000000000000-0x000000001fffffff]
[    0.000000][    T0] Initmem setup node 0 [mem 0x0000000000000000-0x000000001fffffff]
[    0.000000][    T0] percpu: Embedded 29 pages/cpu s25364 r8192 d85228 u118784
[    0.000000][    T0] Kernel command line: console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 mtdparts=spi0.0:4m(boot),-(spi-rootfs) earlyprintk=serial
[    0.000000][    T0] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    0.000000][    T0] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes, linear)
[    0.000000][    T0] Built 1 zonelists, mobility grouping on.  Total pages: 129920
[    0.000000][    T0] mem auto-init: stack:off, heap alloc:on, heap free:off
[    0.000000][    T0] Memory: 495040K/524288K available (10240K kernel code, 873K rwdata, 3492K rodata, 1024K init, 314K bss, 29248K reserved, 0K cma-reserved, 0K highmem)
[    0.000000][    T0] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=2, Nodes=1
[    0.000000][    T0] rcu: Preemptible hierarchical RCU implementation.
[    0.000000][    T0] rcu: 	RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=2.
[    0.000000][    T0] 	Trampoline variant of Tasks RCU enabled.
[    0.000000][    T0] 	Tracing variant of Tasks RCU enabled.
[    0.000000][    T0] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
[    0.000000][    T0] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=2
[    0.000000][    T0] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[    0.000000][    T0] L2C: DT/platform modifies aux control register: 0x06070000 -> 0x16070000
[    0.000000][    T0] L2C-310 enabling early BRESP for Cortex-A9
[    0.000000][    T0] L2C-310 full line of zeros enabled for Cortex-A9
[    0.000000][    T0] L2C-310 D prefetch enabled, offset 1 lines
[    0.000000][    T0] L2C-310 dynamic clock gating enabled, standby mode enabled
[    0.000000][    T0] L2C-310 Coherent cache controller enabled, 16 ways, 1024 kB
[    0.000000][    T0] L2C-310 Coherent: CACHE_ID 0x410054c9, AUX_CTRL 0x56070001
[    0.000000][    T0] rcu: srcu_init: Setting srcu_struct sizes based on contention.
[    0.000001][    T0] sched_clock: 64 bits at 666MHz, resolution 1ns, wraps every 4398046511103ns
[    0.008682][    T0] clocksource: arm_global_timer: mask: 0xffffffffffffffff max_cycles: 0x999999d70a, max_idle_ns: 440795225152 ns
[    0.020389][    T0] Switching to timer-based delay loop, resolution 1ns
[    0.027211][    T0] Ignoring duplicate/late registration of read_current_timer delay
[    0.034940][    T0] clocksource: armada_370_xp_clocksource: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 76450417870 ns
[    0.046813][    T0] kfence: initialized - using 2097152 bytes for 255 objects at 0x(ptrval)-0x(ptrval)
[    0.056415][    T0] Console: colour dummy device 80x30
[    0.061566][    T0] Calibrating delay loop (skipped), value calculated using timer frequency.. 1332.00 BogoMIPS (lpj=6660000)
[    0.072844][    T0] CPU: Testing write buffer coherency: ok
[    0.078425][    T0] CPU0: Spectre v2: using BPIALL workaround
[    0.084150][    T0] pid_max: default: 32768 minimum: 301
[    0.092682][    T0] LSM: initializing lsm=capability,integrity
[    0.099418][    T0] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.107405][    T0] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.119903][    T1] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[    0.127015][    T1] RCU Tasks: Setting shift to 1 and lim to 1 rcu_task_cb_adjust=1.
[    0.134905][    T1] RCU Tasks Trace: Setting shift to 1 and lim to 1 rcu_task_cb_adjust=1.
[    0.143245][    T1] Setting up static identity map for 0x100000 - 0x100060
[    0.150382][    T1] mvebu-soc-id: MVEBU SoC ID=0x6820, Rev=0x4
[    0.156325][    T1] mvebu-pmsu: Initializing Power Management Service Unit
[    0.163319][    T1] rcu: Hierarchical SRCU implementation.
[    0.168805][    T1] rcu: 	Max phase no-delay instances is 1000.
[    0.175371][    T1] smp: Bringing up secondary CPUs ...
[    0.181014][    T1] Booting CPU 1
[    0.184476][    T0] CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
[    0.184488][    T0] CPU1: Spectre v2: using BPIALL workaround
[    0.196645][    T1] smp: Brought up 1 node, 2 CPUs
[    0.201434][    T1] SMP: Total of 2 processors activated (2664.00 BogoMIPS).
[    0.208470][    T1] CPU: All CPU(s) started in SVC mode.
[    0.214857][    T1] devtmpfs: initialized
[    0.223286][    T1] VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 4
[    0.231940][    T1] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.242473][    T1] futex hash table entries: 512 (order: 3, 32768 bytes, linear)
[    0.252158][    T1] prandom: seed boundary self test passed
[    0.259318][    T1] prandom: 100 self tests passed
[    0.264092][    T1] pinctrl core: initialized pinctrl subsystem
[    0.271307][    T1] NET: Registered PF_NETLINK/PF_ROUTE protocol family
[    0.278666][    T1] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.288524][    T1] audit: initializing netlink subsys (disabled)
[    0.294792][   T30] audit: type=2000 audit(0.250:1): state=initialized audit_enabled=0 res=1
[    0.295251][    T1] thermal_sys: Registered thermal governor 'step_wise'
[    0.303276][    T1] cpuidle: using governor ladder
[    0.314749][    T1] cpuidle: using governor menu
[    0.319519][    T1] hw-breakpoint: found 5 (+1 reserved) breakpoint and 1 watchpoint registers.
[    0.328198][    T1] hw-breakpoint: maximum watchpoint size is 4 bytes.
[    0.337246][    T1] platform soc: Fixed dependency cycle(s) with /soc/internal-regs/interrupt-controller@d000
[    0.527063][    T1] raid6: int32x8  gen()   266 MB/s
[    0.697109][    T1] raid6: int32x4  gen()   277 MB/s
[    0.867092][    T1] raid6: int32x2  gen()   459 MB/s
[    1.037053][    T1] raid6: int32x1  gen()   531 MB/s
[    1.042000][    T1] raid6: using algorithm int32x1 gen() 531 MB/s
[    1.217104][    T1] raid6: .... xor() 177 MB/s, rmw enabled
[    1.222658][    T1] raid6: using intx1 recovery algorithm
[    1.229265][    T1] SCSI subsystem initialized
[    1.234060][    T1] usbcore: registered new interface driver usbfs
[    1.240261][    T1] usbcore: registered new interface driver hub
[    1.246274][    T1] usbcore: registered new device driver usb
[    1.252309][    T1] pps_core: LinuxPPS API ver. 1 registered
[    1.257964][    T1] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    1.267800][    T1] PTP clock support registered
[    1.273838][    T1] vgaarb: loaded
[    1.277661][    T1] clocksource: Switched to clocksource arm_global_timer
[    1.287937][    T1] VFS: Disk quotas dquot_6.6.0
[    1.292718][    T1] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[    1.308578][    T1] NET: Registered PF_INET protocol family
[    1.314293][    T1] IP idents hash table entries: 8192 (order: 4, 65536 bytes, linear)
[    1.323181][    T1] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes, linear)
[    1.332288][    T1] Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    1.340730][    T1] TCP established hash table entries: 4096 (order: 2, 16384 bytes, linear)
[    1.349215][    T1] TCP bind hash table entries: 4096 (order: 4, 65536 bytes, linear)
[    1.357086][    T1] TCP: Hash tables configured (established 4096 bind 4096)
[    1.364420][    T1] MPTCP token hash table entries: 512 (order: 1, 8192 bytes, linear)
[    1.372504][    T1] UDP hash table entries: 256 (order: 1, 8192 bytes, linear)
[    1.379737][    T1] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear)
[    1.387746][    T1] NET: Registered PF_UNIX/PF_LOCAL protocol family
[    1.394578][    T1] RPC: Registered named UNIX socket transport module.
[    1.401192][    T1] RPC: Registered udp transport module.
[    1.406571][    T1] RPC: Registered tcp transport module.
[    1.411957][    T1] RPC: Registered tcp-with-tls transport module.
[    1.418120][    T1] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    1.425235][    T1] PCI: CLS 0 bytes, default 64
[    1.430049][   T25] Trying to unpack rootfs image as initramfs...
[    1.438119][    T1] hw perfevents: enabled with armv7_cortex_a9 PMU driver, 7 counters available
[    1.449999][    T1] Initialise system trusted keyrings
[    1.455208][    T1] Key type blacklist registered
[    1.461030][    T1] workingset: timestamp_bits=14 max_order=17 bucket_order=3
[    1.468279][    T1] zbud: loaded
[    1.478373][    T1] NFS: Registering the id_resolver key type
[    1.484134][    T1] Key type id_resolver registered
[    1.489045][    T1] Key type id_legacy registered
[    1.493872][    T1] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[    1.501310][    T1] nfs4flexfilelayout_init: NFSv4 Flexfile Layout Driver Registering...
[    1.594890][    T1] xor: measuring software checksum speed
[    1.604930][    T1]    arm4regs        :  2172 MB/sec
[    1.615876][    T1]    8regs           :  1669 MB/sec
[    1.618200][   T25] Freeing initrd memory: 5136K
[    1.626643][    T1]    32regs          :  1733 MB/sec
[    1.631690][    T1] xor: using function: arm4regs (2172 MB/sec)
[    1.637596][    T1] async_tx: api initialized (async)
[    1.642645][    T1] Key type asymmetric registered
[    1.647420][    T1] Asymmetric key parser 'x509' registered
[    1.653299][    T1] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 245)
[    1.661701][    T1] io scheduler bfq registered
[    1.669713][    T1] armada-38x-pinctrl f1018000.pinctrl: registered pinctrl driver
[    1.679110][    T1] gpio gpiochip0: Static allocation of GPIO base is deprecated, use dynamic allocation.
[    1.689108][    T1] debugfs: Directory 'f1018100.gpio' with parent 'regmap' already present!
[    1.698252][    T1] gpio gpiochip1: Static allocation of GPIO base is deprecated, use dynamic allocation.
[    1.708213][    T1] debugfs: Directory 'f1018140.gpio' with parent 'regmap' already present!
[    1.718149][    T1] mv_xor f1060800.xor: Marvell shared XOR driver
[    1.798686][    T1] mv_xor f1060800.xor: Marvell XOR (Descriptor Mode): ( xor cpy intr )
[    1.809091][    T1] mv_xor f1060900.xor: Marvell shared XOR driver
[    1.868711][    T1] mv_xor f1060900.xor: Marvell XOR (Descriptor Mode): ( xor cpy intr )
[    1.982658][    T1] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
[    1.993604][    T1] printk: console [ttyS0] disabled
[    2.019794][    T1] f1012000.serial: ttyS0 at MMIO 0xf1012000 (irq = 39, base_baud = 15625000) is a 16550A
[    2.029490][    T1] printk: console [ttyS0] enabled
[    2.029490][    T1] printk: console [ttyS0] enabled
[    2.039300][    T1] printk: bootconsole [earlycon0] disabled
[    2.039300][    T1] printk: bootconsole [earlycon0] disabled
[    2.089326][    T1] f1012100.serial: ttyS1 at MMIO 0xf1012100 (irq = 40, base_baud = 15625000) is a 16550A
[    2.101028][    T1] ahci-mvebu f10a8000.sata: supply ahci not found, using dummy regulator
[    2.109589][    T1] ahci-mvebu f10a8000.sata: supply phy not found, using dummy regulator
[    2.117865][    T1] ahci-mvebu f10a8000.sata: supply target not found, using dummy regulator
[    2.126496][    T1] ahci-mvebu f10a8000.sata: AHCI 0001.0000 32 slots 2 ports 6 Gbps 0x3 impl platform mode
[    2.136311][    T1] ahci-mvebu f10a8000.sata: flags: 64bit ncq sntf led only pmp fbs pio slum part sxs 
[    2.147367][    T1] scsi host0: ahci-mvebu
[    2.152392][    T1] scsi host1: ahci-mvebu
[    2.156855][    T1] ata1: SATA max UDMA/133 mmio [mem 0xf10a8000-0xf10a9fff] port 0x100 irq 41
[    2.165524][    T1] ata2: SATA max UDMA/133 mmio [mem 0xf10a8000-0xf10a9fff] port 0x180 irq 41
[    2.176694][    T1] spi-nor spi0.0: n25q064 (8192 Kbytes)
[    2.182223][    T1] 2 cmdlinepart partitions found on MTD device spi0.0
[    2.188887][    T1] Creating 2 MTD partitions on "spi0.0":
[    2.194412][    T1] 0x000000000000-0x000000400000 : "boot"
[    2.201567][    T1] 0x000000400000-0x000000800000 : "spi-rootfs"
[    2.209605][    T1] wireguard: WireGuard 1.0.0 loaded. See www.wireguard.com for information.
[    2.218216][    T1] wireguard: Copyright (C) 2015-2019 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
[    2.245070][    T1] hwmon hwmon0: temp1_input not attached to any thermal zone
[    2.253583][    T1] mvneta_bm f10c8000.bm: Buffer Manager for network controller enabled
[    2.267191][    T1] mvneta f1070000.ethernet eth0: Using random mac address d6:47:0c:f7:56:96
[    2.276532][    T1] usbcore: registered new interface driver smsc75xx
[    2.283580][    T1] orion-ehci f1058000.usb: EHCI Host Controller
[    2.289761][    T1] orion-ehci f1058000.usb: new USB bus registered, assigned bus number 1
[    2.298147][    T1] orion-ehci f1058000.usb: irq 43, io mem 0xf1058000
[    2.337678][    T1] orion-ehci f1058000.usb: USB 2.0 started, EHCI 1.00
[    2.344534][    T1] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 6.06
[    2.353550][    T1] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    2.361509][    T1] usb usb1: Product: EHCI Host Controller
[    2.367105][    T1] usb usb1: Manufacturer: Linux 6.6.2-mvebu-tld-1 ehci_hcd
[    2.374190][    T1] usb usb1: SerialNumber: f1058000.usb
[    2.380240][    T1] hub 1-0:1.0: USB hub found
[    2.384739][    T1] hub 1-0:1.0: 1 port detected
[    2.390733][    T1] xhci-hcd f10f0000.usb3: xHCI Host Controller
[    2.396785][    T1] xhci-hcd f10f0000.usb3: new USB bus registered, assigned bus number 2
[    2.405091][    T1] xhci-hcd f10f0000.usb3: hcc params 0x0a000990 hci version 0x100 quirks 0x0000000000000010
[    2.415108][    T1] xhci-hcd f10f0000.usb3: irq 44, io mem 0xf10f0000
[    2.422279][    T1] xhci-hcd f10f0000.usb3: xHCI Host Controller
[    2.428336][    T1] xhci-hcd f10f0000.usb3: new USB bus registered, assigned bus number 3
[    2.436579][    T1] xhci-hcd f10f0000.usb3: Host supports USB 3.0 SuperSpeed
[    2.443824][    T1] usb usb2: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 6.06
[    2.452835][    T1] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    2.460798][    T1] usb usb2: Product: xHCI Host Controller
[    2.466393][    T1] usb usb2: Manufacturer: Linux 6.6.2-mvebu-tld-1 xhci-hcd
[    2.473476][    T1] usb usb2: SerialNumber: f10f0000.usb3
[    2.479560][    T1] hub 2-0:1.0: USB hub found
[    2.484058][    T1] hub 2-0:1.0: 1 port detected
[    2.489234][    T1] usb usb3: We don't know the algorithms for LPM for this host, disabling LPM.
[    2.498190][    T1] usb usb3: New USB device found, idVendor=1d6b, idProduct=0003, bcdDevice= 6.06
[    2.507188][    T1] usb usb3: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    2.515147][    T1] usb usb3: Product: xHCI Host Controller
[    2.520828][    T1] usb usb3: Manufacturer: Linux 6.6.2-mvebu-tld-1 xhci-hcd
[    2.527919][    T1] usb usb3: SerialNumber: f10f0000.usb3
[    2.533925][    T1] hub 3-0:1.0: USB hub found
[    2.538437][    T1] hub 3-0:1.0: 1 port detected
[    2.543908][    T1] xhci-hcd f10f8000.usb3: xHCI Host Controller
[    2.550059][    T1] xhci-hcd f10f8000.usb3: new USB bus registered, assigned bus number 4
[    2.558364][    T1] xhci-hcd f10f8000.usb3: hcc params 0x0a000990 hci version 0x100 quirks 0x0000000000000010
[    2.568397][    T1] xhci-hcd f10f8000.usb3: irq 45, io mem 0xf10f8000
[    2.575002][    T1] xhci-hcd f10f8000.usb3: xHCI Host Controller
[    2.581137][    T1] xhci-hcd f10f8000.usb3: new USB bus registered, assigned bus number 5
[    2.589379][    T1] xhci-hcd f10f8000.usb3: Host supports USB 3.0 SuperSpeed
[    2.596596][    T1] usb usb4: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 6.06
[    2.605605][    T1] usb usb4: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    2.613630][    T1] usb usb4: Product: xHCI Host Controller
[    2.619239][    T1] usb usb4: Manufacturer: Linux 6.6.2-mvebu-tld-1 xhci-hcd
[    2.626316][    T1] usb usb4: SerialNumber: f10f8000.usb3
[    2.632357][    T1] hub 4-0:1.0: USB hub found
[    2.636853][    T1] hub 4-0:1.0: 1 port detected
[    2.642082][    T1] usb usb5: We don't know the algorithms for LPM for this host, disabling LPM.
[    2.651106][    T1] usb usb5: New USB device found, idVendor=1d6b, idProduct=0003, bcdDevice= 6.06
[    2.660118][    T1] usb usb5: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    2.667709][  T691] ata1: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
[    2.668254][    T1] usb usb5: Product: xHCI Host Controller
[    2.675005][  T696] ata2: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
[    2.680581][    T1] usb usb5: Manufacturer: Linux 6.6.2-mvebu-tld-1 xhci-hcd
[    2.680587][    T1] usb usb5: SerialNumber: f10f8000.usb3
[    2.694994][    T1] hub 5-0:1.0: USB hub found
[    2.700105][  T691] ata1.00: ATA-8: ST500LT012-1DG142, 1003YAM1, max UDMA/133
[    2.704884][    T1] hub 5-0:1.0: 1 port detected
[    2.711828][  T691] ata1.00: 976773168 sectors, multi 16: LBA48 NCQ (depth 32)
[    2.718058][    T1] usbcore: registered new interface driver usblp
[    2.723627][  T696] ata2.00: ATA-8: Hitachi HTS545050A7E380, GG2OA7A0, max UDMA/100
[    2.730163][    T1] usbcore: registered new interface driver usb-storage
[    2.737598][  T696] ata2.00: 976773168 sectors, multi 16: LBA48 NCQ (depth 32)
[    2.744953][    T1] mousedev: PS/2 mouse device common for all mice
[    2.752803][  T696] ata2.00: configured for UDMA/100
[    2.760656][    T1] armada38x-rtc f10a3800.rtc: registered as rtc0
[    2.762826][  T691] ata1.00: configured for UDMA/133
[    2.769075][    T1] armada38x-rtc f10a3800.rtc: setting system clock to 2024-04-11T20:48:57 UTC (1712868537)
[    2.784316][   T26] scsi 0:0:0:0: Direct-Access     ATA      ST500LT012-1DG14 YAM1 PQ: 0 ANSI: 5
[    2.794506][    T1] i2c_dev: i2c /dev entries driver
[    2.795580][   T25] sd 0:0:0:0: [sda] 976773168 512-byte logical blocks: (500 GB/466 GiB)
[    2.801408][    T1] at24 0-0057: supply vcc not found, using dummy regulator
[    2.807987][   T25] sd 0:0:0:0: [sda] 4096-byte physical blocks
[    2.821348][   T39] scsi 1:0:0:0: Direct-Access     ATA      Hitachi HTS54505 A7A0 PQ: 0 ANSI: 5
[    2.830342][   T25] sd 0:0:0:0: [sda] Write Protect is off
[    2.833173][   T26] sd 1:0:0:0: [sdb] 976773168 512-byte logical blocks: (500 GB/466 GiB)
[    2.844311][   T25] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    2.844666][   T26] sd 1:0:0:0: [sdb] 4096-byte physical blocks
[    2.854452][   T25] sd 0:0:0:0: [sda] Preferred minimum I/O size 4096 bytes
[    2.860289][   T26] sd 1:0:0:0: [sdb] Write Protect is off
[    2.872742][   T26] sd 1:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    2.883841][    T1] gpio-fan fan: GPIO fan initialized
[    2.890101][   T26] sd 1:0:0:0: [sdb] Preferred minimum I/O size 4096 bytes
[    2.899511][    T1] orion_wdt: Initial timeout 171 sec
[    2.905333][    T1] device-mapper: uevent: version 1.0.3
[    2.911026][    T1] device-mapper: ioctl: 4.48.0-ioctl (2023-03-01) initialised: dm-devel@redhat.com
[    2.920620][    T1] device-mapper: multipath round-robin: version 1.2.0 loaded
[    2.927916][    T1] device-mapper: multipath queue-length: version 0.2.0 loaded
[    2.935255][    T1] device-mapper: multipath service-time: version 0.3.0 loaded
[    2.942708][    T1] device-mapper: dm-log-userspace: version 1.3.0 loaded
[    2.949873][    T1] sdhci: Secure Digital Host Controller Interface driver
[    2.956788][    T1] sdhci: Copyright(c) Pierre Ossman
[    2.962074][    T1] sdhci-pltfm: SDHCI platform and OF driver helper
[    2.970575][    T1] marvell-cesa f1090000.crypto: CESA device successfully registered
[    2.978926][    T1] hid: raw HID events driver (C) Jiri Kosina
[    2.985372][    T1] usbcore: registered new interface driver usbhid
[    2.991709][    T1] usbhid: USB HID core driver
[    2.996407][   T26]  sdb: sdb1
[    2.997460][    T1] NET: Registered PF_INET6 protocol family
[    3.000549][   T26] sd 1:0:0:0: [sdb] Attached SCSI removable disk
[    3.006363][    T1] Segment Routing with IPv6
[    3.015795][    T1] RPL Segment Routing with IPv6
[    3.020572][    T1] In-situ OAM (IOAM) with IPv6
[    3.025273][    T1] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
[    3.033466][    T1] NET: Registered PF_PACKET protocol family
[    3.039427][    T1] 8021q: 802.1Q VLAN Support v1.8
[    3.044403][    T1] Key type dns_resolver registered
[    3.049583][    T1] ThumbEE CPU extension supported.
[    3.054576][    T1] Registering SWP/SWPB emulation handler
[    3.091854][    T1] registered taskstats version 1
[    3.096743][    T1] Loading compiled-in X.509 certificates
[    3.116142][    T1] Key type .fscrypt registered
[    3.120892][    T1] Key type fscrypt-provisioning registered
[    3.126653][    T1] Key type big_key registered
[    3.148761][    T1] Key type encrypted registered
[    3.158850][ T1139] usb_phy_generic ehci-phy: dummy supplies not allowed for exclusive requests
[    3.167838][ T1139] usb_phy_generic xhci-phy: dummy supplies not allowed for exclusive requests
[    3.178024][    T1] input: keys as /devices/platform/keys/input/input0
[    3.185470][    T1] clk: Disabling unused clocks
[    3.270505][   T25]  sda: sda1 sda2 sda3 sda4
[    3.275621][   T25] sd 0:0:0:0: [sda] Attached SCSI removable disk
[    3.284419][    T1] Freeing unused kernel image (initmem) memory: 1024K
[    3.328271][    T1] Checked W+X mappings: passed, no W+X pages found
[    3.334662][    T1] Run /init as init process
Loading, please wait...
Starting systemd-udevd version 252.19-1~deb12u1
Begin: Loading essential drivers ... done.
Begin: Running /scripts/init-premount ... done.
Begin: Mounting root file system ... Begin: Running /scripts/local-top ... done.
Begin: Running /scripts/local-premount ... done.
Begin: Will now check root file system ... fsck from util-linux 2.38.1
fsck: error 2 (No such file or directory) while executing fsck.ext4 for /dev/sdb1
fsck exited with status code 8
done.
Warning: File system check failed but did not detect errors
[   20.368117][ T1346] EXT4-fs (sdb1): mounted filesystem 92f11383-f1e4-44cb-a386-5bf287ad08ff ro with ordered data mode. Quota mode: none.
done.
Begin: Running /scripts/local-bottom ... done.
Begin: Running /scripts/init-bottom ... done.
INIT: version 3.06 booting
INIT: No inittab.d directory found
Using makefile-style concurrent boot in runlevel S.
Setting hostname to 'debian'...done.
Starting hotplug events dispatcher: systemd-udevd.
Synthesizing the initial hotplug events (subsystems)...done.
Synthesizing the initial hotplug events (devices)...done.
Waiting for /dev to be fully populated...[   23.697483][ T1533] sd 0:0:0:0: Attached scsi generic sg0 type 0
[   23.703705][ T1533] sd 1:0:0:0: Attached scsi generic sg1 type 0
done.
Activating swap:.
[   26.045378][ T1673] EXT4-fs (sdb1): re-mounted 92f11383-f1e4-44cb-a386-5bf287ad08ff ro. Quota mode: none.
Will now check root file system:[/sbin/fsck.ext3 (1) -- /] fsck.ext3 -y -C0 /dev/sdb1 
e2fsck 1.47.0 (5-Feb-2023)
rootfs: clean, 25962/30523392 files, 2414580/122083840 blocks
.
[   26.733615][ T1680] EXT4-fs (sdb1): re-mounted 92f11383-f1e4-44cb-a386-5bf287ad08ff r/w. Quota mode: none.
[   27.191958][    C0] random: crng init done
Will now check all file systems.
Checking all file systems.
LABEL=rootfs is mounted
Done checking file systems.
Log is being saved in /var/log/fsck/checkfs if that location is writable.
Cleaning up temporary files...Cleaning /tmp...done.
 /tmp.
Will now mount local filesystems:.
Will now activate swapfile swap, if any:done.
Checking minimum space in /tmp...done.
Cleaning up temporary files....
Starting Setting kernel variables: sysctl.
Initializing random number generator...done.
Configuring network interfaces...Internet Systems Consortium DHCP Client 4.4.3-P1
Copyright 2004-2022 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

[   31.108528][ T2070] mvneta f1070000.ethernet eth0: PHY [f1072004.mdio-mii:01] driver [Marvell 88E1510] (irq=POLL)
[   31.120109][ T2070] mvneta f1070000.ethernet eth0: configuring for phy/sgmii link mode
[   34.268080][  T833] mvneta f1070000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
Listening on LPF/eth0/c2:90:9a:b0:fd:d6
Sending on   LPF/eth0/c2:90:9a:b0:fd:d6
Sending on   Socket/fallback
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 6
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 14
DHCPOFFER of 192.168.1.249 from 192.168.1.1
DHCPREQUEST for 192.168.1.249 on eth0 to 255.255.255.255 port 67
DHCPACK of 192.168.1.249 from 192.168.1.1
bound to 192.168.1.249 -- renewal in 18989 seconds.
done.
Starting RPC port mapper daemon: rpcbind.
Starting NFS common utilities: statd idmapd.
Cleaning up temporary files....
INIT: Entering runlevel: 2
Using makefile-style concurrent boot in runlevel 2.
Not starting NFS kernel daemon: no exports ... (warning).
Starting busybox' syslogd implementation : syslogdStarting /sbin/syslogd...
2226 (syslogd)
.
Starting NTP server: ntpd2024-04-11T22:49:21 ntpd[2269]: INIT: ntpd ntpsec-1.2.2: Starting
2024-04-11T22:49:21 ntpd[2269]: INIT: Command line: /usr/sbin/ntpd -p /var/run/ntpd.pid -g -u 104:109
.
Starting NTP server: ntpd2024-04-11T22:49:21 ntpd[2237]: INIT: ntpd ntpsec-1.2.2: Starting
2024-04-11T22:49:21 ntpd[2237]: INIT: Command line: /usr/sbin/ntpd -p /run/ntpd.pid -c /etc/ntpsec/ntp.conf -g -N -u ntpsec:ntpsec
.
Starting periodic command scheduler: cron.
Starting OpenBSD Secure Shell server: sshd.
Starting system message bus: dbus.
Starting Avahi mDNS/DNS-SD Daemon: avahi-daemon.
Starting busybox' klogd implementation : klogdStarting /sbin/klogd...
2247 (klogd)
.
Running local boot scripts (/etc/rc.local)
Cannot read environment, using default
Cannot read default environment from file
<13>Apr 11 22:49:24 root[2320]: Cannot read u-boot env ethaddr
.

Debian GNU/Linux 12 debian ttyS0

debian login:



Edited 3 time(s). Last edit at 04/12/2024 02:09AM by Robin.
Attachments:
open | download - armada-385-synology-ds216.dts (8.7 KB)
Re: Debian on Synology DS216
April 12, 2024 02:40PM
Hi Robin,

Great job with the DTS!

> Here are my current DTS and
> bootlog, if you find something i may have missed
> i'm all ears ;-)

The boot log looks very good! Here is my comment on the DTS so far.

FAN

The new binding for fan speed now has each speed in the map inside brackets. This is a recent change in the DT binding (old style still work, though).

For example,

gpio-fan,speed-map = <   0 0>,
                                             <1500 1>,
                                             <2500 2>,
                                             <3000 3>,
                                             <3400 4>,
                                             <3700 5>,
                                             <3900 6>,
                                             <4000 7>;
And have you tested the fan speeds?

> Any hints concerning the way i could control the
> "enable hdd leds" and "enable all leds" GPIOs is
> welcome.

Let me take a close look and post again about this subject.

> Thanks for your support, I couldn't have done that
> much in so little time without you guys.

Thanks for your contribution!

>
> EDIT: Quick note on HWmon as there are now three
> good looking nodes under debian. I'll check it out
> tomorrow but it seems like the issue is mostly
> solved.

Cool!

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian on Synology DS216
April 12, 2024 03:51PM
HDD LEDs

Since you have found this in the GPL:
9   GPIO0 9        OUTPUT    HIGH         Enable HDD LEDs.
But there is no GPIO for HDD1 or HDD2. It looks like the HDD LEDs are not individually controlled. As I recalled (badly), some Synology boxes are like this (it's how the board layout was designed, not that they could not do it).

So add another led node similar to what you did for the orange led-0 and led-1.

led-2 {
                        label = "ds216:status:disk";
                        gpios = <&gpio0 9 GPIO_ACTIVE_HIGH>;
                };

To test this in Linux, reboot with the new DTB appended to uImage, and
echo disk-activity > /sys/class/leds/ds216\:status\:disk/trigger
And then do a disk access that would last a few seconds to see both HDD LED flashing.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian on Synology DS216
April 12, 2024 04:52PM
Hi Tony,
Thanks for your comments and tips. I spent most of my day refining my DTS and discovered a few things on the way...

EEPROM

For my first DTS, the one I shared previously, I foolishly copy-pasted some bindings from other DTS files I based my work on in the first place, including:
                        i2c@11000 {
				pinctrl-names = "default";
				pinctrl-0 = <&i2c0_pins>;
				status = "okay";
				clock-frequency = <100000>;

				eeprom@57 {
					compatible = "atmel,24c64";
					reg = <0x57>;
				};
			};

However, having some doubts about the EEPROM presence, I completely removed the mainboard of the DS216 and took time to understand it's design.
There is absolutely no EEPROM chip on this board whatsoever, and the i2c-0 bus is most likely unused. The bus experiencing locks all the time, I decided to remove the whole i2c-0 + EEPROM node.

I discovered a few things on the way, notably when it comes to memory.

RAM

This is something that is more related to u-boot than the core subject of this topic, but I prefer to write a small paragraph about it with a bold header as a reminder for later.
The DS216 unit I own has two 2GBIT (256MB) Samsung DDR3 1600MHz K4B2G1646Q-BCK0 soldered on board, for a grand total of 512MB of RAM.

Those chips are 1600MHz capable, but the stock Marvell u-boot initializes them at 1333MHz. I don't know if it's a mistake, or if some units may have 1333Mhz RAM chips soldered on board but it's clearly sub-optimal in this unit.

SPI FLASH PARTITIONS

I noticed that during the boot sequence, the SPI FLASH driver simply ignored the partition scheme provided in the DTS. I found that apparently it was a normal behavior for the driver to take the redboot partition table first if partitions aren't included in a common "partitions" node with "compatible = "fixed-partitions";" set. I made some edits and report how well it worked once i tested everything properly.

LEDs and GPIOs

bodhi Wrote:
-------------------------------------------------------
> But there is no GPIO for HDD1 or HDD2. It looks
> like the HDD LEDs are not individually controlled.
> As I recalled (badly), some Synology boxes are
> like this (it's how the board layout was designed,
> not that they could not do it).

Indeed, it's even a bit wilder than that. Inspecting the board i found that almost all LEDs are in fact wired to the CPLD. This way, the logic almost every manufacturer on earth would have done in software is now handled with a super overkill ALTERA EPM3032A programmable logic device and an old school PIC16 microcontroller. This whole "synobios" subsystem even has it's own RTC clock, with a dedicated S-35390A chip (mainly used for wake-up programming through the serial interface).

A wacky and hardly flexible design, that leaves us with an IO behavior designed for the DSM logic:

- GPIO 42 enables or disables all LEDs (active high). It takes priority over all LED GPIOs and even shuts off the power and status LEDs, which can normally only be controlled through the serial interface. It basically acts like a "night mode LED off" switch.
- GPIO 9 enables or disables HDD LEDs, green and orange. It takes priority over all HDD LED GPIOs.
- GPIO 13 and 14 enables or disables the orange HDD LEDs. Those are not activity triggered, only static orange diodes. Enabling those automatically disables the green activity LED it shares the indicator with. It basically acts as a "Fault on DiskX" indicator.
- GPIO 16 enables the green ethernet PHY LED. It is activity triggered under u-boot and during the boot sequence (if the IO is set high in u-boot, it is not by default) but does not seem to be as soon as debian initializes the interface.

That's why I'm hesitating between declaring some GPIOs as LEDs, even if the logic is a bit skewed, and simply exposing other GPIOs to userspace so that a script or service can do what it wants with them.

FAN

Thanks for the tips about the new bindings. I'll make some edits and do some more testing about this tomorrow.
Re: Debian on Synology DS216
April 12, 2024 05:40PM
Hi Robin,

> There is absolutely no EEPROM chip on this board
> whatsoever, and the i2c-0 bus is most likely
> unused. The bus experiencing locks all the time, I
> decided to remove the whole i2c-0 + EEPROM node.

Cool!

> This is something that is more related to u-boot
> than the core subject of this topic, but I prefer
> to write a small paragraph about it with a bold
> header as a reminder for later.
> The DS216 unit I own has two 2GBIT (256MB) Samsung
> DDR3 1600MHz K4B2G1646Q-BCK0 soldered on board,
> for a grand total of 512MB of RAM.
>
> Those chips are 1600MHz capable, but the stock
> Marvell u-boot initializes them at 1333MHz. I
> don't know if it's a mistake, or if some units may
> have 1333Mhz RAM chips soldered on board but it's
> clearly sub-optimal in this unit.

Yes, indeed it is relevant to u-boot. I think you're right about 1333Mhz RAM chip. There must have been be a mix of 1600MHz and 1333Mhz RAM chips used in the DS216 boards.

This is a subject that we can revisit later.

> SPI FLASH PARTITIONS
>
> I noticed that during the boot sequence, the SPI
> FLASH driver simply ignored the partition scheme
> provided in the DTS. I found that apparently it
> was a normal behavior for the driver to take the
> redboot partition table first if partitions aren't
> included in a common "partitions" node with
> "compatible = "fixed-partitions";" set. I made
> some edits and report how well it worked once i
> tested everything properly.

Yes, it was my decision to ignore the stock DTS mtd definition. They are just wrong and confuse users. When we pass the mtdparts bootarg to the kernel, we overide that DTS definition. So the result is there are only 2 partitions. Only the 1st partition is needed for u-boot. The 2nd partition is there as a place holder for someone to install flash-based kernel, such as OpenWrt.

So don't need to do further in the DTS. The stock MTD partitions in the DTS is fine in case someone wants to use them for other purpose. But we are not using it in Debian.

>
> LEDs and GPIOs

> Indeed, it's even a bit wilder than that.
>
> A wacky and hardly flexible design, that leaves us
> with an IO behavior designed for the DSM logic:
>
> - GPIO 42 enables or disables all LEDs (active
> high). It takes priority over all LED GPIOs and
> even shuts off the power and status LEDs, which
> can normally only be controlled through the serial
> interface. It basically acts like a "night mode
> LED off" switch.

It's best to ignore this GPIO 42. It is not useful. If one likes to turn off some LEDs, it should be individually turned off.

> - GPIO 9 enables or disables HDD LEDs, green and
> orange. It takes priority over all HDD LED GPIOs.
> - GPIO 13 and 14 enables or disables the orange
> HDD LEDs. Those are not activity triggered, only
> static orange diodes. Enabling those automatically
> disables the green activity LED it shares the
> indicator with. It basically acts as a "Fault on
> DiskX" indicator.

We need a bit more testing. The orange LED is only useful in a scenario where we have a bad disk. But it should be off to let the green LED take over. Try

echo none > /sys/class/leds/ds216\:orange\:disk/trigger
echo disk-activity > /sys/class/leds/ds216\:status\:disk/trigger

or just to see if the sequence is correct, do it manually:

echo none > /sys/class/leds/ds216\:orange\:disk/trigger
echo default-on > /sys/class/leds/ds216\:status\:disk/trigger

> - GPIO 16 enables the green ethernet PHY LED. It
> is activity triggered under u-boot and during the
> boot sequence (if the IO is set high in u-boot, it
> is not by default) but does not seem to be as soon
> as debian initializes the interface.

It's good to have, but not necessary.

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



Edited 2 time(s). Last edit at 04/12/2024 06:05PM by bodhi.
Re: Debian on Synology DS216
April 13, 2024 04:15AM
LEDs and GPIOs

The green disk activity LEDs are hardware triggered, I previously said otherwise as I was confused by the GPIO logic to enable it. The only thing is that those are not enabled by default, but setting the pin high in u-boot env seems like a simple persistent solution even under debian.

By default the stock u-boot enables 3 GPIOs:
- The fan speed LSB to spin the fan at the lowest speed available.
- The "Enable all LED GPIO", mostly to allow the power LED to blink during startup (The stock kernel sets it to static blue through serial once the synobios module is loaded).
- The "USB 2.0 power enable pin", probably the reason why many people reported only the front USB 2.0 port allows boot from stock u-boot with default configuration.

I personally modified this behavior by enabling a few more pins (at first it was just a quick fix but in the end this isn't bad at all):
- The "Enable HDD LED GPIO", this way both HDD LEDs turn green as soon as the disks are turned on and they act as activity LEDs even during the debian boot. This also gives the user the ability to turn the indicators to static orange by bringing on the orange LEDs in debian.
- The "Enable ethernet PHY LED", so that the led turns on as soon as a cable is connected and then acts as an activity LED during the boot sequence. However, it seems like it then becomes static when debian initializes the interface.

As most GPIOs are properly declared in the pinctrl dts binding, one can still export and control from sysfs those which are not defined as LEDs. I could give them friendly line names to make things easier for the end user.

So in the end I think about something like that:
- "Enable all LEDs" set to high by u-boot (default) then mapped to a "dummy" led called something like "ds216:all:all" with no default trigger and default on state but 99% of triggers sounds dumb for it, and the logic might be quite confusing for users in the first place. I think it is stiil useful to have it as it's probably the most debian friendly way to just disable the LEDs managed through the serial interface.
- "Enable HDD LEDs" set to high by u-boot (custom) then mapped to a "dummy" led called something like "ds216:all:disk" with no default trigger and default on state but most triggers sounds dumb for it as green LEDs are already hardware triggered, and the logic might be confusing at first for users too.
- "Enable ethernet PHY LED" mapped to "ds216:green:lan" and probably soft triggered by LAN activity as it does not seem to be triggered once debian initializes the interface (i don't really understand what is happening here).
- Orange HDD LEDs mapped to "ds216:orange:disk0" and "ds216:orange:disk1" as those are simple static orange indicators once "Enable all" and "Enable HDD" are set to high. It disables the green activity LEDs on the way but it's quite predictable as the indicator is shared so I don't think users will get confused.

SPI FLASH PARTITIONS

Okay, it's all clear now. I just reverted my changes and wrote a little comment about it.



Edited 1 time(s). Last edit at 04/13/2024 04:17AM by Robin.
Re: Debian on Synology DS216
April 13, 2024 10:54AM
SO FAR, EVERYTHING WORKS

I made a lot of minor edits to my DTS file, the latest one is attached to this post.
I listened to your advice and tested the fan speeds carefully, LSB and MSB were swapped so I fixed it in no time.
Everything seems to work fine when it comes to hwmon, and even though the LED config is not the way we would like it to be, it's probably the most convenient we can implement on this box.
Sadly I can't compile the DTS file with the new fan bindings you mentioned, so I reverted the changes.
Overall I'm quite happy with this DTS, don't hesitate if you have some remarks or advice to improve it even further.
Unless some major edits are required, I'll probably post a guide that will sum up all the things one should have in mind to install Debian on a Synology DS116 before moving to u-boot.
Attachments:
open | download - armada-385-synology-ds216.dts (9.9 KB)
Re: Debian on Synology DS216
April 13, 2024 02:25PM
> I made a lot of minor edits to my DTS file, the
> latest one is attached to this post.
> I listened to your advice and tested the fan
> speeds carefully, LSB and MSB were swapped so I
> fixed it in no time.

> Everything seems to work fine when it comes to
> hwmon, and even though the LED config is not the
> way we would like it to be, it's probably the most
> convenient we can implement on this box.
> Sadly I can't compile the DTS file with the new
> fan bindings you mentioned, so I reverted the
> changes.

That's OK. When I release new MVEBU kernel (probably the end of this month), I will make that tweak.

> Overall I'm quite happy with this DTS, don't
> hesitate if you have some remarks or advice to
> improve it even further.

I will give it a final look.

> Unless some major edits are required, I'll
> probably post a guide that will sum up all the
> things one should have in mind to install Debian
> on a Synology DS116 before moving to u-boot.

Yes, there is 1 more task to complete: u-boot envs in Debian. I have modified the mtdparts definition to make it better for future growth. And that made the envs definition in Debian a bit different from the past.

I will post this in a separate post.

=======

In the mean time, please do this.

Power up and interrupt u-boot at count down,
md.l f1018000 8
md.l f1018100 1
md.l f1018140 1
printenv
And post the entire serial console log at this point.

But if you'd like to capture the whole boot log for reference later, then go ahead and boot
boot
and post the entire serial console log here.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian on Synology DS216
April 13, 2024 03:40PM
As I did a few edits to my uboot environment, I performed a resetenv before getting the following log:
BootROM - 1.73
Booting from SPI flash


General initialization - Version: 1.0.0
AVS selection from EFUSE disabled (Skip reading EFUSE values)
Overriding default AVS value to: 0x23
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      |
 |   2    |  6   |  SATA1      |
 |   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
BootROM: Image checksum verification PASSED

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


U-Boot 2013.01-g74a026b-dirty (Dec 30 2015 - 14:38:52) Marvell version: 2015_T1.0p16

Board: SYNO-DS216
SoC:   MV88F6820 Rev A0
       running 2 CPUs
CPU:   ARM Cortex A9 MPCore (Rev 1) LE
       CPU 0
       CPU    @ 1332 [MHz]
       L2     @ 666 [MHz]
       TClock @ 250 [MHz]
       DDR3    @ 666 [MHz]
       DDR3 32 Bit Width,FastPath Memory Access, DLB Enabled, ECC Disabled
DRAM:  512 MiB
MMC:   mv_sdh: 0
SF: Detected N25Q64 with page size 64 KiB, total 8 MiB
*** Warning - bad CRC, using default environment

USB2.0 0: Host Mode
USB3.0 0: Host Mode
USB3.0 1: Host Mode

Map:   Code:			0x1ff3b000:0x1ffc915c
       BSS:			0x1ffef688
       Stack:			0x1fa2af20
       Heap:			0x1fa2b000:0x1ff3b000
       U-Boot Environment:	0x007e0000:0x007f0000 (SPI)

Board configuration detected:

Synology Model: DS216

Net:   
|  port  | Interface | PHY address  |
|--------|-----------|--------------|
| egiga0 |   SGMII   |     0x01     |
egiga0 [PRIME]
Press Ctrl+C to abort autoboot in 3 second
Marvell>> md.l f1018000 8
f1018000: 00111111 00000000 11044330 00000011    ........0C......
f1018010: 00000000 00000000 00000000 00000000    ................
Marvell>> md.l f1018100 1
f1018100: 00000000    ....
Marvell>> md.l f1018140 1
f1018140: 00008440    @...
Marvell>> printenv
CASset=max
MALLOC_len=5
MPmode=SMP
ata_hdd_detect=syno_hdd_detect=39,40
ata_hdd_enable=syno_hdd_enable=26,27
autoload=no
baudrate=115200
boot_order=hd_scr usb_scr mmc_scr hd_img usb_img mmc_img pxe net_img net_scr
bootargs= 
bootargs_dflt=$console $nandEcc $mtdparts_lgcy $bootargs_root nfsroot=$serverip:$rootpath ip=$ipaddr:$serverip$bootargs_end $mvNetConfig video=dovefb:lcd0:$lcd0_params clcd.lcd0_enable=$lcd0_enable clcd.lcd_panel=$lcd_panel
bootargs_end=:10.4.50.254:255.255.255.0:Armada38x:eth0:none
bootargs_root=root=/dev/nfs rw
bootcmd=mw 0xf10a2620 0x251;mw 0xf10a2e20 0x251;usb xhciinit; run bootspi
bootcmd_auto=stage_boot $boot_order
bootcmd_fdt=tftpboot 0x2000000 $image_name;tftpboot $fdtaddr $fdtfile;setenv bootargs $console $nandEcc $mtdparts $bootargs_root nfsroot=$serverip:$rootpath ip=$ipaddr:$serverip$bootargs_end $mvNetConfig video=dovefb:lcd0:$lcd0_params clcd.lcd0_enable=$lcd0_enable clcd.lcd_panel=$lcd_panel; bootz 0x2000000 - $fdtaddr;
bootcmd_fdt_boot=tftpboot 0x2000000 $image_name; setenv bootargs $console $nandEcc $mtdparts $bootargs_root nfsroot=$serverip:$rootpath ip=$ipaddr:$serverip$bootargs_end $mvNetConfig video=dovefb:lcd0:$lcd0_params clcd.lcd0_enable=$lcd0_enable clcd.lcd_panel=$lcd_panel; bootz 0x2000000 - $fdtaddr;
bootcmd_fdt_edit=tftpboot $fdtaddr $fdtfile; fdt addr $fdtaddr; setenv bootcmd $bootcmd_fdt_boot
bootcmd_lgcy=tftpboot 0x2000000 $image_name;setenv bootargs $console $nandEcc $mtdparts_lgcy $bootargs_root nfsroot=$serverip:$rootpath ip=$ipaddr:$serverip$bootargs_end  video=dovefb:lcd0:$lcd0_params clcd.lcd0_enable=$lcd0_enable clcd.lcd_panel=$lcd_panel;  bootm $loadaddr; 
bootdelay=3
bootftp=run syno_bootargs;tftpboot $loadaddr_kernel $file_kernel;tftpboot $loadaddr_rootfs $file_rootfs;sf probe; sf read $loadaddr_dt $spi_pt_addr_dt $spi_pt_size_dt;fdt addr $loadaddr_dt;bootm $loadaddr_kernel $loadaddr_rootfs $loadaddr_dt;
bootspi=run syno_bootargs;sf probe 0 50000000;sf read $loadaddr_kernel $spi_pt_addr_kernel $spi_pt_size_kernel;sf read $loadaddr_rootfs $spi_pt_addr_rootfs $spi_pt_size_rootfs;sf read $loadaddr_dt $spi_pt_addr_dt $spi_pt_size_dt;bootm $loadaddr_kernel $loadaddr_rootfs $loadaddr_dt;
cacheShare=no
clean_env=sf probe; sf erase $spi_pt_addr_env $spi_pt_size_env; 
console=console=ttyS0,115200
device_partition=0:1
disaMvPnp=no
eeeEnable=no
enaClockGating=no
enaCpuStream=no
enaFPU=yes
enaMonExt=no
enaWrAllo=no
eth1addr=00:50:43:58:1f:1b
eth1mtu=1500
eth2addr=00:50:43:58:fc:1b
eth2mtu=1500
eth3addr=00:50:43:1f:fc:58
eth3mtu=1500
ethact=egiga0
ethaddr=00:50:43:fc:1f:1b
ethmtu=1500
ethprime=egiga0
fdt_addr=2040000
fdt_skip_update=yes
fdtaddr=0x1000000
fdtfile=armada-38x.dtb
file_flash=armada38x/flash.bin
file_kernel=armada38x/uImage
file_rootfs=armada38x/rd.bin
file_uboot=armada38x/uboot.bin
ide_path=/
image_name=uImage
initrd_name=uInitrd
kernel_addr_r=2080000
lcd0_enable=0
lcd0_params=640x480-16@60
lcd_panel=0
limit_dram_size=yes
loadaddr=0x02000000
loadaddr_dt=0x1000000
loadaddr_kernel=0x2000000
loadaddr_rootfs=0x3000000
loads_echo=0
mtdids=spi0=spi_flash
mtdparts=mtdparts=spi0.0:4m(boot),-(spi-rootfs)
mtdparts_lgcy=mtdparts=spi_flash:4m(boot),-(spi-rootfs)
mvNetConfig=mv_net_config=4,(00:50:43:11:11:11,0:1:2:3),mtu=1500
mv_pon_addr=00:50:43:1b:fc:58
netbsd_en=no
netretry=no
pcieTune=no
pexMode=RC
pxe_files_load=:default.arm-armadaxp-db:default.arm-armadaxp:default.arm
pxefile_addr_r=3100000
ramdisk_addr_r=2880000
rootpath=/srv/nfs/
run_script=no
sata_delay_reset=0
sata_dma_mode=yes
script_addr_r=3000000
script_name=boot.scr
sd_detection_dat3=no
spi_pt_addr_dt=0x0E0000
spi_pt_addr_env=0x7e0000
spi_pt_addr_kernel=0x0F0000
spi_pt_addr_rootfs=0x3C0000
spi_pt_size_dt=0x010000
spi_pt_size_env=0x010000
spi_pt_size_kernel=0x2D0000
spi_pt_size_rootfs=0x410000
standalone=fsload 0x2000000 $image_name;setenv bootargs $console $nandEcc $mtdparts_lgcy root=/dev/mtdblock0 rw ip=$ipaddr:$serverip$bootargs_end; bootm 0x2000000;
stderr=serial
stdin=serial
stdout=serial
syno_boot_dev=/dev/md0
syno_bootargs=setenv bootargs console=ttyS0,115200 ip=off initrd=$loadaddr_rootfs root=$syno_boot_dev rw $syno_extra_args syno_hw_version=$syno_hw_version hd_power_on_seq=$syno_hdd_powerup_seq ihd_num=$syno_hdd_powerup_seq netif_num=$syno_net_if_num $ata_hdd_detect $ata_hdd_enable flash_size=8
syno_extra_args=HddHotplug=2
syno_hdd_powerup_seq=2
syno_hw_version=DS216
syno_net_if_num=1
upd_flash=setenv tftpfile $file_flash; tftpboot $loadaddr $tftpfile; if test $? -eq 0; then echo "This may take a while, please be patient..."; sf probe; sf erase 0 +$filesize; sf write $loadaddr 0 $filesize; echo "\
Flash Update Done"; fi; 
upd_kernel=setenv tftpfile $file_kernel; mw.b $loadaddr 0xFF $spi_pt_size_kernel; tftpboot $loadaddr $tftpfile; if test $? -eq 0; then sf probe; sf erase $spi_pt_addr_kernel $spi_pt_size_kernel; sf write $loadaddr $spi_pt_addr_kernel $spi_pt_size_kernel; echo "\
Kernel Update Done"; fi; 
upd_rootfs=setenv tftpfile $file_rootfs; mw.b $loadaddr 0xFF $spi_pt_size_rootfs; tftpboot $loadaddr $tftpfile; if test $? -eq 0; then sf probe; sf erase $spi_pt_addr_rootfs +$filesize; sf write $loadaddr $spi_pt_addr_rootfs $filesize; echo "\
Rootfs Update Done"; fi; 
upd_uboot=setenv tftpfile $file_uboot; tftpboot $loadaddr $tftpfile; if test $? -eq 0; then sf probe; sf erase 0 +$filesize; sf write $loadaddr 0 $filesize; echo "\
Uboot Update Done"; fi; 
usb0Mode=host
usbActive=0
usbType=2
vxworks_en=no
yuk_ethaddr=00:00:00:EE:51:81

Environment size: 5681/65532 bytes
Marvell>> 


Re: Debian on Synology DS216
April 13, 2024 04:03PM
Robin,

Sorry I was not clear. What I'd like to see is your current envs and how it boots.

But the stock envs are also good to have, too.

====

These are how the USB 3.0 ports were activated in stock u-boot (no need to poke the memory).
usbActive=0
usbType=2

So,
setenv usbActive 1
setenv usbType 3

But your finding about what GPIOs to set is great info.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian on Synology DS216
April 14, 2024 03:23PM
Hi Tony,

I reverted most of the changes I've done when I switched to my latest DTS as those were no more required.
In the end, all the changes I made persistent are the following ones:
setenv load_image_addr 0x02000000
setenv load_initrd_addr 0x3000000
setenv load_image 'echo loading uImage from raw HDD ...; scsi device 0; scsi read $load_image_addr 0x5000 0x2F00'
setenv load_initrd 'echo loading uInitrd from raw HDD ...; scsi device 0; scsi read $load_initrd_addr 0xA000 0x4F00'
setenv set_bootargs 'setenv bootargs "console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts earlyprintk=serial"'
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'
setenv bootcmd 'scsi init; run bootcmd_exec; echo Booting Stock OS ...; run bootspi'
setenv bootcmd 'mw.l f1018100 0C000000; scsi init; run bootcmd_exec; echo Booting Stock OS ...; run bootspi'

Here is my current dmesg output:
[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 6.6.2-mvebu-tld-1 (root@tldDebian) (gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40) #1 SMP PREEMPT Mon Nov 20 18:44:27 PST 2023
[    0.000000] CPU: ARMv7 Processor [414fc091] revision 1 (ARMv7), cr=10c5387d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] OF: fdt: Machine model: Synology DS216
[    0.000000] printk: bootconsole [earlycon0] enabled
[    0.000000] Memory policy: Data cache writealloc
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000000000000-0x000000001fffffff]
[    0.000000]   HighMem  empty
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x000000001fffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x000000001fffffff]
[    0.000000] percpu: Embedded 29 pages/cpu s25364 r8192 d85228 u118784
[    0.000000] pcpu-alloc: s25364 r8192 d85228 u118784 alloc=29*4096
[    0.000000] pcpu-alloc: [0] 0 [0] 1 
[    0.000000] Kernel command line: console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 mtdparts=spi0.0:4m(boot),-(spi-rootfs) earlyprintk=serial
[    0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes, linear)
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 129920
[    0.000000] mem auto-init: stack:off, heap alloc:on, heap free:off
[    0.000000] Memory: 495040K/524288K available (10240K kernel code, 873K rwdata, 3492K rodata, 1024K init, 314K bss, 29248K reserved, 0K cma-reserved, 0K highmem)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=2, Nodes=1
[    0.000000] rcu: Preemptible hierarchical RCU implementation.
[    0.000000] rcu: 	RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=2.
[    0.000000] 	Trampoline variant of Tasks RCU enabled.
[    0.000000] 	Tracing variant of Tasks RCU enabled.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
[    0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=2
[    0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[    0.000000] L2C: DT/platform modifies aux control register: 0x06070000 -> 0x16070000
[    0.000000] L2C-310 enabling early BRESP for Cortex-A9
[    0.000000] L2C-310 full line of zeros enabled for Cortex-A9
[    0.000000] L2C-310 D prefetch enabled, offset 1 lines
[    0.000000] L2C-310 dynamic clock gating enabled, standby mode enabled
[    0.000000] L2C-310 Coherent cache controller enabled, 16 ways, 1024 kB
[    0.000000] L2C-310 Coherent: CACHE_ID 0x410054c9, AUX_CTRL 0x56070001
[    0.000000] rcu: srcu_init: Setting srcu_struct sizes based on contention.
[    0.000001] sched_clock: 64 bits at 666MHz, resolution 1ns, wraps every 4398046511103ns
[    0.008682] clocksource: arm_global_timer: mask: 0xffffffffffffffff max_cycles: 0x999999d70a, max_idle_ns: 440795225152 ns
[    0.020389] Switching to timer-based delay loop, resolution 1ns
[    0.027210] Ignoring duplicate/late registration of read_current_timer delay
[    0.034940] clocksource: armada_370_xp_clocksource: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 76450417870 ns
[    0.046816] kfence: initialized - using 2097152 bytes for 255 objects at 0x(ptrval)-0x(ptrval)
[    0.056417] Console: colour dummy device 80x30
[    0.061569] Calibrating delay loop (skipped), value calculated using timer frequency.. 1332.00 BogoMIPS (lpj=6660000)
[    0.072847] CPU: Testing write buffer coherency: ok
[    0.078429] CPU0: Spectre v2: using BPIALL workaround
[    0.084154] pid_max: default: 32768 minimum: 301
[    0.092689] LSM: initializing lsm=capability,integrity
[    0.099426] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.107413] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.119922] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[    0.127037] RCU Tasks: Setting shift to 1 and lim to 1 rcu_task_cb_adjust=1.
[    0.134887] RCU Tasks Trace: Setting shift to 1 and lim to 1 rcu_task_cb_adjust=1.
[    0.143240] Setting up static identity map for 0x100000 - 0x100060
[    0.150370] mvebu-soc-id: MVEBU SoC ID=0x6820, Rev=0x4
[    0.156312] mvebu-pmsu: Initializing Power Management Service Unit
[    0.163308] rcu: Hierarchical SRCU implementation.
[    0.168785] rcu: 	Max phase no-delay instances is 1000.
[    0.175336] smp: Bringing up secondary CPUs ...
[    0.180961] Booting CPU 1
[    0.184423] CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
[    0.184434] CPU1: Spectre v2: using BPIALL workaround
[    0.196597] smp: Brought up 1 node, 2 CPUs
[    0.201385] SMP: Total of 2 processors activated (2664.00 BogoMIPS).
[    0.208427] CPU: All CPU(s) started in SVC mode.
[    0.214803] devtmpfs: initialized
[    0.223321] VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 4
[    0.231971] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.242629] futex hash table entries: 512 (order: 3, 32768 bytes, linear)
[    0.252238] prandom: seed boundary self test passed
[    0.259413] prandom: 100 self tests passed
[    0.264188] pinctrl core: initialized pinctrl subsystem
[    0.271611] NET: Registered PF_NETLINK/PF_ROUTE protocol family
[    0.278956] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.288837] audit: initializing netlink subsys (disabled)
[    0.295096] audit: type=2000 audit(0.250:1): state=initialized audit_enabled=0 res=1
[    0.295537] thermal_sys: Registered thermal governor 'step_wise'
[    0.303581] cpuidle: using governor ladder
[    0.315055] cpuidle: using governor menu
[    0.319822] hw-breakpoint: found 5 (+1 reserved) breakpoint and 1 watchpoint registers.
[    0.328502] hw-breakpoint: maximum watchpoint size is 4 bytes.
[    0.337537] platform soc: Fixed dependency cycle(s) with /soc/internal-regs/interrupt-controller@d000
[    0.527096] raid6: int32x8  gen()   266 MB/s
[    0.697132] raid6: int32x4  gen()   277 MB/s
[    0.867090] raid6: int32x2  gen()   459 MB/s
[    1.037079] raid6: int32x1  gen()   531 MB/s
[    1.042025] raid6: using algorithm int32x1 gen() 531 MB/s
[    1.217078] raid6: .... xor() 205 MB/s, rmw enabled
[    1.222631] raid6: using intx1 recovery algorithm
[    1.229219] SCSI subsystem initialized
[    1.233889] libata version 3.00 loaded.
[    1.234071] usbcore: registered new interface driver usbfs
[    1.240278] usbcore: registered new interface driver hub
[    1.246318] usbcore: registered new device driver usb
[    1.252372] pps_core: LinuxPPS API ver. 1 registered
[    1.258024] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    1.267835] PTP clock support registered
[    1.273872] vgaarb: loaded
[    1.277680] clocksource: Switched to clocksource arm_global_timer
[    1.287968] VFS: Disk quotas dquot_6.6.0
[    1.292748] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[    1.308604] NET: Registered PF_INET protocol family
[    1.314320] IP idents hash table entries: 8192 (order: 4, 65536 bytes, linear)
[    1.323212] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes, linear)
[    1.332316] Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    1.340790] TCP established hash table entries: 4096 (order: 2, 16384 bytes, linear)
[    1.349254] TCP bind hash table entries: 4096 (order: 4, 65536 bytes, linear)
[    1.357125] TCP: Hash tables configured (established 4096 bind 4096)
[    1.364456] MPTCP token hash table entries: 512 (order: 1, 8192 bytes, linear)
[    1.372532] UDP hash table entries: 256 (order: 1, 8192 bytes, linear)
[    1.379753] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear)
[    1.387763] NET: Registered PF_UNIX/PF_LOCAL protocol family
[    1.394639] RPC: Registered named UNIX socket transport module.
[    1.401254] RPC: Registered udp transport module.
[    1.406632] RPC: Registered tcp transport module.
[    1.412023] RPC: Registered tcp-with-tls transport module.
[    1.418187] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    1.425302] PCI: CLS 0 bytes, default 64
[    1.430454] Trying to unpack rootfs image as initramfs...
[    1.437765] hw perfevents: enabled with armv7_cortex_a9 PMU driver, 7 counters available
[    1.460780] Initialise system trusted keyrings
[    1.465980] Key type blacklist registered
[    1.477878] workingset: timestamp_bits=14 max_order=17 bucket_order=3
[    1.485045] zbud: loaded
[    1.495082] NFS: Registering the id_resolver key type
[    1.500924] Key type id_resolver registered
[    1.505792] Key type id_legacy registered
[    1.510649] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[    1.518051] nfs4flexfilelayout_init: NFSv4 Flexfile Layout Driver Registering...
[    1.611493] xor: measuring software checksum speed
[    1.618513] Freeing initrd memory: 5136K
[    1.621575]    arm4regs        :  2172 MB/sec
[    1.634303]    8regs           :  1669 MB/sec
[    1.645058]    32regs          :  1733 MB/sec
[    1.650124] xor: using function: arm4regs (2172 MB/sec)
[    1.656031] async_tx: api initialized (async)
[    1.661087] Key type asymmetric registered
[    1.665862] Asymmetric key parser 'x509' registered
[    1.671633] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 245)
[    1.680030] io scheduler bfq registered
[    1.686650] armada-38x-pinctrl f1018000.pinctrl: registered pinctrl driver
[    1.695900] gpio gpiochip0: Static allocation of GPIO base is deprecated, use dynamic allocation.
[    1.705891] debugfs: Directory 'f1018100.gpio' with parent 'regmap' already present!
[    1.715009] gpio gpiochip1: Static allocation of GPIO base is deprecated, use dynamic allocation.
[    1.724930] debugfs: Directory 'f1018140.gpio' with parent 'regmap' already present!
[    1.735268] mv_xor f1060800.xor: Marvell shared XOR driver
[    1.798719] mv_xor f1060800.xor: Marvell XOR (Descriptor Mode): ( xor cpy intr )
[    1.809466] mv_xor f1060900.xor: Marvell shared XOR driver
[    1.878713] mv_xor f1060900.xor: Marvell XOR (Descriptor Mode): ( xor cpy intr )
[    1.972050] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
[    1.982998] printk: console [ttyS0] disabled
[    2.009081] f1012000.serial: ttyS0 at MMIO 0xf1012000 (irq = 39, base_baud = 15625000) is a 16550A
[    2.018810] printk: console [ttyS0] enabled
[    2.028623] printk: bootconsole [earlycon0] disabled
[    2.079897] f1012100.serial: ttyS1 at MMIO 0xf1012100 (irq = 40, base_baud = 15625000) is a 16550A
[    2.091291] ahci-mvebu f10a8000.sata: supply ahci not found, using dummy regulator
[    2.099765] ahci-mvebu f10a8000.sata: supply phy not found, using dummy regulator
[    2.108107] ahci-mvebu f10a8000.sata: supply target not found, using dummy regulator
[    2.116726] ahci-mvebu f10a8000.sata: AHCI 0001.0000 32 slots 2 ports 6 Gbps 0x3 impl platform mode
[    2.126533] ahci-mvebu f10a8000.sata: flags: 64bit ncq sntf led only pmp fbs pio slum part sxs 
[    2.137706] scsi host0: ahci-mvebu
[    2.142630] scsi host1: ahci-mvebu
[    2.146949] ata1: SATA max UDMA/133 mmio [mem 0xf10a8000-0xf10a9fff] port 0x100 irq 41
[    2.155802] ata2: SATA max UDMA/133 mmio [mem 0xf10a8000-0xf10a9fff] port 0x180 irq 41
[    2.167552] spi-nor spi0.0: n25q064 (8192 Kbytes)
[    2.173098] 2 cmdlinepart partitions found on MTD device spi0.0
[    2.179765] Creating 2 MTD partitions on "spi0.0":
[    2.185276] 0x000000000000-0x000000400000 : "boot"
[    2.192444] 0x000000400000-0x000000800000 : "spi-rootfs"
[    2.200113] wireguard: WireGuard 1.0.0 loaded. See www.wireguard.com for information.
[    2.208804] wireguard: Copyright (C) 2015-2019 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
[    2.235513] hwmon hwmon0: temp1_input not attached to any thermal zone
[    2.244431] mvneta_bm f10c8000.bm: Buffer Manager for network controller enabled
[    2.257493] mvneta f1070000.ethernet eth0: Using random mac address 32:d6:57:16:2e:f7
[    2.266651] usbcore: registered new interface driver smsc75xx
[    2.273459] orion-ehci f1058000.usb: EHCI Host Controller
[    2.279624] orion-ehci f1058000.usb: new USB bus registered, assigned bus number 1
[    2.288023] orion-ehci f1058000.usb: irq 43, io mem 0xf1058000
[    2.317693] orion-ehci f1058000.usb: USB 2.0 started, EHCI 1.00
[    2.324539] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 6.06
[    2.333557] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    2.341519] usb usb1: Product: EHCI Host Controller
[    2.347114] usb usb1: Manufacturer: Linux 6.6.2-mvebu-tld-1 ehci_hcd
[    2.354198] usb usb1: SerialNumber: f1058000.usb
[    2.360175] hub 1-0:1.0: USB hub found
[    2.364717] hub 1-0:1.0: 1 port detected
[    2.370514] xhci-hcd f10f0000.usb3: xHCI Host Controller
[    2.376566] xhci-hcd f10f0000.usb3: new USB bus registered, assigned bus number 2
[    2.384887] xhci-hcd f10f0000.usb3: hcc params 0x0a000990 hci version 0x100 quirks 0x0000000000000010
[    2.394917] xhci-hcd f10f0000.usb3: irq 44, io mem 0xf10f0000
[    2.402145] xhci-hcd f10f0000.usb3: xHCI Host Controller
[    2.408230] xhci-hcd f10f0000.usb3: new USB bus registered, assigned bus number 3
[    2.416473] xhci-hcd f10f0000.usb3: Host supports USB 3.0 SuperSpeed
[    2.423693] usb usb2: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 6.06
[    2.432712] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    2.440689] usb usb2: Product: xHCI Host Controller
[    2.446298] usb usb2: Manufacturer: Linux 6.6.2-mvebu-tld-1 xhci-hcd
[    2.453395] usb usb2: SerialNumber: f10f0000.usb3
[    2.459503] hub 2-0:1.0: USB hub found
[    2.464013] hub 2-0:1.0: 1 port detected
[    2.469166] usb usb3: We don't know the algorithms for LPM for this host, disabling LPM.
[    2.478111] usb usb3: New USB device found, idVendor=1d6b, idProduct=0003, bcdDevice= 6.06
[    2.487124] usb usb3: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    2.495101] usb usb3: Product: xHCI Host Controller
[    2.500793] usb usb3: Manufacturer: Linux 6.6.2-mvebu-tld-1 xhci-hcd
[    2.507882] usb usb3: SerialNumber: f10f0000.usb3
[    2.513879] hub 3-0:1.0: USB hub found
[    2.518387] hub 3-0:1.0: 1 port detected
[    2.523818] xhci-hcd f10f8000.usb3: xHCI Host Controller
[    2.529969] xhci-hcd f10f8000.usb3: new USB bus registered, assigned bus number 4
[    2.538261] xhci-hcd f10f8000.usb3: hcc params 0x0a000990 hci version 0x100 quirks 0x0000000000000010
[    2.548262] xhci-hcd f10f8000.usb3: irq 45, io mem 0xf10f8000
[    2.554866] xhci-hcd f10f8000.usb3: xHCI Host Controller
[    2.561053] xhci-hcd f10f8000.usb3: new USB bus registered, assigned bus number 5
[    2.569297] xhci-hcd f10f8000.usb3: Host supports USB 3.0 SuperSpeed
[    2.576487] usb usb4: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 6.06
[    2.585497] usb usb4: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    2.593519] usb usb4: Product: xHCI Host Controller
[    2.599128] usb usb4: Manufacturer: Linux 6.6.2-mvebu-tld-1 xhci-hcd
[    2.606205] usb usb4: SerialNumber: f10f8000.usb3
[    2.612237] hub 4-0:1.0: USB hub found
[    2.616728] hub 4-0:1.0: 1 port detected
[    2.621956] usb usb5: We don't know the algorithms for LPM for this host, disabling LPM.
[    2.630969] usb usb5: New USB device found, idVendor=1d6b, idProduct=0003, bcdDevice= 6.06
[    2.639984] usb usb5: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    2.648058] usb usb5: Product: xHCI Host Controller
[    2.653708] usb usb5: Manufacturer: Linux 6.6.2-mvebu-tld-1 xhci-hcd
[    2.657708] ata1: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
[    2.660815] usb usb5: SerialNumber: f10f8000.usb3
[    2.667747] ata2: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
[    2.680200] ata1.00: supports DRM functions and may not be fully accessible
[    2.680504] hub 5-0:1.0: USB hub found
[    2.688201] ata1.00: ATA-11: Samsung SSD 870 EVO 500GB, SVT01B6Q, max UDMA/133
[    2.692469] hub 5-0:1.0: 1 port detected
[    2.700346] ata1.00: 976773168 sectors, multi 1: LBA48 NCQ (depth 32)
[    2.709209] usbcore: registered new interface driver usblp
[    2.718388] ata2.00: ATA-8: Hitachi HTS545050A7E380, GG2OA7A0, max UDMA/100
[    2.726088] ata2.00: 976773168 sectors, multi 16: LBA48 NCQ (depth 32)
[    2.733628] usbcore: registered new interface driver usb-storage
[    2.740904] mousedev: PS/2 mouse device common for all mice
[    2.747839] ata1.00: Features: Trust Dev-Sleep
[    2.749610] armada38x-rtc f10a3800.rtc: registered as rtc0
[    2.753287] ata2.00: configured for UDMA/100
[    2.759502] armada38x-rtc f10a3800.rtc: setting system clock to 2024-04-14T02:45:28 UTC (1713062728)
[    2.774146] ata1.00: supports DRM functions and may not be fully accessible
[    2.775751] i2c_dev: i2c /dev entries driver
[    2.788652] gpio-fan fan: GPIO fan initialized
[    2.794064] ata1.00: configured for UDMA/133
[    2.797273] orion_wdt: Initial timeout 171 sec
[    2.804606] scsi 0:0:0:0: Direct-Access     ATA      Samsung SSD 870  1B6Q PQ: 0 ANSI: 5
[    2.815006] ata1.00: Enabling discard_zeroes_data
[    2.821041] scsi 1:0:0:0: Direct-Access     ATA      Hitachi HTS54505 A7A0 PQ: 0 ANSI: 5
[    2.821073] device-mapper: uevent: version 1.0.3
[    2.831360] sd 1:0:0:0: [sdb] 976773168 512-byte logical blocks: (500 GB/466 GiB)
[    2.835614] sd 0:0:0:0: [sda] 976773168 512-byte logical blocks: (500 GB/466 GiB)
[    2.843914] sd 1:0:0:0: [sdb] 4096-byte physical blocks
[    2.852056] sd 0:0:0:0: [sda] Write Protect is off
[    2.858034] sd 1:0:0:0: [sdb] Write Protect is off
[    2.863257] device-mapper: ioctl: 4.48.0-ioctl (2023-03-01) initialised: dm-devel@redhat.com
[    2.868711] sd 1:0:0:0: [sdb] Mode Sense: 00 3a 00 00
[    2.877937] sd 1:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    2.878403] sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
[    2.888031] sd 1:0:0:0: [sdb] Preferred minimum I/O size 4096 bytes
[    2.888169] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    2.904838] device-mapper: multipath round-robin: version 1.2.0 loaded
[    2.912406] sd 0:0:0:0: [sda] Preferred minimum I/O size 512 bytes
[    2.919377] device-mapper: multipath queue-length: version 0.2.0 loaded
[    2.926717] device-mapper: multipath service-time: version 0.3.0 loaded
[    2.934367] device-mapper: dm-log-userspace: version 1.3.0 loaded
[    2.934860] ata1.00: Enabling discard_zeroes_data
[    2.947308] sdhci: Secure Digital Host Controller Interface driver
[    2.954414] sdhci: Copyright(c) Pierre Ossman
[    2.959812] sdhci-pltfm: SDHCI platform and OF driver helper
[    2.967023]  sda: sda1 sda2 sda3 sda4
[    2.969334] marvell-cesa f1090000.crypto: CESA device successfully registered
[    2.973984] sd 0:0:0:0: [sda] Attached SCSI removable disk
[    2.980371] hid: raw HID events driver (C) Jiri Kosina
[    2.991741] usbcore: registered new interface driver usbhid
[    2.998092] usbhid: USB HID core driver
[    2.998506]  sdb: sdb1
[    3.003862] NET: Registered PF_INET6 protocol family
[    3.006375] sd 1:0:0:0: [sdb] Attached SCSI removable disk
[    3.018761] Segment Routing with IPv6
[    3.023142] RPL Segment Routing with IPv6
[    3.028070] In-situ OAM (IOAM) with IPv6
[    3.032773] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
[    3.041031] NET: Registered PF_PACKET protocol family
[    3.046956] 8021q: 802.1Q VLAN Support v1.8
[    3.051921] Key type dns_resolver registered
[    3.057081] ThumbEE CPU extension supported.
[    3.062117] Registering SWP/SWPB emulation handler
[    3.100870] registered taskstats version 1
[    3.105811] Loading compiled-in X.509 certificates
[    3.126575] Key type .fscrypt registered
[    3.131743] Key type fscrypt-provisioning registered
[    3.137536] Key type big_key registered
[    3.160041] Key type encrypted registered
[    3.168509] usb_phy_generic ehci-phy: dummy supplies not allowed for exclusive requests
[    3.177554] usb_phy_generic xhci-phy: dummy supplies not allowed for exclusive requests
[    3.187941] input: keys as /devices/platform/keys/input/input0
[    3.195391] clk: Disabling unused clocks
[    3.202348] Freeing unused kernel image (initmem) memory: 1024K
[    3.238353] Checked W+X mappings: passed, no W+X pages found
[    3.244787] Run /init as init process
[    3.249184]   with arguments:
[    3.249190]     /init
[    3.249194]   with environment:
[    3.249198]     HOME=/
[    3.249203]     TERM=linux
[   20.025356] EXT4-fs (sdb1): mounted filesystem 92f11383-f1e4-44cb-a386-5bf287ad08ff ro with ordered data mode. Quota mode: none.
[   23.819250] sd 0:0:0:0: Attached scsi generic sg0 type 0
[   23.836359] sd 1:0:0:0: Attached scsi generic sg1 type 0
[   25.444731] EXT4-fs (sdb1): re-mounted 92f11383-f1e4-44cb-a386-5bf287ad08ff ro. Quota mode: none.
[   26.101921] EXT4-fs (sdb1): re-mounted 92f11383-f1e4-44cb-a386-5bf287ad08ff r/w. Quota mode: none.
[   27.727694] random: crng init done
[   28.408507] mvneta f1070000.ethernet eth0: PHY [f1072004.mdio-mii:01] driver [Marvell 88E1510] (irq=POLL)
[   28.419135] mvneta f1070000.ethernet eth0: configuring for phy/sgmii link mode
[   33.628106] mvneta f1070000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
Re: Debian on Synology DS216
April 14, 2024 09:33PM
@Robin,

Thanks for the envs and boot log.

And I've looked at the DTS. Looks very good! The only nit I have is the indentations, some are spaces where they should be tabs (not relevant for our purpose here, though).

I'll be back tomorrow to post more details about u-boot envs.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian on Synology DS216
April 15, 2024 05:03PM
u-boot envs in Linux.

Power up, interrupt u-boot countdown and,

setenv mtdparts 'mtdparts=spi0.0:1m(u-boot),7040k(kernel),64k(u-boot-env),-(data)'

Boot into Debian and

- Check the mtd layout
cat /proc/mtd

- modify /etc/fw_env.config

cat /etc/fw_env.config
# MTD device name	Device offset	Env. size	Flash sector size	Number of sectors

# DS216
/dev/mtd2 0x00000 0x10000 0x10000

And
fw_printenv
This should list the envs as they were set in u-boot.

But don't try to change the envs yet.

To be absolutely safe, we need to do try kwboot this box first to see make sure is a recovery path. Even though you have set envs and save envs at u-boot prompt, it is still a good practice to run kwboot first in case there is something we don't know about stock u-boot. I will post this topic in a separate post.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian on Synology DS216
April 16, 2024 02:40AM
It works perfectly.

root@debian:~# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00100000 00001000 "u-boot"
mtd1: 006e0000 00001000 "kernel"
mtd2: 00010000 00001000 "u-boot-env"
mtd3: 00010000 00001000 "data"
root@debian:~# cat /etc/fw_env.config 
# MTD device name	Device offset	Env. size	Flash sector size	Number of sectors

# DS216
/dev/mtd2 0x00000 0x10000 0x10000
root@debian:~# fw_printenv
CASset=max
MALLOC_len=5
MPmode=SMP
ata_hdd_detect=syno_hdd_detect=39,40
ata_hdd_enable=syno_hdd_enable=26,27
autoload=no
baudrate=115200
boot_order=hd_scr usb_scr mmc_scr hd_img usb_img mmc_img pxe net_img net_scr
bootargs= 
bootargs_dflt=$console $nandEcc $mtdparts_lgcy $bootargs_root nfsroot=$serverip:$rootpath ip=$ipaddr:$serverip$bootargs_end $mvNetConfig video=dovefb:lcd0:$lcd0_params clcd.lcd0_enable=$lcd0_enable clcd.lcd_panel=$lcd_panel
bootargs_end=:10.4.50.254:255.255.255.0:Armada38x:eth0:none
bootargs_root=root=/dev/nfs rw
bootcmd=mw.l f1018100 0C000000; scsi init; run bootcmd_exec; echo Booting Stock OS ...; run bootspi
bootcmd_auto=stage_boot $boot_order
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
bootcmd_fdt=tftpboot 0x2000000 $image_name;tftpboot $fdtaddr $fdtfile;setenv bootargs $console $nandEcc $mtdparts $bootargs_root nfsroot=$serverip:$rootpath ip=$ipaddr:$serverip$bootargs_end $mvNetConfig video=do
vefb:lcd0:$lcd0_params clcd.lcd0_enable=$lcd0_enable clcd.lcd_panel=$lcd_panel; bootz 0x2000000 - $fdtaddr;
bootcmd_fdt_boot=tftpboot 0x2000000 $image_name; setenv bootargs $console $nandEcc $mtdparts $bootargs_root nfsroot=$serverip:$rootpath ip=$ipaddr:$serverip$bootargs_end $mvNetConfig video=dovefb:lcd0:$lcd0_param
s clcd.lcd0_enable=$lcd0_enable clcd.lcd_panel=$lcd_panel; bootz 0x2000000 - $fdtaddr;
bootcmd_fdt_edit=tftpboot $fdtaddr $fdtfile; fdt addr $fdtaddr; setenv bootcmd $bootcmd_fdt_boot
bootcmd_lgcy=tftpboot 0x2000000 $image_name;setenv bootargs $console $nandEcc $mtdparts_lgcy $bootargs_root nfsroot=$serverip:$rootpath ip=$ipaddr:$serverip$bootargs_end  video=dovefb:lcd0:$lcd0_params clcd.lcd0_
enable=$lcd0_enable clcd.lcd_panel=$lcd_panel;  bootm $loadaddr; 
bootdelay=3
bootftp=run syno_bootargs;tftpboot $loadaddr_kernel $file_kernel;tftpboot $loadaddr_rootfs $file_rootfs;sf probe; sf read $loadaddr_dt $spi_pt_addr_dt $spi_pt_size_dt;fdt addr $loadaddr_dt;bootm $loadaddr_kernel 
$loadaddr_rootfs $loadaddr_dt;
bootspi=run syno_bootargs;sf probe 0 50000000;sf read $loadaddr_kernel $spi_pt_addr_kernel $spi_pt_size_kernel;sf read $loadaddr_rootfs $spi_pt_addr_rootfs $spi_pt_size_rootfs;sf read $loadaddr_dt $spi_pt_addr_dt
 $spi_pt_size_dt;bootm $loadaddr_kernel $loadaddr_rootfs $loadaddr_dt;
cacheShare=no
clean_env=sf probe; sf erase $spi_pt_addr_env $spi_pt_size_env; 
console=console=ttyS0,115200
device_partition=0:1
disaMvPnp=no
eeeEnable=no
enaClockGating=no
enaCpuStream=no
enaFPU=yes
enaMonExt=no
enaWrAllo=no
eth1addr=00:50:43:58:1f:1b
eth1mtu=1500
eth2addr=00:50:43:58:fc:1b
eth2mtu=1500
eth3addr=00:50:43:1f:fc:58
eth3mtu=1500
ethact=egiga0
ethaddr=00:50:43:fc:1f:1b
ethmtu=1500
ethprime=egiga0
fdt_addr=2040000
fdt_skip_update=yes
fdtaddr=0x1000000
fdtfile=armada-38x.dtb
file_flash=armada38x/flash.bin
file_kernel=armada38x/uImage
file_rootfs=armada38x/rd.bin
file_uboot=armada38x/uboot.bin
ide_path=/
image_name=uImage
initrd_name=uInitrd
kernel_addr_r=2080000
lcd0_enable=0
lcd0_params=640x480-16@60
lcd_panel=0
limit_dram_size=yes
load_image=echo loading uImage from raw HDD ...; scsi device 0; scsi read $load_image_addr 0x5000 0x2F00
load_image_addr=0x02000000
load_initrd=echo loading uInitrd from raw HDD ...; scsi device 0; scsi read $load_initrd_addr 0xA000 0xAF00
load_initrd_addr=0x3000000
loadaddr=0x02000000
loadaddr_dt=0x1000000
loadaddr_kernel=0x2000000
loadaddr_rootfs=0x3000000
loads_echo=0
mtdids=spi0=spi_flash
mtdparts=mtdparts=spi0.0:4m(boot),-(spi-rootfs)
mtdparts_lgcy=mtdparts=spi_flash:4m(boot),-(spi-rootfs)
mvNetConfig=mv_net_config=4,(00:50:43:11:11:11,0:1:2:3),mtu=1500
mv_pon_addr=00:50:43:1b:fc:58
netbsd_en=no
netretry=no
pcieTune=no
pexMode=RC
pxe_files_load=:default.arm-armadaxp-db:default.arm-armadaxp:default.arm
pxefile_addr_r=3100000
ramdisk_addr_r=2880000
rootpath=/srv/nfs/
run_script=no
sata_delay_reset=0
sata_dma_mode=yes
script_addr_r=3000000
script_name=boot.scr
sd_detection_dat3=no
set_bootargs=setenv bootargs "console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts earlyprintk=serial"
spi_pt_addr_dt=0x0E0000
spi_pt_addr_env=0x7e0000
spi_pt_addr_kernel=0x0F0000
spi_pt_addr_rootfs=0x3C0000
spi_pt_size_dt=0x010000
spi_pt_size_env=0x010000
spi_pt_size_kernel=0x2D0000
spi_pt_size_rootfs=0x410000
standalone=fsload 0x2000000 $image_name;setenv bootargs $console $nandEcc $mtdparts_lgcy root=/dev/mtdblock0 rw ip=$ipaddr:$serverip$bootargs_end; bootm 0x2000000;
stderr=serial
stdin=serial
stdout=serial
syno_boot_dev=/dev/md0
syno_bootargs=setenv bootargs console=ttyS0,115200 ip=off initrd=$loadaddr_rootfs root=$syno_boot_dev rw $syno_extra_args syno_hw_version=$syno_hw_version hd_power_on_seq=$syno_hdd_powerup_seq ihd_num=$syno_hdd_p
owerup_seq netif_num=$syno_net_if_num $ata_hdd_detect $ata_hdd_enable flash_size=8
syno_extra_args=HddHotplug=2
syno_hdd_powerup_seq=2
syno_hw_version=DS216
syno_net_if_num=1
upd_flash=setenv tftpfile $file_flash; tftpboot $loadaddr $tftpfile; if test $? -eq 0; then echo "This may take a while, please be patient..."; sf probe; sf erase 0 +$filesize; sf write $loadaddr 0 $filesize; ech
o "
Flash Update Done"; fi; 
upd_kernel=setenv tftpfile $file_kernel; mw.b $loadaddr 0xFF $spi_pt_size_kernel; tftpboot $loadaddr $tftpfile; if test $? -eq 0; then sf probe; sf erase $spi_pt_addr_kernel $spi_pt_size_kernel; sf write $loadadd
r $spi_pt_addr_kernel $spi_pt_size_kernel; echo "
Kernel Update Done"; fi; 
upd_rootfs=setenv tftpfile $file_rootfs; mw.b $loadaddr 0xFF $spi_pt_size_rootfs; tftpboot $loadaddr $tftpfile; if test $? -eq 0; then sf probe; sf erase $spi_pt_addr_rootfs +$filesize; sf write $loadaddr $spi_pt
_addr_rootfs $filesize; echo "
Rootfs Update Done"; fi; 
upd_uboot=setenv tftpfile $file_uboot; tftpboot $loadaddr $tftpfile; if test $? -eq 0; then sf probe; sf erase 0 +$filesize; sf write $loadaddr 0 $filesize; echo "
Uboot Update Done"; fi; 
usb0Mode=host
usbActive=0
usbType=2
vxworks_en=no
yuk_ethaddr=00:00:00:EE:51:81

We can check if kwboot works indeed. But as I have the required tools to dump or flash the SPI NOR in place, it's not that risky for me to edit things to oblivion.



Edited 1 time(s). Last edit at 04/16/2024 02:46AM by Robin.
Re: Debian on Synology DS216
April 16, 2024 09:26AM
UPDATE

Even though the MVEBU RTC works fine, the system is intended to work with the dedicated SEIKO S35390A I2C RTC chip. Only the SEIKO RTC can wake the system.
I edited the DTS to enable the use of the SEIKO RTC and disable de MVEBU RTC by default.
Attachments:
open | download - armada-385-synology-ds216.dts (10.3 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: