Commit Graph

165 Commits

Author SHA1 Message Date
Trevor Woerner
fe7cfa748b fitimage rework
oe-core has completely re-written the fitImage support starting roughly at
commit [1], update meta-rockchip to match.

Most of the MACHINEs in meta-rockchip use a fitImage for the kernel, but
some don't. Create a boolean variable (RK_KERNEL_FITIMAGE), enabled by
default, to keep track of which ones do and which ones don't. Use this
variable to decide how to configure various image-related fields.

Build tested with all meta-rockchip MACHINEs both with and without RAUC.

Run tested on the following with RAUC configured:
	- nanopi-m4b
	- nanopi-r2s
	- radxa-zero-3e
	- rock-pi-4b
	- rock-pi-e
	- rock-pi-s

Run tested on the following without RAUC:
	- radxa-zero-3e
	- rock-pi-e
	- rock-pi-s

[1] oe-core: 3442d9297dca ("oe-selftest: fitimage: test external dtb")
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
Signed-off-by: Trevor Woerner <twoerner@gmail.com>
2025-06-27 10:52:37 -04:00
Trevor Woerner
961768ccd1 layer.conf: update for whinlatter
Signed-off-by: Trevor Woerner <twoerner@gmail.com>
2025-06-20 10:18:15 -04:00
Trevor Woerner
08f9c34e10 layer.conf: update to walnascar only
The next patch (involving changes for radxa-zero-3) only applies to master
(walnascar) and not styhead.

Signed-off-by: Trevor Woerner <trevor.woerner@amd.com>
2024-12-15 23:10:47 -05:00
Trevor Woerner
fcaa154e82 radxa-zero-3: switch to yocto-dev kernel
The radxa-zero-3{e|w} devices are not supported in the current yocto kernel,
but they are supported in the yocto-dev kernel. Switch to yocto-dev until
support is available in the yocto kernel.

Reported-by: Oleksii Kurochko<oleksii.kurochko@gmail.com>
Reviewed-by: Oleksii Kurochko<oleksii.kurochko@gmail.com>
Signed-off-by: Trevor Woerner <trevor.woerner@amd.com>
2024-12-15 23:07:28 -05:00
Trevor Woerner
5958fb41f7 rk3308: add provider for trusted firmware-a
A PREFERRED_PROVIDER entry was missed for rk3308 builds:

	NOTE: Multiple providers are available for trusted-firmware-a (rk3308-rkbin, rockchip-rkbin-tf-a)
	Consider defining a PREFERRED_PROVIDER entry to match trusted-firmware-a

This allows the RKBIN_RK3308_LATEST knob to work in all cases again.

Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
Signed-off-by: Trevor Woerner <trevor.woerner@amd.com>
2024-12-15 22:42:58 -05:00
Paul M. B. Bendixen
3a8be31581 SOQuartz: add
The SOQuartz is a RK3566 based compute module and parts of Quartz64 series
The Model-A base board is one possible board that supports it

Website:
	https://pine64.org/devices/soquartz/
Wiki:
	https://wiki.pine64.org/wiki/SOQuartz

Specs:
- Rockchip RK3566 Quad-core ARM Cortex-A55@1.8GHz
- Mali-G52 2EE Bifrost GPU@800MHz
- Raspberry Pi 4 CM form factor
- RAM Memory Variants: 2GB, 4GB, 8GB LPDDR4.
- optional eMMC from 8GB to 128GB
- optional 128Mb SPI Flash
- 10/100/1000Mbps Ethernet
- WiFi 802.11 b/g/n/ac with Bluetooth 5.0

Exposed preripherals:
- 1x HDMI
- 2x DSI
- 1x eDP
- 1x LVDS
- 1x CSI 4-line
- 1x Ethernet
- 1x USB 2.0 OTG
- 1x SD
- 1x PCIe 1-line
- 28x GPIO

Model-A baseboard:
- 1x microSD - bootable
- 1x HDMI Port
- 2x USB A 2.0 Host
- 1x USB C 2.0 Host
- 1x 5 pin USB expansion
- 1x Ethernet w. PoE
- 1x 40 pole Pi2 compatible GPIO
- 1x MiPi-CSI 2 lanes
- 1x MiPi-CSI 4 lanes
- 1x MiPi-DSI 2 lanes
- 1x MiPi-DSI 4 lanes
- 1x PCIe open ended

Reviewed-by: Trevor Woerner <twoerner@gmail.com>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
Signed-off-by: Paul M. B. Bendixen <pbe@trifork.com>
2024-11-21 13:39:35 -05:00
Quentin Schulz
f895d0c1e2 rk3588(s): add support for upstream TF-A
Upstream TF-A > 2.11 (no release available yet) has initial support for
the RK3588 (and thus RK3588S).

