blob: 5bfda5db94d07ca033cb008d173438125a5d2d7a [file] [log] [blame]
Andre Przywaraaa26f532017-12-08 01:27:02 +00001/*
Samuel Holland73186552021-01-24 17:06:54 -06002 * Copyright (c) 2017-2021, ARM Limited and Contributors. All rights reserved.
Andre Przywaraaa26f532017-12-08 01:27:02 +00003 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
Antonio Nino Diaz5eb88372018-11-08 10:20:19 +00007#ifndef SUNXI_CPUCFG_H
8#define SUNXI_CPUCFG_H
Andre Przywaraaa26f532017-12-08 01:27:02 +00009
10#include <sunxi_mmap.h>
11
12/* c = cluster, n = core */
13#define SUNXI_CPUCFG_CLS_CTRL_REG0(c) (SUNXI_CPUCFG_BASE + 0x0010 + (c) * 0x10)
14#define SUNXI_CPUCFG_CLS_CTRL_REG1(c) (SUNXI_CPUCFG_BASE + 0x0014 + (c) * 0x10)
15#define SUNXI_CPUCFG_CACHE_CFG_REG (SUNXI_CPUCFG_BASE + 0x0024)
16#define SUNXI_CPUCFG_DBG_REG0 (SUNXI_CPUCFG_BASE + 0x00c0)
17
18#define SUNXI_CPUCFG_RST_CTRL_REG(c) (SUNXI_CPUCFG_BASE + 0x0000 + (c) * 4)
19#define SUNXI_CPUCFG_RVBAR_LO_REG(n) (SUNXI_CPUCFG_BASE + 0x0040 + (n) * 8)
20#define SUNXI_CPUCFG_RVBAR_HI_REG(n) (SUNXI_CPUCFG_BASE + 0x0044 + (n) * 8)
21
22#define SUNXI_POWERON_RST_REG(c) (SUNXI_R_CPUCFG_BASE + 0x0040 + (c) * 4)
23#define SUNXI_POWEROFF_GATING_REG(c) (SUNXI_R_CPUCFG_BASE + 0x0044 + (c) * 4)
24#define SUNXI_CPU_POWER_CLAMP_REG(c, n) (SUNXI_R_CPUCFG_BASE + 0x0050 + \
25 (c) * 0x10 + (n) * 4)
26
Samuel Holland73186552021-01-24 17:06:54 -060027#define SUNXI_CPUIDLE_EN_REG (SUNXI_R_CPUCFG_BASE + 0x0100)
28#define SUNXI_CORE_CLOSE_REG (SUNXI_R_CPUCFG_BASE + 0x0104)
29#define SUNXI_PWR_SW_DELAY_REG (SUNXI_R_CPUCFG_BASE + 0x0140)
30#define SUNXI_CONFIG_DELAY_REG (SUNXI_R_CPUCFG_BASE + 0x0144)
31
Icenowy Zheng6f515d02021-07-22 09:35:19 +080032#define SUNXI_AA64nAA32_REG SUNXI_CPUCFG_CLS_CTRL_REG0
33#define SUNXI_AA64nAA32_OFFSET 24
34
Antonio Nino Diaz5eb88372018-11-08 10:20:19 +000035#endif /* SUNXI_CPUCFG_H */