Commit Graph

19 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
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
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
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
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
361f19c3d4 rockchip-defaults: remove xf86-input-keyboard
xf86-input-keyboard was removed from openembedded-core at its commit:
f1d7c33b64 (xf86-input-keyboard: remove the recipe, 2022-07-20). Therefore
remove it from the XSERVER definition.

Reviewed-by: Quentin Schulz <foss+yocto@0leil.net>
Signed-off-by: Trevor Woerner <twoerner@gmail.com>
2022-11-21 14:23:58 -05:00
Trevor Woerner
6fed2791f1 override syntax fixup
The _virtual notation is not an override. These syntax "fixes" need to be
reverted.

In the case of the kernel override, when it was added, the rock-pi-e needed
the latest kernel (linux-yocto-dev) but now the default linux-yocto kernel
will suffice. So this mistake actually switched the rock-pi-e from
linux-yocto-dev back to linux-yocto inadvertently but at a time when
linux-yocto-dev was no longer required.

In the case of the bootloader overrides, u-boot was always the default, so
these overrides were always redundant.

Therefore, in the end, simply removing these overrides is the best way
forward (considering these aren't doing anything, and the builds are working
fine regardless).

Signed-off-by: Trevor Woerner <twoerner@gmail.com>
2021-12-13 17:32:36 -05:00
Trevor Woerner
335bfcbf8d switch to the new bitbake OVERRIDE syntax
With bitbake commit 7dcf317cc141dc980634f8c18bfa84f83e57206a
("bitbake: Switch to using new override syntax"), applied on
Aug 2, 2021, the OVERRIDE separator is now a colon instead of
an underscore. Therefore all builds performed with a bitbake
before this change must use a meta-rockchip commit before this
one, and any builds performed with a bitbake after this change
must use a meta-rockchip starting from this commit onwards.

Build-tested for all meta-rockchip MACHINEs.

Run tested on:
- tinker-board
- nanopi-m4-2gb
- rock64
- rock-pi-4b
- rock-pi-e

The tinker-board and rock-pi-e work fine. The rest of the boards
seem to have a, hopefully unrelated, issue running a
5.13-yocto-standard kernel. However, all boards work with the
5.10-yocto-standard kernel.

Signed-off-by: Trevor Woerner <twoerner@gmail.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2021-08-04 21:59:14 -04:00
Trevor Woerner
88a9704bd6 remove LINUX_VERSION_EXTENSION
Adding "-rockchip" to the Linux kernel name implies, to me anyway, that this
is a vendor kernel. The PREFERRED_PROVIDERs of all kernels specified in this
BSP are upstream linux-yocto kernels, not vendor kernels. Therefore remove the
version name extension to avoid confusion.

Signed-off-by: Trevor Woerner <twoerner@gmail.com>
2021-07-26 21:05:44 -04:00
Trevor Woerner
1b38edb292 IMAGE_FSTYPES: remove ext4
The ext4 IMAGE_FSTYPES does not need to be mentioned explicitly. It will be
automatically generated in cases where it is needed.

Signed-off-by: Trevor Woerner <twoerner@gmail.com>
2021-06-30 12:11:51 -04:00
Trevor Woerner
62d4201415 conf/machine/include/rockchip-wic.inc: create
Create a conf/machine/include/rockchip-wic.inc file to contain all the common
wic/wks things for easy inclusion by any MACHINEs that use wic for their image
creation.

NOTE: the wic image type of rock-pi-e changed from "wic.xz" to "wic" which
      matches all the other meta-rockchip MACHINEs that use wic

The following variables were checked before and after to make sure they remain
correct/sensible:
- IMAGE_FSTYPES
- WKS_FILE_DEPENDS
- IMAGE_BOOT_FILES
- RK_CONSOLE_BAUD
- RK_CONSOLE_DEVICE
- RK_BOOT_DEVICE
- SERIAL_CONSOLES
- WICVARS

Build-tested for all currently-defined MACHINEs.

