Jump to content

Proof of concept - Realtek 1295


Staars

Recommended Posts

On 12/25/2019 at 10:54 PM, y52 said:

Does somebody know who to implement the following solution ?

https://lkml.org/lkml/2019/7/7/39

I can not answer your question, but in the last few weeks there has been a lot of activity on lkml.org regarding the realtek-platform.

Basically „the pro‘s have taken over“ and this is the best thing, that could have happened. I think it is a smart move from realtek to go the „mainline-route“, as it will make their and our lives much easier in the future.

But now we need some patience, because every effort outside of the kernel-development is (IMHO) wasted time.

Link to comment
Share on other sites

1 hour ago, Staars said:

every effort outside of the kernel-development is (IMHO) wasted time

I can not but agree.

I've tried several kernel branches for now: mainline, next, legacy BPI-SINOVOIP. In the absence of Realtek's support, accessibility to the board features is very poor. Even basic ethernet NIC's are not operational, even with the legacy BPI-SINOVOIP, which is supposed meeting this basic task. I do not even mention the video Mali T820 support, which is probably far from being thought of. 

 

Link to comment
Share on other sites

On 12/24/2019 at 10:40 AM, danman said:

Can you try to dump it from u-boot?

My UART cable hasn't arrived yet, it should has been lost on its way to complete the setback with the W2 itself. Meanwhile I have decided sending the BPI-W2 back to the supplier, as no achievement has been made with the broken ethernet and it looks, that nobody interested from the Sinovoip side. Thus I shall not be able dumping mtd.  The hardware components are good for different applications, but the absence of drivers and kernel support makes it a handicap. 

Link to comment
Share on other sites

On 12/29/2019 at 11:30 PM, Staars said:

I can not answer your question, but in the last few weeks there has been a lot of activity on lkml.org regarding the realtek-platform.

Basically „the pro‘s have taken over“ and this is the best thing, that could have happened. I think it is a smart move from realtek to go the „mainline-route“, as it will make their and our lives much easier in the future.

But now we need some patience, because every effort outside of the kernel-development is (IMHO) wasted time.

good job!

 

hi Staars   I have rtd1295 tvbox  how install armbian on my tvbox?

 

UART cable info:

 

U-Boot 2012.07-g593d2f1-dirty (Sep 01 2016 - 15:39:48)

CPU  : Cortex-A7 dual core
Board: Realtek QA Board
DRAM:  1 GiB
Watchdog: Disabled
Cache: Enabled
Non-Cache Region: 1 MB@0x07900000
MMC:   rtk_emmc : Detect chip rev. >= B
RTD1195 eMMC: 0
rtk_emmc : Detect chip rev. >= B
mmc->version=0x00010000
version=0x00000004
SDR select (sample/push) : 0x00/0x00
[LY] cardtype=57, mmc->card_caps=0f
[LY] TBD : to support DDR50/HS200
[LY] SDR bus width=2
SDR select (sample/push) : 0x00/0x00
[LY] mmc->boot_caps = 203
[LY] sdr50 : 0
exit from mmc_startup(),err=0
Device: RTD1195 eMMC
Manufacturer ID: 11
OEM: 100
Name: 004GE 
Tran Speed: 3197500
Rd Block Len: 512
MMC version 4.0
High Capacity: No
Capacity: 3.7 GiB
Bus Width: 8-bit
Speed: SDR50
Net:   Realtek PCIe GBE Family Controller mcfg = 0024
dev->name=r8168#0
167,sw_boot_init
SECURE_BOOT enter!
Cache: Enabled
Non-Cache Region: 1 MB@0x07900000
hardware name = R140B
74,sw_ptable_init
Read Partition ptable,offset = 0,length = 2000,addr=6000000
130,sw_ptentry_read
Read Partition ptable,offset = 200000,length = 2000,addr=6000000
30,sw_mmc_read
offset:200000,lengh=2000,addr=6000000, blk:1000,cnt:10
56,sw_ptable_check
mtd_parts=mtdparts=emmc:2M(loader),2M(ptable),2M(devinfo),2M(misc),16M(logo),24M(recovery),24M(boot),48M(swdb),320M(backup),320M(cache),480M(system),2856M(data)
ptable->cksum=0x298b,count=12
ptn=0    name='loader'    flags=0x0    offset=0x0    size=0x2
ptn=1    name='ptable'    flags=0x0    offset=0x2    size=0x2
ptn=2    name='devinfo'    flags=0x0    offset=0x4    size=0x2
ptn=3    name='misc'    flags=0x0    offset=0x6    size=0x2
ptn=4    name='logo'    flags=0x0    offset=0x8    size=0x10
ptn=5    name='recovery'    flags=0x0    offset=0x18    size=0x18
ptn=6    name='boot'    flags=0x0    offset=0x30    size=0x18
ptn=7    name='swdb'    flags=0x40    offset=0x48    size=0x30
ptn=8    name='backup'    flags=0x40    offset=0x78    size=0x140
ptn=9    name='cache'    flags=0x40    offset=0x1b8    size=0x140
ptn=10    name='system'    flags=0x40    offset=0x2f8    size=0x1e0
ptn=11    name='data'    flags=0x80    offset=0x4d8    size=0xb28

