All of lore.kernel.org
 help / color / mirror / Atom feed
From: Trevor Woerner <twoerner@gmail.com>
To: yocto@lists.yoctoproject.org
Subject: [meta-rockchip][PATCH 3/3] rock-pi-s: add
Date: Sun,  1 Oct 2023 09:08:03 -0400	[thread overview]
Message-ID: <20231001130803.18662-4-twoerner@gmail.com> (raw)
In-Reply-To: <20231001130803.18662-1-twoerner@gmail.com>

ROCK Pi S is a Rockchip RK3308 based SBC from Radxa. It contains a 64-bit
quad core processor, USB, ethernet, wireless connectivity, and voice
detection engine in 1.7-inches square. The ROCK Pi S comes in two RAM sizes
256MB or 512MB DDR3, and uses sdmmc card for OS and storage. Optionally, some
versions of the ROCK Pi S provide on-board storage via 1Gb/2Gb/4Gb/8Gb of
SLC NAND flash.

"S" stands for "small square" since the total board size of the rock-pi-s is
1.7-inches square.

This BSP assumes booting from sdmmc, and using ttyS0 for the serial console
(similar to Raspberry Pi).

Signed-off-by: Trevor Woerner <twoerner@gmail.com>
---
 README                                      |  1 +
 conf/machine/include/rk3308.inc             | 18 ++++++++++++++++++
 conf/machine/rock-pi-s.conf                 | 11 +++++++++++
 recipes-bsp/rkbin/rockchip-rkbin_git.bb     | 17 +++++++++++++++++
 recipes-bsp/u-boot/u-boot%.bbappend         | 11 +++++++++++
 recipes-kernel/linux/linux-yocto_%.bbappend |  1 +
 6 files changed, 59 insertions(+)
 create mode 100644 conf/machine/include/rk3308.inc
 create mode 100644 conf/machine/rock-pi-s.conf

diff --git a/README b/README
index d4576d73c636..e815fb47ff5f 100644
--- a/README
+++ b/README
@@ -31,6 +31,7 @@ Status of supported boards:
 		firefly-rk3288
 		nanopi-r4s
 		rock-5b
+		rock-pi-s
 	builds:
 		marsboard-rk3066
 		radxarock
diff --git a/conf/machine/include/rk3308.inc b/conf/machine/include/rk3308.inc
new file mode 100644
index 000000000000..19cabafdfac0
--- /dev/null
+++ b/conf/machine/include/rk3308.inc
@@ -0,0 +1,18 @@
+SOC_FAMILY = "rk3308"
+
+DEFAULTTUNE ?= "cortexa35-crypto"
+
+require conf/machine/include/soc-family.inc
+require conf/machine/include/arm/armv8a/tune-cortexa35.inc
+require conf/machine/include/rockchip-defaults.inc
+require conf/machine/include/rockchip-wic.inc
+
+SERIAL_CONSOLES = "1500000;ttyS0"
+
+KBUILD_DEFCONFIG ?= "defconfig"
+KERNEL_FEATURES:append:rk3308 = " bsp/rockchip/remove-non-rockchip-arch-arm64.scc"
+KERNEL_CLASSES = "kernel-fitimage"
+KERNEL_IMAGETYPE = "fitImage"
+
+UBOOT_SUFFIX ?= "itb"
+UBOOT_ENTRYPOINT ?= "0x06000000"
diff --git a/conf/machine/rock-pi-s.conf b/conf/machine/rock-pi-s.conf
new file mode 100644
index 000000000000..79ea73c6b47e
--- /dev/null
+++ b/conf/machine/rock-pi-s.conf
@@ -0,0 +1,11 @@
+#@TYPE: Machine
+#@NAME: Radxa Rock Pi S
+#@DESCRIPTION: ROCK Pi S is a Rockchip RK3308 based SBC by Radxa. "S" stands for "small square"
+#https://wiki.radxa.com/RockpiS
+
+require conf/machine/include/rk3308.inc
+
+KERNEL_DEVICETREE = "rockchip/rk3308-rock-pi-s.dtb"
+MACHINE_EXTRA_RRECOMMENDS += "kernel-modules"
+
+UBOOT_MACHINE = "rock-pi-s-rk3308_defconfig"
diff --git a/recipes-bsp/rkbin/rockchip-rkbin_git.bb b/recipes-bsp/rkbin/rockchip-rkbin_git.bb
index 7fefb017053b..49e1e682eb7d 100644
--- a/recipes-bsp/rkbin/rockchip-rkbin_git.bb
+++ b/recipes-bsp/rkbin/rockchip-rkbin_git.bb
@@ -1,9 +1,12 @@
 DESCRIPTION = "Rockchip Firmware and Tool Binaries"
 LICENSE = "Proprietary"