This was boot tested on an RK3588 Jaguar, the modified baudrate is taken
into account as well.

Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
2024-11-01 14:51:31 -04:00
Quentin Schulz
67aeda3896 rk356x: add support for upstream TF-A
Upstream TF-A > 2.11 (no release available yet) has initial support for
the RK3566 and RK3568. They both share the same code base.

This was not tested as I do not own RK356x boards.

Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
2024-11-01 14:51:31 -04:00
Quentin Schulz
e2d1876f02 bsp: rkbin: split optee-os, tf-a and ddr init from rkbin into separate recipes
Having one common recipe for optee-os, TF-A and DDR init blobs coming
from rkbin is nice for maintenance but it doesn't allow for having e.g.
TF-A come from another recipe and optee-os and DDR init from this one.

Now that upstream TF-A has initial support for RK356x and RK3588, but
there's still no open OP-TEE OS or DDR init, it'd be nice to allow users
to have upstream TF-A.

Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
2024-11-01 14:51:18 -04:00
Martin Jansa
74aec6e83d layer.conf: Update to styhead release name series
oe-core switched to styhead only in:
https://git.openembedded.org/openembedded-core/commit/?h=styhead&id=b4cf6d5236a3eacaf56ca2f805b006efac65b26c

Signed-off-by: Martin Jansa <martin.jansa@gmail.com>
2024-09-06 14:39:38 -04:00
Quentin Schulz
91a694e250 enable HW VPU decoding for SoCs that have stateless VPUs
v4l2codecs is the gstreamer plugin for V4L2 stateless video hardware
decoding. The Rockchip SoCs that have a VPU all seems to be based on
Hantro, RKVDEC or RKVDECv2, all stateless encoding/decoding VPUs.

Therefore, let's enable VPU decoding in Gstreamer whenever possible,
when the SoC supports it.

PX30, RK3066, RK3188, RK3288, RK3328, RK3399, RK356x and RK3588(s) all
have at least one Hantro VPU.

RK3328, RK3399, RK356x and RK3588(s) all have at least one
RKVDEC/RKVDECv2 VPU (though not necessarily supported in the upstream
kernel just yet).

=== PX30
Tested on PX30 Ringneck with with Haikou+Haikou Video Demo adapter:

$ gst-launch-1.0 filesrc location=$FILE ! parsebin ! v4l2slh264dec ! waylandsink

with FILE storing the path to any h264 file, e.g.
https://download.blender.org/peach/bigbuckbunny_movies/big_buck_bunny_720p_h264.mov
https://download.blender.org/peach/bigbuckbunny_movies/big_buck_bunny_1080p_h264.mov

Needed packages are:
- weston
- gstreamer1.0-plugins-bad (for waylandsink and v4l2slh264dec)
- gstreamer1.0-plugins-base (for parsebin)

A few frames are dropped every other second for 1080p but otherwise
smooth.

=== RK3399
Tested on RK3399 Puma with Haikou:

$ gst-launch-1.0 filesrc location=$FILE ! parsebin ! v4l2slh264dec ! waylandsink

with FILE storing the path to any h264 file, e.g.
https://download.blender.org/peach/bigbuckbunny_movies/big_buck_bunny_1080p_h264.mov
https://download.blender.org/demo/movies/BBB/bbb_sunflower_2160p_30fps_normal.mp4.zip

Needed packages are:
- weston
- gstreamer1.0-plugins-bad (for waylandsink and v4l2codecs)
- gstreamer1.0-plugins-base (for parsebin)

=== RK3588

Tested on a RK3588 Tiger with Haikou+Haikou Video Demo adapter - on a
downstream v6.6 (upstream-based, not Rockchip BSP-based) with DSI
patches - :

$ gst-launch-1.0 filesrc location=$FILE ! parsebin ! v4l2slav1dec ! fakesink

with FILE storing the path to any AV1 file, e.g.
http://download.opencontent.netflix.com.s3.amazonaws.com/AV1/cmaf/spark-8b-59.94fps/spark_606kbps_432p.mp4
https://woolyss.com/f/av1-nosound-chimera.mp4
https://woolyss.com/f/av1-opus-sita.webm

Needed packages are:
- gstreamer1.0-plugins-bad (for fakesink and v4l2slav1dec)
- gstreamer1.0-plugins-base (for parsebin)

For some reason though, waylandsink is very choppy. Combining
fpsdisplaysink with fakesink shows a ~60fps when decoding the 432p file,
~24fps for the two others.
Note that 10b-depth isn't supported (at least in my setup).

