ibmnp405h.c 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. /*
  2. * arch/ppc/platforms/4xx/ibmnp405h.c
  3. *
  4. * Author: Armin Kuster <akuster@mvista.com>
  5. *
  6. * 2000-2002 (c) MontaVista, Software, Inc. This file is licensed under
  7. * the terms of the GNU General Public License version 2. This program
  8. * is licensed "as is" without any warranty of any kind, whether express
  9. * or implied.
  10. */
  11. #include <linux/config.h>
  12. #include <linux/init.h>
  13. #include <asm/ocp.h>
  14. #include <platforms/4xx/ibmnp405h.h>
  15. static struct ocp_func_emac_data ibmnp405h_emac0_def = {
  16. .rgmii_idx = -1, /* No RGMII */
  17. .rgmii_mux = -1, /* No RGMII */
  18. .zmii_idx = 0, /* ZMII device index */
  19. .zmii_mux = 0, /* ZMII input of this EMAC */
  20. .mal_idx = 0, /* MAL device index */
  21. .mal_rx_chan = 0, /* MAL rx channel number */
  22. .mal_tx_chan = 0, /* MAL tx channel number */
  23. .wol_irq = 41, /* WOL interrupt number */
  24. .mdio_idx = -1, /* No shared MDIO */
  25. .tah_idx = -1, /* No TAH */
  26. };
  27. static struct ocp_func_emac_data ibmnp405h_emac1_def = {
  28. .rgmii_idx = -1, /* No RGMII */
  29. .rgmii_mux = -1, /* No RGMII */
  30. .zmii_idx = 0, /* ZMII device index */
  31. .zmii_mux = 1, /* ZMII input of this EMAC */
  32. .mal_idx = 0, /* MAL device index */
  33. .mal_rx_chan = 1, /* MAL rx channel number */
  34. .mal_tx_chan = 1, /* MAL tx channel number */
  35. .wol_irq = 41, /* WOL interrupt number */
  36. .mdio_idx = -1, /* No shared MDIO */
  37. .tah_idx = -1, /* No TAH */
  38. };
  39. static struct ocp_func_emac_data ibmnp405h_emac2_def = {
  40. .rgmii_idx = -1, /* No RGMII */
  41. .rgmii_mux = -1, /* No RGMII */
  42. .zmii_idx = 0, /* ZMII device index */
  43. .zmii_mux = 2, /* ZMII input of this EMAC */
  44. .mal_idx = 0, /* MAL device index */
  45. .mal_rx_chan = 2, /* MAL rx channel number */
  46. .mal_tx_chan = 2, /* MAL tx channel number */
  47. .wol_irq = 41, /* WOL interrupt number */
  48. .mdio_idx = -1, /* No shared MDIO */
  49. .tah_idx = -1, /* No TAH */
  50. };
  51. static struct ocp_func_emac_data ibmnp405h_emac3_def = {
  52. .rgmii_idx = -1, /* No RGMII */
  53. .rgmii_mux = -1, /* No RGMII */
  54. .zmii_idx = 0, /* ZMII device index */
  55. .zmii_mux = 3, /* ZMII input of this EMAC */
  56. .mal_idx = 0, /* MAL device index */
  57. .mal_rx_chan = 3, /* MAL rx channel number */
  58. .mal_tx_chan = 3, /* MAL tx channel number */
  59. .wol_irq = 41, /* WOL interrupt number */
  60. .mdio_idx = -1, /* No shared MDIO */
  61. .tah_idx = -1, /* No TAH */
  62. };
  63. OCP_SYSFS_EMAC_DATA()
  64. static struct ocp_func_mal_data ibmnp405h_mal0_def = {
  65. .num_tx_chans = 8, /* Number of TX channels */
  66. .num_rx_chans = 4, /* Number of RX channels */
  67. .txeob_irq = 17, /* TX End Of Buffer IRQ */
  68. .rxeob_irq = 18, /* RX End Of Buffer IRQ */
  69. .txde_irq = 46, /* TX Descriptor Error IRQ */
  70. .rxde_irq = 47, /* RX Descriptor Error IRQ */
  71. .serr_irq = 45, /* MAL System Error IRQ */
  72. };
  73. OCP_SYSFS_MAL_DATA()
  74. static struct ocp_func_iic_data ibmnp405h_iic0_def = {
  75. .fast_mode = 0, /* Use standad mode (100Khz) */
  76. };
  77. OCP_SYSFS_IIC_DATA()
  78. struct ocp_def core_ocp[] = {
  79. { .vendor = OCP_VENDOR_IBM,
  80. .function = OCP_FUNC_OPB,
  81. .index = 0,
  82. .paddr = 0xEF600000,
  83. .irq = OCP_IRQ_NA,
  84. .pm = OCP_CPM_NA,
  85. },
  86. { .vendor = OCP_VENDOR_IBM,
  87. .function = OCP_FUNC_16550,
  88. .index = 0,
  89. .paddr = UART0_IO_BASE,
  90. .irq = UART0_INT,
  91. .pm = IBM_CPM_UART0
  92. },
  93. { .vendor = OCP_VENDOR_IBM,
  94. .function = OCP_FUNC_16550,
  95. .index = 1,
  96. .paddr = UART1_IO_BASE,
  97. .irq = UART1_INT,
  98. .pm = IBM_CPM_UART1
  99. },
  100. { .vendor = OCP_VENDOR_IBM,
  101. .function = OCP_FUNC_IIC,
  102. .paddr = 0xEF600500,
  103. .irq = 2,
  104. .pm = IBM_CPM_IIC0,
  105. .additions = &ibmnp405h_iic0_def,
  106. .show = &ocp_show_iic_data
  107. },
  108. { .vendor = OCP_VENDOR_IBM,
  109. .function = OCP_FUNC_GPIO,
  110. .paddr = 0xEF600700,
  111. .irq = OCP_IRQ_NA,
  112. .pm = IBM_CPM_GPIO0
  113. },
  114. { .vendor = OCP_VENDOR_IBM,
  115. .function = OCP_FUNC_MAL,
  116. .paddr = OCP_PADDR_NA,
  117. .irq = OCP_IRQ_NA,
  118. .pm = OCP_CPM_NA,
  119. .additions = &ibmnp405h_mal0_def,
  120. .show = &ocp_show_mal_data,
  121. },
  122. { .vendor = OCP_VENDOR_IBM,
  123. .function = OCP_FUNC_EMAC,
  124. .index = 0,
  125. .paddr = EMAC0_BASE,
  126. .irq = 37,
  127. .pm = IBM_CPM_EMAC0,
  128. .additions = &ibmnp405h_emac0_def,
  129. .show = &ocp_show_emac_data,
  130. },
  131. { .vendor = OCP_VENDOR_IBM,
  132. .function = OCP_FUNC_EMAC,
  133. .index = 1,
  134. .paddr = 0xEF600900,
  135. .irq = 38,
  136. .pm = IBM_CPM_EMAC1,
  137. .additions = &ibmnp405h_emac1_def,
  138. .show = &ocp_show_emac_data,
  139. },
  140. { .vendor = OCP_VENDOR_IBM,
  141. .function = OCP_FUNC_EMAC,
  142. .index = 2,
  143. .paddr = 0xEF600a00,
  144. .irq = 39,
  145. .pm = IBM_CPM_EMAC2,
  146. .additions = &ibmnp405h_emac2_def,
  147. .show = &ocp_show_emac_data,
  148. },
  149. { .vendor = OCP_VENDOR_IBM,
  150. .function = OCP_FUNC_EMAC,
  151. .index = 3,
  152. .paddr = 0xEF600b00,
  153. .irq = 40,
  154. .pm = IBM_CPM_EMAC3,
  155. .additions = &ibmnp405h_emac3_def,
  156. .show = &ocp_show_emac_data,
  157. },
  158. { .vendor = OCP_VENDOR_IBM,
  159. .function = OCP_FUNC_ZMII,
  160. .paddr = 0xEF600C10,
  161. .irq = OCP_IRQ_NA,
  162. .pm = OCP_CPM_NA,
  163. },
  164. { .vendor = OCP_VENDOR_INVALID
  165. }
  166. };