Boot-tested on the following boards to make sure they continue to boot to a
console correctly (core-image-base):
- tinker-board
- rock64
- rock-pi-4b
- rock-pi-e
- nanopi-m4-2gb

Signed-off-by: Trevor Woerner <twoerner@gmail.com>
2021-06-28 11:13:21 -04:00
Trevor Woerner
8cd56cdcd8 console cleanup
Consolidate all the various console definitions to the common
conf/machine/include/rockchip-defaults.inc file and create
RK_CONSOLE_BAUD and RK_CONSOLE_DEVICE variables that can be
reused in the wks files.

The following variables were checked before and after this patch
to make sure they are sensible:
- SERIAL_CONSOLES
- RK_CONSOLE_DEVICE
- RK_CONSOLE_BAUD

A boot test was performed on the following boards to make sure
they all continue to boot to a cmdline:
- tinker-board
- rock-pi-e
- nanopi-m4-2gb
- rock64
- rock-pi-4b

Signed-off-by: Trevor Woerner <twoerner@gmail.com>
2021-06-27 14:43:56 -04:00
Joshua Watt
18b5329e2c Use linux-yocto kernel from OE-core
Updates all machines to use the linux-yocto kernel from OE-core instead
of maintaining distinct kernels in this repository.

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
2020-04-19 00:39:54 -04:00
Sergey 'Jin' Bostandzhyan
1aea373d88 Add configuration parameter to set boot device for the image
wic modifies /etc/fstab on the root file system during image generation,
without the --ondisk parameter it assumes some default device name which
leads to an /etc/fstab file populated with /dev/sda entries.
This is not correct for the machines in the rockchip layer which use
mmcblkX.

This patch introduces an RK_BOOT_DEVICE option which is being set in the
machine configuratoin and which is being used in the wks files.
The variable expansion in the wks is handled by propagating the variable to
the wic environment.

This results in correct /etc/fstab entries and in a correct kernel
bootargs root= parameter.

Signed-off-by: Sergey Bostandzhyan <jin@mediatomb.cc>
2020-02-11 10:20:58 -05:00
Joshua Watt
01467664da rk3399: Add generic rk3399 support
Adds support for the rk3399 SoC. Notably:
 *) Split out the default kernel config and image type from
    rockchip-defaults.inc now that not all support chips are ARMv7
 *) Apply a patch to Arm Trusted Firmware to fix a compile issue
 *) Arm Trusted Firmware requires the arm-none-eabi-native compiler to
    compile the M0 firmware.
 *) Modify u-boot to pull in the ATF files when compiling
 *) The rk3399 is support by the panfrost driver in mesa, so enable it

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
2020-01-27 16:32:19 -05:00
Trevor Woerner
d2a3f0f22a rockchip-defaults.inc: no default kernel version
Don't specify a default kernel version for linux-stable, allow the build
system to pick, or the user to choose (if there is a choice).

Signed-off-by: Trevor Woerner <twoerner@gmail.com>
2018-06-13 22:21:14 -04:00
Trevor Woerner
be84ce07ef rockchip-defaults.inc: adjust xserver modules
It looks like xf86-video-fbturbo is mostly AllWinner-specific
(https://github.com/ssvb/xf86-video-fbturbo). Also, it looks like it provides
an accelerated xserver fbdev by making use of the mali blobs. Therefore
there's no need for it.

Add current xserver modules for modesetting, glx, exa.

Signed-off-by: Trevor Woerner <twoerner@gmail.com>
2018-04-26 19:22:24 -04:00
Trevor Woerner
2f3644e039 linux-stable: add/bump
Provide a linux-stable recipe for 4.16.2
git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git

Remove 4.12 recipe from
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git

Signed-off-by: Trevor Woerner <twoerner@gmail.com>
2018-04-25 23:00:46 -04:00
Trevor Woerner
02f601cfee machine: cleanup
Create a conf/machine/include/rockchip-defaults.inc that includes
rockchip-wide defaults, then organize the conf/machine/include/rk*.inc and
individual machine files accordingly.

Signed-off-by: Trevor Woerner <twoerner@gmail.com>
2018-04-25 23:00:39 -04:00