Hi Trevor,

On 9/22/23 17:06, Trevor Woerner wrote:
On Fri 2023-09-22 @ 04:22:11 PM, Quentin Schulz wrote:
Hi Trevor,

Looking good :) Thanks for looking into it, will be helpful to me in the
upcoming weeks/months :)

On 9/22/23 04:51, Trevor Woerner via lists.yoctoproject.org wrote:
Add support for the Radxa Rock 5B
https://wiki.radxa.com/Rock5/5b

The device-tree for this board is better in the 6.5 (and later) kernels,
therefore set the kernel to linux-yocto-dev for now (eventually this won't be
needed as linux-yocto moves forward).

The Trusted Firmware A project (TF-A git://git.trustedfirmware.org/TF-A)
does not currently support the rk3588, but patches are in review. For
the time-being we're using the binary DDR/TPL initialization blob from
https://github.com/rockchip-linux/rkbin. Hopefully this can change if/when
TF-A gains support for the rk3588.


Because it's closed source, I cannot tell if DDR binary is based off TF-A
but I would say it's likely not? It's fine like this but not entirely sure
it's true.

Does this sound like I believe the binary blob is based on TF-A? If so I'll
need to reword. I'm literally trying to say the opposite. I.e. we can't use
TF-A yet so we're stuck using the blob... for now.


I can suggest:
"""
The upstream Trusted Firmware A project (TF-A git://git.trustedfirmware.org/TF-A) does not currently support the rk3588, but patches are in review. Until it gains support, we are stuck with blob provided by Rockchip in <rockchip-rkbin link>. Similarly, U-Boot doesn't have support for DDR initialization on rk3588 yet and only a blob has been provided by Rockchip in <rockchip-rkbin link>, so we've no choice but use that one until proper DDR init is added to U-Boot upstream.
"""

what do you think?

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 <[email protected]>

I may have improperly wrote this in the github commit I sent you, but my
professional mail address is:
[email protected]
:)

lol, I was wondering why that bounced.


Mystery solved :)


Signed-off-by: Trevor Woerner <[email protected]>
---
   README                                        |  1 +
   conf/machine/include/rk3588.inc               |  8 ++
   conf/machine/include/rk3588s-base.inc         | 16 ++++
   conf/machine/include/rk3588s.inc              |  5 ++
   conf/machine/rock5b.conf                      | 12 +++
   recipes-bsp/rkbin/rockchip-rkbin_git.bb       | 37 ++++++++
   recipes-bsp/u-boot/u-boot%.bbappend           |  5 ++
   recipes-kernel/linux/linux-yocto-dev.bbappend |  3 +
   .../rockchip/remove-non-rockchip-arch-arm.cfg | 85 +++++++++++++++++++
   .../rockchip/remove-non-rockchip-arch-arm.scc |  1 +
   .../remove-non-rockchip-arch-arm64.cfg        | 66 ++++++++++++++
   .../remove-non-rockchip-arch-arm64.scc        |  1 +
   12 files changed, 240 insertions(+)
   create mode 100644 conf/machine/include/rk3588.inc
   create mode 100644 conf/machine/include/rk3588s-base.inc
   create mode 100644 conf/machine/include/rk3588s.inc
   create mode 100644 conf/machine/rock5b.conf
   create mode 100644 recipes-bsp/rkbin/rockchip-rkbin_git.bb
   create mode 100644 recipes-kernel/linux/linux-yocto-dev.bbappend
   create mode 100644 
recipes-kernel/linux/linux-yocto-dev/rockchip-kmeta/bsp/rockchip/remove-non-rockchip-arch-arm.cfg
   create mode 100644 
recipes-kernel/linux/linux-yocto-dev/rockchip-kmeta/bsp/rockchip/remove-non-rockchip-arch-arm.scc
   create mode 100644 
recipes-kernel/linux/linux-yocto-dev/rockchip-kmeta/bsp/rockchip/remove-non-rockchip-arch-arm64.cfg
   create mode 100644 
recipes-kernel/linux/linux-yocto-dev/rockchip-kmeta/bsp/rockchip/remove-non-rockchip-arch-arm64.scc

diff --git a/README b/README
index 286dafbe1020..032d9bbb6b34 100644
--- a/README
+++ b/README
@@ -30,6 +30,7 @@ Status of supported boards:
                vyasa-rk3288
                firefly-rk3288
                nanopi-r4s
