Jernej Skrabec | e331301 | 2021-01-11 21:11:37 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
| 2 | /* |
| 3 | * Sunxi H6 Power Management Unit register definition. |
| 4 | * |
| 5 | * (C) Copyright 2020 Jernej Skrabec <jernej.skrabec@siol.net> |
| 6 | */ |
| 7 | |
| 8 | #ifndef _SUN50I_PRCM_H |
| 9 | #define _SUN50I_PRCM_H |
| 10 | |
| 11 | #ifndef __ASSEMBLY__ |
| 12 | #include <linux/compiler.h> |
| 13 | |
Andre Przywara | f9987ca | 2025-01-24 22:49:40 +0000 | [diff] [blame^] | 14 | #define CCU_PRCM_I2C_GATE_RESET 0x19c |
| 15 | #define CCU_PRCM_PLL_LDO_CFG 0x244 |
| 16 | #define CCU_PRCM_SYS_PWROFF_GATING 0x250 |
| 17 | #define CCU_PRCM_RES_CAL_CTRL 0x310 |
| 18 | |
Jernej Skrabec | e331301 | 2021-01-11 21:11:37 +0100 | [diff] [blame] | 19 | struct sunxi_prcm_reg { |
| 20 | u32 cpus_cfg; /* 0x000 */ |
| 21 | u8 res0[0x8]; /* 0x004 */ |
| 22 | u32 apbs1_cfg; /* 0x00c */ |
| 23 | u32 apbs2_cfg; /* 0x010 */ |
| 24 | u8 res1[0x108]; /* 0x014 */ |
| 25 | u32 tmr_gate_reset; /* 0x11c */ |
| 26 | u8 res2[0xc]; /* 0x120 */ |
| 27 | u32 twd_gate_reset; /* 0x12c */ |
| 28 | u8 res3[0xc]; /* 0x130 */ |
| 29 | u32 pwm_gate_reset; /* 0x13c */ |
| 30 | u8 res4[0x4c]; /* 0x140 */ |
| 31 | u32 uart_gate_reset; /* 0x18c */ |
| 32 | u8 res5[0xc]; /* 0x190 */ |
| 33 | u32 twi_gate_reset; /* 0x19c */ |
| 34 | u8 res6[0x1c]; /* 0x1a0 */ |
| 35 | u32 rsb_gate_reset; /* 0x1bc */ |
| 36 | u32 cir_cfg; /* 0x1c0 */ |
| 37 | u8 res7[0x8]; /* 0x1c4 */ |
| 38 | u32 cir_gate_reset; /* 0x1cc */ |
| 39 | u8 res8[0x10]; /* 0x1d0 */ |
| 40 | u32 w1_cfg; /* 0x1e0 */ |
| 41 | u8 res9[0x8]; /* 0x1e4 */ |
| 42 | u32 w1_gate_reset; /* 0x1ec */ |
| 43 | u8 res10[0x1c]; /* 0x1f0 */ |
| 44 | u32 rtc_gate_reset; /* 0x20c */ |
Jernej Skrabec | e04cd49 | 2022-01-30 15:27:13 +0100 | [diff] [blame] | 45 | u8 res11[0x34]; /* 0x210 */ |
| 46 | u32 pll_ldo_cfg; /* 0x244 */ |
| 47 | u8 res12[0x8]; /* 0x248 */ |
| 48 | u32 sys_pwroff_gating; /* 0x250 */ |
| 49 | u8 res13[0xbc]; /* 0x254 */ |
| 50 | u32 res_cal_ctrl; /* 0x310 */ |
| 51 | u32 ohms200; /* 0x314 */ |
| 52 | u32 ohms240; /* 0x318 */ |
| 53 | u32 res_cal_status; /* 0x31c */ |
Jernej Skrabec | e331301 | 2021-01-11 21:11:37 +0100 | [diff] [blame] | 54 | }; |
| 55 | check_member(sunxi_prcm_reg, rtc_gate_reset, 0x20c); |
Jernej Skrabec | e04cd49 | 2022-01-30 15:27:13 +0100 | [diff] [blame] | 56 | check_member(sunxi_prcm_reg, res_cal_status, 0x31c); |
Jernej Skrabec | e331301 | 2021-01-11 21:11:37 +0100 | [diff] [blame] | 57 | |
| 58 | #define PRCM_TWI_GATE (1 << 0) |
| 59 | #define PRCM_TWI_RESET (1 << 16) |
| 60 | |
| 61 | #endif /* __ASSEMBLY__ */ |
| 62 | #endif /* _PRCM_H */ |