Go to file
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
classes KERNEL_DEVICETREE: 32-bit re-org 2024-01-24 20:57:59 -05:00
conf remove /boot partition 2024-02-26 10:27:30 -05:00
dynamic-layers/qt5-layer/recipes-qt/qt5 switch to the new bitbake OVERRIDE syntax 2021-08-04 21:59:14 -04:00
recipes-bsp rename u-boot bbappend 2024-01-29 21:44:26 -05:00
recipes-graphics/mesa mesa: Enable Panfrost for PX30 2023-06-09 12:40:34 -04:00
recipes-kernel/linux rock-4c-plus: add 2024-01-20 16:20:37 -05:00
wic remove /boot partition 2024-02-26 10:27:30 -05:00
COPYING.MIT Initial commit 2014-04-04 16:25:45 +02:00
README rock-4c-plus: add 2024-01-20 16:20:37 -05:00

OpenEmbedded BSP layer for Rockchip boards

About:

The purpose of this layer is to provide OpenEmbedded BSP support for
Rockchip-based devices using upstream sources as much as possible.

Dependencies:

URI: git://git.openembedded.org/openembedded-core
layers: meta
branch: matched branches (e.g. master, sumo, ...)

URI: git://git.yoctoproject.org/meta-arm
layers: meta-arm, meta-arm-toolchain
branch: matched branches (e.g. master, sumo, ...)

Status of supported boards:

builds and boots wic image:
	nanopi-m4
	nanopi-m4-2gb
	rock-pi-e
	rock-pi-4a
	rock-pi-4b
	rock-pi-4c
	rock64
	tinker-board
	tinker-board-s
	vyasa-rk3288
	firefly-rk3288
	nanopi-r4s
	rock-5b
	nanopi-r2s
	nanopi-m4b
	rock-pi-s
	rock-5a
	roc-rk3328-cc
	roc-rk3308-cc
	orangepi-5-plus
	rock-3a
	rock-4c-plus
builds:
	marsboard-rk3066
	radxarock
	rock2-square

Notes:

The latest ddr initializer for the rk3308 platform does not output
diagnostic messages to uart0. This causes a bunch of gibberish to
be printed to the console window which only becomes legible once
the linux kernel starts. I.e. the console output of the ddr
initialization routine, as well as u-boot is lost. An older
version of this same binary blob does, however, support output to
uart0 (making its diagnostic messages as well as u-boot available
on the console). By default the build assumes the user would like
to see these message and be able to have the option to interact
with u-boot.

IOW: for rk3308-based devices, an older version of rkbin is used.

If, however, the user would prefer to use the latest binary ddr
initializer from rkbin, simply set:

	RKBIN_RK3308_LATEST = "1"

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

Maintenance:

Please send pull requests, patches, comments, or questions to the
yocto mailing list (yocto@lists.yoctoproject.org) CCing the maintainer

When sending patches, please make sure the email subject line includes
"[meta-rockchip][PATCH]" and follow the community's patch submission
guidelines, as described in:
	https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines
	https://www.openembedded.org/wiki/How_to_submit_a_patch_to_OpenEmbedded

Please send changes to the yocto mailing list with [meta-rockchip] in the subject line,
cc'ing the maintainer.

This can be configured within the repository with the following commands:

	git config sendemail.to yocto@lists.yoctoproject.org
	git config sendemail.cc twoerner@gmail.com
	git config format.subjectprefix "meta-rockchip] [PATCH"

Then, to send your most recent commit (i.e. just one patch),
please use something like:

	git format-patch -M -1
	git send-email <your patch file>

Maintainer:

Trevor Woerner <twoerner@gmail.com>

Brief History:

2014 April
	- originally started by Julien Chauveau
	- Romain Perier joins
2014 Sep
	- Julien leaves
2015 Aug
	- Trevor Woerner joins
2017 Mar
	- developers from Rockchip fork this layer see:
		https://github.com/rockchip-linux/meta-rockchip.git
		http://rockchip.wikidot.com/yocto-user-guide
2017 May
	- Romain leaves
2018 Feb
	- Rockchip developers abandon their fork for buildroot
		http://opensource.rock-chips.com/wiki_Buildroot