xref: /optee_os/core/arch/arm/plat-versal2/platform_config.h (revision 79ea7b0ab52d9e488da53bc72f7f8d7116283cd6)
1 /* SPDX-License-Identifier: BSD-2-Clause */
2 /*
3  * Copyright (c) 2023-2024, Advanced Micro Devices, Inc. All rights reserved.
4  */
5 
6 #ifndef PLATFORM_CONFIG_H
7 #define PLATFORM_CONFIG_H
8 
9 #include <mm/generic_ram_layout.h>
10 
11 /* Make stacks aligned to data cache line length */
12 #define CACHELINE_LEN		64
13 #define STACK_ALIGNMENT		CACHELINE_LEN
14 
15 #define CONSOLE_UART0		U(0)
16 #define CONSOLE_UART1		U(1)
17 
18 #if defined(PLATFORM_FLAVOR_generic)
19 
20 #define PLM_RTCA		0xF2014000
21 #define PLM_RTCA_LEN		0x1000
22 
23 #define GICD_BASE		U(0xE2000000)
24 #define GICR_BASE		U(0xE2060000)
25 
26 #define UART0_BASE		U(0xF1920000)
27 #define UART1_BASE		U(0xF1930000)
28 
29 #define IT_UART0		50
30 #define IT_UART1		51
31 
32 #define UART_CLK_IN_HZ		100000000
33 
34 #if (CFG_CONSOLE_UART == CONSOLE_UART1)
35 #define CONSOLE_UART_BASE       UART1_BASE
36 #define IT_CONSOLE_UART         IT_UART1
37 #else /* CFG_CONSOLE_UART == CONSOLE_UART0 (default) */
38 #define CONSOLE_UART_BASE	UART0_BASE
39 #define IT_CONSOLE_UART		IT_UART0
40 #endif
41 
42 #define CONSOLE_UART_CLK_IN_HZ	UART_CLK_IN_HZ
43 
44 #define DRAM0_BASE		0
45 #define DRAM0_SIZE		0x80000000
46 
47 #ifndef ARM64
48 #error "Only ARM64 is supported!"
49 #endif
50 
51 #else
52 #error "Unknown platform flavor"
53 #endif
54 
55 #ifndef UART_BAUDRATE
56 #define UART_BAUDRATE		115200
57 #endif
58 
59 #ifndef CONSOLE_BAUDRATE
60 #define CONSOLE_BAUDRATE	UART_BAUDRATE
61 #endif
62 
63 #endif /* PLATFORM_CONFIG_H */
64