Press 1b Key
Hit Esc or Tab key to enter console mode or rescue linux:  0 
Start Boot Setup ... 
[ERR] rtk_plat_prepare_fw_image_from_eMMC:Signature() error!
Enter console mode, disable watchdog ...

Realtek> 
 

Link to comment
Share on other sites

Hi @Igor

 

I have a Banana Pi W3 board which now has kernel code for supporting the two Ethernet ports (actually three, one not wired).

 

    https://github.com/BPI-SINOVOIP/BPI-W2-bsp/tree/rtk1296_ow

 

I am wanting to know if there are any instructions or help available on how to go about :-

 

a) supporting the BPI W2 A53 CPU

b) integrating the Realtech 1296 Support and possibly all th Realtech chipsets, on the following links

 

https://github.com/BPI-SINOVOIP/BPI-W2-bsp/tree/rtk1296_ow/linux-rtk/drivers/soc/realtek

https://github.com/BPI-SINOVOIP/BPI-W2-bsp/tree/rtk1296_ow/linux-rtk/drivers/soc/realtek/rtd129x

 

I am a pretty confident programmer but have not looked at the Linux Kernel properly since v2.4 days and do not know the Armbian framework other than top level image building.

 

 

Link to comment
Share on other sites

1 hour ago, AaronNGray said:

I am wanting to know if there are any instructions

 

If initial board support package (boot loader + kernel + toolchain) is on some decent level, check those examples:

https://github.com/armbian/build/pull/2126

https://github.com/armbian/build/pull/2032

 

1 hour ago, AaronNGray said:

integrating the Realtech 1296 Support and possibly all th Realtech chipsets, on the following links


HW integration and support is very expensive and we can't afford to sponsor maintenance and support more hardware without expanding team / hire people. Maintaining the code is not exactly something people would stay in the line to get that. Development, playing with toys, contributing here and there, existing, but not near enough to cover everything. Nevertheless, there are people that might be interested to join your efforts ... which is the purpose of this forum. Officially, basic conditions are still at least those:

 

1 hour ago, AaronNGray said:

I am a pretty confident programmer but have not looked at the Linux Kernel properly since v2.4 days and do not know the Armbian framework other than top level image building.


Kernel tinkering experiences are surely helpful but IHMO in this particular case not enough. (I am not dealing with this particular hardware so I could be wrong) Boot loaders are custom pcs of poorly maintained but very important part of the whole - for each board. Also kernel changed in the term how hardware is configured since the old days ...

 

Armbian is "just" a tool that helps you put all those things together. Like Yocto or Buildroot, just from a different perspective.

Link to comment
Share on other sites

Okay I understand the background issues now so I have either got to wait till SINOVOIP's drivers get into mainline Linux source (which I dont know if that will ever happen judging on what I have seen), or go about integrating the drivers at my end into Armbian, then testing, possibly getting other BananaPi W2 users testing, and then do pull request to you and maybe to appropriate kernel driver maintainer(s).

 

Is there any documentation on the internals to the Armbian framework at all ?

 

Oh I had done an issue following your guidlines I was pointer at before the forum topics were merged :- https://github.com/armbian/build/issues/2152

 

Link to comment
Share on other sites

7 hours ago, AaronNGray said:

Is there any documentation on the internals to the Armbian framework at all ?


Docs -> Building Armbian

https://docs.armbian.com/Developer-Guide_Build-Preparation/

 

  • Building Armbian
  • Building with Vagrant
  • Building with Docker
  • Build Options
  • User Configurations
  • FEL boot

 

is the best we got  + already exposed examples. You can find more under https://github.com/armbian/build/pulls?q=is%3Apr+is%3Aclosed

 

7 hours ago, AaronNGray said:

Okay I understand the background issues now so I have either got to wait till SINOVOIP's drivers get into mainline Linux source


