SyterKit 0.4.0.x
SyterKit is a bare-metal framework
Loading...
Searching...
No Matches
reg-ccu.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: GPL-2.0+ */
2
3#ifndef __SUN8IW21_REG_CCU_H__
4#define __SUN8IW21_REG_CCU_H__
5
6#include <reg-ncat.h>
7
8#define CCU_BASE SUNXI_CCU_BASE
9
10#define CCU_PLL_CPU_CTRL_REG 0x0000 /* PLL_CPU Control Register */
11#define CCU_PLL_DDR_CTRL_REG 0x0010 /* PLL_DDR Control Register */
12#define CCU_PLL_PERI_CTRL_REG 0x0020 /* PLL_PERI Control Register */
13#define CCU_PLL_VIDEO_CTRL_REG 0x0040 /* PLL_VIDEO Control Register */
14#define CCU_PLL_CSI_CTRL_REG 0x0048 /* PLL_CSI Control Register */
15#define CCU_PLL_AUDIO_CTRL_REG 0x0078 /* PLL_AUDIO Control Register */
16#define CCU_PLL_NPU_CTRL_REG 0x0080 /* PLL_NPU Control Register */
17#define CCU_PLL_DDR_PAT0_CTRL_REG 0x0110 /* PLL_DDR Pattern0 Control Register */
18#define CCU_PLL_DDR_PAT1_CTRL_REG 0x0114 /* PLL_DDR Pattern1 Control Register */
19#define CCU_PLL_PERI_PAT0_CTRL_REG 0x0120 /* PLL_PERI Pattern0 Control Register */
20#define CCU_PLL_PERI_PAT1_CTRL_REG 0x0124 /* PLL_PERI Pattern1 Control Register */
21#define CCU_PLL_VIDEO_PAT0_CTRL_REG 0x0140 /* PLL_VIDEO Pattern0 Control Register */
22#define CCU_PLL_VIDEO_PAT1_CTRL_REG 0x0144 /* PLL_VIDEO Pattern1 Control Register */
23#define CCU_PLL_CSI_PAT0_CTRL_REG 0x0148 /* PLL_CSI Pattern0 Control Register */
24#define CCU_PLL_CSI_PAT1_CTRL_REG 0x014C /* PLL_CSI Pattern1 Control Register */
25#define CCU_PLL_AUDIO_PAT0_CTRL_REG 0x0178 /* PLL_AUDIO Pattern0 Control Register */
26#define CCU_PLL_AUDIO_PAT1_CTRL_REG 0x017C /* PLL_AUDIO Pattern1 Control Register */
27#define CCU_PLL_NPU_PAT0_CTRL_REG 0x0180 /* PLL_NPU Pattern0 Control Register */
28#define CCU_PLL_NPU_PAT1_CTRL_REG 0x0184 /* PLL_NPU Pattern1 Control Register */
29#define CCU_PLL_CPU_BIAS_REG 0x0300 /* PLL_CPU Bias Register */
30#define CCU_PLL_DDR_BIAS_REG 0x0310 /* PLL_DDR Bias Register */
31#define CCU_PLL_PERI_BIAS_REG 0x0320 /* PLL_PERI Bias Register */
32#define CCU_PLL_VIDEO_BIAS_REG 0x0340 /* PLL_VIDEO Bias Register */
33#define CCU_PLL_CSI_BIAS_REG 0x0348 /* PLL_CSI Bias Register */
34#define CCU_PLL_AUDIO_BIAS_REG 0x0378 /* PLL_AUDIO Bias Register */
35#define CCU_PLL_NPU_BIAS_REG 0x0380 /* PLL_NPU Bias Register */
36#define CCU_PLL_CPU_TUN_REG 0x0400 /* PLL_CPU Tuning Register */
37#define CCU_CPU_CLK_REG 0x0500 /* CPU Clock Register */
38#define CCU_CPU_GATING_REG 0x0504 /* CPU Gating Configuration Register */
39#define CCU_AHB_CLK_REG 0x0510 /* AHB Clock Register */
40#define CCU_APB0_CLK_REG 0x0520 /* APB0 Clock Register */
41#define CCU_APB1_CLK_REG 0x0524 /* APB1 Clock Register */
42#define CCU_MBUS_CLK_REG 0x0540 /* MBUS Clock Register */
43#define CCU_DE_CLK_REG 0x0600 /* DE Clock Register */
44#define CCU_DE_BGR_REG 0x060C /* DE Bus Gating Reset Register */
45#define CCU_G2D_CLK_REG 0x0630 /* G2D Clock Register */
46#define CCU_G2D_BGR_REG 0x063C /* G2D Bus Gating Reset Register */
47#define CCU_CE_CLK_REG 0x0680 /* CE Clock Register */
48#define CCU_CE_BGR_REG 0x068C /* CE Bus Gating Reset Register */
49#define CCU_VE_CLK_REG 0x0690 /* VE Clock Register */
50#define CCU_VE_BGR_REG 0x069C /* VE Bus Gating Reset Register */
51#define CCU_NPU_CLK_REG 0x06E0 /* NPU Clock Register */
52#define CCU_NPU_BGR_REG 0x06EC /* NPU Bus Gating Reset Register */
53#define CCU_DMA_BGR_REG 0x070C /* DMA Bus Gating Reset Register */
54#define CCU_MSGBOX_BGR_REG 0x071C /* MSGBOX Bus Gating Reset Register */
55#define CCU_SPINLOCK_BGR_REG 0x072C /* SPINLOCK Bus Gating Reset Register */
56#define CCU_HSTIMER_BGR_REG 0x073C /* HSTIMER Bus Gating Reset Register */
57#define CCU_AVS_CLK_REG 0x0740 /* AVS Clock Register */
58#define CCU_DBGSYS_BGR_REG 0x078C /* DBGSYS Bus Gating Reset Register */
59#define CCU_PWM_BGR_REG 0x07AC /* PWM Bus Gating Reset Register */
60#define CCU_IOMMU_BGR_REG 0x07BC /* IOMMU Bus Gating Reset Register */
61#define CCU_DRAM_CLK_REG 0x0800 /* DRAM Clock Register */
62#define CCU_MBUS_MAT_CLK_GATING_REG 0x0804 /* MBUS Master Clock Gating Register */
63#define CCU_DRAM_BGR_REG 0x080C /* DRAM Bus Gating Reset Register */
64#define CCU_SMHC0_CLK_REG 0x0830 /* SMHC0 Clock Register */
65#define CCU_SMHC1_CLK_REG 0x0834 /* SMHC1 Clock Register */
66#define CCU_SMHC2_CLK_REG 0x0838 /* SMHC2 Clock Register */
67#define CCU_SMHC_BGR_REG 0x084C /* SMHC Bus Gating Reset Register */
68#define CCU_UART_BGR_REG 0x090C /* UART Bus Gating Reset Register */
69#define CCU_TWI_BGR_REG 0x091C /* TWI Bus Gating Reset Register */
70#define CCU_SPI0_CLK_REG 0x0940 /* SPI0 Clock Register */
71#define CCU_SPI1_CLK_REG 0x0944 /* SPI1 Clock Register */
72#define CCU_SPI2_CLK_REG 0x0948 /* SPI2 Clock Register */
73#define CCU_SPI3_CLK_REG 0x094C /* SPI3 Clock Register */
74#define CCU_SPI_BGR_REG 0x096C /* SPI Bus Gating Reset Register */
75#define CCU_EMAC_25M_CLK_REG 0x0970 /* EMAC_25M Clock Register */
76#define CCU_EMAC_BGR_REG 0x097C /* EMAC Bus Gating Reset Register */
77#define CCU_GPADC_BGR_REG 0x09EC /* GPADC Bus Gating Reset Register */
78#define CCU_THS_BGR_REG 0x09FC /* THS Bus Gating Reset Register */
79#define CCU_I2S1_CLK_REG 0x0A14 /* I2S1 Clock Register */
80#define CCU_I2S_BGR_REG 0x0A20 /* I2S Bus Gating Reset Register */
81#define CCU_DMIC_CLK_REG 0x0A40 /* DMIC Clock Register */
82#define CCU_DMIC_BGR_REG 0x0A4C /* DMIC Bus Gating Reset Register */
83#define CCU_AUDIO_CODEC_DAC_CLK_REG 0x0A50 /* AUDIO_CODEC_DAC Clock Register */
84#define CCU_AUDIO_CODEC_ADC_CLK_REG 0x0A54 /* AUDIO_CODEC_ADC Clock Register */
85#define CCU_AUDIO_CODEC_BGR_REG 0x0A5C /* AUDIO_CODEC Bus Gating Reset Register */
86#define CCU_USB0_CLK_REG 0x0A70 /* USB0 Clock Register */
87#define CCU_USB_BGR_REG 0x0A8C /* USB Bus Gating Reset Register */
88#define CCU_DPSS_TOP_BGR_REG 0x0ABC /* DPSS_TOP Bus Gating Reset Register */
89#define CCU_DSI_CLK_REG 0x0B24 /* DSI Clock Register */
90#define CCU_DSI_BGR_REG 0x0B4C /* DSI Bus Gating Reset Register */
91#define CCU_TCONLCD_CLK_REG 0x0B60 /* TCONLCD Clock Register */
92#define CCU_TCONLCD_BGR_REG 0x0B7C /* TCONLCD Bus Gating Reset Register */
93#define CCU_CSI_CLK_REG 0x0C04 /* CSI Clock Register */
94#define CCU_CSI_MASTER0_CLK_REG 0x0C08 /* CSI Master0 Clock Register */
95#define CCU_CSI_MASTER1_CLK_REG 0x0C0C /* CSI Master1 Clock Register */
96#define CCU_CSI_MASTER2_CLK_REG 0x0C10 /* CSI Master2 Clock Register */
97#define CCU_CSI_BGR_REG 0x0C2C /* CSI Bus Gating Reset Register */
98#define CCU_WIEGAND_BGR_REG 0x0C7C /* WIEGAND Bus Gating Reset Register */
99#define CCU_PLL_PRE_DIV_REG 0x0E00 /* PLL Pre Divider Register */
100#define CCU_AHB_GATE_EN_REG 0x0E04 /* AHB Gate Enable Register */
101#define CCU_PERIPLL_GATE_EN_REG 0x0E08 /* PERIPLL Gate Enable Register */
102#define CCU_CLK24M_GATE_EN_REG 0x0E0C /* CLK24M Gate Enable Register */
103#define CCU_CCMU_SEC_SWITCH_REG 0x0F00 /* CCMU Security Switch Register */
104#define CCU_GPADC_CLK_SEL_REG 0x0F04 /* GPADC Clock Select Register */
105#define CCU_FRE_DET_CTRL_REG 0x0F08 /* Frequency Detect Control Register */
106#define CCU_FRE_UP_LIM_REG 0x0F0C /* Frequency Up Limit Register */
107#define CCU_FRE_DOWN_LIM_REG 0x0F10 /* Frequency Down Limit Register */
108#define CCU_CCMU_FAN_GATE_REG 0x0F30 /* CCMU FANOUT CLOCK GATE Register */
109#define CCU_CLK27M_FAN_REG 0x0F34 /* CLK27M FANOUT Register */
110#define CCU_CLK_FAN_REG 0x0F38 /* CLK FANOUT Register */
111#define CCU_CCMU_FAN_REG 0x0F3C /* CCMU FANOUT Register */
112
113/* MMC clock bit field */
114#define CCU_MMC_CTRL_M(x) ((x) -1)
115#define CCU_MMC_CTRL_N(x) ((x) << 8)
116#define CCU_MMC_CTRL_OSCM24 (0x0 << 24)
117#define CCU_MMC_CTRL_PERI_400M (0x1 << 24)
118#define CCU_MMC_CTRL_PERI_300M (0x2 << 24)
119#define CCU_MMC_CTRL_PLL_PERIPH1X CCU_MMC_CTRL_PERI_400M
120#define CCU_MMC_CTRL_PLL_PERIPH2X CCU_MMC_CTRL_PERI_300M
121#define CCU_MMC_CTRL_ENABLE (0x1 << 31)
122/* if doesn't have these delays */
123#define CCU_MMC_CTRL_OCLK_DLY(a) ((void) (a), 0)
124#define CCU_MMC_CTRL_SCLK_DLY(a) ((void) (a), 0)
125
126#define CCU_MMC_BGR_SMHC0_GATE (1 << 0)
127#define CCU_MMC_BGR_SMHC1_GATE (1 << 1)
128#define CCU_MMC_BGR_SMHC2_GATE (1 << 2)
129
130#define CCU_MMC_BGR_SMHC0_RST (1 << 16)
131#define CCU_MMC_BGR_SMHC1_RST (1 << 17)
132#define CCU_MMC_BGR_SMHC2_RST (1 << 18)
133
134/* This file defines the register addresses and bit fields for
135 * controlling the RISC-V subsystem in the CCU module.
136 */
137#define CCU_RISCV_GATING_RST_REG (CCU_BASE + 0x0d04)// Register address for RISC-V gating reset control
138#define CCU_RISCV_GATING_RST_FIELD (0x16aa << 16) // Bit field value for RISC-V gating reset
139#define CCU_RISCV_SYS_APB_SOFT_RSTN (0x1 << 2) // Bit field value for RISC-V system APB soft reset
140#define CCU_RISCV_SOFT_RSTN (0x1 << 1) // Bit field value for RISC-V soft reset
141#define CCU_RISCV_CLK_GATING (0x1 << 0) // Bit field value for RISC-V clock gating
142
143#define CCU_RISCV_CLK_REG (CCU_BASE + 0x0d00)// Register address for RISC-V clock control
144#define CCU_RISCV_CLK_MASK (0x7 << 24) // Bit mask for RISC-V clock selection
145#define CCU_RISCV_CLK_HOSC (0) // Bit field value for high-frequency oscillator clock
146#define CCU_RISCV_CLK_32K (0x1 << 24) // Bit field value for 32 kHz clock
147#define CCU_RISCV_CLK_16M (0x2 << 24) // Bit field value for 16 MHz clock
148#define CCU_RISCV_CLK_PERI_600M (0x3 << 24) // Bit field value for 600 MHz peripheral clock
149#define CCU_RISCV_CLK_PERI_480M (0x4 << 24) // Bit field value for 480 MHz peripheral clock
150#define CCU_RISCV_CLK_CPUPLL (0x5 << 24) // Bit field value for CPU PLL clock
151
152#define CCU_PLL_CPUX_TUNING_REG (0x1400)// Register address for CPU PLL tuning control
153
154#define CCU_RISCV_CFG_BGR_REG (CCU_BASE + 0x0d0c)// Register address for RISC-V configuration BGR control
155#define CCU_RISCV_CFG_RST (0x1 << 16) // Bit field value for RISC-V configuration reset
156#define CCU_RISCV_CFG_GATING (0x1 << 0) // Bit field value for RISC-V configuration gating
157
158#endif// __SUN8IW21_REG_CCU_H__