Reviewed-by: Trevor Woerner <twoerner@gmail.com>
Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
2024-08-29 19:27:56 -04:00
Trevor Woerner
ea72b22f53 rauc demo: add
Add an example of implementing rauc on a rockchip board. Adding the meta-rauc
layer, adding 'rauc' to DISTRO_FEATURES, and enabling RK_RAUC_DEMO will build
an image using the example provided in dynamic-layers/rk-rauc-demo.

This example uses a simple A/B + D scheme (i.e. two root partitions and a
non-updated /data partition). Repartitioning occurs automatically on first
boot thanks to systemd's 'repart' mechanism.

NOTE:
- this example only works with systemd

If you wish to provide your own implementation, simply add the meta-rauc
layer, add 'rauc' to DISTRO_FEATURES, don't enable RK_RAUC_DEMO, and provide
your own implementation in a separate layer.

Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
Signed-off-by: Trevor Woerner <twoerner@gmail.com>
2024-06-27 09:12:40 -04:00
Trevor Woerner
aefc2bf345 radxa-zero-3w: add
The Radxa ZERO 3e is an ultra-small, high-performance single board computer
based on the Rockchip RK3566, with a compact form factor, and rich interfaces.

	http://radxa.com/products/zeros/zero3w/

tech specs:
- Rockchip RK3566 (4x Arm Cortex-A55 @ 1.6GHz)
- Arm Mali-G52-2EE (OpenGL ES 1.1/2.0/3.0/3.1/3.2, Vulkan 1.1, OpenCL 2.0)
- LPDDR4 RAM (1/2/3/8 GB)
- µSD
- optional onboard eMMC (8/16/32/64 GB)
- IEEE 802.11 b/g/n/ac/ax(WiFi6), BT5.4 with BLE
- 1x USB 2.0 Type C OTG, 1x USB 3.0 Type C Host
- 1x µHDMI (1080p @ 60fps)
- 1x MIPI CSI camera port
- colour-coded 40-pin GPIO (uart, spi, i2c, pcm/i2s, pwm, gpio)
- 72mm x 30mm

Signed-off-by: Trevor Woerner <twoerner@gmail.com>
2024-06-14 10:13:29 -04:00
Trevor Woerner
ce59a4e3b8 radxa-zero-3e: add
The Radxa ZERO 3e is an ultra-small, high-performance single board computer
based on the Rockchip RK3566, with a compact form factor, and rich interfaces.

	http://radxa.com/products/zeros/zero3e/

tech specs:
- Rockchip RK3566 (4x Arm Cortex-A55 @ 1.6GHz)
- Arm Mali-G52-2EE (OpenGL ES 1.1/2.0/3.0/3.1/3.2, Vulkan 1.1, OpenCL 2.0)
- LPDDR4 RAM (1/2/3/8 GB)
- µSD
- GbE
- 1x USB 2.0 Type C OTG, 1x USB 3.0 Type C Host
- 1x µHDMI (1080p @ 60fps)
- 1x MIPI CSI camera port
- colour-coded 40-pin GPIO (uart, spi, i2c, pcm/i2s, pwm, gpio)
- 72mm x 30mm

NOTE: currently support for this board requires a U-Boot fork for the
bootloader, and linux-next for the kernel. Support will probably come in linux
kernel 6.11-ish, at which point U-Boot will then use that kernel's device tree
which means U-Boot support will come after the release of whichever kernel
includes support for this board.

Signed-off-by: Trevor Woerner <twoerner@gmail.com>
2024-06-14 10:13:29 -04:00
Trevor Woerner
bdba46b6c8 user-selectable wic compression
For boards which build and boot wic images, the user can optionally specify
a compression using the WIC_COMPRESSION_EXTENSION variable. By default "wic"
images are built, but if the user would prefer, say "wic.xz" images, simply
specify:

	WIC_COMPRESSION_EXTENSION = ".xz"

in the configuration (e.g. conf/local.conf).

Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
Signed-off-by: Trevor Woerner <twoerner@gmail.com>
2024-06-12 09:18:40 -04:00
Quentin Schulz
4e65ccbecd machine: rk3588/rk3588s: mark all machines as to be using the closed TPL
This will be useful once we migrate the U-Boot recipe to use this new
override.

Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
2024-06-06 13:20:19 -04:00
Quentin Schulz
b49aeb46db machine: rk3568: mark all machines as to be using the closed TPL
This will be useful once we migrate the U-Boot recipe to use this new
override.

Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
2024-06-06 13:20:19 -04:00
Quentin Schulz
76f6663f7a machine: rk3308: mark all machines as to be using the closed TPL
This will be useful once we migrate the U-Boot recipe to use this new
override.

Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
2024-06-06 13:20:19 -04:00
Quentin Schulz
dc831d9733 machine: rockchip-defaults: conditionally add closed-tpl MACHINEOVERRIDES
This adds closed-tpl to MACHINEOVERRIDES if ROCKCHIP_CLOSED_TPL is set
to 1. This is a way to tell U-Boot that it needs to fetch the TPL from
some place instead of building it. This will allow us to have a common
logic in U-Boot, and also avoid touching the U-Boot recipe to add
support for a new SoC.

