summaryrefslogtreecommitdiff
path: root/plat/mediatek
diff options
context:
space:
mode:
authorJulius Werner <jwerner@chromium.org>2019-05-30 17:34:08 -0700
committerJulius Werner <jwerner@chromium.org>2019-07-24 11:04:05 -0700
commitcbdc72b559ab8230e17b7ef0f928097207a61060 (patch)
tree9582db34eff3ef5557fa1d68d926459e8e7116bb /plat/mediatek
parent3e02c7436cf40fb7f7eb4d3038b7fc1ed1eeaa5f (diff)
plat/mediatek/mt81*: Use new bl31_params_parse() helper
The Mediatek MT8173/MT8183 SoCs are prime candidates for switching to the new bl31_params_parse() helper, so switch them over. This will allow BL2 implementations on these platforms to transparently switch over to the version 2 parameter structure. Change-Id: I0d17ba6c455102d325a06503d2078a76d12b5deb Signed-off-by: Julius Werner <jwerner@chromium.org>
Diffstat (limited to 'plat/mediatek')
-rw-r--r--plat/mediatek/mt8173/bl31_plat_setup.c13
-rw-r--r--plat/mediatek/mt8173/platform.mk3
-rw-r--r--plat/mediatek/mt8183/bl31_plat_setup.c10
-rw-r--r--plat/mediatek/mt8183/platform.mk3
4 files changed, 11 insertions, 18 deletions
diff --git a/plat/mediatek/mt8173/bl31_plat_setup.c b/plat/mediatek/mt8173/bl31_plat_setup.c
index dd23e63e..ad81b169 100644
--- a/plat/mediatek/mt8173/bl31_plat_setup.c
+++ b/plat/mediatek/mt8173/bl31_plat_setup.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013-2018, ARM Limited and Contributors. All rights reserved.
+ * Copyright (c) 2013-2019, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -8,6 +8,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 <lib/mmio.h>
@@ -79,6 +80,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)
@@ -98,18 +100,11 @@ entry_point_info_t *bl31_plat_get_next_image_ep_info(uint32_t type)
void bl31_early_platform_setup2(u_register_t arg0, u_register_t arg1,
u_register_t arg2, u_register_t arg3)
{
- struct mtk_bl31_params *arg_from_bl2 = (struct mtk_bl31_params *)arg0;
-
console_init(MT8173_UART0_BASE, MT8173_UART_CLOCK, MT8173_BAUDRATE);
VERBOSE("bl31_setup\n");
- assert(arg_from_bl2 != NULL);
- 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/mediatek/mt8173/platform.mk b/plat/mediatek/mt8173/platform.mk
index 0726efe4..24e4ec65 100644
--- a/plat/mediatek/mt8173/platform.mk
+++ b/plat/mediatek/mt8173/platform.mk
@@ -23,7 +23,8 @@ PLAT_BL_COMMON_SOURCES := lib/xlat_tables/xlat_tables_common.c \
plat/arm/common/arm_gicv2.c \
plat/common/plat_gicv2.c
-BL31_SOURCES += drivers/arm/cci/cci.c \
+BL31_SOURCES += common/desc_image_load.c \
+ drivers/arm/cci/cci.c \
drivers/arm/gic/common/gic_common.c \
drivers/arm/gic/v2/gicv2_main.c \
drivers/arm/gic/v2/gicv2_helpers.c \
diff --git a/plat/mediatek/mt8183/bl31_plat_setup.c b/plat/mediatek/mt8183/bl31_plat_setup.c
index b451189d..e623e96a 100644
--- a/plat/mediatek/mt8183/bl31_plat_setup.c
+++ b/plat/mediatek/mt8183/bl31_plat_setup.c
@@ -7,6 +7,7 @@
#include <assert.h>
#include <arch_helpers.h>
#include <common/bl_common.h>
+#include <common/desc_image_load.h>
#include <plat/common/common_def.h>
#include <drivers/console.h>
#include <common/debug.h>
@@ -50,6 +51,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)
@@ -69,19 +71,13 @@ entry_point_info_t *bl31_plat_get_next_image_ep_info(uint32_t type)
void bl31_early_platform_setup2(u_register_t arg0, u_register_t arg1,
u_register_t arg2, u_register_t arg3)
{
- struct mtk_bl31_params *arg_from_bl2 = (struct mtk_bl31_params *)arg0;
static console_16550_t console;
console_16550_register(UART0_BASE, UART_CLOCK, UART_BAUDRATE, &console);
NOTICE("MT8183 bl31_setup\n");
- assert(arg_from_bl2 != NULL);
- 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/mediatek/mt8183/platform.mk b/plat/mediatek/mt8183/platform.mk
index 8c8e2fe9..f0a598a3 100644
--- a/plat/mediatek/mt8183/platform.mk
+++ b/plat/mediatek/mt8183/platform.mk
@@ -16,7 +16,8 @@ PLAT_BL_COMMON_SOURCES := lib/xlat_tables/aarch64/xlat_tables.c \
plat/common/plat_psci_common.c \
plat/common/aarch64/crash_console_helpers.S
-BL31_SOURCES += drivers/arm/cci/cci.c \
+BL31_SOURCES += common/desc_image_load.c \
+ drivers/arm/cci/cci.c \
drivers/arm/gic/common/gic_common.c \
drivers/arm/gic/v3/arm_gicv3_common.c \
drivers/arm/gic/v3/gicv3_helpers.c \