ibm440gx.c 6.8 KB

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