ibm440gx.c 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  1. /*
  2. * arch/ppc/platforms/4xx/ibm440gx.c
  3. *
  4. * PPC440GX I/O descriptions
  5. *
  6. * Matt Porter <mporter@mvista.com>
  7. * Copyright 2002-2004 MontaVista Software Inc.
  8. *
  9. * Eugene Surovegin <eugene.surovegin@zultys.com> or <ebs@ebshome.net>
  10. * Copyright (c) 2003, 2004 Zultys Technologies
  11. *
  12. * This program is free software; you can redistribute it and/or modify it
  13. * under the terms of the GNU General Public License as published by the
  14. * Free Software Foundation; either version 2 of the License, or (at your
  15. * option) any later version.
  16. *
  17. */
  18. #include <linux/init.h>
  19. #include <linux/module.h>
  20. #include <platforms/4xx/ibm440gx.h>
  21. #include <asm/ocp.h>
  22. #include <asm/ppc4xx_pic.h>
  23. static struct ocp_func_emac_data ibm440gx_emac0_def = {
  24. .rgmii_idx = -1, /* No RGMII */
  25. .rgmii_mux = -1, /* No RGMII */
  26. .zmii_idx = 0, /* ZMII device index */
  27. .zmii_mux = 0, /* ZMII input of this EMAC */
  28. .mal_idx = 0, /* MAL device index */
  29. .mal_rx_chan = 0, /* MAL rx channel number */
  30. .mal_tx_chan = 0, /* MAL tx channel number */
  31. .wol_irq = 61, /* WOL interrupt number */
  32. .mdio_idx = -1, /* No shared MDIO */
  33. .tah_idx = -1, /* No TAH */
  34. };
  35. static struct ocp_func_emac_data ibm440gx_emac1_def = {
  36. .rgmii_idx = -1, /* No RGMII */
  37. .rgmii_mux = -1, /* No RGMII */
  38. .zmii_idx = 0, /* ZMII device index */
  39. .zmii_mux = 1, /* ZMII input of this EMAC */
  40. .mal_idx = 0, /* MAL device index */
  41. .mal_rx_chan = 1, /* MAL rx channel number */
  42. .mal_tx_chan = 1, /* MAL tx channel number */
  43. .wol_irq = 63, /* WOL interrupt number */
  44. .mdio_idx = -1, /* No shared MDIO */
  45. .tah_idx = -1, /* No TAH */
  46. };
  47. static struct ocp_func_emac_data ibm440gx_emac2_def = {
  48. .rgmii_idx = 0, /* RGMII device index */
  49. .rgmii_mux = 0, /* RGMII input of this EMAC */
  50. .zmii_idx = 0, /* ZMII device index */
  51. .zmii_mux = 2, /* ZMII input of this EMAC */
  52. .mal_idx = 0, /* MAL device index */
  53. .mal_rx_chan = 2, /* MAL rx channel number */
  54. .mal_tx_chan = 2, /* MAL tx channel number */
  55. .wol_irq = 65, /* WOL interrupt number */
  56. .mdio_idx = -1, /* No shared MDIO */
  57. .tah_idx = 0, /* TAH device index */
  58. .jumbo = 1, /* Jumbo frames supported */
  59. };
  60. static struct ocp_func_emac_data ibm440gx_emac3_def = {
  61. .rgmii_idx = 0, /* RGMII device index */
  62. .rgmii_mux = 1, /* RGMII input of this EMAC */
  63. .zmii_idx = 0, /* ZMII device index */
  64. .zmii_mux = 3, /* ZMII input of this EMAC */
  65. .mal_idx = 0, /* MAL device index */
  66. .mal_rx_chan = 3, /* MAL rx channel number */
  67. .mal_tx_chan = 3, /* MAL tx channel number */
  68. .wol_irq = 67, /* WOL interrupt number */
  69. .mdio_idx = -1, /* No shared MDIO */
  70. .tah_idx = 1, /* TAH device index */
  71. .jumbo = 1, /* Jumbo frames supported */
  72. };
  73. OCP_SYSFS_EMAC_DATA()
  74. static struct ocp_func_mal_data ibm440gx_mal0_def = {
  75. .num_tx_chans = 4, /* Number of TX channels */
  76. .num_rx_chans = 4, /* Number of RX channels */
  77. .txeob_irq = 10, /* TX End Of Buffer IRQ */
  78. .rxeob_irq = 11, /* RX End Of Buffer IRQ */
  79. .txde_irq = 33, /* TX Descriptor Error IRQ */
  80. .rxde_irq = 34, /* RX Descriptor Error IRQ */
  81. .serr_irq = 32, /* MAL System Error IRQ */
  82. .dcr_base = DCRN_MAL_BASE /* MAL0_CFG DCR number */
  83. };
  84. OCP_SYSFS_MAL_DATA()
  85. static struct ocp_func_iic_data ibm440gx_iic0_def = {
  86. .fast_mode = 0, /* Use standad mode (100Khz) */
  87. };
  88. static struct ocp_func_iic_data ibm440gx_iic1_def = {
  89. .fast_mode = 0, /* Use standad mode (100Khz) */
  90. };
  91. OCP_SYSFS_IIC_DATA()
  92. struct ocp_def core_ocp[] = {
  93. { .vendor = OCP_VENDOR_IBM,
  94. .function = OCP_FUNC_OPB,
  95. .index = 0,
  96. .paddr = 0x0000000140000000ULL,
  97. .irq = OCP_IRQ_NA,
  98. .pm = OCP_CPM_NA,
  99. },
  100. { .vendor = OCP_VENDOR_IBM,
  101. .function = OCP_FUNC_16550,
  102. .index = 0,
  103. .paddr = PPC440GX_UART0_ADDR,
  104. .irq = UART0_INT,
  105. .pm = IBM_CPM_UART0,
  106. },
  107. { .vendor = OCP_VENDOR_IBM,
  108. .function = OCP_FUNC_16550,
  109. .index = 1,
  110. .paddr = PPC440GX_UART1_ADDR,
  111. .irq = UART1_INT,
  112. .pm = IBM_CPM_UART1,
  113. },
  114. { .vendor = OCP_VENDOR_IBM,
  115. .function = OCP_FUNC_IIC,
  116. .index = 0,
  117. .paddr = 0x0000000140000400ULL,
  118. .irq = 2,
  119. .pm = IBM_CPM_IIC0,
  120. .additions = &ibm440gx_iic0_def,
  121. .show = &ocp_show_iic_data
  122. },
  123. { .vendor = OCP_VENDOR_IBM,
  124. .function = OCP_FUNC_IIC,
  125. .index = 1,
  126. .paddr = 0x0000000140000500ULL,
  127. .irq = 3,
  128. .pm = IBM_CPM_IIC1,
  129. .additions = &ibm440gx_iic1_def,
  130. .show = &ocp_show_iic_data
  131. },
  132. { .vendor = OCP_VENDOR_IBM,
  133. .function = OCP_FUNC_GPIO,
  134. .index = 0,
  135. .paddr = 0x0000000140000700ULL,
  136. .irq = OCP_IRQ_NA,
  137. .pm = IBM_CPM_GPIO0,
  138. },
  139. { .vendor = OCP_VENDOR_IBM,
  140. .function = OCP_FUNC_MAL,
  141. .paddr = OCP_PADDR_NA,
  142. .irq = OCP_IRQ_NA,
  143. .pm = OCP_CPM_NA,
  144. .additions = &ibm440gx_mal0_def,
  145. .show = &ocp_show_mal_data,
  146. },
  147. { .vendor = OCP_VENDOR_IBM,
  148. .function = OCP_FUNC_EMAC,
  149. .index = 0,
  150. .paddr = 0x0000000140000800ULL,
  151. .irq = 60,
  152. .pm = OCP_CPM_NA,
  153. .additions = &ibm440gx_emac0_def,
  154. .show = &ocp_show_emac_data,
  155. },
  156. { .vendor = OCP_VENDOR_IBM,
  157. .function = OCP_FUNC_EMAC,
  158. .index = 1,
  159. .paddr = 0x0000000140000900ULL,
  160. .irq = 62,
  161. .pm = OCP_CPM_NA,
  162. .additions = &ibm440gx_emac1_def,
  163. .show = &ocp_show_emac_data,
  164. },
  165. { .vendor = OCP_VENDOR_IBM,
  166. .function = OCP_FUNC_EMAC,
  167. .index = 2,
  168. .paddr = 0x0000000140000C00ULL,
  169. .irq = 64,
  170. .pm = OCP_CPM_NA,
  171. .additions = &ibm440gx_emac2_def,
  172. .show = &ocp_show_emac_data,
  173. },
  174. { .vendor = OCP_VENDOR_IBM,
  175. .function = OCP_FUNC_EMAC,
  176. .index = 3,
  177. .paddr = 0x0000000140000E00ULL,
  178. .irq = 66,
  179. .pm = OCP_CPM_NA,
  180. .additions = &ibm440gx_emac3_def,
  181. .show = &ocp_show_emac_data,
  182. },
  183. { .vendor = OCP_VENDOR_IBM,
  184. .function = OCP_FUNC_RGMII,
  185. .paddr = 0x0000000140000790ULL,
  186. .irq = OCP_IRQ_NA,
  187. .pm = OCP_CPM_NA,
  188. },
  189. { .vendor = OCP_VENDOR_IBM,
  190. .function = OCP_FUNC_ZMII,
  191. .paddr = 0x0000000140000780ULL,
  192. .irq = OCP_IRQ_NA,
  193. .pm = OCP_CPM_NA,
  194. },
  195. { .vendor = OCP_VENDOR_IBM,
  196. .function = OCP_FUNC_TAH,
  197. .index = 0,
  198. .paddr = 0x0000000140000b50ULL,
  199. .irq = 68,
  200. .pm = OCP_CPM_NA,
  201. },
  202. { .vendor = OCP_VENDOR_IBM,
  203. .function = OCP_FUNC_TAH,
  204. .index = 1,
  205. .paddr = 0x0000000140000d50ULL,
  206. .irq = 69,
  207. .pm = OCP_CPM_NA,
  208. },
  209. { .vendor = OCP_VENDOR_INVALID
  210. }
  211. };
  212. /* Polarity and triggering settings for internal interrupt sources */
  213. struct ppc4xx_uic_settings ppc4xx_core_uic_cfg[] __initdata = {
  214. { .polarity = 0xfffffe03,
  215. .triggering = 0x01c00000,
  216. .ext_irq_mask = 0x000001fc, /* IRQ0 - IRQ6 */
  217. },
  218. { .polarity = 0xffffc0ff,
  219. .triggering = 0x00ff8000,
  220. .ext_irq_mask = 0x00003f00, /* IRQ7 - IRQ12 */
  221. },
  222. { .polarity = 0xffff83ff,
  223. .triggering = 0x000f83c0,
  224. .ext_irq_mask = 0x00007c00, /* IRQ13 - IRQ17 */
  225. },
  226. };