Re: [yocto] [meta-rockchip][PATCH] enable stored U-Boot environment

2024-03-21 Thread Trevor Woerner
Hi Quentin,

Thank you ever so much for your review!
I appreciate your feedback :-)

On Thu 2024-03-21 @ 07:35:14 PM, Quentin Schulz wrote:
> Hi Trevor,
> 
> On 3/21/24 18:53, Trevor Woerner via lists.yoctoproject.org wrote:
> > When U-Boot is built it is compiled with a set of environment variables
> > (and their values) built into the U-Boot binary. U-Boot can be configured
> > to use storage to load and/or store environment variables which can persist
> > over reboots. This storage could be (but not limited to) a chunk of an MMC
> > device, it could be in SPI, or simply a file in the device's filesystem. If
> > this storage-based environment is valid (checksum is verified) U-Boot will
> > use these values over any same values which are built-in.
> > 
> > By default some of the MACHINES in this BSP layer are configured to use
> > a persistent U-Boot environment, others are not. It all depends on what
> > is set in the specific defconfig file for the device found in upstream,
> > mainline U-Boot. This is, apparently, random.
> > 
> > If you want to ensure that you have access to an on-boot-device, persistent
> > U-Boot environment, simply add the following to MACHINE_FEATURES in your
> > configuration:
> > 
> > rk-u-boot-env
> > 
> > If you have enabled this feature, you now have a second choice to make:
> > do you want your build to 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, 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, set this
> > variable to "1" in your configuration. This variable only takes effect if
> > the rk-u-boot-env MACHINE_FEATURE is enabled, and has no effect otherwise.
> > 
> > The script:
> > 
> > scripts/dump-uboot-env-from-yocto-image.sh
> > 
> > can be used on your wic file to see the contents of the U-Boot environment
> > partition at build time.
> > 
> > Signed-off-by: Trevor Woerner 
> > ---
> >   README| 45 +++
> >   classes/rk-u-boot-env.bbclass |  1 +
> >   conf/machine/include/rockchip-wic.inc | 10 +
> >   .../rockchip-enable-environment-mmc.cfg   |  4 ++
> >   .../rockchip-enable-environment-mmc0.cfg  |  1 +
> >   .../rockchip-enable-environment-mmc1.cfg  |  1 +
> >   recipes-bsp/u-boot/u-boot_%.bbappend  | 24 ++
> >   scripts/dump-uboot-env-from-yocto-image.sh| 29 
> >   wic/rockchip.wks  |  2 +-
> >   9 files changed, 116 insertions(+), 1 deletion(-)
> >   create mode 100644 classes/rk-u-boot-env.bbclass
> >   create mode 100644 
> > recipes-bsp/u-boot/files/rk-u-boot-env/rockchip-enable-environment-mmc.cfg
> >   create mode 100644 
> > recipes-bsp/u-boot/files/rk-u-boot-env/rockchip-enable-environment-mmc0.cfg
> >   create mode 100644 
> > recipes-bsp/u-boot/files/rk-u-boot-env/rockchip-enable-environment-mmc1.cfg
> >   create mode 100755 scripts/dump-uboot-env-from-yocto-image.sh
> > 
> > diff --git a/README b/README
> > index 4c30f7529353..e357e093d45f 100644
> > --- a/README
> > +++ b/README
> > @@ -67,6 +67,51 @@ Notes:
> > 
> > in the configuration (e.g. conf/local.conf).
> > +U-Boot Environment:
> > +--
> > +   When U-Boot is built it is compiled with a set of environment variables
> > +   (and their values) built into the U-Boot binary. U-Boot can be 
> > configured
> > +   to use storage to load and/or store environment variables which can 
> > persist
> > +   over reboots. This storage could be (but not limited to) a chunk of an 
> > MMC
> > +   device, it could be in SPI, or simply a file in the device's 
> > filesystem. If
> > +   this storage-based environment is valid (checksum is verified) U-Boot 
> > will
> > +   use these values over any same values which are built-in

[yocto] [meta-rockchip][PATCH] enable stored U-Boot environment

2024-03-21 Thread Trevor Woerner
When U-Boot is built it is compiled with a set of environment variables
(and their values) built into the U-Boot binary. U-Boot can be configured
to use storage to load and/or store environment variables which can persist
over reboots. This storage could be (but not limited to) a chunk of an MMC
device, it could be in SPI, or simply a file in the device's filesystem. If
this storage-based environment is valid (checksum is verified) U-Boot will
use these values over any same values which are built-in.

By default some of the MACHINES in this BSP layer are configured to use
a persistent U-Boot environment, others are not. It all depends on what
is set in the specific defconfig file for the device found in upstream,
mainline U-Boot. This is, apparently, random.

If you want to ensure that you have access to an on-boot-device, persistent
U-Boot environment, simply add the following to MACHINE_FEATURES in your
configuration:

rk-u-boot-env

If you have enabled this feature, you now have a second choice to make:
do you want your build to 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, 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, set this
variable to "1" in your configuration. This variable only takes effect if
the rk-u-boot-env MACHINE_FEATURE is enabled, and has no effect otherwise.

The script:

scripts/dump-uboot-env-from-yocto-image.sh

can be used on your wic file to see the contents of the U-Boot environment
partition at build time.

Signed-off-by: Trevor Woerner 
---
 README| 45 +++
 classes/rk-u-boot-env.bbclass |  1 +
 conf/machine/include/rockchip-wic.inc | 10 +
 .../rockchip-enable-environment-mmc.cfg   |  4 ++
 .../rockchip-enable-environment-mmc0.cfg  |  1 +
 .../rockchip-enable-environment-mmc1.cfg  |  1 +
 recipes-bsp/u-boot/u-boot_%.bbappend  | 24 ++
 scripts/dump-uboot-env-from-yocto-image.sh| 29 
 wic/rockchip.wks  |  2 +-
 9 files changed, 116 insertions(+), 1 deletion(-)
 create mode 100644 classes/rk-u-boot-env.bbclass
 create mode 100644 
recipes-bsp/u-boot/files/rk-u-boot-env/rockchip-enable-environment-mmc.cfg
 create mode 100644 
recipes-bsp/u-boot/files/rk-u-boot-env/rockchip-enable-environment-mmc0.cfg
 create mode 100644 
recipes-bsp/u-boot/files/rk-u-boot-env/rockchip-enable-environment-mmc1.cfg
 create mode 100755 scripts/dump-uboot-env-from-yocto-image.sh

diff --git a/README b/README
index 4c30f7529353..e357e093d45f 100644
--- a/README
+++ b/README
@@ -67,6 +67,51 @@ Notes:

in the configuration (e.g. conf/local.conf).
 
+U-Boot Environment:
+--
+   When U-Boot is built it is compiled with a set of environment variables
+   (and their values) built into the U-Boot binary. U-Boot can be 
configured
+   to use storage to load and/or store environment variables which can 
persist
+   over reboots. This storage could be (but not limited to) a chunk of an 
MMC
+   device, it could be in SPI, or simply a file in the device's 
filesystem. If
+   this storage-based environment is valid (checksum is verified) U-Boot 
will
+   use these values over any same values which are built-in.
+
+   By default some of the MACHINES in this BSP layer are configured to use
+   a persistent U-Boot environment, others are not. It all depends on what
+   is set in the specific defconfig file for the device found in upstream,
+   mainline U-Boot. This is, apparently, random.
+
+   If you want to ensure that you have access to an on-boot-device, 
persistent
+   U-Boot environment, simply add the following to MACHINE_FEATURES in your
+   configuration:
+
+   rk-u-boot-env
+
+   If you have enabled this feature, you now have a second choice to make:
+   do you want your build to 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 con

Re: [yocto] [meta-rockchip][PATCH] rock-5[ab]: use regular yocto kernel

2024-03-07 Thread Trevor Woerner
On Sun 2024-03-03 @ 06:13:09 PM, Trevor Woerner wrote:
> Upstream kernel support for both the rock-5a and rock-5b landed in version
> 6.5. Nanbield contained linux-yocto recipes for both 6.1 and 6.5 so it
> was best to simply have these MACHINEs use linux-yocto-dev. Post-nanbield
> oecore master only has a recipe for 6.6 (so far), therefore these two
> MACHINEs can use linux-yocto by default, instead of linux-yocto-dev.
> 
> Signed-off-by: Trevor Woerner 
> ---
>  conf/machine/rock-5a.conf | 1 -
>  conf/machine/rock-5b.conf | 1 -
>  recipes-kernel/linux/linux-yocto-dev.bbappend | 4 
>  recipes-kernel/linux/linux-yocto_%.bbappend   | 2 ++
>  4 files changed, 2 insertions(+), 6 deletions(-)

Applied to meta-rockchip, master branch.

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



[yocto] [meta-rockchip][PATCH] rock-5[ab]: use regular yocto kernel

2024-03-03 Thread Trevor Woerner
Upstream kernel support for both the rock-5a and rock-5b landed in version
6.5. Nanbield contained linux-yocto recipes for both 6.1 and 6.5 so it
was best to simply have these MACHINEs use linux-yocto-dev. Post-nanbield
oecore master only has a recipe for 6.6 (so far), therefore these two
MACHINEs can use linux-yocto by default, instead of linux-yocto-dev.

Signed-off-by: Trevor Woerner 
---
 conf/machine/rock-5a.conf | 1 -
 conf/machine/rock-5b.conf | 1 -
 recipes-kernel/linux/linux-yocto-dev.bbappend | 4 
 recipes-kernel/linux/linux-yocto_%.bbappend   | 2 ++
 4 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/conf/machine/rock-5a.conf b/conf/machine/rock-5a.conf
index 5ace4dac8fe4..1a6aa36fe649 100644
--- a/conf/machine/rock-5a.conf
+++ b/conf/machine/rock-5a.conf
@@ -5,7 +5,6 @@
 
 require conf/machine/include/rk3588s.inc
 
-PREFERRED_PROVIDER_virtual/kernel = "linux-yocto-dev"
 KERNEL_DEVICETREE = "rockchip/rk3588s-rock-5a.dtb"
 MACHINE_EXTRA_RRECOMMENDS += "kernel-modules"
 
diff --git a/conf/machine/rock-5b.conf b/conf/machine/rock-5b.conf
index d1371084becc..c3a9b0afa57d 100644
--- a/conf/machine/rock-5b.conf
+++ b/conf/machine/rock-5b.conf
@@ -5,7 +5,6 @@
 
 require conf/machine/include/rk3588.inc
 
-PREFERRED_PROVIDER_virtual/kernel = "linux-yocto-dev"
 KERNEL_DEVICETREE = "rockchip/rk3588-rock-5b.dtb"
 MACHINE_EXTRA_RRECOMMENDS += "kernel-modules"
 
diff --git a/recipes-kernel/linux/linux-yocto-dev.bbappend 
b/recipes-kernel/linux/linux-yocto-dev.bbappend
index 38fbb77a0f2b..b6a63d7b7b29 100644
--- a/recipes-kernel/linux/linux-yocto-dev.bbappend
+++ b/recipes-kernel/linux/linux-yocto-dev.bbappend
@@ -1,9 +1,5 @@
 FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
 
-COMPATIBLE_MACHINE:rock-5a = "rock-5a"
-COMPATIBLE_MACHINE:rock-5b = "rock-5b"
 COMPATIBLE_MACHINE:orangepi-5-plus = "orangepi-5-plus"
 
-SRC_URI:append:rock-5a = " 
file://rockchip-kmeta;type=kmeta;name=rockchip-kmeta;destsuffix=rockchip-kmeta"
-SRC_URI:append:rock-5b = " 
file://rockchip-kmeta;type=kmeta;name=rockchip-kmeta;destsuffix=rockchip-kmeta"
 SRC_URI:append:orangepi-5-plus = " 
file://rockchip-kmeta;type=kmeta;name=rockchip-kmeta;destsuffix=rockchip-kmeta"
diff --git a/recipes-kernel/linux/linux-yocto_%.bbappend 
b/recipes-kernel/linux/linux-yocto_%.bbappend
index 41451dfeefb1..5528bab0d17c 100644
--- a/recipes-kernel/linux/linux-yocto_%.bbappend
+++ b/recipes-kernel/linux/linux-yocto_%.bbappend
@@ -20,6 +20,8 @@ COMPATIBLE_MACHINE:roc-rk3328-cc = "roc-rk3328-cc"
 COMPATIBLE_MACHINE:roc-rk3308-cc = "roc-rk3308-cc"
 COMPATIBLE_MACHINE:rock-3a = "rock-3a"
 COMPATIBLE_MACHINE:rock-4c-plus = "rock-4c-plus"
+COMPATIBLE_MACHINE:rock-5a = "rock-5a"
+COMPATIBLE_MACHINE:rock-5b = "rock-5b"
 
 SRC_URI:append = " 
file://rockchip-kmeta;type=kmeta;name=rockchip-kmeta;destsuffix=rockchip-kmeta"
 SRC_URI:append:nanopi-r4s = " file://nanopi-r4s.scc"
-- 
2.43.0.76.g1a87c842ece3


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



Re: [yocto] [meta-rockchip][PATCH v4 5/5] rockchip.wks: wks file cleanup

2024-02-26 Thread Trevor Woerner
On Thu 2024-02-22 @ 12:04:15 PM, Trevor Woerner via lists.yoctoproject.org 
wrote:
> Cleanup the elements of the wic/rockchip.wks file so that they take up less
> horizontal space.
> 
> Reviewed-by: Quentin Schulz 
> Signed-off-by: Trevor Woerner 
> ---
> changes in v4:
> - updated for latest rockchip.wks
> 
> changes in v3:
> - tweaks to accommodate the existing changes
> 
> changes in v2:
> - add Quentin's tag
> ---
>  wic/rockchip.wks | 18 +-
>  1 file changed, 9 insertions(+), 9 deletions(-)

Applied to meta-rockchip, master branch.

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



Re: [yocto] [meta-rockchip][PATCH v4 4/5] remove /boot partition

2024-02-26 Thread Trevor Woerner
On Thu 2024-02-22 @ 12:04:14 PM, 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
> 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 
> Signed-off-by: Trevor Woerner 
> ---
> changes in v4:
> - updated for latest rockchip.wks
> - remove offset for /boot partition (let wic calculate this)
> 
> changes in v3:
> - add back the comment explaining the need for NONFITDT
> - change the inclusion of the u-boot-extlinux package from RRECOMMENDS
>   to RDEPENDS
> - clarify the commit message to remove the un-true statement that sizes
>   are hard requirements
> - add back the "--ptable gpt" line to rockchip.wks
> 
> changes in v2:
> - add UBOOT_EXTLINUX_FDT and tweak UBOOT_EXTLINUX_FDTDIR to modify their
>   behaviour based on whether or not KERNEL_IMAGETYPE is fitImage
> - remove extraneous WKS_FILE_DEPENDS
> - remove "--ptable gpt" from wks
> - move newly added "earlycon" to UBOOT_EXTLINUX_CONSOLE
> - re-word the commit message to better explain the behaviour of the
>   Rockchip BootROM
> ---
>  conf/machine/include/rockchip-defaults.inc |  2 ++
>  conf/machine/include/rockchip-extlinux.inc | 24 ++
>  conf/machine/include/rockchip-wic.inc  | 20 ++
>  wic/rockchip.wks   | 12 +--
>  4 files changed, 33 insertions(+), 25 deletions(-)
>  create mode 100644 conf/machine/include/rockchip-extlinux.inc

Applied to meta-rockchip, master branch.

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



Re: [yocto] [meta-rockchip][PATCH v4 3/5] rockchip.wks: add most Rockchip partitions

2024-02-26 Thread Trevor Woerner
On Thu 2024-02-22 @ 12:04:13 PM, Trevor Woerner via lists.yoctoproject.org 
wrote:
> 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 SectorsPartition 
> Size PartNum in GPTRequirements
> MBR 0  1   0001 512   
> 0.5KB
> Primary GPT 1  000163  003F 32256 
> 31.5KB
> loader1 64 004071041bc0 4096000   
> 2.5MB1 preloader (miniloader or U-Boot SPL)
> Vendor Storage  7168   1c00512 0200 262144
> 256KB  SN, MAC and etc.
> Reserved Space  7680   1e00384 0180 196608
> 192KB  Not used
> reserved1   8064   1f80128 0080 65536 
> 64KB   legacy DRM key
> U-Boot ENV  8128   1fc064  0040 32768 32KB
> reserved2   8192   200081922000 4194304   4MB 
>legacy parameter
> loader2 16384  400081922000 4194304   4MB 
>  2 U-Boot or UEFI
> trust   24576  600081922000 4194304   4MB 
>  3 trusted-os like ATF, OP-TEE
> boot32768  8000229376  00038000 117440512 
> 112MB4 kernel, dtb, extlinux.conf, ramdisk
> rootfs  262144 0004-   -- -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: ----4D9B9EF0
> 
> Device  Start End Sectors   Size Type
> /dev/mmcblk1p1 6480638000   3.9M Microsoft basic data
> /dev/mmcblk1p2   80648191 12864K Microsoft basic data
> /dev/mmcblk1p3   8192   163838192 4M Microsoft basic data
> /dev/mmcblk1p4  16384   245758192 4M Microsoft basic data
> /dev/mmcblk1p5  24576   327678192 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: ---

Re: [yocto] [meta-rockchip][PATCH v4 2/5] rockchip.wks: specify fstype

2024-02-26 Thread Trevor Woerner
On Thu 2024-02-22 @ 12:04:12 PM, Trevor Woerner via lists.yoctoproject.org 
wrote:
> If the wks file doesn't specify, the assumption is that each partition
> contains a vfat-formatted filesystem. Most of the partitions in the
> Rockchip layout don't have filesystems. Implicitly setting the fstype to
> vfat causes wic to format the partitions. It doesn't make sense to format
> the rawcopy partitions as vfat just to immediately overwrite them with
> binaries, and it wastes time formatting partitions that won't ever be used
> as filesystems.
> 
> Reviewed-by: Quentin Schulz 
> Signed-off-by: Trevor Woerner 
> ---
> changes in v4:
> - none
> 
> changes in v3:
> - tweak to accommodate offsets specified in sectors
> 
> changes in v2:
> - reword the commit message to add clarity
> - add Quentin's tag
> ---
>  wic/rockchip.wks | 14 +++---
>  1 file changed, 7 insertions(+), 7 deletions(-)

Applied to meta-rockchip, master branch.

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



Re: [yocto] [meta-rockchip][PATCH v4 1/5] rockchip.wks: specify offsets in sectors

2024-02-26 Thread Trevor Woerner
On Thu 2024-02-22 @ 12:04:11 PM, Trevor Woerner via lists.yoctoproject.org 
wrote:
> In WIC, size arguments can be optionally specified using one of a variety
> of suffixes (e.g. K, M, G, etc.) thanks to sizetype(). One such suffix being
> "s/S" for handling sector sizes which are assumed to be 512 bytes, rather than
> the other size suffixes which are multiples of 1024 bytes.
> 
> Using the s/S sizetype allows the definition to match the documentation.
> Unfortunately we can not use the s/S suffix for --fixed-size.
> 
> Reviewed-by: Quentin Schulz 
> Signed-off-by: Trevor Woerner 
> ---
> changes in v4:
> - add Quentin's tag
> 
> changes in v3:
> - new
> ---
>  wic/rockchip.wks | 15 +++
>  1 file changed, 7 insertions(+), 8 deletions(-)

Applied to meta-rockchip, master branch.

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



[yocto] [meta-rockchip][PATCH v4 5/5] rockchip.wks: wks file cleanup

2024-02-22 Thread Trevor Woerner
Cleanup the elements of the wic/rockchip.wks file so that they take up less
horizontal space.

Reviewed-by: Quentin Schulz 
Signed-off-by: Trevor Woerner 
---
changes in v4:
- updated for latest rockchip.wks

changes in v3:
- tweaks to accommodate the existing changes

changes in v2:
- add Quentin's tag
---
 wic/rockchip.wks | 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/wic/rockchip.wks b/wic/rockchip.wks
index 6622e395ee2f..ee660b06d78e 100644
--- a/wic/rockchip.wks
+++ b/wic/rockchip.wks
@@ -18,14 +18,14 @@
 #   atf 24576   8192(trusted OS e.g. ATF, OP-TEE, etc)
 #   root32768   -
 
-part loader1--offset 64s--fixed-size 3552K   --fstype=none
--source rawcopy  --sourceparams="file=${SPL_BINARY}"
-part v_storage  --offset 7168s  --fixed-size 256K--fstype=none
-part reserved   --offset 7680s  --fixed-size 192K--fstype=none
-part reserved1  --offset 8064s  --fixed-size 32K --fstype=none
-part uboot_env  --offset 8128s  --fixed-size 32K --fstype=none
-part reserved2  --offset 8192s  --fixed-size 4096K   --fstype=none
-part loader2--offset 16384s --fixed-size 4096K   --fstype=none
--source rawcopy  --sourceparams="file=u-boot.${UBOOT_SUFFIX}"
-part atf--offset 24576s --fixed-size 4096K   --fstype=none
-part /   --fstype=ext4 --active   
--source rootfs  --label root
+part loader1   --offset 64s--fixed-size 3552K --fstype=none --source 
rawcopy --sourceparams="file=${SPL_BINARY}"
+part v_storage --offset 7168s  --fixed-size 256K  --fstype=none
+part reserved  --offset 7680s  --fixed-size 192K  --fstype=none
+part reserved1 --offset 8064s  --fixed-size 32K   --fstype=none
+part uboot_env --offset 8128s  --fixed-size 32K   --fstype=none
+part reserved2 --offset 8192s  --fixed-size 4096K --fstype=none
+part loader2   --offset 16384s --fixed-size 4096K --fstype=none --source 
rawcopy --sourceparams="file=u-boot.${UBOOT_SUFFIX}"
+part atf   --offset 24576s --fixed-size 4096K --fstype=none
+part / --label root--active   --fstype=ext4 --source rootfs
 
 bootloader --ptable gpt
-- 
2.43.0.76.g1a87c842ece3


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



[yocto] [meta-rockchip][PATCH v4 4/5] remove /boot partition

2024-02-22 Thread Trevor Woerner
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 
Signed-off-by: Trevor Woerner 
---
changes in v4:
- updated for latest rockchip.wks
- remove offset for /boot partition (let wic calculate this)

changes in v3:
- add back the comment explaining the need for NONFITDT
- change the inclusion of the u-boot-extlinux package from RRECOMMENDS
  to RDEPENDS
- clarify the commit message to remove the un-true statement that sizes
  are hard requirements
- add back the "--ptable gpt" line to rockchip.wks

changes in v2:
- add UBOOT_EXTLINUX_FDT and tweak UBOOT_EXTLINUX_FDTDIR to modify their
  behaviour based on whether or not KERNEL_IMAGETYPE is fitImage
- remove extraneous WKS_FILE_DEPENDS
- remove "--ptable gpt" from wks
- move newly added "earlycon" to UBOOT_EXTLINUX_CONSOLE
- re-word the commit message to better explain the behaviour of the
  Rockchip BootROM
---
 conf/machine/include/rockchip-defaults.inc |  2 ++
 conf/machine/include/rockchip-extlinux.inc | 24 ++
 conf/machine/include/rockchip-wic.inc  | 20 ++
 wic/rockchip.wks   | 12 +--
 4 files changed, 33 insertions(+), 25 deletions(-)
 create mode 100644 conf/machine/include/rockchip-extlinux.inc

diff --git a/conf/machine/include/rockchip-defaults.inc 
b/conf/machine/include/rockchip-defaults.inc
index 3ce2e246ab0b..2387eb909934 100644
--- a/conf/machine/include/rockchip-defaults.inc
+++ b/conf/machine/include/rockchip-defaults.inc
@@ -19,3 +19,5 @@ XSERVER = " \
 
 # misc
 SERIAL_CONSOLES ?= "150;ttyS2"
+RK_CONSOLE_BAUD ?= "${@d.getVar('SERIAL_CONSOLES').split(';')[0]}"
+RK_CONSOLE_DEVICE ?= "${@d.getVar('SERIAL_CONSOLES').split(';')[1].split()[0]}"
diff --git a/conf/machine/include/rockchip-extlinux.inc 
b/conf/machine/include/rockchip-extlinux.inc
new file mode 100644
index ..ca33f4c7f42a
--- /dev/null
+++ b/conf/machine/include/rock

[yocto] [meta-rockchip][PATCH v4 3/5] rockchip.wks: add most Rockchip partitions

2024-02-22 Thread Trevor Woerner
/dev/mmcblk1p7   16384   245758192 4M Linux filesystem
/dev/mmcblk1p8   24576   327678192 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 
Signed-off-by: Trevor Woerner 
---
changes in v4:
- remove all --no-table to include all partitions in the gpt table

changes in v3:
- tweaked to accommodate offsets specified in sectors
- clarified that the first 2 partitions can not be added
- change name of vstorage to v_storage
- fixed typo (ATR -> ATF)
- added Quentin's tag

changes in v2:
- expand the commit message to show past, expected, and new behaviour
- spell out that vstorage stands for "vendor storage"
---
 wic/rockchip.wks | 18 --
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/wic/rockchip.wks b/wic/rockchip.wks
index 42b731ac47b2..714fc5e11e11 100644
--- a/wic/rockchip.wks
+++ b/wic/rockchip.wks
@@ -8,16 +8,22 @@
 # See: https://opensource.rock-chips.com/wiki_Partitions
 #
 #   Partition   Start SectorNumber of Sectors
-#   loader1 64  8000(idbloader / U-Boot SPL)
-#   reserved1   8064128
-#   reserved2   81928192
+#   loader1 64  7104(idbloader / U-Boot SPL)
+#   v_storage   7168512 (vendor storage: e.g. serial 
number, MAC address, etc)
+#   reserved7680384 (not used)
+#   reserved1   806464  (legacy DRM key)
+#   uboot_env   812864  (U-Boo environment)
+#   reserved2   81928192(legacy parameters, ATAGS, etc)
 #   loader2 16384   8192(U-Boot proper)
-#   atf 24576   8192
+#   atf 24576   8192(trusted OS e.g. ATF, OP-TEE, etc)
 #   boot32768   229376
 #   root262144  -   (suggested)
 
-part loader1--offset 64s--fixed-size 4000K   --fstype=none
--source rawcopy   
--sourceparams="file=${SPL_BINARY}"
-part reserved1  --offset 8064s  --fixed-size 64K --fstype=none
+part loader1--offset 64s--fixed-size 3552K   --fstype=none
--source rawcopy   
--sourceparams="file=${SPL_BINARY}"
+part v_storage  --offset 7168s  --fixed-size 256K--fstype=none
+part reserved   --offset 7680s  --fixed-size 192K--fstype=none
+part reserved1  --offset 8064s  --fixed-size 32K --fstype=none
+part uboot_env  --offset 8128s  --fixed-size 32K --fstype=none
 part reserved2  --offset 8192s  --fixed-size 4096K   --fstype=none
 part loader2--offset 16384s --fixed-size 4096K   --fstype=none
--source rawcopy   
--sourceparams="file=u-boot.${UBOOT_SUFFIX}"
 part atf--offset 24576s --fixed-size 4096K   --fstype=none
-- 
2.43.0.76.g1a87c842ece3


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



[yocto] [meta-rockchip][PATCH v4 2/5] rockchip.wks: specify fstype

2024-02-22 Thread Trevor Woerner
If the wks file doesn't specify, the assumption is that each partition
contains a vfat-formatted filesystem. Most of the partitions in the
Rockchip layout don't have filesystems. Implicitly setting the fstype to
vfat causes wic to format the partitions. It doesn't make sense to format
the rawcopy partitions as vfat just to immediately overwrite them with
binaries, and it wastes time formatting partitions that won't ever be used
as filesystems.

Reviewed-by: Quentin Schulz 
Signed-off-by: Trevor Woerner 
---
changes in v4:
- none

changes in v3:
- tweak to accommodate offsets specified in sectors

changes in v2:
- reword the commit message to add clarity
- add Quentin's tag
---
 wic/rockchip.wks | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/wic/rockchip.wks b/wic/rockchip.wks
index 804e84ceb316..42b731ac47b2 100644
--- a/wic/rockchip.wks
+++ b/wic/rockchip.wks
@@ -16,12 +16,12 @@
 #   boot32768   229376
 #   root262144  -   (suggested)
 
-part loader1--offset 64s--fixed-size 4000K--source rawcopy 

--sourceparams="file=${SPL_BINARY}"
-part reserved1  --offset 8064s  --fixed-size 64K
-part reserved2  --offset 8192s  --fixed-size 4096K
-part loader2--offset 16384s --fixed-size 4096K--source rawcopy 

--sourceparams="file=u-boot.${UBOOT_SUFFIX}"
-part atf--offset 24576s --fixed-size 4096K
-part /boot  --offset 32768s --size   114688K --active --source 
bootimg-partition --fstype=vfat --label boot --use-uuid 
--sourceparams="loader=u-boot"
-part /--source rootfs  
  --fstype=ext4 --label root --use-uuid
+part loader1--offset 64s--fixed-size 4000K   --fstype=none
--source rawcopy   
--sourceparams="file=${SPL_BINARY}"
+part reserved1  --offset 8064s  --fixed-size 64K --fstype=none
+part reserved2  --offset 8192s  --fixed-size 4096K   --fstype=none
+part loader2--offset 16384s --fixed-size 4096K   --fstype=none
--source rawcopy   
--sourceparams="file=u-boot.${UBOOT_SUFFIX}"
+part atf--offset 24576s --fixed-size 4096K   --fstype=none
+part /boot  --offset 32768s --size   114688K --fstype=vfat --active   
--source bootimg-partition --label boot --use-uuid 
--sourceparams="loader=u-boot"
+part /   --fstype=ext4
--source rootfs--label root --use-uuid
 
 bootloader --ptable gpt --append="console=tty1 
console=${RK_CONSOLE_DEVICE},${RK_CONSOLE_BAUD}n8 rw rootfstype=ext4 
init=/sbin/init"
-- 
2.43.0.76.g1a87c842ece3


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



[yocto] [meta-rockchip][PATCH v4 1/5] rockchip.wks: specify offsets in sectors

2024-02-22 Thread Trevor Woerner
In WIC, size arguments can be optionally specified using one of a variety
of suffixes (e.g. K, M, G, etc.) thanks to sizetype(). One such suffix being
"s/S" for handling sector sizes which are assumed to be 512 bytes, rather than
the other size suffixes which are multiples of 1024 bytes.

Using the s/S sizetype allows the definition to match the documentation.
Unfortunately we can not use the s/S suffix for --fixed-size.

Reviewed-by: Quentin Schulz 
Signed-off-by: Trevor Woerner 
---
changes in v4:
- add Quentin's tag

changes in v3:
- new
---
 wic/rockchip.wks | 15 +++
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/wic/rockchip.wks b/wic/rockchip.wks
index fac0b8f70112..804e84ceb316 100644
--- a/wic/rockchip.wks
+++ b/wic/rockchip.wks
@@ -5,8 +5,7 @@
 # short-description: Create a disk image suitable for booting Rockchip from 
SD-card
 # long-description: Creates a disk image partitioned using GPT, suitable for 
Rockchip
 # Disk layout
-# Note that the reference documentation refers to 512 byte disk sectors, but
-# wic uses 1KB blocks. The following table uses 512 byte sectors:
+# See: https://opensource.rock-chips.com/wiki_Partitions
 #
 #   Partition   Start SectorNumber of Sectors
 #   loader1 64  8000(idbloader / U-Boot SPL)
@@ -17,12 +16,12 @@
 #   boot32768   229376
 #   root262144  -   (suggested)
 
-part loader1--offset 32 --fixed-size 4000K--source rawcopy 

--sourceparams="file=${SPL_BINARY}"
-part reserved1  --offset 4032   --fixed-size 64K
-part reserved2  --offset 4096   --fixed-size 4096K
-part loader2--offset 8192   --fixed-size 4096K--source rawcopy 

--sourceparams="file=u-boot.${UBOOT_SUFFIX}"
-part atf--offset 12288  --fixed-size 4096K
-part /boot  --offset 16384  --size   114688K --active --source 
bootimg-partition --fstype=vfat --label boot --use-uuid 
--sourceparams="loader=u-boot"
+part loader1--offset 64s--fixed-size 4000K--source rawcopy 

--sourceparams="file=${SPL_BINARY}"
+part reserved1  --offset 8064s  --fixed-size 64K
+part reserved2  --offset 8192s  --fixed-size 4096K
+part loader2--offset 16384s --fixed-size 4096K--source rawcopy 

--sourceparams="file=u-boot.${UBOOT_SUFFIX}"
+part atf--offset 24576s --fixed-size 4096K
+part /boot  --offset 32768s --size   114688K --active --source 
bootimg-partition --fstype=vfat --label boot --use-uuid 
--sourceparams="loader=u-boot"
 part /--source rootfs  
  --fstype=ext4 --label root --use-uuid
 
 bootloader --ptable gpt --append="console=tty1 
console=${RK_CONSOLE_DEVICE},${RK_CONSOLE_BAUD}n8 rw rootfstype=ext4 
init=/sbin/init"
-- 
2.43.0.76.g1a87c842ece3


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



Re: [yocto] [meta-rockchip][PATCH 3/4] remove /boot partition from wic:bootimg-paritition

2024-02-21 Thread Trevor Woerner
On Wed 2024-02-21 @ 07:31:17 PM, Quentin Schulz wrote:
> Hi Trevor,
> 
> On 2/18/24 18:28, Trevor Woerner wrote:
> > On Fri 2024-02-16 @ 10:31:36 AM, Quentin Schulz wrote:
> > > 
> > > 
> > > On 2/16/24 09:25, Trevor Woerner wrote:
> > > > On Thu 2024-02-15 @ 06:45:59 PM, Quentin Schulz wrote:
> > > > > Hi Trevor,
> > > > > 
> > > > > On 2/12/24 21:23, Trevor Woerner via lists.yoctoproject.org wrote:
> > > [...]
> > > > > > +UBOOT_EXTLINUX_KERNEL_IMAGE ?= "/boot/${KERNEL_IMAGETYPE}"
> > > > > 
> > > > > FWIW, I don't think /boot is required. bootstd/bootmeth in U-Boot 
> > > > > (upstream
> > > > > at the very least) will check for / and then /boot prefix for the 
> > > > > paths in
> > > > > extlinux.conf. Not providing /boot means if someone still wants to 
> > > > > use a
> > > > > separate boot partition, they wouldn't have to update this variable. 
> > > > > But
> > > > > since it's overridable, this is basically up to your preference.
> > > > 
> > > > This is a good example of working ahead. The next thing I have queued 
> > > > up is
> > > > a meta-rauc-rockchip example that works generically on all (most?) 
> > > > rockchip
> > > > boards. As part of the U-Boot script I need to make the A/B logic work, 
> > > > it
> > > > needs the "/boot" in there otherwise it doesn't work; therefore it's 
> > > > best to
> > > > set it up properly now.
> > > > 
> > > 
> > > Mmmm I'm interested to see why it fails without the /boot thing? Let's see
> > > when we get patches :)
> > 
> > I'm working on getting rauc working with meta-rockchip generically so it 
> > works
> > with all the MACHINES in meta-rockchip. The patch won't be part of
> > meta-rockchip, but rather be part of a 
> > meta-rauc-community/meta-rauc-rockchip
> > I hope to submit upstream at some point.
> > 
> > Basically rauc works with U-Boot via a boot script. To make that script more
> > flexible I'm borrowing a variable form meta-rockchip in the rauc U-Boot 
> > script
> > to actually do the booting of the kernel/fitImage/etc. So while U-Boot might
> > be smart enough to check a bunch of places looking for the thing to boot, 
> > the
> > rauc boot script isn't quite so smart. It's my script to write, and I could
> > add such logic, but that would just inflate the script for questionable 
> > gain.
> > 
> 
> This seems like you're not using extlinux.conf when using rauc but using one
> of the variables used to build the extlinux.conf to do some magic/logic in
> rauc?

