hikey: Migrate to new interfaces
- Migrate to new GIC interfaces. - Remove unused bl1_init_bl2_mem_layout(). - Migrate to bl31_early_platform_setup2(). - Use PLAT_VIRT_ADDR_SPACE_SIZE and PLAT_PHY_ADDR_SPACE_SIZE. - Update Makefile paths. - Remove references to removed build options. Change-Id: Idd1e99b4864b2a72e9e12ff1fcd73d8285bc1c94 Tested-by: Haojian Zhuang <haojian.zhuang@linaro.org> Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
This commit is contained in:
parent
1ba2ff7b0f
commit
c3b5800bbb
|
@ -5,7 +5,6 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <arch_helpers.h>
|
#include <arch_helpers.h>
|
||||||
#include <arm_gic.h>
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <bl_common.h>
|
#include <bl_common.h>
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
|
|
@ -37,28 +37,6 @@ meminfo_t *bl1_plat_sec_mem_layout(void)
|
||||||
return &bl1_tzram_layout;
|
return &bl1_tzram_layout;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* Function that takes a memory layout into which BL2 has been loaded and
|
|
||||||
* populates a new memory layout for BL2 that ensures that BL1's data sections
|
|
||||||
* resident in secure RAM are not visible to BL2.
|
|
||||||
******************************************************************************/
|
|
||||||
void bl1_init_bl2_mem_layout(const meminfo_t *bl1_mem_layout,
|
|
||||||
meminfo_t *bl2_mem_layout)
|
|
||||||
{
|
|
||||||
|
|
||||||
assert(bl1_mem_layout != NULL);
|
|
||||||
assert(bl2_mem_layout != NULL);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Cannot remove BL1 RW data from the scope of memory visible to BL2
|
|
||||||
* like arm platforms because they overlap in hikey
|
|
||||||
*/
|
|
||||||
bl2_mem_layout->total_base = BL2_BASE;
|
|
||||||
bl2_mem_layout->total_size = BL32_SRAM_LIMIT - BL2_BASE;
|
|
||||||
|
|
||||||
flush_dcache_range((unsigned long)bl2_mem_layout, sizeof(meminfo_t));
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Perform any BL1 specific platform actions.
|
* Perform any BL1 specific platform actions.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -5,7 +5,6 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <arch_helpers.h>
|
#include <arch_helpers.h>
|
||||||
#include <arm_gic.h>
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <bl_common.h>
|
#include <bl_common.h>
|
||||||
#include <cci.h>
|
#include <cci.h>
|
||||||
|
@ -17,6 +16,7 @@
|
||||||
#include <hikey_def.h>
|
#include <hikey_def.h>
|
||||||
#include <hisi_ipc.h>
|
#include <hisi_ipc.h>
|
||||||
#include <hisi_pwrc.h>
|
#include <hisi_pwrc.h>
|
||||||
|
#include <interrupt_props.h>
|
||||||
#include <mmio.h>
|
#include <mmio.h>
|
||||||
#include <platform_def.h>
|
#include <platform_def.h>
|
||||||
|
|
||||||
|
@ -48,9 +48,11 @@ static entry_point_info_t bl33_ep_info;
|
||||||
* On a GICv2 system, the Group 1 secure interrupts are treated as Group 0
|
* On a GICv2 system, the Group 1 secure interrupts are treated as Group 0
|
||||||
* interrupts.
|
* interrupts.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
const unsigned int g0_interrupt_array[] = {
|
static const interrupt_prop_t g0_interrupt_props[] = {
|
||||||
IRQ_SEC_PHY_TIMER,
|
INTR_PROP_DESC(IRQ_SEC_PHY_TIMER, GIC_HIGHEST_SEC_PRIORITY,
|
||||||
IRQ_SEC_SGI_0
|
GICV2_INTR_GROUP0, GIC_INTR_CFG_LEVEL),
|
||||||
|
INTR_PROP_DESC(IRQ_SEC_SGI_0, GIC_HIGHEST_SEC_PRIORITY,
|
||||||
|
GICV2_INTR_GROUP0, GIC_INTR_CFG_LEVEL),
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -61,8 +63,8 @@ const unsigned int g0_interrupt_array[] = {
|
||||||
gicv2_driver_data_t hikey_gic_data = {
|
gicv2_driver_data_t hikey_gic_data = {
|
||||||
.gicd_base = PLAT_ARM_GICD_BASE,
|
.gicd_base = PLAT_ARM_GICD_BASE,
|
||||||
.gicc_base = PLAT_ARM_GICC_BASE,
|
.gicc_base = PLAT_ARM_GICC_BASE,
|
||||||
.g0_interrupt_num = ARRAY_SIZE(g0_interrupt_array),
|
.interrupt_props = g0_interrupt_props,
|
||||||
.g0_interrupt_array = g0_interrupt_array,
|
.interrupt_props_num = ARRAY_SIZE(g0_interrupt_props),
|
||||||
};
|
};
|
||||||
|
|
||||||
static const int cci_map[] = {
|
static const int cci_map[] = {
|
||||||
|
@ -82,9 +84,13 @@ entry_point_info_t *bl31_plat_get_next_image_ep_info(uint32_t type)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void bl31_early_platform_setup(void *from_bl2,
|
void bl31_early_platform_setup2(u_register_t arg0, u_register_t arg1,
|
||||||
void *plat_params_from_bl2)
|
u_register_t arg2, u_register_t arg3)
|
||||||
{
|
{
|
||||||
|
void *from_bl2;
|
||||||
|
|
||||||
|
from_bl2 = (void *) arg0;
|
||||||
|
|
||||||
/* Initialize the console to provide early debug support */
|
/* Initialize the console to provide early debug support */
|
||||||
console_init(CONSOLE_BASE, PL011_UART_CLK_IN_HZ, PL011_BAUDRATE);
|
console_init(CONSOLE_BASE, PL011_UART_CLK_IN_HZ, PL011_BAUDRATE);
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
#define __PLAT_MACROS_S__
|
#define __PLAT_MACROS_S__
|
||||||
|
|
||||||
#include <cci.h>
|
#include <cci.h>
|
||||||
#include <gic_v2.h>
|
#include <gicv2.h>
|
||||||
#include <hi6220.h>
|
#include <hi6220.h>
|
||||||
#include <platform_def.h>
|
#include <platform_def.h>
|
||||||
|
|
||||||
|
|
|
@ -52,7 +52,8 @@
|
||||||
/*
|
/*
|
||||||
* Platform specific page table and MMU setup constants
|
* Platform specific page table and MMU setup constants
|
||||||
*/
|
*/
|
||||||
#define ADDR_SPACE_SIZE (1ULL << 32)
|
#define PLAT_VIRT_ADDR_SPACE_SIZE (1ULL << 32)
|
||||||
|
#define PLAT_PHY_ADDR_SPACE_SIZE (1ULL << 32)
|
||||||
|
|
||||||
#if defined(IMAGE_BL1) || defined(IMAGE_BL32)
|
#if defined(IMAGE_BL1) || defined(IMAGE_BL32)
|
||||||
#define MAX_XLAT_TABLES 3
|
#define MAX_XLAT_TABLES 3
|
||||||
|
|
|
@ -4,9 +4,6 @@
|
||||||
# SPDX-License-Identifier: BSD-3-Clause
|
# SPDX-License-Identifier: BSD-3-Clause
|
||||||
#
|
#
|
||||||
|
|
||||||
# Enable version2 of image loading
|
|
||||||
LOAD_IMAGE_V2 := 1
|
|
||||||
|
|
||||||
# Non-TF Boot ROM
|
# Non-TF Boot ROM
|
||||||
BL2_AT_EL3 := 1
|
BL2_AT_EL3 := 1
|
||||||
|
|
||||||
|
@ -45,16 +42,15 @@ ifneq ($(BL32_EXTRA2),)
|
||||||
$(eval $(call TOOL_ADD_IMG,bl32_extra2,--tos-fw-extra2))
|
$(eval $(call TOOL_ADD_IMG,bl32_extra2,--tos-fw-extra2))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ENABLE_PLAT_COMPAT := 0
|
|
||||||
|
|
||||||
USE_COHERENT_MEM := 1
|
USE_COHERENT_MEM := 1
|
||||||
|
|
||||||
PLAT_INCLUDES := -Iinclude/common/tbbr \
|
PLAT_INCLUDES := -Iinclude/common/tbbr \
|
||||||
-Iinclude/drivers/synopsys \
|
-Iinclude/drivers/synopsys \
|
||||||
-Iplat/hisilicon/hikey/include
|
-Iplat/hisilicon/hikey/include
|
||||||
|
|
||||||
PLAT_BL_COMMON_SOURCES := drivers/arm/pl011/pl011_console.S \
|
PLAT_BL_COMMON_SOURCES := drivers/arm/pl011/aarch64/pl011_console.S \
|
||||||
lib/aarch64/xlat_tables.c \
|
lib/xlat_tables/aarch64/xlat_tables.c \
|
||||||
|
lib/xlat_tables/xlat_tables_common.c \
|
||||||
plat/hisilicon/hikey/aarch64/hikey_common.c
|
plat/hisilicon/hikey/aarch64/hikey_common.c
|
||||||
|
|
||||||
BL1_SOURCES += bl1/tbbr/tbbr_img_desc.c \
|
BL1_SOURCES += bl1/tbbr/tbbr_img_desc.c \
|
||||||
|
@ -108,7 +104,7 @@ BL31_SOURCES += drivers/arm/cci/cci.c \
|
||||||
drivers/arm/sp804/sp804_delay_timer.c \
|
drivers/arm/sp804/sp804_delay_timer.c \
|
||||||
drivers/delay_timer/delay_timer.c \
|
drivers/delay_timer/delay_timer.c \
|
||||||
lib/cpus/aarch64/cortex_a53.S \
|
lib/cpus/aarch64/cortex_a53.S \
|
||||||
plat/common/aarch64/plat_psci_common.c \
|
plat/common/plat_psci_common.c \
|
||||||
plat/hisilicon/hikey/aarch64/hikey_helpers.S \
|
plat/hisilicon/hikey/aarch64/hikey_helpers.S \
|
||||||
plat/hisilicon/hikey/hikey_bl31_setup.c \
|
plat/hisilicon/hikey/hikey_bl31_setup.c \
|
||||||
plat/hisilicon/hikey/hikey_pm.c \
|
plat/hisilicon/hikey/hikey_pm.c \
|
||||||
|
@ -127,8 +123,6 @@ ifneq (${TRUSTED_BOARD_BOOT},0)
|
||||||
include drivers/auth/mbedtls/mbedtls_crypto.mk
|
include drivers/auth/mbedtls/mbedtls_crypto.mk
|
||||||
include drivers/auth/mbedtls/mbedtls_x509.mk
|
include drivers/auth/mbedtls/mbedtls_x509.mk
|
||||||
|
|
||||||
USE_TBBR_DEFS := 1
|
|
||||||
|
|
||||||
AUTH_SOURCES := drivers/auth/auth_mod.c \
|
AUTH_SOURCES := drivers/auth/auth_mod.c \
|
||||||
drivers/auth/crypto_mod.c \
|
drivers/auth/crypto_mod.c \
|
||||||
drivers/auth/img_parser_mod.c \
|
drivers/auth/img_parser_mod.c \
|
||||||
|
|
Loading…
Reference in New Issue