blob: 09b4acca070fbe596e213ba19bd3831bac10f2f6 [file] [log] [blame]
Akshay Belsare52aefd92023-04-04 10:26:40 +05301/*
2 * Copyright (c) 2022-2023, Advanced Micro Devices, Inc. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#ifndef PLATFORM_DEF_H
8#define PLATFORM_DEF_H
9
10#include <arch.h>
11
12#define PLATFORM_LINKER_FORMAT "elf64-littleaarch64"
13#define PLATFORM_LINKER_ARCH aarch64
14
15#define TFTF_BASE U(0x8000000)
16
17#define CACHE_WRITEBACK_GRANULE U(0x40)
18
19#define PLATFORM_CLUSTER_COUNT 1
20#define PLATFORM_CORE_COUNT_PER_CLUSTER 2
21#define PLATFORM_CORE_COUNT (PLATFORM_CLUSTER_COUNT * \
22 PLATFORM_CORE_COUNT_PER_CLUSTER)
23#define PLATFORM_NUM_AFFS (PLATFORM_CORE_COUNT + \
24 PLATFORM_CLUSTER_COUNT + 1)
25#define PLATFORM_MAX_AFFLVL MPIDR_AFFLVL2
26#define PLAT_MAX_PWR_LEVEL MPIDR_AFFLVL2
27#define PLAT_MAX_PWR_STATES_PER_LVL 2
28
29
30#define PLATFORM_STACK_SIZE U(0x880)
31#define PCPU_DV_MEM_STACK_SIZE U(0x440)
32
33
34#define PLAT_VIRT_ADDR_SPACE_SIZE (1ULL << 32)
35#define PLAT_PHY_ADDR_SPACE_SIZE (1ULL << 32)
36#define MAX_XLAT_TABLES U(8)
37#define MAX_MMAP_REGIONS U(16)
38
39#define DRAM_BASE U(0x0)
40#define DRAM_SIZE U(0x80000000)
41
Maheedhar Bollapallic779d0d2025-02-14 10:43:37 +053042/*******************************************************************************
43 * LOW DDR MAX defines
44 ******************************************************************************/
45#define PLAT_DDR_LOWMEM_MAX U(0x80000000)
46
Akshay Belsare52aefd92023-04-04 10:26:40 +053047/*
48 * TFTF_NVM_OFFSET/SIZE correspond to the NVM partition in the partition
49 * table
50 */
51#define TFTF_NVM_SIZE U(0x600000)
52#define TFTF_NVM_OFFSET U(0x20000000)
53
54/* Local state bit width for each level in the state-ID field of power state */
55#define PLAT_LOCAL_PSTATE_WIDTH U(4)
56
57/* GIC-400 related addresses from datasheet */
58#define GICD_REG_BASE U(0xf9000000)
59#define GICC_REG_BASE U(0xf9040000)
60#define GICR_REG_BASE U(0xf9080000)
61
62/*
63 * Memory mapped devices that we must create MMU mappings for them
64 */
65#define GIC_BASE GICD_REG_BASE
66#define GIC_SIZE U(0x01000000)
67
68#define TTC_BASE U(0xff0e0000)
69#define TTC_SIZE U(0x00010000)
70
71#define SYS_CNT_BASE1 TTC_BASE
72#define SYS_CNT_SIZE TTC_SIZE
73
74#define LPD_IOU_SLCR U(0xff080000)
75#define LPD_IOU_SLCR_SIZE U(0x00010000)
76
77/* ARM PL011 UART */
78#define PL011_UART0_BASE U(0xff000000)
79#define PL011_BAUDRATE U(115200)
80#define PL011_UART_CLK_IN_HZ U(100000000)
81
82#define PLAT_ARM_UART_BASE PL011_UART0_BASE
83#define PLAT_ARM_UART_SIZE U(0x1000)
84
85#define CRASH_CONSOLE_BASE PL011_UART0_BASE
86#define CRASH_CONSOLE_SIZE PLAT_ARM_UART_SIZE
87
Akshay Belsare52aefd92023-04-04 10:26:40 +053088/* Per-CPU Hypervisor Timer Interrupt ID */
89#define IRQ_PCPU_HP_TIMER U(29)
90/* Datasheet: TIME00 event*/
91#define IRQ_CNTPSIRQ1 U(29)
92
93/* Refer to AM011(v1.5), Chapter 50, Page 430 */
94#define PLAT_MAX_SPI_OFFSET_ID U(223)
95
96/*
97 * Times(in ms) used by test code for completion of different events.
98 */
99#define PLAT_SUSPEND_ENTRY_TIME U(15)
100#define PLAT_SUSPEND_ENTRY_EXIT_TIME U(30)
101
102/*
103 * Dummy definitions that we need just to compile...
104 */
105#define ARM_SECURE_SERVICE_BUFFER_BASE U(0)
106#define ARM_SECURE_SERVICE_BUFFER_SIZE U(100)
107
108/* LPD_SWDT_INT, AM011(v1.5), Chapter 50, Page 428 */
109#define IRQ_TWDOG_INTID U(0x51)
110
Prasad Kummari1d8f2222023-08-25 12:02:33 +0530111#define TTC_TIMER_IRQ U(69)
Amit Nagal9c736782024-02-16 12:29:16 +0530112#define TTC_CLK_SEL_OFFSET U(0x360)
Prasad Kummari1d8f2222023-08-25 12:02:33 +0530113
Akshay Belsare52aefd92023-04-04 10:26:40 +0530114#endif /* PLATFORM_DEF_H */