1 /* arch/arm/plat-s3c64xx/include/plat/regs-clock.h
3 * Copyright 2008 Openmoko, Inc.
4 * Copyright 2008 Simtec Electronics
5 * Ben Dooks <ben@simtec.co.uk>
6 * http://armlinux.simtec.co.uk/
8 * S3C64XX clock register definitions
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
15 #ifndef __PLAT_REGS_CLOCK_H
16 #define __PLAT_REGS_CLOCK_H __FILE__
18 #define S3C_CLKREG(x) (S3C_VA_SYS + (x))
20 #define S3C_APLL_LOCK S3C_CLKREG(0x00)
21 #define S3C_MPLL_LOCK S3C_CLKREG(0x04)
22 #define S3C_EPLL_LOCK S3C_CLKREG(0x08)
23 #define S3C_APLL_CON S3C_CLKREG(0x0C)
24 #define S3C_MPLL_CON S3C_CLKREG(0x10)
25 #define S3C_EPLL_CON0 S3C_CLKREG(0x14)
26 #define S3C_EPLL_CON1 S3C_CLKREG(0x18)
27 #define S3C_CLK_SRC S3C_CLKREG(0x1C)
28 #define S3C_CLK_DIV0 S3C_CLKREG(0x20)
29 #define S3C_CLK_DIV1 S3C_CLKREG(0x24)
30 #define S3C_CLK_DIV2 S3C_CLKREG(0x28)
31 #define S3C_CLK_OUT S3C_CLKREG(0x2C)
32 #define S3C_HCLK_GATE S3C_CLKREG(0x30)
33 #define S3C_PCLK_GATE S3C_CLKREG(0x34)
34 #define S3C_SCLK_GATE S3C_CLKREG(0x38)
37 #define S3C6400_CLKDIV0_MFC_MASK (0xf << 28)
38 #define S3C6400_CLKDIV0_MFC_SHIFT (28)
39 #define S3C6400_CLKDIV0_JPEG_MASK (0xf << 24)
40 #define S3C6400_CLKDIV0_JPEG_SHIFT (24)
41 #define S3C6400_CLKDIV0_CAM_MASK (0xf << 20)
42 #define S3C6400_CLKDIV0_CAM_SHIFT (20)
43 #define S3C6400_CLKDIV0_SECURITY_MASK (0x3 << 18)
44 #define S3C6400_CLKDIV0_SECURITY_SHIFT (18)
45 #define S3C6400_CLKDIV0_PCLK_MASK (0xf << 12)
46 #define S3C6400_CLKDIV0_PCLK_SHIFT (12)
47 #define S3C6400_CLKDIV0_HCLK2_MASK (0x7 << 9)
48 #define S3C6400_CLKDIV0_HCLK2_SHIFT (9)
49 #define S3C6400_CLKDIV0_HCLK_MASK (0x1 << 8)
50 #define S3C6400_CLKDIV0_HCLK_SHIFT (8)
51 #define S3C6400_CLKDIV0_MPLL_MASK (0x1 << 4)
52 #define S3C6400_CLKDIV0_MPLL_SHIFT (4)
53 #define S3C6400_CLKDIV0_ARM_MASK (0x3 << 0)
54 #define S3C6410_CLKDIV0_ARM_MASK (0x7 << 0)
55 #define S3C6400_CLKDIV0_ARM_SHIFT (0)
58 #define S3C6410_CLKDIV1_FIMC_MASK (0xf << 24)
59 #define S3C6410_CLKDIV1_FIMC_SHIFT (24)
60 #define S3C6400_CLKDIV1_UHOST_MASK (0xf << 20)
61 #define S3C6400_CLKDIV1_UHOST_SHIFT (20)
62 #define S3C6400_CLKDIV1_SCALER_MASK (0xf << 16)
63 #define S3C6400_CLKDIV1_SCALER_SHIFT (16)
64 #define S3C6400_CLKDIV1_LCD_MASK (0xf << 12)
65 #define S3C6400_CLKDIV1_LCD_SHIFT (12)
66 #define S3C6400_CLKDIV1_MMC2_MASK (0xf << 8)
67 #define S3C6400_CLKDIV1_MMC2_SHIFT (8)
68 #define S3C6400_CLKDIV1_MMC1_MASK (0xf << 4)
69 #define S3C6400_CLKDIV1_MMC1_SHIFT (4)
70 #define S3C6400_CLKDIV1_MMC0_MASK (0xf << 0)
71 #define S3C6400_CLKDIV1_MMC0_SHIFT (0)
74 #define S3C6410_CLKDIV2_AUDIO2_MASK (0xf << 24)
75 #define S3C6410_CLKDIV2_AUDIO2_SHIFT (24)
76 #define S3C6400_CLKDIV2_IRDA_MASK (0xf << 20)
77 #define S3C6400_CLKDIV2_IRDA_SHIFT (20)
78 #define S3C6400_CLKDIV2_UART_MASK (0xf << 16)
79 #define S3C6400_CLKDIV2_UART_SHIFT (16)
80 #define S3C6400_CLKDIV2_AUDIO1_MASK (0xf << 12)
81 #define S3C6400_CLKDIV2_AUDIO1_SHIFT (12)
82 #define S3C6400_CLKDIV2_AUDIO0_MASK (0xf << 8)
83 #define S3C6400_CLKDIV2_AUDIO0_SHIFT (8)
84 #define S3C6400_CLKDIV2_SPI1_MASK (0xf << 4)
85 #define S3C6400_CLKDIV2_SPI1_SHIFT (4)
86 #define S3C6400_CLKDIV2_SPI0_MASK (0xf << 0)
87 #define S3C6400_CLKDIV2_SPI0_SHIFT (0)
89 /* HCLK GATE Registers */
90 #define S3C_CLKCON_HCLK_BUS (1<<30)
91 #define S3C_CLKCON_HCLK_SECUR (1<<29)
92 #define S3C_CLKCON_HCLK_SDMA1 (1<<28)
93 #define S3C_CLKCON_HCLK_SDMA2 (1<<27)
94 #define S3C_CLKCON_HCLK_UHOST (1<<26)
95 #define S3C_CLKCON_HCLK_IROM (1<<25)
96 #define S3C_CLKCON_HCLK_DDR1 (1<<24)
97 #define S3C_CLKCON_HCLK_DDR0 (1<<23)
98 #define S3C_CLKCON_HCLK_MEM1 (1<<22)
99 #define S3C_CLKCON_HCLK_MEM0 (1<<21)
100 #define S3C_CLKCON_HCLK_USB (1<<20)
101 #define S3C_CLKCON_HCLK_HSMMC2 (1<<19)
102 #define S3C_CLKCON_HCLK_HSMMC1 (1<<18)
103 #define S3C_CLKCON_HCLK_HSMMC0 (1<<17)
104 #define S3C_CLKCON_HCLK_MDP (1<<16)
105 #define S3C_CLKCON_HCLK_DHOST (1<<15)
106 #define S3C_CLKCON_HCLK_IHOST (1<<14)
107 #define S3C_CLKCON_HCLK_DMA1 (1<<13)
108 #define S3C_CLKCON_HCLK_DMA0 (1<<12)
109 #define S3C_CLKCON_HCLK_JPEG (1<<11)
110 #define S3C_CLKCON_HCLK_CAMIF (1<<10)
111 #define S3C_CLKCON_HCLK_SCALER (1<<9)
112 #define S3C_CLKCON_HCLK_2D (1<<8)
113 #define S3C_CLKCON_HCLK_TV (1<<7)
114 #define S3C_CLKCON_HCLK_POST0 (1<<5)
115 #define S3C_CLKCON_HCLK_ROT (1<<4)
116 #define S3C_CLKCON_HCLK_LCD (1<<3)
117 #define S3C_CLKCON_HCLK_TZIC (1<<2)
118 #define S3C_CLKCON_HCLK_INTC (1<<1)
119 #define S3C_CLKCON_HCLK_MFC (1<<0)
121 /* PCLK GATE Registers */
122 #define S3C6410_CLKCON_PCLK_I2C1 (1<<27)
123 #define S3C6410_CLKCON_PCLK_IIS2 (1<<26)
124 #define S3C_CLKCON_PCLK_SKEY (1<<24)
125 #define S3C_CLKCON_PCLK_CHIPID (1<<23)
126 #define S3C_CLKCON_PCLK_SPI1 (1<<22)
127 #define S3C_CLKCON_PCLK_SPI0 (1<<21)
128 #define S3C_CLKCON_PCLK_HSIRX (1<<20)
129 #define S3C_CLKCON_PCLK_HSITX (1<<19)
130 #define S3C_CLKCON_PCLK_GPIO (1<<18)
131 #define S3C_CLKCON_PCLK_IIC (1<<17)
132 #define S3C_CLKCON_PCLK_IIS1 (1<<16)
133 #define S3C_CLKCON_PCLK_IIS0 (1<<15)
134 #define S3C_CLKCON_PCLK_AC97 (1<<14)
135 #define S3C_CLKCON_PCLK_TZPC (1<<13)
136 #define S3C_CLKCON_PCLK_TSADC (1<<12)
137 #define S3C_CLKCON_PCLK_KEYPAD (1<<11)
138 #define S3C_CLKCON_PCLK_IRDA (1<<10)
139 #define S3C_CLKCON_PCLK_PCM1 (1<<9)
140 #define S3C_CLKCON_PCLK_PCM0 (1<<8)
141 #define S3C_CLKCON_PCLK_PWM (1<<7)
142 #define S3C_CLKCON_PCLK_RTC (1<<6)
143 #define S3C_CLKCON_PCLK_WDT (1<<5)
144 #define S3C_CLKCON_PCLK_UART3 (1<<4)
145 #define S3C_CLKCON_PCLK_UART2 (1<<3)
146 #define S3C_CLKCON_PCLK_UART1 (1<<2)
147 #define S3C_CLKCON_PCLK_UART0 (1<<1)
148 #define S3C_CLKCON_PCLK_MFC (1<<0)
150 /* SCLK GATE Registers */
151 #define S3C_CLKCON_SCLK_UHOST (1<<30)
152 #define S3C_CLKCON_SCLK_MMC2_48 (1<<29)
153 #define S3C_CLKCON_SCLK_MMC1_48 (1<<28)
154 #define S3C_CLKCON_SCLK_MMC0_48 (1<<27)
155 #define S3C_CLKCON_SCLK_MMC2 (1<<26)
156 #define S3C_CLKCON_SCLK_MMC1 (1<<25)
157 #define S3C_CLKCON_SCLK_MMC0 (1<<24)
158 #define S3C_CLKCON_SCLK_SPI1_48 (1<<23)
159 #define S3C_CLKCON_SCLK_SPI0_48 (1<<22)
160 #define S3C_CLKCON_SCLK_SPI1 (1<<21)
161 #define S3C_CLKCON_SCLK_SPI0 (1<<20)
162 #define S3C_CLKCON_SCLK_DAC27 (1<<19)
163 #define S3C_CLKCON_SCLK_TV27 (1<<18)
164 #define S3C_CLKCON_SCLK_SCALER27 (1<<17)
165 #define S3C_CLKCON_SCLK_SCALER (1<<16)
166 #define S3C_CLKCON_SCLK_LCD27 (1<<15)
167 #define S3C_CLKCON_SCLK_LCD (1<<14)
168 #define S3C6400_CLKCON_SCLK_POST1_27 (1<<13)
169 #define S3C6410_CLKCON_FIMC (1<<13)
170 #define S3C_CLKCON_SCLK_POST0_27 (1<<12)
171 #define S3C6400_CLKCON_SCLK_POST1 (1<<11)
172 #define S3C6410_CLKCON_SCLK_AUDIO2 (1<<11)
173 #define S3C_CLKCON_SCLK_POST0 (1<<10)
174 #define S3C_CLKCON_SCLK_AUDIO1 (1<<9)
175 #define S3C_CLKCON_SCLK_AUDIO0 (1<<8)
176 #define S3C_CLKCON_SCLK_SECUR (1<<7)
177 #define S3C_CLKCON_SCLK_IRDA (1<<6)
178 #define S3C_CLKCON_SCLK_UART (1<<5)
179 #define S3C_CLKCON_SCLK_ONENAND (1<<4)
180 #define S3C_CLKCON_SCLK_MFC (1<<3)
181 #define S3C_CLKCON_SCLK_CAM (1<<2)
182 #define S3C_CLKCON_SCLK_JPEG (1<<1)
186 #define S3C6400_CLKSRC_APLL_MOUT (1 << 0)
187 #define S3C6400_CLKSRC_MPLL_MOUT (1 << 1)
188 #define S3C6400_CLKSRC_EPLL_MOUT (1 << 2)
189 #define S3C6400_CLKSRC_APLL_MOUT_SHIFT (0)
190 #define S3C6400_CLKSRC_MPLL_MOUT_SHIFT (1)
191 #define S3C6400_CLKSRC_EPLL_MOUT_SHIFT (2)
192 #define S3C6400_CLKSRC_MFC (1 << 4)
194 #define S3C6410_CLKSRC_TV27_MASK (0x1 << 31)
195 #define S3C6410_CLKSRC_TV27_SHIFT (31)
196 #define S3C6410_CLKSRC_DAC27_MASK (0x1 << 30)
197 #define S3C6410_CLKSRC_DAC27_SHIFT (30)
198 #define S3C6400_CLKSRC_SCALER_MASK (0x3 << 28)
199 #define S3C6400_CLKSRC_SCALER_SHIFT (28)
200 #define S3C6400_CLKSRC_LCD_MASK (0x3 << 26)
201 #define S3C6400_CLKSRC_LCD_SHIFT (26)
202 #define S3C6400_CLKSRC_IRDA_MASK (0x3 << 24)
203 #define S3C6400_CLKSRC_IRDA_SHIFT (24)
204 #define S3C6400_CLKSRC_MMC2_MASK (0x3 << 22)
205 #define S3C6400_CLKSRC_MMC2_SHIFT (22)
206 #define S3C6400_CLKSRC_MMC1_MASK (0x3 << 20)
207 #define S3C6400_CLKSRC_MMC1_SHIFT (20)
208 #define S3C6400_CLKSRC_MMC0_MASK (0x3 << 18)
209 #define S3C6400_CLKSRC_MMC0_SHIFT (18)
210 #define S3C6400_CLKSRC_SPI1_MASK (0x3 << 16)
211 #define S3C6400_CLKSRC_SPI1_SHIFT (16)
212 #define S3C6400_CLKSRC_SPI0_MASK (0x3 << 14)
213 #define S3C6400_CLKSRC_SPI0_SHIFT (14)
214 #define S3C6400_CLKSRC_UART_MASK (0x1 << 13)
215 #define S3C6400_CLKSRC_UART_SHIFT (13)
216 #define S3C6400_CLKSRC_AUDIO1_MASK (0x7 << 10)
217 #define S3C6400_CLKSRC_AUDIO1_SHIFT (10)
218 #define S3C6400_CLKSRC_AUDIO0_MASK (0x7 << 7)
219 #define S3C6400_CLKSRC_AUDIO0_SHIFT (7)
220 #define S3C6400_CLKSRC_UHOST_MASK (0x3 << 5)
221 #define S3C6400_CLKSRC_UHOST_SHIFT (5)
224 #endif /* _PLAT_REGS_CLOCK_H */