blob: 9df99d147b4c7a4ec6910f7f532391fa43143f83 [file] [log] [blame]
Arunachalam Ganapathya5b17762020-04-27 14:33:00 +01001/*
Usama Arif6ddc37f2021-01-17 18:05:08 +00002 * Copyright (c) 2020-2021, Arm Limited. All rights reserved.
Arunachalam Ganapathya5b17762020-04-27 14:33:00 +01003 *
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 Arif6ddc37f2021-01-17 18:05:08 +000016#define TC0_MAX_CPUS_PER_CLUSTER 8
Arunachalam Ganapathya5b17762020-04-27 14:33:00 +010017#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
51/* Base address and size of external NVM flash */
52#define FLASH_BASE 0x08000000
53
54#define NOR_FLASH_BLOCK_SIZE 0x40000 /* 256KB */
55#define FLASH_SIZE 0x4000000 /* 64MB */
56
57/*
58 * If you want to use DRAM for non-volatile memory then the first 128MB
59 * can be used. However for tests that involve power resets this is not
60 * suitable since the state will be lost.
61 */
62#define TFTF_NVM_OFFSET 0x0
63#define TFTF_NVM_SIZE 0x8000000 /* 128 MB */
64
65/* Sub-system Peripherals */
66#define TC0_DEVICE0_BASE 0x21000000
67#define TC0_DEVICE0_SIZE 0x5f000000
68
69/* Following covers Peripherals and PCIe expansion area */
70#define TC0_DEVICE1_BASE 0x60000000
71#define TC0_DEVICE1_SIZE 0x20000000
72
73/* GIC-600 & interrupt handling related constants */
74#define TC0_GICD_BASE 0x30000000
Arunachalam Ganapathy3f6e1ec2021-05-24 14:49:24 +010075#define TC0_GICR_BASE 0x30080000
Arunachalam Ganapathya5b17762020-04-27 14:33:00 +010076#define TC0_GICC_BASE 0x2C000000
77
78/* SoC's PL011 UART0 related constants */
79#define PL011_UART0_BASE 0x7FF70000
80#define PL011_UART0_CLK_IN_HZ 7372800
81
82/* SoC's PL011 UART1 related constants */
83#define PL011_UART1_BASE 0x7FF80000
84#define PL011_UART1_CLK_IN_HZ 7372800
85
86#define PLAT_ARM_UART_BASE PL011_UART0_BASE
87#define PLAT_ARM_UART_CLK_IN_HZ PL011_UART0_CLK_IN_HZ
88
89/* Size of cacheable stacks */
90#define PLATFORM_STACK_SIZE 0x1400
91
92/* Size of coherent stacks */
93#define PCPU_DV_MEM_STACK_SIZE 0x600
94
95#define PLATFORM_CORE_COUNT (TC0_CLUSTER_COUNT * TC0_MAX_CPUS_PER_CLUSTER)
96#define PLATFORM_NUM_AFFS (TC0_CLUSTER_COUNT + PLATFORM_CORE_COUNT)
97#define PLATFORM_MAX_AFFLVL MPIDR_AFFLVL1
98
99#define PLAT_MAX_PWR_LEVEL PLATFORM_MAX_AFFLVL
100#define PLAT_MAX_PWR_STATES_PER_LVL 2
101
102/* I/O Storage NOR flash device */
103#define MAX_IO_DEVICES 1
104#define MAX_IO_HANDLES 1
105
106/* Local state bit width for each level in the state-ID field of power state */
107#define PLAT_LOCAL_PSTATE_WIDTH 4
108
109/* Platform specific page table and MMU setup constants */
110#define PLAT_PHY_ADDR_SPACE_SIZE (1ull << 36)
111#define PLAT_VIRT_ADDR_SPACE_SIZE (1ull << 36)
Arunachalam Ganapathy9682b772021-05-24 11:08:40 +0100112
113#if IMAGE_CACTUS
114#define MAX_XLAT_TABLES 6
115#else
Arunachalam Ganapathya5b17762020-04-27 14:33:00 +0100116#define MAX_XLAT_TABLES 5
Arunachalam Ganapathy9682b772021-05-24 11:08:40 +0100117#endif
Arunachalam Ganapathya5b17762020-04-27 14:33:00 +0100118#define MAX_MMAP_REGIONS 16
119
120/*******************************************************************************
121 * Used to align variables on the biggest cache line size in the platform.
122 * This is known only to the platform as it might have a combination of
123 * integrated and external caches.
124 ******************************************************************************/
125#define CACHE_WRITEBACK_SHIFT 6
126#define CACHE_WRITEBACK_GRANULE (1 << CACHE_WRITEBACK_SHIFT)
127
128/* Non-Secure Software Generated Interupts IDs */
129#define IRQ_NS_SGI_0 0
130#define IRQ_NS_SGI_7 7
131
132/* AP UART1 interrupt is considered as the maximum SPI */
133#define PLAT_MAX_SPI_OFFSET_ID 64
134
135/* AP_REFCLK Generic Timer, Non-secure. */
136#define IRQ_CNTPSIRQ1 92
137
138/* Per-CPU Hypervisor Timer Interrupt ID */
139#define IRQ_PCPU_HP_TIMER 26
140
141/* Times(in ms) used by test code for completion of different events */
142#define PLAT_SUSPEND_ENTRY_TIME 15
143#define PLAT_SUSPEND_ENTRY_EXIT_TIME 30
144
145#endif /* PLATFORM_DEF_H */