generic.h 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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 at91rm9200_dt_initialize(void);
  21. extern void __init at91_dt_initialize(void);
  22. /* Interrupts */
  23. extern void __init at91_init_irq_default(void);
  24. extern void __init at91_init_interrupts(unsigned int priority[]);
  25. extern void __init at91x40_init_interrupts(unsigned int priority[]);
  26. extern void __init at91_aic_init(unsigned int priority[],
  27. unsigned int ext_irq_mask);
  28. extern int __init at91_aic_of_init(struct device_node *node,
  29. struct device_node *parent);
  30. extern int __init at91_aic5_of_init(struct device_node *node,
  31. struct device_node *parent);
  32. /* Timer */
  33. struct sys_timer;
  34. extern void at91rm9200_ioremap_st(u32 addr);
  35. extern struct sys_timer at91rm9200_timer;
  36. extern void at91sam926x_ioremap_pit(u32 addr);
  37. extern struct sys_timer at91sam926x_timer;
  38. extern struct sys_timer at91x40_timer;
  39. /* Clocks */
  40. #ifdef CONFIG_AT91_PMC_UNIT
  41. extern int __init at91_clock_init(unsigned long main_clock);
  42. extern int __init at91_dt_clock_init(void);
  43. #else
  44. static int inline at91_clock_init(unsigned long main_clock) { return 0; }
  45. #endif
  46. struct device;
  47. /* Power Management */
  48. extern void at91_irq_suspend(void);
  49. extern void at91_irq_resume(void);
  50. /* idle */
  51. extern void at91sam9_idle(void);
  52. /* reset */
  53. extern void at91_ioremap_rstc(u32 base_addr);
  54. extern void at91sam9_alt_restart(char, const char *);
  55. extern void at91sam9g45_restart(char, const char *);
  56. /* shutdown */
  57. extern void at91_ioremap_shdwc(u32 base_addr);
  58. /* Matrix */
  59. extern void at91_ioremap_matrix(u32 base_addr);
  60. /* Ram Controler */
  61. extern void at91_ioremap_ramc(int id, u32 addr, u32 size);
  62. /* GPIO */
  63. #define AT91RM9200_PQFP 3 /* AT91RM9200 PQFP package has 3 banks */
  64. #define AT91RM9200_BGA 4 /* AT91RM9200 BGA package has 4 banks */
  65. struct at91_gpio_bank {
  66. unsigned short id; /* peripheral ID */
  67. unsigned long regbase; /* offset from system peripheral base */
  68. };
  69. extern void __init at91_gpio_init(struct at91_gpio_bank *, int nr_banks);
  70. extern void __init at91_gpio_irq_setup(void);
  71. extern int __init at91_gpio_of_irq_setup(struct device_node *node,
  72. struct device_node *parent);
  73. extern int at91_extern_irq;