Jump to content

bloodyshell

Validating
  • Posts

    1
  • Joined

  • Last visited

  1. I have the exact same device and it recently started panicking on the btrfs driver after an update to the latest stock firmware and I've been trying to boot a new kernel since then. The source code of the bootloader is included in the source dump released by Terramaster: looking at the code I found a way to boot from USB. This is the list of commands I use to boot dumps of the stock firmware from a USB stick: usb start fatload usb 0:1 ${audio_loadaddr} /dump/mtd3-afw.img fatload usb 0:1 ${kernel_loadaddr} /dump/mtd5-kernel.img fatload usb 0:1 ${fdt_loadaddr} /dump/mtd4-dtb.img fatload usb 0:1 ${rootfs_loadaddr} /dump/mtd6-initrd.img setenv bootargs rdinit=/sbin/init mtdparts=RtkSFC:128k(factory),512k(uboot),320k(logo),1408k(afw),64k(dtb),7680k(kernel),5632k(initrd) earlycon=uart8250,mmio32,0x98007800 console=ttyS0,115200 loglevel=7 root=/dev/ram0 initrd=${rootfs_loadaddr},0x${filesize} go all From a comparison of the decompiled stock dtbs, the hardware looks very similar (if not identical) to the Synology DS418 and I was able to boot to a shell with a custom 5.9 kernel (and dtb) built from https://github.com/afaerber/linux/tree/rtd1295-next and a ramdisk built with the latest stable buildroot. The bad news is that currently nothing else works. This is the dmesg I get: [ 0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034] [ 0.000000] Linux version 5.9.0-rc5-next-20200915 (user@host.lan) (aarch64-buildroot-linux-uclibc-gcc.br_real (Buildroot 2021.02.3) 9.3.0, GNU ld (GNU Binutils) 2.35.2) #1 SMP PREEMPT Wed Sep 1 21:48:13 IST 2021 [ 0.000000] Machine model: Synology DiskStation DS418 [ 0.000000] earlycon: uart8250 at MMIO32 0x0000000098007800 (options '') [ 0.000000] printk: bootconsole [uart8250] enabled [ 0.000000] [Firmware Bug]: Kernel image misaligned at boot, please fix your bootloader! [ 0.000000] cma: Reserved 32 MiB at 0x000000007e000000 [ 0.000000] Zone ranges: [ 0.000000] DMA [mem 0x000000000001f000-0x000000003fffffff] [ 0.000000] DMA32 [mem 0x0000000040000000-0x000000007fffffff] [ 0.000000] Normal empty [ 0.000000] Movable zone start for each node [ 0.000000] Early memory node ranges [ 0.000000] node 0: [mem 0x000000000001f000-0x00000000100fffff] [ 0.000000] node 0: [mem 0x0000000011000000-0x000000007fffffff] [ 0.000000] Zeroed struct page in unavailable ranges: 256 pages [ 0.000000] Initmem setup node 0 [mem 0x000000000001f000-0x000000007fffffff] [ 0.000000] On node 0 totalpages: 520417 [ 0.000000] DMA zone: 4096 pages used for memmap [ 0.000000] DMA zone: 0 pages reserved [ 0.000000] DMA zone: 258273 pages, LIFO batch:63 [ 0.000000] DMA32 zone: 4096 pages used for memmap [ 0.000000] DMA32 zone: 262144 pages, LIFO batch:63 [ 0.000000] percpu: Embedded 21 pages/cpu s48856 r8192 d28968 u86016 [ 0.000000] pcpu-alloc: s48856 r8192 d28968 u86016 alloc=21*4096 [ 0.000000] pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3 [ 0.000000] Detected VIPT I-cache on CPU0 [ 0.000000] CPU features: detected: ARM erratum 845719 [ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 512225 [ 0.000000] Kernel command line: rdinit=/sbin/init mtdparts=RtkSFC:128k(factory),512k(uboot),320k(logo),1408k(afw),64k(dtb),7680k(kernel),5632k(initrd) earlycon=uart8250,mmio32,0x98007800 console=ttyS0,115200 loglevel=7 root=/dev/ram0 initrd=0x02200000,0x7b82c8 [ 0.000000] Dentry cache hash table entries: 262144 (order: 9, 2097152 bytes, linear) [ 0.000000] Inode-cache hash table entries: 131072 (order: 8, 1048576 bytes, linear) [ 0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off [ 0.000000] software IO TLB: mapped [mem 0x3bfff000-0x3ffff000] (64MB) [ 0.000000] Memory: 1903500K/2081668K available (9278K kernel code, 914K rwdata, 3568K rodata, 1600K init, 458K bss, 145400K reserved, 32768K cma-reserved) [ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1 [ 0.000000] rcu: Preemptible hierarchical RCU implementation. [ 0.000000] rcu: RCU event tracing is enabled. [ 0.000000] Trampoline variant of Tasks RCU enabled. [ 0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies. [ 0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0 [ 0.000000] GIC: Using split EOI/Deactivate mode [ 0.000000] random: get_random_bytes called from start_kernel+0x310/0x4c8 with crng_init=0 [ 0.000000] pll_scpu 0x0001c213 n=56 f=531 0x00000100 x=2 0x0000000d y=1 0x0011c213 z=1 rate=800000086 [ 0.000000] pll_bus 0x00003400 n=6 f=1024 0x0000000d d=13 0x00303400 x=1 rate=256500000 [ 0.000000] pll_bus_h 0x00007000 n=14 f=0 0x0000000d d=13 0x00307000 x=1 rate=459000000 [ 0.000000] pll_ddsa 0x00006800 n=13 f=0 0x0000000d d=13 0x00306800 x=1 rate=432000000 [ 0.000000] pll_ddsb 0x00006800 n=13 f=0 0x0000000d d=13 0x00106800 x=1 rate=432000000 [ 0.000000] pll_vodma 0x0010c166 m=22 n=0 o=0 0x00000003 rate=648000000 [ 0.000000] pll_ve1 0x0010c146 m=20 n=0 o=0 0x00000004 rate=594000000 [ 0.000000] pll_ve2 0x0010c176 m=23 n=0 o=0 0x00000004 rate=675000000 [ 0.000000] pll_gpu 0x00006d55 n=13 f=1365 0x00000018 d=8 0x00006800 x=0 rate=503929687 [ 0.000000] pll_acpu 0x00008af6 n=17 f=758 0x0000000d d=13 0x00108af6 x=1 rate=549993164 [ 0.000000] I2C1_SDA_DEL ff000001 [ 0.000000] I2C0_SDA_DEL ff000001 [ 0.000000] arch_timer: cp15 timer(s) running at 27.00MHz (phys). [ 0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x63a1e71a3, max_idle_ns: 440795203123 ns [ 0.000006] sched_clock: 56 bits at 27MHz, resolution 37ns, wraps every 4398046511093ns [ 0.009147] Console: colour dummy device 80x25 [ 0.014186] Calibrating delay loop (skipped), value calculated using timer frequency.. 54.00 BogoMIPS (lpj=108000) [ 0.025848] pid_max: default: 32768 minimum: 301 [ 0.031149] LSM: Security Framework initializing [ 0.036409] Mount-cache hash table entries: 4096 (order: 3, 32768 bytes, linear) [ 0.044748] Mountpoint-cache hash table entries: 4096 (order: 3, 32768 bytes, linear) [ 0.055075] rcu: Hierarchical SRCU implementation. [ 0.061059] smp: Bringing up secondary CPUs ... [ 0.066611] Detected VIPT I-cache on CPU1 [ 0.066664] CPU1: Booted secondary processor 0x0000000001 [0x410fd034] [ 0.067141] Detected VIPT I-cache on CPU2 [ 0.067178] CPU2: Booted secondary processor 0x0000000002 [0x410fd034] [ 0.067636] Detected VIPT I-cache on CPU3 [ 0.067674] CPU3: Booted secondary processor 0x0000000003 [0x410fd034] [ 0.067752] smp: Brought up 1 node, 4 CPUs [ 0.107950] SMP: Total of 4 processors activated. [ 0.113252] CPU features: detected: 32-bit EL0 Support [ 0.119059] CPU features: detected: CRC32 instructions [ 0.130904] CPU: All CPU(s) started at EL2 [ 0.135542] alternatives: patching kernel code [ 0.141658] devtmpfs: initialized [ 0.149881] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns [ 0.160867] futex hash table entries: 1024 (order: 4, 65536 bytes, linear) [ 0.169889] pinctrl core: initialized pinctrl subsystem [ 0.176842] NET: Registered protocol family 16 [ 0.183779] DMA: preallocated 256 KiB GFP_KERNEL pool for atomic allocations [ 0.191779] DMA: preallocated 256 KiB GFP_KERNEL|GFP_DMA pool for atomic allocations [ 0.200642] DMA: preallocated 256 KiB GFP_KERNEL|GFP_DMA32 pool for atomic allocations [ 0.209606] audit: initializing netlink subsys (disabled) [ 0.215815] audit: type=2000 audit(0.128:1): state=initialized audit_enabled=0 res=1 [ 0.216263] thermal_sys: Registered thermal governor 'step_wise' [ 0.224663] cpuidle: using governor menu [ 0.236023] hw-breakpoint: found 6 breakpoint and 4 watchpoint registers. [ 0.243750] ASID allocator initialised with 65536 entries [ 0.249949] Serial: AMBA PL011 UART driver [ 0.276518] HugeTLB registered 1.00 GiB page size, pre-allocated 0 pages [ 0.284100] HugeTLB registered 32.0 MiB page size, pre-allocated 0 pages [ 0.291662] HugeTLB registered 2.00 MiB page size, pre-allocated 0 pages [ 0.299230] HugeTLB registered 64.0 KiB page size, pre-allocated 0 pages [ 0.308030] cryptd: max_cpu_qlen set to 1000 [ 0.315582] iommu: Default domain type: Translated [ 0.321246] vgaarb: loaded [ 0.324606] SCSI subsystem initialized [ 0.328996] libata version 3.00 loaded. [ 0.329221] usbcore: registered new interface driver usbfs [ 0.335447] usbcore: registered new interface driver hub [ 0.341502] usbcore: registered new device driver usb [ 0.347522] pps_core: LinuxPPS API ver. 1 registered [ 0.353126] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it> [ 0.363445] PTP clock support registered [ 0.369275] clocksource: Switched to clocksource arch_sys_counter [ 0.383741] NET: Registered protocol family 2 [ 0.389068] tcp_listen_portaddr_hash hash table entries: 1024 (order: 2, 16384 bytes, linear) [ 0.398713] TCP established hash table entries: 16384 (order: 5, 131072 bytes, linear) [ 0.407785] TCP bind hash table entries: 16384 (order: 6, 262144 bytes, linear) [ 0.416318] TCP: Hash tables configured (established 16384 bind 16384) [ 0.423777] UDP hash table entries: 1024 (order: 3, 32768 bytes, linear) [ 0.431404] UDP-Lite hash table entries: 1024 (order: 3, 32768 bytes, linear) [ 0.439604] NET: Registered protocol family 1 [ 0.444539] PCI: CLS 0 bytes, default 64 [ 0.449114] Unpacking initramfs... [ 4.048644] Freeing initrd memory: 7904K [ 4.053899] hw perfevents: enabled with armv8_cortex_a53 PMU driver, 7 counters available [ 4.067172] Initialise system trusted keyrings [ 4.072309] workingset: timestamp_bits=46 max_order=19 bucket_order=0 [ 4.140666] Key type asymmetric registered [ 4.145288] Asymmetric key parser 'x509' registered [ 4.150812] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 249) [ 4.159144] io scheduler mq-deadline registered [ 4.164247] io scheduler kyber registered [ 4.169950] gpiochip_add_data_with_key: GPIOs 101..135 (98007100.gpio) failed to register, -517 [ 4.179759] gpio-rtd119x 98007100.gpio: Adding GPIO chip failed (-517) [ 4.187237] gpiochip_add_data_with_key: GPIOs 0..100 (9801b100.gpio) failed to register, -517 [ 4.196845] gpio-rtd119x 9801b100.gpio: Adding GPIO chip failed (-517) [ 4.206556] rtd1295-sb2 9801a000.bridge: probed [ 4.216123] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled [ 4.233661] loop: module loaded [ 4.237784] megasas: 07.714.04.00-rc1 [ 4.242726] ahci_rtd129x 9803f000.sata: supply ahci not found, using dummy regulator [ 4.251566] ahci_rtd129x 9803f000.sata: supply phy not found, using dummy regulator [ 4.262744] libphy: Fixed MDIO Bus: probed [ 4.268692] tun: Universal TUN/TAP device driver, 1.6 [ 4.274839] dwc3 98020000.usb: can't request region for resource [mem 0x9802c100-0x98028fff] [ 4.284372] dwc3: probe of 98020000.usb failed with error -16 [ 4.290889] dwc3 98029000.usb: can't request region for resource [mem 0x98035100-0x98031fff] [ 4.300404] dwc3: probe of 98029000.usb failed with error -16 [ 4.307777] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver [ 4.315135] ehci-pci: EHCI PCI platform driver [ 4.320178] ehci-platform: EHCI generic platform driver [ 4.326188] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver [ 4.338201] ohci-platform: OHCI generic platform driver [ 4.344501] usbcore: registered new interface driver usb-storage [ 4.352868] rtd1295-rtc 9801b600.rtc: registered as rtc0 [ 4.358884] rtd1295-rtc 9801b600.rtc: setting system clock to 2019-09-03T07:28:26 UTC (1567495706) [ 4.369058] i2c /dev entries driver [ 4.374783] sdhci: Secure Digital Host Controller Interface driver [ 4.381753] sdhci: Copyright(c) Pierre Ossman [ 4.387059] Synopsys Designware Multimedia Card Interface Driver [ 4.394274] sdhci-pltfm: SDHCI platform and OF driver helper [ 4.401497] ledtrig-cpu: registered to indicate activity on CPUs [ 4.408970] usbcore: registered new interface driver usbhid [ 4.415252] usbhid: USB HID core driver [ 4.420774] NET: Registered protocol family 17 [ 4.425814] Key type dns_resolver registered [ 4.430930] Loading compiled-in X.509 certificates [ 4.442350] rtd1295-scpu-wrapper 9801d000.scpu: probed [ 4.449660] gpiochip_add_data_with_key: GPIOs 101..135 (98007100.gpio) failed to register, -517 [ 4.459473] gpio-rtd119x 98007100.gpio: Adding GPIO chip failed (-517) [ 4.467114] gpiochip_add_data_with_key: GPIOs 0..100 (9801b100.gpio) failed to register, -517 [ 4.476725] gpio-rtd119x 9801b100.gpio: Adding GPIO chip failed (-517) [ 4.485402] ahci_rtd129x 9803f000.sata: supply ahci not found, using dummy regulator [ 4.494265] ahci_rtd129x 9803f000.sata: supply phy not found, using dummy regulator [ 4.504363] i2c_designware 98007d00.i2c: deferred probe timeout, ignoring dependency [ 4.514029] gpiochip_add_data_with_key: GPIOs 101..135 (98007100.gpio) failed to register, -517 [ 4.523844] gpio-rtd119x 98007100.gpio: Adding GPIO chip failed (-517) [ 4.531481] gpiochip_add_data_with_key: GPIOs 0..100 (9801b100.gpio) failed to register, -517 [ 4.541092] gpio-rtd119x 9801b100.gpio: Adding GPIO chip failed (-517) [ 4.548688] pcie-rtd129x 9804e000.pci: deferred probe timeout, ignoring dependency [ 4.557500] pcie-rtd129x 9803b000.pci: deferred probe timeout, ignoring dependency [ 4.566565] dw-apb-uart 98007800.serial: deferred probe timeout, ignoring dependency [ 4.575738] printk: console [ttyS0] disabled [ 4.580621] 98007800.serial: ttyS0 at MMIO 0x98007800 (irq = 17, base_baud = 1687500) is a 16550A [ 4.590664] printk: console [ttyS0] enabled [ 4.599662] printk: bootconsole [uart8250] disabled [ 4.610704] ahci_rtd129x 9803f000.sata: supply ahci not found, using dummy regulator [ 4.618800] ahci_rtd129x 9803f000.sata: supply phy not found, using dummy regulator [ 4.628120] gpiochip_add_data_with_key: GPIOs 101..135 (98007100.gpio) failed to register, -517 [ 4.637055] gpio-rtd119x 98007100.gpio: Adding GPIO chip failed (-517) [ 4.644034] gpiochip_add_data_with_key: GPIOs 0..100 (9801b100.gpio) failed to register, -517 [ 4.652782] gpio-rtd119x 9801b100.gpio: Adding GPIO chip failed (-517) [ 4.659722] pcie-rtd129x 9804e000.pci: deferred probe timeout, ignoring dependency [ 4.667754] pcie-rtd129x 9803b000.pci: deferred probe timeout, ignoring dependency [ 4.676168] psci_checker: Missing PSCI operations, aborting tests [ 4.682773] dw-apb-uart 98007800.serial: forbid DMA for kernel console [ 4.690139] Freeing unused kernel memory: 1600K [ 4.705337] Run /sbin/init as init process [ 4.709552] with arguments: [ 4.709557] /sbin/init [ 4.709562] with environment: [ 4.709566] HOME=/ [ 4.709570] TERM=linux [ 4.709575] mtdparts=RtkSFC:128k(factory),512k(uboot),320k(logo),1408k(afw),64k(dtb),7680k(kernel),5632k(initrd) [ 5.012182] NET: Registered protocol family 10 [ 5.017568] Segment Routing with IPv6 [ 35.358369] random: fast init done Something is causing the gpio driver initialisation to fail and therefore also the pcie, sata and usb drivers cannot start. I'm suspecting an issue with the pin mux configuration but this is my first deep dive into the arm kernel so I'm not 100% sure how to approach this roadblock. Any suggestion is very welcome.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines