aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-at91/at91sam9rl.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-at91/at91sam9rl.c')
-rw-r--r--arch/arm/mach-at91/at91sam9rl.c40
1 files changed, 39 insertions, 1 deletions
diff --git a/arch/arm/mach-at91/at91sam9rl.c b/arch/arm/mach-at91/at91sam9rl.c
index 6a9d24e5ed8e..1a40f16b66c8 100644
--- a/arch/arm/mach-at91/at91sam9rl.c
+++ b/arch/arm/mach-at91/at91sam9rl.c
@@ -190,6 +190,24 @@ static struct clk *periph_clocks[] __initdata = {
190 // irq0 190 // irq0
191}; 191};
192 192
193static struct clk_lookup periph_clocks_lookups[] = {
194 CLKDEV_CON_DEV_ID("hclk", "atmel_usba_udc.0", &utmi_clk),
195 CLKDEV_CON_DEV_ID("pclk", "atmel_usba_udc.0", &udphs_clk),
196 CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tc0_clk),
197 CLKDEV_CON_DEV_ID("t1_clk", "atmel_tcb.0", &tc1_clk),
198 CLKDEV_CON_DEV_ID("t2_clk", "atmel_tcb.0", &tc2_clk),
199 CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk),
200 CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk),
201};
202
203static struct clk_lookup usart_clocks_lookups[] = {
204 CLKDEV_CON_DEV_ID("usart", "atmel_usart.0", &mck),
205 CLKDEV_CON_DEV_ID("usart", "atmel_usart.1", &usart0_clk),
206 CLKDEV_CON_DEV_ID("usart", "atmel_usart.2", &usart1_clk),
207 CLKDEV_CON_DEV_ID("usart", "atmel_usart.3", &usart2_clk),
208 CLKDEV_CON_DEV_ID("usart", "atmel_usart.4", &usart3_clk),
209};
210
193/* 211/*
194 * The two programmable clocks. 212 * The two programmable clocks.
195 * You must configure pin multiplexing to bring these signals out. 213 * You must configure pin multiplexing to bring these signals out.
@@ -214,10 +232,27 @@ static void __init at91sam9rl_register_clocks(void)
214 for (i = 0; i < ARRAY_SIZE(periph_clocks); i++) 232 for (i = 0; i < ARRAY_SIZE(periph_clocks); i++)
215 clk_register(periph_clocks[i]); 233 clk_register(periph_clocks[i]);
216 234
235 clkdev_add_table(periph_clocks_lookups,
236 ARRAY_SIZE(periph_clocks_lookups));
237 clkdev_add_table(usart_clocks_lookups,
238 ARRAY_SIZE(usart_clocks_lookups));
239
217 clk_register(&pck0); 240 clk_register(&pck0);
218 clk_register(&pck1); 241 clk_register(&pck1);
219} 242}
220 243
244static struct clk_lookup console_clock_lookup;
245
246void __init at91sam9rl_set_console_clock(int id)
247{
248 if (id >= ARRAY_SIZE(usart_clocks_lookups))
249 return;
250
251 console_clock_lookup.con_id = "usart";
252 console_clock_lookup.clk = usart_clocks_lookups[id].clk;
253 clkdev_add(&console_clock_lookup);
254}
255
221/* -------------------------------------------------------------------- 256/* --------------------------------------------------------------------
222 * GPIO 257 * GPIO
223 * -------------------------------------------------------------------- */ 258 * -------------------------------------------------------------------- */
@@ -252,7 +287,7 @@ static void at91sam9rl_poweroff(void)
252 * AT91SAM9RL processor initialization 287 * AT91SAM9RL processor initialization
253 * -------------------------------------------------------------------- */ 288 * -------------------------------------------------------------------- */
254 289
255void __init at91sam9rl_initialize(unsigned long main_clock) 290void __init at91sam9rl_map_io(void)
256{ 291{
257 unsigned long cidr, sram_size; 292 unsigned long cidr, sram_size;
258 293
@@ -275,7 +310,10 @@ void __init at91sam9rl_initialize(unsigned long main_clock)
275 310
276 /* Map SRAM */ 311 /* Map SRAM */
277 iotable_init(at91sam9rl_sram_desc, ARRAY_SIZE(at91sam9rl_sram_desc)); 312 iotable_init(at91sam9rl_sram_desc, ARRAY_SIZE(at91sam9rl_sram_desc));
313}
278 314
315void __init at91sam9rl_initialize(unsigned long main_clock)
316{
279 at91_arch_reset = at91sam9_alt_reset; 317 at91_arch_reset = at91sam9_alt_reset;
280 pm_power_off = at91sam9rl_poweroff; 318 pm_power_off = at91sam9rl_poweroff;
281 at91_extern_irq = (1 << AT91SAM9RL_ID_IRQ0); 319 at91_extern_irq = (1 << AT91SAM9RL_ID_IRQ0);