Hi Trevor,

On 2/16/24 09:29, Trevor Woerner via lists.yoctoproject.org wrote:
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 and
sizes 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 and size of the SPL partition is a hard dependency since the

Just because I like being pedantic, I don't thhink the size is a hard dependency. The location is (well there are a few possible though :) ), but the size is part of the header(s) that is parsed by the BootROM, the BootROM will only fetch what it needs as far as I remember. It's a bit of convoluted code but it's done in tools/rkcommon.c in U-Boot source code.

What we can say though is that the TPL+SPL has a maximum size, since it needs to fit inside the SRAM. But I don't think any SoC has been released by Rockchip that has 2.5MiB of SRAM, it's usually a few tens of KiB max only. Anyway, the message is fine, just wanted to give a bit more info there.

[...]

diff --git a/conf/machine/include/rockchip-extlinux.inc 
b/conf/machine/include/rockchip-extlinux.inc
new file mode 100644
index 000000000000..3af7ed629e34
--- /dev/null
+++ b/conf/machine/include/rockchip-extlinux.inc
@@ -0,0 +1,12 @@
+UBOOT_EXTLINUX ?= "1"
+UBOOT_EXTLINUX_ROOT ?= "root=PARTLABEL=root"
+UBOOT_EXTLINUX_FDTDIR ?= "${@bb.utils.contains('KERNEL_IMAGETYPE', 'fitImage', '', 
'/boot', d)}"
+NONFITDT ?= "${@d.getVar('KERNEL_DEVICETREE').split('/')[1]}"

Maybe keep the comment explaining the logic of this line?

+UBOOT_EXTLINUX_FDT ?= "${@bb.utils.contains('KERNEL_IMAGETYPE', 'fitImage', '', 
'${NONFITDT}', d)}"
+UBOOT_EXTLINUX_CONSOLE ?= "earlycon console=tty1 
console=${RK_CONSOLE_DEVICE},${RK_CONSOLE_BAUD}n8"
+UBOOT_EXTLINUX_KERNEL_ARGS ?= "rootwait rw rootfstype=ext4"
+UBOOT_EXTLINUX_KERNEL_IMAGE ?= "/boot/${KERNEL_IMAGETYPE}"
+UBOOT_EXTLINUX_LABELS ?= "default"
+UBOOT_EXTLINUX_MENU_DESCRIPTION:default ?= "${MACHINE}"
+
+MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += "u-boot-extlinux"

Going back to the mail I sent a few minutes ago on the v1 (which was sent after your v2 was sent :) ), I have a gut feeling we need _RDEPENDS here and not _RRECOMMENDS.

Cheers,
Quentin
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#62519): https://lists.yoctoproject.org/g/yocto/message/62519
Mute This Topic: https://lists.yoctoproject.org/mt/104389371/21656
Group Owner: yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to