As there may be a transition phase during which we still have closed TPL
by default but an open-source implementation exists, let's make it a
weak assignment so it can be overridden from higher configuration files.

Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
2024-06-06 13:20:19 -04:00
Quentin Schulz
035690ba9d rk3308: move rockchip-rkbin selection to SoC conf file
The mechanism remains the same, except that everything that requires
rockchip-rkbin doesn't need to know that rk3308 boards would prefer the
rk3308-rkbin instead, it's abstracted by the PREFERRED_PROVIDER
mechanism by BitBake.

Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
2024-06-06 13:20:19 -04:00
Quentin Schulz
50fdb975cf add rockchip MACHINEOVERRIDES
Add "rockchip" to the MACHINEOVERRIDES so that it can be used to easily
identify things that apply only to Rockchip-based devices and keeping
other devices untouched.

Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
2024-06-06 13:20:19 -04:00
Quentin Schulz
5291187998 rk3288: fix MACHINEOVERRIDES order
The SOC_FAMILY OVERRIDES should come after the TUNE one, so it needs to
be defined before.

before:
MACHINEOVERRIDES="rk3288:armv7ve:vyasa-rk3288"
after:
MACHINEOVERRIDES="armv7ve:rk3288:vyasa-rk3288"

Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
2024-06-06 13:20:18 -04:00
Quentin Schulz
6bf4054599 rk3188: fix MACHINEOVERRIDES order
The SOC_FAMILY OVERRIDES should come after the TUNE one, so it needs to
be defined before.

before:
MACHINEOVERRIDES="rk3188:armv7a:radxarock"
after:
MACHINEOVERRIDES="armv7a:rk3188:radxarock"

Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
2024-06-06 13:20:18 -04:00
Quentin Schulz
49ec226dc0 rk3066: fix MACHINEOVERRIDES order
The SOC_FAMILY OVERRIDES should come after the TUNE one, so it needs to
be defined before.

before:
MACHINEOVERRIDES="rk3066:armv7a:marsboard-rk3066"
after:
MACHINEOVERRIDES="armv7a:rk3066:marsboard-rk3066"

Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
2024-06-06 13:20:18 -04:00
Quentin Schulz
d4f5eecddb rk3588/rk3588s: add SOC_FAMILY
This adds an SOC_FAMILY for rk3588 and rk3588s.

Note that we are NOT "require"'ing conf/machine/include/soc-family.inc
so SOC_FAMILY is just another BitBake variable. If we were to require
this file, it would break the MACHINEOVERRIDES order, so some more
changes would be required to handle those properly.

Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
2024-06-06 13:20:18 -04:00
Quentin Schulz
3381d6af6e rockchip-extlinux.inc: fix non-fit KERNEL_IMAGETYPE image boot
On systems where KERNEL_IMAGETYPE is not set to fitImage, one needs to
either pass an DTB or a path to a directory where DTBs are located on
the rootfs.

When FDT property in extlinux is provided, FDTDIR isn't used (and
actually u-boot-extlinux-config doesn't even write it to the
configuration file).

When relative paths are used, they are relative to the directory where
extlinux.conf is stored[1]. Since the DTBs are stored in /boot, just
providing the filename of the DTB won't work because extlinux in U-Boot
will search for it in /boot/extlinux. We should therefore either use ../
prefix for relative paths or use /boot to make it absolute. /boot is
more explicit and easily parseable, so let's use the latter.

[1] https://wiki.syslinux.org/wiki/index.php?title=Config#Working_directory

Fixes: d80fa46c42 ("rockchip-extlinux.inc: handle multiple DTs in KERNEL_DEVICETREE")
Fixes: 3b51866f22 ("remove /boot partition")
Fixes: 13316b7968 ("KERNEL_DEVICETREE: 32-bit re-org")
Reviewed-by: Trevor Woerner <twoerner@gmail.com>
Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
2024-05-30 10:10:30 -04:00
Quentin Schulz
cb3dedaede rockchip-extlinux.inc: add kernel and dtb packages to the image
If an image doesn't include kernel-modules, the kernel-image package
won't be installed by default. This means that no
kernel-image-${KERNEL_IMAGETYPE} package will be pulled in, resulting in
neither fitImage nor Image (or uImage, or zImage, or...) making it to
the filesystem, rendering the image non-bootable.

