[PATCH 6/6] ARM: Rockchip: use vendor blob OPTEE load addresses

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxx>
---
 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





[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux