blob: 5c2f59e0fa38b16aebb3d6fd8d15c925178c083c [file] [log] [blame]
Jerry Wangd49873a2024-07-25 13:45:13 +01001/*
Boyan Karatotev6d144db2025-06-23 15:04:53 +01002 * Copyright (c) 2024-2025, Arm Limited and Contributors. All rights reserved.
Jerry Wangd49873a2024-07-25 13:45:13 +01003 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 *
6 * This file is limited to include the platform port definitions for the
7 * third generation of platforms.
8 */
9
10#ifndef NRD_PLAT_ARM_DEF3_H
11#define NRD_PLAT_ARM_DEF3_H
12
13#ifndef __ASSEMBLER__
14#include <lib/mmio.h>
15#endif /* __ASSEMBLER__ */
16
17#include <lib/utils_def.h>
18#include "nrd_css_fw_def3.h"
19#include "nrd_ros_def3.h"
20
21/* Platform binary types for linking */
22#define PLATFORM_LINKER_FORMAT "elf64-littleaarch64"
23#define PLATFORM_LINKER_ARCH aarch64
24
25/*******************************************************************************
26 * Stack size
27 ******************************************************************************/
28
29/* Size of cacheable stacks */
30#define PLATFORM_STACK_SIZE U(0x1400) /* 5120 bytes */
31
32/* Size of coherent stacks */
33#define PCPU_DV_MEM_STACK_SIZE U(0x600) /* 1536 bytes */
34
35/*******************************************************************************
36 * Core count
37 ******************************************************************************/
38
39#define PLATFORM_CORE_COUNT (PLAT_ARM_CLUSTER_COUNT * \
40 NRD_MAX_CPUS_PER_CLUSTER)
41#define PLATFORM_NUM_AFFS (PLAT_ARM_CLUSTER_COUNT + PLATFORM_CORE_COUNT)
42
43/*******************************************************************************
44 * Power related definitions
45 ******************************************************************************/
46
47#define PLATFORM_MAX_AFFLVL MPIDR_AFFLVL1
48
49#define PLAT_MAX_PWR_LEVEL PLATFORM_MAX_AFFLVL
50#define PLAT_MAX_PWR_STATES_PER_LVL U(2)
51
52/* Local state bit width for each level in the state-ID field of power state */
53#define PLAT_LOCAL_PSTATE_WIDTH U(4)
54
55/*******************************************************************************
56 * XLAT definitions
57 ******************************************************************************/
58
59/* Platform specific page table and MMU setup constants */
60#define MAX_XLAT_TABLES U(7)
61#define MAX_MMAP_REGIONS U(16)
62
63/*******************************************************************************
64 * I/O definitions
65 ******************************************************************************/
66
67/* I/O Storage NOR flash device */
68#define MAX_IO_DEVICES U(1)
69#define MAX_IO_HANDLES U(1)
70
Jerry Wangd49873a2024-07-25 13:45:13 +010071/* Maximum SPI */
72#define PLAT_MAX_SPI_OFFSET_ID U(256)
73
74/*******************************************************************************
75 * Timer config
76 ******************************************************************************/
77
78/* Per-CPU Hypervisor Timer Interrupt ID */
79#define IRQ_PCPU_HP_TIMER U(26)
80
81/* Memory mapped Generic timer interfaces */
82#define SYS_CNT_BASE1 NRD_CSS_NSEC_CNT_BASE1
83
84/* AP_REFCLK Generic Timer, Non-secure. */
85#define IRQ_CNTPSIRQ1 U(109)
86
87/* Times(in ms) used by test code for completion of different events */
88#define PLAT_SUSPEND_ENTRY_TIME U(15)
89#define PLAT_SUSPEND_ENTRY_EXIT_TIME U(30)
90
91/*******************************************************************************
92 * Console config
93 ******************************************************************************/
94
95#define PLAT_ARM_UART_BASE NRD_CSS_NSEC_UART_BASE
96#define PLAT_ARM_UART_CLK_IN_HZ NRD_CSS_NSEC_CLK_IN_HZ
97
98/*******************************************************************************
99 * DRAM config
100 ******************************************************************************/
101
102/* TF-A reserves DRAM space 0xFF000000- 0xFFFFFFFF for TZC */
103#define DRAM_BASE NRD_CSS_DRAM1_BASE
104#define DRAM_SIZE (NRD_CSS_DRAM1_SIZE - 0x1000000)
105
106/*******************************************************************************
107 * Cache related config
108 ******************************************************************************/
109#define CACHE_WRITEBACK_SHIFT U(6)
110#define CACHE_WRITEBACK_GRANULE (1U << CACHE_WRITEBACK_SHIFT)
111
112/*******************************************************************************
113 * Run-time address of the TFTF image.
114 * It has to match the location where the Trusted Firmware-A loads the BL33
115 * image.
116 ******************************************************************************/
117#define TFTF_BASE UL(0xE0000000)
118
119/*******************************************************************************
120 * TFTF NVM configs
121 ******************************************************************************/
122
123#define TFTF_NVM_OFFSET U(0x0)
124#define TFTF_NVM_SIZE UL(0x08000000) /* 128 MB */
125
126/*******************************************************************************
127 * Watchdog related config
128 ******************************************************************************/
129
130/* Base address of trusted watchdog (SP805) */
131#define SP805_TWDOG_BASE NRD_CSS_TWDOG_BASE
132
133/* Base address of non-trusted watchdog (SP805) */
134#define SP805_WDOG_BASE NRD_CSS_WDOG_BASE
135
136/* Trusted watchdog (SP805) Interrupt ID */
137#define IRQ_TWDOG_INTID U(107)
138
139/*******************************************************************************
140 * Flash related config
141 ******************************************************************************/
142
143/* Base address and size of external NVM flash */
144#define FLASH_BASE NRD_ROS_FLASH_BASE
145#define FLASH_SIZE NRD_ROS_FLASH_SIZE
146#define NOR_FLASH_BLOCK_SIZE UL(0x40000) /* 256KB */
147
Boyan Karatotev6d144db2025-06-23 15:04:53 +0100148#endif /* NRD_PLAT_ARM_DEF3_H */