diff --git a/fdts/tc.dts b/fdts/tc.dts index 09cf21d14..4b601894b 100644 --- a/fdts/tc.dts +++ b/fdts/tc.dts @@ -348,6 +348,13 @@ }; }; + memory { + device_type = "memory"; + reg = <0x0 TC_NS_DRAM1_BASE 0x0 TC_NS_DRAM1_SIZE>, + ; + }; + psci { compatible = "arm,psci-1.0", "arm,psci-0.2"; method = "smc"; @@ -367,11 +374,11 @@ sram: sram@6000000 { compatible = "mmio-sram"; - reg = <0x0 0x06000000 0x0 0x8000>; + reg = <0x0 PLAT_ARM_NSRAM_BASE 0x0 PLAT_ARM_NSRAM_SIZE>; #address-cells = <1>; #size-cells = <1>; - ranges = <0 0x0 0x06000000 0x8000>; + ranges = <0 0x0 PLAT_ARM_NSRAM_BASE PLAT_ARM_NSRAM_SIZE>; cpu_scp_scmi_mem: scp-shmem@0 { compatible = "arm,scmi-shmem"; diff --git a/include/lib/utils_def.h b/include/lib/utils_def.h index a170a09d2..8a03c7db9 100644 --- a/include/lib/utils_def.h +++ b/include/lib/utils_def.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2023, Arm Limited and Contributors. All rights reserved. + * Copyright (c) 2016-2024, Arm Limited and Contributors. All rights reserved. * Copyright (c) 2020, NVIDIA Corporation. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause @@ -53,6 +53,9 @@ #define GENMASK GENMASK_32 #endif +#define HI(addr) (addr >> 32) +#define LO(addr) (addr & 0xffffffff) + /* * This variant of div_round_up can be used in macro definition but should not * be used in C code as the `div` parameter is evaluated twice. diff --git a/plat/arm/board/tc/include/platform_def.h b/plat/arm/board/tc/include/platform_def.h index 643cf1336..86fbf4936 100644 --- a/plat/arm/board/tc/include/platform_def.h +++ b/plat/arm/board/tc/include/platform_def.h @@ -44,7 +44,7 @@ */ #define TC_TZC_DRAM1_BASE (ARM_AP_TZC_DRAM1_BASE - \ TC_TZC_DRAM1_SIZE) -#define TC_TZC_DRAM1_SIZE 96 * SZ_1M /* 96 MB */ +#define TC_TZC_DRAM1_SIZE (96 * SZ_1M) /* 96 MB */ #define TC_TZC_DRAM1_END (TC_TZC_DRAM1_BASE + \ TC_TZC_DRAM1_SIZE - 1) @@ -52,8 +52,8 @@ #define TC_NS_DRAM1_SIZE (ARM_DRAM1_SIZE - \ ARM_TZC_DRAM1_SIZE - \ TC_TZC_DRAM1_SIZE) -#define TC_NS_DRAM1_END (TC_NS_DRAM1_BASE + \ - TC_NS_DRAM1_SIZE - 1) +#define TC_NS_DRAM1_END (TC_NS_DRAM1_BASE + TC_NS_DRAM1_SIZE - 1) + /* * Mappings for TC DRAM1 (non-secure) and TC TZC DRAM1 (secure) @@ -225,6 +225,10 @@ #define PLAT_ARM_DRAM2_SIZE ULL(0x180000000) #define PLAT_ARM_DRAM2_END (PLAT_ARM_DRAM2_BASE + PLAT_ARM_DRAM2_SIZE - 1ULL) +#define TC_NS_MTE_SIZE (256 * SZ_1M) +/* the SCP puts the carveout at the end of DRAM2 */ +#define TC_NS_DRAM2_SIZE (PLAT_ARM_DRAM2_SIZE - TC_NS_MTE_SIZE) + #define PLAT_ARM_G1S_IRQ_PROPS(grp) CSS_G1S_INT_PROPS(grp) #define PLAT_ARM_G0_IRQ_PROPS(grp) ARM_G0_IRQ_PROPS(grp), \ INTR_PROP_DESC(SBSA_SECURE_WDOG_INTID, \