ryan4yin / nixos-rk3588

Minimal NixOS running on RK3588/RK3588s based SBC(Orange Pi 5 Plus, Orange Pi 5, Rock 5A, etc)
MIT License
126 stars 14 forks source link

Steps to add support for a new board (Turing Pi RK1) #18

Open eripa opened 6 months ago

eripa commented 6 months ago

Hi,

Thanks for putting this together. I'm fairly new to SBC and NixOS, I just recently received a couple of Turing Pi RK1, and was hoping to add support for them.

It looks like there are DTS available here: https://github.com/armbian/linux-rockchip/blob/rk-5.10-rkr6/arch/arm64/boot/dts/rockchip/rk3588-turing-rk1.dts

The official Turing Pi image uses Ubuntu based on the following repo (config and u-boot).

Do you have any pointers to how to add support?

Thanks

ryan4yin commented 5 months ago

I don't know much about Linux kernel and embedded, but since that rockchip's linux kernel has its dts, you can use my configuration here and change the deviceTree into turing pi's dts, to see if it works.

schwankner commented 5 months ago

I forked this repo to try to make a turing rk1 version. But currently I have problems with the u-boot compile process. I know how it works and which files are needed. Everything is at the ubuntu-rockchip repo for creating a .deb file. But my NixOS skills are not sufficent to create a working port. The simple process is on the terminal like this:

git clone https://github.com/Joshua-Riek/ubuntu-rockchip.git
cd ubuntu-rockchip/build

export UBOOT_PACKAGE=u-boot-turing-rk3588
source ../packages/"${UBOOT_PACKAGE}"/debian/upstream
git clone --single-branch --progress -b "${BRANCH}" "${GIT}" "${UBOOT_PACKAGE}"
git -C "${UBOOT_PACKAGE}" checkout "${COMMIT}"
cp -r ../packages/"${UBOOT_PACKAGE}"/debian "${UBOOT_PACKAGE}"

cd u-boot-turing-rk3588

make turing-rk1-rk3588_defconfig ARCH=arm O=output

make BL31=debian/rkbin/rk3588_bl31_v1.38.elf  ROCKCHIP_TPL=debian/rkbin/rk3588_ddr_lp4_2112MHz_lp5_2736MHz_uart9_115200_v1.11.bin ARCH=arm O=output

But there are patches for turing rk1 in the git repo, maybe these are needed as well.

I did not research how the EFI way works, but maybe this is easyer. There are offical Turing images avialable at their site. One Ubuntu image which uses u-boot and one talos with efi. Maybe investigating these images could be helpfull.