Arunachalam Ganapathy | a5b1776 | 2020-04-27 14:33:00 +0100 | [diff] [blame] | 1 | /* |
Usama Arif | 6ddc37f | 2021-01-17 18:05:08 +0000 | [diff] [blame] | 2 | * Copyright (c) 2020-2021, Arm Limited. All rights reserved. |
Arunachalam Ganapathy | a5b1776 | 2020-04-27 14:33:00 +0100 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
| 6 | #include <arch.h> |
| 7 | |
| 8 | #ifndef PLATFORM_DEF_H |
| 9 | #define PLATFORM_DEF_H |
| 10 | |
| 11 | /* Platform binary types for linking */ |
| 12 | #define PLATFORM_LINKER_FORMAT "elf64-littleaarch64" |
| 13 | #define PLATFORM_LINKER_ARCH aarch64 |
| 14 | |
| 15 | #define TC0_CLUSTER_COUNT 1 |
Usama Arif | 6ddc37f | 2021-01-17 18:05:08 +0000 | [diff] [blame] | 16 | #define TC0_MAX_CPUS_PER_CLUSTER 8 |
Arunachalam Ganapathy | a5b1776 | 2020-04-27 14:33:00 +0100 | [diff] [blame] | 17 | #define TC0_MAX_PE_PER_CPU 1 |
| 18 | |
| 19 | /******************************************************************************* |
| 20 | * Run-time address of the TFTF image. |
| 21 | * It has to match the location where the Trusted Firmware-A loads the BL33 |
| 22 | * image. |
| 23 | ******************************************************************************/ |
| 24 | #define TFTF_BASE 0xE0000000 |
| 25 | |
| 26 | #define TC0_DRAM1_BASE 0x80000000 |
| 27 | #define TC0_DRAM1_SIZE 0x80000000 |
| 28 | #define DRAM_BASE TC0_DRAM1_BASE |
| 29 | |
| 30 | /* |
| 31 | * TF-A reserves DRAM space 0xFD000000 - 0xFEFFFFFF for Trusted DRAM |
| 32 | * TF-A reserves DRAM space 0xFF000000 - 0xFFFFFFFF for TZC |
| 33 | */ |
| 34 | #define ARM_TZC_DRAM1_SIZE 0x01000000 |
| 35 | #define ARM_TRUSTED_DRAM1_SIZE 0x02000000 |
| 36 | |
| 37 | #define DRAM_SIZE (TC0_DRAM1_SIZE - \ |
| 38 | ARM_TRUSTED_DRAM1_SIZE - \ |
| 39 | ARM_TZC_DRAM1_SIZE) |
| 40 | |
| 41 | /* REFCLK CNTControl, Generic Timer. Secure Access only. */ |
| 42 | #define SYS_CNT_CONTROL_BASE 0x2a430000 |
| 43 | /* REFCLK CNTRead, Generic Timer. */ |
| 44 | #define SYS_CNT_READ_BASE 0x2a800000 |
| 45 | /* AP_REFCLK CNTBase1, Generic Timer. */ |
| 46 | #define SYS_CNT_BASE1 0x2A830000 |
| 47 | |
| 48 | /* Base address of non-trusted watchdog (SP805) */ |
| 49 | #define SP805_WDOG_BASE 0x1C0F0000 |
| 50 | |
Madhukar Pappireddy | d3fc83c | 2021-11-09 10:04:33 -0600 | [diff] [blame^] | 51 | /* Base address of trusted watchdog (SP805) */ |
| 52 | #define SP805_TWDOG_BASE 0x2A480000 |
| 53 | #define IRQ_TWDOG_INTID 86 |
| 54 | |
Arunachalam Ganapathy | a5b1776 | 2020-04-27 14:33:00 +0100 | [diff] [blame] | 55 | /* Base address and size of external NVM flash */ |
| 56 | #define FLASH_BASE 0x08000000 |
| 57 | |
| 58 | #define NOR_FLASH_BLOCK_SIZE 0x40000 /* 256KB */ |
| 59 | #define FLASH_SIZE 0x4000000 /* 64MB */ |
| 60 | |
| 61 | /* |
| 62 | * If you want to use DRAM for non-volatile memory then the first 128MB |
| 63 | * can be used. However for tests that involve power resets this is not |
| 64 | * suitable since the state will be lost. |
| 65 | */ |
| 66 | #define TFTF_NVM_OFFSET 0x0 |
| 67 | #define TFTF_NVM_SIZE 0x8000000 /* 128 MB */ |
| 68 | |
| 69 | /* Sub-system Peripherals */ |
| 70 | #define TC0_DEVICE0_BASE 0x21000000 |
| 71 | #define TC0_DEVICE0_SIZE 0x5f000000 |
| 72 | |
| 73 | /* Following covers Peripherals and PCIe expansion area */ |
| 74 | #define TC0_DEVICE1_BASE 0x60000000 |
| 75 | #define TC0_DEVICE1_SIZE 0x20000000 |
| 76 | |
| 77 | /* GIC-600 & interrupt handling related constants */ |
| 78 | #define TC0_GICD_BASE 0x30000000 |
Arunachalam Ganapathy | 3f6e1ec | 2021-05-24 14:49:24 +0100 | [diff] [blame] | 79 | #define TC0_GICR_BASE 0x30080000 |
Arunachalam Ganapathy | a5b1776 | 2020-04-27 14:33:00 +0100 | [diff] [blame] | 80 | #define TC0_GICC_BASE 0x2C000000 |
| 81 | |
| 82 | /* SoC's PL011 UART0 related constants */ |
| 83 | #define PL011_UART0_BASE 0x7FF70000 |
| 84 | #define PL011_UART0_CLK_IN_HZ 7372800 |
| 85 | |
| 86 | /* SoC's PL011 UART1 related constants */ |
| 87 | #define PL011_UART1_BASE 0x7FF80000 |
| 88 | #define PL011_UART1_CLK_IN_HZ 7372800 |
| 89 | |
| 90 | #define PLAT_ARM_UART_BASE PL011_UART0_BASE |
| 91 | #define PLAT_ARM_UART_CLK_IN_HZ PL011_UART0_CLK_IN_HZ |
| 92 | |
| 93 | /* Size of cacheable stacks */ |
| 94 | #define PLATFORM_STACK_SIZE 0x1400 |
| 95 | |
| 96 | /* Size of coherent stacks */ |
| 97 | #define PCPU_DV_MEM_STACK_SIZE 0x600 |
| 98 | |
| 99 | #define PLATFORM_CORE_COUNT (TC0_CLUSTER_COUNT * TC0_MAX_CPUS_PER_CLUSTER) |
| 100 | #define PLATFORM_NUM_AFFS (TC0_CLUSTER_COUNT + PLATFORM_CORE_COUNT) |
| 101 | #define PLATFORM_MAX_AFFLVL MPIDR_AFFLVL1 |
| 102 | |
| 103 | #define PLAT_MAX_PWR_LEVEL PLATFORM_MAX_AFFLVL |
| 104 | #define PLAT_MAX_PWR_STATES_PER_LVL 2 |
| 105 | |
| 106 | /* I/O Storage NOR flash device */ |
| 107 | #define MAX_IO_DEVICES 1 |
| 108 | #define MAX_IO_HANDLES 1 |
| 109 | |
| 110 | /* Local state bit width for each level in the state-ID field of power state */ |
| 111 | #define PLAT_LOCAL_PSTATE_WIDTH 4 |
| 112 | |
| 113 | /* Platform specific page table and MMU setup constants */ |
| 114 | #define PLAT_PHY_ADDR_SPACE_SIZE (1ull << 36) |
| 115 | #define PLAT_VIRT_ADDR_SPACE_SIZE (1ull << 36) |
Arunachalam Ganapathy | 9682b77 | 2021-05-24 11:08:40 +0100 | [diff] [blame] | 116 | |
| 117 | #if IMAGE_CACTUS |
| 118 | #define MAX_XLAT_TABLES 6 |
| 119 | #else |
Arunachalam Ganapathy | a5b1776 | 2020-04-27 14:33:00 +0100 | [diff] [blame] | 120 | #define MAX_XLAT_TABLES 5 |
Arunachalam Ganapathy | 9682b77 | 2021-05-24 11:08:40 +0100 | [diff] [blame] | 121 | #endif |
Arunachalam Ganapathy | a5b1776 | 2020-04-27 14:33:00 +0100 | [diff] [blame] | 122 | #define MAX_MMAP_REGIONS 16 |
| 123 | |
| 124 | /******************************************************************************* |
| 125 | * Used to align variables on the biggest cache line size in the platform. |
| 126 | * This is known only to the platform as it might have a combination of |
| 127 | * integrated and external caches. |
| 128 | ******************************************************************************/ |
| 129 | #define CACHE_WRITEBACK_SHIFT 6 |
| 130 | #define CACHE_WRITEBACK_GRANULE (1 << CACHE_WRITEBACK_SHIFT) |
| 131 | |
| 132 | /* Non-Secure Software Generated Interupts IDs */ |
| 133 | #define IRQ_NS_SGI_0 0 |
| 134 | #define IRQ_NS_SGI_7 7 |
| 135 | |
| 136 | /* AP UART1 interrupt is considered as the maximum SPI */ |
| 137 | #define PLAT_MAX_SPI_OFFSET_ID 64 |
| 138 | |
| 139 | /* AP_REFCLK Generic Timer, Non-secure. */ |
| 140 | #define IRQ_CNTPSIRQ1 92 |
| 141 | |
| 142 | /* Per-CPU Hypervisor Timer Interrupt ID */ |
| 143 | #define IRQ_PCPU_HP_TIMER 26 |
| 144 | |
| 145 | /* Times(in ms) used by test code for completion of different events */ |
| 146 | #define PLAT_SUSPEND_ENTRY_TIME 15 |
| 147 | #define PLAT_SUSPEND_ENTRY_EXIT_TIME 30 |
| 148 | |
| 149 | #endif /* PLATFORM_DEF_H */ |