Welcome! Log In Create A New Profile

Advanced

Debian on ds218play (rtl1296 cpu) - work in progress

Posted by lonestar 
Debian on ds218play (rtl1296 cpu) - work in progress
August 04, 2023 10:50AM
Hi,

back again. As I have finished my tests with the ds214 and it working as my "productive" NAS now I wanted to see whether I can get my ds218play working. This is a bit different, as it uses an Realtek rtl1296 cpu.

I managed to connect the UART to it and stop at u-boot. Attached you will find some logs for that one.

I can load files via tftp, but at the moment I am searching for a matching kernel + device tree + initrd + rootfs. Any ideas where to start?
There is some branch in u-boot which looks promising for the dts: https://github.com/afaerber/linux/blob/rtd1295-next/arch/arm64/boot/dts/realtek/rtd1296-ds418.dts The ds418 has the same cpu on it. Edit: oops, that was not u-boot but the kernel device tree

Very interestingly it uses a 2-staged bootloader with two different u-boots. Looks like a trusted-firmware system, but apparently the device is not locked.

And yes - I know that fiddling around with the device can brick it ;)
BTW: is there a similar way to boot via serial as on the kirkwood devices?

regards,
Martin



Edited 2 time(s). Last edit at 08/07/2023 11:59AM by lonestar.
Attachments:
open | download - boot.log (7.4 KB)
open | download - uboot.env (3.1 KB)
open | download - dmesg.txt (39.8 KB)
Re: Debian on ds218play (rtl1296 cpu) - work in progress
August 07, 2023 12:07PM
I did some further tests and even found the original kernel config of synology in their gpl sources.
Unfortunately when I use this config on an 6.0.8 kernel the kernel gets quite big (>20MB)

u-boot seems to only support the typical 8MB image, as I get "Loading Kernel Image ... Image too large: increase CONFIG_SYS_BOOTM_LEN".
As I want to avoid having to flash the u-boot instances I will have to downsize the kernel.

So far I have gotten down to 8.84MiB.

My current workflow:
- compile kernel and create uImage with the dtb from the kernel tree (rtd1296-ds418.dtb)
- in the first u-boot use tftp to load the uImage to ram. I currently ignore the initrd as I am not there yet.
- the I use bootr to switch to the second u-boot.
- in the second u-boot I call bootm to boot the image.

Note that the first u-boot does not support bootm and the second one does not support tftp.

I attach my current kernel config, where I hopefully didn't deactivate anything I need and where I still need to find further stuff that can be safely disabled. So if anyone wants to take a look and has some ideas, I am happy :)

.config_downsizing is my current state
rtd1296_kernel_config is the original from the gpl source.

regards,
Martin
Attachments:
open | download - .config_downsizing (128.8 KB)
open | download - rtd1296_kernel_config (149.9 KB)
Re: Debian on ds218play (rtl1296 cpu) - work in progress
August 07, 2023 01:48PM
I spent a little time looking at some similar devices running a RTD1195 and RTD1619 (Buffalo Linkstation LS500 and LS700). I ran into the reference to that two stage u-boot needed for the device-tree's in the mainline kernel but hadn't gotten around to finding it yet.

I don't have much to add at this point but I'm glad to see someone taking a look!
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: