13fc4124cSDan Handley /* 294f1c959SAlexei Fedorov * Copyright (c) 2014-2020, ARM Limited and Contributors. All rights reserved. 33fc4124cSDan Handley * 482cb2c1aSdp-arm * SPDX-License-Identifier: BSD-3-Clause 53fc4124cSDan Handley */ 63fc4124cSDan Handley 71083b2b3SAntonio Nino Diaz #ifndef FVP_DEF_H 81083b2b3SAntonio Nino Diaz #define FVP_DEF_H 91083b2b3SAntonio Nino Diaz 1009d40e0eSAntonio Nino Diaz #include <lib/utils_def.h> 113fc4124cSDan Handley 120108047aSSoby Mathew #ifndef FVP_CLUSTER_COUNT 1394f1c959SAlexei Fedorov #error "FVP_CLUSTER_COUNT is not set in makefile" 140108047aSSoby Mathew #endif 15fe7210cdSJeenu Viswambharan 16fe7210cdSJeenu Viswambharan #ifndef FVP_MAX_CPUS_PER_CLUSTER 1794f1c959SAlexei Fedorov #error "FVP_MAX_CPUS_PER_CLUSTER is not set in makefile" 18fe7210cdSJeenu Viswambharan #endif 193fc4124cSDan Handley 2011ad8f20SJeenu Viswambharan #ifndef FVP_MAX_PE_PER_CPU 2194f1c959SAlexei Fedorov #error "FVP_MAX_PE_PER_CPU is not set in makefile" 2211ad8f20SJeenu Viswambharan #endif 2311ad8f20SJeenu Viswambharan 243fc4124cSDan Handley #define FVP_PRIMARY_CPU 0x0 253fc4124cSDan Handley 2671237876SSoby Mathew /* Defines for the Interconnect build selection */ 2771237876SSoby Mathew #define FVP_CCI 1 2871237876SSoby Mathew #define FVP_CCN 2 2971237876SSoby Mathew 303fc4124cSDan Handley /******************************************************************************* 313fc4124cSDan Handley * FVP memory map related constants 323fc4124cSDan Handley ******************************************************************************/ 333fc4124cSDan Handley 34f21c6321SAntonio Nino Diaz #define FLASH1_BASE UL(0x0c000000) 35f21c6321SAntonio Nino Diaz #define FLASH1_SIZE UL(0x04000000) 363fc4124cSDan Handley 37f21c6321SAntonio Nino Diaz #define PSRAM_BASE UL(0x14000000) 38f21c6321SAntonio Nino Diaz #define PSRAM_SIZE UL(0x04000000) 393fc4124cSDan Handley 40f21c6321SAntonio Nino Diaz #define VRAM_BASE UL(0x18000000) 41f21c6321SAntonio Nino Diaz #define VRAM_SIZE UL(0x02000000) 423fc4124cSDan Handley 433fc4124cSDan Handley /* Aggregate of all devices in the first GB */ 44f21c6321SAntonio Nino Diaz #define DEVICE0_BASE UL(0x20000000) 45f21c6321SAntonio Nino Diaz #define DEVICE0_SIZE UL(0x0c200000) 463fc4124cSDan Handley 4771237876SSoby Mathew /* 4871237876SSoby Mathew * In case of FVP models with CCN, the CCN register space overlaps into 4971237876SSoby Mathew * the NSRAM area. 5071237876SSoby Mathew */ 5171237876SSoby Mathew #if FVP_INTERCONNECT_DRIVER == FVP_CCN 52f21c6321SAntonio Nino Diaz #define DEVICE1_BASE UL(0x2e000000) 53f21c6321SAntonio Nino Diaz #define DEVICE1_SIZE UL(0x1A00000) 5471237876SSoby Mathew #else 55b3c431f3SAlexei Fedorov #define DEVICE1_BASE BASE_GICD_BASE 56*e6e10eccSAlexei Fedorov 57*e6e10eccSAlexei Fedorov #if GIC_ENABLE_V4_EXTN 58*e6e10eccSAlexei Fedorov /* GICv4 mapping: GICD + CORE_COUNT * 256KB */ 59*e6e10eccSAlexei Fedorov #define DEVICE1_SIZE ((BASE_GICR_BASE - BASE_GICD_BASE) + \ 60*e6e10eccSAlexei Fedorov (PLATFORM_CORE_COUNT * 0x40000)) 61*e6e10eccSAlexei Fedorov #else 62*e6e10eccSAlexei Fedorov /* GICv2 and GICv3 mapping: GICD + CORE_COUNT * 128KB */ 63b3c431f3SAlexei Fedorov #define DEVICE1_SIZE ((BASE_GICR_BASE - BASE_GICD_BASE) + \ 64b3c431f3SAlexei Fedorov (PLATFORM_CORE_COUNT * 0x20000)) 65*e6e10eccSAlexei Fedorov #endif /* GIC_ENABLE_V4_EXTN */ 66*e6e10eccSAlexei Fedorov 67f21c6321SAntonio Nino Diaz #define NSRAM_BASE UL(0x2e000000) 68f21c6321SAntonio Nino Diaz #define NSRAM_SIZE UL(0x10000) 6971237876SSoby Mathew #endif 7095cfd4adSJuan Castillo /* Devices in the second GB */ 71f21c6321SAntonio Nino Diaz #define DEVICE2_BASE UL(0x7fe00000) 72f21c6321SAntonio Nino Diaz #define DEVICE2_SIZE UL(0x00200000) 7395cfd4adSJuan Castillo 74f21c6321SAntonio Nino Diaz #define PCIE_EXP_BASE UL(0x40000000) 75f21c6321SAntonio Nino Diaz #define TZRNG_BASE UL(0x7fe60000) 7648279d52SJuan Castillo 7748279d52SJuan Castillo /* Non-volatile counters */ 78f21c6321SAntonio Nino Diaz #define TRUSTED_NVCTR_BASE UL(0x7fe70000) 79f21c6321SAntonio Nino Diaz #define TFW_NVCTR_BASE (TRUSTED_NVCTR_BASE + UL(0x0000)) 80f21c6321SAntonio Nino Diaz #define TFW_NVCTR_SIZE UL(4) 81f21c6321SAntonio Nino Diaz #define NTFW_CTR_BASE (TRUSTED_NVCTR_BASE + UL(0x0004)) 82f21c6321SAntonio Nino Diaz #define NTFW_CTR_SIZE UL(4) 8395cfd4adSJuan Castillo 8495cfd4adSJuan Castillo /* Keys */ 85f21c6321SAntonio Nino Diaz #define SOC_KEYS_BASE UL(0x7fe80000) 86f21c6321SAntonio Nino Diaz #define TZ_PUB_KEY_HASH_BASE (SOC_KEYS_BASE + UL(0x0000)) 87f21c6321SAntonio Nino Diaz #define TZ_PUB_KEY_HASH_SIZE UL(32) 88f21c6321SAntonio Nino Diaz #define HU_KEY_BASE (SOC_KEYS_BASE + UL(0x0020)) 89f21c6321SAntonio Nino Diaz #define HU_KEY_SIZE UL(16) 90f21c6321SAntonio Nino Diaz #define END_KEY_BASE (SOC_KEYS_BASE + UL(0x0044)) 91f21c6321SAntonio Nino Diaz #define END_KEY_SIZE UL(32) 923fc4124cSDan Handley 933fc4124cSDan Handley /* Constants to distinguish FVP type */ 94f21c6321SAntonio Nino Diaz #define HBI_BASE_FVP U(0x020) 95f21c6321SAntonio Nino Diaz #define REV_BASE_FVP_V0 U(0x0) 96f21c6321SAntonio Nino Diaz #define REV_BASE_FVP_REVC U(0x2) 973fc4124cSDan Handley 98f21c6321SAntonio Nino Diaz #define HBI_FOUNDATION_FVP U(0x010) 99f21c6321SAntonio Nino Diaz #define REV_FOUNDATION_FVP_V2_0 U(0x0) 100f21c6321SAntonio Nino Diaz #define REV_FOUNDATION_FVP_V2_1 U(0x1) 101f21c6321SAntonio Nino Diaz #define REV_FOUNDATION_FVP_v9_1 U(0x2) 102f21c6321SAntonio Nino Diaz #define REV_FOUNDATION_FVP_v9_6 U(0x3) 1033fc4124cSDan Handley 104f21c6321SAntonio Nino Diaz #define BLD_GIC_VE_MMAP U(0x0) 105f21c6321SAntonio Nino Diaz #define BLD_GIC_A53A57_MMAP U(0x1) 1063fc4124cSDan Handley 107f21c6321SAntonio Nino Diaz #define ARCH_MODEL U(0x1) 1083fc4124cSDan Handley 1093fc4124cSDan Handley /* FVP Power controller base address*/ 110e02f469fSSathees Balya #define PWRC_BASE UL(0x1c100000) 1113fc4124cSDan Handley 112b49b3221SRyan Harkin /* FVP SP804 timer frequency is 35 MHz*/ 113540a5ba8SJuan Castillo #define SP804_TIMER_CLKMULT 1 114540a5ba8SJuan Castillo #define SP804_TIMER_CLKDIV 35 115540a5ba8SJuan Castillo 116540a5ba8SJuan Castillo /* SP810 controller. FVP specific flags */ 117f21c6321SAntonio Nino Diaz #define FVP_SP810_CTRL_TIM0_OV BIT_32(16) 118f21c6321SAntonio Nino Diaz #define FVP_SP810_CTRL_TIM1_OV BIT_32(18) 119f21c6321SAntonio Nino Diaz #define FVP_SP810_CTRL_TIM2_OV BIT_32(20) 120f21c6321SAntonio Nino Diaz #define FVP_SP810_CTRL_TIM3_OV BIT_32(22) 1213fc4124cSDan Handley 1223fc4124cSDan Handley /******************************************************************************* 123b3c431f3SAlexei Fedorov * GIC & interrupt handling related constants 1243fc4124cSDan Handley ******************************************************************************/ 1253fc4124cSDan Handley /* VE compatible GIC memory map */ 126f21c6321SAntonio Nino Diaz #define VE_GICD_BASE UL(0x2c001000) 127f21c6321SAntonio Nino Diaz #define VE_GICC_BASE UL(0x2c002000) 128f21c6321SAntonio Nino Diaz #define VE_GICH_BASE UL(0x2c004000) 129f21c6321SAntonio Nino Diaz #define VE_GICV_BASE UL(0x2c006000) 1303fc4124cSDan Handley 1313fc4124cSDan Handley /* Base FVP compatible GIC memory map */ 132f21c6321SAntonio Nino Diaz #define BASE_GICD_BASE UL(0x2f000000) 133f21c6321SAntonio Nino Diaz #define BASE_GICR_BASE UL(0x2f100000) 134f21c6321SAntonio Nino Diaz #define BASE_GICC_BASE UL(0x2c000000) 135f21c6321SAntonio Nino Diaz #define BASE_GICH_BASE UL(0x2c010000) 136f21c6321SAntonio Nino Diaz #define BASE_GICV_BASE UL(0x2c02f000) 1373fc4124cSDan Handley 138a7270d35SVikram Kanigiri #define FVP_IRQ_TZ_WDOG 56 139a7270d35SVikram Kanigiri #define FVP_IRQ_SEC_SYS_TIMER 57 1403fc4124cSDan Handley 1413fc4124cSDan Handley /******************************************************************************* 1423fc4124cSDan Handley * TrustZone address space controller related constants 1433fc4124cSDan Handley ******************************************************************************/ 1443fc4124cSDan Handley 1453fc4124cSDan Handley /* NSAIDs used by devices in TZC filter 0 on FVP */ 1463fc4124cSDan Handley #define FVP_NSAID_DEFAULT 0 1473fc4124cSDan Handley #define FVP_NSAID_PCI 1 1483fc4124cSDan Handley #define FVP_NSAID_VIRTIO 8 /* from FVP v5.6 onwards */ 1493fc4124cSDan Handley #define FVP_NSAID_AP 9 /* Application Processors */ 1503fc4124cSDan Handley #define FVP_NSAID_VIRTIO_OLD 15 /* until FVP v5.5 */ 1513fc4124cSDan Handley 1523fc4124cSDan Handley /* NSAIDs used by devices in TZC filter 2 on FVP */ 1533fc4124cSDan Handley #define FVP_NSAID_HDLCD0 2 1543fc4124cSDan Handley #define FVP_NSAID_CLCD 7 1553fc4124cSDan Handley 156e237c1baSRoberto Vargas /******************************************************************************* 157e237c1baSRoberto Vargas * Memprotect definitions 158e237c1baSRoberto Vargas ******************************************************************************/ 159e237c1baSRoberto Vargas /* PSCI memory protect definitions: 160e237c1baSRoberto Vargas * This variable is stored in a non-secure flash because some ARM reference 161e237c1baSRoberto Vargas * platforms do not have secure NVRAM. Real systems that provided MEM_PROTECT 162e237c1baSRoberto Vargas * support must use a secure NVRAM to store the PSCI MEM_PROTECT definitions. 163e237c1baSRoberto Vargas */ 164e237c1baSRoberto Vargas #define PLAT_ARM_MEM_PROT_ADDR (V2M_FLASH0_BASE + \ 165e237c1baSRoberto Vargas V2M_FLASH0_SIZE - V2M_FLASH_BLOCK_SIZE) 166e237c1baSRoberto Vargas 1671083b2b3SAntonio Nino Diaz #endif /* FVP_DEF_H */ 168