I'm using sed to search and replace a tag in a U-Boot script template with
UBOOT_EXTLINUX_KERNEL_IMAGE which my U-Boot bbappend then turns into a U-Boot
script that handles the rauc A/B logic.

Specifically once it figures out whether to use A or B,
UBOOT_EXTLINUX_KERNEL_IMAGE is what is booted.

So keeping the initial "/boot/" part of UBOOT_EXTLINUX_KERNEL_IMAGE is useful
to me so the U-Boot script can find what it needs to boot in the filesystem
image. I could strip that prefix from the variable and include it as part of
the script template, but the current way provides the most flexibility. In
theory the fitImage could be located anywhere in the filesystem and the U-Boot
script would be able to find, load, and run it.

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



Re: [yocto] [meta-rockchip][PATCH v3 3/5] rockchip.wks: add most Rockchip partitions

2024-02-21 Thread Trevor Woerner
On Wed 2024-02-21 @ 07:38:41 PM, Quentin Schulz wrote:
> Hi Trevor,
> 
> On 2/19/24 18:48, Trevor Woerner via lists.yoctoproject.org wrote:
> > 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. Due to the
> > fact 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. This patch uses "--no-table" to only number the
> > partitions that are numbered in the Rockchip wiki, as well as to give these
> > partitions the partition numbers indicated in the wiki.
> > 
> > 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 SectorsPartition 
> > Size PartNum in GPTRequirements
> >  MBR 0  1   0001 512   
> > 0.5KB
> >  Primary GPT 1  000163  003F 32256 
> > 31.5KB
> >  loader1 64 004071041bc0 4096000   
> > 2.5MB1 preloader (miniloader or U-Boot SPL)
> >  Vendor Storage  7168   1c00512 0200 262144
> > 256KB  SN, MAC and etc.
> >  Reserved Space  7680   1e00384 0180 196608
> > 192KB  Not used
> >  reserved1   8064   1f80128 0080 65536 
> > 64KB   legacy DRM key
> >  U-Boot ENV  8128   1fc064  0040 32768 
> > 32KB
> >  reserved2   8192   200081922000 4194304   
> > 4MBlegacy parameter
> >  loader2 16384  400081922000 4194304   
> > 4MB  2 U-Boot or UEFI
> >  trust   24576  600081922000 4194304   
> > 4MB  3 trusted-os like ATF, OP-TEE
> >  boot32768  8000229376  00038000 117440512 
> > 112MB4 kernel, dtb, extlinux.conf, ramdisk
> >  rootfs  262144 0004-   -- 
> > -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: ----4D9B9EF0
> > 
> >  Device  Start End Sectors   Size Type
> >  /dev/mmcblk1p1 6480638000   3.9M Microsoft basic data
> >  /dev/mmcblk1p2   80648191 12864K Microsoft basic data
> >  /dev/mmcblk1p3   8192   163838192 4M Microsoft basic data
> >  /dev/mmcblk1p4  16384   245758192 4M Microsoft basic data
> >  /dev/mmcblk1p5  24576   327678192 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 (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

[yocto] [meta-rockchip][PATCH v3 5/5] rockchip.wks: wks file cleanup

2024-02-19 Thread Trevor Woerner
Cleanup the elements of the wic/rockchip.wks file so that they take up less
horizontal space.

Reviewed-by: Quentin Schulz 
Signed-off-by: Trevor Woerner 
---
changes in v3:
- tweaks to accommodate the existing changes

changes in v2:
- add Quentin's tag
---
 wic/rockchip.wks | 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/wic/rockchip.wks b/wic/rockchip.wks
index e8f0251272c1..0e929bc0749a 100644
--- a/wic/rockchip.wks
+++ b/wic/rockchip.wks
@@ -18,14 +18,14 @@
 #   atf 24576   8192(trusted OS e.g. ATF, OP-TEE, etc)
 #   root32768   -
 
-part loader1--offset 64s--fixed-size 3552K   --fstype=none
--source rawcopy  --sourceparams="file=${SPL_BINARY}"
-part v_storage  --offset 7168s  --fixed-size 256K--fstype=none --no-table
-part reserved   --offset 7680s  --fixed-size 192K--fstype=none --no-table
-part reserved1  --offset 8064s  --fixed-size 32K --fstype=none --no-table
-part uboot_env  --offset 8128s  --fixed-size 32K --fstype=none --no-table
-part reserved2  --offset 8192s  --fixed-size 4096K   --fstype=none --no-table
-part loader2--offset 16384s --fixed-size 4096K   --fstype=none
--source rawcopy  --sourceparams="file=u-boot.${UBOOT_SUFFIX}"
-part atf--offset 24576s --fixed-size 4096K   --fstype=none
-part /  --offset 32768s  --fstype=ext4 --active   
--source rootfs  --label root
+part loader1   --offset 64s--fixed-size 3552K --fstype=none --source 
rawcopy --sourceparams="file=${SPL_BINARY}"
+part v_storage --offset 7168s  --fixed-size 256K  --fstype=none --no-table
+part reserved  --offset 7680s  --fixed-size 192K  --fstype=none --no-table
+part reserved1 --offset 8064s  --fixed-size 32K   --fstype=none --no-table
+part uboot_env --offset 8128s  --fixed-size 32K   --fstype=none --no-table
+part reserved2 --offset 8192s  --fixed-size 4096K --fstype=none --no-table
+part loader2   --offset 16384s --fixed-size 4096K --fstype=none --source 
rawcopy --sourceparams="file=u-boot.${UBOOT_SUFFIX}"
+part atf   --offset 24576s --fixed-size 4096K --fstype=none
+part / --label root--active   --fstype=ext4 --source rootfs
 
 bootloader --ptable gpt
-- 
2.43.0.76.g1a87c842ece3


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



[yocto] [meta-rockchip][PATCH v3 4/5] remove /boot partition

2024-02-19 Thread Trevor Woerner
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

Signed-off-by: Trevor Woerner 
---
changes in v3:
- add back the comment explaining the need for NONFITDT
- change the inclusion of the u-boot-extlinux package from RRECOMMENDS
  to RDEPENDS
- clarify the commit message to remove the un-true statement that sizes
  are hard requirements
- add back the "--ptable gpt" line to rockchip.wks

changes in v2:
- add UBOOT_EXTLINUX_FDT and tweak UBOOT_EXTLINUX_FDTDIR to modify their
  behaviour based on whether or not KERNEL_IMAGETYPE is fitImage
- remove extraneous WKS_FILE_DEPENDS
- remove "--ptable gpt" from wks
- move newly added "earlycon" to UBOOT_EXTLINUX_CONSOLE
- re-word the commit message to better explain the behaviour of the
  Rockchip BootROM
---
 conf/machine/include/rockchip-defaults.inc |  2 ++
 conf/machine/include/rockchip-extlinux.inc | 24 ++
 conf/machine/include/rockchip-wic.inc  | 20 ++
 wic/rockchip.wks   | 12 +--
 4 files changed, 33 insertions(+), 25 deletions(-)
 create mode 100644 conf/machine/include/rockchip-extlinux.inc

diff --git a/conf/machine/include/rockchip-defaults.inc 
b/conf/machine/include/rockchip-defaults.inc
index 3ce2e246ab0b..2387eb909934 100644
--- a/conf/machine/include/rockchip-defaults.inc
+++ b/conf/machine/include/rockchip-defaults.inc
@@ -19,3 +19,5 @@ XSERVER = " \
 
 # misc
 SERIAL_CONSOLES ?= "150;ttyS2"
+RK_CONSOLE_BAUD ?= "${@d.getVar('SERIAL_CONSOLES').split(';')[0]}"
+RK_CONSOLE_DEVICE ?= "${@d.getVar('SERIAL_CONSOLES').split(';')[1].split()[0]}"
diff --git a/conf/machine/include/rockchip-extlinux.inc 
b/conf/machine/include/rockchip-extlinux.inc
new file mode 100644
index ..ca33f4c7f42a
--- /dev/null
+++ b/conf/machine/include/rockchip-extlinux.inc
@@ -0,0 +1,24 @@
+# KERNEL_DEVICETREE follows the pattern of
+# 'rockchip/${SOC_FAMILY}-${BOARD}.dtb' which is required when c

[yocto] [meta-rockchip][PATCH v3 3/5] rockchip.wks: add most Rockchip partitions

2024-02-19 Thread Trevor Woerner
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. Due to the
fact 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. This patch uses "--no-table" to only number the
partitions that are numbered in the Rockchip wiki, as well as to give these
partitions the partition numbers indicated in the wiki.

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 SectorsPartition Size  
   PartNum in GPTRequirements
MBR 0  1   0001 512   0.5KB
Primary GPT 1  000163  003F 32256 31.5KB
loader1 64 004071041bc0 4096000   2.5MB 
   1 preloader (miniloader or U-Boot SPL)
Vendor Storage  7168   1c00512 0200 262144256KB 
 SN, MAC and etc.
Reserved Space  7680   1e00384 0180 196608192KB 
 Not used
reserved1   8064   1f80128 0080 65536 64KB  
 legacy DRM key
U-Boot ENV  8128   1fc064  0040 32768 32KB
reserved2   8192   200081922000 4194304   4MB   
 legacy parameter
loader2 16384  400081922000 4194304   4MB   
   2 U-Boot or UEFI
trust   24576  600081922000 4194304   4MB   
   3 trusted-os like ATF, OP-TEE
boot32768  8000229376  00038000 117440512 112MB 
   4 kernel, dtb, extlinux.conf, ramdisk
rootfs  262144 0004-   -- -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: ----4D9B9EF0

Device  Start End Sectors   Size Type
/dev/mmcblk1p1 6480638000   3.9M Microsoft basic data
/dev/mmcblk1p2   80648191 12864K Microsoft basic data
/dev/mmcblk1p3   8192   163838192 4M Microsoft basic data
/dev/mmcblk1p4  16384   245758192 4M Microsoft basic data
/dev/mmcblk1p5  24576   327678192 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 (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: ----4D9B9EF0

Device  Start End Sectors   Size Type
/dev/mmcblk1p1 6471677104   3.5M Linux filesystem
/dev/mmcblk1p2  16384   245758192 4M Linux filesystem
/dev/mmcblk1p3  24576   327678192 4M Linux filesystem
/dev/mmcblk1p4  32768  330955  298188 145.6M Microsoft basic data
/dev/mmcblk1p5 330956 1504693 1173738 573.1M Linux filesystem

Reviewed-by: Quentin Schulz 
Signed-off-by: Trevor Woerner 
---
changes in v3:
- tweaked to accommodate offsets specified in sectors
- clarified that the first 2 partitions can not be added
- change name of vstorage to v_storage
- fixed typo (ATR -> ATF)
- added Quentin's tag

changes in v2:
- expand the commit message to show past, expected, and new behaviour
- spell out that vstorage stands for "vend

[yocto] [meta-rockchip][PATCH v3 2/5] rockchip.wks: specify fstype

2024-02-19 Thread Trevor Woerner
If the wks file doesn't specify, the assumption is that each partition
contains a vfat-formatted filesystem. Most of the partitions in the
Rockchip layout don't have filesystems. Implicitly setting the fstype to
vfat causes wic to format the partitions. It doesn't make sense to format
the rawcopy partitions as vfat just to immediately overwrite them with
binaries, and it wastes time formatting partitions that won't ever be used
as filesystems.

Reviewed-by: Quentin Schulz 
Signed-off-by: Trevor Woerner 
---
changes in v3:
- tweak to accommodate offsets specified in sectors

changes in v2:
- reword the commit message to add clarity
- add Quentin's tag
---
 wic/rockchip.wks | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/wic/rockchip.wks b/wic/rockchip.wks
index 804e84ceb316..42b731ac47b2 100644
--- a/wic/rockchip.wks
+++ b/wic/rockchip.wks
@@ -16,12 +16,12 @@
 #   boot32768   229376
 #   root262144  -   (suggested)
 
-part loader1--offset 64s--fixed-size 4000K--source rawcopy 

--sourceparams="file=${SPL_BINARY}"
-part reserved1  --offset 8064s  --fixed-size 64K
-part reserved2  --offset 8192s  --fixed-size 4096K
-part loader2--offset 16384s --fixed-size 4096K--source rawcopy 

--sourceparams="file=u-boot.${UBOOT_SUFFIX}"
-part atf--offset 24576s --fixed-size 4096K
-part /boot  --offset 32768s --size   114688K --active --source 
bootimg-partition --fstype=vfat --label boot --use-uuid 
--sourceparams="loader=u-boot"
-part /--source rootfs  
  --fstype=ext4 --label root --use-uuid
+part loader1--offset 64s--fixed-size 4000K   --fstype=none
--source rawcopy   
--sourceparams="file=${SPL_BINARY}"
+part reserved1  --offset 8064s  --fixed-size 64K --fstype=none
+part reserved2  --offset 8192s  --fixed-size 4096K   --fstype=none
+part loader2--offset 16384s --fixed-size 4096K   --fstype=none
--source rawcopy   
--sourceparams="file=u-boot.${UBOOT_SUFFIX}"
+part atf--offset 24576s --fixed-size 4096K   --fstype=none
+part /boot  --offset 32768s --size   114688K --fstype=vfat --active   
--source bootimg-partition --label boot --use-uuid 
--sourceparams="loader=u-boot"
+part /   --fstype=ext4
--source rootfs--label root --use-uuid
 
 bootloader --ptable gpt --append="console=tty1 
console=${RK_CONSOLE_DEVICE},${RK_CONSOLE_BAUD}n8 rw rootfstype=ext4 
init=/sbin/init"
-- 
2.43.0.76.g1a87c842ece3


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



[yocto] [meta-rockchip][PATCH v3 1/5] rockchip.wks: specify offsets in sectors

2024-02-19 Thread Trevor Woerner
In WIC, size arguments can be optionally specified using one of a variety
of suffixes (e.g. K, M, G, etc.) thanks to sizetype(). One such suffix being
"s/S" for handling sector sizes which are assumed to be 512 bytes, rather than
the other size suffixes which are multiples of 1024 bytes.

Using the s/S sizetype allows the definition to match the documentation.
Unfortunately we can not use the s/S suffix for --fixed-size.

Signed-off-by: Trevor Woerner 
---
changes in v3:
- new
---
 wic/rockchip.wks | 15 +++
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/wic/rockchip.wks b/wic/rockchip.wks
index fac0b8f70112..804e84ceb316 100644
--- a/wic/rockchip.wks
+++ b/wic/rockchip.wks
@@ -5,8 +5,7 @@
 # short-description: Create a disk image suitable for booting Rockchip from 
SD-card
 # long-description: Creates a disk image partitioned using GPT, suitable for 
Rockchip
 # Disk layout
-# Note that the reference documentation refers to 512 byte disk sectors, but
-# wic uses 1KB blocks. The following table uses 512 byte sectors:
+# See: https://opensource.rock-chips.com/wiki_Partitions
 #
 #   Partition   Start SectorNumber of Sectors
 #   loader1 64  8000(idbloader / U-Boot SPL)
@@ -17,12 +16,12 @@
 #   boot32768   229376
 #   root262144  -   (suggested)
 
-part loader1--offset 32 --fixed-size 4000K--source rawcopy 

--sourceparams="file=${SPL_BINARY}"
-part reserved1  --offset 4032   --fixed-size 64K
-part reserved2  --offset 4096   --fixed-size 4096K
-part loader2--offset 8192   --fixed-size 4096K--source rawcopy 

--sourceparams="file=u-boot.${UBOOT_SUFFIX}"
-part atf--offset 12288  --fixed-size 4096K
-part /boot  --offset 16384  --size   114688K --active --source 
bootimg-partition --fstype=vfat --label boot --use-uuid 
--sourceparams="loader=u-boot"
+part loader1--offset 64s--fixed-size 4000K--source rawcopy 

--sourceparams="file=${SPL_BINARY}"
+part reserved1  --offset 8064s  --fixed-size 64K
+part reserved2  --offset 8192s  --fixed-size 4096K
+part loader2--offset 16384s --fixed-size 4096K--source rawcopy 

--sourceparams="file=u-boot.${UBOOT_SUFFIX}"
+part atf--offset 24576s --fixed-size 4096K
+part /boot  --offset 32768s --size   114688K --active --source 
bootimg-partition --fstype=vfat --label boot --use-uuid 
--sourceparams="loader=u-boot"
 part /--source rootfs  
  --fstype=ext4 --label root --use-uuid
 
 bootloader --ptable gpt --append="console=tty1 
console=${RK_CONSOLE_DEVICE},${RK_CONSOLE_BAUD}n8 rw rootfstype=ext4 
init=/sbin/init"
-- 
2.43.0.76.g1a87c842ece3


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



Re: [yocto] [meta-rockchip][PATCH 3/4] remove /boot partition from wic:bootimg-paritition

2024-02-18 Thread Trevor Woerner
On Fri 2024-02-16 @ 10:31:36 AM, Quentin Schulz wrote:
> 
> 
> On 2/16/24 09:25, Trevor Woerner wrote:
> > On Thu 2024-02-15 @ 06:45:59 PM, Quentin Schulz wrote:
> > > Hi Trevor,
> > > 
> > > On 2/12/24 21:23, Trevor Woerner via lists.yoctoproject.org wrote:
> [...]
> > > > +UBOOT_EXTLINUX_KERNEL_IMAGE ?= "/boot/${KERNEL_IMAGETYPE}"
> > > 
> > > FWIW, I don't think /boot is required. bootstd/bootmeth in U-Boot 
> > > (upstream
> > > at the very least) will check for / and then /boot prefix for the paths in
> > > extlinux.conf. Not providing /boot means if someone still wants to use a
> > > separate boot partition, they wouldn't have to update this variable. But
> > > since it's overridable, this is basically up to your preference.
> > 
> > This is a good example of working ahead. The next thing I have queued up is
> > a meta-rauc-rockchip example that works generically on all (most?) rockchip
> > boards. As part of the U-Boot script I need to make the A/B logic work, it
> > needs the "/boot" in there otherwise it doesn't work; therefore it's best to
> > set it up properly now.
> > 
> 
> Mmmm I'm interested to see why it fails without the /boot thing? Let's see
> when we get patches :)

I'm working on getting rauc working with meta-rockchip generically so it works
with all the MACHINES in meta-rockchip. The patch won't be part of
meta-rockchip, but rather be part of a meta-rauc-community/meta-rauc-rockchip
I hope to submit upstream at some point.

Basically rauc works with U-Boot via a boot script. To make that script more
flexible I'm borrowing a variable form meta-rockchip in the rauc U-Boot script
to actually do the booting of the kernel/fitImage/etc. So while U-Boot might
be smart enough to check a bunch of places looking for the thing to boot, the
rauc boot script isn't quite so smart. It's my script to write, and I could
add such logic, but that would just inflate the script for questionable gain.

> > > > +UBOOT_EXTLINUX_LABELS ?= "default"
> > > > +UBOOT_EXTLINUX_MENU_DESCRIPTION:default ?= "${MACHINE}"
> > > > +
> > > > +MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += "u-boot-extlinux"
> > > 
> > > Is the image actually bootable if we do NOT have u-boot-extlinux 
> > > installed?
> > > I'm challenging the RRECOMMENDS basically. And wondering whether
> > > MACHINE_ESSENTIAL_EXTRA_* is always included (it seems like RDEPENDS one 
> > > is
> > > part of packagegroup-core-boot which is virtually installed in all 
> > > images).
> > 
> > I can double-check, but I'm pretty sure that line was added explicitly after
> > testing and noticing that it was needed. If we remove the extlinux artifacts
> > from the image, what boot method is U-Boot supposed to use?
> > 
> 
> I'm not saying it is not needed, I'm thinking _RRECOMMENDS is too weak and
> it should be _RDEPENDS instead?
> 
> I'm not sure the wic image (or rather the rootfs) is proper basically if
> u-boot-extlinux is not installed.
> 
> As for what U-Boot does if it doesn't find an extlinux.conf, it depends on
> what U-Boot is configured to do. If I rememebr correctly, most (all)
> Rockchip boards now use bootflow by default.
> 
> You can check the content of the bootcmd environment variable, that's what's
> started when the user does nothing to interrupt the boot.
> 
> For me on Jaguar RK3588:
> """
> > printenv bootcmd
> bootcmd=bootflow scan -lb
> """
> 
> remove the -b flag so it doesn't boot and you should have something
> reasonable.
> 
> For me:
> """
> => bootflow scan -lae
> Scanning for bootflows in all bootdevs
> Seq  Method   State   UclassPart  Name  Filename
> ---  ---  --      
> 
> Scanning global bootmeth 'efi_mgr':
>   0  efi_mgr  ready   (none)   0  
> Scanning bootdev 'mmc@fe2e.bootdev':
>   1  extlinux media   mmc  0  m...@fe2e.bootdev.whol
>  ** No partition found, err=-2: No such file or directory
>   2  script   media   mmc  0  m...@fe2e.bootdev.whol
>  ** No partition found, err=-2: No such file or directory
>   3  efi  media   mmc  0  m...@fe2e.bootdev.whol
>  ** No partition found, err=-2: No such file or directory
>   4  pxe  basemmc  0  m...@fe2e.bootdev.whol
>  ** No media/partition found, err=-524: Unknown error
>   5  extlinux media   mmc  1  m...@fe2e.bootdev.part
>  

Re: [yocto] [meta-rockchip][PATCH v2 3/4] remove /boot partition

2024-02-18 Thread Trevor Woerner
On Fri 2024-02-16 @ 11:06:03 AM, Quentin Schulz wrote:
> 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.

I appreciate pedantic, so don't hesitate to jump in. In fact up until this
point we have been playing fast and loose with the partition sizes, so I
already had proof that the sizing was not a hard dependency. And I never mind
in-depth explanations and experiences.

> 
> [...]
> 
> > diff --git a/conf/machine/include/rockchip-extlinux.inc 
> > b/conf/machine/include/rockchip-extlinux.inc
> > new file mode 100644
> > index ..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?

Done. But tweaked a little. The reasons for having it before (as part of the
boot files is slightly different than the reason for keeping it for EXTLINUX,
but very similar.

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

Ah got it. I misunderstood your comments. I thought you had been asking
whether it was necessary at all and I was pointing out that without that
package being added to the rootfs it wouldn't work.

Not a problem, I've upgraded it from a recommendation to a dependency.

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#62535): https://lists.yoctoproject.org/g/yocto/message/62535
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]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [yocto] [meta-rockchip][PATCH v2 2/4] rockchip.wks: add all Rockchip partitions

2024-02-18 Thread Trevor Woerner
On Fri 2024-02-16 @ 10:48:59 AM, Quentin Schulz wrote:
> Hi Trevor,
> 
> On 2/16/24 09:29, Trevor Woerner via lists.yoctoproject.org wrote:
> > 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
> > 
> > Note: in the Rockchip layout, not all partitions are expected to show up
> > in the gpt partition table. This patch uses "--no-table" to only number the
> > partitions that are numbered in the Rockchip wiki, as well as to give these
> > partitions the partition numbers indicated in the wiki.
> > 
> > Note: there is a mistake in the Rockchip table (which I've copied
> > verbatim here). 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 SectorsPartition Size  
> >PartNum in GPTRequirements
> > MBR 0  1   0001 512   0.5KB
> > Primary GPT 1  000163  003F 32256 31.5KB
> > loader1 64 004071041bc0 4096000   2.5MB 
> >1 preloader (miniloader or U-Boot SPL)
> > Vendor Storage  7168   1c00512 0200 262144256KB 
> >  SN, MAC and etc.
> > Reserved Space  7680   1e00384 0180 196608192KB 
> >  Not used
> > reserved1   8064   1f80128 0080 65536 64KB  
> >  legacy DRM key
> > U-Boot ENV  8128   1fc064  0040 32768 32KB
> > reserved2   8192   200081922000 4194304   4MB   
> >  legacy parameter
> > loader2 16384  400081922000 4194304   4MB   
> >2 U-Boot or UEFI
> > trust   24576  600081922000 4194304   4MB   
> >3 trusted-os like ATF, OP-TEE
> > boot32768  8000229376  00038000 117440512 112MB 
> >4 kernel, dtb, extlinux.conf, ramdisk
> > rootfs  262144 0004-   -- -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: ----4D9B9EF0
> > 
> > Device  Start End Sectors   Size Type
> > /dev/mmcblk1p1 6480638000   3.9M Microsoft basic data
> > /dev/mmcblk1p2   80648191 12864K Microsoft basic data
> > /dev/mmcblk1p3   8192   163838192 4M Microsoft basic data
> > /dev/mmcblk1p4  16384   245758192 4M Microsoft basic data
> > /dev/mmcblk1p5  24576   327678192 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 (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: ----00004D9B9EF0
> > 
> > Device  Start End Sectors   Size Type
> > /dev/mmcblk1p1 6471677104   3.5M Linux filesystem
> > /dev/mmcblk1p2  16384   245758192 4M Linux filesystem
> > /dev/mmcblk1p3  24576   327678192 4M Linux filesystem
> > /dev/mmcblk1p4  32768  330955  298188 145.6M Microsoft basic data
> > /dev/mmcblk1p5 330956 1504693 1173738 573.1M Linux filesystem
> > 
> > Signed-off-by: Trevor Woerner 
> &

Re: [yocto] [meta-rockchip][PATCH v2 2/4] rockchip.wks: add all Rockchip partitions

2024-02-17 Thread Trevor Woerner
On Sat 2024-02-17 @ 06:58:27 AM, Stephen Chen wrote:
> On Fri, Feb 16, 2024 at 04:29 PM, Trevor Woerner wrote:
> 
> > 
> > +# atf 24576 8192 (trusted OS e.g. ATR, OP-TEE, etc)
> 
> Is it a typo? Use ATF instead of ATR?

Oops yes! Good catch, thank you.

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



[yocto] [meta-rockchip][PATCH v2 4/4] wks file cleanup

2024-02-16 Thread Trevor Woerner
Cleanup the elements of the wic/rockchip.wks file so they take up less
horizontal space.

Reviewed-by: Quentin Schulz 
Signed-off-by: Trevor Woerner 
---
changes in v2:
- add Quentin's tag
---
 wic/rockchip.wks | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/wic/rockchip.wks b/wic/rockchip.wks
index 4fccdf668c50..1dcd9d69ada6 100644
--- a/wic/rockchip.wks
+++ b/wic/rockchip.wks
@@ -19,12 +19,12 @@
 #   atf 24576   8192(trusted OS e.g. ATR, OP-TEE, etc)
 #   root32768   -
 
-part loader1--offset 32 --fixed-size 3552K--fstype=none
--source rawcopy   
--sourceparams="file=${SPL_BINARY}"
+part loader1--offset 32 --fixed-size 3552K--fstype=none
--source rawcopy  --sourceparams="file=${SPL_BINARY}"
 part vstorage   --offset 3584   --fixed-size 256K --fstype=none  --no-table
 part reserved   --offset 3840   --fixed-size 192K --fstype=none  --no-table
 part reserved1  --offset 4032   --fixed-size 32K  --fstype=none  --no-table
 part uboot_env  --offset 4064   --fixed-size 32K  --fstype=none  --no-table
 part reserved2  --offset 4096   --fixed-size 4096K--fstype=none  --no-table
-part loader2--offset 8192   --fixed-size 4096K--fstype=none
--source rawcopy   
--sourceparams="file=u-boot.${UBOOT_SUFFIX}"
+part loader2--offset 8192   --fixed-size 4096K--fstype=none
--source rawcopy  --sourceparams="file=u-boot.${UBOOT_SUFFIX}"
 part atf--offset 12288  --fixed-size 4096K--fstype=none
-part /  --offset 16384--fstype=ext4  --active  
--source rootfs--label root
+part /  --offset 16384  --active  --fstype=ext4  --label 
root  --source rootfs
-- 
2.43.0.76.g1a87c842ece3


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



[yocto] [meta-rockchip][PATCH v2 3/4] remove /boot partition

2024-02-16 Thread Trevor Woerner
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
BOOTROM etched inside the Rockchip SoCs is programmed to load and run a
validated binary it finds at this location. The locations, sizes, and
contents 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.

Signed-off-by: Trevor Woerner 
---
changes in v2:
- add UBOOT_EXTLINUX_FDT and tweak UBOOT_EXTLINUX_FDTDIR to modify their
  behaviour based on whether or not KERNEL_IMAGETYPE is fitImage
- remove extraneous WKS_FILE_DEPENDS
- remove "--ptable gpt" from wks
- move newly added "earlycon" to UBOOT_EXTLINUX_CONSOLE
- re-word the commit message to better explain the behaviour of the
  Rockchip BootROM
---
 conf/machine/include/rockchip-defaults.inc |  2 ++
 conf/machine/include/rockchip-extlinux.inc | 12 
 conf/machine/include/rockchip-wic.inc  | 20 ++--
 wic/rockchip.wks   |  8 ++--
 4 files changed, 18 insertions(+), 24 deletions(-)
 create mode 100644 conf/machine/include/rockchip-extlinux.inc

diff --git a/conf/machine/include/rockchip-defaults.inc 
b/conf/machine/include/rockchip-defaults.inc
index 3ce2e246ab0b..2387eb909934 100644
--- a/conf/machine/include/rockchip-defaults.inc
+++ b/conf/machine/include/rockchip-defaults.inc
@@ -19,3 +19,5 @@ XSERVER = " \
 
 # misc
 SERIAL_CONSOLES ?= "150;ttyS2"
+RK_CONSOLE_BAUD ?= "${@d.getVar('SERIAL_CONSOLES').split(';')[0]}"
+RK_CONSOLE_DEVICE ?= "${@d.getVar('SERIAL_CONSOLES').split(';')[1].split()[0]}"
diff --git a/conf/machine/include/rockchip-extlinux.inc 
b/conf/machine/include/rockchip-extlinux.inc
new file mode 100644
index ..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]}"
+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 ?= 

[yocto] [meta-rockchip][PATCH v2 2/4] rockchip.wks: add all Rockchip partitions

2024-02-16 Thread Trevor Woerner
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

Note: in the Rockchip layout, not all partitions are expected to show up
in the gpt partition table. This patch uses "--no-table" to only number the
partitions that are numbered in the Rockchip wiki, as well as to give these
partitions the partition numbers indicated in the wiki.

Note: there is a mistake in the Rockchip table (which I've copied
verbatim here). 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 SectorsPartition Size  
   PartNum in GPTRequirements
MBR 0  1   0001 512   0.5KB
Primary GPT 1  000163  003F 32256 31.5KB
loader1 64 004071041bc0 4096000   2.5MB 
   1 preloader (miniloader or U-Boot SPL)
Vendor Storage  7168   1c00512 0200 262144256KB 
 SN, MAC and etc.
Reserved Space  7680   1e00384 0180 196608192KB 
 Not used
reserved1   8064   1f80128 0080 65536 64KB  
 legacy DRM key
U-Boot ENV  8128   1fc064  0040 32768 32KB
reserved2   8192   200081922000 4194304   4MB   
 legacy parameter
loader2 16384  400081922000 4194304   4MB   
   2 U-Boot or UEFI
trust   24576  600081922000 4194304   4MB   
   3 trusted-os like ATF, OP-TEE
boot32768  8000229376  00038000 117440512 112MB 
   4 kernel, dtb, extlinux.conf, ramdisk
rootfs  262144 0004-   -- -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: ----4D9B9EF0

Device  Start End Sectors   Size Type
/dev/mmcblk1p1 6480638000   3.9M Microsoft basic data
/dev/mmcblk1p2   80648191 12864K Microsoft basic data
/dev/mmcblk1p3   8192   163838192 4M Microsoft basic data
/dev/mmcblk1p4  16384   245758192 4M Microsoft basic data
/dev/mmcblk1p5  24576   327678192 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 (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: ----4D9B9EF0

Device  Start End Sectors   Size Type
/dev/mmcblk1p1 6471677104   3.5M Linux filesystem
/dev/mmcblk1p2  16384   245758192 4M Linux filesystem
/dev/mmcblk1p3  24576   327678192 4M Linux filesystem
/dev/mmcblk1p4  32768  330955  298188 145.6M Microsoft basic data
/dev/mmcblk1p5 330956 1504693 1173738 573.1M Linux filesystem

Signed-off-by: Trevor Woerner 
---
changes in v2:
- expand the commit message to show past, expected, and new behaviour
- spell out that vstorage stands for "vendor storage"
---
 wic/rockchip.wks | 20 +---
 1 file changed, 13 insertions(+), 7 deletions(-)

diff --git a/wic/rockchip.wks b/wic/rockchip.wks
index b14ec0d1690a..034443d90050 100644
--- a/wic/rockchip.wks
+++ b/wic/rockchip.wks
@@ -9,17 +9,23 @@
 # wic uses 1KB blocks. The following table uses 512 byte sectors:
 #
 #   Partition   Start SectorNumber of Sectors
-#   loader1 64  8000(idbloader / U-Boot SPL)
-#   reserved1   8064128
-#   reserved2   81928192
+#   loader1 64  7104(idbloader / U-Boot SPL)
+#   vstorage716

[yocto] [meta-rockchip][PATCH v2 1/4] rockchip.wks: specify fstype

2024-02-16 Thread Trevor Woerner
If the wks file doesn't specify, the assumption is that each partition
contains a vfat-formatted filesystem. Most of the partitions in the
Rockchip layout don't have filesystems. Implicitly setting the fstype to
vfat causes wic to format the partitions. It doesn't make sense to format
the rawcopy partitions as vfat just to immediately overwrite them with
binaries, and it wastes time formatting partitions that won't ever be used
as filesystems.

Reviewed-by: Quentin Schulz 
Signed-off-by: Trevor Woerner 
---
changes in v2:
- reword the commit message to add clarity
- add Quentin's tag
---
 wic/rockchip.wks | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/wic/rockchip.wks b/wic/rockchip.wks
index fac0b8f70112..b14ec0d1690a 100644
--- a/wic/rockchip.wks
+++ b/wic/rockchip.wks
@@ -17,12 +17,12 @@
 #   boot32768   229376
 #   root262144  -   (suggested)
 
-part loader1--offset 32 --fixed-size 4000K--source rawcopy 

--sourceparams="file=${SPL_BINARY}"
-part reserved1  --offset 4032   --fixed-size 64K
-part reserved2  --offset 4096   --fixed-size 4096K
-part loader2--offset 8192   --fixed-size 4096K--source rawcopy 

--sourceparams="file=u-boot.${UBOOT_SUFFIX}"
-part atf--offset 12288  --fixed-size 4096K
-part /boot  --offset 16384  --size   114688K --active --source 
bootimg-partition --fstype=vfat --label boot --use-uuid 
--sourceparams="loader=u-boot"
-part /--source rootfs  
  --fstype=ext4 --label root --use-uuid
+part loader1--offset 32 --fixed-size 4000K--fstype=none
--source rawcopy   
--sourceparams="file=${SPL_BINARY}"
+part reserved1  --offset 4032   --fixed-size 64K  --fstype=none
+part reserved2  --offset 4096   --fixed-size 4096K--fstype=none
+part loader2--offset 8192   --fixed-size 4096K--fstype=none
--source rawcopy   
--sourceparams="file=u-boot.${UBOOT_SUFFIX}"
+part atf--offset 12288  --fixed-size 4096K--fstype=none
+part /boot  --offset 16384  --size   114688K  --fstype=vfat  --active  
--source bootimg-partition --label boot --use-uuid 
--sourceparams="loader=u-boot"
+part /--fstype=ext4
--source rootfs--label root --use-uuid
 
 bootloader --ptable gpt --append="console=tty1 
console=${RK_CONSOLE_DEVICE},${RK_CONSOLE_BAUD}n8 rw rootfstype=ext4 
init=/sbin/init"
-- 
2.43.0.76.g1a87c842ece3


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



Re: [yocto] [meta-rockchip][PATCH 3/4] remove /boot partition from wic:bootimg-paritition

2024-02-16 Thread Trevor Woerner
On Thu 2024-02-15 @ 06:45:59 PM, Quentin Schulz wrote:
> Hi Trevor,
> 
> On 2/12/24 21:23, 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 locations and sizes of the SPL and U-Boot partitions are hard
> > dependencies since the BOOTROM etched inside the Rockchip SoCs is > 
> > programmed to blindly load and run what it finds at these locations. The
> 
> What matters is the location of TPL+SPL, U-Boot proper can be
> programmatically be put anywhere (not where TPL+SPL is of course :) ). The
> SPL actually stores in itself where to look for U-Boot proper in the storage
> media (and different storage media may have different locations, we have
> this for Puma RK3399 which has a differnet location for U-Boot proper on
> SPI-NOR and on eMMC/SD card). We do this on Puma RK3399 and Ringneck PX30
> for example (but we're not using this wks file so this isn't really
> relevant). Also, IIRC, the BootROM tries a few locations for the TPL+SPL in
> the boot storage medium (e.g. every 32KB offsets for the first 2/3/4).
> 
> Also, "blindly" is a bit of a stretch, the BootROM checks for a magic header
> value and then another magic string (e.g. RK33 for RK3399 and PX30). RK3568
> and RK3588 have a different header layout also (headerv1 vs headerv2).
> There's also secure boot that is possible, doing a bunch of extra checks
> directly from the BootROM, etc. :)

Good points. I've updated the commit message accordingly.

> > locations, sizes, and contents 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
> > bootimg-partition.
> > 
> > Also, 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.
> > 
> 
> And now users would have to update a potentially multi-gigabyte image only
> to update their kernel or dtb :)
> 
> > The boot partition 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.
> 
> This means the boot partition is going away :) which is confirmed by the
> change in wic/rockchip.wks.
> 
> I think you meant to say the boot directory is not going away, or rather the
> content of the boot partition is not going away?

Yes.

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

Re: [yocto] [meta-rockchip][PATCH 2/4] rockchip.wks: add all Rockchip partitions

2024-02-15 Thread Trevor Woerner
On Thu 2024-02-15 @ 06:06:42 PM, Quentin Schulz wrote:
> Hi Trevor,
> 
> On 2/12/24 21:23, Trevor Woerner via lists.yoctoproject.org wrote:
> > 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
> > 
> > Signed-off-by: Trevor Woerner 
> > ---
> >   wic/rockchip.wks | 18 --
> >   1 file changed, 12 insertions(+), 6 deletions(-)
> > 
> > diff --git a/wic/rockchip.wks b/wic/rockchip.wks
> > index b14ec0d1690a..8dc4d20f2f54 100644
> > --- a/wic/rockchip.wks
> > +++ b/wic/rockchip.wks
> > @@ -9,16 +9,22 @@
> >   # wic uses 1KB blocks. The following table uses 512 byte sectors:
> >   #
> >   #   Partition   Start SectorNumber of Sectors
> > -#   loader1 64  8000(idbloader / U-Boot SPL)
> > -#   reserved1   8064128
> > -#   reserved2   81928192
> > +#   loader1 64  7104(idbloader / U-Boot SPL)
> > +#   vstorage7168512 (serial number, MAC address, 
> > etc)
> > +#   reserved7680384 (not used)
> > +#   reserved1   806464  (legacy DRM key)
> > +#   uboot_env   812864  (U-Boot environment)
> > +#   reserved2   81928192(legacy parameters, ATAGS, etc)
> >   #   loader2 16384   8192(U-Boot proper)
> > -#   atf 24576   8192
> > +#   atf 24576   8192(trusted OS e.g. ATR, OP-TEE, 
> > etc)
> >   #   boot32768   229376
> >   #   root262144  -   (suggested)
> > -part loader1--offset 32 --fixed-size 4000K--fstype=none
> > --source rawcopy   
> > --sourceparams="file=${SPL_BINARY}"
> > -part reserved1  --offset 4032   --fixed-size 64K  --fstype=none
> > +part loader1--offset 32 --fixed-size 3552K--fstype=none
> > --source rawcopy   
> > --sourceparams="file=${SPL_BINARY}"
> > +part vstorage   --offset 3584   --fixed-size 256K --fstype=none
> > +part reserved   --offset 3840   --fixed-size 192K --fstype=none
> > +part reserved1  --offset 4032   --fixed-size 32K  --fstype=none
> > +part uboot_env  --offset 4064   --fixed-size 32K  --fstype=none
> >   part reserved2  --offset 4096   --fixed-size 4096K--fstype=none
> >   part loader2--offset 8192   --fixed-size 4096K--fstype=none   
> >  --source rawcopy   
> > --sourceparams="file=u-boot.${UBOOT_SUFFIX}"
> >   part atf--offset 12288  --fixed-size 4096K--fstype=none
> > 
> 
> This is... quite dangerous. I assume people access raw partitions via their
> index number, and now they would be changed, making it harder to do partial
> updates. It depends how one sees this file, but could be seen as immutable
> for existing partitions to avoid backward compatibility issues.

I don't think that's a huge problem, but I could be wrong. People will see
their builds fail, investigate, update, and move on?

But I think I saw something in wic about not adding a partition to the table,
or not giving it a number? So it might be possible to define these partitions
and not change the numbers? I could look into it a bit more.


> I was wondering whether there is support for partition labels or something
> like that for raw partitions, but doesn't seem like it. Which is quite odd,
> wouldn't that kind of information be stored in the partition table for
> example?

Yes, I noticed some things that should probably be there and aren't, such as
the label thing you point out. Also not formatting raw partitions; or not
requiring an explicit fstype on raw partitions to keep from formatting them.

> Also, maybe use sectors for offsets and fixed-sizes since you document them
> this way? S is the suffix for it.
> 
> Random thought, but we could probably also get the env from U-Boot recipe
> (or any other recipe that generates one) (if one is generated) and install
> it into uboot_env partition?

That's exactly where I'm going with this. I already have a spreadsheet
listing all the rockchip devices, and their U-Boot environment configurations
(location, size, etc) to see which ones come with environment configurations,
and to make sure they're all the correct location and size for those that do
(they are). I also already have Yocto pieces generating and placing
the U-Boot environment in the U-Boot environment p

Re: [yocto] bmap-tools repository closes

2024-01-26 Thread Trevor Woerner
On Fri 2024-01-26 @ 01:33:15 PM, Richard Purdie wrote:
> On Thu, 2024-01-25 at 17:58 -0500, Philip Balister wrote:
> > On 1/25/24 11:58, Trevor Woerner wrote:
> > > On Wed 2024-01-24 @ 03:16:04 PM, Tim Orling wrote:
> > > > On Wed, Jan 24, 2024 at 2:02 PM Joshua Watt  
> > > > wrote:
> > > > 
> > > > > On Wed, Jan 24, 2024 at 10:59 AM Trevor Woerner 
> > > > > wrote:
> > > > > > 
> > > > > > Hi Artem,
> > > > > > 
> > > > > > On Wed 2024-01-24 @ 02:01:08 PM, Artem Bityutskiy wrote:
> > > > > > > Hello Yocto community,
> > > > > > > 
> > > > > > > some parts of Yocto software (MIC?) use the 'bmap-tools' project 
> > > > > > > to
> > > > > speed up
> > > > > > > image flashing.
> > > > > > > 
> > > > > > > https://github.com/intel/bmap-tools
> > > > > > > 
> > > > > > > I am the original author of the software, and I created it many 
> > > > > > > years
> > > > > ago to
> > > > > > > speed up Tizen image flashing, and it helped a lot back at the 
> > > > > > > time.
> > > > > It was also
> > > > > > > my first python project, so it was a lot of fun learning python 
> > > > > > > while
> > > > > also
> > > > > > > creating something useful.
> > > > > > 
> > > > > > Thank you for your contribution, this tool has been quite useful 
> > > > > > for me
> > > > > over
> > > > > > the years.
> > > > > > 
> > > > > > > But after that, I stopped working on it and it was mostly Yocto 
> > > > > > > folks
> > > > > who
> > > > > > > contributed changes here and there. I never had time and enough
> > > > > motivation to
> > > > > > > maintain the project further, but other folks helped.
> > > > > > > 
> > > > > > > Simon McVitte was active maintainer, but he said he does not have 
> > > > > > > time
> > > > > for it
> > > > > > > now as well.
> > > > > > > 
> > > > > > > The project is in "github.com/intel" space, and Intel is going to
> > > > > archive the
> > > > > > > git repository soon. This basically means the repository becomes
> > > > > read-only soon.
> > > > > > 
> > > > > > Thank you for this update and letting us know ahead of time.
> > > > > > 
> > > > > > > Would Yocto community have enthusiasts to fork it and maintain the
> > > > > fork?
> > > > > > 
> > > > > > Yes, I'll volunteer to maintain it going forward. My 
> > > > > > non-stackoverflow
> > > > > python
> > > > > > knowledge is minimal, but I recently dug deeply into bmaptools to 
> > > > > > solve
> > > > > an
> > > > > > issue I had noticed. So I'm confident enough to take it over if 
> > > > > > nobody
> > > > > else is
> > > > > > interested.
> > > > > 
> > > > > Ya, it's an awesome tool and a huge time saver for us, so can also
> > > > > help maintain it
> > > > > 
> > > > 
> > > > We can probably move it under the https://github.com/yoctoproject 
> > > > umbrella?
> > > > I can also help maintain this tremendous time saver.
> > > 
> > > https://github.com/yoctoproject and the github workflow is fine with me as
> > > long as I can commit to it from my @gmail identity.
> > > 
> > > @tim do you want to import the current repository from intel? Then we can
> > > update the recipe in oe-core and go from there.
> > > 
> > 
> > Michael, if you need any support from the Yocto Project advisory board 
> > to move bmaptool to the yoctoproject github, I can help with that.
> 
> This falls to the YP TSC, not the board.
> 
> I have no problem with the project hosting that git repo and
> maintaining it. I do worry quite a bit about moving it to github. Would
> moiving it to git.yoctoproject.org be ok?
> 
> The reason I say this is that I already get a lot of comments/randon
> questions against commits in github repos. I feel quite sad that people
> are effectively talking into a void. If we start supporting different
> workflows for different repos under yoctoproject, we're going to really
> confuse people.
> 
> You might argue that we should host issues for bmap-tools. The
> challenge is that we have bugzilla, we have a triage team and we have a
> load of processes. Telling those people to just cover both would likely
> result in a flat refusal.

git.yoctoproject.org and mailing lists are my preferred workflow, especially
now that the oe/yp lists are in lore. But if others wanted it on github I
wasn't feeling strongly about it.

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



Re: [yocto] bmap-tools repository closes

2024-01-25 Thread Trevor Woerner
On Wed 2024-01-24 @ 03:16:04 PM, Tim Orling wrote:
> On Wed, Jan 24, 2024 at 2:02 PM Joshua Watt  wrote:
> 
> > On Wed, Jan 24, 2024 at 10:59 AM Trevor Woerner 
> > wrote:
> > >
> > > Hi Artem,
> > >
> > > On Wed 2024-01-24 @ 02:01:08 PM, Artem Bityutskiy wrote:
> > > > Hello Yocto community,
> > > >
> > > > some parts of Yocto software (MIC?) use the 'bmap-tools' project to
> > speed up
> > > > image flashing.
> > > >
> > > > https://github.com/intel/bmap-tools
> > > >
> > > > I am the original author of the software, and I created it many years
> > ago to
> > > > speed up Tizen image flashing, and it helped a lot back at the time.
> > It was also
> > > > my first python project, so it was a lot of fun learning python while
> > also
> > > > creating something useful.
> > >
> > > Thank you for your contribution, this tool has been quite useful for me
> > over
> > > the years.
> > >
> > > > But after that, I stopped working on it and it was mostly Yocto folks
> > who
> > > > contributed changes here and there. I never had time and enough
> > motivation to
> > > > maintain the project further, but other folks helped.
> > > >
> > > > Simon McVitte was active maintainer, but he said he does not have time
> > for it
> > > > now as well.
> > > >
> > > > The project is in "github.com/intel" space, and Intel is going to
> > archive the
> > > > git repository soon. This basically means the repository becomes
> > read-only soon.
> > >
> > > Thank you for this update and letting us know ahead of time.
> > >
> > > > Would Yocto community have enthusiasts to fork it and maintain the
> > fork?
> > >
> > > Yes, I'll volunteer to maintain it going forward. My non-stackoverflow
> > python
> > > knowledge is minimal, but I recently dug deeply into bmaptools to solve
> > an
> > > issue I had noticed. So I'm confident enough to take it over if nobody
> > else is
> > > interested.
> >
> > Ya, it's an awesome tool and a huge time saver for us, so can also
> > help maintain it
> >
> 
> We can probably move it under the https://github.com/yoctoproject umbrella?
> I can also help maintain this tremendous time saver.

https://github.com/yoctoproject and the github workflow is fine with me as
long as I can commit to it from my @gmail identity.

@tim do you want to import the current repository from intel? Then we can
update the recipe in oe-core and go from there.

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



Re: [yocto] [meta-rockchip][PATCH] u-boot: make rock-pi-e patches only for rock-pi-e

2024-01-24 Thread Trevor Woerner
On Wed 2024-01-24 @ 12:51:13 PM, Trevor Woerner via lists.yoctoproject.org 
wrote:
> The U-Boot patches that were added recently are only for the rock-pi-e
> MACHINE, therefore only apply them when building for rock-pi-e.
> 
> Fixes: b5bba3a01197 ("rock-pi-e: apply upstream PHY fix")
Reviewed-by: Quentin Schulz 
> Signed-off-by: Trevor Woerner 
> ---
>  recipes-bsp/u-boot/u-boot%.bbappend | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied to meta-rockchip, master branch.

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



Re: [yocto] [meta-rockchip][PATCH v2] KERNEL_DEVICETREE: 32-bit re-org

2024-01-24 Thread Trevor Woerner
On Tue 2024-01-23 @ 10:24:16 PM, Trevor Woerner via lists.yoctoproject.org 
wrote:
> The upstream kernel reorganized the 32-bit arch/arm device-tree directory
> structure to separate out the device-trees by manufacturer (similar to the
> organization of the arch/arm64 device-trees). Update the references to
> 32-bit arm device-trees to match.
> 
> This patch can now be applied since all pre-6.5-rc1 kernels have been
> removed from oe-core.
> 
> NOTE: trying to build a post-6.5-rc1 32-bit kernel with this patch applied
>   will fail
> 
> Signed-off-by: Trevor Woerner 
> Signed-off-by: Stephen Chen 
> ---
>  classes/rockchip-gpt-img.bbclass  | 2 +-
>  conf/machine/firefly-rk3288.conf  | 2 +-
>  conf/machine/include/rockchip-wic.inc | 6 +-
>  conf/machine/marsboard-rk3066.conf| 2 +-
>  conf/machine/radxarock.conf   | 2 +-
>  conf/machine/rock2-square.conf| 2 +-
>  conf/machine/tinker-board-s.conf  | 2 +-
>  conf/machine/tinker-board.conf| 2 +-
>  conf/machine/vyasa-rk3288.conf| 2 +-
>  9 files changed, 13 insertions(+), 9 deletions(-)

Applied to meta-rockchip, master branch.

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



Re: [yocto] [meta-rockchip][PATCH] u-boot: make rock-pi-e patches only for rock-pi-e

2024-01-24 Thread Trevor Woerner
On Wed 2024-01-24 @ 06:56:01 PM, Quentin Schulz wrote:
> Hi Trevor,
> 
> On 1/24/24 18:51, Trevor Woerner via lists.yoctoproject.org wrote:
> > The U-Boot patches that were added recently are only for the rock-pi-e
> > MACHINE, therefore only apply them when building for rock-pi-e.
> > 
> > Fixes: b5bba3a01197 ("rock-pi-e: apply upstream PHY fix")
> > Signed-off-by: Trevor Woerner 
> 
> Reviewed-by: Quentin Schulz 
> 
> What a nice timing, got "bothered" by this a few hours ago but got
> sidetracked :)
> 
> I **think** this would make more sense in a u-boot_2024.01.bbappend though,
> since it'll likely only apply on top of that version :)

Hopefully these patches go upstream soon, when it does my nightly build will
fail, and I can remove it the next day. But if the patches don't get into the
next release then rock-pi-e's second ethernet will stop working again if we
make it version-specific.

> Cheers,
> Quentin

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



Re: [yocto] bmap-tools repository closes

2024-01-24 Thread Trevor Woerner
Hi Artem,

On Wed 2024-01-24 @ 02:01:08 PM, Artem Bityutskiy wrote:
> Hello Yocto community,
> 
> some parts of Yocto software (MIC?) use the 'bmap-tools' project to speed up
> image flashing.
> 
> https://github.com/intel/bmap-tools
> 
> I am the original author of the software, and I created it many years ago to
> speed up Tizen image flashing, and it helped a lot back at the time. It was 
> also
> my first python project, so it was a lot of fun learning python while also
> creating something useful.

Thank you for your contribution, this tool has been quite useful for me over
the years.

> But after that, I stopped working on it and it was mostly Yocto folks who
> contributed changes here and there. I never had time and enough motivation to
> maintain the project further, but other folks helped.
> 
> Simon McVitte was active maintainer, but he said he does not have time for it
> now as well.
> 
> The project is in "github.com/intel" space, and Intel is going to archive the
> git repository soon. This basically means the repository becomes read-only 
> soon.

Thank you for this update and letting us know ahead of time.

> Would Yocto community have enthusiasts to fork it and maintain the fork?

Yes, I'll volunteer to maintain it going forward. My non-stackoverflow python
knowledge is minimal, but I recently dug deeply into bmaptools to solve an
issue I had noticed. So I'm confident enough to take it over if nobody else is
interested.

Best regards,
Trevor

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



[yocto] [meta-rockchip][PATCH] u-boot: make rock-pi-e patches only for rock-pi-e

2024-01-24 Thread Trevor Woerner
The U-Boot patches that were added recently are only for the rock-pi-e
MACHINE, therefore only apply them when building for rock-pi-e.

Fixes: b5bba3a01197 ("rock-pi-e: apply upstream PHY fix")
Signed-off-by: Trevor Woerner 
---
 recipes-bsp/u-boot/u-boot%.bbappend | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/recipes-bsp/u-boot/u-boot%.bbappend 
b/recipes-bsp/u-boot/u-boot%.bbappend
index 292530c5ad40..f8378d91ce68 100644
--- a/recipes-bsp/u-boot/u-boot%.bbappend
+++ b/recipes-bsp/u-boot/u-boot%.bbappend
@@ -1,5 +1,5 @@
 FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
-SRC_URI += " \
+SRC_URI:append:rock-pi-e = " \
file://PATCH_1-2_net_designware_Reset_eth_phy_before_phy_connect.patch \

file://PATCH_2-2_rockchip_rk3328-rock-pi-e_Enable_DM_ETH_PHY_and_PHY_REALTEK.patch
 \
"
-- 
2.43.0.76.g1a87c842ece3


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



[yocto] [meta-rockchip][PATCH v2] KERNEL_DEVICETREE: 32-bit re-org

2024-01-23 Thread Trevor Woerner
The upstream kernel reorganized the 32-bit arch/arm device-tree directory
structure to separate out the device-trees by manufacturer (similar to the
organization of the arch/arm64 device-trees). Update the references to
32-bit arm device-trees to match.

This patch can now be applied since all pre-6.5-rc1 kernels have been
removed from oe-core.

NOTE: trying to build a post-6.5-rc1 32-bit kernel with this patch applied
  will fail

Signed-off-by: Trevor Woerner 
Signed-off-by: Stephen Chen 
---
 classes/rockchip-gpt-img.bbclass  | 2 +-
 conf/machine/firefly-rk3288.conf  | 2 +-
 conf/machine/include/rockchip-wic.inc | 6 +-
 conf/machine/marsboard-rk3066.conf| 2 +-
 conf/machine/radxarock.conf   | 2 +-
 conf/machine/rock2-square.conf| 2 +-
 conf/machine/tinker-board-s.conf  | 2 +-
 conf/machine/tinker-board.conf| 2 +-
 conf/machine/vyasa-rk3288.conf| 2 +-
 9 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/classes/rockchip-gpt-img.bbclass b/classes/rockchip-gpt-img.bbclass
index b698db0798ea..440dcac7874d 100644
--- a/classes/rockchip-gpt-img.bbclass
+++ b/classes/rockchip-gpt-img.bbclass
@@ -108,7 +108,7 @@ create_rk_image () {
mcopy -i ${WORKDIR}/${BOOT_IMG} -s 
${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${MACHINE}.bin ::${KERNEL_IMAGETYPE}
 
DEVICETREE_DEFAULT=""
-   for DTS_FILE in ${KERNEL_DEVICETREE}; do
+   for DTS_FILE in $(echo ${KERNEL_DEVICETREE} | cut -d'/' -f2); do
[ -n "${DEVICETREE_DEFAULT}"] && 
DEVICETREE_DEFAULT="${DTS_FILE}"
mcopy -i ${WORKDIR}/${BOOT_IMG} -s 
${DEPLOY_DIR_IMAGE}/${DTS_FILE} ::${DTS_FILE}
done
diff --git a/conf/machine/firefly-rk3288.conf b/conf/machine/firefly-rk3288.conf
index 3270bb9f1657..6ff1be822008 100644
--- a/conf/machine/firefly-rk3288.conf
+++ b/conf/machine/firefly-rk3288.conf
@@ -9,5 +9,5 @@
 require conf/machine/include/rk3288.inc
 require conf/machine/include/rockchip-wic.inc
 
-KERNEL_DEVICETREE = "rk3288-firefly.dtb"
+KERNEL_DEVICETREE = "rockchip/rk3288-firefly.dtb"
 UBOOT_MACHINE = "firefly-rk3288_defconfig"
diff --git a/conf/machine/include/rockchip-wic.inc 
b/conf/machine/include/rockchip-wic.inc
index 635288ca4e98..b1ca27cdd0a2 100644
--- a/conf/machine/include/rockchip-wic.inc
+++ b/conf/machine/include/rockchip-wic.inc
@@ -11,9 +11,13 @@ WKS_FILE_DEPENDS ?= " \
virtual/bootloader \
virtual/kernel \
"
+# KERNEL_DEVICETREE follows the pattern of 
'rockchip/${SOC_FAMILY}-${BOARD}.dtb'
+# but is placed in the deploy directory as simply '${SOC_FAMILY}-${BOARD}.dtb'
+# therefore we have to strip off the 'rockchip/' for IMAGE_BOOT_FILES
+NONFITDT="${@d.getVar('KERNEL_DEVICETREE').split('/')[1]}"
 IMAGE_BOOT_FILES = " \
${KERNEL_IMAGETYPE} \
-   ${@bb.utils.contains('KERNEL_IMAGETYPE', 'fitImage', '', 
'${KERNEL_DEVICETREE}', d)} \
+   ${@bb.utils.contains('KERNEL_IMAGETYPE', 'fitImage', '', '${NONFITDT}', 
d)} \
"
 
 # use the first-defined ; pair in SERIAL_CONSOLES
diff --git a/conf/machine/marsboard-rk3066.conf 
b/conf/machine/marsboard-rk3066.conf
index 52fd256a3445..36945e8e407b 100644
--- a/conf/machine/marsboard-rk3066.conf
+++ b/conf/machine/marsboard-rk3066.conf
@@ -8,4 +8,4 @@
 
 require conf/machine/include/rk3066.inc
 
-KERNEL_DEVICETREE = "rk3066a-marsboard.dtb"
+KERNEL_DEVICETREE = "rockchip/rk3066a-marsboard.dtb"
diff --git a/conf/machine/radxarock.conf b/conf/machine/radxarock.conf
index 42d8848e1d09..6ad8474669d0 100644
--- a/conf/machine/radxarock.conf
+++ b/conf/machine/radxarock.conf
@@ -9,4 +9,4 @@
 
 require conf/machine/include/rk3188.inc
 
-KERNEL_DEVICETREE = "rk3188-radxarock.dtb"
+KERNEL_DEVICETREE = "rockchip/rk3188-radxarock.dtb"
diff --git a/conf/machine/rock2-square.conf b/conf/machine/rock2-square.conf
index 46064eebcc67..9468b9a6b559 100644
--- a/conf/machine/rock2-square.conf
+++ b/conf/machine/rock2-square.conf
@@ -9,7 +9,7 @@
 require conf/machine/include/rk3288.inc
 
 SPL_BINARY = "u-boot-spl-dtb.bin"
-KERNEL_DEVICETREE = "rk3288-rock2-square.dtb"
+KERNEL_DEVICETREE = "rockchip/rk3288-rock2-square.dtb"
 UBOOT_MACHINE = "rock2_defconfig"
 
 # This board doesn't support the combined idbloader, so resort to the older
diff --git a/conf/machine/tinker-board-s.conf b/conf/machine/tinker-board-s.conf
index 870b9bcdf8c7..3a656136c554 100644
--- a/conf/machine/tinker-board-s.conf
+++ b/conf/machine/tinker-board-s.conf
@@ -7,5 +7,5 @@
 
 require conf/machine/include/tinker.inc
 
-KERNEL_DEVICETREE = "rk3288-tinker-s.dtb"
+KERNEL_DEVICETREE = "rockchip/rk3288-tinker-s.dtb"
 UBOOT_MACHINE = "tinker-s-rk3288_defconfig"
diff --git a/conf/machine/tinker-board.conf b/conf/machine/tinker-board.conf
index 8fe5f6305d70..ef1a1c1ac098 100644
--- a/conf/machi

Re: [yocto][meta-rockchip][PATCH] wic: implement wic list and tweak description

2024-01-22 Thread Trevor Woerner
(forwarding to the new mailing list)

On Mon 2024-01-22 @ 02:24:29 PM, Trevor Woerner wrote:
> Hi André,
> 
> Nice to "see" you again. Sorry I missed your email initially since it was
> emailed to yo...@yoctoproject.org. Does that still work? My filters look for
> things in yo...@lists.yoctoprojet.org.
> 
> On Thu 2024-01-18 @ 08:42:03 AM, André Draszik wrote:
> > This now produces sensible output in
> > wic list images
> > wic list rockchip help
> > 
> > Signed-off-by: André Draszik 
> > ---
> >  wic/rockchip.wks | 8 +---
> >  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> Applied to meta-rockchip, master branch.
> Thanks!

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



Re: [yocto][meta-rockchip][PATCH] wic: implement wic list and tweak description (forward)

2024-01-22 Thread Trevor Woerner
(forwarding to the new mailing list)

On Thu 2024-01-18 @ 08:42:03 AM, André Draszik wrote:
> This now produces sensible output in
> wic list images
> wic list rockchip help
> 
> Signed-off-by: André Draszik 
> ---
>  wic/rockchip.wks | 8 +---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/wic/rockchip.wks b/wic/rockchip.wks
> index 1cc30aed5ec7..fac0b8f70112 100644
> --- a/wic/rockchip.wks
> +++ b/wic/rockchip.wks
> @@ -2,15 +2,17 @@
>  # Copyright (C) 2021 Trevor Woerner
>  # Released under the MIT license (see COPYING.MIT for the terms)
>  #
> +# short-description: Create a disk image suitable for booting Rockchip from 
> SD-card
> +# long-description: Creates a disk image partitioned using GPT, suitable for 
> Rockchip
>  # Disk layout
>  # Note that the reference documentation refers to 512 byte disk sectors, but
> -# wic uses 1KB blocks
> +# wic uses 1KB blocks. The following table uses 512 byte sectors:
>  #
>  #   Partition   Start SectorNumber of Sectors
> -#   loader1 64  8000
> +#   loader1 64  8000(idbloader / U-Boot SPL)
>  #   reserved1   8064128
>  #   reserved2   81928192
> -#   loader2 16384   8192
> +#   loader2 16384   8192(U-Boot proper)
>  #   atf 24576   8192
>  #   boot32768   229376
>  #   root262144  -   (suggested)
> -- 
> 2.43.0
> 

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



Re: [yocto] [meta-rockchip] [PATCH] machines: correct rk3066/rk3188/rk3288 kernel devicetree path

2024-01-22 Thread Trevor Woerner
On Sun 2024-01-21 @ 01:51:47 AM, Stephen Chen wrote:
> Hi
> 
> > 
> > Perhaps also take a look the email thread here:
> > https://lists.yoctoproject.org/g/yocto/topic/101728482#61210
> 
> This patch fixes kernel build error like this.
> 
> Run command "MACHINE=rock2-square bitbake linux-yocto" and get the error.
> 
> |   SYNC    include/config/auto.conf
> |   GEN Makefile
> | make[2]: *** No rule to make target 
> 'arch/arm/boot/dts/rk3288-rock2-square.dtb'.  Stop.
> 
> You can run "MACHINE=tinker-board bitbake linux-yocto" to test it.

If you would have read the email thread which I linked above, you would have
noticed that I submitted a patch to do the same thing in the beginning of
November, and you would have seen why it wasn't applied then.

> 
> > 
> > When I build I get:
> > 
> > |
> > /opt/oe/configs/z/build-master/tinker-board/layers/openembedded-core/scripts/lib/wic/engine.py:362:
> > SyntaxWarning: invalid escape sequence '\/'
> > | abs_path = re.sub('\/\/+', '/', path)
> > | INFO: Creating image(s)...
> > |
> > | ERROR: _exec_cmd: install -m 0644 -D
> > /z/build-master/tinker-board/build/tmp-glibc/deploy/images/tinker-board/rockchip/rk3288-tinker.dtb
> > /z/build-master/tinker-board/build/tmp-glibc/work/tinker_board-oe-linux-gnueabi/core-image-base/1.0/tmp-wic/boot.6/rockchip/rk3288-tinker.dtb
> > returned '1' instead of 0
> > | output: install: cannot stat
> > '/z/build-master/tinker-board/build/tmp-glibc/deploy/images/tinker-board/rockchip/rk3288-tinker.dtb':
> > No such file or directory
> > |
> > | WARNING:
> > /z/build-master/tinker-board/build/tmp-glibc/work/tinker_board-oe-linux-gnueabi/core-image-base/1.0/temp/run.do_image_wic.449:160
> > exit 1 from 'BUILDDIR="/z/build-master/tinker-board/build" PSEUDO_UNLOAD=1
> > wic create "$wks" --vars
> > "/z/build-master/tinker-board/build/tmp-glibc/sysroots/tinker-board/imgdata/"
> > -e "core-image-base" -o "$build_wic/" -w "$tmp_wic"'
> > | WARNING: Backtrace (BB generated script):
> > | #1: do_image_wic,
> > /z/build-master/tinker-board/build/tmp-glibc/work/tinker_board-oe-linux-gnueabi/core-image-base/1.0/temp/run.do_image_wic.449,
> > line 160
> > | #2: main,
> > /z/build-master/tinker-board/build/tmp-glibc/work/tinker_board-oe-linux-gnueabi/core-image-base/1.0/temp/run.do_image_wic.449,
> > line 177
> > ERROR: Task
> > (/opt/oe/configs/z/build-master/tinker-board/layers/openembedded-core/meta/recipes-core/images/core-image-base.bb:do_image_wic)
> > failed with exit code '1'
> 
> I think another patch would fix it.

As a courtesy, in the future please test your patches before sending them.

> 
> > 
> > diff --git a/conf/machine/include/rockchip-wic.inc
> > b/conf/machine/include/rockchip-wic.inc
> > index 635288c..b4f4226 100644
> > --- a/conf/machine/include/rockchip-wic.inc
> > +++ b/conf/machine/include/rockchip-wic.inc
> > @@ -13,7 +13,7 @@ WKS_FILE_DEPENDS ?= " \
> > "
> > IMAGE_BOOT_FILES = " \
> > ${KERNEL_IMAGETYPE} \
> > -   ${@bb.utils.contains('KERNEL_IMAGETYPE', 'fitImage', '',
> > '${KERNEL_DEVICETREE}', d)} \
> > +   ${@bb.utils.contains('KERNEL_IMAGETYPE', 'fitImage', '',
> > '${SOC_FAMILY}*.dtb', d)} \
> > "
> > 
> > # use the first-defined ; pair in SERIAL_CONSOLES

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



Re: [yocto] [meta-rockchip] [PATCH] machines: correct rk3066/rk3188/rk3288 kernel devicetree path

2024-01-20 Thread Trevor Woerner
On Sat 2024-01-20 @ 11:46:20 PM, Trevor Woerner via lists.yoctoproject.org 
wrote:
> On Sat 2024-01-20 @ 06:25:20 PM, Stephen Chen wrote:
> > Since mainline linux v6.5-rc1, this commit 724ba6751532
> > ("ARM: dts: Move .dts files to vendor sub-directories")
> > was added.
> > 
> > Link: 
> > https://github.com/torvalds/linux/commit/724ba6751532055db75992fc6ae21c3e322e94a7
> > 
> > Signed-off-by: Stephen Chen 
> > ---
> >  conf/machine/firefly-rk3288.conf   | 2 +-
> >  conf/machine/marsboard-rk3066.conf | 2 +-
> >  conf/machine/radxarock.conf| 2 +-
> >  conf/machine/rock2-square.conf | 2 +-
> >  conf/machine/tinker-board-s.conf   | 2 +-
> >  conf/machine/tinker-board.conf | 2 +-
> >  conf/machine/vyasa-rk3288.conf | 2 +-
> >  7 files changed, 7 insertions(+), 7 deletions(-)
> 
> When I build I get:
> 
>   | 
> /opt/oe/configs/z/build-master/tinker-board/layers/openembedded-core/scripts/lib/wic/engine.py:362:
>  SyntaxWarning: invalid escape sequence '\/'
>   |   abs_path = re.sub('\/\/+', '/', path)
>   | INFO: Creating image(s)...
>   | 
>   | ERROR: _exec_cmd: install -m 0644 -D 
> /z/build-master/tinker-board/build/tmp-glibc/deploy/images/tinker-board/rockchip/rk3288-tinker.dtb
>  
> /z/build-master/tinker-board/build/tmp-glibc/work/tinker_board-oe-linux-gnueabi/core-image-base/1.0/tmp-wic/boot.6/rockchip/rk3288-tinker.dtb
>  returned '1' instead of 0
>   | output: install: cannot stat 
> '/z/build-master/tinker-board/build/tmp-glibc/deploy/images/tinker-board/rockchip/rk3288-tinker.dtb':
>  No such file or directory
>   | 
>   | WARNING: 
> /z/build-master/tinker-board/build/tmp-glibc/work/tinker_board-oe-linux-gnueabi/core-image-base/1.0/temp/run.do_image_wic.449:160
>  exit 1 from 'BUILDDIR="/z/build-master/tinker-board/build" PSEUDO_UNLOAD=1 
> wic create "$wks" --vars 
> "/z/build-master/tinker-board/build/tmp-glibc/sysroots/tinker-board/imgdata/" 
> -e "core-image-base" -o "$build_wic/" -w "$tmp_wic"'
>   | WARNING: Backtrace (BB generated script):
>   |   #1: do_image_wic, 
> /z/build-master/tinker-board/build/tmp-glibc/work/tinker_board-oe-linux-gnueabi/core-image-base/1.0/temp/run.do_image_wic.449,
>  line 160
>   |   #2: main, 
> /z/build-master/tinker-board/build/tmp-glibc/work/tinker_board-oe-linux-gnueabi/core-image-base/1.0/temp/run.do_image_wic.449,
>  line 177
>   ERROR: Task 
> (/opt/oe/configs/z/build-master/tinker-board/layers/openembedded-core/meta/recipes-core/images/core-image-base.bb:do_image_wic)
>  failed with exit code '1'

Perhaps also take a look the email thread here:
https://lists.yoctoproject.org/g/yocto/topic/101728482#61210

> > diff --git a/conf/machine/firefly-rk3288.conf 
> > b/conf/machine/firefly-rk3288.conf
> > index 3270bb9..6ff1be8 100644
> > --- a/conf/machine/firefly-rk3288.conf
> > +++ b/conf/machine/firefly-rk3288.conf
> > @@ -9,5 +9,5 @@
> >  require conf/machine/include/rk3288.inc
> >  require conf/machine/include/rockchip-wic.inc
> >  
> > -KERNEL_DEVICETREE = "rk3288-firefly.dtb"
> > +KERNEL_DEVICETREE = "rockchip/rk3288-firefly.dtb"
> >  UBOOT_MACHINE = "firefly-rk3288_defconfig"
> > diff --git a/conf/machine/marsboard-rk3066.conf 
> > b/conf/machine/marsboard-rk3066.conf
> > index 52fd256..36945e8 100644
> > --- a/conf/machine/marsboard-rk3066.conf
> > +++ b/conf/machine/marsboard-rk3066.conf
> > @@ -8,4 +8,4 @@
> >  
> >  require conf/machine/include/rk3066.inc
> >  
> > -KERNEL_DEVICETREE = "rk3066a-marsboard.dtb"
> > +KERNEL_DEVICETREE = "rockchip/rk3066a-marsboard.dtb"
> > diff --git a/conf/machine/radxarock.conf b/conf/machine/radxarock.conf
> > index 42d8848..6ad8474 100644
> > --- a/conf/machine/radxarock.conf
> > +++ b/conf/machine/radxarock.conf
> > @@ -9,4 +9,4 @@
> >  
> >  require conf/machine/include/rk3188.inc
> >  
> > -KERNEL_DEVICETREE = "rk3188-radxarock.dtb"
> > +KERNEL_DEVICETREE = "rockchip/rk3188-radxarock.dtb"
> > diff --git a/conf/machine/rock2-square.conf b/conf/machine/rock2-square.conf
> > index 46064ee..9468b9a 100644
> > --- a/conf/machine/rock2-square.conf
> > +++ b/conf/machine/rock2-square.conf
> > @@ -9,7 +9,7 @@
> >  require conf/machine/include/rk3288.inc
> >  
> >  SPL_BINARY = "u-boot-spl-dtb.bin"
> > -KERNEL_DEVICETREE = "rk3288-rock2-square.dtb"
> > +KERNEL_DEVICETREE = "rockchip/rk3288-rock2-square.dtb"

Re: [yocto] [meta-rockchip] [PATCH] machines: correct rk3066/rk3188/rk3288 kernel devicetree path

2024-01-20 Thread Trevor Woerner
On Sat 2024-01-20 @ 06:25:20 PM, Stephen Chen wrote:
> Since mainline linux v6.5-rc1, this commit 724ba6751532
> ("ARM: dts: Move .dts files to vendor sub-directories")
> was added.
> 
> Link: 
> https://github.com/torvalds/linux/commit/724ba6751532055db75992fc6ae21c3e322e94a7
> 
> Signed-off-by: Stephen Chen 
> ---
>  conf/machine/firefly-rk3288.conf   | 2 +-
>  conf/machine/marsboard-rk3066.conf | 2 +-
>  conf/machine/radxarock.conf| 2 +-
>  conf/machine/rock2-square.conf | 2 +-
>  conf/machine/tinker-board-s.conf   | 2 +-
>  conf/machine/tinker-board.conf | 2 +-
>  conf/machine/vyasa-rk3288.conf | 2 +-
>  7 files changed, 7 insertions(+), 7 deletions(-)

When I build I get:

| 
/opt/oe/configs/z/build-master/tinker-board/layers/openembedded-core/scripts/lib/wic/engine.py:362:
 SyntaxWarning: invalid escape sequence '\/'
|   abs_path = re.sub('\/\/+', '/', path)
| INFO: Creating image(s)...
| 
| ERROR: _exec_cmd: install -m 0644 -D 
/z/build-master/tinker-board/build/tmp-glibc/deploy/images/tinker-board/rockchip/rk3288-tinker.dtb
 
/z/build-master/tinker-board/build/tmp-glibc/work/tinker_board-oe-linux-gnueabi/core-image-base/1.0/tmp-wic/boot.6/rockchip/rk3288-tinker.dtb
 returned '1' instead of 0
| output: install: cannot stat 
'/z/build-master/tinker-board/build/tmp-glibc/deploy/images/tinker-board/rockchip/rk3288-tinker.dtb':
 No such file or directory
| 
| WARNING: 
/z/build-master/tinker-board/build/tmp-glibc/work/tinker_board-oe-linux-gnueabi/core-image-base/1.0/temp/run.do_image_wic.449:160
 exit 1 from 'BUILDDIR="/z/build-master/tinker-board/build" PSEUDO_UNLOAD=1 wic 
create "$wks" --vars 
"/z/build-master/tinker-board/build/tmp-glibc/sysroots/tinker-board/imgdata/" 
-e "core-image-base" -o "$build_wic/" -w "$tmp_wic"'
| WARNING: Backtrace (BB generated script):
|   #1: do_image_wic, 
/z/build-master/tinker-board/build/tmp-glibc/work/tinker_board-oe-linux-gnueabi/core-image-base/1.0/temp/run.do_image_wic.449,
 line 160
|   #2: main, 
/z/build-master/tinker-board/build/tmp-glibc/work/tinker_board-oe-linux-gnueabi/core-image-base/1.0/temp/run.do_image_wic.449,
 line 177
ERROR: Task 
(/opt/oe/configs/z/build-master/tinker-board/layers/openembedded-core/meta/recipes-core/images/core-image-base.bb:do_image_wic)
 failed with exit code '1'

> diff --git a/conf/machine/firefly-rk3288.conf 
> b/conf/machine/firefly-rk3288.conf
> index 3270bb9..6ff1be8 100644
> --- a/conf/machine/firefly-rk3288.conf
> +++ b/conf/machine/firefly-rk3288.conf
> @@ -9,5 +9,5 @@
>  require conf/machine/include/rk3288.inc
>  require conf/machine/include/rockchip-wic.inc
>  
> -KERNEL_DEVICETREE = "rk3288-firefly.dtb"
> +KERNEL_DEVICETREE = "rockchip/rk3288-firefly.dtb"
>  UBOOT_MACHINE = "firefly-rk3288_defconfig"
> diff --git a/conf/machine/marsboard-rk3066.conf 
> b/conf/machine/marsboard-rk3066.conf
> index 52fd256..36945e8 100644
> --- a/conf/machine/marsboard-rk3066.conf
> +++ b/conf/machine/marsboard-rk3066.conf
> @@ -8,4 +8,4 @@
>  
>  require conf/machine/include/rk3066.inc
>  
> -KERNEL_DEVICETREE = "rk3066a-marsboard.dtb"
> +KERNEL_DEVICETREE = "rockchip/rk3066a-marsboard.dtb"
> diff --git a/conf/machine/radxarock.conf b/conf/machine/radxarock.conf
> index 42d8848..6ad8474 100644
> --- a/conf/machine/radxarock.conf
> +++ b/conf/machine/radxarock.conf
> @@ -9,4 +9,4 @@
>  
>  require conf/machine/include/rk3188.inc
>  
> -KERNEL_DEVICETREE = "rk3188-radxarock.dtb"
> +KERNEL_DEVICETREE = "rockchip/rk3188-radxarock.dtb"
> diff --git a/conf/machine/rock2-square.conf b/conf/machine/rock2-square.conf
> index 46064ee..9468b9a 100644
> --- a/conf/machine/rock2-square.conf
> +++ b/conf/machine/rock2-square.conf
> @@ -9,7 +9,7 @@
>  require conf/machine/include/rk3288.inc
>  
>  SPL_BINARY = "u-boot-spl-dtb.bin"
> -KERNEL_DEVICETREE = "rk3288-rock2-square.dtb"
> +KERNEL_DEVICETREE = "rockchip/rk3288-rock2-square.dtb"
>  UBOOT_MACHINE = "rock2_defconfig"
>  
>  # This board doesn't support the combined idbloader, so resort to the older
> diff --git a/conf/machine/tinker-board-s.conf 
> b/conf/machine/tinker-board-s.conf
> index 870b9bc..3a65613 100644
> --- a/conf/machine/tinker-board-s.conf
> +++ b/conf/machine/tinker-board-s.conf
> @@ -7,5 +7,5 @@
>  
>  require conf/machine/include/tinker.inc
>  
> -KERNEL_DEVICETREE = "rk3288-tinker-s.dtb"
> +KERNEL_DEVICETREE = "rockchip/rk3288-tinker-s.dtb"
>  UBOOT_MACHINE = "tinker-s-rk3288_defconfig"
> diff --git a/conf/machine/tinker-board.conf b/conf/machine/tinker-board.conf
> index 8fe5f63..ef1a1c1 100644
> --- a/conf/machine/tinker-board.conf
> +++ b/conf/machine/tinker-board.conf
> @@ -7,5 +7,5 @@
>  
>  require conf/machine/include/tinker.inc
>  
> -KERNEL_DEVICETREE = "rk3288-tinker.dtb"
> +KERNEL_DEVICETREE = "rockchip/rk3288-tinker.dtb"
>  UBOOT_MACHINE = "tinker-rk3288_defconfig"
> diff --git a/conf/machine/vyasa-rk3288.conf 

Re: [yocto] [meta-rockchip] [PATCH v2] rock-4c-plus: add

2024-01-20 Thread Trevor Woerner
On Sat 2024-01-20 @ 05:30:38 PM, Stephen Chen wrote:
> ROCK 4C Plus is a Rockchip RK3399-T based SBC from Radxa.
> 
> Specs:
> - RaspberryPi 4 form factor
> - 64bit LPDDR4
> - eMMC
> - Micro SD
> - SPI Nor Flash
> - Two Micro-HDMI (HDMI 4K and HDMI 2K)
> - 4-lane MIPI DSI
> - MIPI CSI
> - GbE LAN with Power over Ethernet (PoE) support
> - Wi-Fi 5 and BT5.0 wireless module
> - 3.5mm headphone jack
> - Four USB ports (two USB2.0 and two USB3.0)
> - RTC
> - LEDs
> - Power button
> - Pwm fan
> - 40-pin color expansion header
> 
> Signed-off-by: Stephen Chen 
> ---
>  README  |  1 +
>  conf/machine/rock-4c-plus.conf  | 10 ++
>  recipes-kernel/linux/linux-yocto_%.bbappend |  1 +
>  3 files changed, 12 insertions(+)
>  create mode 100644 conf/machine/rock-4c-plus.conf

Applied to meta-rockchip, master branch.
Thanks!

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



Re: [yocto] [meta-rockchip] [PATCH v3 1/1] orangepi-5-plus: Support Orange Pi 5 Plus single-board computer

2024-01-20 Thread Trevor Woerner
On Thu 2023-12-21 @ 11:40:48 AM, Abhisit Sangjan wrote:
> From: Abhisit Sangjan 
> 
> Being merged when the u-boot version is 2024.01-rc5 or newer and the Linux 
> Kernel version is 6.7 or newer
> 
> Orange Pi 5 Plus is RK3588 based SBC featuring:
> - 2x 2.5G ethernet ports – onboard NIC hooked to PCIe 2.0 interface
> - 2x USB 2.0 host ports
> - 2x USB 3.0 host ports (exposed over USB 3.0 hub)
> - Type-C port featuring USB 2.0/3.0 and Alt-DP mode
> - PCIe 2.0/USB 2.0/I2S/I2C/UART on E.KEY socket
> - RTC
> - ES8388 on-board sound codec – jack in/out, onboard mic, speaker amplifier
> - SPI NOR flash
> - RGB LED (R is always on)
> - IR receiver
> - PCIe 3.0 on the bottom for NVMe, etc.
> - 40pin GPIO header (with gpio, I2C, SPI, PWM, UART)
> - Power, recovery and Mask ROM buttons
> - 2x HDMI out, 1x HDMI in
> - Slots/connectors for eMMC, uSD card, fan, MIPI CSI/DSI
> - 4 GB, 8 GB, 16 GB and 32 GB of RAM
> 
> Signed-off-by: Abhisit Sangjan 
> ---
>  README|  1 +
>  conf/machine/orangepi-5-plus.conf | 12 
>  recipes-bsp/rkbin/rockchip-rkbin_git.bb   |  2 +-
>  recipes-kernel/linux/linux-yocto-dev.bbappend |  3 +++
>  4 files changed, 17 insertions(+), 1 deletion(-)
>  create mode 100644 conf/machine/orangepi-5-plus.conf

Tweaked and applied to meta-rockchip, master branch.
Thanks!

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



Re: [yocto] [meta-rockchip] [PATCH v3] rock-3a add

2024-01-20 Thread Trevor Woerner
On Mon 2023-10-16 @ 09:43:45 PM, anthony.t.dav...@gmail.com wrote:
> From: Anthony Davies 
> 
> Add support for the Radxa Rock 3A
> https://wiki.radxa.com/Rock3/3a
> 
> The TF-A project does not currently have support for
> the rk3568. Therefore, for the time-being, the only way to supply a
> TPL/DDR-init for the rk3568 is to use the closed-source rkbin binaries
> from Rockchip. If/when TF-A adds support for the rk3588 we can investigate
> switching.
> 
> recipes-bsp/rkbin/rockchip-rkbin_git.bb was modified to allow a machine
> override to allow both rk3568 and rk3588s to use differnet binary blobs
> 
> Signed-off-by: Anthony Davies 
> ---
>  README  |  1 +
>  conf/machine/include/rk3568.inc | 17 +
>  conf/machine/rock-3a.conf   | 12 
>  recipes-bsp/rkbin/rockchip-rkbin_git.bb | 16 +++-
>  recipes-bsp/u-boot/u-boot%.bbappend |  5 +
>  5 files changed, 50 insertions(+), 1 deletion(-)
>  create mode 100644 conf/machine/include/rk3568.inc
>  create mode 100644 conf/machine/rock-3a.conf

Applied some form of this patch to meta-rockchip, master branch.
Thanks!

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



Re: [yocto] [meta-rockchip][PATCH] rock-pi-e: apply upstream PHY fix

2024-01-19 Thread Trevor Woerner
On Fri 2024-01-19 @ 10:17:55 AM, Trevor Woerner via lists.yoctoproject.org 
wrote:
> This patch was submitted to the U-Boot mailing list to fix an issue
> initializing the PHY on the rock-pi-e.
> 
> Signed-off-by: Trevor Woerner 
> ---
>  ...are_Reset_eth_phy_before_phy_connect.patch | 83 +++
>  ...-e_Enable_DM_ETH_PHY_and_PHY_REALTEK.patch | 65 +++
>  recipes-bsp/u-boot/u-boot%.bbappend   |  6 ++
>  3 files changed, 154 insertions(+)
>  create mode 100644 
> recipes-bsp/u-boot/files/PATCH_1-2_net_designware_Reset_eth_phy_before_phy_connect.patch
>  create mode 100644 
> recipes-bsp/u-boot/files/PATCH_2-2_rockchip_rk3328-rock-pi-e_Enable_DM_ETH_PHY_and_PHY_REALTEK.patch

Applied to meta-rockchip, master branch.

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



[yocto] [meta-rockchip][PATCH] rock-pi-e: apply upstream PHY fix

2024-01-19 Thread Trevor Woerner
This patch was submitted to the U-Boot mailing list to fix an issue
initializing the PHY on the rock-pi-e.

Signed-off-by: Trevor Woerner 
---
 ...are_Reset_eth_phy_before_phy_connect.patch | 83 +++
 ...-e_Enable_DM_ETH_PHY_and_PHY_REALTEK.patch | 65 +++
 recipes-bsp/u-boot/u-boot%.bbappend   |  6 ++
 3 files changed, 154 insertions(+)
 create mode 100644 
recipes-bsp/u-boot/files/PATCH_1-2_net_designware_Reset_eth_phy_before_phy_connect.patch
 create mode 100644 
recipes-bsp/u-boot/files/PATCH_2-2_rockchip_rk3328-rock-pi-e_Enable_DM_ETH_PHY_and_PHY_REALTEK.patch

diff --git 
a/recipes-bsp/u-boot/files/PATCH_1-2_net_designware_Reset_eth_phy_before_phy_connect.patch
 
b/recipes-bsp/u-boot/files/PATCH_1-2_net_designware_Reset_eth_phy_before_phy_connect.patch
new file mode 100644
index ..4910b9803611
--- /dev/null
+++ 
b/recipes-bsp/u-boot/files/PATCH_1-2_net_designware_Reset_eth_phy_before_phy_connect.patch
@@ -0,0 +1,83 @@
+From: Jonas Karlman 
+To: Kever Yang , Ramon Fried
+ , Joe Hershberger , Simon
+ Glass , Banglang Huang 
+Cc: Trevor Woerner , u-b...@lists.denx.de, Jonas
+ Karlman 
+Subject: [PATCH 1/2] net: designware: Reset eth phy before phy connect
+Date: Thu, 18 Jan 2024 07:19:45 +
+Message-ID: <20240118071949.927089-2-jo...@kwiboo.se>
+X-Mailer: git-send-email 2.43.0
+In-Reply-To: <20240118071949.927089-1-jo...@kwiboo.se>
+References: <20240118071949.927089-1-jo...@kwiboo.se>
+MIME-Version: 1.0
+Content-Transfer-Encoding: 8bit
+X-Report-Abuse-To: ab...@forwardemail.net
+X-Report-Abuse: ab...@forwardemail.net
+X-Complaints-To: ab...@forwardemail.net
+X-ForwardEmail-Version: 0.4.40
+X-ForwardEmail-Sender: rfc822; jo...@kwiboo.se, smtp.forwardemail.net,
+ 149.28.215.223
+X-ForwardEmail-ID: 65a8d11ed66eecd94fbb691a
+
+Some ethernet PHY require being reset before a phy-id can be read back
+on the MDIO bus. This can result in the following message being show
+on e.g. a Radxa ROCK Pi E v1.21 with a RTL8211F ethernet PHY.
+
+  Could not get PHY for ethernet@ff54: addr -1
+
+Add support to designware ethernet driver to reset eth phy by calling
+the eth phy uclass function eth_phy_set_mdio_bus(). The call use NULL
+as bus parameter to not set a shared mdio bus reference that would be
+freed when probe fails. Also add a eth_phy_get_addr() call to try and
+get the phy addr from DT when DM_MDIO is disabled.
+
+This help fix ethernet on Radxa ROCK Pi E v1.21:
+
+  => mdio list
+  ethernet@ff54:
+  1 - RealTek RTL8211F <--> ethernet@ff54
+
+Upstream-Status: Submitted
+Reported-by: Trevor Woerner 
+Signed-off-by: Jonas Karlman 
+---
+ drivers/net/designware.c | 7 +++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/drivers/net/designware.c b/drivers/net/designware.c
+index a174344b3ef5..9aa5d8a1409e 100644
+--- a/drivers/net/designware.c
 b/drivers/net/designware.c
+@@ -13,6 +13,7 @@
+ #include 
+ #include 
+ #include 
++#include 
+ #include 
+ #include 
+ #include 
+@@ -576,6 +577,9 @@ static int dw_phy_init(struct dw_eth_dev *priv, void *dev)
+   struct phy_device *phydev;
+   int ret;
+ 
++  if (IS_ENABLED(CONFIG_DM_ETH_PHY))
++  eth_phy_set_mdio_bus(dev, NULL);
++
+ #if IS_ENABLED(CONFIG_DM_MDIO)
+   phydev = dm_eth_phy_connect(dev);
+   if (!phydev)
+@@ -583,6 +587,9 @@ static int dw_phy_init(struct dw_eth_dev *priv, void *dev)
+ #else
+   int phy_addr = -1;
+ 
++  if (IS_ENABLED(CONFIG_DM_ETH_PHY))
++  phy_addr = eth_phy_get_addr(dev);
++
+ #ifdef CONFIG_PHY_ADDR
+   phy_addr = CONFIG_PHY_ADDR;
+ #endif
+-- 
+2.43.0
+
+
diff --git 
a/recipes-bsp/u-boot/files/PATCH_2-2_rockchip_rk3328-rock-pi-e_Enable_DM_ETH_PHY_and_PHY_REALTEK.patch
 
b/recipes-bsp/u-boot/files/PATCH_2-2_rockchip_rk3328-rock-pi-e_Enable_DM_ETH_PHY_and_PHY_REALTEK.patch
new file mode 100644
index ..c4afce401655
--- /dev/null
+++ 
b/recipes-bsp/u-boot/files/PATCH_2-2_rockchip_rk3328-rock-pi-e_Enable_DM_ETH_PHY_and_PHY_REALTEK.patch
@@ -0,0 +1,65 @@
+From: Jonas Karlman 
+To: Kever Yang , Ramon Fried
+ , Joe Hershberger , Simon
+ Glass , Banglang Huang 
+Cc: Trevor Woerner , u-b...@lists.denx.de, Jonas
+ Karlman 
+Subject: [PATCH 2/2] rockchip: rk3328-rock-pi-e: Enable DM_ETH_PHY and 
PHY_REALTEK
+Date: Thu, 18 Jan 2024 07:19:46 +
+Message-ID: <20240118071949.927089-3-jo...@kwiboo.se>
+X-Mailer: git-send-email 2.43.0
+In-Reply-To: <20240118071949.927089-1-jo...@kwiboo.se>
+References: <20240118071949.927089-1-jo...@kwiboo.se>
+MIME-Version: 1.0
+Content-Transfer-Encoding: 8bit
+X-Report-Abuse-To: ab...@forwardemail.net
+X-Report-Abuse: ab...@forwardemail.net
+X-Complaints-To: ab...@forwardemail.net
+X-ForwardEmail-Version: 0.4.40
+X-ForwardEmail-Sender: rfc822; jo...@kwiboo.se, smtp.forwardemail.net,
+ 149.28.215.223
+X-ForwardEmail-ID: 65a8d121d66eecd94fbb6928
+
+Enable the DM_ETH_PHY and PHY_REALTEK now that the designware ethernet
+driver call et

Re: [yocto] [meta-rockchip][PATCH] rock-pi-e: fix kernel device-tree

2024-01-18 Thread Trevor Woerner
I have provided 2 patches recently to fix the ethernet issue on the rock-pi-e.
By submitting them upstream it prompted a conversation to led to the
maintainer creating a proper fix in U-Boot. Therefore these 2 patches of mine
are obsolete and I will be submitting a newer patch to add the maintainer's
U-Boot patches to the build.

On Tue 2024-01-16 @ 05:21:06 PM, Trevor Woerner via lists.yoctoproject.org 
wrote:
> The device-tree for the GbE interface of the rock-pi-e had some properties
> in the wrong location. Oddly enough the older rock-pi-e devices with
> the Realtek 8211e PHY worked fine, but the latest spin (v1.21) with the
> rtl8211f PHY didn't. This fixes allows both PHYs to work.
> 
> Signed-off-by: Trevor Woerner 
> ---
>  ...hip-rock-pi-e-adjust-phy-handle-name.patch | 40 +++
>  ...ip-rock-pi-e-fix-location-of-snps-pr.patch | 50 +++
>  recipes-kernel/linux/linux-yocto_%.bbappend   |  4 ++
>  3 files changed, 94 insertions(+)
>  create mode 100644 
> recipes-kernel/linux/linux-yocto/0001-arm64-dts-rockchip-rock-pi-e-adjust-phy-handle-name.patch
>  create mode 100644 
> recipes-kernel/linux/linux-yocto/0002-arm64-dts-rockchip-rock-pi-e-fix-location-of-snps-pr.patch
> 
> diff --git 
> a/recipes-kernel/linux/linux-yocto/0001-arm64-dts-rockchip-rock-pi-e-adjust-phy-handle-name.patch
>  
> b/recipes-kernel/linux/linux-yocto/0001-arm64-dts-rockchip-rock-pi-e-adjust-phy-handle-name.patch
> new file mode 100644
> index ..6ba072732854
> --- /dev/null
> +++ 
> b/recipes-kernel/linux/linux-yocto/0001-arm64-dts-rockchip-rock-pi-e-adjust-phy-handle-name.patch
> @@ -0,0 +1,40 @@
> +From 58f61444baa53d8818911c43e4060d550d5c19b9 Mon Sep 17 00:00:00 2001
> +From: Trevor Woerner 
> +Date: Tue, 16 Jan 2024 15:03:58 -0500
> +Subject: [PATCH 1/2] arm64: dts: rockchip: rock-pi-e: adjust phy-handle name
> +
> +The rock-pi-e currently comes in 4 board spins, the latest one (v1.21) swaps
> +out the Realtek 8211e PHY for an 8211f PHY. Therefore modify the phy-handle
> +name to be more generic.
> +
> +Upstream-Status: Submitted
> +Signed-off-by: Trevor Woerner 
> +---
> + arch/arm64/boot/dts/rockchip/rk3328-rock-pi-e.dts | 4 ++--
> + 1 file changed, 2 insertions(+), 2 deletions(-)
> +
> +diff --git a/arch/arm64/boot/dts/rockchip/rk3328-rock-pi-e.dts 
> b/arch/arm64/boot/dts/rockchip/rk3328-rock-pi-e.dts
> +index 018a3a5075c7..096cfa19036e 100644
> +--- a/arch/arm64/boot/dts/rockchip/rk3328-rock-pi-e.dts
>  b/arch/arm64/boot/dts/rockchip/rk3328-rock-pi-e.dts
> +@@ -146,7 +146,7 @@  {
> + assigned-clocks = < SCLK_MAC2IO>, < SCLK_MAC2IO_EXT>;
> + assigned-clock-parents = <_clkin>, <_clkin>;
> + clock_in_out = "input";
> +-phy-handle = <>;
> ++phy-handle = <>;
> + phy-mode = "rgmii";
> + phy-supply = <_io>;
> + pinctrl-names = "default";
> +@@ -163,7 +163,7 @@ mdio {
> + #address-cells = <1>;
> + #size-cells = <0>;
> + 
> +-rtl8211e: ethernet-phy@1 {
> ++rtl8211: ethernet-phy@1 {
> + reg = <1>;
> + pinctrl-0 = <_phy_int_pin>, <_phy_reset_pin>;
> + pinctrl-names = "default";
> +-- 
> +2.43.0.76.g1a87c842ece3
> +
> diff --git 
> a/recipes-kernel/linux/linux-yocto/0002-arm64-dts-rockchip-rock-pi-e-fix-location-of-snps-pr.patch
>  
> b/recipes-kernel/linux/linux-yocto/0002-arm64-dts-rockchip-rock-pi-e-fix-location-of-snps-pr.patch
> new file mode 100644
> index ..67ed1a09a0c6
> --- /dev/null
> +++ 
> b/recipes-kernel/linux/linux-yocto/0002-arm64-dts-rockchip-rock-pi-e-fix-location-of-snps-pr.patch
> @@ -0,0 +1,50 @@
> +From 7eaabc1e5047d839376c4d9e511862f7ded67c24 Mon Sep 17 00:00:00 2001
> +From: Trevor Woerner 
> +Date: Tue, 16 Jan 2024 15:09:15 -0500
> +Subject: [PATCH 2/2] arm64: dts: rockchip: rock-pi-e: fix location of snps
> + properties
> +
> +A number of snps (Synopsys) properties are not in their correct location.
> +
> +Upstream-Status: Submitted
> +Fixes: b918e81f2145 ("arm64: dts: rockchip: rk3328: Add Radxa ROCK Pi E")
> +Signed-off-by: Trevor Woerner 
> +---
> + arch/arm64/boot/dts/rockchip/rk3328-rock-pi-e.dts | 10 +-
> + 1 file changed, 5 insertions(+), 5 deletions(-)
> +
> +diff --git a/arch/arm64/boot/dts/rockchip/rk3328-rock-pi-e.dts 
> b/arch/arm64/boot/dts/rockchip/rk3328-rock-pi-e.dts
> +index 096cfa19036e..0739b8fec86e 100644
> +--- a/arch/arm64/boot/dts/rockchip/rk3328-rock-pi-e.dts
>  b/arch/arm64/boot/dts/rockchip/rk3328-rock-pi-e.dts
> +@@ -150,8 +150,11 @@  {
> + ph

Re: [yocto] [meta-rockchip][PATCH] roc-rk3308-cc: add

2024-01-18 Thread Trevor Woerner
On Wed 2024-01-17 @ 01:13:53 AM, Trevor Woerner via lists.yoctoproject.org 
wrote:
> The T-Firefly ROC-RK3308-CC is a miniature and compact main board which is
> equipped with a cost-effective RK3308 Core Processor and a high-performance
> CODEC.
> 
> Features:
> - Rockchip RK3308, 64-bit, quad-core, Arm Cortex-A35 processor @ 1.3GHz
> - 100M ethernet
> - PoE
> - USB 2.0 and Type-C (OTG and power)
> - 802.11 b/g/n WiFi and Bluetooth 4.2
> 
> https://en.t-firefly.com/product/rocrk3308cc
> 
> Signed-off-by: Trevor Woerner 
> ---
>  README  | 24 +++--
>  conf/machine/roc-rk3308-cc.conf | 12 +++
>  recipes-bsp/u-boot/u-boot%.bbappend |  2 +-
>  recipes-kernel/linux/linux-yocto_%.bbappend |  1 +
>  4 files changed, 27 insertions(+), 12 deletions(-)
>  create mode 100644 conf/machine/roc-rk3308-cc.conf

Applied to meta-rockchip, master branch.

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



Re: [yocto] [meta-rockchip][PATCH] u-boot: fix build for rk3308

2024-01-18 Thread Trevor Woerner
On Wed 2024-01-17 @ 12:48:41 AM, Trevor Woerner via lists.yoctoproject.org 
wrote:
> In upstream mainline U-Boot commit 9e13fef00b8d ("rockchip: Kconfig: Enable
> external TPL binary for rk3308") U-Boot was changed to incorporate the DDR TPL
> using the same mechanism as the RK3568 and RK3588 platforms.
> 
> Signed-off-by: Trevor Woerner 
> ---
>  recipes-bsp/u-boot/u-boot%.bbappend | 10 --
>  1 file changed, 4 insertions(+), 6 deletions(-)

Applied to meta-rockchip, master branch.

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



Re: [yocto] [meta-rockchip][PATCH] roc-rk3328-cc: add

2024-01-18 Thread Trevor Woerner
On Tue 2024-01-16 @ 05:42:54 PM, Trevor Woerner wrote:
> AKA the "renegade"
> 
> The ROC-RK3328-CC platform is built on the Rockchip RK3328 system-on-chip
> optimized for low cost, low power, and high performance IO. It features a
> high performance native USB 3.0 interface and Gigabit MAC.
> 
> Specs:
> - RaspberryPi 2/3 form factor
> - quad-core ARM Cortex-A53 @ 1.5GHz
> - ARM Mali-450 MP2
> - DDR4 RAM
> - USB 3.0
> - GbE MAC
> 
> https://libre.computer/products/roc-rk3328-cc/
> https://wiki.t-firefly.com/ROC-RK3328-CC/intro.html
> 
> Signed-off-by: Trevor Woerner 
> ---
>  README  |  1 +
>  conf/machine/roc-rk3328-cc.conf | 11 +++
>  recipes-kernel/linux/linux-yocto_%.bbappend |  1 +
>  3 files changed, 13 insertions(+)
>  create mode 100644 conf/machine/roc-rk3328-cc.conf

Applied to meta-rockchip, master branch.

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



[yocto] [meta-rockchip][PATCH] roc-rk3308-cc: add

2024-01-16 Thread Trevor Woerner
The T-Firefly ROC-RK3308-CC is a miniature and compact main board which is
equipped with a cost-effective RK3308 Core Processor and a high-performance
CODEC.

Features:
- Rockchip RK3308, 64-bit, quad-core, Arm Cortex-A35 processor @ 1.3GHz
- 100M ethernet
- PoE
- USB 2.0 and Type-C (OTG and power)
- 802.11 b/g/n WiFi and Bluetooth 4.2

https://en.t-firefly.com/product/rocrk3308cc

Signed-off-by: Trevor Woerner 
---
 README  | 24 +++--
 conf/machine/roc-rk3308-cc.conf | 12 +++
 recipes-bsp/u-boot/u-boot%.bbappend |  2 +-
 recipes-kernel/linux/linux-yocto_%.bbappend |  1 +
 4 files changed, 27 insertions(+), 12 deletions(-)
 create mode 100644 conf/machine/roc-rk3308-cc.conf

diff --git a/README b/README
index 48cb952a3b09..80ba592eb812 100644
--- a/README
+++ b/README
@@ -36,6 +36,7 @@ Status of supported boards:
rock-pi-s
rock-5a
roc-rk3328-cc
+   roc-rk3308-cc
builds:
marsboard-rk3066
radxarock
@@ -43,17 +44,18 @@ Status of supported boards:
 
 Notes:
 -
-   The latest ddr initializer for the rk3308 platform (currently only
-   used by the rock-pi-s machine) 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 the
-   rock-pi-s an older version of rkbin is used.
+   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:
diff --git a/conf/machine/roc-rk3308-cc.conf b/conf/machine/roc-rk3308-cc.conf
new file mode 100644
index ..839e73c41f06
--- /dev/null
+++ b/conf/machine/roc-rk3308-cc.conf
@@ -0,0 +1,12 @@
+# Copyright (C) 2024  Trevor Woerner
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+#@TYPE: Machine
+#@NAME: roc-rk3308-cc
+#@DESCRIPTION: T-Firefly ROC-RK3308-CC SBC
+#https://en.t-firefly.com/product/rocrk3308cc
+
+require include/rk3308.inc
+
+UBOOT_MACHINE = "roc-cc-rk3308_defconfig"
+KERNEL_DEVICETREE = "rockchip/rk3308-roc-cc.dtb"
diff --git a/recipes-bsp/u-boot/u-boot%.bbappend 
b/recipes-bsp/u-boot/u-boot%.bbappend
index 3e59e46c646f..dce4f32d356a 100644
--- a/recipes-bsp/u-boot/u-boot%.bbappend
+++ b/recipes-bsp/u-boot/u-boot%.bbappend
@@ -1,6 +1,6 @@
 # various machines require the pyelftools library for parsing dtb files
 DEPENDS:append = " python3-pyelftools-native"
-DEPENDS:append:rock-pi-s = " u-boot-tools-native"
+DEPENDS:append:rk3308 = " u-boot-tools-native"
 DEPENDS:append:rock-pi-4 = " gnutls-native"
 
 EXTRA_OEMAKE:append:px30 = " BL31=${DEPLOY_DIR_IMAGE}/bl31-px30.elf"
diff --git a/recipes-kernel/linux/linux-yocto_%.bbappend 
b/recipes-kernel/linux/linux-yocto_%.bbappend
index b0efa0d0c130..a9223301dde1 100644
--- a/recipes-kernel/linux/linux-yocto_%.bbappend
+++ b/recipes-kernel/linux/linux-yocto_%.bbappend
@@ -17,6 +17,7 @@ COMPATIBLE_MACHINE:nanopi-r2s = "nanopi-r2s"
 COMPATIBLE_MACHINE:nanopi-m4b = "nanopi-m4b"
 COMPATIBLE_MACHINE:rock-pi-s = "rock-pi-s"
 COMPATIBLE_MACHINE:roc-rk3328-cc = "roc-rk3328-cc"
+COMPATIBLE_MACHINE:roc-rk3308-cc = "roc-rk3308-cc"
 
 SRC_URI:append = " 
file://rockchip-kmeta;type=kmeta;name=rockchip-kmeta;destsuffix=rockchip-kmeta"
 SRC_URI:append:nanopi-r4s = " file://nanopi-r4s.scc"
-- 
2.43.0.76.g1a87c842ece3


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



[yocto] [meta-rockchip][PATCH] u-boot: fix build for rk3308

2024-01-16 Thread Trevor Woerner
In upstream mainline U-Boot commit 9e13fef00b8d ("rockchip: Kconfig: Enable
external TPL binary for rk3308") U-Boot was changed to incorporate the DDR TPL
using the same mechanism as the RK3568 and RK3588 platforms.

Signed-off-by: Trevor Woerner 
---
 recipes-bsp/u-boot/u-boot%.bbappend | 10 --
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/recipes-bsp/u-boot/u-boot%.bbappend 
b/recipes-bsp/u-boot/u-boot%.bbappend
index d902c9a05a83..3e59e46c646f 100644
--- a/recipes-bsp/u-boot/u-boot%.bbappend
+++ b/recipes-bsp/u-boot/u-boot%.bbappend
@@ -4,7 +4,10 @@ DEPENDS:append:rock-pi-s = " u-boot-tools-native"
 DEPENDS:append:rock-pi-4 = " gnutls-native"
 
 EXTRA_OEMAKE:append:px30 = " BL31=${DEPLOY_DIR_IMAGE}/bl31-px30.elf"
-EXTRA_OEMAKE:append:rk3308 = " BL31=${DEPLOY_DIR_IMAGE}/bl31-rk3308.elf"
+EXTRA_OEMAKE:append:rk3308 = " \
+   BL31=${DEPLOY_DIR_IMAGE}/bl31-rk3308.elf \
+   ROCKCHIP_TPL=${DEPLOY_DIR_IMAGE}/ddr-rk3308.bin \
+   "
 EXTRA_OEMAKE:append:rk3328 = " BL31=${DEPLOY_DIR_IMAGE}/bl31-rk3328.elf"
 EXTRA_OEMAKE:append:rk3399 = " BL31=${DEPLOY_DIR_IMAGE}/bl31-rk3399.elf"
 EXTRA_OEMAKE:append:rk3588s = " \
@@ -26,8 +29,3 @@ do_compile:append:rock2-square () {
cp ${B}/spl/${SPL_BINARY} ${B}
fi
 }
-
-do_compile:append:rk3308() {
-   mkimage -n rk3308 -T rksd -d ${DEPLOY_DIR_IMAGE}/ddr-rk3308.bin 
${B}/idbloader.img
-   cat ${B}/spl/u-boot-spl.bin >> ${B}/idbloader.img
-}
-- 
2.43.0.76.g1a87c842ece3


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



[yocto] [meta-rockchip][PATCH] roc-rk3328-cc: add

2024-01-16 Thread Trevor Woerner
AKA the "renegade"

The ROC-RK3328-CC platform is built on the Rockchip RK3328 system-on-chip
optimized for low cost, low power, and high performance IO. It features a
high performance native USB 3.0 interface and Gigabit MAC.

Specs:
- RaspberryPi 2/3 form factor
- quad-core ARM Cortex-A53 @ 1.5GHz
- ARM Mali-450 MP2
- DDR4 RAM
- USB 3.0
- GbE MAC

https://libre.computer/products/roc-rk3328-cc/
https://wiki.t-firefly.com/ROC-RK3328-CC/intro.html

Signed-off-by: Trevor Woerner 
---
 README  |  1 +
 conf/machine/roc-rk3328-cc.conf | 11 +++
 recipes-kernel/linux/linux-yocto_%.bbappend |  1 +
 3 files changed, 13 insertions(+)
 create mode 100644 conf/machine/roc-rk3328-cc.conf

diff --git a/README b/README
index 12060cf3c0d5..48cb952a3b09 100644
--- a/README
+++ b/README
@@ -35,6 +35,7 @@ Status of supported boards:
nanopi-m4b
rock-pi-s
rock-5a
+   roc-rk3328-cc
builds:
marsboard-rk3066
radxarock
diff --git a/conf/machine/roc-rk3328-cc.conf b/conf/machine/roc-rk3328-cc.conf
new file mode 100644
index ..05216ec4d15e
--- /dev/null
+++ b/conf/machine/roc-rk3328-cc.conf
@@ -0,0 +1,11 @@
+# Copyright (C) 2021  Trevor Woerner
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+#@TYPE: Machine
+#@NAME: roc-rk3328-cc (aka "renegade")
+#@DESCRIPTION: Libre Computer Board ROC-RK3328-CC (Renegade) Mini Computer 
with Gigabit Ethernet and USB 3.0
+
+require include/rk3328.inc
+
+UBOOT_MACHINE = "roc-cc-rk3328_defconfig"
+KERNEL_DEVICETREE = "rockchip/rk3328-roc-cc.dtb"
diff --git a/recipes-kernel/linux/linux-yocto_%.bbappend 
b/recipes-kernel/linux/linux-yocto_%.bbappend
index 7d8fb8b3d58e..b0efa0d0c130 100644
--- a/recipes-kernel/linux/linux-yocto_%.bbappend
+++ b/recipes-kernel/linux/linux-yocto_%.bbappend
@@ -16,6 +16,7 @@ COMPATIBLE_MACHINE:nanopi-r4s = "nanopi-r4s"
 COMPATIBLE_MACHINE:nanopi-r2s = "nanopi-r2s"
 COMPATIBLE_MACHINE:nanopi-m4b = "nanopi-m4b"
 COMPATIBLE_MACHINE:rock-pi-s = "rock-pi-s"
+COMPATIBLE_MACHINE:roc-rk3328-cc = "roc-rk3328-cc"
 
 SRC_URI:append = " 
file://rockchip-kmeta;type=kmeta;name=rockchip-kmeta;destsuffix=rockchip-kmeta"
 SRC_URI:append:nanopi-r4s = " file://nanopi-r4s.scc"
-- 
2.43.0.76.g1a87c842ece3


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



[yocto] [meta-rockchip][PATCH] rock-pi-e: fix kernel device-tree

2024-01-16 Thread Trevor Woerner
The device-tree for the GbE interface of the rock-pi-e had some properties
in the wrong location. Oddly enough the older rock-pi-e devices with
the Realtek 8211e PHY worked fine, but the latest spin (v1.21) with the
rtl8211f PHY didn't. This fixes allows both PHYs to work.

Signed-off-by: Trevor Woerner 
---
 ...hip-rock-pi-e-adjust-phy-handle-name.patch | 40 +++
 ...ip-rock-pi-e-fix-location-of-snps-pr.patch | 50 +++
 recipes-kernel/linux/linux-yocto_%.bbappend   |  4 ++
 3 files changed, 94 insertions(+)
 create mode 100644 
recipes-kernel/linux/linux-yocto/0001-arm64-dts-rockchip-rock-pi-e-adjust-phy-handle-name.patch
 create mode 100644 
recipes-kernel/linux/linux-yocto/0002-arm64-dts-rockchip-rock-pi-e-fix-location-of-snps-pr.patch

diff --git 
a/recipes-kernel/linux/linux-yocto/0001-arm64-dts-rockchip-rock-pi-e-adjust-phy-handle-name.patch
 
b/recipes-kernel/linux/linux-yocto/0001-arm64-dts-rockchip-rock-pi-e-adjust-phy-handle-name.patch
new file mode 100644
index ..6ba072732854
--- /dev/null
+++ 
b/recipes-kernel/linux/linux-yocto/0001-arm64-dts-rockchip-rock-pi-e-adjust-phy-handle-name.patch
@@ -0,0 +1,40 @@
+From 58f61444baa53d8818911c43e4060d550d5c19b9 Mon Sep 17 00:00:00 2001
+From: Trevor Woerner 
+Date: Tue, 16 Jan 2024 15:03:58 -0500
+Subject: [PATCH 1/2] arm64: dts: rockchip: rock-pi-e: adjust phy-handle name
+
+The rock-pi-e currently comes in 4 board spins, the latest one (v1.21) swaps
+out the Realtek 8211e PHY for an 8211f PHY. Therefore modify the phy-handle
+name to be more generic.
+
+Upstream-Status: Submitted
+Signed-off-by: Trevor Woerner 
+---
+ arch/arm64/boot/dts/rockchip/rk3328-rock-pi-e.dts | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/arch/arm64/boot/dts/rockchip/rk3328-rock-pi-e.dts 
b/arch/arm64/boot/dts/rockchip/rk3328-rock-pi-e.dts
+index 018a3a5075c7..096cfa19036e 100644
+--- a/arch/arm64/boot/dts/rockchip/rk3328-rock-pi-e.dts
 b/arch/arm64/boot/dts/rockchip/rk3328-rock-pi-e.dts
+@@ -146,7 +146,7 @@  {
+   assigned-clocks = < SCLK_MAC2IO>, < SCLK_MAC2IO_EXT>;
+   assigned-clock-parents = <_clkin>, <_clkin>;
+   clock_in_out = "input";
+-  phy-handle = <>;
++  phy-handle = <>;
+   phy-mode = "rgmii";
+   phy-supply = <_io>;
+   pinctrl-names = "default";
+@@ -163,7 +163,7 @@ mdio {
+   #address-cells = <1>;
+   #size-cells = <0>;
+ 
+-  rtl8211e: ethernet-phy@1 {
++  rtl8211: ethernet-phy@1 {
+   reg = <1>;
+   pinctrl-0 = <_phy_int_pin>, <_phy_reset_pin>;
+   pinctrl-names = "default";
+-- 
+2.43.0.76.g1a87c842ece3
+
diff --git 
a/recipes-kernel/linux/linux-yocto/0002-arm64-dts-rockchip-rock-pi-e-fix-location-of-snps-pr.patch
 
b/recipes-kernel/linux/linux-yocto/0002-arm64-dts-rockchip-rock-pi-e-fix-location-of-snps-pr.patch
new file mode 100644
index ..67ed1a09a0c6
--- /dev/null
+++ 
b/recipes-kernel/linux/linux-yocto/0002-arm64-dts-rockchip-rock-pi-e-fix-location-of-snps-pr.patch
@@ -0,0 +1,50 @@
+From 7eaabc1e5047d839376c4d9e511862f7ded67c24 Mon Sep 17 00:00:00 2001
+From: Trevor Woerner 
+Date: Tue, 16 Jan 2024 15:09:15 -0500
+Subject: [PATCH 2/2] arm64: dts: rockchip: rock-pi-e: fix location of snps
+ properties
+
+A number of snps (Synopsys) properties are not in their correct location.
+
+Upstream-Status: Submitted
+Fixes: b918e81f2145 ("arm64: dts: rockchip: rk3328: Add Radxa ROCK Pi E")
+Signed-off-by: Trevor Woerner 
+---
+ arch/arm64/boot/dts/rockchip/rk3328-rock-pi-e.dts | 10 +-
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/arch/arm64/boot/dts/rockchip/rk3328-rock-pi-e.dts 
b/arch/arm64/boot/dts/rockchip/rk3328-rock-pi-e.dts
+index 096cfa19036e..0739b8fec86e 100644
+--- a/arch/arm64/boot/dts/rockchip/rk3328-rock-pi-e.dts
 b/arch/arm64/boot/dts/rockchip/rk3328-rock-pi-e.dts
+@@ -150,8 +150,11 @@  {
+   phy-mode = "rgmii";
+   phy-supply = <_io>;
+   pinctrl-names = "default";
+-  pinctrl-0 = <_pins>;
++  pinctrl-0 = <_pins>, <_phy_reset_pin>;
+   snps,aal;
++  snps,reset-gpio = < RK_PC2 GPIO_ACTIVE_LOW>;
++  snps,reset-active-low;
++  snps,reset-delays-us = <0 1 5>;
+   snps,rxpbl = <0x4>;
+   snps,txpbl = <0x4>;
+   tx_delay = <0x26>;
+@@ -165,13 +168,10 @@ mdio {
+ 
+   rtl8211: ethernet-phy@1 {
+   reg = <1>;
+-  pinctrl-0 = <_phy_int_pin>, <_phy_reset_pin>;
++  pinctrl-0 = <_phy_int_pin>;
+   pinctrl-names = "default";
+   interrupt-parent = <>;
+   interrupts = <24 IRQ_TYPE_LEVEL_

[yocto] [meta-rockchip][PATCH v3] rock-pi-e: enable networking in u-boot

2024-01-16 Thread Trevor Woerner
The rock-pi-e currently comes in 4 board revisions, the latest of which
(v1.21) replaces the realtek 8211e PHY with the 8211f.

This patch enables networking on the rock-pi-e, which had not been working up
to this point. Interestingly enough, this patch also has the side-effect of
enabling both the 8211e and 8211f PHYs under Linux. Previously only the 8211e
boards were working.

Signed-off-by: Trevor Woerner 
---
changes in v3:
- fix the device tree by moving the snps properties to their correct location
- u-boot patch commit message tweaks

changes in v2:
- add eth_phy_reset_pin to pinctrl-0 in gmac2io node
- u-boot patch commit message tweaks
---
 ...s-rk3328-rock-pi-e-enable-networking.patch | 78 +++
 recipes-bsp/u-boot/u-boot%.bbappend   |  5 ++
 2 files changed, 83 insertions(+)
 create mode 100644 
recipes-bsp/u-boot/files/0001-arm-dts-rk3328-rock-pi-e-enable-networking.patch

diff --git 
a/recipes-bsp/u-boot/files/0001-arm-dts-rk3328-rock-pi-e-enable-networking.patch
 
b/recipes-bsp/u-boot/files/0001-arm-dts-rk3328-rock-pi-e-enable-networking.patch
new file mode 100644
index ..7018f0d76324
--- /dev/null
+++ 
b/recipes-bsp/u-boot/files/0001-arm-dts-rk3328-rock-pi-e-enable-networking.patch
@@ -0,0 +1,78 @@
+From 47c4146d2307757340d78117427853409404c080 Mon Sep 17 00:00:00 2001
+From: Trevor Woerner 
+Date: Tue, 16 Jan 2024 14:07:49 -0500
+Subject: [PATCH] arm: dts: rk3328-rock-pi-e: enable networking
+
+Currently the rock-pi-e comes in 4 board spins, the latest of which
+replaces the realtek phy from the rtl8211e to the rtl8211f, therefore
+rename the phy handle to be more generic.
+
+The device tree includes information for the MDIO, therefore enable DM_MDIO
+to use it.
+
+A couple of the snps (Synopsys) properties were in the wrong location
+therefore move them to where they belong.
+
+Upstream-Status: Submitted
+Signed-off-by: Trevor Woerner 
+---
+ arch/arm/dts/rk3328-rock-pi-e.dts  | 14 +++---
+ configs/rock-pi-e-rk3328_defconfig |  2 ++
+ 2 files changed, 9 insertions(+), 7 deletions(-)
+
+diff --git a/arch/arm/dts/rk3328-rock-pi-e.dts 
b/arch/arm/dts/rk3328-rock-pi-e.dts
+index 018a3a5075c7..0739b8fec86e 100644
+--- a/arch/arm/dts/rk3328-rock-pi-e.dts
 b/arch/arm/dts/rk3328-rock-pi-e.dts
+@@ -146,12 +146,15 @@
+   assigned-clocks = < SCLK_MAC2IO>, < SCLK_MAC2IO_EXT>;
+   assigned-clock-parents = <_clkin>, <_clkin>;
+   clock_in_out = "input";
+-  phy-handle = <>;
++  phy-handle = <>;
+   phy-mode = "rgmii";
+   phy-supply = <_io>;
+   pinctrl-names = "default";
+-  pinctrl-0 = <_pins>;
++  pinctrl-0 = <_pins>, <_phy_reset_pin>;
+   snps,aal;
++  snps,reset-gpio = < RK_PC2 GPIO_ACTIVE_LOW>;
++  snps,reset-active-low;
++  snps,reset-delays-us = <0 1 5>;
+   snps,rxpbl = <0x4>;
+   snps,txpbl = <0x4>;
+   tx_delay = <0x26>;
+@@ -163,15 +166,12 @@
+   #address-cells = <1>;
+   #size-cells = <0>;
+ 
+-  rtl8211e: ethernet-phy@1 {
++  rtl8211: ethernet-phy@1 {
+   reg = <1>;
+-  pinctrl-0 = <_phy_int_pin>, <_phy_reset_pin>;
++  pinctrl-0 = <_phy_int_pin>;
+   pinctrl-names = "default";
+   interrupt-parent = <>;
+   interrupts = <24 IRQ_TYPE_LEVEL_LOW>;
+-  reset-assert-us = <1>;
+-  reset-deassert-us = <5>;
+-  reset-gpios = < RK_PC2 GPIO_ACTIVE_LOW>;
+   };
+   };
+ };
+diff --git a/configs/rock-pi-e-rk3328_defconfig 
b/configs/rock-pi-e-rk3328_defconfig
+index c0375beffec3..65ca028c0787 100644
+--- a/configs/rock-pi-e-rk3328_defconfig
 b/configs/rock-pi-e-rk3328_defconfig
+@@ -76,6 +76,8 @@ CONFIG_SYS_I2C_ROCKCHIP=y
+ CONFIG_MISC=y
+ CONFIG_MMC_DW=y
+ CONFIG_MMC_DW_ROCKCHIP=y
++CONFIG_PHY_REALTEK=y
++CONFIG_DM_MDIO=y
+ CONFIG_ETH_DESIGNWARE=y
+ CONFIG_GMAC_ROCKCHIP=y
+ CONFIG_PHY_ROCKCHIP_INNO_USB2=y
+-- 
+2.43.0.76.g1a87c842ece3
+
diff --git a/recipes-bsp/u-boot/u-boot%.bbappend 
b/recipes-bsp/u-boot/u-boot%.bbappend
index d902c9a05a83..62133f24c64a 100644
--- a/recipes-bsp/u-boot/u-boot%.bbappend
+++ b/recipes-bsp/u-boot/u-boot%.bbappend
@@ -1,3 +1,8 @@
+FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
+SRC_URI:append:rock-pi-e = " \
+   file://0001-arm-dts-rk3328-rock-pi-e-enable-networking.patch \
+   "
+
 # various machines require the pyelftools library for parsing dtb files
 DEPENDS:append = " python3-pyelftools-native"
 DEPENDS:append:rock-pi-s = " u-boot-tools-native"
-- 
2.43.0.76.g1a87c842ece3


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/

[yocto] [meta-rockchip][PATCH v2] rock-pi-e: enable networking in u-boot

2024-01-16 Thread Trevor Woerner
The rock-pi-e currently comes in 4 board revisions, the latest of which
(v1.21) replaces the realtek 8211e PHY with the 8211f.

This patch enables networking on the rock-pi-e, which had not been working up
to this point. Interestingly enough, this patch also has the side-effect of
enabling both the 8211e and 8211f PHYs under Linux. Previously only the 8211e
boards were working.

Signed-off-by: Trevor Woerner 
---
changes in v2:
- add eth_phy_reset_pin to pinctrl-0 in gmac2io node
- u-boot patch commit message tweaks
---
 ...s-rk3328-rock-pi-e-enable-networking.patch | 68 +++
 recipes-bsp/u-boot/u-boot%.bbappend   |  5 ++
 2 files changed, 73 insertions(+)
 create mode 100644 
recipes-bsp/u-boot/files/0001-arm-dts-rk3328-rock-pi-e-enable-networking.patch

diff --git 
a/recipes-bsp/u-boot/files/0001-arm-dts-rk3328-rock-pi-e-enable-networking.patch
 
b/recipes-bsp/u-boot/files/0001-arm-dts-rk3328-rock-pi-e-enable-networking.patch
new file mode 100644
index ..e1c71a40261b
--- /dev/null
+++ 
b/recipes-bsp/u-boot/files/0001-arm-dts-rk3328-rock-pi-e-enable-networking.patch
@@ -0,0 +1,68 @@
+From 9204939a75805769c654b1dab399c30f2b9bd9b4 Mon Sep 17 00:00:00 2001
+From: Trevor Woerner 
+Date: Tue, 16 Jan 2024 11:33:50 -0500
+Subject: [PATCH] arm: dts: rk3328-rock-pi-e: enable networking
+
+Currently the rock-pi-e comes in 4 board spins, the latest of which
+replaces the realtek phy from the rtl8211e to the rtl8211f, therefore
+rename the phy handle to be more generic.
+
+The device tree includes information for the MDIO, therefore enable DM_MDIO
+to use it. The gmac2io node needs addition information in order for the
+driver to initialize correctly, specifically the 3 "snps" lines; add the
+reset pin to the pinctrl-0 entry to match.
+
+Upstream-Status: Submitted
+Signed-off-by: Trevor Woerner 
+---
+ arch/arm/dts/rk3328-rock-pi-e.dts  | 9 ++---
+ configs/rock-pi-e-rk3328_defconfig | 2 ++
+ 2 files changed, 8 insertions(+), 3 deletions(-)
+
+diff --git a/arch/arm/dts/rk3328-rock-pi-e.dts 
b/arch/arm/dts/rk3328-rock-pi-e.dts
+index 018a3a5075c7..f5e28cbf4ffe 100644
+--- a/arch/arm/dts/rk3328-rock-pi-e.dts
 b/arch/arm/dts/rk3328-rock-pi-e.dts
+@@ -146,12 +146,15 @@
+   assigned-clocks = < SCLK_MAC2IO>, < SCLK_MAC2IO_EXT>;
+   assigned-clock-parents = <_clkin>, <_clkin>;
+   clock_in_out = "input";
+-  phy-handle = <>;
++  phy-handle = <>;
+   phy-mode = "rgmii";
+   phy-supply = <_io>;
+   pinctrl-names = "default";
+-  pinctrl-0 = <_pins>;
++  pinctrl-0 = <_pins>, <_phy_reset_pin>;
+   snps,aal;
++  snps,reset-gpio = < RK_PC2 GPIO_ACTIVE_LOW>;
++  snps,reset-active-low;
++  snps,reset-delays-us = <0 1 5>;
+   snps,rxpbl = <0x4>;
+   snps,txpbl = <0x4>;
+   tx_delay = <0x26>;
+@@ -163,7 +166,7 @@
+   #address-cells = <1>;
+   #size-cells = <0>;
+ 
+-  rtl8211e: ethernet-phy@1 {
++  rtl8211: ethernet-phy@1 {
+   reg = <1>;
+   pinctrl-0 = <_phy_int_pin>, <_phy_reset_pin>;
+   pinctrl-names = "default";
+diff --git a/configs/rock-pi-e-rk3328_defconfig 
b/configs/rock-pi-e-rk3328_defconfig
+index c0375beffec3..65ca028c0787 100644
+--- a/configs/rock-pi-e-rk3328_defconfig
 b/configs/rock-pi-e-rk3328_defconfig
+@@ -76,6 +76,8 @@ CONFIG_SYS_I2C_ROCKCHIP=y
+ CONFIG_MISC=y
+ CONFIG_MMC_DW=y
+ CONFIG_MMC_DW_ROCKCHIP=y
++CONFIG_PHY_REALTEK=y
++CONFIG_DM_MDIO=y
+ CONFIG_ETH_DESIGNWARE=y
+ CONFIG_GMAC_ROCKCHIP=y
+ CONFIG_PHY_ROCKCHIP_INNO_USB2=y
+-- 
+2.43.0.76.g1a87c842ece3
+
diff --git a/recipes-bsp/u-boot/u-boot%.bbappend 
b/recipes-bsp/u-boot/u-boot%.bbappend
index d902c9a05a83..62133f24c64a 100644
--- a/recipes-bsp/u-boot/u-boot%.bbappend
+++ b/recipes-bsp/u-boot/u-boot%.bbappend
@@ -1,3 +1,8 @@
+FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
+SRC_URI:append:rock-pi-e = " \
+   file://0001-arm-dts-rk3328-rock-pi-e-enable-networking.patch \
+   "
+
 # various machines require the pyelftools library for parsing dtb files
 DEPENDS:append = " python3-pyelftools-native"
 DEPENDS:append:rock-pi-s = " u-boot-tools-native"
-- 
2.43.0.76.g1a87c842ece3


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



[yocto] [meta-rockchip][PATCH] rock-pi-e: enable networking in u-boot

2024-01-16 Thread Trevor Woerner
The rock-pi-e currently comes in 4 board revisions, the latest of which
(v1.21) replaces the realtek 8211e PHY with the 8211f.

This patch enables networking on the rock-pi-e, which had not been working up
to this point. Interestingly enough, this patch also has the side-effect of
enabling both the 8211e and 8211f PHYs under Linux. Previously only the 8211e
boards were working.

Signed-off-by: Trevor Woerner 
---
 ...s-rk3328-rock-pi-e-enable-networking.patch | 68 +++
 recipes-bsp/u-boot/u-boot%.bbappend   |  5 ++
 2 files changed, 73 insertions(+)
 create mode 100644 
recipes-bsp/u-boot/files/0001-arm-dts-rk3328-rock-pi-e-enable-networking.patch

diff --git 
a/recipes-bsp/u-boot/files/0001-arm-dts-rk3328-rock-pi-e-enable-networking.patch
 
b/recipes-bsp/u-boot/files/0001-arm-dts-rk3328-rock-pi-e-enable-networking.patch
new file mode 100644
index ..6900543559b1
--- /dev/null
+++ 
b/recipes-bsp/u-boot/files/0001-arm-dts-rk3328-rock-pi-e-enable-networking.patch
@@ -0,0 +1,68 @@
+From e7b7ba2baeec01e18e7633fad81aa91d1bf64ee1 Mon Sep 17 00:00:00 2001
+From: Trevor Woerner 
+Date: Tue, 16 Jan 2024 09:58:35 -0500
+Subject: [PATCH] arm: dts: rk3328-rock-pi-e: enable networking
+
+Currently the rock-pi-e comes in 4 board spins, the latest of which replaces
+the realtek phy from the rtl8211e to the rtl8211f, therefore rename the phy
+handle to be more generic.
+
+The device tree includes information for the MDIO, therefore enable DM_MDIO to
+use it.
+
+The gmac2io clause needs addition information in order for the driver to
+initialize correctly.
+
+Upstream-Status: Submitted
+Signed-off-by: Trevor Woerner 
+---
+ arch/arm/dts/rk3328-rock-pi-e.dts  | 7 +--
+ configs/rock-pi-e-rk3328_defconfig | 2 ++
+ 2 files changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/arch/arm/dts/rk3328-rock-pi-e.dts 
b/arch/arm/dts/rk3328-rock-pi-e.dts
+index 018a3a5075c7..aa30de69e815 100644
+--- a/arch/arm/dts/rk3328-rock-pi-e.dts
 b/arch/arm/dts/rk3328-rock-pi-e.dts
+@@ -146,12 +146,15 @@
+   assigned-clocks = < SCLK_MAC2IO>, < SCLK_MAC2IO_EXT>;
+   assigned-clock-parents = <_clkin>, <_clkin>;
+   clock_in_out = "input";
+-  phy-handle = <>;
++  phy-handle = <>;
+   phy-mode = "rgmii";
+   phy-supply = <_io>;
+   pinctrl-names = "default";
+   pinctrl-0 = <_pins>;
+   snps,aal;
++  snps,reset-gpio = < RK_PC2 GPIO_ACTIVE_LOW>;
++  snps,reset-active-low;
++  snps,reset-delays-us = <0 1 5>;
+   snps,rxpbl = <0x4>;
+   snps,txpbl = <0x4>;
+   tx_delay = <0x26>;
+@@ -163,7 +166,7 @@
+   #address-cells = <1>;
+   #size-cells = <0>;
+ 
+-  rtl8211e: ethernet-phy@1 {
++  rtl8211: ethernet-phy@1 {
+   reg = <1>;
+   pinctrl-0 = <_phy_int_pin>, <_phy_reset_pin>;
+   pinctrl-names = "default";
+diff --git a/configs/rock-pi-e-rk3328_defconfig 
b/configs/rock-pi-e-rk3328_defconfig
+index c0375beffec3..65ca028c0787 100644
+--- a/configs/rock-pi-e-rk3328_defconfig
 b/configs/rock-pi-e-rk3328_defconfig
+@@ -76,6 +76,8 @@ CONFIG_SYS_I2C_ROCKCHIP=y
+ CONFIG_MISC=y
+ CONFIG_MMC_DW=y
+ CONFIG_MMC_DW_ROCKCHIP=y
++CONFIG_PHY_REALTEK=y
++CONFIG_DM_MDIO=y
+ CONFIG_ETH_DESIGNWARE=y
+ CONFIG_GMAC_ROCKCHIP=y
+ CONFIG_PHY_ROCKCHIP_INNO_USB2=y
+-- 
+2.43.0.76.g1a87c842ece3
+
diff --git a/recipes-bsp/u-boot/u-boot%.bbappend 
b/recipes-bsp/u-boot/u-boot%.bbappend
index d902c9a05a83..62133f24c64a 100644
--- a/recipes-bsp/u-boot/u-boot%.bbappend
+++ b/recipes-bsp/u-boot/u-boot%.bbappend
@@ -1,3 +1,8 @@
+FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
+SRC_URI:append:rock-pi-e = " \
+   file://0001-arm-dts-rk3328-rock-pi-e-enable-networking.patch \
+   "
+
 # various machines require the pyelftools library for parsing dtb files
 DEPENDS:append = " python3-pyelftools-native"
 DEPENDS:append:rock-pi-s = " u-boot-tools-native"
-- 
2.43.0.76.g1a87c842ece3


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



[yocto] [meta-rockchip][PATCH] remove adding all kernel modules by default

2024-01-14 Thread Trevor Woerner
A BSP layer shouldn't be deciding to include all kernel modules. That's more
of a distro decision, or for local.conf at a minimum. Modules that are
required for the basic functioning of a board are fine, but doing a blanket
"install all" is overreach and inflates images unnecessarily (~45MB, by one
measurement).

I expect patches will probably roll in after this one to add back necessary
modules, but it will be easier to figure out which ones when starting with
having none of them included by default.

Signed-off-by: Trevor Woerner 
---
 conf/machine/include/rock-pi-4.inc | 2 --
 conf/machine/nanopi-m4b.conf   | 2 --
 conf/machine/nanopi-r2s.conf   | 1 -
 conf/machine/nanopi-r4s.conf   | 2 --
 conf/machine/rock-5a.conf  | 1 -
 conf/machine/rock-5b.conf  | 1 -
 conf/machine/rock-pi-e.conf| 1 -
 conf/machine/rock-pi-s.conf| 1 -
 8 files changed, 11 deletions(-)

diff --git a/conf/machine/include/rock-pi-4.inc 
b/conf/machine/include/rock-pi-4.inc
index 0a868463bc64..02dfb18fc775 100644
--- a/conf/machine/include/rock-pi-4.inc
+++ b/conf/machine/include/rock-pi-4.inc
@@ -2,5 +2,3 @@
 MACHINEOVERRIDES =. "rock-pi-4:"
 
 require conf/machine/include/rk3399.inc
-
-MACHINE_EXTRA_RRECOMMENDS += "kernel-modules"
diff --git a/conf/machine/nanopi-m4b.conf b/conf/machine/nanopi-m4b.conf
index 35cd8f68e82e..b924b0018867 100644
--- a/conf/machine/nanopi-m4b.conf
+++ b/conf/machine/nanopi-m4b.conf
@@ -5,7 +5,5 @@
 
 require conf/machine/include/rk3399.inc
 
-MACHINE_EXTRA_RRECOMMENDS += "kernel-modules"
-
 KERNEL_DEVICETREE = "rockchip/rk3399-nanopi-m4b.dtb"
 UBOOT_MACHINE = "nanopi-m4b-rk3399_defconfig"
diff --git a/conf/machine/nanopi-r2s.conf b/conf/machine/nanopi-r2s.conf
index 4472c21f0217..0451002ecff5 100644
--- a/conf/machine/nanopi-r2s.conf
+++ b/conf/machine/nanopi-r2s.conf
@@ -6,6 +6,5 @@
 require conf/machine/include/rk3328.inc
 
 KERNEL_DEVICETREE = "rockchip/rk3328-nanopi-r2s.dtb"
-MACHINE_EXTRA_RRECOMMENDS += "kernel-modules"
 
 UBOOT_MACHINE = "nanopi-r2s-rk3328_defconfig"
diff --git a/conf/machine/nanopi-r4s.conf b/conf/machine/nanopi-r4s.conf
index 21be4400c89d..161f4b4e4609 100644
--- a/conf/machine/nanopi-r4s.conf
+++ b/conf/machine/nanopi-r4s.conf
@@ -5,7 +5,5 @@
 
 require conf/machine/include/rk3399.inc
 
-MACHINE_EXTRA_RRECOMMENDS += "kernel-modules"
-
 KERNEL_DEVICETREE = "rockchip/rk3399-nanopi-r4s.dtb"
 UBOOT_MACHINE = "nanopi-r4s-rk3399_defconfig"
diff --git a/conf/machine/rock-5a.conf b/conf/machine/rock-5a.conf
index 5ace4dac8fe4..28e06486eda3 100644
--- a/conf/machine/rock-5a.conf
+++ b/conf/machine/rock-5a.conf
@@ -7,6 +7,5 @@ require conf/machine/include/rk3588s.inc
 
 PREFERRED_PROVIDER_virtual/kernel = "linux-yocto-dev"
 KERNEL_DEVICETREE = "rockchip/rk3588s-rock-5a.dtb"
-MACHINE_EXTRA_RRECOMMENDS += "kernel-modules"
 
 UBOOT_MACHINE = "rock5a-rk3588s_defconfig"
diff --git a/conf/machine/rock-5b.conf b/conf/machine/rock-5b.conf
index d1371084becc..ea2cf219e153 100644
--- a/conf/machine/rock-5b.conf
+++ b/conf/machine/rock-5b.conf
@@ -7,6 +7,5 @@ require conf/machine/include/rk3588.inc
 
 PREFERRED_PROVIDER_virtual/kernel = "linux-yocto-dev"
 KERNEL_DEVICETREE = "rockchip/rk3588-rock-5b.dtb"
-MACHINE_EXTRA_RRECOMMENDS += "kernel-modules"
 
 UBOOT_MACHINE = "rock5b-rk3588_defconfig"
diff --git a/conf/machine/rock-pi-e.conf b/conf/machine/rock-pi-e.conf
index 517956c4b9db..1e2169b01993 100644
--- a/conf/machine/rock-pi-e.conf
+++ b/conf/machine/rock-pi-e.conf
@@ -6,6 +6,5 @@
 require conf/machine/include/rk3328.inc
 
 KERNEL_DEVICETREE = "rockchip/rk3328-rock-pi-e.dtb"
-MACHINE_EXTRA_RRECOMMENDS += "kernel-modules"
 
 UBOOT_MACHINE = "rock-pi-e-rk3328_defconfig"
diff --git a/conf/machine/rock-pi-s.conf b/conf/machine/rock-pi-s.conf
index 79ea73c6b47e..3aa868b7ec7c 100644
--- a/conf/machine/rock-pi-s.conf
+++ b/conf/machine/rock-pi-s.conf
@@ -6,6 +6,5 @@
 require conf/machine/include/rk3308.inc
 
 KERNEL_DEVICETREE = "rockchip/rk3308-rock-pi-s.dtb"
-MACHINE_EXTRA_RRECOMMENDS += "kernel-modules"
 
 UBOOT_MACHINE = "rock-pi-s-rk3308_defconfig"
-- 
2.43.0.76.g1a87c842ece3


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



Re: [yocto] [meta-rockchip] [PATCH] rock 4c+: add

2024-01-06 Thread Trevor Woerner
Hi Stephen,

Thanks for the patch.

Please use the proposed Yocto name for the board you are adding.

On Thu 2023-12-21 @ 09:41:00 AM, Stephen Chen wrote:
> ROCK 4C+ is a Rockchip RK3399-T based SBC from Radxa.
> Main differences of ROCK 4C+ compared to other ROCK 4 SBC.
> - Rockchip RK3399-T SoC
> - DP from ROCK Pi 4C replaced with micro HDMI 2K@60fps
> - 4-lane MIPI DSI
> - RK817 Audio codec

I want to see the capabilities of the board that is being added. Not what
amounts to a diff between this new board and some other random board.

Could you add the new board to the README file as well (the list is sorted
chronologically, later entries are the most recently-added boards).

Also, do we need to add a COMPATIBLE_MACHINE entry for the kernel?

> 
> Signed-off-by: Stephen Chen 
> ---
>  conf/machine/rock-4c-plus.conf | 10 ++
>  1 file changed, 10 insertions(+)
>  create mode 100644 conf/machine/rock-4c-plus.conf
> 
> diff --git a/conf/machine/rock-4c-plus.conf b/conf/machine/rock-4c-plus.conf
> new file mode 100644
> index 000..424fed2
> --- /dev/null
> +++ b/conf/machine/rock-4c-plus.conf
> @@ -0,0 +1,10 @@
> +#@TYPE: Machine
> +#@NAME: ROCK 4C+
> +#@DESCRIPTION: ROCK 4C+ based on Rockchip RK3399-T Processor is designed by 
> Radxa.
> +#https://wiki.radxa.com/Rock4/4cplus
> +#https://docs.radxa.com/en/rock4/rock4c+
> +
> +require conf/machine/include/rock-pi-4.inc
> +
> +KERNEL_DEVICETREE = "rockchip/rk3399-rock-4c-plus.dtb"
> +UBOOT_MACHINE = "rock-4c-plus-rk3399_defconfig"
> -- 
> 2.34.1
> 

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



Re: [yocto] [meta-rockchip] [PATCH] use MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS to add kernel-modules

2024-01-06 Thread Trevor Woerner
I have been running little experiments on various builds with
meta-rockchip and with just oe-core and qemu machines. The more
I think about it, the more I wonder why a BSP layer is including
kernel modules via MACHINE_EXTRA_RRECOMMENDS at all, never mind
with MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS.

If a specific module were required for something to work (like wifi) or
perhaps some firmware blob, then it would be understandable. But a blanket
pulling in of all kernel modules by the BSP layer seems fishy.

This feels more like a distro setting, or local.conf at the very least.

I'm going to remove these from meta-rockchip. We can see if any are truly
required for a board to work.

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



Re: [yocto] [meta-rockchip] [PATCH] use MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS to add kernel-modules

2024-01-03 Thread Trevor Woerner
On Tue 2023-12-19 @ 07:23:52 PM, Stephen Chen wrote:
> This will add all built kernel modules to the image.
> 
> Signed-off-by: Stephen Chen 
> 
> diff --git a/conf/machine/include/rock-pi-4.inc 
> b/conf/machine/include/rock-pi-4.inc
> index 0a86846..fd9a9eb 100644
> --- a/conf/machine/include/rock-pi-4.inc
> +++ b/conf/machine/include/rock-pi-4.inc
> @@ -3,4 +3,4 @@ MACHINEOVERRIDES =. "rock-pi-4:"
>  
>  require conf/machine/include/rk3399.inc
>  
> -MACHINE_EXTRA_RRECOMMENDS += "kernel-modules"
> +MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += "kernel-modules"
> diff --git a/conf/machine/nanopi-m4b.conf b/conf/machine/nanopi-m4b.conf
> index 35cd8f6..01d5c59 100644
> --- a/conf/machine/nanopi-m4b.conf
> +++ b/conf/machine/nanopi-m4b.conf
> @@ -5,7 +5,7 @@

I've tried this a couple times and a couple different ways and I can't figure
out how what we already have (MACHINE_EXTRA_RRECOMMENDS) is any different from
what you're proposing (MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS).

Using a very basic, no-distro setup I've built core-image-minimal and
core-image-base both with and without your patch and I see absolutely no
difference in the list of installed packages
(buildhistory/images/rock_5b/glibc/core-image-*/installed-packages.txt).

All of meta-rockchip's machine/include/* files already include
MACHINE_EXTRA_RRECOMMENDS, do you have a scenario where a build is not
including all of the built kernel modules in an image?

>  require conf/machine/include/rk3399.inc
>  
> -MACHINE_EXTRA_RRECOMMENDS += "kernel-modules"
> +MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += "kernel-modules"
>  
>  KERNEL_DEVICETREE = "rockchip/rk3399-nanopi-m4b.dtb"
>  UBOOT_MACHINE = "nanopi-m4b-rk3399_defconfig"
> diff --git a/conf/machine/nanopi-r2s.conf b/conf/machine/nanopi-r2s.conf
> index 4472c21..4ed3160 100644
> --- a/conf/machine/nanopi-r2s.conf
> +++ b/conf/machine/nanopi-r2s.conf
> @@ -6,6 +6,6 @@
>  require conf/machine/include/rk3328.inc
>  
>  KERNEL_DEVICETREE = "rockchip/rk3328-nanopi-r2s.dtb"
> -MACHINE_EXTRA_RRECOMMENDS += "kernel-modules"
> +MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += "kernel-modules"
>  
>  UBOOT_MACHINE = "nanopi-r2s-rk3328_defconfig"
> diff --git a/conf/machine/nanopi-r4s.conf b/conf/machine/nanopi-r4s.conf
> index 21be440..1a63a96 100644
> --- a/conf/machine/nanopi-r4s.conf
> +++ b/conf/machine/nanopi-r4s.conf
> @@ -5,7 +5,7 @@
>  
>  require conf/machine/include/rk3399.inc
>  
> -MACHINE_EXTRA_RRECOMMENDS += "kernel-modules"
> +MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += "kernel-modules"
>  
>  KERNEL_DEVICETREE = "rockchip/rk3399-nanopi-r4s.dtb"
>  UBOOT_MACHINE = "nanopi-r4s-rk3399_defconfig"
> diff --git a/conf/machine/rock-5a.conf b/conf/machine/rock-5a.conf
> index 5ace4da..53b56b1 100644
> --- a/conf/machine/rock-5a.conf
> +++ b/conf/machine/rock-5a.conf
> @@ -7,6 +7,6 @@ require conf/machine/include/rk3588s.inc
>  
>  PREFERRED_PROVIDER_virtual/kernel = "linux-yocto-dev"
>  KERNEL_DEVICETREE = "rockchip/rk3588s-rock-5a.dtb"
> -MACHINE_EXTRA_RRECOMMENDS += "kernel-modules"
> +MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += "kernel-modules"
>  
>  UBOOT_MACHINE = "rock5a-rk3588s_defconfig"
> diff --git a/conf/machine/rock-5b.conf b/conf/machine/rock-5b.conf
> index d137108..dc5fabc 100644
> --- a/conf/machine/rock-5b.conf
> +++ b/conf/machine/rock-5b.conf
> @@ -7,6 +7,6 @@ require conf/machine/include/rk3588.inc
>  
>  PREFERRED_PROVIDER_virtual/kernel = "linux-yocto-dev"
>  KERNEL_DEVICETREE = "rockchip/rk3588-rock-5b.dtb"
> -MACHINE_EXTRA_RRECOMMENDS += "kernel-modules"
> +MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += "kernel-modules"
>  
>  UBOOT_MACHINE = "rock5b-rk3588_defconfig"
> diff --git a/conf/machine/rock-pi-e.conf b/conf/machine/rock-pi-e.conf
> index 517956c..3f83675 100644
> --- a/conf/machine/rock-pi-e.conf
> +++ b/conf/machine/rock-pi-e.conf
> @@ -6,6 +6,6 @@
>  require conf/machine/include/rk3328.inc
>  
>  KERNEL_DEVICETREE = "rockchip/rk3328-rock-pi-e.dtb"
> -MACHINE_EXTRA_RRECOMMENDS += "kernel-modules"
> +MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += "kernel-modules"
>  
>  UBOOT_MACHINE = "rock-pi-e-rk3328_defconfig"
> diff --git a/conf/machine/rock-pi-s.conf b/conf/machine/rock-pi-s.conf
> index 79ea73c..590e972 100644
> --- a/conf/machine/rock-pi-s.conf
> +++ b/conf/machine/rock-pi-s.conf
> @@ -6,6 +6,6 @@
>  require conf/machine/include/rk3308.inc
>  
>  KERNEL_DEVICETREE = "rockchip/rk3308-rock-pi-s.dtb"
> -MACHINE_EXTRA_RRECOMMENDS += "kernel-modules"
> +MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += "kernel-modules"
>  
>  UBOOT_MACHINE = "rock-pi-s-rk3308_defconfig"
> -- 
> 2.25.1
> 

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



Re: [yocto] [meta-rockchip] [PATCH] orange-pi-5-plus: Support Xunlong Orange Pi 5 Plus single-board computer

2023-12-18 Thread Trevor Woerner
On Fri 2023-12-15 @ 10:30:51 PM, Abhisit Sangjan wrote:
> Orange Pi 5 Plus is RK3588 based SBC featuring:
> - 2x 2.5G ethernet ports – onboard NIC hooked to PCIe 2.0 interface
> - 2x USB 2.0 host ports
> - 2x USB 3.0 host ports (exposed over USB 3.0 hub)
> - Type-C port featuring USB 2.0/3.0 and Alt-DP mode
> - PCIe 2.0/USB 2.0/I2S/I2C/UART on E.KEY socket
> - RTC
> - ES8388 on-board sound codec – jack in/out, onboard mic, speaker amplifier
> - SPI NOR flash
> - RGB LED (R is always on)
> - IR receiver
> - PCIe 3.0 on the bottom for NVMe, etc.
> - 40pin GPIO header (with gpio, I2C, SPI, PWM, UART)
> - Power, recovery and Mask ROM buttons
> - 2x HDMI out, 1x HDMI in
> - Slots/connectors for eMMC, uSD card, fan, MIPI CSI/DSI
> - 4 GB, 8 GB, 16 GB and 32 GB of RAM
> 
> Signed-off-by: Abhisit Sangjan 
> ---
>  README|  3 ++-
>  conf/machine/include/rk3588.inc   |  4 +---
>  conf/machine/orange-pi-5-plus.conf| 14 ++
>  recipes-bsp/rkbin/rockchip-rkbin_git.bb   | 10 ++
>  recipes-bsp/u-boot/u-boot%.bbappend   |  5 +
>  recipes-bsp/u-boot/u-boot_2024.01.bb  |  5 +
>  recipes-kernel/linux/linux-yocto-dev.bbappend |  5 +
>  7 files changed, 42 insertions(+), 4 deletions(-)
>  create mode 100644 conf/machine/orange-pi-5-plus.conf
>  create mode 100644 recipes-bsp/u-boot/u-boot_2024.01.bb
> 
> diff --git a/README b/README
> index e5beaa0..4d1a83e 100644
> --- a/README
> +++ b/README
> @@ -31,6 +31,7 @@ Status of supported boards:
>   firefly-rk3288
>   nanopi-r4s
>   rock-5b
> + orange-pi-5-plus
>   nanopi-r2s
>   nanopi-m4b
>   rock-pi-s

The list is "sorted" from earliest inclusion in meta-rockchip to latest.
Therefore the most recent addition should be added at the bottom of the list.

> @@ -57,7 +58,7 @@ Notes:
>   initializer from rkbin, simply set:
>  
>   RKBIN_RK3308_LATEST = "1"
> - 
> +

Remove spurious edits.

>   in the configuration (e.g. conf/local.conf).
>  
>  Maintenance:
> diff --git a/conf/machine/include/rk3588.inc b/conf/machine/include/rk3588.inc
> index 34f0627..46ac2ba 100644
> --- a/conf/machine/include/rk3588.inc
> +++ b/conf/machine/include/rk3588.inc
> @@ -1,6 +1,4 @@
>  MACHINEOVERRIDES =. "rk3588:"
>  
> -# the rk3588s is a "stripped-down" version of the rk3588
> -# in the kernel's device-tree the rk3588 builds on top of the rk3588s
> -# so anything that is valid for the rk3588s is valid for the rk3588
> +# The rk3588 is a "full" version of the rk3588 series
>  require conf/machine/include/rk3588s.inc

You don't understand how we're using rk3588 and rk3588s in meta-rockchip. From
meta-rockchip's point of view their the same so instead of having two
identical include files, we simply reference one from the other. The comment
was placed there on purpose to point this out to the user.

> diff --git a/conf/machine/orange-pi-5-plus.conf 
> b/conf/machine/orange-pi-5-plus.conf
> new file mode 100644
> index 000..a222c84
> --- /dev/null
> +++ b/conf/machine/orange-pi-5-plus.conf
> @@ -0,0 +1,14 @@
> +#@TYPE: Machine
> +#@NAME: Xunlong Orange Pi 5 Plus
> +#@DESCRIPTION: It is the 5th generation of single-board computer designed by 
> Kunlong.
> +#http://www.orangepi.org/html/hardWare/computerAndMicrocontrollers/details/Orange-Pi-5-plus-32GB.html
> +
> +require conf/machine/include/rk3588.inc
> +
> +PREFERRED_PROVIDER_virtual/kernel = "linux-yocto-dev"
> +KERNEL_DEVICETREE = "rockchip/rk3588-orangepi-5-plus.dtb"
> +MACHINE_EXTRA_RRECOMMENDS += "kernel-modules"
> +
> +UBOOT_MACHINE = "orangepi-5-plus-rk3588_defconfig"
> +
> +PREFERRED_VERSION_u-boot:orange-pi-5-plus = "2024.01"

I would rather not introduce a new recipe just to remove it in a couple weeks.
If orange-pi-5-plus needs u-boot 2024.1 then we can wait a couple weeks to add
it once oe-core's u-boot moves.

> diff --git a/recipes-bsp/rkbin/rockchip-rkbin_git.bb 
> b/recipes-bsp/rkbin/rockchip-rkbin_git.bb
> index f1609c7..5573ad2 100644
> --- a/recipes-bsp/rkbin/rockchip-rkbin_git.bb
> +++ b/recipes-bsp/rkbin/rockchip-rkbin_git.bb
> @@ -14,6 +14,7 @@ S = "${WORKDIR}/git"
>  
>  COMPATIBLE_MACHINE = "^$"
>  COMPATIBLE_MACHINE:rk3308 = "rk3308"
> +COMPATIBLE_MACHINE:rk3588 = "rk3588"
>  COMPATIBLE_MACHINE:rk3588s = "rk3588s"
>  
>  PACKAGE_ARCH = "${MACHINE_ARCH}"
> @@ -35,6 +36,15 @@ do_deploy:rk3308() {
>   install -m 644 ${S}/bin/rk33/rk3308_ddr_589MHz_uart?_m0_v*.bin 
> ${DEPLOYDIR}/ddr-rk3308.bin
>  }
>  
> +do_deploy:rk3588() {
> + # Prebuilt TF-A
> + install -m 644 ${S}/bin/rk35/rk3588_bl31_v*.elf 
> ${DEPLOYDIR}/bl31-rk3588.elf
> + # Prebuilt OPTEE-OS
> + install -m 644 ${S}/bin/rk35/rk3588_bl32_v*.bin 
> ${DEPLOYDIR}/tee-rk3588.bin
> + # Prebuilt U-Boot TPL (DDR init)
> + install -m 644 ${S}/bin/rk35/rk3588_ddr_lp4_2112MHz_lp5_2736MHz_v*.bin 
> ${DEPLOYDIR}/ddr-rk3588.bin
> +}
> 

Re: [yocto] [meta-rockchip] [PATCH] Allow KERNEL_IMAGETYPE override v3

2023-11-16 Thread Trevor Woerner
On Tue 2023-10-03 @ 11:43:08 AM, anthony.t.dav...@gmail.com wrote:
> From: Anthony Davies 
> 
> Updated inc files to allow overriding KERNEL_IMAGETYPE in local.conf
> 
> Signed-off-by: Anthony Davies 
> ---
>  conf/machine/include/px30.inc   | 2 +-
>  conf/machine/include/rk3066.inc | 2 +-
>  conf/machine/include/rk3188.inc | 2 +-
>  conf/machine/include/rk3288.inc | 2 +-
>  conf/machine/include/rk3328.inc | 2 +-
>  conf/machine/include/rk3399.inc | 2 +-
>  6 files changed, 6 insertions(+), 6 deletions(-)

Applied, with a couple tweaks, to meta-rockchip, master branch.
Thanks!

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



[yocto] [meta-rockchip][PATCH] rkbin:rk3308: pre-cleanup

2023-11-03 Thread Trevor Woerner
Since 2 recipes can provide the same rk3308-specific blobs, switching
between them can potentially cause: "... is trying to install files into a
shared area when those files already exist" errors. Perform a pre-cleanup
in both recipes so they don't step on each others' toes.

Signed-off-by: Trevor Woerner 
---
 recipes-bsp/rkbin/rk3308-rkbin_git.bb   | 5 +
 recipes-bsp/rkbin/rockchip-rkbin_git.bb | 5 +
 2 files changed, 10 insertions(+)

diff --git a/recipes-bsp/rkbin/rk3308-rkbin_git.bb 
b/recipes-bsp/rkbin/rk3308-rkbin_git.bb
index c6b05b242738..65ee136eff7c 100644
--- a/recipes-bsp/rkbin/rk3308-rkbin_git.bb
+++ b/recipes-bsp/rkbin/rk3308-rkbin_git.bb
@@ -26,6 +26,11 @@ PACKAGES = "${PN}"
 ALLOW_EMPTY:${PN} = "1"
 
 do_deploy:rk3308() {
+   # cleanup first
+   rm -f ${DEPLOY_DIR_IMAGE}/bl31-rk3308.elf
+   rm -f ${DEPLOY_DIR_IMAGE}/tee-rk3308.bin
+   rm -f ${DEPLOY_DIR_IMAGE}/ddr-rk3308.bin
+
# Prebuilt TF-A
install -m 644 ${S}/bin/rk33/rk3308_bl31_v*.elf 
${DEPLOYDIR}/bl31-rk3308.elf
# Prebuilt OPTEE-OS
diff --git a/recipes-bsp/rkbin/rockchip-rkbin_git.bb 
b/recipes-bsp/rkbin/rockchip-rkbin_git.bb
index f1609c7a4957..3f842d669c76 100644
--- a/recipes-bsp/rkbin/rockchip-rkbin_git.bb
+++ b/recipes-bsp/rkbin/rockchip-rkbin_git.bb
@@ -27,6 +27,11 @@ PACKAGES = "${PN}"
 ALLOW_EMPTY:${PN} = "1"
 
 do_deploy:rk3308() {
+   # cleanup first
+   rm -f ${DEPLOY_DIR_IMAGE}/bl31-rk3308.elf
+   rm -f ${DEPLOY_DIR_IMAGE}/tee-rk3308.bin
+   rm -f ${DEPLOY_DIR_IMAGE}/ddr-rk3308.bin
+
# Prebuilt TF-A
install -m 644 ${S}/bin/rk33/rk3308_bl31_v*.elf 
${DEPLOYDIR}/bl31-rk3308.elf
# Prebuilt OPTEE-OS
-- 
2.41.0.327.gaa9166bcc0ba


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



Re: [yocto] [meta-rockchip][PATCH v2 0/1] rock-pi-s: add

2023-11-02 Thread Trevor Woerner
On Tue 2023-10-31 @ 08:58:04 AM, Trevor Woerner via lists.yoctoproject.org 
wrote:
> Add a new MACHINE: rock-pi-s
> 
> changes since v1:
> - while the actual patch to add the rock-pi-s was not merged, all of the
>   cleanup patches that were submitted in advance of the "add" patch (and
>   were part of the original series) were applied, therefore those patches
>   are dropped from this version
> - upstream master now contains a version of u-boot that supports the
>   rock-pi-s, therefore using rk3308-specific overrides in the u-boot
>   bbappend is no longer necessary
> - add a separate rk3308-rkbin recipe instead of loading the rockchip-rkbin
>   recipe with rk3308-specific overrides
> - allow the user to choose whether they want the rkbin and u-boot debug
>   messages to show up on the console (i.e. use an older version of rkbin)
>   or have gibberish until the linux kernel starts (use the latest version
>   of rkbin) by setting (or not) a variable; default is to use an older
>   version
> 
> Trevor Woerner (1):
>   rock-pi-s: add
> 
>  README  | 22 +++
>  conf/machine/include/rk3308.inc | 18 +
>  conf/machine/rock-pi-s.conf | 11 ++
>  recipes-bsp/rkbin/rk3308-rkbin_git.bb   | 41 +
>  recipes-bsp/rkbin/rockchip-rkbin_git.bb | 10 +
>  recipes-bsp/u-boot/u-boot%.bbappend |  8 
>  recipes-kernel/linux/linux-yocto_%.bbappend |  1 +
>  7 files changed, 111 insertions(+)
>  create mode 100644 conf/machine/include/rk3308.inc
>  create mode 100644 conf/machine/rock-pi-s.conf
>  create mode 100644 recipes-bsp/rkbin/rk3308-rkbin_git.bb

Applied to meta-rockchip, master branch.

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



[yocto] [meta-rockchip][PATCH v2 1/1] rock-pi-s: add

2023-10-31 Thread Trevor Woerner
ROCK Pi S is a Rockchip RK3308 based SBC from Radxa. It contains a 64-bit
quad core processor, USB, ethernet, wireless connectivity, and voice
detection engine in 1.7-inches square. The ROCK Pi S comes in two RAM sizes
256MB or 512MB DDR3, and uses an sdmmc card for OS and storage. Optionally,
some versions of the ROCK Pi S provide on-board storage via 1Gb/2Gb/4Gb/8Gb
of SLC NAND flash.

"S" stands for "small square" since the total board size of the rock-pi-s
is 1.7-inches square.

This BSP assumes booting from sdmmc, and using ttyS0 for the serial console
(similar to Raspberry Pi).

The latest version of the binary ddr initializer code from rkbin does not
provide a uart0 option, therefore all diagnostic output from rkbin and u-boot
is lost on the console (and replaced with a stream of gibberish until the
Linux kernel starts). Therefore, by default, the build assumes the user would
prefer to see this information and have the option to interact with U-Boot,
which means an older version of rkbin is used. The user can override this
decision by setting:

RKBIN_RK3308_LATEST = "1"

Signed-off-by: Trevor Woerner 
---
changes since v1:
- upstream master now contains a version of u-boot that supports the
  rock-pi-s, therefore using rk3308-specific overrides in the u-boot
  bbappend is no longer necessary
- add a separate rk3308-rkbin recipe instead of loading the rockchip-rkbin
  recipe with rk3308-specific overrides
- allow the user to choose whether they want the rkbin and u-boot debug
  messages to show up on the console (i.e. use an older version of rkbin)
  or have gibberish until the linux kernel starts (use the latest version
  of rkbin) by setting (or not) a variable; default is to use an older
  version
---
 README  | 22 +++
 conf/machine/include/rk3308.inc | 18 +
 conf/machine/rock-pi-s.conf | 11 ++
 recipes-bsp/rkbin/rk3308-rkbin_git.bb   | 41 +
 recipes-bsp/rkbin/rockchip-rkbin_git.bb | 10 +
 recipes-bsp/u-boot/u-boot%.bbappend |  8 
 recipes-kernel/linux/linux-yocto_%.bbappend |  1 +
 7 files changed, 111 insertions(+)
 create mode 100644 conf/machine/include/rk3308.inc
 create mode 100644 conf/machine/rock-pi-s.conf
 create mode 100644 recipes-bsp/rkbin/rk3308-rkbin_git.bb

diff --git a/README b/README
index bcf1e0bba361..e5beaa0b2d49 100644
--- a/README
+++ b/README
@@ -33,11 +33,33 @@ Status of supported boards:
rock-5b
nanopi-r2s
nanopi-m4b
+   rock-pi-s
builds:
marsboard-rk3066
radxarock
rock2-square
 
+Notes:
+-
+   The latest ddr initializer for the rk3308 platform (currently only
+   used by the rock-pi-s machine) 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 the
+   rock-pi-s 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
diff --git a/conf/machine/include/rk3308.inc b/conf/machine/include/rk3308.inc
new file mode 100644
index ..19cabafdfac0
--- /dev/null
+++ b/conf/machine/include/rk3308.inc
@@ -0,0 +1,18 @@
+SOC_FAMILY = "rk3308"
+
+DEFAULTTUNE ?= "cortexa35-crypto"
+
+require conf/machine/include/soc-family.inc
+require conf/machine/include/arm/armv8a/tune-cortexa35.inc
+require conf/machine/include/rockchip-defaults.inc
+require conf/machine/include/rockchip-wic.inc
+
+SERIAL_CONSOLES = "150;ttyS0"
+
+KBUILD_DEFCONFIG ?= "defconfig"
+KERNEL_FEATURES:append:rk3308 = " 
bsp/rockchip/remove-non-rockchip-arch-arm64.scc"
+KERNEL_CLASSES = "kernel-fitimage"
+KERNEL_IMAGETYPE = "fitImage"
+
+UBOOT_SUFFIX ?= "itb"
+UBOOT_ENTRYPOINT ?= "0x0600"
diff --git a/conf/machine/rock-pi-s.conf b/conf/machine/rock-pi-s.conf
new file mode 100644
index ..79ea73c6b47e
--- /dev/null
+++ b/conf/machine/rock-pi-s.conf
@@ -0,0 +1,11 @@
+#@TYPE: Machine
+#@NAME: Radxa Rock Pi S
+#@DESCRIPTION: ROCK Pi S is a Rockchip RK3

[yocto] [meta-rockchip][PATCH v2 0/1] rock-pi-s: add

2023-10-31 Thread Trevor Woerner
Add a new MACHINE: rock-pi-s

changes since v1:
- while the actual patch to add the rock-pi-s was not merged, all of the
  cleanup patches that were submitted in advance of the "add" patch (and
  were part of the original series) were applied, therefore those patches
  are dropped from this version
- upstream master now contains a version of u-boot that supports the
  rock-pi-s, therefore using rk3308-specific overrides in the u-boot
  bbappend is no longer necessary
- add a separate rk3308-rkbin recipe instead of loading the rockchip-rkbin
  recipe with rk3308-specific overrides
- allow the user to choose whether they want the rkbin and u-boot debug
  messages to show up on the console (i.e. use an older version of rkbin)
  or have gibberish until the linux kernel starts (use the latest version
  of rkbin) by setting (or not) a variable; default is to use an older
  version

Trevor Woerner (1):
  rock-pi-s: add

 README  | 22 +++
 conf/machine/include/rk3308.inc | 18 +
 conf/machine/rock-pi-s.conf | 11 ++
 recipes-bsp/rkbin/rk3308-rkbin_git.bb   | 41 +
 recipes-bsp/rkbin/rockchip-rkbin_git.bb | 10 +
 recipes-bsp/u-boot/u-boot%.bbappend |  8 
 recipes-kernel/linux/linux-yocto_%.bbappend |  1 +
 7 files changed, 111 insertions(+)
 create mode 100644 conf/machine/include/rk3308.inc
 create mode 100644 conf/machine/rock-pi-s.conf
 create mode 100644 recipes-bsp/rkbin/rk3308-rkbin_git.bb

-- 
2.41.0.327.gaa9166bcc0ba


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



Re: [yocto] [meta-rockchip][PATCH 3/3] rock-pi-s: add

2023-10-30 Thread Trevor Woerner
On Wed 2023-10-04 @ 04:23:31 PM, Quentin Schulz wrote:
> On 10/3/23 15:56, Trevor Woerner wrote:
> > On Mon 2023-10-02 @ 06:17:15 PM, Quentin Schulz wrote:
> > > > diff --git a/recipes-bsp/rkbin/rockchip-rkbin_git.bb 
> > > > b/recipes-bsp/rkbin/rockchip-rkbin_git.bb
> > > > index 7fefb017053b..49e1e682eb7d 100644
> > > > --- a/recipes-bsp/rkbin/rockchip-rkbin_git.bb
> > > > +++ b/recipes-bsp/rkbin/rockchip-rkbin_git.bb
> > > > @@ -1,9 +1,12 @@
> > > >DESCRIPTION = "Rockchip Firmware and Tool Binaries"
> > > >LICENSE = "Proprietary"
> > > > +LICENSE:rk3308 = "CLOSED"
> > > >LIC_FILES_CHKSUM = 
> > > > "file://LICENSE;md5=15faa4a01e7eb0f5d33f9f2bcc7bff62"
> > > > +LIC_FILES_CHKSUM:rk3308 = 
> > > > "file://README;md5=39cc9df955478b8df26158d489fdcc95"
> > > >SRC_URI = 
> > > > "git://github.com/rockchip-linux/rkbin;protocol=https;branch=master"
> > > >SRCREV = "b4558da0860ca48bf1a571dd33ccba580b9abe23"
> > > > +SRCREV:rk3308 = "e65b97b511f1349156702db40694454c141d8fe2"
> > > 
> > > Could you please say a few words about this change? It seems that there 
> > > are
> > > still binaries for it in the SRCREV we already point to. I assume newer
> > > should be better (though it's not always the case), so wondering what's
> > > prompted this change?
> > > 
> > > 
> > > Oooh, there is no TPL with uart0m0 support anymore... honestly not 
> > > sure
> > > it's a good idea to stay on a old blob version just for that? I assume you
> > > should only be missing the uart in TPL but the moment you reach the SPL 
> > > the
> > > console should appear, doesn't it?
> > 
> > Exactly, I would prefer to be able to capture all of the console output all 
> > in
> > one place. It's annoying they randomly decided to change uarts for every 
> > other
> > update. As far as I'm concerned one binary blob is a good (or bad) as the
> > next, and if this one gives me diagnostic info in the console, then it wins
> > :-)
> > 
> 
> I think this is a bit too much to hope for :) In the commit logs for ddr-bin
> updates in rkbin, I've seen a few mentions to DDR init stability/reliability
> for example. So saying it's all the same is probably incorrect.

I did a test with the rk3308 binaries from the latest commit of rkbin that
don't support uart0. Specifically I tested with 
rk3308_ddr_589MHz_uart4_m0_v2.07.bin:
this also works.

Also, it's a lot less hassle to build (rather than rolling back to a release
that has a uart0 console for the rk3308). However, even though the console is
set to uart4, this binary also outputs a lot of data to uart0. I've tried both
1,500,000 baud (the standard rockchip baud) and 115,200 baud: neither are able
to interpret the data. U-Boot, apparently, doesn't try to reset the serial
port either, because the garbage output continues until the Linux kernel
finally takes over. Or perhaps maybe the gibberish that I'm seeing is from
U-Boot outputting to an uninitialized serial port?

Roll back to older rkbin checkout:
PRO:
- supports console on uart0 (same as linux kernel) and all messages from
  rkbin, u-boot, linux kernel, and console appear legibly on the terminal
CON:
- more cumbersome to build (recipe requires a bunch of rk3308-based
  overrides), perhaps a separate rkbin recipe would be better?
- uses older ddr initialization code

Use latest rkbin:
PRO:
- simpler recipe, no overrides necessary, simpler build
- uses the latest code (might include bug fixes or other improvements?)
CON:
- spews a bunch of gibberish to the serial console (from rkbin? from u-boot?
  from both?)
- the first legible messages only start once the linux kernel takes over,
  therefore the user can't interact with U-Boot (should they so wish)

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



Re: [yocto] [meta-rockchip][PATCH] nanopi-m4b: add

2023-10-30 Thread Trevor Woerner
On Mon 2023-10-02 @ 08:10:38 PM, Trevor Woerner via lists.yoctoproject.org 
wrote:
> NanoPi M4B is a RK3399-based (dual-core A72, quad-core A53 with NEON) board
> in the same form factor as the RPi B3+ (including compatible connectors) with
> onboard 2.4/5.0 dual-band WiFi + Bluetooth 5.0 with USB type-C power from
> FriendlyElec.
> 
> https://www.friendlyelec.com/index.php?route=product/product_id=275
> 
> Signed-off-by: Trevor Woerner 
> ---
>  README  |  1 +
>  conf/machine/nanopi-m4b.conf| 11 +++
>  recipes-kernel/linux/linux-yocto_%.bbappend |  1 +
>  3 files changed, 13 insertions(+)
>  create mode 100644 conf/machine/nanopi-m4b.conf

Added to meta-rockchip, master branch.

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



Re: [yocto] [meta-rockchip][PATCH] rockchip-rkbin: fail if lacking an override

2023-10-30 Thread Trevor Woerner
On Wed 2023-10-25 @ 10:57:56 AM, Trevor Woerner via lists.yoctoproject.org 
wrote:
> Looking forward, rkbin should only be used by specific Rockchip platforms
> for which TF-A support is not (yet?) available. If rkbin gets added by
> accident without an override, add a bbfatal to let the user know an
> override is required.
> 
> Signed-off-by: Trevor Woerner 
> ---
>  recipes-bsp/rkbin/rockchip-rkbin_git.bb | 6 +-
>  1 file changed, 5 insertions(+), 1 deletion(-)

Added to meta-rockchip, master branch.

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



Re: [yocto] [meta-rockchip] [PATCH v3] rock-3a add

2023-10-25 Thread Trevor Woerner
On Wed 2023-10-25 @ 05:49:06 PM, Quentin Schulz wrote:
> Hi Trevor,
> 
> On 10/25/23 16:42, Trevor Woerner wrote:
> > On Wed 2023-10-25 @ 04:22:17 PM, Quentin Schulz wrote:
> > > Hi Trevor,
> > > 
> > > On 10/25/23 15:56, Trevor Woerner via lists.yoctoproject.org wrote:
> > > > Hi Anthony,
> > > > 
> > > > Thanks for working on this.
> > > > 
> > > > On Mon 2023-10-16 @ 09:43:45 PM, anthony.t.dav...@gmail.com wrote:
> > > > > From: Anthony Davies 
> > > > > 
> > > > > Add support for the Radxa Rock 3A
> > > > > https://wiki.radxa.com/Rock3/3a
> > > > > 
> > > > > The TF-A project does not currently have support for
> > > > > the rk3568. Therefore, for the time-being, the only way to supply a
> > > > > TPL/DDR-init for the rk3568 is to use the closed-source rkbin binaries
> > > > > from Rockchip. If/when TF-A adds support for the rk3588 we can 
> > > > > investigate
> > > > > switching.
> > > > > 
> > > > > recipes-bsp/rkbin/rockchip-rkbin_git.bb was modified to allow a 
> > > > > machine
> > > > > override to allow both rk3568 and rk3588s to use differnet binary 
> > > > > blobs
> > > > > 
> > > > > Signed-off-by: Anthony Davies 
> > > > > ---
> > > > >README  |  1 +
> > > > >conf/machine/include/rk3568.inc | 17 +
> > > > >conf/machine/rock-3a.conf   | 12 
> > > > >recipes-bsp/rkbin/rockchip-rkbin_git.bb | 16 +++-
> > > > >recipes-bsp/u-boot/u-boot%.bbappend |  5 +
> > > > >5 files changed, 50 insertions(+), 1 deletion(-)
> > > > >create mode 100644 conf/machine/include/rk3568.inc
> > > > >create mode 100644 conf/machine/rock-3a.conf
> > > > > 
> > > > > diff --git a/README b/README
> > > > > index 8104474..3357b47 100644
> > > > > --- a/README
> > > > > +++ b/README
> > > > > @@ -32,6 +32,7 @@ Status of supported boards:
> > > > >   nanopi-r4s
> > > > >   rock-5b
> > > > >   nanopi-r2s
> > > > > +rock-3a
> > > > 
> > > > There's still an issue with indents/tabs.
> > > > 
> > > > >   builds:
> > > > >   marsboard-rk3066
> > > > >   radxarock
> > > > > diff --git a/conf/machine/include/rk3568.inc 
> > > > > b/conf/machine/include/rk3568.inc
> > > > > new file mode 100644
> > > > > index 000..5382b58
> > > > > --- /dev/null
> > > > > +++ b/conf/machine/include/rk3568.inc
> > > > > @@ -0,0 +1,17 @@
> > > > > +MACHINEOVERRIDES =. "rk3568:"
> > > > > +DEFAULTTUNE ?= "cortexa55"
> > > > > +
> > > > > +require conf/machine/include/arm/armv8-2a/tune-cortexa55.inc
> > > > > +require conf/machine/include/rockchip-defaults.inc
> > > > > +require conf/machine/include/rockchip-wic.inc
> > > > > +
> > > > > +KBUILD_DEFCONFIG ?= "defconfig"
> > > > > +KERNEL_FEATURES:append:rk3568 = " 
> > > > > bsp/rockchip/remove-non-rockchip-arch-arm64.scc"
> > > > > +KERNEL_CLASSES ??= "kernel-fitimage"
> > > > > +KERNEL_IMAGETYPE ??= "fitImage"
> > > > > +
> > > > > +PREFERRED_PROVIDER_trusted-firmware-a = "rockchip-rkbin"
> > > > > +PREFERRED_PROVIDER_optee-os = "rockchip-rkbin"
> > > > > +
> > > > > +UBOOT_SUFFIX ?= "itb"
> > > > > +UBOOT_ENTRYPOINT ?= "0x0600"
> > > > > diff --git a/conf/machine/rock-3a.conf b/conf/machine/rock-3a.conf
> > > > > new file mode 100644
> > > > > index 000..2ed83a3
> > > > > --- /dev/null
> > > > > +++ b/conf/machine/rock-3a.conf
> > > > > @@ -0,0 +1,12 @@
> > > > > +#@TYPE: Machine
> > > > > +#@NAME: Radxa Rock 3a
> > > > > +#@DESCRIPTION: ROCK3 is a series of Rockchip RK3566/RK3568 based
> > > > > +#SBC(Single Board Computer) and 

[yocto] [meta-rockchip][PATCH] rockchip-rkbin: fail if lacking an override

2023-10-25 Thread Trevor Woerner
Looking forward, rkbin should only be used by specific Rockchip platforms
for which TF-A support is not (yet?) available. If rkbin gets added by
accident without an override, add a bbfatal to let the user know an
override is required.

Signed-off-by: Trevor Woerner 
---
 recipes-bsp/rkbin/rockchip-rkbin_git.bb | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/recipes-bsp/rkbin/rockchip-rkbin_git.bb 
b/recipes-bsp/rkbin/rockchip-rkbin_git.bb
index f9e680d16cb9..a3ab34189041 100644
--- a/recipes-bsp/rkbin/rockchip-rkbin_git.bb
+++ b/recipes-bsp/rkbin/rockchip-rkbin_git.bb
@@ -25,7 +25,7 @@ do_install() {
 PACKAGES = "${PN}"
 ALLOW_EMPTY:${PN} = "1"
 
-do_deploy() {
+do_deploy:rk3588s() {
# Prebuilt TF-A
install -m 644 ${S}/bin/rk35/rk3588_bl31_v*.elf 
${DEPLOYDIR}/bl31-rk3588.elf
# Prebuilt OPTEE-OS
@@ -34,4 +34,8 @@ do_deploy() {
install -m 644 ${S}/bin/rk35/rk3588_ddr_lp4_2112MHz_lp5_2736MHz_v*.bin 
${DEPLOYDIR}/ddr-rk3588.bin
 }
 
+do_deploy() {
+   bbfatal "COMPATIBLE_MACHINE requires a corresponding 
do_deploy:() override"
+}
+
 addtask deploy after do_install
-- 
2.41.0.327.gaa9166bcc0ba


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



Re: [yocto] [meta-rockchip] [PATCH v3] rock-3a add

2023-10-25 Thread Trevor Woerner
On Wed 2023-10-25 @ 04:22:17 PM, Quentin Schulz wrote:
> Hi Trevor,
> 
> On 10/25/23 15:56, Trevor Woerner via lists.yoctoproject.org wrote:
> > Hi Anthony,
> > 
> > Thanks for working on this.
> > 
> > On Mon 2023-10-16 @ 09:43:45 PM, anthony.t.dav...@gmail.com wrote:
> > > From: Anthony Davies 
> > > 
> > > Add support for the Radxa Rock 3A
> > > https://wiki.radxa.com/Rock3/3a
> > > 
> > > The TF-A project does not currently have support for
> > > the rk3568. Therefore, for the time-being, the only way to supply a
> > > TPL/DDR-init for the rk3568 is to use the closed-source rkbin binaries
> > > from Rockchip. If/when TF-A adds support for the rk3588 we can investigate
> > > switching.
> > > 
> > > recipes-bsp/rkbin/rockchip-rkbin_git.bb was modified to allow a machine
> > > override to allow both rk3568 and rk3588s to use differnet binary blobs
> > > 
> > > Signed-off-by: Anthony Davies 
> > > ---
> > >   README  |  1 +
> > >   conf/machine/include/rk3568.inc | 17 +
> > >   conf/machine/rock-3a.conf   | 12 
> > >   recipes-bsp/rkbin/rockchip-rkbin_git.bb | 16 +++-
> > >   recipes-bsp/u-boot/u-boot%.bbappend |  5 +
> > >   5 files changed, 50 insertions(+), 1 deletion(-)
> > >   create mode 100644 conf/machine/include/rk3568.inc
> > >   create mode 100644 conf/machine/rock-3a.conf
> > > 
> > > diff --git a/README b/README
> > > index 8104474..3357b47 100644
> > > --- a/README
> > > +++ b/README
> > > @@ -32,6 +32,7 @@ Status of supported boards:
> > >   nanopi-r4s
> > >   rock-5b
> > >   nanopi-r2s
> > > +rock-3a
> > 
> > There's still an issue with indents/tabs.
> > 
> > >   builds:
> > >   marsboard-rk3066
> > >   radxarock
> > > diff --git a/conf/machine/include/rk3568.inc 
> > > b/conf/machine/include/rk3568.inc
> > > new file mode 100644
> > > index 000..5382b58
> > > --- /dev/null
> > > +++ b/conf/machine/include/rk3568.inc
> > > @@ -0,0 +1,17 @@
> > > +MACHINEOVERRIDES =. "rk3568:"
> > > +DEFAULTTUNE ?= "cortexa55"
> > > +
> > > +require conf/machine/include/arm/armv8-2a/tune-cortexa55.inc
> > > +require conf/machine/include/rockchip-defaults.inc
> > > +require conf/machine/include/rockchip-wic.inc
> > > +
> > > +KBUILD_DEFCONFIG ?= "defconfig"
> > > +KERNEL_FEATURES:append:rk3568 = " 
> > > bsp/rockchip/remove-non-rockchip-arch-arm64.scc"
> > > +KERNEL_CLASSES ??= "kernel-fitimage"
> > > +KERNEL_IMAGETYPE ??= "fitImage"
> > > +
> > > +PREFERRED_PROVIDER_trusted-firmware-a = "rockchip-rkbin"
> > > +PREFERRED_PROVIDER_optee-os = "rockchip-rkbin"
> > > +
> > > +UBOOT_SUFFIX ?= "itb"
> > > +UBOOT_ENTRYPOINT ?= "0x0600"
> > > diff --git a/conf/machine/rock-3a.conf b/conf/machine/rock-3a.conf
> > > new file mode 100644
> > > index 000..2ed83a3
> > > --- /dev/null
> > > +++ b/conf/machine/rock-3a.conf
> > > @@ -0,0 +1,12 @@
> > > +#@TYPE: Machine
> > > +#@NAME: Radxa Rock 3a
> > > +#@DESCRIPTION: ROCK3 is a series of Rockchip RK3566/RK3568 based
> > > +#SBC(Single Board Computer) and Compute Module by Radxa.
> > > +#https://wiki.radxa.com/Rock3
> > > +
> > > +require conf/machine/include/rk3568.inc
> > > +
> > > +KERNEL_DEVICETREE = "rockchip/rk3568-rock-3a.dtb"
> > > +MACHINE_EXTRA_RRECOMMENDS += "kernel-modules"
> > > +
> > > +UBOOT_MACHINE = "rock-3a-rk3568_defconfig"
> > > diff --git a/recipes-bsp/rkbin/rockchip-rkbin_git.bb 
> > > b/recipes-bsp/rkbin/rockchip-rkbin_git.bb
> > > index 7fefb01..ad5593c 100644
> > > --- a/recipes-bsp/rkbin/rockchip-rkbin_git.bb
> > > +++ b/recipes-bsp/rkbin/rockchip-rkbin_git.bb
> > > @@ -14,6 +14,7 @@ S = "${WORKDIR}/git"
> > >   COMPATIBLE_MACHINE = ""
> > >   COMPATIBLE_MACHINE:rk3588s = "rk3588s"
> > > +COMPATIBLE_MACHINE:rk3568 = "rk3568"
> > >   PACKAGE_ARCH = "${MACHINE_ARCH}"
> > > @@ -25,7 +26,16 @@ do_install()

Re: [yocto] [meta-rockchip] [PATCH v3] rock-3a add

2023-10-25 Thread Trevor Woerner
Hi Anthony,

Thanks for working on this.

On Mon 2023-10-16 @ 09:43:45 PM, anthony.t.dav...@gmail.com wrote:
> From: Anthony Davies 
> 
> Add support for the Radxa Rock 3A
> https://wiki.radxa.com/Rock3/3a
> 
> The TF-A project does not currently have support for
> the rk3568. Therefore, for the time-being, the only way to supply a
> TPL/DDR-init for the rk3568 is to use the closed-source rkbin binaries
> from Rockchip. If/when TF-A adds support for the rk3588 we can investigate
> switching.
> 
> recipes-bsp/rkbin/rockchip-rkbin_git.bb was modified to allow a machine
> override to allow both rk3568 and rk3588s to use differnet binary blobs
> 
> Signed-off-by: Anthony Davies 
> ---
>  README  |  1 +
>  conf/machine/include/rk3568.inc | 17 +
>  conf/machine/rock-3a.conf   | 12 
>  recipes-bsp/rkbin/rockchip-rkbin_git.bb | 16 +++-
>  recipes-bsp/u-boot/u-boot%.bbappend |  5 +
>  5 files changed, 50 insertions(+), 1 deletion(-)
>  create mode 100644 conf/machine/include/rk3568.inc
>  create mode 100644 conf/machine/rock-3a.conf
> 
> diff --git a/README b/README
> index 8104474..3357b47 100644
> --- a/README
> +++ b/README
> @@ -32,6 +32,7 @@ Status of supported boards:
>   nanopi-r4s
>   rock-5b
>   nanopi-r2s
> +rock-3a

There's still an issue with indents/tabs.

>   builds:
>   marsboard-rk3066
>   radxarock
> diff --git a/conf/machine/include/rk3568.inc b/conf/machine/include/rk3568.inc
> new file mode 100644
> index 000..5382b58
> --- /dev/null
> +++ b/conf/machine/include/rk3568.inc
> @@ -0,0 +1,17 @@
> +MACHINEOVERRIDES =. "rk3568:"
> +DEFAULTTUNE ?= "cortexa55"
> +
> +require conf/machine/include/arm/armv8-2a/tune-cortexa55.inc
> +require conf/machine/include/rockchip-defaults.inc
> +require conf/machine/include/rockchip-wic.inc
> +
> +KBUILD_DEFCONFIG ?= "defconfig"
> +KERNEL_FEATURES:append:rk3568 = " 
> bsp/rockchip/remove-non-rockchip-arch-arm64.scc"
> +KERNEL_CLASSES ??= "kernel-fitimage"
> +KERNEL_IMAGETYPE ??= "fitImage"
> +
> +PREFERRED_PROVIDER_trusted-firmware-a = "rockchip-rkbin"
> +PREFERRED_PROVIDER_optee-os = "rockchip-rkbin"
> +
> +UBOOT_SUFFIX ?= "itb"
> +UBOOT_ENTRYPOINT ?= "0x0600"
> diff --git a/conf/machine/rock-3a.conf b/conf/machine/rock-3a.conf
> new file mode 100644
> index 000..2ed83a3
> --- /dev/null
> +++ b/conf/machine/rock-3a.conf
> @@ -0,0 +1,12 @@
> +#@TYPE: Machine
> +#@NAME: Radxa Rock 3a
> +#@DESCRIPTION: ROCK3 is a series of Rockchip RK3566/RK3568 based
> +#SBC(Single Board Computer) and Compute Module by Radxa.
> +#https://wiki.radxa.com/Rock3
> +
> +require conf/machine/include/rk3568.inc
> +
> +KERNEL_DEVICETREE = "rockchip/rk3568-rock-3a.dtb"
> +MACHINE_EXTRA_RRECOMMENDS += "kernel-modules"
> +
> +UBOOT_MACHINE = "rock-3a-rk3568_defconfig"
> diff --git a/recipes-bsp/rkbin/rockchip-rkbin_git.bb 
> b/recipes-bsp/rkbin/rockchip-rkbin_git.bb
> index 7fefb01..ad5593c 100644
> --- a/recipes-bsp/rkbin/rockchip-rkbin_git.bb
> +++ b/recipes-bsp/rkbin/rockchip-rkbin_git.bb
> @@ -14,6 +14,7 @@ S = "${WORKDIR}/git"
>  
>  COMPATIBLE_MACHINE = ""
>  COMPATIBLE_MACHINE:rk3588s = "rk3588s"
> +COMPATIBLE_MACHINE:rk3568 = "rk3568"
>  
>  PACKAGE_ARCH = "${MACHINE_ARCH}"
>  
> @@ -25,7 +26,16 @@ do_install() {
>  PACKAGES = "${PN}"
>  ALLOW_EMPTY:${PN} = "1"
>  
> -do_deploy() {
> +do_deploy:rk3568() {
> + # Prebuilt TF-A
> + install -m 644 ${S}/bin/rk35/rk3568_bl31_v*.elf 
> ${DEPLOYDIR}/bl31-rk3568.elf
> + # Prebuilt OPTEE-OS
> + install -m 644 ${S}/bin/rk35/rk3568_bl32_v*.bin 
> ${DEPLOYDIR}/tee-rk3568.bin
> + # Prebuilt U-Boot TPL (DDR init)
> + install -m 644 ${S}/bin/rk35/rk3568_ddr_1560MHz_v1.18.bin 
> ${DEPLOYDIR}/ddr-rk3568.bin
> +}
> +
> +do_deploy:rk3588s() {
>   # Prebuilt TF-A
>   install -m 644 ${S}/bin/rk35/rk3588_bl31_v*.elf 
> ${DEPLOYDIR}/bl31-rk3588.elf
>   # Prebuilt OPTEE-OS
> @@ -34,4 +44,8 @@ do_deploy() {
>   install -m 644 ${S}/bin/rk35/rk3588_ddr_lp4_2112MHz_lp5_2736MHz_v*.bin 
> ${DEPLOYDIR}/ddr-rk3588.bin
>  }
>  
> +do_deploy() {
> +  bbfatal "COMPATIBLE_MACHINE requires a corressponding 
> do_deploy:() override"
> +}
> +

This is not related to adding support for rock3a.

>  addtask deploy after do_install
> diff --git a/recipes-bsp/u-boot/u-boot%.bbappend 
> b/recipes-bsp/u-boot/u-boot%.bbappend
> index e79c471..66c81da 100644
> --- a/recipes-bsp/u-boot/u-boot%.bbappend
> +++ b/recipes-bsp/u-boot/u-boot%.bbappend
> @@ -9,12 +9,17 @@ EXTRA_OEMAKE:append:rk3588s = " \
>   BL31=${DEPLOY_DIR_IMAGE}/bl31-rk3588.elf \
>   ROCKCHIP_TPL=${DEPLOY_DIR_IMAGE}/ddr-rk3588.bin \
>   "
> +EXTRA_OEMAKE:append:rk3568 = " \
> + BL31=${DEPLOY_DIR_IMAGE}/bl31-rk3568.elf \
> + ROCKCHIP_TPL=${DEPLOY_DIR_IMAGE}/ddr-rk3568.bin \
> + "
>  
>  INIT_FIRMWARE_DEPENDS ??= ""
>  INIT_FIRMWARE_DEPENDS:px30 = " trusted-firmware-a:do_deploy"
>  

Re: [yocto] [meta-rockchip][kirkstone][PATCH] bsp: rkbin: fix default COMPATIBLE_MACHINE matching all

2023-10-25 Thread Trevor Woerner
On Mon 2023-10-16 @ 01:22:33 PM, Quentin Schulz wrote:
> From: Quentin Schulz 
> 
> The goal of the default COMPATIBLE_MACHINE was to not allow
> rockchip-rkbin to be even parsed if a MACHINE isn't part of the
> COMPATIBLE_MACHINE.
> 
> However, COMPATIBLE_MACHINE is a regexp checked using Python's re module
> approximately like:
> """
> if re.match(COMPATIBLE_MACHINE, MACHINE):
>   return True
> """
> 
> and re.match() returns a match whatever MACHINE is if COMPATIBLE_MACHINE
> is the empty string.
> 
> Therefore, let's change it to `^$` which only matches the empty string,
> which shouldn't be possible for anything in MACHINEOVERRIDES, and if it
> is there are probably bigger problems than parsing rockchip-rkbin.
> 
> Fixes: 3c7f532c2e25 ("rk3588(s): add")
> Cc: Quentin Schulz 
> Signed-off-by: Quentin Schulz 
> ---
>  recipes-bsp/rkbin/rockchip-rkbin_git.bb | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied to meta-rockchip, kirkstone branch. Thanks!

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



Re: [yocto] [meta-rockchip][PATCH] bsp: rkbin: fix default COMPATIBLE_MACHINE matching all

2023-10-25 Thread Trevor Woerner
On Mon 2023-10-16 @ 01:21:10 PM, Quentin Schulz wrote:
> From: Quentin Schulz 
> 
> The goal of the default COMPATIBLE_MACHINE was to not allow
> rockchip-rkbin to be even parsed if a MACHINE isn't part of the
> COMPATIBLE_MACHINE.
> 
> However, COMPATIBLE_MACHINE is a regexp checked using Python's re module
> approximately like:
> """
> if re.match(COMPATIBLE_MACHINE, MACHINE):
>   return True
> """
> 
> and re.match() returns a match whatever MACHINE is if COMPATIBLE_MACHINE
> is the empty string.
> 
> Therefore, let's change it to `^$` which only matches the empty string,
> which shouldn't be possible for anything in MACHINEOVERRIDES, and if it
> is there are probably bigger problems than parsing rockchip-rkbin.
> 
> Fixes: f8af59dd7cd7 ("rock-5b: add")
> Cc: Quentin Schulz 
> Signed-off-by: Quentin Schulz 
> ---
>  recipes-bsp/rkbin/rockchip-rkbin_git.bb | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied to meta-rockchip, master branch. Thanks!

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



Re: [yocto] [meta-rockchip][kirkstone][PATCH] rk3588(s): add

2023-10-13 Thread Trevor Woerner
On Thu 2023-10-05 @ 11:00:16 AM, Quentin Schulz wrote:
> From: Trevor Woerner 
> 
> Unfortunately the TF-A project does not currently have support for
> the rk3588. Therefore, for the time-being, the only way to supply a
> TPL/DDR-init for the rk3588 is to use the closed-source rkbin binaries
> from Rockchip. If/when TF-A adds support for the rk3588 we can investigate
> switching.
> 
> The rk3588 comes in two variants: rk3588 and rk3588s. The "s" option is a
> stripped-down version of the rk3588. In the Linux kernel these two SoCs are
> kept separate, with the rk3588 building on the rk3588s, so we've mimicked that
> same behaviour here.
> 
> Signed-off-by: Quentin Schulz 
> Signed-off-by: Trevor Woerner 
> [backported from f8af59dd7cd7 ("rock-5b: add")]
> [removed support for rock-5b since no decent linux-yocto support in kirkstone]
> [removed KERNEL_FEATURES and kmeta since no decent linux-yocto support in 
> kirkstone]
> [renamed INIT_FIRMWARE_DEPENDS to ATF_DEPENDS]
> [tested on downstream board with downstream kernel and u-boot]
> Signed-off-by: Quentin Schulz 
> ---
>  conf/machine/include/rk3588.inc |  6 
>  conf/machine/include/rk3588s.inc| 16 +++
>  recipes-bsp/rkbin/rockchip-rkbin_git.bb | 37 +
>  recipes-bsp/u-boot/u-boot%.bbappend |  6 
>  4 files changed, 65 insertions(+)
>  create mode 100644 conf/machine/include/rk3588.inc
>  create mode 100644 conf/machine/include/rk3588s.inc
>  create mode 100644 recipes-bsp/rkbin/rockchip-rkbin_git.bb

Applied to meta-rockchip, kirkstone branch.
Thanks!

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



Re: [yocto] [meta-rockchip] [PATCH] Add support for the Radxa Rock-3a based on rk3568

2023-10-05 Thread Trevor Woerner
On Fri 2023-10-06 @ 09:45:44 AM, anthony.t.dav...@gmail.com wrote:
> From: Anthony Davies 
> 
> Added appropriate inc files and machine.conf
> 
> Modified rockchip-rkbin_git.bb to allow machine overrides on
> do_deploy.
> 
> I have tested this patch on my own rock-3a

This commit message is lacking. Take a look at some of the other commits
adding new machines and try to follow suit.

> 
> Signed-off-by: Anthony Davies 
> ---
>  README  |  1 +
>  conf/machine/include/rk3568.inc | 17 ++
>  conf/machine/rock-3a.conf   | 12 +++
>  recipes-bsp/rkbin/rockchip-rkbin_git.bb | 16 -
>  recipes-bsp/u-boot/u-boot%.bbappend | 43 -
>  5 files changed, 73 insertions(+), 16 deletions(-)
>  create mode 100644 conf/machine/include/rk3568.inc
>  create mode 100644 conf/machine/rock-3a.conf
> 
> diff --git a/README b/README
> index 8104474..aa1c834 100644
> --- a/README
> +++ b/README
> @@ -30,6 +30,7 @@ Status of supported boards:
>   vyasa-rk3288
>   firefly-rk3288
>   nanopi-r4s
> +rock-3a
>   rock-5b
>   nanopi-r2s
>   builds:
> diff --git a/conf/machine/include/rk3568.inc b/conf/machine/include/rk3568.inc
> new file mode 100644
> index 000..5382b58
> --- /dev/null
> +++ b/conf/machine/include/rk3568.inc
> @@ -0,0 +1,17 @@
> +MACHINEOVERRIDES =. "rk3568:"
> +DEFAULTTUNE ?= "cortexa55"
> +
> +require conf/machine/include/arm/armv8-2a/tune-cortexa55.inc
> +require conf/machine/include/rockchip-defaults.inc
> +require conf/machine/include/rockchip-wic.inc
> +
> +KBUILD_DEFCONFIG ?= "defconfig"
> +KERNEL_FEATURES:append:rk3568 = " 
> bsp/rockchip/remove-non-rockchip-arch-arm64.scc"
> +KERNEL_CLASSES ??= "kernel-fitimage"
> +KERNEL_IMAGETYPE ??= "fitImage"
> +
> +PREFERRED_PROVIDER_trusted-firmware-a = "rockchip-rkbin"
> +PREFERRED_PROVIDER_optee-os = "rockchip-rkbin"
> +
> +UBOOT_SUFFIX ?= "itb"
> +UBOOT_ENTRYPOINT ?= "0x0600"
> diff --git a/conf/machine/rock-3a.conf b/conf/machine/rock-3a.conf
> new file mode 100644
> index 000..452bde0
> --- /dev/null
> +++ b/conf/machine/rock-3a.conf
> @@ -0,0 +1,12 @@
> +#@TYPE: Machine
> +#@NAME: Radxa Rock3a
> +#@DESCRIPTION: ROCK3 is a series of Rockchip RK3566/RK3568 based SBC(Single 
> Board Computer) and Compute Module by Radxa.
> +#https://wiki.radxa.com/Rock3
> +
> +require conf/machine/include/rk3568.inc
> +
> +PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto-dev"
> +KERNEL_DEVICETREE = "rockchip/rk3568-rock-3a.dtb"
> +MACHINE_EXTRA_RRECOMMENDS += "kernel-modules"
> +
> +UBOOT_MACHINE = "rock-3a-rk3568_defconfig"
> diff --git a/recipes-bsp/rkbin/rockchip-rkbin_git.bb 
> b/recipes-bsp/rkbin/rockchip-rkbin_git.bb
> index 7fefb01..273f394 100644
> --- a/recipes-bsp/rkbin/rockchip-rkbin_git.bb
> +++ b/recipes-bsp/rkbin/rockchip-rkbin_git.bb
> @@ -14,6 +14,7 @@ S = "${WORKDIR}/git"
>  
>  COMPATIBLE_MACHINE = ""
>  COMPATIBLE_MACHINE:rk3588s = "rk3588s"
> +COMPATIBLE_MACHINE:rk3568 = "rk3568"
>  
>  PACKAGE_ARCH = "${MACHINE_ARCH}"
>  
> @@ -25,7 +26,16 @@ do_install() {
>  PACKAGES = "${PN}"
>  ALLOW_EMPTY:${PN} = "1"
>  
> -do_deploy() {
> +do_deploy:rk3568() {
> + # Prebuilt TF-A
> + install -m 644 ${S}/bin/rk35/rk3568_bl31_v*.elf 
> ${DEPLOYDIR}/bl31-rk3568.elf
> + # Prebuilt OPTEE-OS
> + install -m 644 ${S}/bin/rk35/rk3568_bl32_v*.bin 
> ${DEPLOYDIR}/tee-rk3568.bin
> + # Prebuilt U-Boot TPL (DDR init)
> + install -m 644 ${S}/bin/rk35/rk3568_ddr_1560MHz_v1.18.bin 
> ${DEPLOYDIR}/ddr-rk3568.bin
> +}
> +
> +do_deploy:rk3588s() {
>   # Prebuilt TF-A
>   install -m 644 ${S}/bin/rk35/rk3588_bl31_v*.elf 
> ${DEPLOYDIR}/bl31-rk3588.elf
>   # Prebuilt OPTEE-OS
> @@ -34,4 +44,8 @@ do_deploy() {
>   install -m 644 ${S}/bin/rk35/rk3588_ddr_lp4_2112MHz_lp5_2736MHz_v*.bin 
> ${DEPLOYDIR}/ddr-rk3588.bin
>  }
>  
> +do_deploy() {
> +# Needed as a default perhaps a bb.fatal with a message saying an override 
> needs to be set
> +}
> +
>  addtask deploy after do_install
> diff --git a/recipes-bsp/u-boot/u-boot%.bbappend 
> b/recipes-bsp/u-boot/u-boot%.bbappend
> index e79c471..5af86aa 100644
> --- a/recipes-bsp/u-boot/u-boot%.bbappend
> +++ b/recipes-bsp/u-boot/u-boot%.bbappend
> @@ -1,25 +1,38 @@
> +do_compile:append:rock2-square () {
> + # copy to default search path
> + if [ "${SPL_BINARY}" = "u-boot-spl-dtb.bin" ]; then
> + cp ${B}/spl/${SPL_BINARY} ${B}
> + fi
> +}
> +
> +DEPENDS:append:rock-pi-4 = " gnutls-native"
>  # various machines require the pyelftools library for parsing dtb files
>  DEPENDS:append = " python3-pyelftools-native"
> -DEPENDS:append:rock-pi-4 = " gnutls-native"
>  
> -EXTRA_OEMAKE:append:px30 = " BL31=${DEPLOY_DIR_IMAGE}/bl31-px30.elf"
> -EXTRA_OEMAKE:append:rk3328 = " BL31=${DEPLOY_DIR_IMAGE}/bl31-rk3328.elf"
> -EXTRA_OEMAKE:append:rk3399 = " BL31=${DEPLOY_DIR_IMAGE}/bl31-rk3399.elf"
> +INIT_FIRMWARE_DEPENDS ??= ""
> +
>  

Re: [yocto] [meta-rockchip][PATCH] KERNEL_DEVICETREE: 32-bit re-org

2023-10-04 Thread Trevor Woerner
On Wed 2023-10-04 @ 10:39:14 AM, Bruce Ashfield wrote:
> On Wed, Oct 4, 2023 at 9:59 AM Quentin Schulz via lists.yoctoproject.org
>  wrote:
> 
> > Hi Trevor,
> >
> > On 10/3/23 15:38, Trevor Woerner wrote:
> > > On Tue 2023-10-03 @ 12:32:08 PM, Quentin Schulz wrote:
> > >> Hi Trevor,
> > >>
> > >> On 10/3/23 06:19, Trevor Woerner via lists.yoctoproject.org wrote:
> > >>> The upstream kernel reorganized the 32-bit arch/arm device-tree
> > directory structure
> > >>> to separate out the device-trees by manufacturer (similar to the
> > organization
> > >>> of the arch/arm64 device-trees). Update the references to 32-bit arm
> > >>> device-trees to match.
> > >>>
> > >>
> > >> Does this work with linux-yocto and linux-yocto-dev from master or do we
> > >> need to add some logic to support both (do you want to?).
> > >
> > > This doesn't work at all. I figured this was an easy one, made the tweak,
> > > submitted it, then added it to my jenkins builder to verify overnight.
> > Woke up
> > > to find the do_image_wic() tasks failed. It's the same layout as the
> > 64-bit
> > > machines but I'll have to dig in to figure out why it didn't work.
> > >
> > > As for the linux-yocto vs linux-yocto-dev question I'll take a look. This
> > > happened with linux-yocto, so I would assume it is already the case with
> > > linux-yocto-dev. But if oe-core supports multiple versions of
> > linux-yocto,
> > > that might be the tricky bit and yes, I would look into supporting both
> > for
> > > the time-being until the transition period ends.
> > >
> >
> > This was done in v6.5-rc1 so anything before won't work sadly.
> >
> > master branch of poky supports 6.1 6.4 and 6.5 for linux-yocto
> > (linux-yocto-dev being typically newer than the latest linux-yocto and
> > the latest linux-yocto already having the change, I'll omit the change
> > for linux-yocto-dev).
> >
> > For reference, denix on IRC suggested you look at
> >
> > https://git.openembedded.org/openembedded-core/commit/?id=04ab57d20009d85eb566e83ae6fe1dcea4db7300
> > for what we're trying to do here. But I think this isn't applying to how
> > the DTB is found but rather where it's put and this is too late for us.
> >
> > I think we need to modify get_real_dtb_path_in_kernel in
> > meta/classes-recipe/kernel-devicetree.bbclass instead.
> >
> > We could handle it this way for example to allow a fallback:
> > """
> > get_real_dtb_path_in_kernel:arm () {
> > dtb="$1"
> > dtb_path="${B}/arch/${ARCH}/boot/dts/$dtb"
> >  # Handle pre-v6.5 layout for Aarch32/ARM DTB
> > if [ ! -e "$dtb_path" ]; then
> > dtb_path="${B}/arch/${ARCH}/boot/dts/$(basename "$dtb")"
> > fi
> > if [ ! -e "$dtb_path" ]; then
> > dtb_path="${B}/arch/${ARCH}/boot/$dtb"
> > fi
> >  # Handle pre-v6.5 layout for Aarch32/ARM DTB
> > if [ ! -e "$dtb_path" ]; then
> > dtb_path="${B}/arch/${ARCH}/boot/$(basename "$dtb")"
> > fi
> >
> > echo "$dtb_path"
> > }
> > """
> > (to be determined if "arm" is a valid OVERRIDES, otherwise we need to
> > check against "ARCH" bb variable; also not sure about the second
> > basename if it's necessary at all).
> >
> > Then you would just have KERNEL_DEVICETREE done the same way as in this
> > patch:
> > KERNEL_DEVICETREE = "rockchip/rk3066a-marsboard.dtb"
> >
> > and we wouldn't have to handle it on the recipe level.
> >
> > Otherwise, we could do the following:
> > RK_KERNEL_DEVICETREE = "rockchip/rk3066a-marsboard.dtb"
> > KERNEL_DEVICETREE ?= "${RK_KERNEL_DEVICETREE}"
> >
> > then have a bbappend for all old-layout recipes:
> > linux-yocto-rt_6.1.bbappend
> > linux-yocto-tiny_6.1.bbappend
> > linux-yocto_6.1.bbappend
> > linux-yocto-rt_6.4.bbappend
> > linux-yocto-tiny_6.4.bbappend
> > linux-yocto_6.4.bbappend
> >
> > KERNEL_DEVICETREE:arm = "${@' '.join(os.path.basename(dtb) for dtb in
> > d.getVar('RK_KERNEL_DEVICETREE').split())}"
> >
> > or something like that. We probably want to have something a bit more
> > precise than just arm 

Re: [yocto] [meta-rockchip][PATCH v2 0/4] u-boot cleanup

2023-10-03 Thread Trevor Woerner
On Mon 2023-10-02 @ 08:47:37 PM, Trevor Woerner wrote:
> The U-Boot bbappend recipe was in need of some cleanups.
> 
> v2:
> - breakup the original 1 patch into 4 to make the steps easier to
>   audit/verify.
> 
> Trevor Woerner (4):
>   u-boot cleanup: move task
>   u-boot cleanup: group dependencies
>   u-boot cleanup: group EXTRA_OEMAKE
>   u-boot cleanup: organize DEPENDS
> 
>  recipes-bsp/u-boot/u-boot%.bbappend | 32 ++---
>  1 file changed, 15 insertions(+), 17 deletions(-)

Applied to meta-rockchip, master branch.

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



Re: [yocto] [meta-rockchip] [PATCH] Allow KERNEL_IMAGETYPE override v3

2023-10-03 Thread Trevor Woerner
On Tue 2023-10-03 @ 12:17:13 PM, Quentin Schulz wrote:
> Hi Anthony,
> 
> On 10/3/23 02:43, Anthony Davies via lists.yoctoproject.org wrote:
> > [You don't often get email from 
> > anthony.t.davies=gmail@lists.yoctoproject.org. Learn why this is 
> > important at https://aka.ms/LearnAboutSenderIdentification ]
> > 
> > From: Anthony Davies 
> > 
> > Updated inc files to allow overriding KERNEL_IMAGETYPE in local.conf
> > 
> > Signed-off-by: Anthony Davies 
> 
> Reviewed-by: Quentin Schulz 
> 
> Unrelated to this patch set, KERNEL_IMAGETYPE actually defaults to zImage so
> we could just avoid doing it again in rk3066, rk3188, rk3328.
> 
> Also, for newer versions of patch series, please use:
> git format-patch -v3
> or
> git send-email -v3
> 
> and it should create a mail with:
> [PATCH v3] in there
> because with the current subject being
> Allow KERNEL_IMAGETYPE override v3
> this would be the commit title inside the git repo and this is the kind of
> information we don't necessarily need in the git repo :) (but thanks for
> thinknig about adding it, it makes it easier to follow which patch mail is
> the latest version :) ).

Would "git send-email -v3" also add the "meta-rockchip"?
I usually just do:

$ git format-patch --subject-prefix="meta-rockchip][PATCH v3" ...
$ git send-email 

I'll fix the commit messages up so don't worry about sending a v4. Thanks for
your patches! It's nice to not be the only one thinking about this layer.

Best regards,
Trevor

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



Re: [yocto] [meta-rockchip][PATCH 3/3] rock-pi-s: add

2023-10-03 Thread Trevor Woerner
On Mon 2023-10-02 @ 06:17:15 PM, Quentin Schulz wrote:
> Hi Trevor,
> 
> On 10/1/23 15:08, Trevor Woerner via lists.yoctoproject.org wrote:
> > ROCK Pi S is a Rockchip RK3308 based SBC from Radxa. It contains a 64-bit
> > quad core processor, USB, ethernet, wireless connectivity, and voice
> > detection engine in 1.7-inches square. The ROCK Pi S comes in two RAM sizes
> > 256MB or 512MB DDR3, and uses sdmmc card for OS and storage. Optionally, 
> > some
> > versions of the ROCK Pi S provide on-board storage via 1Gb/2Gb/4Gb/8Gb of
> > SLC NAND flash.
> > 
> > "S" stands for "small square" since the total board size of the rock-pi-s is
> > 1.7-inches square.
> > 
> > This BSP assumes booting from sdmmc, and using ttyS0 for the serial console
> > (similar to Raspberry Pi).
> > 
> > Signed-off-by: Trevor Woerner 
> > ---
> >   README  |  1 +
> >   conf/machine/include/rk3308.inc | 18 ++
> >   conf/machine/rock-pi-s.conf | 11 +++
> >   recipes-bsp/rkbin/rockchip-rkbin_git.bb | 17 +
> >   recipes-bsp/u-boot/u-boot%.bbappend | 11 +++
> >   recipes-kernel/linux/linux-yocto_%.bbappend |  1 +
> >   6 files changed, 59 insertions(+)
> >   create mode 100644 conf/machine/include/rk3308.inc
> >   create mode 100644 conf/machine/rock-pi-s.conf
> > 
> > diff --git a/README b/README
> > index d4576d73c636..e815fb47ff5f 100644
> > --- a/README
> > +++ b/README
> > @@ -31,6 +31,7 @@ Status of supported boards:
> > firefly-rk3288
> > nanopi-r4s
> > rock-5b
> > +   rock-pi-s
> > builds:
> > marsboard-rk3066
> > radxarock
> > diff --git a/conf/machine/include/rk3308.inc 
> > b/conf/machine/include/rk3308.inc
> > new file mode 100644
> > index ..19cabafdfac0
> > --- /dev/null
> > +++ b/conf/machine/include/rk3308.inc
> > @@ -0,0 +1,18 @@
> > +SOC_FAMILY = "rk3308"
> > +
> > +DEFAULTTUNE ?= "cortexa35-crypto"
> > +
> > +require conf/machine/include/soc-family.inc
> > +require conf/machine/include/arm/armv8a/tune-cortexa35.inc
> > +require conf/machine/include/rockchip-defaults.inc
> > +require conf/machine/include/rockchip-wic.inc
> > +
> > +SERIAL_CONSOLES = "150;ttyS0"
> > +
> > +KBUILD_DEFCONFIG ?= "defconfig"
> > +KERNEL_FEATURES:append:rk3308 = " 
> > bsp/rockchip/remove-non-rockchip-arch-arm64.scc"
> 
> I'm starting to wonder if we shouldn't make this a pn-linux-yocto (and other
> flavors) override as well because we would make it difficult for other
> people to NOT include this. e.g. if they have their own recipe where
> KERNEL_FEATURES is used for example. Anyway, not specific to this SoC
> include file so not a blocker.

I'm not 100% sure what you're recommending, but if there's a better way that
is more flexible for the users, it sounds good to me.

> 
> > +KERNEL_CLASSES = "kernel-fitimage"
> > +KERNEL_IMAGETYPE = "fitImage"
> > +
> > +UBOOT_SUFFIX ?= "itb"
> > +UBOOT_ENTRYPOINT ?= "0x0600"
> > diff --git a/conf/machine/rock-pi-s.conf b/conf/machine/rock-pi-s.conf
> > new file mode 100644
> > index ..79ea73c6b47e
> > --- /dev/null
> > +++ b/conf/machine/rock-pi-s.conf
> > @@ -0,0 +1,11 @@
> > +#@TYPE: Machine
> > +#@NAME: Radxa Rock Pi S
> > +#@DESCRIPTION: ROCK Pi S is a Rockchip RK3308 based SBC by Radxa. "S" 
> > stands for "small square"
> > +#https://wiki.radxa.com/RockpiS
> > +
> > +require conf/machine/include/rk3308.inc
> > +
> > +KERNEL_DEVICETREE = "rockchip/rk3308-rock-pi-s.dtb"
> > +MACHINE_EXTRA_RRECOMMENDS += "kernel-modules"
> > +
> > +UBOOT_MACHINE = "rock-pi-s-rk3308_defconfig"
> > diff --git a/recipes-bsp/rkbin/rockchip-rkbin_git.bb 
> > b/recipes-bsp/rkbin/rockchip-rkbin_git.bb
> > index 7fefb017053b..49e1e682eb7d 100644
> > --- a/recipes-bsp/rkbin/rockchip-rkbin_git.bb
> > +++ b/recipes-bsp/rkbin/rockchip-rkbin_git.bb
> > @@ -1,9 +1,12 @@
> >   DESCRIPTION = "Rockchip Firmware and Tool Binaries"
> >   LICENSE = "Proprietary"
> > +LICENSE:rk3308 = "CLOSED"
> >   LIC_FILES_CHKSUM = "file://LICENSE;md5=15faa4a01e7eb0f5d33f9f2bcc7bff62"
> > +LIC_FILES_CHKSUM:rk3308 = 
> > "file://README;md5=

Re: [yocto] [meta-rockchip] [PATCH] Stop u-boot sections partition table

2023-10-03 Thread Trevor Woerner
On Tue 2023-10-03 @ 12:22:01 PM, Quentin Schulz wrote:
> Hi Anthony,
> 
> On 10/3/23 03:26, Anthony Davies via lists.yoctoproject.org wrote:
> > From: Anthony Davies 
> > 
> > When checking the partition table of builds using this layer you get
> > numerous extra partitions due to each bootloader entry creating a
> > partition. --no-table on these entries should stop this from happening.
> > 
> > Signed-off-by: Anthony Davies 
> 
> While this is annoying in some aspects, it's also very nice when you want to
> flash a new U-Boot manually for example. You just need to flash the raw file
> in the partition directly instead of having to figure out which offset to
> use. FWIW, I actually do flash by offset instead of by partition and I have
> to remember the offsets for different products (we don't use Rockchip's
> defaults :) ) and I guess this would make things easier.
> 
> So,
> Reviewed-by: Quentin Schulz 
> 
> Up to Trevor to decide what to do with the patch :)

The whole point of partitions is to keep things safely separated from each
other, avoid overruns that clobber adjacent things, and make it easier to
modify contents (flash a partition instead of magic offsets). I've worked with
a device that had hidden/magic offsets and ended up redefining the partition
table to call everything its own partition.

I don't know what we'd be gaining be keeping these "partitions" hidden?

> 
> Cheers,
> Quentin
> 
> > ---
> >   wic/rockchip.wks | 10 +-
> >   1 file changed, 5 insertions(+), 5 deletions(-)
> > 
> > diff --git a/wic/rockchip.wks b/wic/rockchip.wks
> > index 1cc30ae..eb50d8c 100644
> > --- a/wic/rockchip.wks
> > +++ b/wic/rockchip.wks
> > @@ -15,11 +15,11 @@
> >   #   boot32768   229376
> >   #   root262144  -   (suggested)
> > -part loader1--offset 32 --fixed-size 4000K--source 
> > rawcopy 
> > --sourceparams="file=${SPL_BINARY}"
> > -part reserved1  --offset 4032   --fixed-size 64K
> > -part reserved2  --offset 4096   --fixed-size 4096K
> > -part loader2--offset 8192   --fixed-size 4096K--source 
> > rawcopy 
> > --sourceparams="file=u-boot.${UBOOT_SUFFIX}"
> > -part atf--offset 12288  --fixed-size 4096K
> > +part loader1--offset 32 --fixed-size 4000K--source 
> > rawcopy   --no-table
> > --sourceparams="file=${SPL_BINARY}"
> > +part reserved1  --offset 4032   --fixed-size 64K   
> >   --no-table
> > +part reserved2  --offset 4096   --fixed-size 4096K 
> >   --no-table
> > +part loader2--offset 8192   --fixed-size 4096K--source 
> > rawcopy   --no-table
> > --sourceparams="file=u-boot.${UBOOT_SUFFIX}"
> > +part atf--offset 12288  --fixed-size 4096K 
> >   --no-table
> >   part /boot  --offset 16384  --size   114688K --active --source 
> > bootimg-partition --fstype=vfat --label boot --use-uuid 
> > --sourceparams="loader=u-boot"
> >   part /--source 
> > rootfs--fstype=ext4 --label root --use-uuid
> > 
> > 
> > 
> > 
> > 

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



Re: [yocto] [meta-rockchip][PATCH] KERNEL_DEVICETREE: 32-bit re-org

2023-10-03 Thread Trevor Woerner
On Tue 2023-10-03 @ 12:32:08 PM, Quentin Schulz wrote:
> Hi Trevor,
> 
> On 10/3/23 06:19, Trevor Woerner via lists.yoctoproject.org wrote:
> > The upstream kernel reorganized the 32-bit arch/arm device-tree directory 
> > structure
> > to separate out the device-trees by manufacturer (similar to the 
> > organization
> > of the arch/arm64 device-trees). Update the references to 32-bit arm
> > device-trees to match.
> > 
> 
> Does this work with linux-yocto and linux-yocto-dev from master or do we
> need to add some logic to support both (do you want to?).

This doesn't work at all. I figured this was an easy one, made the tweak,
submitted it, then added it to my jenkins builder to verify overnight. Woke up
to find the do_image_wic() tasks failed. It's the same layout as the 64-bit
machines but I'll have to dig in to figure out why it didn't work.

As for the linux-yocto vs linux-yocto-dev question I'll take a look. This
happened with linux-yocto, so I would assume it is already the case with
linux-yocto-dev. But if oe-core supports multiple versions of linux-yocto,
that might be the tricky bit and yes, I would look into supporting both for
the time-being until the transition period ends.

Although... any BSP layer supporting 32-bit machines will have similar issues,
so perhaps there's a better way to solve this in oe-core?

Best regards,
Trevor

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



[yocto] [meta-rockchip][PATCH] KERNEL_DEVICETREE: 32-bit re-org

2023-10-02 Thread Trevor Woerner
The upstream kernel reorganized the 32-bit arch/arm device-tree directory 
structure
to separate out the device-trees by manufacturer (similar to the organization
of the arch/arm64 device-trees). Update the references to 32-bit arm
device-trees to match.

Signed-off-by: Trevor Woerner 
---
 conf/machine/firefly-rk3288.conf   | 2 +-
 conf/machine/marsboard-rk3066.conf | 2 +-
 conf/machine/radxarock.conf| 2 +-
 conf/machine/rock2-square.conf | 2 +-
 conf/machine/tinker-board-s.conf   | 2 +-
 conf/machine/tinker-board.conf | 2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/conf/machine/firefly-rk3288.conf b/conf/machine/firefly-rk3288.conf
index 3270bb9f1657..6ff1be822008 100644
--- a/conf/machine/firefly-rk3288.conf
+++ b/conf/machine/firefly-rk3288.conf
@@ -9,5 +9,5 @@
 require conf/machine/include/rk3288.inc
 require conf/machine/include/rockchip-wic.inc
 
-KERNEL_DEVICETREE = "rk3288-firefly.dtb"
+KERNEL_DEVICETREE = "rockchip/rk3288-firefly.dtb"
 UBOOT_MACHINE = "firefly-rk3288_defconfig"
diff --git a/conf/machine/marsboard-rk3066.conf 
b/conf/machine/marsboard-rk3066.conf
index 52fd256a3445..36945e8e407b 100644
--- a/conf/machine/marsboard-rk3066.conf
+++ b/conf/machine/marsboard-rk3066.conf
@@ -8,4 +8,4 @@
 
 require conf/machine/include/rk3066.inc
 
-KERNEL_DEVICETREE = "rk3066a-marsboard.dtb"
+KERNEL_DEVICETREE = "rockchip/rk3066a-marsboard.dtb"
diff --git a/conf/machine/radxarock.conf b/conf/machine/radxarock.conf
index 42d8848e1d09..6ad8474669d0 100644
--- a/conf/machine/radxarock.conf
+++ b/conf/machine/radxarock.conf
@@ -9,4 +9,4 @@
 
 require conf/machine/include/rk3188.inc
 
-KERNEL_DEVICETREE = "rk3188-radxarock.dtb"
+KERNEL_DEVICETREE = "rockchip/rk3188-radxarock.dtb"
diff --git a/conf/machine/rock2-square.conf b/conf/machine/rock2-square.conf
index 46064eebcc67..9468b9a6b559 100644
--- a/conf/machine/rock2-square.conf
+++ b/conf/machine/rock2-square.conf
@@ -9,7 +9,7 @@
 require conf/machine/include/rk3288.inc
 
 SPL_BINARY = "u-boot-spl-dtb.bin"
-KERNEL_DEVICETREE = "rk3288-rock2-square.dtb"
+KERNEL_DEVICETREE = "rockchip/rk3288-rock2-square.dtb"
 UBOOT_MACHINE = "rock2_defconfig"
 
 # This board doesn't support the combined idbloader, so resort to the older
diff --git a/conf/machine/tinker-board-s.conf b/conf/machine/tinker-board-s.conf
index 870b9bcdf8c7..3a656136c554 100644
--- a/conf/machine/tinker-board-s.conf
+++ b/conf/machine/tinker-board-s.conf
@@ -7,5 +7,5 @@
 
 require conf/machine/include/tinker.inc
 
-KERNEL_DEVICETREE = "rk3288-tinker-s.dtb"
+KERNEL_DEVICETREE = "rockchip/rk3288-tinker-s.dtb"
 UBOOT_MACHINE = "tinker-s-rk3288_defconfig"
diff --git a/conf/machine/tinker-board.conf b/conf/machine/tinker-board.conf
index 8fe5f6305d70..ef1a1c1ac098 100644
--- a/conf/machine/tinker-board.conf
+++ b/conf/machine/tinker-board.conf
@@ -7,5 +7,5 @@
 
 require conf/machine/include/tinker.inc
 
-KERNEL_DEVICETREE = "rk3288-tinker.dtb"
+KERNEL_DEVICETREE = "rockchip/rk3288-tinker.dtb"
 UBOOT_MACHINE = "tinker-rk3288_defconfig"
-- 
2.41.0.327.gaa9166bcc0ba


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



[yocto] [meta-rockchip][PATCH v2 4/4] u-boot cleanup: organize DEPENDS

2023-10-02 Thread Trevor Woerner
Group and sort the DEPENDS.

Signed-off-by: Trevor Woerner 
---
 recipes-bsp/u-boot/u-boot%.bbappend | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/recipes-bsp/u-boot/u-boot%.bbappend 
b/recipes-bsp/u-boot/u-boot%.bbappend
index 951e82af7743..e79c471cf5ce 100644
--- a/recipes-bsp/u-boot/u-boot%.bbappend
+++ b/recipes-bsp/u-boot/u-boot%.bbappend
@@ -1,6 +1,6 @@
-DEPENDS:append:rock-pi-4 = " gnutls-native"
 # various machines require the pyelftools library for parsing dtb files
 DEPENDS:append = " python3-pyelftools-native"
+DEPENDS:append:rock-pi-4 = " gnutls-native"
 
 EXTRA_OEMAKE:append:px30 = " BL31=${DEPLOY_DIR_IMAGE}/bl31-px30.elf"
 EXTRA_OEMAKE:append:rk3328 = " BL31=${DEPLOY_DIR_IMAGE}/bl31-rk3328.elf"
-- 
2.41.0.327.gaa9166bcc0ba


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



[yocto] [meta-rockchip][PATCH v2 3/4] u-boot cleanup: group EXTRA_OEMAKE

2023-10-02 Thread Trevor Woerner
Group the EXTRA_OEMAKE items together and sort.

Signed-off-by: Trevor Woerner 
---
 recipes-bsp/u-boot/u-boot%.bbappend | 7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/recipes-bsp/u-boot/u-boot%.bbappend 
b/recipes-bsp/u-boot/u-boot%.bbappend
index 8c6ac8627efa..951e82af7743 100644
--- a/recipes-bsp/u-boot/u-boot%.bbappend
+++ b/recipes-bsp/u-boot/u-boot%.bbappend
@@ -2,15 +2,14 @@ DEPENDS:append:rock-pi-4 = " gnutls-native"
 # various machines require the pyelftools library for parsing dtb files
 DEPENDS:append = " python3-pyelftools-native"
 
+EXTRA_OEMAKE:append:px30 = " BL31=${DEPLOY_DIR_IMAGE}/bl31-px30.elf"
+EXTRA_OEMAKE:append:rk3328 = " BL31=${DEPLOY_DIR_IMAGE}/bl31-rk3328.elf"
+EXTRA_OEMAKE:append:rk3399 = " BL31=${DEPLOY_DIR_IMAGE}/bl31-rk3399.elf"
 EXTRA_OEMAKE:append:rk3588s = " \
BL31=${DEPLOY_DIR_IMAGE}/bl31-rk3588.elf \
ROCKCHIP_TPL=${DEPLOY_DIR_IMAGE}/ddr-rk3588.bin \
"
 
-EXTRA_OEMAKE:append:rk3399 = " BL31=${DEPLOY_DIR_IMAGE}/bl31-rk3399.elf"
-EXTRA_OEMAKE:append:rk3328 = " BL31=${DEPLOY_DIR_IMAGE}/bl31-rk3328.elf"
-EXTRA_OEMAKE:append:px30 = " BL31=${DEPLOY_DIR_IMAGE}/bl31-px30.elf"
-
 INIT_FIRMWARE_DEPENDS ??= ""
 INIT_FIRMWARE_DEPENDS:px30 = " trusted-firmware-a:do_deploy"
 INIT_FIRMWARE_DEPENDS:rk3328 = " trusted-firmware-a:do_deploy"
-- 
2.41.0.327.gaa9166bcc0ba


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



[yocto] [meta-rockchip][PATCH v2 2/4] u-boot cleanup: group dependencies

2023-10-02 Thread Trevor Woerner
Group the INIT_FIRMWARE_DEPENDS together and sort.

Signed-off-by: Trevor Woerner 
---
 recipes-bsp/u-boot/u-boot%.bbappend | 11 +--
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/recipes-bsp/u-boot/u-boot%.bbappend 
b/recipes-bsp/u-boot/u-boot%.bbappend
index c8444aacad89..8c6ac8627efa 100644
--- a/recipes-bsp/u-boot/u-boot%.bbappend
+++ b/recipes-bsp/u-boot/u-boot%.bbappend
@@ -2,21 +2,20 @@ DEPENDS:append:rock-pi-4 = " gnutls-native"
 # various machines require the pyelftools library for parsing dtb files
 DEPENDS:append = " python3-pyelftools-native"
 
-INIT_FIRMWARE_DEPENDS ??= ""
-
 EXTRA_OEMAKE:append:rk3588s = " \
BL31=${DEPLOY_DIR_IMAGE}/bl31-rk3588.elf \
ROCKCHIP_TPL=${DEPLOY_DIR_IMAGE}/ddr-rk3588.bin \
"
-INIT_FIRMWARE_DEPENDS:rk3588s = " rockchip-rkbin:do_deploy"
 
 EXTRA_OEMAKE:append:rk3399 = " BL31=${DEPLOY_DIR_IMAGE}/bl31-rk3399.elf"
-INIT_FIRMWARE_DEPENDS:rk3399 = " trusted-firmware-a:do_deploy"
 EXTRA_OEMAKE:append:rk3328 = " BL31=${DEPLOY_DIR_IMAGE}/bl31-rk3328.elf"
-INIT_FIRMWARE_DEPENDS:rk3328 = " trusted-firmware-a:do_deploy"
 EXTRA_OEMAKE:append:px30 = " BL31=${DEPLOY_DIR_IMAGE}/bl31-px30.elf"
-INIT_FIRMWARE_DEPENDS:px30 = " trusted-firmware-a:do_deploy"
 
+INIT_FIRMWARE_DEPENDS ??= ""
+INIT_FIRMWARE_DEPENDS:px30 = " trusted-firmware-a:do_deploy"
+INIT_FIRMWARE_DEPENDS:rk3328 = " trusted-firmware-a:do_deploy"
+INIT_FIRMWARE_DEPENDS:rk3399 = " trusted-firmware-a:do_deploy"
+INIT_FIRMWARE_DEPENDS:rk3588s = " rockchip-rkbin:do_deploy"
 do_compile[depends] .= "${INIT_FIRMWARE_DEPENDS}"
 
 do_compile:append:rock2-square () {
-- 
2.41.0.327.gaa9166bcc0ba


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



[yocto] [meta-rockchip][PATCH v2 1/4] u-boot cleanup: move task

2023-10-02 Thread Trevor Woerner
According to the Yocto Recipe Style Guide[1] the tasks should be at the end.

[1] https://docs.yoctoproject.org/dev/contributor-guide/recipe-style-guide.html

Signed-off-by: Trevor Woerner 
---
 recipes-bsp/u-boot/u-boot%.bbappend | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/recipes-bsp/u-boot/u-boot%.bbappend 
b/recipes-bsp/u-boot/u-boot%.bbappend
index f7800625aaf1..c8444aacad89 100644
--- a/recipes-bsp/u-boot/u-boot%.bbappend
+++ b/recipes-bsp/u-boot/u-boot%.bbappend
@@ -1,10 +1,3 @@
-do_compile:append:rock2-square () {
-   # copy to default search path
-   if [ "${SPL_BINARY}" = "u-boot-spl-dtb.bin" ]; then
-   cp ${B}/spl/${SPL_BINARY} ${B}
-   fi
-}
-
 DEPENDS:append:rock-pi-4 = " gnutls-native"
 # various machines require the pyelftools library for parsing dtb files
 DEPENDS:append = " python3-pyelftools-native"
@@ -25,3 +18,10 @@ EXTRA_OEMAKE:append:px30 = " 
BL31=${DEPLOY_DIR_IMAGE}/bl31-px30.elf"
 INIT_FIRMWARE_DEPENDS:px30 = " trusted-firmware-a:do_deploy"
 
 do_compile[depends] .= "${INIT_FIRMWARE_DEPENDS}"
+
+do_compile:append:rock2-square () {
+   # copy to default search path
+   if [ "${SPL_BINARY}" = "u-boot-spl-dtb.bin" ]; then
+   cp ${B}/spl/${SPL_BINARY} ${B}
+   fi
+}
-- 
2.41.0.327.gaa9166bcc0ba


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



[yocto] [meta-rockchip][PATCH v2 0/4] u-boot cleanup

2023-10-02 Thread Trevor Woerner
The U-Boot bbappend recipe was in need of some cleanups.

v2:
- breakup the original 1 patch into 4 to make the steps easier to
  audit/verify.

Trevor Woerner (4):
  u-boot cleanup: move task
  u-boot cleanup: group dependencies
  u-boot cleanup: group EXTRA_OEMAKE
  u-boot cleanup: organize DEPENDS

 recipes-bsp/u-boot/u-boot%.bbappend | 32 ++---
 1 file changed, 15 insertions(+), 17 deletions(-)

-- 
2.41.0.327.gaa9166bcc0ba


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



[yocto] [meta-rockchip][PATCH] nanopi-m4b: add

2023-10-02 Thread Trevor Woerner
NanoPi M4B is a RK3399-based (dual-core A72, quad-core A53 with NEON) board
in the same form factor as the RPi B3+ (including compatible connectors) with
onboard 2.4/5.0 dual-band WiFi + Bluetooth 5.0 with USB type-C power from
FriendlyElec.

https://www.friendlyelec.com/index.php?route=product/product_id=275

Signed-off-by: Trevor Woerner 
---
 README  |  1 +
 conf/machine/nanopi-m4b.conf| 11 +++
 recipes-kernel/linux/linux-yocto_%.bbappend |  1 +
 3 files changed, 13 insertions(+)
 create mode 100644 conf/machine/nanopi-m4b.conf

diff --git a/README b/README
index 81044748880a..bcf1e0bba361 100644
--- a/README
+++ b/README
@@ -32,6 +32,7 @@ Status of supported boards:
nanopi-r4s
rock-5b
nanopi-r2s
+   nanopi-m4b
builds:
marsboard-rk3066
radxarock
diff --git a/conf/machine/nanopi-m4b.conf b/conf/machine/nanopi-m4b.conf
new file mode 100644
index ..35cd8f68e82e
--- /dev/null
+++ b/conf/machine/nanopi-m4b.conf
@@ -0,0 +1,11 @@
+#@TYPE: Machine
+#@NAME: NanoPi M4B
+#@DESCRIPTION: NanoPi M4B RK3399-based board which has the same form factor as 
the RPi B3+.
+#https://www.friendlyelec.com/index.php?route=product/product_id=275
+
+require conf/machine/include/rk3399.inc
+
+MACHINE_EXTRA_RRECOMMENDS += "kernel-modules"
+
+KERNEL_DEVICETREE = "rockchip/rk3399-nanopi-m4b.dtb"
+UBOOT_MACHINE = "nanopi-m4b-rk3399_defconfig"
diff --git a/recipes-kernel/linux/linux-yocto_%.bbappend 
b/recipes-kernel/linux/linux-yocto_%.bbappend
index d627a063a2d0..7da92dbab508 100644
--- a/recipes-kernel/linux/linux-yocto_%.bbappend
+++ b/recipes-kernel/linux/linux-yocto_%.bbappend
@@ -14,6 +14,7 @@ COMPATIBLE_MACHINE:rock64 = "rock64"
 COMPATIBLE_MACHINE:rock-pi-e = "rock-pi-e"
 COMPATIBLE_MACHINE:nanopi-r4s = "nanopi-r4s"
 COMPATIBLE_MACHINE:nanopi-r2s = "nanopi-r2s"
+COMPATIBLE_MACHINE:nanopi-m4b = "nanopi-m4b"
 
 SRC_URI:append = " 
file://rockchip-kmeta;type=kmeta;name=rockchip-kmeta;destsuffix=rockchip-kmeta"
 SRC_URI:append:nanopi-r4s = " file://nanopi-r4s.scc"
-- 
2.41.0.327.gaa9166bcc0ba


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



[yocto] [meta-rockchip][PATCH] virtual/tpl: add

2023-10-02 Thread Trevor Woerner
Be more obvious regarding the roles of TF-A vs rkbin: both provide a TPL for
Rockchip SoCs, but only one should be used.

Signed-off-by: Trevor Woerner 
---
 conf/machine/include/px30.inc| 1 +
 conf/machine/include/rk3328.inc  | 1 +
 conf/machine/include/rk3399.inc  | 1 +
 conf/machine/include/rk3588s.inc | 2 +-
 recipes-bsp/rkbin/rockchip-rkbin_git.bb  | 2 +-
 recipes-bsp/trusted-firmware-a/trusted-firmware-a_%.bbappend | 2 ++
 6 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/conf/machine/include/px30.inc b/conf/machine/include/px30.inc
index a3727fbfca66..04cbd092a00d 100644
--- a/conf/machine/include/px30.inc
+++ b/conf/machine/include/px30.inc
@@ -14,6 +14,7 @@ KBUILD_DEFCONFIG ?= "defconfig"
 KERNEL_CLASSES = "kernel-fitimage"
 KERNEL_IMAGETYPE = "fitImage"
 
+PREFERRED_PROVIDER_virtual/tpl = "trusted-firmware-a"
 TFA_PLATFORM = "px30"
 TFA_BUILD_TARGET = "bl31"
 
diff --git a/conf/machine/include/rk3328.inc b/conf/machine/include/rk3328.inc
index f9f8792ca521..7f8673f062d1 100644
--- a/conf/machine/include/rk3328.inc
+++ b/conf/machine/include/rk3328.inc
@@ -15,6 +15,7 @@ KERNEL_FEATURES:append:rk3328 = " 
bsp/rockchip/remove-non-rockchip-arch-arm64.sc
 KERNEL_CLASSES = "kernel-fitimage"
 KERNEL_IMAGETYPE = "fitImage"
 
+PREFERRED_PROVIDER_virtual/tpl = "trusted-firmware-a"
 TFA_PLATFORM = "rk3328"
 TFA_BUILD_TARGET = "bl31"
 
diff --git a/conf/machine/include/rk3399.inc b/conf/machine/include/rk3399.inc
index 88c87af3a03e..09be584468b8 100644
--- a/conf/machine/include/rk3399.inc
+++ b/conf/machine/include/rk3399.inc
@@ -15,6 +15,7 @@ KERNEL_FEATURES:append:rk3399 = " 
bsp/rockchip/remove-non-rockchip-arch-arm64.sc
 KERNEL_CLASSES = "kernel-fitimage"
 KERNEL_IMAGETYPE = "fitImage"
 
+PREFERRED_PROVIDER_virtual/tpl = "trusted-firmware-a"
 TFA_PLATFORM = "rk3399"
 TFA_BUILD_TARGET = "bl31"
 
diff --git a/conf/machine/include/rk3588s.inc b/conf/machine/include/rk3588s.inc
index 7bfc9474e96e..e66ad565585b 100644
--- a/conf/machine/include/rk3588s.inc
+++ b/conf/machine/include/rk3588s.inc
@@ -10,7 +10,7 @@ KERNEL_FEATURES:append:rk3588s = " 
bsp/rockchip/remove-non-rockchip-arch-arm64.s
 KERNEL_CLASSES = "kernel-fitimage"
 KERNEL_IMAGETYPE = "fitImage"
 
-PREFERRED_PROVIDER_trusted-firmware-a = "rockchip-rkbin"
+PREFERRED_PROVIDER_virtual/tpl = "rockchip-rkbin"
 PREFERRED_PROVIDER_optee-os = "rockchip-rkbin"
 
 UBOOT_SUFFIX ?= "itb"
diff --git a/recipes-bsp/rkbin/rockchip-rkbin_git.bb 
b/recipes-bsp/rkbin/rockchip-rkbin_git.bb
index 7fefb017053b..887a7fb61853 100644
--- a/recipes-bsp/rkbin/rockchip-rkbin_git.bb
+++ b/recipes-bsp/rkbin/rockchip-rkbin_git.bb
@@ -5,7 +5,7 @@ LIC_FILES_CHKSUM = 
"file://LICENSE;md5=15faa4a01e7eb0f5d33f9f2bcc7bff62"
 SRC_URI = "git://github.com/rockchip-linux/rkbin;protocol=https;branch=master"
 SRCREV = "b4558da0860ca48bf1a571dd33ccba580b9abe23"
 
-PROVIDES += "trusted-firmware-a"
+PROVIDES += "virtual/tpl"
 PROVIDES += "optee-os"
 
 inherit bin_package deploy
diff --git a/recipes-bsp/trusted-firmware-a/trusted-firmware-a_%.bbappend 
b/recipes-bsp/trusted-firmware-a/trusted-firmware-a_%.bbappend
index c9ad84c24857..f6566212746e 100644
--- a/recipes-bsp/trusted-firmware-a/trusted-firmware-a_%.bbappend
+++ b/recipes-bsp/trusted-firmware-a/trusted-firmware-a_%.bbappend
@@ -2,6 +2,8 @@
 # toolchain
 DEPENDS:append:rk3399 = " gcc-arm-none-eabi-native"
 
+PROVIDES += "virtual/tpl"
+
 COMPATIBLE_MACHINE:append:rk3399 = "|rk3399"
 COMPATIBLE_MACHINE:append:rk3328 = "|rk3328"
 COMPATIBLE_MACHINE:append:px30 = "|px30"
-- 
2.41.0.327.gaa9166bcc0ba


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



Re: [yocto] [meta-rockchip][PATCH] nanopi-r2s: add

2023-10-02 Thread Trevor Woerner
On Mon 2023-10-02 @ 10:11:46 AM, Trevor Woerner wrote:
> The NanoPi R2S is a mini router with edge computing and dual GbE ports by
> FriendlyElec. It is based on the Rockchip RK3328 - a quad A53 core, 64-bit SoC
> running at 1.2GHz with at least 1GB of DDR4 RAM. It has one USB 2.0 host and
> is powered via a USB type-C connector (5V/2A).
> 
> https://www.friendlyelec.com/index.php?route=product/product_id=282
> 
> Signed-off-by: Trevor Woerner 
> ---
>  README  |  1 +
>  conf/machine/nanopi-r2s.conf| 11 +++
>  recipes-kernel/linux/linux-yocto_%.bbappend |  1 +
>  3 files changed, 13 insertions(+)
>  create mode 100644 conf/machine/nanopi-r2s.conf

Applied to meta-rockchip, master branch.

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



Re: [yocto] [meta-rockchip][PATCH 2/3] rock-pi-e.conf: remove redundant MACHINEOVERRIDES

2023-10-02 Thread Trevor Woerner
On Sun 2023-10-01 @ 09:08:02 AM, Trevor Woerner wrote:
> The MACHINE name is already added to the MACHINEOVERRIDES implicitly, no need
> to add it explicitly.
> 
> Signed-off-by: Trevor Woerner 
> ---
>  conf/machine/rock-pi-e.conf | 2 --
>  1 file changed, 2 deletions(-)

Applied to meta-rockchip, master branch.

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



[yocto] [meta-rockchip][PATCH] nanopi-r2s: add

2023-10-02 Thread Trevor Woerner
The NanoPi R2S is a mini router with edge computing and dual GbE ports by
FriendlyElec. It is based on the Rockchip RK3328 - a quad A53 core, 64-bit SoC
running at 1.2GHz with at least 1GB of DDR4 RAM. It has one USB 2.0 host and
is powered via a USB type-C connector (5V/2A).

https://www.friendlyelec.com/index.php?route=product/product_id=282

Signed-off-by: Trevor Woerner 
---
 README  |  1 +
 conf/machine/nanopi-r2s.conf| 11 +++
 recipes-kernel/linux/linux-yocto_%.bbappend |  1 +
 3 files changed, 13 insertions(+)
 create mode 100644 conf/machine/nanopi-r2s.conf

diff --git a/README b/README
index e815fb47ff5f..8451b4778c37 100644
--- a/README
+++ b/README
@@ -32,6 +32,7 @@ Status of supported boards:
nanopi-r4s
rock-5b
rock-pi-s
+   nanopi-r2s
builds:
marsboard-rk3066
radxarock
diff --git a/conf/machine/nanopi-r2s.conf b/conf/machine/nanopi-r2s.conf
new file mode 100644
index ..4472c21f0217
--- /dev/null
+++ b/conf/machine/nanopi-r2s.conf
@@ -0,0 +1,11 @@
+#@TYPE: Machine
+#@NAME: NanoPi R2S
+#@DESCRIPTION: The NanoPi R2S is a mini router with edge computing and dual 
GbE ports by FriendlyElec
+#https://www.friendlyelec.com/index.php?route=product/product_id=282
+
+require conf/machine/include/rk3328.inc
+
+KERNEL_DEVICETREE = "rockchip/rk3328-nanopi-r2s.dtb"
+MACHINE_EXTRA_RRECOMMENDS += "kernel-modules"
+
+UBOOT_MACHINE = "nanopi-r2s-rk3328_defconfig"
diff --git a/recipes-kernel/linux/linux-yocto_%.bbappend 
b/recipes-kernel/linux/linux-yocto_%.bbappend
index 61c89f70d8dc..456182ee473d 100644
--- a/recipes-kernel/linux/linux-yocto_%.bbappend
+++ b/recipes-kernel/linux/linux-yocto_%.bbappend
@@ -14,6 +14,7 @@ COMPATIBLE_MACHINE:rock64 = "rock64"
 COMPATIBLE_MACHINE:rock-pi-e = "rock-pi-e"
 COMPATIBLE_MACHINE:nanopi-r4s = "nanopi-r4s"
 COMPATIBLE_MACHINE:rock-pi-s = "rock-pi-s"
+COMPATIBLE_MACHINE:nanopi-r2s = "nanopi-r2s"
 
 SRC_URI:append = " 
file://rockchip-kmeta;type=kmeta;name=rockchip-kmeta;destsuffix=rockchip-kmeta"
 SRC_URI:append:nanopi-r4s = " file://nanopi-r4s.scc"
-- 
2.41.0.327.gaa9166bcc0ba


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



[yocto] [meta-rockchip][PATCH 2/3] rock-pi-e.conf: remove redundant MACHINEOVERRIDES

2023-10-01 Thread Trevor Woerner
The MACHINE name is already added to the MACHINEOVERRIDES implicitly, no need
to add it explicitly.

Signed-off-by: Trevor Woerner 
---
 conf/machine/rock-pi-e.conf | 2 --
 1 file changed, 2 deletions(-)

diff --git a/conf/machine/rock-pi-e.conf b/conf/machine/rock-pi-e.conf
index 0e2856ffe1a7..517956c4b9db 100644
--- a/conf/machine/rock-pi-e.conf
+++ b/conf/machine/rock-pi-e.conf
@@ -5,8 +5,6 @@
 
 require conf/machine/include/rk3328.inc
 
-MACHINEOVERRIDES =. "rock-pi-e:"
-
 KERNEL_DEVICETREE = "rockchip/rk3328-rock-pi-e.dtb"
 MACHINE_EXTRA_RRECOMMENDS += "kernel-modules"
 
-- 
2.41.0.327.gaa9166bcc0ba


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



[yocto] [meta-rockchip][PATCH 0/3] rock-pi-s

2023-10-01 Thread Trevor Woerner
Perform a couple recipe cleanups then add a new MACHINE: rock-pi-s.

Trevor Woerner (3):
  u-boot: cleanup
  rock-pi-e.conf: remove redundant MACHINEOVERRIDES
  rock-pi-s: add

 README  |  1 +
 conf/machine/include/rk3308.inc | 18 +
 conf/machine/rock-pi-e.conf |  2 -
 conf/machine/rock-pi-s.conf | 11 ++
 recipes-bsp/rkbin/rockchip-rkbin_git.bb | 17 +
 recipes-bsp/u-boot/u-boot%.bbappend | 41 +
 recipes-kernel/linux/linux-yocto_%.bbappend |  1 +
 7 files changed, 73 insertions(+), 18 deletions(-)
 create mode 100644 conf/machine/include/rk3308.inc
 create mode 100644 conf/machine/rock-pi-s.conf

-- 
2.41.0.327.gaa9166bcc0ba


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



  1   2   3   4   >