SyterKit
0.4.0.x
SyterKit is a bare-metal framework
Loading...
Searching...
No Matches
include
drivers
chips
sun50iw9
reg-ccu.h
Go to the documentation of this file.
1
/* SPDX-License-Identifier: GPL-2.0+ */
2
/*
3
* (C) Copyright 2013-2025
4
* Allwinner Technology Co., Ltd. <www.allwinnertech.com>
5
*
6
* original from bsp uboot defines
7
*/
8
9
#ifndef __SUN50IW9_REG_CCU_H__
10
#define __SUN50IW9_REG_CCU_H__
11
12
#include <
reg-ncat.h
>
13
14
#define CCU_BASE SUNXI_CCM_BASE
15
16
/* pll list */
17
#define CCU_PLL_CPUX_CTRL_REG (0x00)
18
#define CCU_PLL_DDR0_CTRL_REG (0x10)
19
#define CCU_PLL_DDR1_CTRL_REG (0x18)
20
#define CCU_PLL_PERI0_CTRL_REG (0x20)
21
#define CCU_PLL_PERI1_CTRL_REG (0x28)
22
23
#define CCU_PLL_HSIC_CTRL_REG (0x70)
24
25
26
/* cfg list */
27
#define CCU_CPUX_AXI_CFG_REG (0x500)
28
#define CCU_PSI_AHB1_AHB2_CFG_REG (0x510)
29
#define CCU_AHB3_CFG_GREG (0x51C)
30
#define CCU_APB1_CFG_GREG (0x520)
31
#define CCU_APB2_CFG_GREG (0x524)
32
#define CCU_MBUS_CFG_REG (0x540)
33
34
#define CCU_CE_CLK_REG (0x680)
35
#define CCU_CE_BGR_REG (0x68C)
36
37
#define CCU_VE_CLK_REG (0x690)
38
#define CCU_VE_BGR_REG (0x69C)
39
40
/*SYS*/
41
#define CCU_DMA_BGR_REG (0x70C)
42
#define CCU_AVS_CLK_REG (0x740)
43
#define CCU_AVS_BGR_REG (0x74C)
44
45
/*IOMMU*/
46
#define CCU_IOMMU_BGR_REG (0x7bc)
47
#define IOMMU_AUTO_GATING_REG (SUNXI_IOMMU_BASE + 0X40)
48
49
/* storage */
50
#define CCU_DRAM_CLK_REG (0x800)
51
#define CCU_MBUS_MAT_CLK_GATING_REG (0x804)
52
#define CCU_PLL_DDR_AUX_REG (0x808)
53
#define CCU_DRAM_BGR_REG (0x80C)
54
55
#define CCU_NAND_CLK_REG (0x810)
56
#define CCU_NAND_BGR_REG (0x82C)
57
58
#define CCU_SMHC0_CLK_REG (0x830)
59
#define CCU_SMHC1_CLK_REG (0x834)
60
#define CCU_SMHC2_CLK_REG (0x838)
61
#define CCU_SMHC_BGR_REG (0x84c)
62
63
/*normal interface*/
64
#define CCU_UART_BGR_REG (0x90C)
65
#define CCU_TWI_BGR_REG (0x91C)
66
67
#define CCU_SCR_BGR_REG (0x93C)
68
69
#define CCU_SPI0_CLK_REG (0x940)
70
#define CCU_SPI1_CLK_REG (0x944)
71
#define CCU_SPI_BGR_REG (0x96C)
72
#define CCU_USB0_CLK_REG (0xA70)
73
#define CCU_USB_BGR_REG (0xA8C)
74
75
/*DMA*/
76
#define DMA_GATING_BASE CCU_DMA_BGR_REG
77
#define DMA_GATING_PASS (1)
78
#define DMA_GATING_BIT (0)
79
80
/*CE*/
81
#define CE_CLK_SRC_MASK (0x1)
82
#define CE_CLK_SRC_SEL_BIT (24)
83
#define CE_CLK_SRC (0x01)
84
85
#define CE_CLK_DIV_RATION_N_BIT (8)
86
#define CE_CLK_DIV_RATION_N_MASK (0x3)
87
#define CE_CLK_DIV_RATION_N (0)
88
89
#define CE_CLK_DIV_RATION_M_BIT (0)
90
#define CE_CLK_DIV_RATION_M_MASK (0xF)
91
#define CE_CLK_DIV_RATION_M (3)
92
93
#define CE_SCLK_ONOFF_BIT (31)
94
#define CE_SCLK_ON (1)
95
96
#define CE_GATING_BASE CCU_CE_BGR_REG
97
#define CE_GATING_PASS (1)
98
#define CE_GATING_BIT (0)
99
100
#define CE_RST_REG_BASE CCU_CE_BGR_REG
101
#define CE_RST_BIT (16)
102
#define CE_DEASSERT (1)
103
104
/*gpadc gate and reset reg*/
105
#define CCU_GPADC_BGR_REG (0x09EC)
106
107
/* ehci */
108
#define BUS_CLK_GATING_REG 0x60
109
#define BUS_SOFTWARE_RESET_REG 0x2c0
110
#define USBPHY_CONFIG_REG 0xcc
111
112
#define USBEHCI0_RST_BIT 24
113
#define USBEHCI0_GATIING_BIT 24
114
#define USBPHY0_RST_BIT 0
115
#define USBPHY0_SCLK_GATING_BIT 8
116
117
#define USBEHCI1_RST_BIT 25
118
#define USBEHCI1_GATIING_BIT 25
119
#define USBPHY1_RST_BIT 1
120
#define USBPHY1_SCLK_GATING_BIT 9
121
122
/* MMC clock bit field */
123
#define CCU_MMC_CTRL_M(x) ((x) -1)
124
#define CCU_MMC_CTRL_N(x) ((x) << 8)
125
#define CCU_MMC_CTRL_OSCM24 (0x0 << 24)
126
#define CCU_MMC_CTRL_PLL6X1 (0x1 << 24)
127
#define CCU_MMC_CTRL_PLL6X2 (0x2 << 24)
128
#define CCU_MMC_CTRL_PLL_PERIPH1X CCU_MMC_CTRL_PLL6X1
129
#define CCU_MMC_CTRL_PLL_PERIPH2X CCU_MMC_CTRL_PLL6X2
130
#define CCU_MMC_CTRL_ENABLE (0x1 << 31)
131
132
/* if doesn't have these delays */
133
#define CCU_MMC_CTRL_OCLK_DLY(a) ((void) (a), 0)
134
#define CCU_MMC_CTRL_SCLK_DLY(a) ((void) (a), 0)
135
136
#define CCU_MMC_BGR_SMHC0_GATE (1 << 0)
137
#define CCU_MMC_BGR_SMHC1_GATE (1 << 1)
138
#define CCU_MMC_BGR_SMHC2_GATE (1 << 2)
139
140
#define CCU_MMC_BGR_SMHC0_RST (1 << 16)
141
#define CCU_MMC_BGR_SMHC1_RST (1 << 17)
142
#define CCU_MMC_BGR_SMHC2_RST (1 << 18)
143
144
#endif
// __SUN50IW9_REG_CCU_H__
reg-ncat.h
Generated by
1.9.8