For non-fitImage scenarios, we currently expect DTB-less kernel images
(no bundle, like in uImage) so we also need to pull in the DTB via the
kernel-devicetree package.

Those packages used to be pulled in by the wic plugin through the
IMAGE_BOOT_FILES variable.

Reviewed-by: Trevor Woerner <twoerner@gmail.com>
Fixes: 3b51866f22 ("remove /boot partition")
Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
2024-05-26 09:35:04 -04:00
Quentin Schulz
d80fa46c42 rockchip-extlinux.inc: handle multiple DTs in KERNEL_DEVICETREE
KERNEL_DEVICETREE may contain more than one DTB, the first one being the
default one. Therefore, let's split on space first, to get the first DTB
before stripping the directory name from it.

This doesn't add support for creating multiple labels for each DTB in
KERNEL_DEVICETREE.

Reviewed-by: Trevor Woerner <twoerner@gmail.com>
Fixes: 3b51866f22 ("remove /boot partition")
Fixes: 13316b7968 ("KERNEL_DEVICETREE: 32-bit re-org")
Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
2024-05-26 09:34:54 -04:00
Trevor Woerner
27664598b8 specify root partition type
Specify the root partition's type according to the Discoverable Partitions
Specification:

	32-bit ARM: 69dad710-2ce4-4e3c-b16c-21a1d49abed3
	64-bit ARM: b921b045-1df0-41c3-af44-4c6f280d3fae

Link: https://uapi-group.org/specifications/specs/discoverable_partitions_specification/
Signed-off-by: Trevor Woerner <twoerner@gmail.com>
2024-05-26 09:31:57 -04:00
Trevor Woerner
840ebc5121 rename root partition
Rename the root partition to "rootfsA" in the off-chance the user may someday
be interested in implementing some sort of whole-partition update mechanism.

Signed-off-by: Trevor Woerner <twoerner@gmail.com>
2024-05-26 09:30:11 -04:00
Trevor Woerner
1f8a8d917b enable stored U-Boot environment
U-Boot has the ability to store its environment variables to a permanent
storage device. Whether or not it does so for any one specific device
depends on whatever settings are enabled in that specific device's
defconfig. In order to definitively configure U-Boot to be able to store
its environment into the device from which it boots, for any device
supported in this BSP, simply add the following to MACHINE_FEATURES:

	rk-u-boot-env

If enabled, there is now a second choice to make: should the build also
include the U-Boot environment in the image or not? The default environment,
as generated by U-Boot, can be included in the generated wic image. If it
is included, then flashing the image will also flash the default U-Boot
environment variables and settings, wiping out anything that might have been
there already. If it is not included then your device will either continue
using whatever environment happens to be there (if valid), or will not use any
stored environment if the stored environment has not been set or is invalid.
The variable which governs this behaviour is:

	RK_IMAGE_INCLUDES_UBOOT_ENV

By default this is set to "0", meaning that by default the image does not
contain the U-Boot environment. To enable this behaviour, enable this
variable. This variable only takes effect if rk-u-boot-env is listed in
MACHINE_FEATURES, and has no effect otherwise.

The script:

	scripts/dump-uboot-env-from-yocto-image.sh

can be used on a rockchip wic image to see the contents of the U-Boot
environment partition at build time.

Tested by booting the same image on both eMMC and SDcard with the following
devices, verifying the ability to read and write the U-Boot environment in
both U-Boot and Linux user-space, and that changes made in one are seen in the
other:
	rock-3a
	rock-5a
	rock-5b
	rock-pi-4b
	rock-pi-e
	rock64

Signed-off-by: Trevor Woerner <twoerner@gmail.com>
2024-05-23 15:47:18 -04:00
Trevor Woerner
06a65d47e3 rock-5[ab]: use regular yocto kernel
Upstream kernel support for both the rock-5a and rock-5b landed in version
6.5. Nanbield contained linux-yocto recipes for both 6.1 and 6.5 so it
was best to simply have these MACHINEs use linux-yocto-dev. Post-nanbield
oecore master only has a recipe for 6.6 (so far), therefore these two
MACHINEs can use linux-yocto by default, instead of linux-yocto-dev.

Signed-off-by: Trevor Woerner <twoerner@gmail.com>
2024-03-07 17:05:07 -05:00
Trevor Woerner
4ad1a1e868 layer.conf: update for scarthgap
Signed-off-by: Trevor Woerner <twoerner@gmail.com>
2024-02-29 23:50:33 -05:00
Trevor Woerner
3b51866f22 remove /boot partition
In order to boot successfully, most Rockchip SoCs require a specific
partitioning scheme which was defined many years (and many SoCs) ago. That
partitioning scheme places the SPL and U-Boot at specific offsets at the
start of the boot block device:

        https://opensource.rock-chips.com/wiki_Partitions

