aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulius Werner <jwerner@chromium.org>2019-05-30 16:57:15 -0700
committerJulius Werner <jwerner@chromium.org>2019-07-24 11:04:03 -0700
commit3e02c7436cf40fb7f7eb4d3038b7fc1ed1eeaa5f (patch)
treefdf6412bad9bf58944d84a9e7768d0469cc3e5f2
parentd9af1f7b6f4ec29d42d15936f254215ad061569f (diff)
downloadtrusted-firmware-a-3e02c7436cf40fb7f7eb4d3038b7fc1ed1eeaa5f.tar.gz
plat/rockchip: Use new bl31_params_parse_helper()
The Rockchip platform is a prime candidate for switching to the new bl31_params_parse_helper(), so switch it over. This will allow BL2 implementations on this platform to transparently switch over to the version 2 parameter structure. Change-Id: I540741d2425c93f66c8697ce749a351eb2b3a7e8 Signed-off-by: Julius Werner <jwerner@chromium.org>
-rw-r--r--plat/rockchip/common/bl31_plat_setup.c12
-rw-r--r--plat/rockchip/common/include/plat_private.h9
-rw-r--r--plat/rockchip/common/sp_min_plat_setup.c12
-rw-r--r--plat/rockchip/rk3288/platform.mk3
-rw-r--r--plat/rockchip/rk3328/platform.mk3
-rw-r--r--plat/rockchip/rk3368/platform.mk3
-rw-r--r--plat/rockchip/rk3399/platform.mk3
7 files changed, 14 insertions, 31 deletions
diff --git a/plat/rockchip/common/bl31_plat_setup.c b/plat/rockchip/common/bl31_plat_setup.c
index e009b88e18..a13ee495a2 100644
--- a/plat/rockchip/common/bl31_plat_setup.c
+++ b/plat/rockchip/common/bl31_plat_setup.c
@@ -10,6 +10,7 @@
#include <common/bl_common.h>
#include <common/debug.h>
+#include <common/desc_image_load.h>
#include <drivers/console.h>
#include <drivers/generic_delay_timer.h>
#include <drivers/ti/uart/uart_16550.h>
@@ -32,6 +33,7 @@ entry_point_info_t *bl31_plat_get_next_image_ep_info(uint32_t type)
entry_point_info_t *next_image_info;
next_image_info = (type == NON_SECURE) ? &bl33_ep_info : &bl32_ep_info;
+ assert(next_image_info->h.type == PARAM_EP);
/* None of the images on this platform can have 0x0 as the entrypoint */
if (next_image_info->pc)
@@ -57,7 +59,6 @@ void bl31_early_platform_setup2(u_register_t arg0, u_register_t arg1,
u_register_t arg2, u_register_t arg3)
{
static console_16550_t console;
- struct rockchip_bl31_params *arg_from_bl2 = (struct rockchip_bl31_params *) arg0;
params_early_setup(arg1);
@@ -74,14 +75,7 @@ void bl31_early_platform_setup2(u_register_t arg0, u_register_t arg1,
VERBOSE("bl31_setup\n");
- /* Passing a NULL context is a critical programming error */
- assert(arg_from_bl2);
-
- assert(arg_from_bl2->h.type == PARAM_BL31);
- assert(arg_from_bl2->h.version >= VERSION_1);
-
- bl32_ep_info = *arg_from_bl2->bl32_ep_info;
- bl33_ep_info = *arg_from_bl2->bl33_ep_info;
+ bl31_params_parse_helper(arg0, &bl32_ep_info, &bl33_ep_info);
}
/*******************************************************************************
diff --git a/plat/rockchip/common/include/plat_private.h b/plat/rockchip/common/include/plat_private.h
index 242b528157..66b61850db 100644
--- a/plat/rockchip/common/include/plat_private.h
+++ b/plat/rockchip/common/include/plat_private.h
@@ -31,15 +31,6 @@ extern uint32_t __bl31_sram_text_real_end, __bl31_sram_data_real_end;
extern uint32_t __sram_incbin_start, __sram_incbin_end;
extern uint32_t __sram_incbin_real_end;
-struct rockchip_bl31_params {
- param_header_t h;
- image_info_t *bl31_image_info;
- entry_point_info_t *bl32_ep_info;
- image_info_t *bl32_image_info;
- entry_point_info_t *bl33_ep_info;
- image_info_t *bl33_image_info;
-};
-
/******************************************************************************
* The register have write-mask bits, it is mean, if you want to set the bits,
* you needs set the write-mask bits at the same time,
diff --git a/plat/rockchip/common/sp_min_plat_setup.c b/plat/rockchip/common/sp_min_plat_setup.c
index cb28b7a615..7b1a0b58b7 100644
--- a/plat/rockchip/common/sp_min_plat_setup.c
+++ b/plat/rockchip/common/sp_min_plat_setup.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016-2018, ARM Limited and Contributors. All rights reserved.
+ * Copyright (c) 2016-2019, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -11,6 +11,7 @@
#include <arch_helpers.h>
#include <common/bl_common.h>
#include <common/debug.h>
+#include <common/desc_image_load.h>
#include <drivers/console.h>
#include <drivers/generic_delay_timer.h>
#include <drivers/ti/uart/uart_16550.h>
@@ -53,7 +54,6 @@ void sp_min_early_platform_setup2(u_register_t arg0, u_register_t arg1,
u_register_t arg2, u_register_t arg3)
{
static console_16550_t console;
- struct rockchip_bl31_params *arg_from_bl2 = (struct rockchip_bl31_params *) arg0;
params_early_setup(arg1);
@@ -69,13 +69,7 @@ void sp_min_early_platform_setup2(u_register_t arg0, u_register_t arg1,
#endif
VERBOSE("sp_min_setup\n");
- /* Passing a NULL context is a critical programming error */
- assert(arg_from_bl2);
-
- assert(arg_from_bl2->h.type == PARAM_BL31);
- assert(arg_from_bl2->h.version >= VERSION_1);
-
- bl33_ep_info = *arg_from_bl2->bl33_ep_info;
+ bl31_params_parse_helper(arg0, NULL, &bl33_ep_info);
}
/*******************************************************************************
diff --git a/plat/rockchip/rk3288/platform.mk b/plat/rockchip/rk3288/platform.mk
index 980fb6bf00..faf7a15201 100644
--- a/plat/rockchip/rk3288/platform.mk
+++ b/plat/rockchip/rk3288/platform.mk
@@ -30,7 +30,8 @@ RK_GIC_SOURCES := drivers/arm/gic/common/gic_common.c \
plat/common/plat_gicv2.c \
${RK_PLAT}/common/rockchip_gicv2.c
-PLAT_BL_COMMON_SOURCES := lib/bl_aux_params/bl_aux_params.c \
+PLAT_BL_COMMON_SOURCES := common/desc_image_load.c \
+ lib/bl_aux_params/bl_aux_params.c \
plat/common/aarch32/crash_console_helpers.S \
plat/common/plat_psci_common.c
diff --git a/plat/rockchip/rk3328/platform.mk b/plat/rockchip/rk3328/platform.mk
index 2be2be3da6..0da4f2dc46 100644
--- a/plat/rockchip/rk3328/platform.mk
+++ b/plat/rockchip/rk3328/platform.mk
@@ -28,7 +28,8 @@ RK_GIC_SOURCES := drivers/arm/gic/common/gic_common.c \
plat/common/plat_gicv2.c \
${RK_PLAT}/common/rockchip_gicv2.c
-PLAT_BL_COMMON_SOURCES := lib/bl_aux_params/bl_aux_params.c \
+PLAT_BL_COMMON_SOURCES := common/desc_image_load.c \
+ lib/bl_aux_params/bl_aux_params.c \
lib/xlat_tables/aarch64/xlat_tables.c \
lib/xlat_tables/xlat_tables_common.c \
plat/common/aarch64/crash_console_helpers.S \
diff --git a/plat/rockchip/rk3368/platform.mk b/plat/rockchip/rk3368/platform.mk
index 8812378b19..cb0cb89625 100644
--- a/plat/rockchip/rk3368/platform.mk
+++ b/plat/rockchip/rk3368/platform.mk
@@ -26,7 +26,8 @@ RK_GIC_SOURCES := drivers/arm/gic/common/gic_common.c \
plat/common/plat_gicv2.c \
${RK_PLAT}/common/rockchip_gicv2.c
-PLAT_BL_COMMON_SOURCES := lib/bl_aux_params/bl_aux_params.c \
+PLAT_BL_COMMON_SOURCES := common/desc_image_load.c \
+ lib/bl_aux_params/bl_aux_params.c \
lib/xlat_tables/xlat_tables_common.c \
lib/xlat_tables/aarch64/xlat_tables.c \
plat/common/aarch64/crash_console_helpers.S \
diff --git a/plat/rockchip/rk3399/platform.mk b/plat/rockchip/rk3399/platform.mk
index 88fa8e9c0a..cfc48e8f96 100644
--- a/plat/rockchip/rk3399/platform.mk
+++ b/plat/rockchip/rk3399/platform.mk
@@ -32,7 +32,8 @@ RK_GIC_SOURCES := drivers/arm/gic/common/gic_common.c \
plat/common/plat_gicv3.c \
${RK_PLAT}/common/rockchip_gicv3.c
-PLAT_BL_COMMON_SOURCES := lib/bl_aux_params/bl_aux_params.c \
+PLAT_BL_COMMON_SOURCES := common/desc_image_load.c \
+ lib/bl_aux_params/bl_aux_params.c \
lib/xlat_tables/xlat_tables_common.c \
lib/xlat_tables/aarch64/xlat_tables.c \
plat/common/aarch64/crash_console_helpers.S \