generic.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /*
  2. * linux/arch/arm/mach-at91/generic.h
  3. *
  4. * Copyright (C) 2005 David Brownell
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2 as
  8. * published by the Free Software Foundation.
  9. */
  10. #include <linux/clkdev.h>
  11. #include <linux/of.h>
  12. /* Map io */
  13. extern void __init at91_map_io(void);
  14. extern void __init at91_init_sram(int bank, unsigned long base,
  15. unsigned int length);
  16. /* Processors */
  17. extern void __init at91rm9200_set_type(int type);
  18. extern void __init at91_initialize(unsigned long main_clock);
  19. extern void __init at91x40_initialize(unsigned long main_clock);
  20. extern void __init at91_dt_initialize(void);
  21. /* Interrupts */
  22. extern void __init at91_init_irq_default(void);
  23. extern void __init at91_init_interrupts(unsigned int priority[]);
  24. extern void __init at91x40_init_interrupts(unsigned int priority[]);
  25. extern void __init at91_aic_init(unsigned int priority[]);
  26. extern int __init at91_aic_of_init(struct device_node *node,
  27. struct device_node *parent);
  28. extern int __init at91_aic5_of_init(struct device_node *node,
  29. struct device_node *parent);
  30. /* Timer */
  31. struct sys_timer;
  32. extern void at91rm9200_ioremap_st(u32 addr);
  33. extern struct sys_timer at91rm9200_timer;
  34. extern void at91sam926x_ioremap_pit(u32 addr);
  35. extern struct sys_timer at91sam926x_timer;
  36. extern struct sys_timer at91x40_timer;
  37. /* Clocks */
  38. #ifdef CONFIG_AT91_PMC_UNIT
  39. extern int __init at91_clock_init(unsigned long main_clock);
  40. extern int __init at91_dt_clock_init(void);
  41. #else
  42. static int inline at91_clock_init(unsigned long main_clock) { return 0; }
  43. #endif
  44. struct device;
  45. /* Power Management */
  46. extern void at91_irq_suspend(void);
  47. extern void at91_irq_resume(void);
  48. /* idle */
  49. extern void at91sam9_idle(void);
  50. /* reset */
  51. extern void at91_ioremap_rstc(u32 base_addr);
  52. extern void at91sam9_alt_restart(char, const char *);
  53. extern void at91sam9g45_restart(char, const char *);
  54. /* shutdown */
  55. extern void at91_ioremap_shdwc(u32 base_addr);
  56. /* Matrix */
  57. extern void at91_ioremap_matrix(u32 base_addr);
  58. /* Ram Controler */
  59. extern void at91_ioremap_ramc(int id, u32 addr, u32 size);
  60. /* GPIO */
  61. #define AT91RM9200_PQFP 3 /* AT91RM9200 PQFP package has 3 banks */
  62. #define AT91RM9200_BGA 4 /* AT91RM9200 BGA package has 4 banks */
  63. struct at91_gpio_bank {
  64. unsigned short id; /* peripheral ID */
  65. unsigned long regbase; /* offset from system peripheral base */
  66. };
  67. extern void __init at91_gpio_init(struct at91_gpio_bank *, int nr_banks);
  68. extern void __init at91_gpio_irq_setup(void);
  69. extern int __init at91_gpio_of_irq_setup(struct device_node *node,
  70. struct device_node *parent);
  71. extern int at91_extern_irq;