Mainlining is a serious business and can easily takes years to complete (but almost no board gets complete support). There are a few companies that provide such services (with help of community) and vendors have to pay hard cash if they choose to go that path. More complicated and exotic device, more work ... Majority can't afford (or would not gamble) and if community around is too small, all you get is old private development kernel drop.

Link to comment
Share on other sites

So there is no way to specify an external kernel like the one in the SINOVoIP BPi W2, rather we have to create patch(es) for the Armbian patch directory ?

 

I have checked the mainline kernel, kernel mailing list, and found this maining list http://lists.infradead.org/pipermail/linux-realtek-soc/ its only three months old and it looks like all there is now is boot, and probing support so far.

 

So ot goes down to how long its going to take to wait for support from RealTek or whether I can make up patches from the BPi BSP Kernel code for an Armbian build in the meantime.

Link to comment
Share on other sites

43 minutes ago, AaronNGray said:

So there is no way to specify an external kernel like the one in the SINOVoIP BPi W2


Kernels that are not part of the mainline are usually heavily derived from and can contain many incompatible code. Probably it is possible to bring the kernel in and probably somebody already tried that. I would do a wide research before thinking about any coding / porting.
 

45 minutes ago, AaronNGray said:

and it looks like all there is now is boot


Probably something is, but is it useful?

 

49 minutes ago, AaronNGray said:

So it goes down to how long its going to take to wait for support from RealTek


You can see how much it was for past few years. It is probably just you. Like I said - there are other people in community that might want to help out when they see things moving.

Link to comment
Share on other sites

3 hours ago, Igor said:


Kernels that are not part of the mainline are usually heavily derived from and can contain many incompatible code. Probably it is possible to bring the kernel in and probably somebody already tried that. I would do a wide research before thinking about any coding / porting.
 

OKay I think I will parallel researching further, with preparing patches and either doing a base level diff's without the prepatched code to see what elese there is in the SINOVoIP code, and searching back through the commits if necessary.

Quote


Probably something is, but is it useful?

I will check whats there against the SINOVoIP code. Not got down to that level yet.

Quote


You can see how much it was for past few years. It is probably just you. Like I said - there are other people in community that might want to help out when they see things moving.

Yeah, I am thinking if I can get the exising BSP Realtek Driver code there and working in Armbian, it will stand as a stop gap until Realtek get there drivers and kernel support there in the Linux Kernel proper.

Link to comment
Share on other sites

 

Ladies and gentlemen, I managed to boot from SPI on my Zidoo X8:

        Banana Pi BPI-W2(SPI ROM:20180907)

C1:80000000
C2
?
C3h
SD card is not detected !!
BPI: try get_builtin_hwsetting !!

hwsetting size: 00000000
C4
BPI: try bootcode_from_emmc !! 
        BPI: support boot from emmc
switch frequency to 0x00000046
frequency divider is 0x00000080
switch frequency to 0x00000046
frequency divider is 0x00000004
switch to SDR 8 bit
switch bus width to 0x00000008 bits success
Time out 
Time out 
Time out 
End bit error 

BPI: sys_boot_type:1414141490A73F71C7
        Banana Pi BPI-W2(SPI ROM:20180907)

C1:80000000
C2
?uu3-1

 

All I needed was dump from BPI-W2 SPI flash (attached) which I was asking for serveral times here :)

 

In next days, I'll try to boot Linux kernel as described here:

http://forum.banana-pi.org/t/bananapi-w2-ubuntu-18-04-new-image-release-2018-09-17/6790

bpi-w2.bin.short

Link to comment
Share on other sites

Until now, I thought that dvrboot.exe.bin is SPI image which is supposed to be directly written to SPI FLASH chip.

But today I discovered it is actually a binary which should be executed on the device to program the SPI chip "in system".

We have sources for this binary here:

https://github.com/BPI-SINOVOIP/BPI-W2-bsp/blob/master/u-boot-rtk/examples/flash_writer/dvrmain.c#L2101

so my next step for creating custom SPI with bootloader for my zidoo X8 is to dissect the locations and create a script to assemble SPI image from all the components which could be directly written to SPI FLASH chip.

Link to comment
Share on other sites

Hello, I just want to inform to anyone that still is going with this project that from here https://www.terra-master.com/code/ you can download the sources of openwrt for rtd1295 (i believe they are complete, with kernel and bootloader sources, and ffmpeg encoder), i found it because i have a wd nas with this chip, and i was trying to bring the video transcode to linux, i failed because my knowledge is limited, but maybe is useful to bring armbian to this board.