The Rockchip partitioning scheme goes on to also define the locations
of a number of additional partitions, including the "boot" and "root"
partitions.

Since both the SPL and U-Boot have already been placed on the block device,
the "boot" partition only contains the extlinux config file and the
kernel+dtb/fitImage; it doesn't contain any bootloader artifacts (other
than the extlinux config).

The location of the SPL partition is a hard dependency since the BOOTROM
etched inside the Rockchip SoCs is programmed to load and run a validated
binary it finds at this location. The locations of the "boot" and "root"
partitions are not so rigid since it is U-Boot which interacts with them.
U-Boot is very flexible with how it finds boot components, and in its
support for various devices, filesystems, sizes, etc.

Both oe-core's U-Boot metadata and wic's bootimg-partition script contain
logic to generate the extlinux pieces required for a bootloader to boot
a Linux system. If both are enabled, the wic pieces silently clobber the
U-Boot pieces. However, the mechanisms contained in the U-Boot metadata are
much more flexible, from a user's point of view, than the mechanisms in
wic's bootimg-partition.

If a user wishes to setup some sort of A/B redundant update mechanism, they
must have redundant root partitions (in order to update their filesystem
contents) but they also need to have redundant boot partitions if they
wish to update the kernel as part of their update mechanism. Pairing
redundant kernel partitions with redundant filesystem partitions becomes
unnecessarily complicated. Therefore it makes sense to combine the kernel
and the filesystem into the same partition so that both the kernel and
filesystem are updated, or rolled back, in lock-step as one unit. Specific
kernel versions and configurations often have dependencies on user-space
components and versions.

The /boot location is not going away. This patch simply transfers
responsibility for its creation to the more flexible U-Boot mechanism
and includes the kernel as part of the same partition as the root
filesystem. Not only does it add flexibility, it also makes update schemes
more straightforward. Although having a separate /boot partition is a
"requirement" of the Rockchip partitioning scheme, it is not an actual
hard requirement when using a flexible, open-source bootloader (such as
U-Boot) instead of using Rockchip's proprietary miniloader, preloader, and
trust.img.

Build-tested for all boards.
Run-tested on:
	nanopi-m4-2gb, nanopi-m4b, nanopi-r2s, nanopi-r4s, roc-rk3328-cc,
	rock-3a, rock-5a, rock-5b, rock-pi-4b, rock-pi-e, rock-pi-s,
	rock64

Reviewed-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Signed-off-by: Trevor Woerner <twoerner@gmail.com>
2024-02-26 10:27:30 -05:00
Trevor Woerner
2db9e63d8f allow user-provided WKS_FILE
Allow the user to provide their own WKS_FILE in situations where they want a
different layout (e.g. to support A/B updates).

Signed-off-by: Trevor Woerner <twoerner@gmail.com>
2024-01-29 21:44:26 -05:00
Trevor Woerner
13316b7968 KERNEL_DEVICETREE: 32-bit re-org
The upstream kernel reorganized the 32-bit arch/arm device-tree directory
structure to separate out the device-trees by manufacturer (similar to the
organization of the arch/arm64 device-trees). Update the references to
32-bit arm device-trees to match.

This patch can now be applied since all pre-6.5-rc1 kernels have been
removed from oe-core.

NOTE: trying to build a post-6.5-rc1 32-bit kernel with this patch applied
      will fail

Signed-off-by: Trevor Woerner <twoerner@gmail.com>
Signed-off-by: Stephen Chen <stephen@radxa.com>
2024-01-24 20:57:59 -05:00
Stephen Chen
f7f2878e02 rock-4c-plus: add
ROCK 4C Plus is a Rockchip RK3399-T based SBC from Radxa.

Specs:
- Rockchip RK3399-T, 2x Cortex-A72 @ 1.5GHz, 4x Cortex-A53@1GHz
- Mali T860MP4 GPU
- RaspberryPi 4 form factor
- 64bit LPDDR4
- eMMC
- Micro SD
- SPI Nor Flash
- Two Micro-HDMI (HDMI 4K and HDMI 2K)
- 4-lane MIPI DSI
- MIPI CSI
- GbE LAN with Power over Ethernet (PoE) support
- Wi-Fi 5 and BT5.0 wireless module
- 3.5mm headphone jack
- Four USB ports (two USB2.0 and two USB3.0)
- RTC
- LEDs
- Power button
- Pwm fan
- 40-pin color expansion header

https://wiki.radxa.com/Rock4/4cplus

