aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToshiyuki Ogasahara <toshiyuki.ogasahara.bo@hitachi.com>2019-12-13 14:43:52 +0900
committerMarek Vasut <marek.vasut+renesas@gmail.com>2020-02-15 10:45:55 +0100
commit13856f3779668f5b33b13261b2bcd194a7d1a097 (patch)
treed70d1a0fcc095545a533bd8be88f85a5c462f8d1
parent956059385cf2532924e1023f9d5156aed2f78f4b (diff)
downloadtrusted-firmware-a-13856f3779668f5b33b13261b2bcd194a7d1a097.tar.gz
rcar_gen3: plat: Change fixed destination address of BL31 and BL32
This patch changes the destination address of BL31 and BL32 From fixed address for getting from the each certificates. Signed-off-by: Toshiyuki Ogasahara <toshiyuki.ogasahara.bo@hitachi.com> Signed-off-by: Yoshifumi Hosoya <yoshifumi.hosoya.wj@renesas.com> Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> # upstream rework Change-Id: Ide11776feff25e6fdd55ab28503a15b658b2e0d5
-rw-r--r--plat/renesas/rcar/bl2_plat_setup.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/plat/renesas/rcar/bl2_plat_setup.c b/plat/renesas/rcar/bl2_plat_setup.c
index 578892eb3..891096724 100644
--- a/plat/renesas/rcar/bl2_plat_setup.c
+++ b/plat/renesas/rcar/bl2_plat_setup.c
@@ -16,6 +16,8 @@
#include <common/debug.h>
#include <common/desc_image_load.h>
#include <drivers/console.h>
+#include <drivers/io/io_driver.h>
+#include <drivers/io/io_storage.h>
#include <lib/mmio.h>
#include <lib/xlat_tables/xlat_tables_defs.h>
#include <plat/common/platform.h>
@@ -33,6 +35,7 @@
#endif
#include "io_common.h"
+#include "io_rcar.h"
#include "qos_init.h"
#include "rcar_def.h"
#include "rcar_private.h"
@@ -382,10 +385,28 @@ cold_boot:
return 0;
}
+static uint64_t rcar_get_dest_addr_from_cert(uint32_t certid, uintptr_t *dest)
+{
+ uint32_t cert, len;
+ int ret;
+
+ ret = rcar_get_certificate(certid, &cert);
+ if (ret) {
+ ERROR("%s : cert file load error", __func__);
+ return 1;
+ }
+
+ rcar_read_certificate((uint64_t) cert, &len, dest);
+
+ return 0;
+}
+
int bl2_plat_handle_post_image_load(unsigned int image_id)
{
static bl2_to_bl31_params_mem_t *params;
bl_mem_params_node_t *bl_mem_params;
+ uintptr_t dest;
+ int ret;
if (!params) {
params = (bl2_to_bl31_params_mem_t *) PARAMS_BASE;
@@ -396,8 +417,17 @@ int bl2_plat_handle_post_image_load(unsigned int image_id)
switch (image_id) {
case BL31_IMAGE_ID:
+ ret = rcar_get_dest_addr_from_cert(SOC_FW_CONTENT_CERT_ID,
+ &dest);
+ if (!ret)
+ bl_mem_params->image_info.image_base = dest;
break;
case BL32_IMAGE_ID:
+ ret = rcar_get_dest_addr_from_cert(TRUSTED_OS_FW_CONTENT_CERT_ID,
+ &dest);
+ if (!ret)
+ bl_mem_params->image_info.image_base = dest;
+
memcpy(&params->bl32_ep_info, &bl_mem_params->ep_info,
sizeof(entry_point_info_t));
break;