at91x40.c 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /*
  2. * arch/arm/mach-at91/at91x40.c
  3. *
  4. * (C) Copyright 2007, Greg Ungerer <gerg@snapgear.com>
  5. * Copyright (C) 2005 SAN People
  6. *
  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.
  11. */
  12. #include <linux/kernel.h>
  13. #include <linux/init.h>
  14. #include <linux/irq.h>
  15. #include <asm/mach/arch.h>
  16. #include <mach/at91x40.h>
  17. #include <mach/at91_st.h>
  18. #include <mach/timex.h>
  19. #include "generic.h"
  20. /*
  21. * Export the clock functions for the AT91X40. Some external code common
  22. * to all AT91 family parts relys on this, like the gpio and serial support.
  23. */
  24. int clk_enable(struct clk *clk)
  25. {
  26. return 0;
  27. }
  28. void clk_disable(struct clk *clk)
  29. {
  30. }
  31. unsigned long clk_get_rate(struct clk *clk)
  32. {
  33. return AT91X40_MASTER_CLOCK;
  34. }
  35. void __init at91x40_initialize(unsigned long main_clock)
  36. {
  37. at91_extern_irq = (1 << AT91X40_ID_IRQ0) | (1 << AT91X40_ID_IRQ1)
  38. | (1 << AT91X40_ID_IRQ2);
  39. }
  40. /*
  41. * The default interrupt priority levels (0 = lowest, 7 = highest).
  42. */
  43. static unsigned int at91x40_default_irq_priority[NR_AIC_IRQS] __initdata = {
  44. 7, /* Advanced Interrupt Controller (FIQ) */
  45. 0, /* System Peripherals */
  46. 0, /* USART 0 */
  47. 0, /* USART 1 */
  48. 2, /* Timer Counter 0 */
  49. 2, /* Timer Counter 1 */
  50. 2, /* Timer Counter 2 */
  51. 0, /* Watchdog timer */
  52. 0, /* Parallel IO Controller A */
  53. 0, /* Reserved */
  54. 0, /* Reserved */
  55. 0, /* Reserved */
  56. 0, /* Reserved */
  57. 0, /* Reserved */
  58. 0, /* Reserved */
  59. 0, /* Reserved */
  60. 0, /* External IRQ0 */
  61. 0, /* External IRQ1 */
  62. 0, /* External IRQ2 */
  63. };
  64. void __init at91x40_init_interrupts(unsigned int priority[NR_AIC_IRQS])
  65. {
  66. if (!priority)
  67. priority = at91x40_default_irq_priority;
  68. at91_aic_init(priority);
  69. }