Link to comment
Share on other sites

Hello

 

I'm trying to run armbian (or any other custom linux) on my NAS TerraMaster F4-210/2G (SoC Realtek RTD1296 based). It has uart connector (the same connector and pins as Zidoo X9S).

So I've created USB stick with Fat32, put uImage and device tree files into it, created another ext2 partition to use as root. Took uImage from banana-pi-w2 just to check things. And used the following command to load my kernel from uboot (there is no b2ndbc command in my uboot):

Realtek> env set bootargs earlycon=uart8250,mmio32,0x98007800 console=ttyS0,115200 noinitrd root=/dev/sda1 rootfs=vfat
Realtek> usb start && fatload usb 0:1 $kernel_loadaddr uimage && fatload usb 0:1 $fdt_loadaddr tm_f4-210.dtb && env set bootargs earlycon=uart8250,mmio32,0x98007800 console=ttyS0,115200 noinitrd root=/dev/sda2  rootfs=ext2 init=/bin/bash && bootr
starting USB...
...
reading uimage
10630032 bytes read in 403 ms (25.2 MiB/s)
reading tm_f4-210.dtb
65536 bytes read in 30 ms (2.1 MiB/s)
Start Boot Setup ... 
*** rtkspi_read32_md 422, tar 0x0b000000, src 0x881a0000, len 0x00050000
...
PowerOnOSD~~
[    0.000000] psci: probing for conduit method from DT.

 

After that original kernel loaded instead of mine.

 

Then I tried to use bootm - also without any luck

Realtek> usb start && fatload usb 0:1 $kernel_loadaddr uimage && fatload usb 0:1 $fdt_loadaddr tm_f4-210.dtb && env set bootargs earlycon=uart8250,mmio32,0x98007800 console=ttyS0,115200 noinitrd root=/dev/sda2  rootfs=ext2 init=/bin/bash 
&& bootm $kernel_loadaddr - $fdt_loadaddr
Wrong Image Format for do_booti command
ERROR: can't get kernel image!

 

I didn't find any documentation on bootr command which stays for `bootr   - boot realtek platform`. So my questions are:

is it possible to get info from current stock uboot or devtree or kernel. Or what image type is required by bootm.

 

uboot load log

uboot help

uboot base, bdinfo, flinfo, printenv, showvar, version

 

Also in my device-tree I see the following:

chosen {
        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";
        linux,initrd-start = <0x2200000>;
        linux,initrd-end = <0x2600000>;
        compatible = "Realtek,rtk1295-cma_info";
        cma-region-enable = <0x01>;
        cma-region-info = <0x00 0x1000000 0x11000000>;
};

memory {
        device_type = "memory";
        reg = <0x00 0x80000000>;
};

mem_remap {
        compatible = "Realtek,rtk1295-mem_remap";
        #address-cells = <0x01>;
        #size-cells = <0x01>;
        ranges;

        rbus {
                reg = <0x98000000 0x200000>;
        };

        common {
                reg = <0x1f000 0x1000>;
        };

        ringbuf {
                reg = <0x1ffe000 0x4000>;
        };
};

 

Link to comment
Share on other sites

On 5/29/2021 at 1:04 PM, Павел Мухатаев said:

I'm trying to run armbian (or any other custom linux) on my NAS TerraMaster F4-210/2G (SoC Realtek RTD1296 based). It has uart connector (the same connector and pins as Zidoo X9S).

So I've created USB stick with Fat32, put uImage and device tree files into it, created another ext2 partition to use as root. Took uImage from banana-pi-w2 just to check things. And used the following command to load my kernel from uboot (there is no b2ndbc command in my uboot):

 

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.

Link to comment
Share on other sites

Hi guys!

 

I have a broken DS218 NAS, it worked for 3+ years and then it randomly died. It's not really releated to this topic, but I think you guys might know more about this CPU than me :)

 

The UART says the following and then the CPU halts.

 

C1:80000000
C2
?
C3h
hwsetting size: 00000B94
C4
f
5-5verify fsbl fail
0000003BC7
C1:80000000
C2
?uu3-1

 

I verified the SPI flash contents, even reflashed the bootloader using the original synology loader but it fails.

I also verified the data being read out using a logic analyser and everything seems to work just fine.

Also tried flashing different bootloaders into the SPI flash (BPi UBoot) but nothing really works.

 

The CTRL+Q on-chip-recovery terminal works, however it does not want to execute any code for some reason.

 

