diff options
Diffstat (limited to 'arch/arm/mach-at91/at91cap9.c')
-rw-r--r-- | arch/arm/mach-at91/at91cap9.c | 41 |
1 files changed, 40 insertions, 1 deletions
diff --git a/arch/arm/mach-at91/at91cap9.c b/arch/arm/mach-at91/at91cap9.c index 73376170fb9..17fae4a42ab 100644 --- a/arch/arm/mach-at91/at91cap9.c +++ b/arch/arm/mach-at91/at91cap9.c | |||
@@ -222,6 +222,25 @@ static struct clk *periph_clocks[] __initdata = { | |||
222 | // irq0 .. irq1 | 222 | // irq0 .. irq1 |
223 | }; | 223 | }; |
224 | 224 | ||
225 | static struct clk_lookup periph_clocks_lookups[] = { | ||
226 | CLKDEV_CON_DEV_ID("hclk", "atmel_usba_udc.0", &utmi_clk), | ||
227 | CLKDEV_CON_DEV_ID("pclk", "atmel_usba_udc.0", &udphs_clk), | ||
228 | CLKDEV_CON_DEV_ID("mci_clk", "at91_mci.0", &mmc0_clk), | ||
229 | CLKDEV_CON_DEV_ID("mci_clk", "at91_mci.1", &mmc1_clk), | ||
230 | CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.0", &spi0_clk), | ||
231 | CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.1", &spi1_clk), | ||
232 | CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tcb_clk), | ||
233 | CLKDEV_CON_DEV_ID("ssc", "ssc.0", &ssc0_clk), | ||
234 | CLKDEV_CON_DEV_ID("ssc", "ssc.1", &ssc1_clk), | ||
235 | }; | ||
236 | |||
237 | static struct clk_lookup usart_clocks_lookups[] = { | ||
238 | CLKDEV_CON_DEV_ID("usart", "atmel_usart.0", &mck), | ||
239 | CLKDEV_CON_DEV_ID("usart", "atmel_usart.1", &usart0_clk), | ||
240 | CLKDEV_CON_DEV_ID("usart", "atmel_usart.2", &usart1_clk), | ||
241 | CLKDEV_CON_DEV_ID("usart", "atmel_usart.3", &usart2_clk), | ||
242 | }; | ||
243 | |||
225 | /* | 244 | /* |
226 | * The four programmable clocks. | 245 | * The four programmable clocks. |
227 | * You must configure pin multiplexing to bring these signals out. | 246 | * You must configure pin multiplexing to bring these signals out. |
@@ -258,12 +277,29 @@ static void __init at91cap9_register_clocks(void) | |||
258 | for (i = 0; i < ARRAY_SIZE(periph_clocks); i++) | 277 | for (i = 0; i < ARRAY_SIZE(periph_clocks); i++) |
259 | clk_register(periph_clocks[i]); | 278 | clk_register(periph_clocks[i]); |
260 | 279 | ||
280 | clkdev_add_table(periph_clocks_lookups, | ||
281 | ARRAY_SIZE(periph_clocks_lookups)); | ||
282 | clkdev_add_table(usart_clocks_lookups, | ||
283 | ARRAY_SIZE(usart_clocks_lookups)); | ||
284 | |||
261 | clk_register(&pck0); | 285 | clk_register(&pck0); |
262 | clk_register(&pck1); | 286 | clk_register(&pck1); |
263 | clk_register(&pck2); | 287 | clk_register(&pck2); |
264 | clk_register(&pck3); | 288 | clk_register(&pck3); |
265 | } | 289 | } |
266 | 290 | ||
291 | static struct clk_lookup console_clock_lookup; | ||
292 | |||
293 | void __init at91cap9_set_console_clock(int id) | ||
294 | { | ||
295 | if (id >= ARRAY_SIZE(usart_clocks_lookups)) | ||
296 | return; | ||
297 | |||
298 | console_clock_lookup.con_id = "usart"; | ||
299 | console_clock_lookup.clk = usart_clocks_lookups[id].clk; | ||
300 | clkdev_add(&console_clock_lookup); | ||
301 | } | ||
302 | |||
267 | /* -------------------------------------------------------------------- | 303 | /* -------------------------------------------------------------------- |
268 | * GPIO | 304 | * GPIO |
269 | * -------------------------------------------------------------------- */ | 305 | * -------------------------------------------------------------------- */ |
@@ -303,11 +339,14 @@ static void at91cap9_poweroff(void) | |||
303 | * AT91CAP9 processor initialization | 339 | * AT91CAP9 processor initialization |
304 | * -------------------------------------------------------------------- */ | 340 | * -------------------------------------------------------------------- */ |
305 | 341 | ||
306 | void __init at91cap9_initialize(unsigned long main_clock) | 342 | void __init at91cap9_map_io(void) |
307 | { | 343 | { |
308 | /* Map peripherals */ | 344 | /* Map peripherals */ |
309 | iotable_init(at91cap9_io_desc, ARRAY_SIZE(at91cap9_io_desc)); | 345 | iotable_init(at91cap9_io_desc, ARRAY_SIZE(at91cap9_io_desc)); |
346 | } | ||
310 | 347 | ||
348 | void __init at91cap9_initialize(unsigned long main_clock) | ||
349 | { | ||
311 | at91_arch_reset = at91cap9_reset; | 350 | at91_arch_reset = at91cap9_reset; |
312 | pm_power_off = at91cap9_poweroff; | 351 | pm_power_off = at91cap9_poweroff; |
313 | at91_extern_irq = (1 << AT91CAP9_ID_IRQ0) | (1 << AT91CAP9_ID_IRQ1); | 352 | at91_extern_irq = (1 << AT91CAP9_ID_IRQ0) | (1 << AT91CAP9_ID_IRQ1); |