+LICENSE:rk3308 = "CLOSED"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=15faa4a01e7eb0f5d33f9f2bcc7bff62"
+LIC_FILES_CHKSUM:rk3308 = "file://README;md5=39cc9df955478b8df26158d489fdcc95"
 
 SRC_URI = "git://github.com/rockchip-linux/rkbin;protocol=https;branch=master"
 SRCREV = "b4558da0860ca48bf1a571dd33ccba580b9abe23"
+SRCREV:rk3308 = "e65b97b511f1349156702db40694454c141d8fe2"
 
 PROVIDES += "trusted-firmware-a"
 PROVIDES += "optee-os"
@@ -14,6 +17,7 @@ S = "${WORKDIR}/git"
 
 COMPATIBLE_MACHINE = ""
 COMPATIBLE_MACHINE:rk3588s = "rk3588s"
+COMPATIBLE_MACHINE:rk3308 = "rk3308"
 
 PACKAGE_ARCH = "${MACHINE_ARCH}"
 
@@ -26,6 +30,19 @@ PACKAGES = "${PN}"
 ALLOW_EMPTY:${PN} = "1"
 
 do_deploy() {
+	:
+}
+
+do_deploy:append:rk3308() {
+	# Prebuilt TF-A
+	install -m 644 ${S}/bin/rk33/rk3308_bl31_v*.elf ${DEPLOYDIR}/bl31-rk3308.elf
+	# Prebuilt OPTEE-OS
+	install -m 644 ${S}/bin/rk33/rk3308_bl32_v*.bin ${DEPLOYDIR}/tee-rk3308.bin
+	# prebuilt tpl
+	install -m 644 ${S}/bin/rk33/rk3308_ddr_589MHz_uart0_m0_v*.bin ${DEPLOYDIR}/ddr-rk3308.bin
+}
+
+do_deploy:append:rk3588s() {
 	# Prebuilt TF-A
 	install -m 644 ${S}/bin/rk35/rk3588_bl31_v*.elf ${DEPLOYDIR}/bl31-rk3588.elf
 	# Prebuilt OPTEE-OS
diff --git a/recipes-bsp/u-boot/u-boot%.bbappend b/recipes-bsp/u-boot/u-boot%.bbappend
index e79c471cf5ce..54f0b7406dd7 100644
--- a/recipes-bsp/u-boot/u-boot%.bbappend
+++ b/recipes-bsp/u-boot/u-boot%.bbappend
@@ -1,8 +1,13 @@
+SRCREV:rk3308 = "2173c4a990664d8228d4dadd814bd64fdc12948f"
+SRC_URI:rk3308 = "git://source.denx.de/u-boot/u-boot.git;protocol=https;branch=master"
+
 # various machines require the pyelftools library for parsing dtb files
 DEPENDS:append = " python3-pyelftools-native"
+DEPENDS:append:rk3308 = " u-boot-tools-native"
 DEPENDS:append:rock-pi-4 = " gnutls-native"
 
 EXTRA_OEMAKE:append:px30 = " BL31=${DEPLOY_DIR_IMAGE}/bl31-px30.elf"
+EXTRA_OEMAKE:append:rk3308 = " BL31=${DEPLOY_DIR_IMAGE}/bl31-rk3308.elf"
 EXTRA_OEMAKE:append:rk3328 = " BL31=${DEPLOY_DIR_IMAGE}/bl31-rk3328.elf"
 EXTRA_OEMAKE:append:rk3399 = " BL31=${DEPLOY_DIR_IMAGE}/bl31-rk3399.elf"
 EXTRA_OEMAKE:append:rk3588s = " \
@@ -12,6 +17,7 @@ EXTRA_OEMAKE:append:rk3588s = " \
 
 INIT_FIRMWARE_DEPENDS ??= ""
 INIT_FIRMWARE_DEPENDS:px30 = " trusted-firmware-a:do_deploy"
+INIT_FIRMWARE_DEPENDS:rk3308 = " rockchip-rkbin:do_deploy"
 INIT_FIRMWARE_DEPENDS:rk3328 = " trusted-firmware-a:do_deploy"
 INIT_FIRMWARE_DEPENDS:rk3399 = " trusted-firmware-a:do_deploy"
 INIT_FIRMWARE_DEPENDS:rk3588s = " rockchip-rkbin:do_deploy"
@@ -23,3 +29,8 @@ do_compile:append:rock2-square () {
 		cp ${B}/spl/${SPL_BINARY} ${B}
 	fi
 }
+
+do_compile:append:rk3308() {
+	mkimage -n rk3308 -T rksd -d ${DEPLOY_DIR_IMAGE}/ddr-rk3308.bin ${B}/idbloader.img
+	cat ${B}/spl/u-boot-spl.bin >> ${B}/idbloader.img
+}
diff --git a/recipes-kernel/linux/linux-yocto_%.bbappend b/recipes-kernel/linux/linux-yocto_%.bbappend
index 53833f1cc3f4..61c89f70d8dc 100644
--- a/recipes-kernel/linux/linux-yocto_%.bbappend
+++ b/recipes-kernel/linux/linux-yocto_%.bbappend
@@ -13,6 +13,7 @@ COMPATIBLE_MACHINE:nanopi-m4-2gb = "nanopi-m4-2gb"
 COMPATIBLE_MACHINE:rock64 = "rock64"
 COMPATIBLE_MACHINE:rock-pi-e = "rock-pi-e"
 COMPATIBLE_MACHINE:nanopi-r4s = "nanopi-r4s"
+COMPATIBLE_MACHINE:rock-pi-s = "rock-pi-s"
 
 SRC_URI:append = " file://rockchip-kmeta;type=kmeta;name=rockchip-kmeta;destsuffix=rockchip-kmeta"
 SRC_URI:append:nanopi-r4s = " file://nanopi-r4s.scc"
-- 
2.41.0.327.gaa9166bcc0ba



  parent reply	other threads:[~2023-10-01 13:08 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-01 13:08 [meta-rockchip][PATCH 0/3] rock-pi-s Trevor Woerner
2023-10-01 13:08 ` [meta-rockchip][PATCH 1/3] u-boot: cleanup Trevor Woerner
2023-10-02 16:07   ` [yocto] " Quentin Schulz
2023-10-01 13:08 ` [meta-rockchip][PATCH 2/3] rock-pi-e.conf: remove redundant MACHINEOVERRIDES Trevor Woerner
2023-10-02 16:07   ` [yocto] " Quentin Schulz
2023-10-02 21:55   ` Trevor Woerner
2023-10-01 13:08 ` Trevor Woerner [this message]
2023-10-02 16:17   ` [yocto] [meta-rockchip][PATCH 3/3] rock-pi-s: add Quentin Schulz
2023-10-03 13:56     ` Trevor Woerner
2023-10-04 14:23       ` Quentin Schulz
2023-10-30 17:26         ` Trevor Woerner
2023-11-02 10:52           ` Quentin Schulz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231001130803.18662-4-twoerner@gmail.com \
    --to=twoerner@gmail.com \
    --cc=yocto@lists.yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.