diff options
author | Ben Dooks <ben-linux@fluff.org> | 2008-10-21 09:07:02 -0400 |
---|---|---|
committer | Ben Dooks <ben-linux@fluff.org> | 2008-12-15 16:54:36 -0500 |
commit | cf18acf0e04260ff8ffa46dc245d3d2324ed41b0 (patch) | |
tree | 904cd7c007c7da92ae34ecfe5cea049ee4b08e57 /arch/arm/plat-s3c64xx/include/plat | |
parent | c652d2ddb97ccdc4774e149ef998928263fd8886 (diff) |
[ARM] S3C64XX: Clock support for S3C6400/S3C6410
Add the PLL clock initialisation and clock registration
and include the clocks sourced via CLKDIVx for most of
the on-chip peripherals.
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Diffstat (limited to 'arch/arm/plat-s3c64xx/include/plat')
-rw-r--r-- | arch/arm/plat-s3c64xx/include/plat/regs-clock.h | 95 | ||||
-rw-r--r-- | arch/arm/plat-s3c64xx/include/plat/s3c6400.h | 2 |
2 files changed, 96 insertions, 1 deletions
diff --git a/arch/arm/plat-s3c64xx/include/plat/regs-clock.h b/arch/arm/plat-s3c64xx/include/plat/regs-clock.h index 462558ec1af..78938a5e1d2 100644 --- a/arch/arm/plat-s3c64xx/include/plat/regs-clock.h +++ b/arch/arm/plat-s3c64xx/include/plat/regs-clock.h | |||
@@ -33,6 +33,59 @@ | |||
33 | #define S3C_PCLK_GATE S3C_CLKREG(0x34) | 33 | #define S3C_PCLK_GATE S3C_CLKREG(0x34) |
34 | #define S3C_SCLK_GATE S3C_CLKREG(0x38) | 34 | #define S3C_SCLK_GATE S3C_CLKREG(0x38) |
35 | 35 | ||
36 | /* CLKDIV0 */ | ||
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) | ||
56 | |||
57 | /* CLKDIV1 */ | ||
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) | ||
72 | |||
73 | /* CLKDIV2 */ | ||
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) | ||
88 | |||
36 | /* HCLK GATE Registers */ | 89 | /* HCLK GATE Registers */ |
37 | #define S3C_CLKCON_HCLK_BUS (1<<30) | 90 | #define S3C_CLKCON_HCLK_BUS (1<<30) |
38 | #define S3C_CLKCON_HCLK_SECUR (1<<29) | 91 | #define S3C_CLKCON_HCLK_SECUR (1<<29) |
@@ -128,4 +181,44 @@ | |||
128 | #define S3C_CLKCON_SCLK_CAM (1<<2) | 181 | #define S3C_CLKCON_SCLK_CAM (1<<2) |
129 | #define S3C_CLKCON_SCLK_JPEG (1<<1) | 182 | #define S3C_CLKCON_SCLK_JPEG (1<<1) |
130 | 183 | ||
131 | #endif /* __PLAT_REGS_CLOCK_H */ | 184 | /* CLKSRC */ |
185 | |||
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) | ||
193 | |||
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 (0xf << 1) | ||
209 | #define S3C6400_CLKSRC_MMC0_SHIFT (1) | ||
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) | ||
222 | |||
223 | |||
224 | #endif /* _PLAT_REGS_CLOCK_H */ | ||
diff --git a/arch/arm/plat-s3c64xx/include/plat/s3c6400.h b/arch/arm/plat-s3c64xx/include/plat/s3c6400.h index 142bb3d18cd..571eaa2e54f 100644 --- a/arch/arm/plat-s3c64xx/include/plat/s3c6400.h +++ b/arch/arm/plat-s3c64xx/include/plat/s3c6400.h | |||
@@ -15,6 +15,8 @@ | |||
15 | /* Common init code for S3C6400 related SoCs */ | 15 | /* Common init code for S3C6400 related SoCs */ |
16 | 16 | ||
17 | extern void s3c6400_common_init_uarts(struct s3c2410_uartcfg *cfg, int no); | 17 | extern void s3c6400_common_init_uarts(struct s3c2410_uartcfg *cfg, int no); |
18 | extern void s3c6400_register_clocks(void); | ||
19 | extern void s3c6400_setup_clocks(void); | ||
18 | 20 | ||
19 | #ifdef CONFIG_CPU_S3C6400 | 21 | #ifdef CONFIG_CPU_S3C6400 |
20 | 22 | ||