From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Robin van der Gracht <robin@protonic.nl>,
Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH 6/6] ARM: Rockchip: use vendor blob OPTEE load addresses
Date: Wed, 6 Nov 2024 19:57:24 +0100 [thread overview]
Message-ID: <20241106185724.2526-7-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20241106185724.2526-1-a.fatoum@pengutronix.de>
It's unknown where the 0x200000 came from, but it's most likely wrong.
- For the RK3399, the upstream default is 0x30000000 and
the vendor load address in rkbin/RKTRUST/RK3399TRUST.ini is
0x08400000 for the blob.
- For the RK3568, there's no upstream support and for both RK35{68,88}
the vendor load address in rkbin/RKTRUST/RK356xTRUST.ini is
0x08400000 for the blob.
The hardcoded OP-TEE load address in barebox is only relevant, when the
OP-TEE header is missing. Users compiling OP-TEE themselves can use the
tee.bin and ignore the hardcoded value altogether.
Users using the blob don't have the header, so it's a good trade off to
use the vendor load addresses as default addresses.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
Documentation/boards/rockchip.rst | 9 ++++++---
include/mach/rockchip/atf.h | 8 +++++---
2 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/Documentation/boards/rockchip.rst b/Documentation/boards/rockchip.rst
index 2d2e0572dd8f..b94c7a78e115 100644
--- a/Documentation/boards/rockchip.rst
+++ b/Documentation/boards/rockchip.rst
@@ -86,10 +86,13 @@ With these barebox can be compiled as:
make ARCH=arm rockchip_v8_defconfig
make ARCH=arm
-**NOTE** I found the bl32 firmware non working for me as of 7d631e0d5b2d373b54d4533580d08fb9bd2eaad4 in the rkbin repository.
+.. note:: When compiling OP-TEE yourself, use the tee.bin image as it has
+ a header telling barebox where to load the image to.
+ Without the header, barebox will fallback to the hardcoded addresses expected
+ by the vendor blobs in the rkbin repository.
-**NOTE** The RK3566 and RK3568 seem to share the bl31 and bl32 firmware files,
-whereas the memory initialization blob is different.
+.. note:: The RK3566 and RK3568 seem to share the bl31 and bl32 firmware files,
+ whereas the memory initialization blob is different.
Creating a bootable SD card
---------------------------
diff --git a/include/mach/rockchip/atf.h b/include/mach/rockchip/atf.h
index 1b07128f2e9b..db00dc71195f 100644
--- a/include/mach/rockchip/atf.h
+++ b/include/mach/rockchip/atf.h
@@ -14,10 +14,12 @@
* tee-raw.bin format, which omits the header. We thus hardcode here the
* fallback addresses that should be used when barebox encounters
* tee-raw.bin instead of tee.bin.
+ *
+ * The values are taken from rkbin/RKTRUST/RK3*.ini: [BL32_OPTION] ADDR
*/
-#define RK3399_OPTEE_LOAD_ADDRESS 0x200000
-#define RK3568_OPTEE_LOAD_ADDRESS 0x200000
-#define RK3588_OPTEE_LOAD_ADDRESS 0x200000
+#define RK3399_OPTEE_LOAD_ADDRESS 0x8400000
+#define RK3568_OPTEE_LOAD_ADDRESS 0x8400000
+#define RK3588_OPTEE_LOAD_ADDRESS 0x8400000
/*
* Hopefully for future platforms, the vendor binaries would use the image
--
2.39.5
next prev parent reply other threads:[~2024-11-06 19:03 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-06 18:57 [PATCH 0/6] ARM: Rockchip: fix OP-TEE as BL32 installation Ahmad Fatoum
2024-11-06 18:57 ` [PATCH 1/6] firmware: rockchip: rename from rk3xxx-op-tee.bin to rk3xxx-bl32.bin Ahmad Fatoum
2024-11-06 22:13 ` [PATCH] fixup! " Ahmad Fatoum
2024-11-06 18:57 ` [PATCH 2/6] ARM: lds: move stack top section to front of rodata Ahmad Fatoum
2024-11-06 18:57 ` [PATCH 3/6] ARM: Rockchip: fix clang warning about passing 32-bit register operand Ahmad Fatoum
2024-11-07 8:42 ` Marco Felsch
2024-11-07 8:48 ` Ahmad Fatoum
2024-11-06 18:57 ` [PATCH 4/6] ARM: Rockchip: save pointer to scratch memory in global variable Ahmad Fatoum
2024-11-06 18:57 ` [PATCH 5/6] ARM: Rockchip: implement tee.bin v1 header parsing Ahmad Fatoum
2024-11-06 18:57 ` Ahmad Fatoum [this message]
2024-11-08 10:20 ` [PATCH 0/6] ARM: Rockchip: fix OP-TEE as BL32 installation Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241106185724.2526-7-a.fatoum@pengutronix.de \
--to=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=robin@protonic.nl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox