2 * arch/arm/mach-at91/at91x40.c
4 * (C) Copyright 2007, Greg Ungerer <gerg@snapgear.com>
5 * Copyright (C) 2005 SAN People
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
13 #include <linux/kernel.h>
14 #include <linux/init.h>
15 #include <linux/irq.h>
16 #include <asm/proc-fns.h>
17 #include <asm/mach/arch.h>
18 #include <mach/at91x40.h>
19 #include <mach/at91_st.h>
20 #include <mach/timex.h>
24 * Export the clock functions for the AT91X40. Some external code common
25 * to all AT91 family parts relys on this, like the gpio and serial support.
27 int clk_enable(struct clk *clk)
32 void clk_disable(struct clk *clk)
36 unsigned long clk_get_rate(struct clk *clk)
38 return AT91X40_MASTER_CLOCK;
41 static void at91x40_idle(void)
44 * Disable the processor clock. The processor will be automatically
45 * re-enabled by an interrupt or by a reset.
47 __raw_writel(AT91_PS_CR_CPU, AT91_PS_CR);
51 void __init at91x40_initialize(unsigned long main_clock)
53 arm_pm_idle = at91x40_idle;
54 at91_extern_irq = (1 << AT91X40_ID_IRQ0) | (1 << AT91X40_ID_IRQ1)
55 | (1 << AT91X40_ID_IRQ2);
59 * The default interrupt priority levels (0 = lowest, 7 = highest).
61 static unsigned int at91x40_default_irq_priority[NR_AIC_IRQS] __initdata = {
62 7, /* Advanced Interrupt Controller (FIQ) */
63 0, /* System Peripherals */
66 2, /* Timer Counter 0 */
67 2, /* Timer Counter 1 */
68 2, /* Timer Counter 2 */
69 0, /* Watchdog timer */
70 0, /* Parallel IO Controller A */
78 0, /* External IRQ0 */
79 0, /* External IRQ1 */
80 0, /* External IRQ2 */
83 void __init at91x40_init_interrupts(unsigned int priority[NR_AIC_IRQS])
86 priority = at91x40_default_irq_priority;
88 at91_aic_init(priority);