generic.h 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. /*
  2. * arch/arm/mach-spear3xx/generic.h
  3. *
  4. * SPEAr3XX machine family generic header file
  5. *
  6. * Copyright (C) 2009 ST Microelectronics
  7. * Viresh Kumar<viresh.kumar@st.com>
  8. *
  9. * This file is licensed under the terms of the GNU General Public
  10. * License version 2. This program is licensed "as is" without any
  11. * warranty of any kind, whether express or implied.
  12. */
  13. #ifndef __MACH_GENERIC_H
  14. #define __MACH_GENERIC_H
  15. #include <asm/mach/time.h>
  16. #include <asm/mach/map.h>
  17. #include <linux/init.h>
  18. #include <linux/platform_device.h>
  19. #include <linux/amba/bus.h>
  20. #include <plat/padmux.h>
  21. /* spear3xx declarations */
  22. /*
  23. * Each GPT has 2 timer channels
  24. * Following GPT channels will be used as clock source and clockevent
  25. */
  26. #define SPEAR_GPT0_BASE SPEAR3XX_ML1_TMR_BASE
  27. #define SPEAR_GPT0_CHAN0_IRQ IRQ_CPU_GPT1_1
  28. #define SPEAR_GPT0_CHAN1_IRQ IRQ_CPU_GPT1_2
  29. /* Add spear3xx family device structure declarations here */
  30. extern struct amba_device gpio_device;
  31. extern struct amba_device uart_device;
  32. extern struct sys_timer spear_sys_timer;
  33. /* Add spear3xx family function declarations here */
  34. void __init clk_init(void);
  35. void __init spear3xx_map_io(void);
  36. void __init spear3xx_init_irq(void);
  37. void __init spear3xx_init(void);
  38. void spear_pmx_init(struct pmx_driver *pmx_driver, uint base, uint size);
  39. /* pad mux declarations */
  40. #define PMX_FIRDA_MASK (1 << 14)
  41. #define PMX_I2C_MASK (1 << 13)
  42. #define PMX_SSP_CS_MASK (1 << 12)
  43. #define PMX_SSP_MASK (1 << 11)
  44. #define PMX_MII_MASK (1 << 10)
  45. #define PMX_GPIO_PIN0_MASK (1 << 9)
  46. #define PMX_GPIO_PIN1_MASK (1 << 8)
  47. #define PMX_GPIO_PIN2_MASK (1 << 7)
  48. #define PMX_GPIO_PIN3_MASK (1 << 6)
  49. #define PMX_GPIO_PIN4_MASK (1 << 5)
  50. #define PMX_GPIO_PIN5_MASK (1 << 4)
  51. #define PMX_UART0_MODEM_MASK (1 << 3)
  52. #define PMX_UART0_MASK (1 << 2)
  53. #define PMX_TIMER_3_4_MASK (1 << 1)
  54. #define PMX_TIMER_1_2_MASK (1 << 0)
  55. /* pad mux devices */
  56. extern struct pmx_dev pmx_firda;
  57. extern struct pmx_dev pmx_i2c;
  58. extern struct pmx_dev pmx_ssp_cs;
  59. extern struct pmx_dev pmx_ssp;
  60. extern struct pmx_dev pmx_mii;
  61. extern struct pmx_dev pmx_gpio_pin0;
  62. extern struct pmx_dev pmx_gpio_pin1;
  63. extern struct pmx_dev pmx_gpio_pin2;
  64. extern struct pmx_dev pmx_gpio_pin3;
  65. extern struct pmx_dev pmx_gpio_pin4;
  66. extern struct pmx_dev pmx_gpio_pin5;
  67. extern struct pmx_dev pmx_uart0_modem;
  68. extern struct pmx_dev pmx_uart0;
  69. extern struct pmx_dev pmx_timer_3_4;
  70. extern struct pmx_dev pmx_timer_1_2;
  71. #if defined(CONFIG_MACH_SPEAR310) || defined(CONFIG_MACH_SPEAR320)
  72. /* padmux plgpio devices */
  73. extern struct pmx_dev pmx_plgpio_0_1;
  74. extern struct pmx_dev pmx_plgpio_2_3;
  75. extern struct pmx_dev pmx_plgpio_4_5;
  76. extern struct pmx_dev pmx_plgpio_6_9;
  77. extern struct pmx_dev pmx_plgpio_10_27;
  78. extern struct pmx_dev pmx_plgpio_28;
  79. extern struct pmx_dev pmx_plgpio_29;
  80. extern struct pmx_dev pmx_plgpio_30;
  81. extern struct pmx_dev pmx_plgpio_31;
  82. extern struct pmx_dev pmx_plgpio_32;
  83. extern struct pmx_dev pmx_plgpio_33;
  84. extern struct pmx_dev pmx_plgpio_34_36;
  85. extern struct pmx_dev pmx_plgpio_37_42;
  86. extern struct pmx_dev pmx_plgpio_43_44_47_48;
  87. extern struct pmx_dev pmx_plgpio_45_46_49_50;
  88. #endif
  89. extern struct pmx_driver pmx_driver;
  90. /* spear300 declarations */
  91. #ifdef CONFIG_MACH_SPEAR300
  92. /* Add spear300 machine device structure declarations here */
  93. extern struct amba_device gpio1_device;
  94. /* pad mux modes */
  95. extern struct pmx_mode nand_mode;
  96. extern struct pmx_mode nor_mode;
  97. extern struct pmx_mode photo_frame_mode;
  98. extern struct pmx_mode lend_ip_phone_mode;
  99. extern struct pmx_mode hend_ip_phone_mode;
  100. extern struct pmx_mode lend_wifi_phone_mode;
  101. extern struct pmx_mode hend_wifi_phone_mode;
  102. extern struct pmx_mode ata_pabx_wi2s_mode;
  103. extern struct pmx_mode ata_pabx_i2s_mode;
  104. extern struct pmx_mode caml_lcdw_mode;
  105. extern struct pmx_mode camu_lcd_mode;
  106. extern struct pmx_mode camu_wlcd_mode;
  107. extern struct pmx_mode caml_lcd_mode;
  108. /* pad mux devices */
  109. extern struct pmx_dev pmx_fsmc_2_chips;
  110. extern struct pmx_dev pmx_fsmc_4_chips;
  111. extern struct pmx_dev pmx_keyboard;
  112. extern struct pmx_dev pmx_clcd;
  113. extern struct pmx_dev pmx_telecom_gpio;
  114. extern struct pmx_dev pmx_telecom_tdm;
  115. extern struct pmx_dev pmx_telecom_spi_cs_i2c_clk;
  116. extern struct pmx_dev pmx_telecom_camera;
  117. extern struct pmx_dev pmx_telecom_dac;
  118. extern struct pmx_dev pmx_telecom_i2s;
  119. extern struct pmx_dev pmx_telecom_boot_pins;
  120. extern struct pmx_dev pmx_telecom_sdio_4bit;
  121. extern struct pmx_dev pmx_telecom_sdio_8bit;
  122. extern struct pmx_dev pmx_gpio1;
  123. void spear300_pmx_init(void);
  124. /* Add spear300 machine function declarations here */
  125. void __init spear300_init(void);
  126. #endif /* CONFIG_MACH_SPEAR300 */
  127. /* spear310 declarations */
  128. #ifdef CONFIG_MACH_SPEAR310
  129. /* Add spear310 machine device structure declarations here */
  130. /* pad mux devices */
  131. extern struct pmx_dev pmx_emi_cs_0_1_4_5;
  132. extern struct pmx_dev pmx_emi_cs_2_3;
  133. extern struct pmx_dev pmx_uart1;
  134. extern struct pmx_dev pmx_uart2;
  135. extern struct pmx_dev pmx_uart3_4_5;
  136. extern struct pmx_dev pmx_fsmc;
  137. extern struct pmx_dev pmx_rs485_0_1;
  138. extern struct pmx_dev pmx_tdm0;
  139. void spear310_pmx_init(void);
  140. /* Add spear310 machine function declarations here */
  141. void __init spear310_init(void);
  142. #endif /* CONFIG_MACH_SPEAR310 */
  143. /* spear320 declarations */
  144. #ifdef CONFIG_MACH_SPEAR320
  145. /* Add spear320 machine device structure declarations here */
  146. /* pad mux modes */
  147. extern struct pmx_mode auto_net_smii_mode;
  148. extern struct pmx_mode auto_net_mii_mode;
  149. extern struct pmx_mode auto_exp_mode;
  150. extern struct pmx_mode small_printers_mode;
  151. /* pad mux devices */
  152. extern struct pmx_dev pmx_clcd;
  153. extern struct pmx_dev pmx_emi;
  154. extern struct pmx_dev pmx_fsmc;
  155. extern struct pmx_dev pmx_spp;
  156. extern struct pmx_dev pmx_sdio;
  157. extern struct pmx_dev pmx_i2s;
  158. extern struct pmx_dev pmx_uart1;
  159. extern struct pmx_dev pmx_uart1_modem;
  160. extern struct pmx_dev pmx_uart2;
  161. extern struct pmx_dev pmx_touchscreen;
  162. extern struct pmx_dev pmx_can;
  163. extern struct pmx_dev pmx_sdio_led;
  164. extern struct pmx_dev pmx_pwm0;
  165. extern struct pmx_dev pmx_pwm1;
  166. extern struct pmx_dev pmx_pwm2;
  167. extern struct pmx_dev pmx_pwm3;
  168. extern struct pmx_dev pmx_ssp1;
  169. extern struct pmx_dev pmx_ssp2;
  170. extern struct pmx_dev pmx_mii1;
  171. extern struct pmx_dev pmx_smii0;
  172. extern struct pmx_dev pmx_smii1;
  173. extern struct pmx_dev pmx_i2c1;
  174. void spear320_pmx_init(void);
  175. /* Add spear320 machine function declarations here */
  176. void __init spear320_init(void);
  177. #endif /* CONFIG_MACH_SPEAR320 */
  178. #endif /* __MACH_GENERIC_H */