xref: /rk3399_ARM-atf/plat/nvidia/tegra/include/t194/tegra_def.h (revision 192fd367a017ff8e63a55e3ff5c771bf4bbaf041)
141612559SVarun Wadekar /*
241612559SVarun Wadekar  * Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
341612559SVarun Wadekar  *
441612559SVarun Wadekar  * SPDX-License-Identifier: BSD-3-Clause
541612559SVarun Wadekar  */
641612559SVarun Wadekar 
741612559SVarun Wadekar #ifndef __TEGRA_DEF_H__
841612559SVarun Wadekar #define __TEGRA_DEF_H__
941612559SVarun Wadekar 
1041612559SVarun Wadekar #include <lib/utils_def.h>
1141612559SVarun Wadekar 
1241612559SVarun Wadekar /*******************************************************************************
1341612559SVarun Wadekar  * These values are used by the PSCI implementation during the `CPU_SUSPEND`
1441612559SVarun Wadekar  * and `SYSTEM_SUSPEND` calls as the `state-id` field in the 'power state'
1541612559SVarun Wadekar  * parameter.
1641612559SVarun Wadekar  ******************************************************************************/
17b6533b56SAnthony Zhou #define PSTATE_ID_CORE_IDLE		U(6)
18b6533b56SAnthony Zhou #define PSTATE_ID_CORE_POWERDN		U(7)
19b6533b56SAnthony Zhou #define PSTATE_ID_SOC_POWERDN		U(2)
2041612559SVarun Wadekar 
2141612559SVarun Wadekar /*******************************************************************************
2241612559SVarun Wadekar  * Platform power states (used by PSCI framework)
2341612559SVarun Wadekar  *
2441612559SVarun Wadekar  * - PLAT_MAX_RET_STATE should be less than lowest PSTATE_ID
2541612559SVarun Wadekar  * - PLAT_MAX_OFF_STATE should be greater than the highest PSTATE_ID
2641612559SVarun Wadekar  ******************************************************************************/
27b6533b56SAnthony Zhou #define PLAT_MAX_RET_STATE		U(1)
28b6533b56SAnthony Zhou #define PLAT_MAX_OFF_STATE		U(8)
2941612559SVarun Wadekar 
3041612559SVarun Wadekar /*******************************************************************************
3141612559SVarun Wadekar  * Secure IRQ definitions
3241612559SVarun Wadekar  ******************************************************************************/
33b6533b56SAnthony Zhou #define TEGRA186_MAX_SEC_IRQS		U(5)
34b6533b56SAnthony Zhou #define TEGRA186_BPMP_WDT_IRQ		U(46)
35b6533b56SAnthony Zhou #define TEGRA186_SPE_WDT_IRQ		U(47)
36b6533b56SAnthony Zhou #define TEGRA186_SCE_WDT_IRQ		U(48)
37b6533b56SAnthony Zhou #define TEGRA186_TOP_WDT_IRQ		U(49)
38b6533b56SAnthony Zhou #define TEGRA186_AON_WDT_IRQ		U(50)
3941612559SVarun Wadekar 
40b6533b56SAnthony Zhou #define TEGRA186_SEC_IRQ_TARGET_MASK	U(0xFF) /* 8 Carmel */
4141612559SVarun Wadekar 
4241612559SVarun Wadekar /*******************************************************************************
4341612559SVarun Wadekar  * Tegra Miscellanous register constants
4441612559SVarun Wadekar  ******************************************************************************/
45b6533b56SAnthony Zhou #define TEGRA_MISC_BASE			U(0x00100000)
4641612559SVarun Wadekar 
47b6533b56SAnthony Zhou #define HARDWARE_REVISION_OFFSET	U(0x4)
48b6533b56SAnthony Zhou #define MISCREG_EMU_REVID		U(0x3160)
49b6533b56SAnthony Zhou #define  BOARD_MASK_BITS		U(0xFF)
50b6533b56SAnthony Zhou #define  BOARD_SHIFT_BITS		U(24)
51b6533b56SAnthony Zhou #define MISCREG_PFCFG			U(0x200C)
5241612559SVarun Wadekar 
5341612559SVarun Wadekar /*******************************************************************************
5441612559SVarun Wadekar  * Tegra Memory Controller constants
5541612559SVarun Wadekar  ******************************************************************************/
56b6533b56SAnthony Zhou #define TEGRA_MC_STREAMID_BASE		U(0x02C00000)
57b6533b56SAnthony Zhou #define TEGRA_MC_BASE			U(0x02C10000)
5841612559SVarun Wadekar 
593b2b3375SVarun Wadekar /* General Security Carveout register macros */
60b6533b56SAnthony Zhou #define MC_GSC_CONFIG_REGS_SIZE		U(0x40)
61b6533b56SAnthony Zhou #define MC_GSC_LOCK_CFG_SETTINGS_BIT	(U(1) << 1)
62b6533b56SAnthony Zhou #define MC_GSC_ENABLE_TZ_LOCK_BIT	(U(1) << 0)
63b6533b56SAnthony Zhou #define MC_GSC_SIZE_RANGE_4KB_SHIFT	U(27)
64b6533b56SAnthony Zhou #define MC_GSC_BASE_LO_SHIFT		U(12)
65b6533b56SAnthony Zhou #define MC_GSC_BASE_LO_MASK		U(0xFFFFF)
66b6533b56SAnthony Zhou #define MC_GSC_BASE_HI_SHIFT		U(0)
67b6533b56SAnthony Zhou #define MC_GSC_BASE_HI_MASK		U(3)
681d9aad42SVarun Wadekar #define MC_GSC_ENABLE_CPU_SECURE_BIT    (U(1) << 31)
693b2b3375SVarun Wadekar 
7041612559SVarun Wadekar /* TZDRAM carveout configuration registers */
71b6533b56SAnthony Zhou #define MC_SECURITY_CFG0_0		U(0x70)
72b6533b56SAnthony Zhou #define MC_SECURITY_CFG1_0		U(0x74)
73b6533b56SAnthony Zhou #define MC_SECURITY_CFG3_0		U(0x9BC)
7441612559SVarun Wadekar 
75c0e1bcd0SHarvey Hsieh #define MC_SECURITY_BOM_MASK		(U(0xFFF) << 20)
76c0e1bcd0SHarvey Hsieh #define MC_SECURITY_SIZE_MB_MASK	(U(0x1FFF) << 0)
77c0e1bcd0SHarvey Hsieh #define MC_SECURITY_BOM_HI_MASK		(U(0x3) << 0)
78c0e1bcd0SHarvey Hsieh 
7941612559SVarun Wadekar /* Video Memory carveout configuration registers */
80b6533b56SAnthony Zhou #define MC_VIDEO_PROTECT_BASE_HI	U(0x978)
81b6533b56SAnthony Zhou #define MC_VIDEO_PROTECT_BASE_LO	U(0x648)
82b6533b56SAnthony Zhou #define MC_VIDEO_PROTECT_SIZE_MB	U(0x64c)
8341612559SVarun Wadekar 
843b2b3375SVarun Wadekar /*
853b2b3375SVarun Wadekar  * Carveout (MC_SECURITY_CARVEOUT24) registers used to clear the
863b2b3375SVarun Wadekar  * non-overlapping Video memory region
873b2b3375SVarun Wadekar  */
88b6533b56SAnthony Zhou #define MC_VIDEO_PROTECT_CLEAR_CFG	U(0x25A0)
89b6533b56SAnthony Zhou #define MC_VIDEO_PROTECT_CLEAR_BASE_LO	U(0x25A4)
90b6533b56SAnthony Zhou #define MC_VIDEO_PROTECT_CLEAR_BASE_HI	U(0x25A8)
91b6533b56SAnthony Zhou #define MC_VIDEO_PROTECT_CLEAR_SIZE	U(0x25AC)
92b6533b56SAnthony Zhou #define MC_VIDEO_PROTECT_CLEAR_ACCESS_CFG0	U(0x25B0)
933b2b3375SVarun Wadekar 
9441612559SVarun Wadekar /* TZRAM carveout (MC_SECURITY_CARVEOUT11) configuration registers */
95b6533b56SAnthony Zhou #define MC_TZRAM_CARVEOUT_CFG		U(0x2190)
96b6533b56SAnthony Zhou #define MC_TZRAM_BASE_LO		U(0x2194)
97b6533b56SAnthony Zhou #define MC_TZRAM_BASE_HI		U(0x2198)
98b6533b56SAnthony Zhou #define MC_TZRAM_SIZE			U(0x219C)
991d9aad42SVarun Wadekar #define MC_TZRAM_CLIENT_ACCESS0_CFG0	U(0x21A0)
1001d9aad42SVarun Wadekar #define MC_TZRAM_CLIENT_ACCESS1_CFG0	U(0x21A4)
1011d9aad42SVarun Wadekar #define  TZRAM_ALLOW_MPCORER		(U(1) << 7)
1021d9aad42SVarun Wadekar #define  TZRAM_ALLOW_MPCOREW		(U(1) << 25)
10341612559SVarun Wadekar 
10441612559SVarun Wadekar /* Memory Controller Reset Control registers */
105b6533b56SAnthony Zhou #define  MC_CLIENT_HOTRESET_CTRL1_DLAA_FLUSH_ENB	(U(1) << 28)
106b6533b56SAnthony Zhou #define  MC_CLIENT_HOTRESET_CTRL1_DLA1A_FLUSH_ENB	(U(1) << 29)
107b6533b56SAnthony Zhou #define  MC_CLIENT_HOTRESET_CTRL1_PVA0A_FLUSH_ENB	(U(1) << 30)
108b6533b56SAnthony Zhou #define  MC_CLIENT_HOTRESET_CTRL1_PVA1A_FLUSH_ENB	(U(1) << 31)
10941612559SVarun Wadekar 
11041612559SVarun Wadekar /*******************************************************************************
11141612559SVarun Wadekar  * Tegra UART Controller constants
11241612559SVarun Wadekar  ******************************************************************************/
113b6533b56SAnthony Zhou #define TEGRA_UARTA_BASE		U(0x03100000)
114b6533b56SAnthony Zhou #define TEGRA_UARTB_BASE		U(0x03110000)
115b6533b56SAnthony Zhou #define TEGRA_UARTC_BASE		U(0x0C280000)
116b6533b56SAnthony Zhou #define TEGRA_UARTD_BASE		U(0x03130000)
117b6533b56SAnthony Zhou #define TEGRA_UARTE_BASE		U(0x03140000)
118b6533b56SAnthony Zhou #define TEGRA_UARTF_BASE		U(0x03150000)
119b6533b56SAnthony Zhou #define TEGRA_UARTG_BASE		U(0x0C290000)
12041612559SVarun Wadekar 
12141612559SVarun Wadekar /*******************************************************************************
12241612559SVarun Wadekar  * Tegra Fuse Controller related constants
12341612559SVarun Wadekar  ******************************************************************************/
124b6533b56SAnthony Zhou #define TEGRA_FUSE_BASE			U(0x03820000)
125b6533b56SAnthony Zhou #define  OPT_SUBREVISION		U(0x248)
126b6533b56SAnthony Zhou #define  SUBREVISION_MASK		U(0xF)
12741612559SVarun Wadekar 
12841612559SVarun Wadekar /*******************************************************************************
12941612559SVarun Wadekar  * GICv2 & interrupt handling related constants
13041612559SVarun Wadekar  ******************************************************************************/
131b6533b56SAnthony Zhou #define TEGRA_GICD_BASE			U(0x03881000)
132b6533b56SAnthony Zhou #define TEGRA_GICC_BASE			U(0x03882000)
13341612559SVarun Wadekar 
13441612559SVarun Wadekar /*******************************************************************************
13541612559SVarun Wadekar  * Security Engine related constants
13641612559SVarun Wadekar  ******************************************************************************/
137b6533b56SAnthony Zhou #define TEGRA_SE0_BASE			U(0x03AC0000)
138b6533b56SAnthony Zhou #define  SE_MUTEX_WATCHDOG_NS_LIMIT	U(0x6C)
139b6533b56SAnthony Zhou #define TEGRA_PKA1_BASE			U(0x03AD0000)
140b6533b56SAnthony Zhou #define  PKA_MUTEX_WATCHDOG_NS_LIMIT	U(0x8144)
141b6533b56SAnthony Zhou #define TEGRA_RNG1_BASE			U(0x03AE0000)
142b6533b56SAnthony Zhou #define  RNG_MUTEX_WATCHDOG_NS_LIMIT	U(0xFE0)
14341612559SVarun Wadekar 
14441612559SVarun Wadekar /*******************************************************************************
14541612559SVarun Wadekar  * Tegra micro-seconds timer constants
14641612559SVarun Wadekar  ******************************************************************************/
147b6533b56SAnthony Zhou #define TEGRA_TMRUS_BASE		U(0x0C2E0000)
148b6533b56SAnthony Zhou #define TEGRA_TMRUS_SIZE		U(0x10000)
14941612559SVarun Wadekar 
15041612559SVarun Wadekar /*******************************************************************************
15141612559SVarun Wadekar  * Tegra Power Mgmt Controller constants
15241612559SVarun Wadekar  ******************************************************************************/
153b6533b56SAnthony Zhou #define TEGRA_PMC_BASE			U(0x0C360000)
15441612559SVarun Wadekar 
15541612559SVarun Wadekar /*******************************************************************************
15641612559SVarun Wadekar  * Tegra scratch registers constants
15741612559SVarun Wadekar  ******************************************************************************/
158b6533b56SAnthony Zhou #define TEGRA_SCRATCH_BASE		U(0x0C390000)
159*192fd367SSteven Kao #define  SECURE_SCRATCH_RSV44_LO	U(0x1C4)
160*192fd367SSteven Kao #define  SECURE_SCRATCH_RSV44_HI	U(0x1C8)
161*192fd367SSteven Kao #define  SECURE_SCRATCH_RSV97		U(0x36C)
162*192fd367SSteven Kao #define  SECURE_SCRATCH_RSV99_LO	U(0x37C)
163*192fd367SSteven Kao #define  SECURE_SCRATCH_RSV99_HI	U(0x380)
164*192fd367SSteven Kao #define  SECURE_SCRATCH_RSV109_LO	U(0x3CC)
165*192fd367SSteven Kao #define  SECURE_SCRATCH_RSV109_HI	U(0x3D0)
166*192fd367SSteven Kao 
167*192fd367SSteven Kao #define SCRATCH_BL31_PARAMS_ADDR	SECURE_SCRATCH_RSV44_LO
168*192fd367SSteven Kao #define SCRATCH_BL31_PLAT_PARAMS_ADDR	SECURE_SCRATCH_RSV44_HI
169*192fd367SSteven Kao #define SCRATCH_SECURE_BOOTP_FCFG	SECURE_SCRATCH_RSV97
170*192fd367SSteven Kao #define SCRATCH_SMMU_TABLE_ADDR_LO	SECURE_SCRATCH_RSV99_LO
171*192fd367SSteven Kao #define SCRATCH_SMMU_TABLE_ADDR_HI	SECURE_SCRATCH_RSV99_HI
172*192fd367SSteven Kao #define SCRATCH_RESET_VECTOR_LO		SECURE_SCRATCH_RSV109_LO
173*192fd367SSteven Kao #define SCRATCH_RESET_VECTOR_HI		SECURE_SCRATCH_RSV109_HI
17441612559SVarun Wadekar 
17541612559SVarun Wadekar /*******************************************************************************
17641612559SVarun Wadekar  * Tegra Memory Mapped Control Register Access Bus constants
17741612559SVarun Wadekar  ******************************************************************************/
178b6533b56SAnthony Zhou #define TEGRA_MMCRAB_BASE		U(0x0E000000)
17941612559SVarun Wadekar 
18041612559SVarun Wadekar /*******************************************************************************
18141612559SVarun Wadekar  * Tegra SMMU Controller constants
18241612559SVarun Wadekar  ******************************************************************************/
183b6533b56SAnthony Zhou #define TEGRA_SMMU0_BASE		U(0x12000000)
184b6533b56SAnthony Zhou #define TEGRA_SMMU1_BASE		U(0x11000000)
185b6533b56SAnthony Zhou #define TEGRA_SMMU2_BASE		U(0x10000000)
18641612559SVarun Wadekar 
18741612559SVarun Wadekar /*******************************************************************************
18841612559SVarun Wadekar  * Tegra TZRAM constants
18941612559SVarun Wadekar  ******************************************************************************/
190b6533b56SAnthony Zhou #define TEGRA_TZRAM_BASE		U(0x40000000)
191b6533b56SAnthony Zhou #define TEGRA_TZRAM_SIZE		U(0x40000)
19241612559SVarun Wadekar 
19341612559SVarun Wadekar /*******************************************************************************
19441612559SVarun Wadekar  * Tegra Clock and Reset Controller constants
19541612559SVarun Wadekar  ******************************************************************************/
196b6533b56SAnthony Zhou #define TEGRA_CAR_RESET_BASE		U(0x20000000)
19741612559SVarun Wadekar 
198719fdb6eSVarun Wadekar /*******************************************************************************
199bc019041SAjay Gupta  * XUSB PADCTL
200bc019041SAjay Gupta  ******************************************************************************/
201b6533b56SAnthony Zhou #define TEGRA_XUSB_PADCTL_BASE			U(0x3520000)
202b6533b56SAnthony Zhou #define TEGRA_XUSB_PADCTL_SIZE			U(0x10000)
203b6533b56SAnthony Zhou #define XUSB_PADCTL_HOST_AXI_STREAMID_PF_0	U(0x136c)
204b6533b56SAnthony Zhou #define XUSB_PADCTL_HOST_AXI_STREAMID_VF_0	U(0x1370)
205b6533b56SAnthony Zhou #define XUSB_PADCTL_HOST_AXI_STREAMID_VF_1	U(0x1374)
206b6533b56SAnthony Zhou #define XUSB_PADCTL_HOST_AXI_STREAMID_VF_2	U(0x1378)
207b6533b56SAnthony Zhou #define XUSB_PADCTL_HOST_AXI_STREAMID_VF_3	U(0x137c)
208b6533b56SAnthony Zhou #define XUSB_PADCTL_DEV_AXI_STREAMID_PF_0	U(0x139c)
209bc019041SAjay Gupta 
210bc019041SAjay Gupta /*******************************************************************************
211bc019041SAjay Gupta  * XUSB STREAMIDs
212bc019041SAjay Gupta  ******************************************************************************/
213b6533b56SAnthony Zhou #define TEGRA_SID_XUSB_HOST			U(0x1b)
214b6533b56SAnthony Zhou #define TEGRA_SID_XUSB_DEV			U(0x1c)
215b6533b56SAnthony Zhou #define TEGRA_SID_XUSB_VF0			U(0x5d)
216b6533b56SAnthony Zhou #define TEGRA_SID_XUSB_VF1			U(0x5e)
217b6533b56SAnthony Zhou #define TEGRA_SID_XUSB_VF2			U(0x5f)
218b6533b56SAnthony Zhou #define TEGRA_SID_XUSB_VF3			U(0x60)
219bc019041SAjay Gupta 
22041612559SVarun Wadekar #endif /* __TEGRA_DEF_H__ */
221