Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions platform/ext/target/arm/corstone1000/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,37 @@ target_sources(tfm_spm
$<$<BOOL:${TFM_S_REG_TEST}>:${CMAKE_CURRENT_SOURCE_DIR}/target_cfg.c>
)

#========================= DSU-120T ============================================#
if (CORSTONE1000_DSU_120T)
target_sources(tfm_psa_rot_partition_ns_agent_mailbox
PUBLIC
dsu-120t/ppu.c
)

target_compile_definitions(tfm_psa_rot_partition_ns_agent_mailbox
PUBLIC
CORSTONE1000_DSU_120T
)

target_compile_definitions(platform_bl1_1
PUBLIC
CORSTONE1000_DSU_120T
)

target_include_directories(tfm_psa_rot_partition_ns_agent_mailbox
PUBLIC
dsu-120t
)
endif()

#========================= Ethos-U NPU =========================================#
if (CORSTONE1000_CORTEX_A320)
target_compile_definitions(platform_bl1_1
PUBLIC
CORSTONE1000_CORTEX_A320
)
endif()

#========================= tfm_adac ============================================#

if (${PLATFORM_PSA_ADAC_SECURE_DEBUG})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/*
* Copyright (c) 2017-2024 Arm Limited. All rights reserved.
* SPDX-FileCopyrightText: Copyright The TrustedFirmware-M Contributors
*
* SPDX-License-Identifier: BSD-3-Clause
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -79,6 +81,10 @@
#define CORSTONE1000_HOST_AXI_QSPI_CTRL_REG_BASE_SE_SECURE_FLASH (0x90010000U) /* AXI QSPI Controller for SE FLash */
#define CORSTONE1000_HOST_DRAM_UEFI_CAPSULE (0xA0000000U) /* 1.5 GB DDR */

#ifdef CORSTONE1000_DSU_120T
#define CORSTONE1000_HOST_DSU_120T_BASE (0xC0910000U) /* DSU-120T PPU */
#endif

/* Map Component definitions to Corstone definitions */
#define CC3XX_BASE_S CORSTONE1000_CRYPTO_ACCELERATOR_BASE

Expand Down
50 changes: 49 additions & 1 deletion platform/ext/target/arm/corstone1000/bl1/boot_hal_bl1_1.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019-2024, Arm Limited. All rights reserved.
* SPDX-FileCopyrightText: Copyright The TrustedFirmware-M Contributors
*
* SPDX-License-Identifier: BSD-3-Clause
*
Expand Down Expand Up @@ -48,6 +48,15 @@ REGION_DECLARE(Image$$, ARM_LIB_HEAP, $$ZI$$Limit)[];
#define HOST_SE_SECURE_FLASH_BASE_FVP 0x60010000
#define HOST_AXI_QSPI_CTRL_REG_BASE_SE_SECURE_FLASH 0x60010000

#ifdef CORSTONE1000_DSU_120T
#define HOST_DSU_120T_BASE 0x60910000
#endif

#ifdef CORSTONE1000_CORTEX_A320
#define HOST_SECURE_SRAM_SIZE 0x400000
#define HOST_NONSECURE_SRAM_BASE (HOST_TRUSTED_RAM_BASE + HOST_SECURE_SRAM_SIZE)
#endif

#define HOST_DRAM_BASE 0x80000000
#define HOST_DRAM_UEFI_CAPSULE 0x80000000

Expand Down Expand Up @@ -286,6 +295,25 @@ static void setup_se_firewall(void)
fc_enable_regions();
#endif

#ifdef CORSTONE1000_DSU_120T
#if (PLATFORM_IS_FVP)
fc_select_region(7);
fc_disable_regions();
fc_disable_mpe(RGN_MPE0);
fc_prog_rgn(RGN_SIZE_16MB, CORSTONE1000_HOST_DSU_120T_BASE);
fc_prog_rgn_upper_addr(HOST_DSU_120T_BASE);
fc_enable_addr_trans();
fc_init_mpl(RGN_MPE0);

mpl_rights = (RGN_MPL_SECURE_READ_MASK |
RGN_MPL_SECURE_WRITE_MASK);

fc_enable_mpl(RGN_MPE0, mpl_rights);
fc_prog_mid(RGN_MPE0, SE_MID);
fc_enable_mpe(RGN_MPE0);
fc_enable_regions();
#endif
#endif
fc_pe_enable();
}

Expand Down Expand Up @@ -369,6 +397,26 @@ static void setup_host_firewall(void)
fc_enable_regions();
fc_rgn_lock();

#ifdef CORSTONE1000_CORTEX_A320
/* CVM - Non Secure RAM */
fc_select_region(2);
fc_disable_regions();
fc_disable_mpe(RGN_MPE0);
fc_prog_rgn(RGN_SIZE_4MB, HOST_NONSECURE_SRAM_BASE);
fc_init_mpl(RGN_MPE0);

mpl_rights = (RGN_MPL_ANY_MST_MASK | RGN_MPL_NONSECURE_READ_MASK |
RGN_MPL_NONSECURE_WRITE_MASK |
RGN_MPL_NONSECURE_EXECUTE_MASK);

fc_enable_mpl(RGN_MPE0, mpl_rights);
fc_disable_mpl(RGN_MPE0, ~mpl_rights);

fc_enable_mpe(RGN_MPE0);
fc_enable_regions();
fc_rgn_lock();
#endif

fc_pe_enable();

/* DDR */
Expand Down
40 changes: 40 additions & 0 deletions platform/ext/target/arm/corstone1000/dsu-120t/ppu.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* SPDX-FileCopyrightText: Copyright The TrustedFirmware-M Contributors
*
* SPDX-License-Identifier: BSD-3-Clause
*
*/

#include <stdint.h>
#include "ppu.h"

void PPU_SetPowerPolicy(PPU_TypeDef *ppu, PPU_PowerPolicy_Type policy, bool isDynamic)
{
uint32_t regval = ppu->PWPR;

regval &= ~(PPU_PWPR_PWR_POLICY_Msk | PPU_PWPR_PWR_DYN_EN_Msk);

regval |= ((policy << PPU_PWPR_PWR_POLICY_Pos) & PPU_PWPR_PWR_POLICY_Msk);

if (isDynamic) {
regval |= PPU_PWPR_PWR_DYN_EN_Msk;
}

ppu->PWPR = regval;
}

void PPU_SetOperatingPolicy(PPU_TypeDef *ppu, PPU_OperatingPolicy_Type policy, bool isDynamic)
{
uint32_t regval = ppu->PWPR;

regval &= ~(PPU_PWPR_OP_POLICY_Msk | PPU_PWPR_OP_DYN_EN_Msk);

regval |= ((policy << PPU_PWPR_OP_POLICY_Pos) & PPU_PWPR_OP_POLICY_Msk);

if (isDynamic) {
regval |= PPU_PWPR_OP_DYN_EN_Msk;
}

ppu->PWPR = regval;
}

Loading