Signed-off-by: Stephen Chen <stephen@radxa.com>
2024-01-20 16:20:37 -05:00
Trevor Woerner
3620d858ab rock-3a: add
The ROCK 3A has an rpi form factor and features:
- 4x Cortex-A55 ARM processor
- Mali G52 GPU
- 0.8TOPS NPU
- 32bit 3200Mb/s LPDDR4, up to 4K@60
- HDMI, MIPI DSI, MIPI CSI
- 3.5mm jack with mic
- USB Port
- GbE LAN
- PCIe 3.0, PCIe 2.0
- 40-pin color expansion header
- RTC
- supports USB PD and QC powering

https://wiki.radxa.com/Rock3/3a

Signed-off-by: Trevor Woerner <twoerner@gmail.com>
Signed-off-by: Anthony Davies <anthony.t.davies@gmail.com>
2024-01-20 16:20:37 -05:00
Abhisit Sangjan
959ba6dc52 orangepi-5-plus: add
The Orange Pi 5 Plus is an RK3588-based SBC featuring:
- Rockchip RK3588 4x Cortex-A76, 4x Cortex-A55
- Mali-G610
- 6TOPS NPU
- 2x 2.5G ethernet ports – onboard NIC connected to PCIe 2.0 interface
- 2x USB 2.0 host ports
- 2x USB 3.0 host ports (exposed over USB 3.0 hub)
- Type-C port featuring USB 2.0/3.0 and Alt-DP mode
- PCIe 2.0/USB 2.0/I2S/I2C/UART on E.KEY socket
- RTC
- ES8388 on-board sound codec – jack in/out, onboard mic, speaker amplifier
- SPI NOR flash
- RGB LED (R is always on)
- IR receiver
- PCIe 3.0 on the bottom for NVMe, etc.
- 40pin GPIO header (with gpio, I2C, SPI, PWM, UART)
- Power, recovery and Mask ROM buttons
- 2x HDMI out, 1x HDMI in
- Slots/connectors for eMMC, uSD card, fan, MIPI CSI/DSI
- 4 GB, 8 GB, 16 GB and 32 GB of RAM

http://www.orangepi.org/html/hardWare/computerAndMicrocontrollers/details/Orange-Pi-5-plus.html

Signed-off-by: Trevor Woerner <twoerner@gmail.com>
Signed-off-by: Abhisit Sangjan <abhisit.sangjan@gmail.com>
2024-01-20 16:20:37 -05:00
Trevor Woerner
09ead816cd roc-rk3308-cc: add
The T-Firefly ROC-RK3308-CC is a miniature and compact main board which is
equipped with a cost-effective RK3308 Core Processor and a high-performance
CODEC.

Features:
- Rockchip RK3308, 64-bit, quad-core, Arm Cortex-A35 processor @ 1.3GHz
- 100M ethernet
- PoE
- USB 2.0 and Type-C (OTG and power)
- 802.11 b/g/n WiFi and Bluetooth 4.2

https://en.t-firefly.com/product/rocrk3308cc

Signed-off-by: Trevor Woerner <twoerner@gmail.com>
2024-01-17 15:04:03 -05:00
Trevor Woerner
346a287ae2 roc-rk3328-cc: add
AKA the "renegade"

The ROC-RK3328-CC platform is built on the Rockchip RK3328 system-on-chip
optimized for low cost, low power, and high performance IO. It features a
high performance native USB 3.0 interface and Gigabit MAC.

Specs:
- RaspberryPi 2/3 form factor
- quad-core ARM Cortex-A53 @ 1.5GHz
- ARM Mali-450 MP2
- DDR4 RAM
- USB 3.0
- GbE MAC

https://libre.computer/products/roc-rk3328-cc/
https://wiki.t-firefly.com/ROC-RK3328-CC/intro.html

Signed-off-by: Trevor Woerner <twoerner@gmail.com>
2024-01-17 15:04:03 -05:00
Stephen Chen
655ba387b1 rock-5a: add
The Radxa ROCK 5 Model A is an SBC in roughly a RaspberryPi-ish form factor
packed with a wide range of class-leading functionality, features and
expansion options. The ROCK 5A board comes in several LPDDR4x RAM memory
options: 4GB, 8GB, 16GB, and 32GB.

It uses the Rockchip RK3588S SoC (quad A76 @ 2.2GHz + quad A55 @ 1.8GHz,
Mali G610mp4 GPU), has both 8k and 4k HDMI, Gb ethernet with PoE support,
USB2/3, M.2 E Key (NVMe or SATA), a 40-pin RaspberryPi-ish 3V3 GPIO header,
USB Type-C power, MIPI DSI/CSI, SDcard slot, optional eMMC, and more.

https://wiki.radxa.com/Rock5/5b
https://radxa.com/products/rock5/5a/

