blob: 106f8f663b16ab25f36f33575081ac8d3cb179bd [file] [log] [blame]
Varun Wadekar921b9062015-08-25 17:03:14 +05301/*
Varun Wadekarcad7b082015-12-28 18:12:59 -08002 * Copyright (c) 2015-2017, ARM Limited and Contributors. All rights reserved.
Varun Wadekar921b9062015-08-25 17:03:14 +05303 *
dp-armfa3cf0b2017-05-03 09:38:09 +01004 * SPDX-License-Identifier: BSD-3-Clause
Varun Wadekar921b9062015-08-25 17:03:14 +05305 */
6
7#ifndef __TEGRA_DEF_H__
8#define __TEGRA_DEF_H__
9
Varun Wadekar921b9062015-08-25 17:03:14 +053010/*******************************************************************************
Varun Wadekaracf1cad2016-12-12 14:24:17 -080011 * MCE apertures used by the ARI interface
12 *
13 * Aperture 0 - Cpu0 (ARM Cortex A-57)
14 * Aperture 1 - Cpu1 (ARM Cortex A-57)
15 * Aperture 2 - Cpu2 (ARM Cortex A-57)
16 * Aperture 3 - Cpu3 (ARM Cortex A-57)
17 * Aperture 4 - Cpu4 (Denver15)
18 * Aperture 5 - Cpu5 (Denver15)
19 ******************************************************************************/
20#define MCE_ARI_APERTURE_0_OFFSET 0x0
21#define MCE_ARI_APERTURE_1_OFFSET 0x10000
22#define MCE_ARI_APERTURE_2_OFFSET 0x20000
23#define MCE_ARI_APERTURE_3_OFFSET 0x30000
24#define MCE_ARI_APERTURE_4_OFFSET 0x40000
25#define MCE_ARI_APERTURE_5_OFFSET 0x50000
26#define MCE_ARI_APERTURE_OFFSET_MAX MCE_APERTURE_5_OFFSET
27
28/* number of apertures */
29#define MCE_ARI_APERTURES_MAX 6
30
31/* each ARI aperture is 64KB */
32#define MCE_ARI_APERTURE_SIZE 0x10000
33
34/*******************************************************************************
35 * CPU core id macros for the MCE_ONLINE_CORE ARI
36 ******************************************************************************/
37#define MCE_CORE_ID_MAX 8
38#define MCE_CORE_ID_MASK 0x7
39
40/*******************************************************************************
Varun Wadekar42236572016-01-18 19:03:19 -080041 * These values are used by the PSCI implementation during the `CPU_SUSPEND`
42 * and `SYSTEM_SUSPEND` calls as the `state-id` field in the 'power state'
43 * parameter.
44 ******************************************************************************/
45#define PSTATE_ID_CORE_IDLE 6
46#define PSTATE_ID_CORE_POWERDN 7
47#define PSTATE_ID_SOC_POWERDN 2
48
49/*******************************************************************************
50 * Platform power states (used by PSCI framework)
51 *
52 * - PLAT_MAX_RET_STATE should be less than lowest PSTATE_ID
53 * - PLAT_MAX_OFF_STATE should be greater than the highest PSTATE_ID
Varun Wadekar921b9062015-08-25 17:03:14 +053054 ******************************************************************************/
Varun Wadekar42236572016-01-18 19:03:19 -080055#define PLAT_MAX_RET_STATE 1
56#define PLAT_MAX_OFF_STATE 8
Varun Wadekar921b9062015-08-25 17:03:14 +053057
58/*******************************************************************************
59 * Implementation defined ACTLR_EL3 bit definitions
60 ******************************************************************************/
61#define ACTLR_EL3_L2ACTLR_BIT (1 << 6)
62#define ACTLR_EL3_L2ECTLR_BIT (1 << 5)
63#define ACTLR_EL3_L2CTLR_BIT (1 << 4)
64#define ACTLR_EL3_CPUECTLR_BIT (1 << 1)
65#define ACTLR_EL3_CPUACTLR_BIT (1 << 0)
66#define ACTLR_EL3_ENABLE_ALL_ACCESS (ACTLR_EL3_L2ACTLR_BIT | \
67 ACTLR_EL3_L2ECTLR_BIT | \
68 ACTLR_EL3_L2CTLR_BIT | \
69 ACTLR_EL3_CPUECTLR_BIT | \
70 ACTLR_EL3_CPUACTLR_BIT)
71
72/*******************************************************************************
Varun Wadekarcad7b082015-12-28 18:12:59 -080073 * Secure IRQ definitions
74 ******************************************************************************/
75#define TEGRA186_TOP_WDT_IRQ 49
76#define TEGRA186_AON_WDT_IRQ 50
77
78#define TEGRA186_SEC_IRQ_TARGET_MASK 0xF3 /* 4 A57 - 2 Denver */
79
80/*******************************************************************************
Varun Wadekar921b9062015-08-25 17:03:14 +053081 * Tegra Miscellanous register constants
82 ******************************************************************************/
83#define TEGRA_MISC_BASE 0x00100000
Varun Wadekarc9ac3e42016-02-17 15:07:49 -080084#define HARDWARE_REVISION_OFFSET 0x4
Varun Wadekare2bc7f22016-04-02 15:41:20 -070085
Varun Wadekarb8776152016-03-03 13:52:52 -080086#define MISCREG_PFCFG 0x200C
Varun Wadekar921b9062015-08-25 17:03:14 +053087
88/*******************************************************************************
Varun Wadekara0f26972016-03-11 17:18:51 -080089 * Tegra TSA Controller constants
90 ******************************************************************************/
91#define TEGRA_TSA_BASE 0x02400000
92
93/*******************************************************************************
Varun Wadekarf5fc53f2016-12-15 11:54:51 -080094 * TSA configuration registers
95 ******************************************************************************/
96#define TSA_CONFIG_STATIC0_CSW_SESWR 0x4010
97#define TSA_CONFIG_STATIC0_CSW_SESWR_RESET 0x1100
98#define TSA_CONFIG_STATIC0_CSW_ETRW 0x4038
99#define TSA_CONFIG_STATIC0_CSW_ETRW_RESET 0x1100
100#define TSA_CONFIG_STATIC0_CSW_SDMMCWAB 0x5010
101#define TSA_CONFIG_STATIC0_CSW_SDMMCWAB_RESET 0x1100
102#define TSA_CONFIG_STATIC0_CSW_AXISW 0x7008
103#define TSA_CONFIG_STATIC0_CSW_AXISW_RESET 0x1100
104#define TSA_CONFIG_STATIC0_CSW_HDAW 0xA008
105#define TSA_CONFIG_STATIC0_CSW_HDAW_RESET 0x100
106#define TSA_CONFIG_STATIC0_CSW_AONDMAW 0xB018
107#define TSA_CONFIG_STATIC0_CSW_AONDMAW_RESET 0x1100
108#define TSA_CONFIG_STATIC0_CSW_SCEDMAW 0xD018
109#define TSA_CONFIG_STATIC0_CSW_SCEDMAW_RESET 0x1100
110#define TSA_CONFIG_STATIC0_CSW_BPMPDMAW 0xD028
111#define TSA_CONFIG_STATIC0_CSW_BPMPDMAW_RESET 0x1100
112#define TSA_CONFIG_STATIC0_CSW_APEDMAW 0x12018
113#define TSA_CONFIG_STATIC0_CSW_APEDMAW_RESET 0x1100
114#define TSA_CONFIG_STATIC0_CSW_UFSHCW 0x13008
115#define TSA_CONFIG_STATIC0_CSW_UFSHCW_RESET 0x1100
116#define TSA_CONFIG_STATIC0_CSW_AFIW 0x13018
117#define TSA_CONFIG_STATIC0_CSW_AFIW_RESET 0x1100
118#define TSA_CONFIG_STATIC0_CSW_SATAW 0x13028
119#define TSA_CONFIG_STATIC0_CSW_SATAW_RESET 0x1100
120#define TSA_CONFIG_STATIC0_CSW_EQOSW 0x13038
121#define TSA_CONFIG_STATIC0_CSW_EQOSW_RESET 0x1100
122#define TSA_CONFIG_STATIC0_CSW_XUSB_DEVW 0x15008
123#define TSA_CONFIG_STATIC0_CSW_XUSB_DEVW_RESET 0x1100
124#define TSA_CONFIG_STATIC0_CSW_XUSB_HOSTW 0x15018
125#define TSA_CONFIG_STATIC0_CSW_XUSB_HOSTW_RESET 0x1100
126
127#define TSA_CONFIG_CSW_MEMTYPE_OVERRIDE_MASK (0x3 << 11)
128#define TSA_CONFIG_CSW_MEMTYPE_OVERRIDE_PASTHRU (0 << 11)
129
130/*******************************************************************************
Varun Wadekar921b9062015-08-25 17:03:14 +0530131 * Tegra Memory Controller constants
132 ******************************************************************************/
133#define TEGRA_MC_STREAMID_BASE 0x02C00000
134#define TEGRA_MC_BASE 0x02C10000
135
Varun Wadekar153982c2016-12-21 14:50:18 -0800136/* General Security Carveout register macros */
137#define MC_GSC_CONFIG_REGS_SIZE 0x40UL
138#define MC_GSC_LOCK_CFG_SETTINGS_BIT (1UL << 1)
139#define MC_GSC_ENABLE_TZ_LOCK_BIT (1UL << 0)
140#define MC_GSC_SIZE_RANGE_4KB_SHIFT 27UL
141#define MC_GSC_BASE_LO_SHIFT 12UL
142#define MC_GSC_BASE_LO_MASK 0xFFFFFUL
143#define MC_GSC_BASE_HI_SHIFT 0UL
144#define MC_GSC_BASE_HI_MASK 3UL
145
Varun Wadekar64443ca2016-12-12 16:14:57 -0800146/* TZDRAM carveout configuration registers */
147#define MC_SECURITY_CFG0_0 0x70
148#define MC_SECURITY_CFG1_0 0x74
149#define MC_SECURITY_CFG3_0 0x9BC
150
151/* Video Memory carveout configuration registers */
152#define MC_VIDEO_PROTECT_BASE_HI 0x978
153#define MC_VIDEO_PROTECT_BASE_LO 0x648
Varun Wadekar153982c2016-12-21 14:50:18 -0800154#define MC_VIDEO_PROTECT_SIZE_MB 0x64C
155
156/*
157 * Carveout (MC_SECURITY_CARVEOUT24) registers used to clear the
158 * non-overlapping Video memory region
159 */
160#define MC_VIDEO_PROTECT_CLEAR_CFG 0x25A0
161#define MC_VIDEO_PROTECT_CLEAR_BASE_LO 0x25A4
162#define MC_VIDEO_PROTECT_CLEAR_BASE_HI 0x25A8
163#define MC_VIDEO_PROTECT_CLEAR_SIZE 0x25AC
164#define MC_VIDEO_PROTECT_CLEAR_ACCESS_CFG0 0x25B0
Varun Wadekar64443ca2016-12-12 16:14:57 -0800165
166/* TZRAM carveout (MC_SECURITY_CARVEOUT11) configuration registers */
Varun Wadekar153982c2016-12-21 14:50:18 -0800167#define MC_TZRAM_CARVEOUT_CFG 0x2190
Varun Wadekar64443ca2016-12-12 16:14:57 -0800168#define MC_TZRAM_BASE_LO 0x2194
Varun Wadekar64443ca2016-12-12 16:14:57 -0800169#define MC_TZRAM_BASE_HI 0x2198
Varun Wadekar64443ca2016-12-12 16:14:57 -0800170#define MC_TZRAM_SIZE 0x219C
Varun Wadekar153982c2016-12-21 14:50:18 -0800171#define MC_TZRAM_CLIENT_ACCESS_CFG0 0x21A0
Varun Wadekar64443ca2016-12-12 16:14:57 -0800172
Varun Wadekar921b9062015-08-25 17:03:14 +0530173/*******************************************************************************
174 * Tegra UART Controller constants
175 ******************************************************************************/
176#define TEGRA_UARTA_BASE 0x03100000
177#define TEGRA_UARTB_BASE 0x03110000
178#define TEGRA_UARTC_BASE 0x0C280000
179#define TEGRA_UARTD_BASE 0x03130000
180#define TEGRA_UARTE_BASE 0x03140000
181#define TEGRA_UARTF_BASE 0x03150000
182#define TEGRA_UARTG_BASE 0x0C290000
183
184/*******************************************************************************
Varun Wadekar4debe052016-05-18 13:39:16 -0700185 * Tegra Fuse Controller related constants
186 ******************************************************************************/
187#define TEGRA_FUSE_BASE 0x03820000
188#define OPT_SUBREVISION 0x248
189#define SUBREVISION_MASK 0xFF
190
191/*******************************************************************************
Varun Wadekar921b9062015-08-25 17:03:14 +0530192 * GICv2 & interrupt handling related constants
193 ******************************************************************************/
194#define TEGRA_GICD_BASE 0x03881000
195#define TEGRA_GICC_BASE 0x03882000
196
197/*******************************************************************************
Varun Wadekarb8776152016-03-03 13:52:52 -0800198 * Security Engine related constants
199 ******************************************************************************/
200#define TEGRA_SE0_BASE 0x03AC0000
201#define SE_MUTEX_WATCHDOG_NS_LIMIT 0x6C
202#define TEGRA_PKA1_BASE 0x03AD0000
203#define PKA_MUTEX_WATCHDOG_NS_LIMIT 0x8144
204#define TEGRA_RNG1_BASE 0x03AE0000
205#define RNG_MUTEX_WATCHDOG_NS_LIMIT 0xFE0
206
207/*******************************************************************************
Varun Wadekar921b9062015-08-25 17:03:14 +0530208 * Tegra Clock and Reset Controller constants
209 ******************************************************************************/
210#define TEGRA_CAR_RESET_BASE 0x05000000
211
212/*******************************************************************************
213 * Tegra micro-seconds timer constants
214 ******************************************************************************/
215#define TEGRA_TMRUS_BASE 0x0C2E0000
Steven Kao4d160ac2016-12-23 16:05:13 +0800216#define TEGRA_TMRUS_SIZE 0x1000
Varun Wadekar921b9062015-08-25 17:03:14 +0530217
218/*******************************************************************************
219 * Tegra Power Mgmt Controller constants
220 ******************************************************************************/
221#define TEGRA_PMC_BASE 0x0C360000
222
223/*******************************************************************************
224 * Tegra scratch registers constants
225 ******************************************************************************/
226#define TEGRA_SCRATCH_BASE 0x0C390000
Varun Wadekarbd2b4142016-12-12 16:46:44 -0800227#define SECURE_SCRATCH_RSV1_LO 0x658
228#define SECURE_SCRATCH_RSV1_HI 0x65C
Varun Wadekarb8776152016-03-03 13:52:52 -0800229#define SECURE_SCRATCH_RSV6 0x680
230#define SECURE_SCRATCH_RSV11_LO 0x6A8
231#define SECURE_SCRATCH_RSV11_HI 0x6AC
Varun Wadekar94701ff2016-05-23 11:47:34 -0700232#define SECURE_SCRATCH_RSV53_LO 0x7F8
233#define SECURE_SCRATCH_RSV53_HI 0x7FC
Harvey Hsiehc95802d2016-07-29 20:10:59 +0800234#define SECURE_SCRATCH_RSV54_HI 0x804
235#define SECURE_SCRATCH_RSV55_LO 0x808
236#define SECURE_SCRATCH_RSV55_HI 0x80C
Varun Wadekar921b9062015-08-25 17:03:14 +0530237
238/*******************************************************************************
Varun Wadekard64db962016-09-23 14:28:16 -0700239 * Tegra Memory Mapped Control Register Access constants
Varun Wadekar921b9062015-08-25 17:03:14 +0530240 ******************************************************************************/
241#define TEGRA_MMCRAB_BASE 0x0E000000
242
243/*******************************************************************************
Varun Wadekard64db962016-09-23 14:28:16 -0700244 * Tegra Memory Mapped Activity Monitor Register Access constants
245 ******************************************************************************/
246#define TEGRA_ARM_ACTMON_CTR_BASE 0x0E060000
247#define TEGRA_DENVER_ACTMON_CTR_BASE 0x0E070000
248
249/*******************************************************************************
Varun Wadekar921b9062015-08-25 17:03:14 +0530250 * Tegra SMMU Controller constants
251 ******************************************************************************/
Pritesh Raithatha0de6e532017-01-24 13:49:46 +0530252#define TEGRA_SMMU0_BASE 0x12000000
Varun Wadekar921b9062015-08-25 17:03:14 +0530253
Varun Wadekar13e7dc42015-12-30 15:15:08 -0800254/*******************************************************************************
255 * Tegra TZRAM constants
256 ******************************************************************************/
257#define TEGRA_TZRAM_BASE 0x30000000
Varun Wadekare6d43222016-05-25 16:35:04 -0700258#define TEGRA_TZRAM_SIZE 0x40000
Varun Wadekar13e7dc42015-12-30 15:15:08 -0800259
Varun Wadekar921b9062015-08-25 17:03:14 +0530260#endif /* __TEGRA_DEF_H__ */