Go to file
Trevor Woerner d19aa922c0 rockchip.wks: add most Rockchip partitions
Rockchip defines the expected layout/map of the default storage device.
Fill out the wks description so it matches.

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

There are 2 partitions at the start that can not be specified in
rockchip.wks due to a limitation in wic which assumes all sizes (e.g.
--size or --fixed-size) are specified in units of 1024 bytes. Since these
partitions don't fall on 1024-byte boundaries, they can not be specified at
this time.

Note: in the Rockchip layout, not all partitions are expected to show up
in the gpt partition table. While --no-table could be used to hide these
partitions from the partition table, as specified in the wiki, there's
no practical reason to do so. In fact, exposing these partitions in the
partition table makes it easier and safer for users to interact with them.
For example, a user dd'ing some data to a particular area would need to
ensure they're using the correct offset and size values when accessing the
raw disk directly. However being able to specify a partition ensures data
won't accidentally "spill" out into adjacent regions.

Note: there is a mistake in the Rockchip table (which I've copied verbatim
here in this commit message but corrected in rockchip.wks). Going by the
values of the "Start Sector", the size of the "reserved1" partition is
listed as being 2x its actual size/number of sectors.

Expected:
        Partition       Start Sector       Number of Sectors    Partition Size     PartNum in GPT    Requirements
        MBR             0      00000000    1       00000001     512       0.5KB
        Primary GPT     1      00000001    63      0000003F     32256     31.5KB
        loader1         64     00000040    7104    00001bc0     4096000   2.5MB    1                 preloader (miniloader or U-Boot SPL)
        Vendor Storage  7168   00001c00    512     00000200     262144    256KB                      SN, MAC and etc.
        Reserved Space  7680   00001e00    384     00000180     196608    192KB                      Not used
        reserved1       8064   00001f80    128     00000080     65536     64KB                       legacy DRM key
        U-Boot ENV      8128   00001fc0    64      00000040     32768     32KB
        reserved2       8192   00002000    8192    00002000     4194304   4MB                        legacy parameter
        loader2         16384  00004000    8192    00002000     4194304   4MB      2                 U-Boot or UEFI
        trust           24576  00006000    8192    00002000     4194304   4MB      3                 trusted-os like ATF, OP-TEE
        boot            32768  00008000    229376  00038000     117440512 112MB    4                 kernel, dtb, extlinux.conf, ramdisk
        rootfs          262144 00040000    -       -            -         -MB      5                 Linux system

Prior to this patch:
        # fdisk -l /dev/mmcblk1
        GPT PMBR size mismatch (1504727 != 30375935) will be corrected by write.
        The backup GPT table is not on the end of the device.
        Disk /dev/mmcblk1: 14.48 GiB, 15552479232 bytes, 30375936 sectors
        Units: sectors of 1 * 512 = 512 bytes
        Sector size (logical/physical): 512 bytes / 512 bytes
        I/O size (minimum/optimal): 512 bytes / 512 bytes
        Disklabel type: gpt
        Disk identifier: 00000000-0000-0000-0000-00004D9B9EF0

        Device          Start     End Sectors   Size Type
        /dev/mmcblk1p1     64    8063    8000   3.9M Microsoft basic data
        /dev/mmcblk1p2   8064    8191     128    64K Microsoft basic data
        /dev/mmcblk1p3   8192   16383    8192     4M Microsoft basic data
        /dev/mmcblk1p4  16384   24575    8192     4M Microsoft basic data
        /dev/mmcblk1p5  24576   32767    8192     4M Microsoft basic data
        /dev/mmcblk1p6  32768  330955  298188 145.6M Microsoft basic data
        /dev/mmcblk1p7 330956 1504693 1173738 573.1M Linux filesystem

New:
        # fdisk -l /dev/mmcblk1
        GPT PMBR size mismatch (1504473 != 30375935) will be corrected by write.
        The backup GPT table is not on the end of the device.
        Disk /dev/mmcblk1: 14.48 GiB, 15552479232 bytes, 30375936 sectors
        Units: sectors of 1 * 512 = 512 bytes
        Sector size (logical/physical): 512 bytes / 512 bytes
        I/O size (minimum/optimal): 512 bytes / 512 bytes
        Disklabel type: gpt
        Disk identifier: 00000000-0000-0000-0000-00004D9B9EF0

        Device           Start     End Sectors   Size Type
        /dev/mmcblk1p1      64    7167    7104   3.5M Linux filesystem
        /dev/mmcblk1p2    7168    7679     512   256K Linux filesystem
        /dev/mmcblk1p3    7680    8063     384   192K Linux filesystem
        /dev/mmcblk1p4    8064    8127      64    32K Linux filesystem
        /dev/mmcblk1p5    8128    8191      64    32K Linux filesystem
        /dev/mmcblk1p6    8192   16383    8192     4M Linux filesystem
        /dev/mmcblk1p7   16384   24575    8192     4M Linux filesystem
        /dev/mmcblk1p8   24576   32767    8192     4M Linux filesystem
        /dev/mmcblk1p9   32768  330955  298188 145.6M Microsoft basic data
        /dev/mmcblk1p10 330956 1504439 1173484   573M Linux filesystem

Reviewed-by: Quentin Schulz <foss+yocto@0leil.net>
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 allow user-provided WKS_FILE 2024-01-29 21:44:26 -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 rockchip.wks: add most Rockchip partitions 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