@@ -234,6 +234,13 @@ Notes:
ENABLE_UPSTREAM_RKNPU = "1"
+ in the configuration (e.g. conf/local.conf). It only takes effect on
+ machines whose MACHINE_FEATURES contain "rknpu", which the RK3588(S)
+ include sets, so it is safe to set for a multi-machine build. A board
+ whose Device Tree does not declare the NPU can opt out with:
+
+ MACHINE_FEATURES:remove = "rknpu"
+
This requires a kernel driver (CONFIG_DRM_ACCEL_ROCKET, v6.18+) and
RKNN Device Tree nodes
(e.g. https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=640366d644b1e282771a09c72be37162b6eda438).
@@ -20,3 +20,6 @@ TFA_PLATFORM = "rk3588"
TFA_BUILD_TARGET = "bl31"
ENABLE_STATELESS_VPU_GST ?= "1"
+
+# NPU supported by the upstream Rocket driver (see ENABLE_UPSTREAM_RKNPU)
+MACHINE_FEATURES += "rknpu"
@@ -1,6 +1,8 @@
# meta-rockchip default settings
MACHINEOVERRIDES =. "${@bb.utils.contains('ROCKCHIP_CLOSED_TPL', '1', 'closed-tpl:', '', d)}"
MACHINEOVERRIDES =. "rockchip:"
+# 'rknpu' marks an NPU supported by the upstream Rocket driver
+MACHINEOVERRIDES .= "${@bb.utils.contains('MACHINE_FEATURES', 'rknpu', ':rknpu', '', d)}"
# kernel
# RK_KERNEL_FITIMAGE needs to be set before the next "require ..."
@@ -12,7 +12,7 @@ PACKAGECONFIG:append:rockchip = "${@bb.utils.contains('MALI_DRIVER', 'panfrost',
# Enable teflon for upstream RKNPU/rocket support
# Requires CONFIG_DRM_ACCEL_ROCKET in Linux kernel to actually work
-PACKAGECONFIG:append:rk3588s = "${@' teflon rocket' if bb.utils.to_boolean(d.getVar('ENABLE_UPSTREAM_RKNPU'), False) else ''}"
+PACKAGECONFIG:append:rknpu = "${@' teflon rocket' if bb.utils.to_boolean(d.getVar('ENABLE_UPSTREAM_RKNPU'), False) else ''}"
# Mali Gen10 (Valhall, supported by Panthor) requires a firmware blob
RRECOMMENDS:mesa-megadriver:append:rk3588s = " linux-firmware-mali-csffw-arch108"
@@ -37,4 +37,4 @@ SRC_URI:append:nanopi-r4s = " file://realtek-r8169.cfg"
KERNEL_FEATURES:append:rockchip = " bsp/rockchip/lttng.scc"
KERNEL_FEATURES:append:rockchip:arm = " bsp/rockchip/remove-non-rockchip-arch-arm.scc"
KERNEL_FEATURES:append:rockchip:aarch64 = " bsp/rockchip/remove-non-rockchip-arch-arm64.scc"
-KERNEL_FEATURES:append:rockchip = "${@' bsp/rockchip/rocket-npu.scc' if bb.utils.to_boolean(d.getVar('ENABLE_UPSTREAM_RKNPU'), False) else ''}"
+KERNEL_FEATURES:append:rknpu = "${@' bsp/rockchip/rocket-npu.scc' if bb.utils.to_boolean(d.getVar('ENABLE_UPSTREAM_RKNPU'), False) else ''}"
ENABLE_UPSTREAM_RKNPU added the NPU kernel fragment on every rockchip machine, so setting it for a multi-machine build made the kernel config audit warn on all those whose NPU the driver does not support. The RK3588(S) include now declares an "rknpu" machine feature, which becomes a machine override under which the kernel and mesa additions apply. The knob is then safe to set in local.conf, a board can opt out with MACHINE_FEATURES:remove, and supporting another SoC only needs the feature added to its include. Cc: Quentin Schulz <quentin.schulz@cherry.de> AI-Generated: codex/claude-opus 5.5 (xhigh) Signed-off-by: Trevor Woerner <twoerner@gmail.com> --- changes in v2: - replace the rk3588s override with an "rknpu" machine feature, so neither the kernel nor the mesa line names an SoC; v1 was "kernel: only add the rocket NPU fragment on rk3588s" - document in the README that the knob may go in local.conf --- README | 7 +++++++ conf/machine/include/rk3588s.inc | 3 +++ conf/machine/include/rockchip-defaults.inc | 2 ++ recipes-graphics/mesa/mesa.bbappend | 2 +- recipes-kernel/linux/linux-rockchip.inc | 2 +- 5 files changed, 14 insertions(+), 2 deletions(-)