diff options
Diffstat (limited to 'arch/arm/mach-mmp/mmp2.c')
-rw-r--r-- | arch/arm/mach-mmp/mmp2.c | 71 |
1 files changed, 5 insertions, 66 deletions
diff --git a/arch/arm/mach-mmp/mmp2.c b/arch/arm/mach-mmp/mmp2.c index c709a24a9d25..c2ce3d05b044 100644 --- a/arch/arm/mach-mmp/mmp2.c +++ b/arch/arm/mach-mmp/mmp2.c | |||
@@ -20,7 +20,6 @@ | |||
20 | #include <asm/mach/time.h> | 20 | #include <asm/mach/time.h> |
21 | #include <mach/addr-map.h> | 21 | #include <mach/addr-map.h> |
22 | #include <mach/regs-apbc.h> | 22 | #include <mach/regs-apbc.h> |
23 | #include <mach/regs-apmu.h> | ||
24 | #include <mach/cputype.h> | 23 | #include <mach/cputype.h> |
25 | #include <mach/irqs.h> | 24 | #include <mach/irqs.h> |
26 | #include <mach/dma.h> | 25 | #include <mach/dma.h> |
@@ -29,7 +28,6 @@ | |||
29 | #include <mach/mmp2.h> | 28 | #include <mach/mmp2.h> |
30 | 29 | ||
31 | #include "common.h" | 30 | #include "common.h" |
32 | #include "clock.h" | ||
33 | 31 | ||
34 | #define MFPR_VIRT_BASE (APB_VIRT_BASE + 0x1e000) | 32 | #define MFPR_VIRT_BASE (APB_VIRT_BASE + 0x1e000) |
35 | 33 | ||
@@ -98,67 +96,6 @@ void __init mmp2_init_irq(void) | |||
98 | mmp2_init_icu(); | 96 | mmp2_init_icu(); |
99 | } | 97 | } |
100 | 98 | ||
101 | static void sdhc_clk_enable(struct clk *clk) | ||
102 | { | ||
103 | uint32_t clk_rst; | ||
104 | |||
105 | clk_rst = __raw_readl(clk->clk_rst); | ||
106 | clk_rst |= clk->enable_val; | ||
107 | __raw_writel(clk_rst, clk->clk_rst); | ||
108 | } | ||
109 | |||
110 | static void sdhc_clk_disable(struct clk *clk) | ||
111 | { | ||
112 | uint32_t clk_rst; | ||
113 | |||
114 | clk_rst = __raw_readl(clk->clk_rst); | ||
115 | clk_rst &= ~clk->enable_val; | ||
116 | __raw_writel(clk_rst, clk->clk_rst); | ||
117 | } | ||
118 | |||
119 | struct clkops sdhc_clk_ops = { | ||
120 | .enable = sdhc_clk_enable, | ||
121 | .disable = sdhc_clk_disable, | ||
122 | }; | ||
123 | |||
124 | /* APB peripheral clocks */ | ||
125 | static APBC_CLK(uart1, MMP2_UART1, 1, 26000000); | ||
126 | static APBC_CLK(uart2, MMP2_UART2, 1, 26000000); | ||
127 | static APBC_CLK(uart3, MMP2_UART3, 1, 26000000); | ||
128 | static APBC_CLK(uart4, MMP2_UART4, 1, 26000000); | ||
129 | static APBC_CLK(twsi1, MMP2_TWSI1, 0, 26000000); | ||
130 | static APBC_CLK(twsi2, MMP2_TWSI2, 0, 26000000); | ||
131 | static APBC_CLK(twsi3, MMP2_TWSI3, 0, 26000000); | ||
132 | static APBC_CLK(twsi4, MMP2_TWSI4, 0, 26000000); | ||
133 | static APBC_CLK(twsi5, MMP2_TWSI5, 0, 26000000); | ||
134 | static APBC_CLK(twsi6, MMP2_TWSI6, 0, 26000000); | ||
135 | static APBC_CLK(gpio, MMP2_GPIO, 0, 26000000); | ||
136 | |||
137 | static APMU_CLK(nand, NAND, 0xbf, 100000000); | ||
138 | static APMU_CLK_OPS(sdh0, SDH0, 0x1b, 200000000, &sdhc_clk_ops); | ||
139 | static APMU_CLK_OPS(sdh1, SDH1, 0x1b, 200000000, &sdhc_clk_ops); | ||
140 | static APMU_CLK_OPS(sdh2, SDH2, 0x1b, 200000000, &sdhc_clk_ops); | ||
141 | static APMU_CLK_OPS(sdh3, SDH3, 0x1b, 200000000, &sdhc_clk_ops); | ||
142 | |||
143 | static struct clk_lookup mmp2_clkregs[] = { | ||
144 | INIT_CLKREG(&clk_uart1, "pxa2xx-uart.0", NULL), | ||
145 | INIT_CLKREG(&clk_uart2, "pxa2xx-uart.1", NULL), | ||
146 | INIT_CLKREG(&clk_uart3, "pxa2xx-uart.2", NULL), | ||
147 | INIT_CLKREG(&clk_uart4, "pxa2xx-uart.3", NULL), | ||
148 | INIT_CLKREG(&clk_twsi1, "pxa2xx-i2c.0", NULL), | ||
149 | INIT_CLKREG(&clk_twsi2, "pxa2xx-i2c.1", NULL), | ||
150 | INIT_CLKREG(&clk_twsi3, "pxa2xx-i2c.2", NULL), | ||
151 | INIT_CLKREG(&clk_twsi4, "pxa2xx-i2c.3", NULL), | ||
152 | INIT_CLKREG(&clk_twsi5, "pxa2xx-i2c.4", NULL), | ||
153 | INIT_CLKREG(&clk_twsi6, "pxa2xx-i2c.5", NULL), | ||
154 | INIT_CLKREG(&clk_nand, "pxa3xx-nand", NULL), | ||
155 | INIT_CLKREG(&clk_gpio, "pxa-gpio", NULL), | ||
156 | INIT_CLKREG(&clk_sdh0, "sdhci-pxav3.0", "PXA-SDHCLK"), | ||
157 | INIT_CLKREG(&clk_sdh1, "sdhci-pxav3.1", "PXA-SDHCLK"), | ||
158 | INIT_CLKREG(&clk_sdh2, "sdhci-pxav3.2", "PXA-SDHCLK"), | ||
159 | INIT_CLKREG(&clk_sdh3, "sdhci-pxav3.3", "PXA-SDHCLK"), | ||
160 | }; | ||
161 | |||
162 | static int __init mmp2_init(void) | 99 | static int __init mmp2_init(void) |
163 | { | 100 | { |
164 | if (cpu_is_mmp2()) { | 101 | if (cpu_is_mmp2()) { |
@@ -168,25 +105,27 @@ static int __init mmp2_init(void) | |||
168 | mfp_init_base(MFPR_VIRT_BASE); | 105 | mfp_init_base(MFPR_VIRT_BASE); |
169 | mfp_init_addr(mmp2_addr_map); | 106 | mfp_init_addr(mmp2_addr_map); |
170 | pxa_init_dma(IRQ_MMP2_DMA_RIQ, 16); | 107 | pxa_init_dma(IRQ_MMP2_DMA_RIQ, 16); |
171 | clkdev_add_table(ARRAY_AND_SIZE(mmp2_clkregs)); | 108 | mmp2_clk_init(); |
172 | } | 109 | } |
173 | 110 | ||
174 | return 0; | 111 | return 0; |
175 | } | 112 | } |
176 | postcore_initcall(mmp2_init); | 113 | postcore_initcall(mmp2_init); |
177 | 114 | ||
115 | #define APBC_TIMERS APBC_REG(0x024) | ||
116 | |||
178 | static void __init mmp2_timer_init(void) | 117 | static void __init mmp2_timer_init(void) |
179 | { | 118 | { |
180 | unsigned long clk_rst; | 119 | unsigned long clk_rst; |
181 | 120 | ||
182 | __raw_writel(APBC_APBCLK | APBC_RST, APBC_MMP2_TIMERS); | 121 | __raw_writel(APBC_APBCLK | APBC_RST, APBC_TIMERS); |
183 | 122 | ||
184 | /* | 123 | /* |
185 | * enable bus/functional clock, enable 6.5MHz (divider 4), | 124 | * enable bus/functional clock, enable 6.5MHz (divider 4), |
186 | * release reset | 125 | * release reset |
187 | */ | 126 | */ |
188 | clk_rst = APBC_APBCLK | APBC_FNCLK | APBC_FNCLKSEL(1); | 127 | clk_rst = APBC_APBCLK | APBC_FNCLK | APBC_FNCLKSEL(1); |
189 | __raw_writel(clk_rst, APBC_MMP2_TIMERS); | 128 | __raw_writel(clk_rst, APBC_TIMERS); |
190 | 129 | ||
191 | timer_init(IRQ_MMP2_TIMER1); | 130 | timer_init(IRQ_MMP2_TIMER1); |
192 | } | 131 | } |