meta-rockchip/README
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

3.7 KiB

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).

U-Boot Environment:

In order to configure U-Boot to be able to store its environment into the
device from which it was booted, for any device supported in this BSP,
simply add the following to MACHINE_FEATURES:

	rk-u-boot-env

If enabled, to additionally have the U-Boot environment generated and
stored in the image, also enable the following variable (default: off):

	RK_IMAGE_INCLUDES_UBOOT_ENV

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.

Maintenance:

Please send pull requests, patches, comments, or questions to the
yocto-patches mailing list (yocto-patches@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

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

	git config sendemail.to yocto-patches@lists.yoctoproject.org
	git config sendemail.cc <your full email address>
	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