[
with the following tweaks by Trevor:
- switch to information URL to one that points to information in english
- improved the commit message
- add rock-5a to README
]

Signed-off-by: Stephen Chen <stephen@radxa.com>
Signed-off-by: Trevor Woerner <twoerner@gmail.com>
2023-12-18 17:32:43 -05:00
Anthony Davies
265e8c3df2 allow KERNEL_IMAGETYPE override
Update machine include files to allow overriding of KERNEL_IMAGETYPE.

[
with the following 2 tweaks by Trevor:
- remove the "v3" from the commit's subject
- extended patch to rk3308 and rk3588s, which were added in between this patch
  being submitted, and this patch being applied
]

Signed-off-by: Anthony Davies <anthony.t.davies@gmail.com>
Signed-off-by: Trevor Woerner <twoerner@gmail.com>
2023-11-16 17:34:24 -05:00
Trevor Woerner
3d91ea1db4 rock-pi-s: add
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 an 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).

The latest version of the binary ddr initializer code from rkbin does not
provide a uart0 option, therefore all diagnostic output from rkbin and u-boot
is lost on the console (and replaced with a stream of gibberish until the
Linux kernel starts). Therefore, by default, the build assumes the user would
prefer to see this information and have the option to interact with U-Boot,
which means an older version of rkbin is used. The user can override this
decision by setting:

	RKBIN_RK3308_LATEST = "1"

Signed-off-by: Trevor Woerner <twoerner@gmail.com>
2023-11-02 15:51:36 -04:00
Trevor Woerner
e628b72ed4 nanopi-m4b: add
NanoPi M4B is a RK3399-based (dual-core A72, quad-core A53 with NEON) board
in the same form factor as the RPi B3+ (including compatible connectors) with
onboard 2.4/5.0 dual-band WiFi + Bluetooth 5.0 with USB type-C power from
FriendlyElec.

https://www.friendlyelec.com/index.php?route=product/product&product_id=275

Signed-off-by: Trevor Woerner <twoerner@gmail.com>
2023-10-30 09:39:09 -04:00
Trevor Woerner
0bef49242f nanopi-r2s: add
The NanoPi R2S is a mini router with edge computing and dual GbE ports by
FriendlyElec. It is based on the Rockchip RK3328 - a quad A53 core, 64-bit SoC
running at 1.2GHz with at least 1GB of DDR4 RAM. It has one USB 2.0 host and
is powered via a USB type-C connector (5V/2A).

https://www.friendlyelec.com/index.php?route=product/product&product_id=282

Reviewed-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Signed-off-by: Trevor Woerner <twoerner@gmail.com>
2023-10-02 18:58:58 -04:00
Trevor Woerner
851a174649 rock-pi-e.conf: remove redundant MACHINEOVERRIDES
The MACHINE name is already added to the MACHINEOVERRIDES implicitly, no need
to add it explicitly.

Reviewed-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Signed-off-by: Trevor Woerner <twoerner@gmail.com>
2023-10-02 17:55:02 -04:00
Trevor Woerner
f8af59dd7c rock-5b: add
Add support for the Radxa Rock 5B
https://wiki.radxa.com/Rock5/5b

The device-tree for this board is better in the 6.5 (and later) kernels,
therefore set the kernel to linux-yocto-dev for now (eventually this won't be
needed as linux-yocto moves forward).

Unfortunately the TF-A project does not currently have support for
the rk3588. Therefore, for the time-being, the only way to supply a
TPL/DDR-init for the rk3588 is to use the closed-source rkbin binaries
from Rockchip. If/when TF-A adds support for the rk3588 we can investigate
switching.

The rk3588 comes in two variants: rk3588 and rk3588s. The "s" option is a
stripped-down version of the rk3588. In the Linux kernel these two SoCs are
kept separate, with the rk3588 building on the rk3588s, so we've mimicked that
same behaviour here.

Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Signed-off-by: Trevor Woerner <twoerner@gmail.com>
2023-09-29 09:00:24 -04:00
Trevor Woerner
3c678726a1 nanopi-r4s: add
Add a MACHINE definition for the FriendlyElec NanoPi R4S
https://www.friendlyelec.com/index.php?route=product/product&product_id=284

Include a device-tree patch to enable the 2nd PCIe ethernet.

Signed-off-by: Trevor Woerner <twoerner@gmail.com>
2023-09-21 22:48:41 -04:00
Trevor Woerner
dd1fc4abcf linux-yocto: remove non-rockchip archs
Remove the non-rockchip architectures from the kernel build since these are
all a waste of build time, filesystem space, and runtime memory.

Signed-off-by: Trevor Woerner <twoerner@gmail.com>
2023-09-16 07:38:36 -04:00