I read somewhere that the FSBL might be encrypted, is it possible that the keys inside the CPU (efuse or OTP memory ?) somehow got corrupted and so now everything is just invalid?

 

Does somebody has any info of what this "verify fsbl fail" means?

 

Cheers,

Bence.

Link to comment
Share on other sites

Hi! Robot9706 , it happened something similar to me with my Home Cloud Duo, I flash a wrong bootloader on the emmc and had the same message as you. I believe your bootloader became corrupted or the emmc of your device died. Take a look in the comments on blog of Danman https://blog.danman.eu/zidoo-x8-recovery/ . Sadly you can not write directly the bootloader on the emmc with the ctrl +q recovery, the bin file inside Synology updates, i believe are raw images writed directly to the emmc (if i remember correctly). You can explore the sources of bananapi w2 or Western digital to see if you can add the writer to the bootloader (sorry if i don´t express myself correctly, but english isn´t my first language).

Link to comment
Share on other sites

1 hour ago, JAN27 said:

Hi! Robot9706 , it happened something similar to me with my Home Cloud Duo, I flash a wrong bootloader on the emmc and had the same message as you. I believe your bootloader became corrupted or the emmc of your device died. Take a look in the comments on blog of Danman https://blog.danman.eu/zidoo-x8-recovery/ . Sadly you can not write directly the bootloader on the emmc with the ctrl +q recovery, the bin file inside Synology updates, i believe are raw images writed directly to the emmc (if i remember correctly). You can explore the sources of bananapi w2 or Western digital to see if you can add the writer to the bootloader (sorry if i don´t express myself correctly, but english isn´t my first language).

 

Hi! Thanks for the comment!

 

I think the SPI flash and its contents are correct. I can compile and transfer and kind of binary that I want into the RAM to run, however if I transfer these into DRAM they won't run (because they get corrupted). They run fine from the internal SRAM.

So I desoldered two RAM chips because I think one of them is broken. The new chips will arrive next week, I'll post an update on how the fix went :)

 

Cheers,

Bence.

Link to comment
Share on other sites

On 1/2/2022 at 2:25 PM, Robot9706 said:

Hi guys!

 

I have a broken DS218 NAS, it worked for 3+ years and then it randomly died. It's not really releated to this topic, but I think you guys might know more about this CPU than me :)

 

The UART says the following and then the CPU halts.

 

C1:80000000
C2
?
C3h
hwsetting size: 00000B94
C4
f
5-5verify fsbl fail
0000003BC7
C1:80000000
C2
?uu3-1

 

I verified the SPI flash contents, even reflashed the bootloader using the original synology loader but it fails.

I also verified the data being read out using a logic analyser and everything seems to work just fine.

Also tried flashing different bootloaders into the SPI flash (BPi UBoot) but nothing really works.

 

The CTRL+Q on-chip-recovery terminal works, however it does not want to execute any code for some reason.

 

I read somewhere that the FSBL might be encrypted, is it possible that the keys inside the CPU (efuse or OTP memory ?) somehow got corrupted and so now everything is just invalid?

 

Does somebody has any info of what this "verify fsbl fail" means?

 

Cheers,

Bence.

 

Sorry for off topic bumping :)

 

Update on this post: After replacing the RAM chips the NAS works again.

It seems using the recovery terminal to poke at RAM addresses to try and figure out which chip is broken works.

I've uploaded all my findings for future use here: https://github.com/robot9706/DS218

 

Cheers,

Bence.

Link to comment
Share on other sites

https://www.cnx-software.com/2018/09/23/realtek-rtd1296-u-boot-linux-source-code-rtd1619-cortex-a55-soc/

 

Скрытый текст

Posted on September 23, 2018 by Jean-Luc Aufranc (CNXSoft) - 9 Comments on Realtek RTD1296 U-boot & Linux Source Code Released, RTD1619 Cortex A55 SoC Shows up in Code

 

Realtek RTD1296 U-boot & Linux Source Code Released, RTD1619 Cortex A55 SoC Shows up in Code

 

Media centers based on Realtek RTD1295 or RTD1296 processors have been around for a few years. They usually run both Android and OpenWrt operating systems for respectively media functions (4K video playback, HDMI input recording…), and NAS functions like file sharing. media downloads, etc…. SinoVoIP also unveiled Banana Pi BPI-W2 board powered by RTD1296 last year, but so far I was not aware of any source code for the target.

Synlogy actually released a Linux 4.4 tarball a while ago, but more recently SinoVoIP released Linux 4.9.119 and U-boot source code for RTD1296 in Github.

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines