mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-16 09:34:18 +00:00
feat(versal): add tsp support
Introduces support for the Test Secure Payload (TSP) for AMD-Xilinx Versal platform. TSP is a component for testing and validating secure OS and trusted execution environments. If a BL32 image is present, then there must be a matching Secure- EL1 Payload Dispatcher (SPD) service called TSPD, this service is responsible for Initializing the TSP. During initialization that service must register a function to carry out initialization of BL32 once the runtime services are fully initialized. BL31 invokes such a registered function to initialize BL32 before running BL33. The GICv3 driver is initialized in EL3 and does not need to be initialized again in SEL1 GICv3 driver is initialized in EL3 This is because the S-EL1 can use GIC system registers to manage interrupts and does not need GIC interface base addresses to be configured. The secure code load address is initially being pointed to 0x0 in the handoff parameters, which is different from the default or user-provided load address of 0x60000000. In this case, set up the PC to the requested BL32_BASE address to ensure that the secure code is loaded and executed from the correct location. Change-Id: Ida0fc6467a10bfde8927ff9b3755a83f3e16f068 Signed-off-by: Prasad Kummari <prasad.kummari@amd.com>
This commit is contained in:
parent
0561070ebf
commit
7ff4d4fbe5
4 changed files with 41 additions and 0 deletions
|
@ -7,6 +7,7 @@
|
|||
|
||||
#include <common/bl_common.h>
|
||||
#include <common/debug.h>
|
||||
#include <drivers/arm/pl011.h>
|
||||
#include <drivers/console.h>
|
||||
#include <plat/arm/common/plat_arm.h>
|
||||
#include <platform_tsp.h>
|
||||
|
@ -25,10 +26,18 @@ void tsp_early_platform_setup(void)
|
|||
static console_t tsp_boot_console;
|
||||
int32_t rc;
|
||||
|
||||
#if defined(PLAT_zynqmp)
|
||||
rc = console_cdns_register((uintptr_t)UART_BASE,
|
||||
(uint32_t)get_uart_clk(),
|
||||
(uint32_t)UART_BAUDRATE,
|
||||
&tsp_boot_console);
|
||||
#else
|
||||
rc = console_pl011_register((uintptr_t)UART_BASE,
|
||||
(uint32_t)get_uart_clk(),
|
||||
(uint32_t)UART_BAUDRATE,
|
||||
&tsp_boot_console);
|
||||
#endif
|
||||
|
||||
if (rc == 0) {
|
||||
panic();
|
||||
}
|
||||
|
@ -42,8 +51,16 @@ void tsp_early_platform_setup(void)
|
|||
******************************************************************************/
|
||||
void tsp_platform_setup(void)
|
||||
{
|
||||
/*
|
||||
* For ZynqMP, the GICv2 driver needs to be initialized in S-EL1,
|
||||
* and for other platforms, the GICv3 driver is initialized in EL3.
|
||||
* This is because S-EL1 can use GIC system registers to manage
|
||||
* interrupts and does not need to be initialized again in SEL1.
|
||||
*/
|
||||
#if defined(PLAT_zynqmp)
|
||||
plat_arm_gic_driver_init();
|
||||
plat_arm_gic_init();
|
||||
#endif
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
|
|
|
@ -115,6 +115,19 @@ void bl31_early_platform_setup2(u_register_t arg0, u_register_t arg1,
|
|||
panic();
|
||||
} else {
|
||||
INFO("BL31: PLM to TF-A handover success %u\n", ret);
|
||||
|
||||
/*
|
||||
* The BL32 load address is indicated as 0x0 in the handoff
|
||||
* parameters, which is different from the default/user-provided
|
||||
* load address of 0x60000000 but the flags are correctly
|
||||
* configured. Consequently, in this scenario, set the PC
|
||||
* to the requested BL32_BASE address.
|
||||
*/
|
||||
|
||||
/* TODO: Remove the following check once this is fixed from PLM */
|
||||
if (bl32_image_ep_info.pc == 0 && bl32_image_ep_info.spsr != 0) {
|
||||
bl32_image_ep_info.pc = (uintptr_t)BL32_BASE;
|
||||
}
|
||||
}
|
||||
|
||||
NOTICE("BL31: Secure code at 0x%lx\n", bl32_image_ep_info.pc);
|
||||
|
|
|
@ -48,6 +48,7 @@
|
|||
* IRQ constants
|
||||
******************************************************************************/
|
||||
#define VERSAL_IRQ_SEC_PHY_TIMER U(29)
|
||||
#define ARM_IRQ_SEC_PHY_TIMER 29
|
||||
|
||||
/*******************************************************************************
|
||||
* CCI-400 related constants
|
||||
|
|
10
plat/xilinx/versal/tsp/tsp-versal.mk
Normal file
10
plat/xilinx/versal/tsp/tsp-versal.mk
Normal file
|
@ -0,0 +1,10 @@
|
|||
#
|
||||
# Copyright (c) 2023, Advanced Micro Devices, Inc. All rights reserved.
|
||||
#
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
# TSP source files specific to Versal platform
|
||||
|
||||
PLAT_XILINX_COMMON := plat/xilinx/common/
|
||||
|
||||
include ${PLAT_XILINX_COMMON}/tsp/tsp.mk
|
Loading…
Add table
Reference in a new issue