Skip to content

Commit 327266f

Browse files
joshdmoorefrezbo
authored andcommitted
feat: add ROCK 5A support
Add Rock 5A support. Signed-off-by: Noel Georgi <[email protected]>
1 parent 0f72371 commit 327266f

File tree

14 files changed

+215
-1
lines changed

14 files changed

+215
-1
lines changed

MAINTAINERS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,6 @@ This document contains a list of maintainers in this repo. For now, you become a
1818
| rockpi4c | Rock Pi 4C | [#1](https://github.com/siderolabs/sbc-rockchip/pull/1) | RK3399 | TBD (Initial PR moved from pkgs) | TBD |
1919
| rock4cplus | Radxa ROCK 4C+ | [#5](https://github.com/siderolabs/sbc-rockchip/pull/5) | RK3399 | Damià Poquet Femenia | [DamiaPoquet](https://github.com/DamiaPoquet) |
2020
| rock4se | Radxa ROCK 4SE | [#18](https://github.com/siderolabs/sbc-rockchip/pull/18) | RK3399 | Boran Car | [borancar](https://github.com/borancar) |
21+
| rock5a | Radxa ROCK 5A | [#51](https://github.com/siderolabs/sbc-rockchip/pull/51) | RK3588 | Josh Moore | [joshdmoore](https://github.com/joshdmoore) |
2122
| rock5b | Radxa ROCK 5B | [#45](https://github.com/siderolabs/sbc-rockchip/pull/45) | RK3588 | Christoph Hoopmann | [choopm](https://github.com/choopm) |
2223
| helios64 | Kobol Helios64 | [#23](https://github.com/siderolabs/sbc-rockchip/pull/23) | RK3399 | Hemanth Bollamreddi | [blmhemu](https://github.com/blmhemu) |

Pkgfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ vars:
1818
uboot_sha512: 678f44e2b9132140f0bf05c637e57e638c73c278611037a41824b3ebff2131af4dec0163da4664bb2e5c4fd8034ba8c95b93b57f7aa9f4c045da322d87c3b5e9
1919

2020
# renovate: datasource=github-tags extractVersion=^v(?<version>.*)$ depName=u-boot/u-boot
21-
uboot_rk1_version: 2024.10
21+
uboot_rk1_version: 2025.01
2222
uboot_rk1_sha256: b28daf4ac17e43156363078bf510297584137f6df50fced9b12df34f61a92fb0
2323
uboot_rk1_sha512: ef817c9b5ae8dc6cd9e3f57811e90acc6a4d4394f0356aa5923e3e3c8559168f977bd5bf82824cd3650aa8e5e3c3d1b00e20818d21368151748682f1fc51152c
2424

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,6 @@ This repo provides the overlay for RockChip based Talos image.
1616
| rockpi4c | Rock Pi 4C | RK3399 | Overlay for Rock Pi 4C |
1717
| rock4se | Rock 4 SE | RK3399 | Overlay for Rock 4 SE |
1818
| rock4cplus | Radxa ROCK 4C+ | RK3399 | Overlay for Radxa ROCK 4C+ |
19+
| rock5a | Radxa ROCK 5A | RK3588s | Overlay for Radxa ROCK 5A |
1920
| rock5b | Radxa ROCK 5B | RK3588 | Overlay for Radxa ROCK 5B |
2021
| turingrk1 | Turing Machines RK1 | RK3588 | Overlay for Turing Machines RK1 |
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
diff --git a/include/linux/byteorder/little_endian.h b/include/linux/byteorder/little_endian.h
2+
index a4cb3bfde5..0ecd088f4a 100644
3+
--- a/include/linux/byteorder/little_endian.h
4+
+++ b/include/linux/byteorder/little_endian.h
5+
@@ -7,7 +7,10 @@
6+
#ifndef __LITTLE_ENDIAN_BITFIELD
7+
#define __LITTLE_ENDIAN_BITFIELD
8+
#endif
9+
+
10+
+#ifndef __BYTE_ORDER
11+
#define __BYTE_ORDER __LITTLE_ENDIAN
12+
+#endif
13+
14+
#include <linux/compiler.h>
15+
#include <linux/types.h>

artifacts/rock5a/u-boot/pkg.yaml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# References:
2+
# U-Boot:
3+
# - https://u-boot.readthedocs.io/en/latest
4+
name: u-boot-rock5a
5+
variant: scratch
6+
shell: /toolchain/bin/bash
7+
dependencies:
8+
- stage: base
9+
- stage: arm-trusted-firmware-rk3588
10+
- stage: rkbin-rk3588
11+
platform: linux/amd64
12+
steps:
13+
- sources:
14+
- url: https://ftp.denx.de/pub/u-boot/u-boot-{{ .uboot_rk1_version }}.tar.bz2
15+
destination: u-boot.tar.bz2
16+
sha256: "{{ .uboot_rk1_sha256 }}"
17+
sha512: "{{ .uboot_rk1_sha512 }}"
18+
env:
19+
SOURCE_DATE_EPOCH: {{ .BUILD_ARG_SOURCE_DATE_EPOCH }}
20+
prepare:
21+
# rock-5a-rk3588s
22+
- |
23+
mkdir -p /usr/bin \
24+
&& ln -sf /toolchain/bin/env /usr/bin/env \
25+
&& ln -sf /toolchain/bin/python3 /toolchain/bin/python
26+
27+
pip3 install pyelftools setuptools \
28+
&& ln -sf /toolchain/bin/python3 /toolchain/bin/python
29+
30+
tar xf u-boot.tar.bz2 --strip-components=1
31+
32+
patch -p1 < /pkg/patches/uboot-byteorder.patch
33+
- |
34+
make rock5a-rk3588s_defconfig
35+
build:
36+
- |
37+
make -j $(nproc) HOSTLDLIBS_mkimage="-lssl -lcrypto" BL31=/libs/arm-trusted-firmware/rk3588/bl31.elf ROCKCHIP_TPL=/libs/rkbin/rk3588_ddr_lp4_2112MHz_lp5_2400MHz_v1.18.bin
38+
install:
39+
- |
40+
mkdir -p /rootfs/artifacts/arm64/u-boot/rock5a
41+
cp u-boot-rockchip.bin /rootfs/artifacts/arm64/u-boot/rock5a
42+
finalize:
43+
- from: /rootfs
44+
to: /rootfs

artifacts/rock5a/vars.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# renovate: datasource=docker versioning=docker depName=cgr.dev/chainguard/wolfi-base
2+
WOLFI_BASE_REF: sha256:8dd9ceace8b1574e550374e9c07c2baafa60cc96223c1314fac61bd2edb48c70

go.work

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ use (
1111
./installers/rockpi4c/src
1212
./installers/rock4cplus/src
1313
./installers/rock4se/src
14+
./installers/rock5a/src
1415
./installers/rock5b/src
1516
./installers/turingrk1/src
1617
)

installers/pkg.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ dependencies:
1212
- stage: rockpi4c
1313
- stage: rock4cplus
1414
- stage: rock4se
15+
- stage: rock5a
1516
- stage: rock5b
1617
- stage: turingrk1
1718
- stage: profiles
@@ -35,6 +36,8 @@ dependencies:
3536
platform: linux/arm64
3637
- stage: u-boot-rock4se
3738
platform: linux/arm64
39+
- stage: u-boot-rock5a
40+
platform: linux/arm64
3841
- stage: u-boot-rock5b
3942
platform: linux/arm64
4043
- stage: u-boot-turingrk1
@@ -79,6 +82,10 @@ dependencies:
7982
platform: linux/arm64
8083
from: /dtb/rockchip/rk3399-rock-4se.dtb
8184
to: /rootfs/artifacts/arm64/dtb/rockchip/rk3399-rock-4se.dtb
85+
- image: "{{ .BUILD_ARG_PKGS_PREFIX }}/kernel:{{ .BUILD_ARG_PKGS }}"
86+
platform: linux/arm64
87+
from: /dtb/rockchip/rk3588s-rock-5a.dtb
88+
to: /rootfs/artifacts/arm64/dtb/rockchip/rk3588s-rock-5a.dtb
8289
- image: "{{ .BUILD_ARG_PKGS_PREFIX }}/kernel:{{ .BUILD_ARG_PKGS }}"
8390
platform: linux/arm64
8491
from: /dtb/rockchip/rk3588-rock-5b.dtb

installers/rock5a/pkg.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: rock5a
2+
variant: scratch
3+
shell: /toolchain/bin/bash
4+
dependencies:
5+
- stage: base
6+
steps:
7+
- env:
8+
GOPATH: /go
9+
cachePaths:
10+
- /.cache/go-build
11+
- /go/pkg
12+
build:
13+
- |
14+
export PATH=${PATH}:${TOOLCHAIN}/go/bin
15+
16+
cd /pkg/src
17+
CGO_ENABLED=0 go build -o ./rock5a .
18+
install:
19+
- |
20+
mkdir -p /rootfs/installers/
21+
22+
cp /pkg/src/rock5a /rootfs/installers/rock5a
23+
finalize:
24+
- from: /rootfs
25+
to: /rootfs

installers/rock5a/src/go.mod

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
module rock5a
2+
3+
go 1.23.0
4+
5+
require (
6+
github.com/siderolabs/go-copy v0.1.0
7+
github.com/siderolabs/talos/pkg/machinery v1.8.3
8+
golang.org/x/sys v0.27.0
9+
)
10+
11+
require gopkg.in/yaml.v3 v3.0.1 // indirect

0 commit comments

Comments
 (0)