xref: /rk3399_ARM-atf/plat/allwinner/common/include/sunxi_cpucfg_ncat.h (revision e603983d3703a0c9cee3f43baf550ca397e20b34)
1573d600eSAndre Przywara /*
2573d600eSAndre Przywara  * Copyright (c) 2017-2021, ARM Limited and Contributors. All rights reserved.
3573d600eSAndre Przywara  *
4573d600eSAndre Przywara  * SPDX-License-Identifier: BSD-3-Clause
5573d600eSAndre Przywara  */
6573d600eSAndre Przywara 
7573d600eSAndre Przywara #ifndef SUNXI_CPUCFG_H
8573d600eSAndre Przywara #define SUNXI_CPUCFG_H
9573d600eSAndre Przywara 
10573d600eSAndre Przywara #include <sunxi_mmap.h>
11573d600eSAndre Przywara 
12573d600eSAndre Przywara /* c = cluster, n = core */
13573d600eSAndre Przywara #define SUNXI_CPUCFG_CLS_CTRL_REG0(c)	(SUNXI_CPUCFG_BASE + 0x0010 + (c) * 0x10)
14573d600eSAndre Przywara #define SUNXI_CPUCFG_CLS_CTRL_REG1(c)	(SUNXI_CPUCFG_BASE + 0x0014 + (c) * 0x10)
15573d600eSAndre Przywara #define SUNXI_CPUCFG_CACHE_CFG_REG	(SUNXI_CPUCFG_BASE + 0x0024)
16*b15e2cdaSMikhail Kalashnikov /* The T507 datasheet does not mention this register. */
17573d600eSAndre Przywara #define SUNXI_CPUCFG_DBG_REG0		(SUNXI_CPUCFG_BASE + 0x00c0)
18573d600eSAndre Przywara 
19573d600eSAndre Przywara #define SUNXI_CPUCFG_RST_CTRL_REG(c)	(SUNXI_CPUCFG_BASE + 0x0000 + (c) * 4)
20573d600eSAndre Przywara #define SUNXI_CPUCFG_RVBAR_LO_REG(n)	(SUNXI_CPUCFG_BASE + 0x0040 + (n) * 8)
21573d600eSAndre Przywara #define SUNXI_CPUCFG_RVBAR_HI_REG(n)	(SUNXI_CPUCFG_BASE + 0x0044 + (n) * 8)
22573d600eSAndre Przywara 
23*b15e2cdaSMikhail Kalashnikov #define SUNXI_C0_CPU_CTRL_REG(n)	(SUNXI_CPUCFG_BASE + 0x0060 + (n) * 4)
24*b15e2cdaSMikhail Kalashnikov 
25*b15e2cdaSMikhail Kalashnikov #define SUNXI_CPU_CTRL_REG(n)		(SUNXI_CPUSUBSYS_BASE + 0x20 + (n) * 4)
26*b15e2cdaSMikhail Kalashnikov #define SUNXI_ALT_RVBAR_LO_REG(n)	(SUNXI_CPUSUBSYS_BASE + 0x40 + (n) * 8)
27*b15e2cdaSMikhail Kalashnikov #define SUNXI_ALT_RVBAR_HI_REG(n)	(SUNXI_CPUSUBSYS_BASE + 0x44 + (n) * 8)
28*b15e2cdaSMikhail Kalashnikov 
29573d600eSAndre Przywara #define SUNXI_POWERON_RST_REG(c)	(SUNXI_R_CPUCFG_BASE + 0x0040 + (c) * 4)
30573d600eSAndre Przywara #define SUNXI_POWEROFF_GATING_REG(c)	(SUNXI_R_CPUCFG_BASE + 0x0044 + (c) * 4)
31573d600eSAndre Przywara #define SUNXI_CPU_POWER_CLAMP_REG(c, n)	(SUNXI_R_CPUCFG_BASE + 0x0050 + \
32573d600eSAndre Przywara 					(c) * 0x10 + (n) * 4)
33*b15e2cdaSMikhail Kalashnikov #define SUNXI_CPU_UNK_REG(n)		(SUNXI_R_CPUCFG_BASE + 0x0070 + (n) * 4)
34573d600eSAndre Przywara 
35573d600eSAndre Przywara #define SUNXI_CPUIDLE_EN_REG		(SUNXI_R_CPUCFG_BASE + 0x0100)
36573d600eSAndre Przywara #define SUNXI_CORE_CLOSE_REG		(SUNXI_R_CPUCFG_BASE + 0x0104)
37573d600eSAndre Przywara #define SUNXI_PWR_SW_DELAY_REG		(SUNXI_R_CPUCFG_BASE + 0x0140)
38573d600eSAndre Przywara #define SUNXI_CONFIG_DELAY_REG		(SUNXI_R_CPUCFG_BASE + 0x0144)
39573d600eSAndre Przywara 
40573d600eSAndre Przywara #define SUNXI_AA64nAA32_REG		SUNXI_CPUCFG_CLS_CTRL_REG0
41573d600eSAndre Przywara #define SUNXI_AA64nAA32_OFFSET		24
42573d600eSAndre Przywara 
43573d600eSAndre Przywara #endif /* SUNXI_CPUCFG_H */
44