+               rock5b
        builds:
                marsboard-rk3066
                radxarock
diff --git a/conf/machine/include/rk3588.inc b/conf/machine/include/rk3588.inc
new file mode 100644
index 000000000000..d358565a904d
--- /dev/null
+++ b/conf/machine/include/rk3588.inc
@@ -0,0 +1,8 @@
+# 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
+MACHINEOVERRIDES =. "rk3588:rk3588s:"

This is incorrect, this makes rk3588s have precedence over rk3588, which is
wrong for rk3588-based devices. Why not have MACHINEOVERRIDES for rk3588s in
rk3588s-base.inc instead?

+require conf/machine/include/rk3588s-base.inc
+
+SOC_FAMILY = "rk3588"
+require conf/machine/include/soc-family.inc

The two lines above actually do MACHINEOVERRIDES =. "rk3588"
so we don't need to repeat it.

diff --git a/conf/machine/include/rk3588s-base.inc 
b/conf/machine/include/rk3588s-base.inc
new file mode 100644
index 000000000000..ad74a1895ec0
--- /dev/null
+++ b/conf/machine/include/rk3588s-base.inc
@@ -0,0 +1,16 @@
+DEFAULTTUNE ?= "cortexa76-cortexa55-crypto"
+
+require conf/machine/include/arm/armv8-2a/tune-cortexa76-cortexa55.inc
+require conf/machine/include/rockchip-defaults.inc
+require conf/machine/include/rockchip-wic.inc
+
+KBUILD_DEFCONFIG ?= "defconfig"
+KERNEL_FEATURES:append:rk3588 = " 
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 ?= "0x06000000"
diff --git a/conf/machine/include/rk3588s.inc b/conf/machine/include/rk3588s.inc
new file mode 100644
index 000000000000..a57be507bf5e
--- /dev/null
+++ b/conf/machine/include/rk3588s.inc
@@ -0,0 +1,5 @@
+MACHINEOVERRIDES =. "rk3588s:"

Maybe we could move this directly to the -base.inc so we don't add it in
rk3588.inc and rk3588s.inc?

To verify the MACHINEOVERRIDES is correct, I highly suggest to run:
"""
bitbake-getvar MACHINEOVERRIDES
"""

this variable is read from right to left, with the highest precedence on the
right side.

So we should have something like:
"""
aarch64:rk3588s:rk3588:rock5b
aarch64:rk3588s:orangepi5
"""
for example.

I spent quite a while checking MACHINEOVERRIDES and SOC_FAMILY with many
variations until I was able to get exactly what you've just said we should be
getting.

MACHINE="rock5b"
        $ meta-rockchip> bitbake core-image-base -e | grep "^MACHINEOVERRIDES="
        
MACHINEOVERRIDES="rk3588:aarch64:armv8-2a:cortexa76-cortexa55:rk3588:rk3588s:rock5b"
        $ meta-rockchip> bitbake core-image-base -e | grep "^SOC_FAMILY="
        SOC_FAMILY="rk3588"

MACHINE="orangepi5"
        $ meta-rockchip> bitbake core-image-base -e | grep "^MACHINEOVERRIDES="
        
MACHINEOVERRIDES="rk3588s:aarch64:armv8-2a:cortexa76-cortexa55:rk3588s:orangepi5"
        $ meta-rockchip> bitbake core-image-base -e | grep "^SOC_FAMILY="
        SOC_FAMILY="rk3588s"

We're still not there yet


rk3588:aarch64:armv8-2a:cortexa76-cortexa55:rk3588:rk3588s:rock5b"

is incorrect
it should be

aarch64:armv8-2a:cortexa76-cortexa55:rk3588s:rk3588:rock5b

similarly for orangepi5 we should have

aarch64:armv8-2a:cortexa76-cortexa55:rk3588s:orangepi5

Could you run with bitbake-getvar so we have the whole history of the variable so we know when things are added and in which file? I remember I had to patch a qemu include in poky because it was incorrect maybe somehow some other layer have it messed up too (or maybe only meta-rockchip for now :) ).

Cheers,
QUentin
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#61081): https://lists.yoctoproject.org/g/yocto/message/61081
Mute This Topic: https://lists.yoctoproject.org/mt/101514536/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to