mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-24 13:55:56 +00:00
feat(rd1ae): introduce BL31 for RD-1 AE platform
This commit introduces BL31 to the RD-1 AE platform. The RD-1 AE platform incorporates an SCP for CPU power control. Additinaly introducing the memory descriptor provides BL image information that gets used by BL2 to load the images Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com> Signed-off-by: Divin Raj <divin.raj@arm.com> Change-Id: I035cbfd09f254aa47483ad35676f1cb3ffb661bd
This commit is contained in:
parent
bb7c7e7130
commit
daf934ca91
5 changed files with 183 additions and 2 deletions
|
@ -19,7 +19,6 @@ override ENABLE_SVE_FOR_NS := 1
|
||||||
override ENABLE_SVE_FOR_SWD := 1
|
override ENABLE_SVE_FOR_SWD := 1
|
||||||
override NEED_BL1 := 0
|
override NEED_BL1 := 0
|
||||||
override NEED_BL2U := 0
|
override NEED_BL2U := 0
|
||||||
override NEED_BL31 := 0
|
|
||||||
override PSCI_EXTENDED_STATE_ID := 1
|
override PSCI_EXTENDED_STATE_ID := 1
|
||||||
|
|
||||||
ARM_ARCH_MAJOR := 9
|
ARM_ARCH_MAJOR := 9
|
||||||
|
@ -30,22 +29,39 @@ ENABLE_FEAT_ECV := 1
|
||||||
ENABLE_FEAT_FGT := 1
|
ENABLE_FEAT_FGT := 1
|
||||||
ENABLE_FEAT_MTE2 := 1
|
ENABLE_FEAT_MTE2 := 1
|
||||||
ENABLE_MPAM_FOR_LOWER_ELS := 1
|
ENABLE_MPAM_FOR_LOWER_ELS := 1
|
||||||
|
GIC_ENABLE_V4_EXTN := 1
|
||||||
|
GICV3_SUPPORT_GIC600 := 1
|
||||||
HW_ASSISTED_COHERENCY := 1
|
HW_ASSISTED_COHERENCY := 1
|
||||||
|
PLAT_MHU_VERSION := 1
|
||||||
RESET_TO_BL2 := 1
|
RESET_TO_BL2 := 1
|
||||||
SVE_VECTOR_LEN := 128
|
SVE_VECTOR_LEN := 128
|
||||||
USE_COHERENT_MEM := 0
|
USE_COHERENT_MEM := 0
|
||||||
|
|
||||||
RD1AE_CPU_SOURCES := lib/cpus/aarch64/neoverse_v3.S
|
RD1AE_CPU_SOURCES := lib/cpus/aarch64/neoverse_v3.S
|
||||||
|
|
||||||
|
include drivers/arm/gic/v3/gicv3.mk
|
||||||
|
RD1AE_GIC_SOURCES := ${GICV3_SOURCES} \
|
||||||
|
plat/common/plat_gicv3.c \
|
||||||
|
plat/arm/common/arm_gicv3.c
|
||||||
|
|
||||||
PLAT_BL_COMMON_SOURCES += ${RD1AE_BASE}/rd1ae_plat.c \
|
PLAT_BL_COMMON_SOURCES += ${RD1AE_BASE}/rd1ae_plat.c \
|
||||||
${RD1AE_BASE}/include/rd1ae_helpers.S
|
${RD1AE_BASE}/include/rd1ae_helpers.S
|
||||||
|
|
||||||
BL2_SOURCES += ${RD1AE_CPU_SOURCES} \
|
BL2_SOURCES += ${RD1AE_CPU_SOURCES} \
|
||||||
${RD1AE_BASE}/rd1ae_err.c \
|
${RD1AE_BASE}/rd1ae_err.c \
|
||||||
|
${RD1AE_BASE}/rd1ae_bl2_mem_params_desc.c \
|
||||||
lib/utils/mem_region.c \
|
lib/utils/mem_region.c \
|
||||||
plat/arm/common/arm_nor_psci_mem_protect.c \
|
plat/arm/common/arm_nor_psci_mem_protect.c \
|
||||||
drivers/arm/sbsa/sbsa.c
|
drivers/arm/sbsa/sbsa.c
|
||||||
|
|
||||||
|
BL31_SOURCES += ${RD1AE_CPU_SOURCES} \
|
||||||
|
${RD1AE_GIC_SOURCES} \
|
||||||
|
${RD1AE_BASE}/rd1ae_bl31_setup.c \
|
||||||
|
${RD1AE_BASE}/rd1ae_topology.c \
|
||||||
|
drivers/cfi/v2m/v2m_flash.c \
|
||||||
|
lib/utils/mem_region.c \
|
||||||
|
plat/arm/common/arm_nor_psci_mem_protect.c
|
||||||
|
|
||||||
# Add the FDT_SOURCES and options for Dynamic Config
|
# Add the FDT_SOURCES and options for Dynamic Config
|
||||||
FDT_SOURCES += ${RD1AE_BASE}/fdts/${PLAT}_fw_config.dts \
|
FDT_SOURCES += ${RD1AE_BASE}/fdts/${PLAT}_fw_config.dts \
|
||||||
fdts/${PLAT}.dts
|
fdts/${PLAT}.dts
|
||||||
|
|
|
@ -0,0 +1,67 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2024, Arm Limited. All rights reserved.
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <common/bl_common.h>
|
||||||
|
#include <common/desc_image_load.h>
|
||||||
|
#include <platform_def.h>
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
* Following descriptor provides BL image/ep information that gets used
|
||||||
|
* by BL2 to load the images and also subset of this information is
|
||||||
|
* passed to next BL image. The image loading sequence is managed by
|
||||||
|
* populating the images in required loading order. The image execution
|
||||||
|
* sequence is managed by populating the `next_handoff_image_id` with
|
||||||
|
* the next executable image id.
|
||||||
|
******************************************************************************/
|
||||||
|
static bl_mem_params_node_t bl2_mem_params_descs[] = {
|
||||||
|
/* Fill BL31 related information */
|
||||||
|
{
|
||||||
|
.image_id = BL31_IMAGE_ID,
|
||||||
|
|
||||||
|
SET_STATIC_PARAM_HEAD(ep_info, PARAM_EP,
|
||||||
|
VERSION_2, entry_point_info_t,
|
||||||
|
SECURE | EXECUTABLE | EP_FIRST_EXE),
|
||||||
|
.ep_info.pc = BL31_BASE,
|
||||||
|
.ep_info.spsr = SPSR_64(MODE_EL3, MODE_SP_ELX,
|
||||||
|
DISABLE_ALL_EXCEPTIONS),
|
||||||
|
#if DEBUG
|
||||||
|
.ep_info.args.arg3 = ARM_BL31_PLAT_PARAM_VAL,
|
||||||
|
#endif
|
||||||
|
|
||||||
|
SET_STATIC_PARAM_HEAD(image_info, PARAM_EP,
|
||||||
|
VERSION_2, image_info_t, IMAGE_ATTRIB_PLAT_SETUP),
|
||||||
|
.image_info.image_base = BL31_BASE,
|
||||||
|
.image_info.image_max_size = BL31_LIMIT - BL31_BASE,
|
||||||
|
|
||||||
|
.next_handoff_image_id = BL33_IMAGE_ID,
|
||||||
|
},
|
||||||
|
/* Fill HW_CONFIG related information */
|
||||||
|
{
|
||||||
|
.image_id = HW_CONFIG_ID,
|
||||||
|
SET_STATIC_PARAM_HEAD(ep_info, PARAM_IMAGE_BINARY,
|
||||||
|
VERSION_2, entry_point_info_t,
|
||||||
|
NON_SECURE | NON_EXECUTABLE),
|
||||||
|
SET_STATIC_PARAM_HEAD(image_info, PARAM_IMAGE_BINARY,
|
||||||
|
VERSION_2, image_info_t, IMAGE_ATTRIB_SKIP_LOADING),
|
||||||
|
.next_handoff_image_id = INVALID_IMAGE_ID,
|
||||||
|
},
|
||||||
|
/* Fill BL33 related information */
|
||||||
|
{
|
||||||
|
.image_id = BL33_IMAGE_ID,
|
||||||
|
SET_STATIC_PARAM_HEAD(ep_info, PARAM_EP,
|
||||||
|
VERSION_2, entry_point_info_t, NON_SECURE | EXECUTABLE),
|
||||||
|
.ep_info.pc = PLAT_ARM_NS_IMAGE_BASE,
|
||||||
|
|
||||||
|
SET_STATIC_PARAM_HEAD(image_info, PARAM_EP,
|
||||||
|
VERSION_2, image_info_t, 0),
|
||||||
|
.image_info.image_base = PLAT_ARM_NS_IMAGE_BASE,
|
||||||
|
.image_info.image_max_size = ARM_DRAM1_BASE + ARM_DRAM1_SIZE
|
||||||
|
- PLAT_ARM_NS_IMAGE_BASE,
|
||||||
|
.next_handoff_image_id = INVALID_IMAGE_ID,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
REGISTER_BL_IMAGE_DESCS(bl2_mem_params_descs)
|
|
@ -0,0 +1,28 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2024, Arm Limited. All rights reserved.
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <drivers/arm/css/css_mhu_doorbell.h>
|
||||||
|
#include <drivers/arm/css/scmi.h>
|
||||||
|
|
||||||
|
static scmi_channel_plat_info_t plat_rd_scmi_info[] = {
|
||||||
|
{
|
||||||
|
.scmi_mbx_mem = CSS_SCMI_PAYLOAD_BASE,
|
||||||
|
.db_reg_addr = PLAT_CSS_MHU_BASE + MHU_V3_SENDER_REG_SET(0),
|
||||||
|
.db_preserve_mask = 0xfffffffe,
|
||||||
|
.db_modify_mask = 0x1,
|
||||||
|
.ring_doorbell = &mhu_ring_doorbell,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
scmi_channel_plat_info_t *plat_css_get_scmi_info(unsigned int channel_id)
|
||||||
|
{
|
||||||
|
return &plat_rd_scmi_info[channel_id];
|
||||||
|
}
|
||||||
|
|
||||||
|
const plat_psci_ops_t *plat_arm_psci_override_pm_ops(plat_psci_ops_t *ops)
|
||||||
|
{
|
||||||
|
return css_scmi_override_pm_ops(ops);
|
||||||
|
}
|
70
plat/arm/board/automotive_rd/platform/rd1ae/rd1ae_topology.c
Normal file
70
plat/arm/board/automotive_rd/platform/rd1ae/rd1ae_topology.c
Normal file
|
@ -0,0 +1,70 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2024, Arm Limited. All rights reserved.
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <plat/arm/common/plat_arm.h>
|
||||||
|
#include <plat/arm/css/common/css_pm.h>
|
||||||
|
|
||||||
|
/******************************************************************************
|
||||||
|
* The power domain tree descriptor.
|
||||||
|
*
|
||||||
|
* This descriptor defines the layout of the power domain tree for the RD1AE
|
||||||
|
* platform, which consists of 16 clusters.
|
||||||
|
******************************************************************************/
|
||||||
|
const unsigned char rd1_ae_pd_tree_desc[] = {
|
||||||
|
(PLAT_ARM_CLUSTER_COUNT),
|
||||||
|
PLAT_MAX_CPUS_PER_CLUSTER,
|
||||||
|
PLAT_MAX_CPUS_PER_CLUSTER,
|
||||||
|
PLAT_MAX_CPUS_PER_CLUSTER,
|
||||||
|
PLAT_MAX_CPUS_PER_CLUSTER,
|
||||||
|
PLAT_MAX_CPUS_PER_CLUSTER,
|
||||||
|
PLAT_MAX_CPUS_PER_CLUSTER,
|
||||||
|
PLAT_MAX_CPUS_PER_CLUSTER,
|
||||||
|
PLAT_MAX_CPUS_PER_CLUSTER,
|
||||||
|
PLAT_MAX_CPUS_PER_CLUSTER,
|
||||||
|
PLAT_MAX_CPUS_PER_CLUSTER,
|
||||||
|
PLAT_MAX_CPUS_PER_CLUSTER,
|
||||||
|
PLAT_MAX_CPUS_PER_CLUSTER,
|
||||||
|
PLAT_MAX_CPUS_PER_CLUSTER,
|
||||||
|
PLAT_MAX_CPUS_PER_CLUSTER,
|
||||||
|
PLAT_MAX_CPUS_PER_CLUSTER,
|
||||||
|
PLAT_MAX_CPUS_PER_CLUSTER,
|
||||||
|
};
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
* This function returns the topology tree information.
|
||||||
|
******************************************************************************/
|
||||||
|
const unsigned char *plat_get_power_domain_tree_desc(void)
|
||||||
|
{
|
||||||
|
return rd1_ae_pd_tree_desc;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
* The array mapping platform core position (implemented by plat_my_core_pos())
|
||||||
|
* to the SCMI power domain ID implemented by SCP.
|
||||||
|
******************************************************************************/
|
||||||
|
const uint32_t plat_css_core_pos_to_scmi_dmn_id_map[] = {
|
||||||
|
(SET_SCMI_CHANNEL_ID(0x0) | SET_SCMI_DOMAIN_ID(0x0)),
|
||||||
|
(SET_SCMI_CHANNEL_ID(0x0) | SET_SCMI_DOMAIN_ID(0x1)),
|
||||||
|
(SET_SCMI_CHANNEL_ID(0x0) | SET_SCMI_DOMAIN_ID(0x2)),
|
||||||
|
(SET_SCMI_CHANNEL_ID(0x0) | SET_SCMI_DOMAIN_ID(0x3)),
|
||||||
|
(SET_SCMI_CHANNEL_ID(0x0) | SET_SCMI_DOMAIN_ID(0x4)),
|
||||||
|
(SET_SCMI_CHANNEL_ID(0x0) | SET_SCMI_DOMAIN_ID(0x5)),
|
||||||
|
(SET_SCMI_CHANNEL_ID(0x0) | SET_SCMI_DOMAIN_ID(0x6)),
|
||||||
|
(SET_SCMI_CHANNEL_ID(0x0) | SET_SCMI_DOMAIN_ID(0x7)),
|
||||||
|
(SET_SCMI_CHANNEL_ID(0x0) | SET_SCMI_DOMAIN_ID(0x8)),
|
||||||
|
(SET_SCMI_CHANNEL_ID(0x0) | SET_SCMI_DOMAIN_ID(0x9)),
|
||||||
|
(SET_SCMI_CHANNEL_ID(0x0) | SET_SCMI_DOMAIN_ID(0xA)),
|
||||||
|
(SET_SCMI_CHANNEL_ID(0x0) | SET_SCMI_DOMAIN_ID(0xB)),
|
||||||
|
(SET_SCMI_CHANNEL_ID(0x0) | SET_SCMI_DOMAIN_ID(0xC)),
|
||||||
|
(SET_SCMI_CHANNEL_ID(0x0) | SET_SCMI_DOMAIN_ID(0xD)),
|
||||||
|
(SET_SCMI_CHANNEL_ID(0x0) | SET_SCMI_DOMAIN_ID(0xE)),
|
||||||
|
(SET_SCMI_CHANNEL_ID(0x0) | SET_SCMI_DOMAIN_ID(0xF)),
|
||||||
|
};
|
||||||
|
|
||||||
|
unsigned int plat_arm_get_cluster_core_count(u_register_t mpidr)
|
||||||
|
{
|
||||||
|
return PLAT_MAX_CPUS_PER_CLUSTER;
|
||||||
|
}
|
|
@ -294,7 +294,7 @@ endif
|
||||||
ifeq (${JUNO_AARCH32_EL3_RUNTIME},1)
|
ifeq (${JUNO_AARCH32_EL3_RUNTIME},1)
|
||||||
BL2_SOURCES += plat/arm/common/aarch32/arm_bl2_mem_params_desc.c
|
BL2_SOURCES += plat/arm/common/aarch32/arm_bl2_mem_params_desc.c
|
||||||
else
|
else
|
||||||
ifneq (${PLAT}, corstone1000)
|
ifeq ($(filter $(PLAT), corstone1000 rd1ae),)
|
||||||
BL2_SOURCES += plat/arm/common/${ARCH}/arm_bl2_mem_params_desc.c
|
BL2_SOURCES += plat/arm/common/${ARCH}/arm_bl2_mem_params_desc.c
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
Loading…
Add table
Reference in a new issue