13fc4124cSDan Handley /* 2*94f1c959SAlexei 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 13*94f1c959SAlexei Fedorov #error "FVP_CLUSTER_COUNT is not set in makefile" 140108047aSSoby Mathew #endif 15fe7210cdSJeenu Viswambharan 16fe7210cdSJeenu Viswambharan #ifndef FVP_MAX_CPUS_PER_CLUSTER 17*94f1c959SAlexei 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 21*94f1c959SAlexei 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 55f21c6321SAntonio Nino Diaz #define DEVICE1_BASE UL(0x2f000000) 56f21c6321SAntonio Nino Diaz #define DEVICE1_SIZE UL(0x200000) 57f21c6321SAntonio Nino Diaz #define NSRAM_BASE UL(0x2e000000) 58f21c6321SAntonio Nino Diaz #define NSRAM_SIZE UL(0x10000) 5971237876SSoby Mathew #endif 6095cfd4adSJuan Castillo /* Devices in the second GB */ 61f21c6321SAntonio Nino Diaz #define DEVICE2_BASE UL(0x7fe00000) 62f21c6321SAntonio Nino Diaz #define DEVICE2_SIZE UL(0x00200000) 6395cfd4adSJuan Castillo 64f21c6321SAntonio Nino Diaz #define PCIE_EXP_BASE UL(0x40000000) 65f21c6321SAntonio Nino Diaz #define TZRNG_BASE UL(0x7fe60000) 6648279d52SJuan Castillo 6748279d52SJuan Castillo /* Non-volatile counters */ 68f21c6321SAntonio Nino Diaz #define TRUSTED_NVCTR_BASE UL(0x7fe70000) 69f21c6321SAntonio Nino Diaz #define TFW_NVCTR_BASE (TRUSTED_NVCTR_BASE + UL(0x0000)) 70f21c6321SAntonio Nino Diaz #define TFW_NVCTR_SIZE UL(4) 71f21c6321SAntonio Nino Diaz #define NTFW_CTR_BASE (TRUSTED_NVCTR_BASE + UL(0x0004)) 72f21c6321SAntonio Nino Diaz #define NTFW_CTR_SIZE UL(4) 7395cfd4adSJuan Castillo 7495cfd4adSJuan Castillo /* Keys */ 75f21c6321SAntonio Nino Diaz #define SOC_KEYS_BASE UL(0x7fe80000) 76f21c6321SAntonio Nino Diaz #define TZ_PUB_KEY_HASH_BASE (SOC_KEYS_BASE + UL(0x0000)) 77f21c6321SAntonio Nino Diaz #define TZ_PUB_KEY_HASH_SIZE UL(32) 78f21c6321SAntonio Nino Diaz #define HU_KEY_BASE (SOC_KEYS_BASE + UL(0x0020)) 79f21c6321SAntonio Nino Diaz #define HU_KEY_SIZE UL(16) 80f21c6321SAntonio Nino Diaz #define END_KEY_BASE (SOC_KEYS_BASE + UL(0x0044)) 81f21c6321SAntonio Nino Diaz #define END_KEY_SIZE UL(32) 823fc4124cSDan Handley 833fc4124cSDan Handley /* Constants to distinguish FVP type */ 84f21c6321SAntonio Nino Diaz #define HBI_BASE_FVP U(0x020) 85f21c6321SAntonio Nino Diaz #define REV_BASE_FVP_V0 U(0x0) 86f21c6321SAntonio Nino Diaz #define REV_BASE_FVP_REVC U(0x2) 873fc4124cSDan Handley 88f21c6321SAntonio Nino Diaz #define HBI_FOUNDATION_FVP U(0x010) 89f21c6321SAntonio Nino Diaz #define REV_FOUNDATION_FVP_V2_0 U(0x0) 90f21c6321SAntonio Nino Diaz #define REV_FOUNDATION_FVP_V2_1 U(0x1) 91f21c6321SAntonio Nino Diaz #define REV_FOUNDATION_FVP_v9_1 U(0x2) 92f21c6321SAntonio Nino Diaz #define REV_FOUNDATION_FVP_v9_6 U(0x3) 933fc4124cSDan Handley 94f21c6321SAntonio Nino Diaz #define BLD_GIC_VE_MMAP U(0x0) 95f21c6321SAntonio Nino Diaz #define BLD_GIC_A53A57_MMAP U(0x1) 963fc4124cSDan Handley 97f21c6321SAntonio Nino Diaz #define ARCH_MODEL U(0x1) 983fc4124cSDan Handley 993fc4124cSDan Handley /* FVP Power controller base address*/ 100e02f469fSSathees Balya #define PWRC_BASE UL(0x1c100000) 1013fc4124cSDan Handley 102b49b3221SRyan Harkin /* FVP SP804 timer frequency is 35 MHz*/ 103540a5ba8SJuan Castillo #define SP804_TIMER_CLKMULT 1 104540a5ba8SJuan Castillo #define SP804_TIMER_CLKDIV 35 105540a5ba8SJuan Castillo 106540a5ba8SJuan Castillo /* SP810 controller. FVP specific flags */ 107f21c6321SAntonio Nino Diaz #define FVP_SP810_CTRL_TIM0_OV BIT_32(16) 108f21c6321SAntonio Nino Diaz #define FVP_SP810_CTRL_TIM1_OV BIT_32(18) 109f21c6321SAntonio Nino Diaz #define FVP_SP810_CTRL_TIM2_OV BIT_32(20) 110f21c6321SAntonio Nino Diaz #define FVP_SP810_CTRL_TIM3_OV BIT_32(22) 1113fc4124cSDan Handley 1123fc4124cSDan Handley /******************************************************************************* 1133fc4124cSDan Handley * GIC-400 & interrupt handling related constants 1143fc4124cSDan Handley ******************************************************************************/ 1153fc4124cSDan Handley /* VE compatible GIC memory map */ 116f21c6321SAntonio Nino Diaz #define VE_GICD_BASE UL(0x2c001000) 117f21c6321SAntonio Nino Diaz #define VE_GICC_BASE UL(0x2c002000) 118f21c6321SAntonio Nino Diaz #define VE_GICH_BASE UL(0x2c004000) 119f21c6321SAntonio Nino Diaz #define VE_GICV_BASE UL(0x2c006000) 1203fc4124cSDan Handley 1213fc4124cSDan Handley /* Base FVP compatible GIC memory map */ 122f21c6321SAntonio Nino Diaz #define BASE_GICD_BASE UL(0x2f000000) 123f21c6321SAntonio Nino Diaz #define BASE_GICR_BASE UL(0x2f100000) 124f21c6321SAntonio Nino Diaz #define BASE_GICC_BASE UL(0x2c000000) 125f21c6321SAntonio Nino Diaz #define BASE_GICH_BASE UL(0x2c010000) 126f21c6321SAntonio Nino Diaz #define BASE_GICV_BASE UL(0x2c02f000) 1273fc4124cSDan Handley 128a7270d35SVikram Kanigiri #define FVP_IRQ_TZ_WDOG 56 129a7270d35SVikram Kanigiri #define FVP_IRQ_SEC_SYS_TIMER 57 1303fc4124cSDan Handley 1313fc4124cSDan Handley 1323fc4124cSDan Handley /******************************************************************************* 1333fc4124cSDan Handley * TrustZone address space controller related constants 1343fc4124cSDan Handley ******************************************************************************/ 1353fc4124cSDan Handley 1363fc4124cSDan Handley /* NSAIDs used by devices in TZC filter 0 on FVP */ 1373fc4124cSDan Handley #define FVP_NSAID_DEFAULT 0 1383fc4124cSDan Handley #define FVP_NSAID_PCI 1 1393fc4124cSDan Handley #define FVP_NSAID_VIRTIO 8 /* from FVP v5.6 onwards */ 1403fc4124cSDan Handley #define FVP_NSAID_AP 9 /* Application Processors */ 1413fc4124cSDan Handley #define FVP_NSAID_VIRTIO_OLD 15 /* until FVP v5.5 */ 1423fc4124cSDan Handley 1433fc4124cSDan Handley /* NSAIDs used by devices in TZC filter 2 on FVP */ 1443fc4124cSDan Handley #define FVP_NSAID_HDLCD0 2 1453fc4124cSDan Handley #define FVP_NSAID_CLCD 7 1463fc4124cSDan Handley 147e237c1baSRoberto Vargas /******************************************************************************* 148e237c1baSRoberto Vargas * Memprotect definitions 149e237c1baSRoberto Vargas ******************************************************************************/ 150e237c1baSRoberto Vargas /* PSCI memory protect definitions: 151e237c1baSRoberto Vargas * This variable is stored in a non-secure flash because some ARM reference 152e237c1baSRoberto Vargas * platforms do not have secure NVRAM. Real systems that provided MEM_PROTECT 153e237c1baSRoberto Vargas * support must use a secure NVRAM to store the PSCI MEM_PROTECT definitions. 154e237c1baSRoberto Vargas */ 155e237c1baSRoberto Vargas #define PLAT_ARM_MEM_PROT_ADDR (V2M_FLASH0_BASE + \ 156e237c1baSRoberto Vargas V2M_FLASH0_SIZE - V2M_FLASH_BLOCK_SIZE) 157e237c1baSRoberto Vargas 1581083b2b3SAntonio Nino Diaz #endif /* FVP_DEF_H */ 159