Skip to content

Commit

Permalink
feat: add Turing RK1 support
Browse files Browse the repository at this point in the history
U-Boot has a patch for generating SPI images, which is required for eMMC
when booting from NVMe.

U-Boot also includes a KASLR patch that enables passing a seed to EFI so the
kernel has sufficient entropy at boot to enable KASLR.

DTB is compiled externally (not via `siderolabs/pkgs`) as they still require
DTS patches.

The RKBIN for RK3588 DDR initialization is patched to support a different baud rate
for the internal UART on the Turing Pi. Without this patch, the `tpi uart` command
will not work (i.e., reading the console from the Turing Pi channel with the RK1).

The UART ID is changed to 9 to prevent device name conflicts.

Patching the RKBIN for the RK3588 involves running a closed-source utility,
ddrbin_tool, from the rkbin repository.

Signed-off-by: Nico Berlee <[email protected]>
Signed-off-by: Noel Georgi <[email protected]>
  • Loading branch information
nberlee authored and frezbo committed Dec 2, 2024
1 parent 3fb40bd commit 45d82b6
Show file tree
Hide file tree
Showing 20 changed files with 1,839 additions and 1 deletion.
5 changes: 5 additions & 0 deletions Pkgfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,10 @@ vars:
rkbin_sha256: 18bde6ce71df308197db0e1d95fd73a19b6a32f4f0b6f5567333ef3c5b617452
rkbin_sha512: f414b26f944e2119d6be93c1675d1bbbd2770141e229a3ffe0a176e6dc25d9cea506e7456344d714ac563af64ad708fe93cca9e184353a1b60d8881285d81822

# renovate: datasource=git-tags extractVersion=^v(?<version>.*)$ depName=git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
linux_version: 6.12.1
linux_sha256: 0193b1d86dd372ec891bae799f6da20deef16fc199f30080a4ea9de8cef0c619
linux_sha512: c7523dc5b012367301ab43a685b766dce025c4993041acd3dacd085b052b3fccc7f50c892357acf481e24ccad512770ef46a13d2da16c2a178c44a27f7022932

labels:
org.opencontainers.image.source: https://github.com/siderolabs/sbc-rockchip
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ This repo provides the overlay for RockChip based Talos image.

| Overlay Name | Board | SoC | Description |
| -------------------- | --------------------- | ------ | --------------------------------------------- |
| helios64 | Kobol Helios64 | RK3399 | Overlay for Kobol Helios64 |
| nanopi-r5s | NanoPi R5S | RK3568 | Overlay for NanoPi R5S (only WAN, no NVMe) |
| nanopi-r4s | NanoPi R4S | RK3399 | Overlay for NanoPi R4S |
| orangepi-r1-plus-lts | Orange Pi R1 Plus LTS | RK3328 | Overlay for Orange Pi R1 Plus LTS |
Expand All @@ -14,4 +15,4 @@ This repo provides the overlay for RockChip based Talos image.
| rockpi4c | Rock Pi 4C | RK3399 | Overlay for Rock Pi 4C |
| rock4se | Rock 4 SE | RK3399 | Overlay for Rock 4 SE |
| rock4cplus | Radxa ROCK 4C+ | RK3399 | Overlay for Radxa ROCK 4C+ |
| helios64 | Kobol Helios64 | RK3399 | Overlay for Kobol Helios64 |
| turingrk1 | Turing Machines RK1 | RK3588 | Overlay for Turing Machines RK1 |
38 changes: 38 additions & 0 deletions artifacts/arm-trusted-firmware/rk3588/pkg.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: arm-trusted-firmware-rk3588
variant: scratch
shell: /toolchain/bin/bash
dependencies:
- stage: base
steps:
- sources:
- url: https://github.com/ARM-software/arm-trusted-firmware/archive/{{ .arm_trusted_firmware_nonlts_version }}.tar.gz
destination: arm-trusted-firmware.tar.gz
sha256: "{{ .arm_trusted_firmware_nonlts_sha256 }}"
sha512: "{{ .arm_trusted_firmware_nonlts_sha512 }}"
env:
SOURCE_DATE_EPOCH: {{ .BUILD_ARG_SOURCE_DATE_EPOCH }}
prepare:
- |
mkdir -p /usr/bin \
&& ln -sf /toolchain/bin/env /usr/bin/env
tar xzf arm-trusted-firmware.tar.gz --strip-components=1
# rk3588
build:
- |
# https://github.com/ARM-software/arm-trusted-firmware/blob/master/docs/getting_started/initial-build.rst
export CROSS_COMPILE=/toolchain/bin/aarch64-linux-musl-
make realclean
# https://salsa.debian.org/debian/arm-trusted-firmware/-/commit/6424a59e08585af7f8a56f1e16ecc6a6b9e4ad7a
# https://salsa.debian.org/debian/arm-trusted-firmware/-/commit/6ed8f61df3b07bb22a68a0fc189ec3b3f7b00dbd
CFLAGS=--param=min-pagesize=0 make -j $(nproc) PLAT=rk3588 DEBUG=0 bl31
install:
- |
mkdir -p /rootfs/arm-trusted-firmware/rk3588
cp build/rk3588/release/bl31/bl31.elf /rootfs/arm-trusted-firmware/rk3588/bl31.elf
finalize:
- from: /rootfs
to: /libs
Loading

0 comments on commit 45d82b6

Please sign in to comment.