ibmnp405h.c 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  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 = 2, /* 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 = 4, /* 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 = 6, /* 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. .dcr_base = DCRN_MAL_BASE /* MAL0_CFG DCR number */
  73. };
  74. OCP_SYSFS_MAL_DATA()
  75. static struct ocp_func_iic_data ibmnp405h_iic0_def = {
  76. .fast_mode = 0, /* Use standad mode (100Khz) */
  77. };
  78. OCP_SYSFS_IIC_DATA()
  79. struct ocp_def core_ocp[] = {
  80. { .vendor = OCP_VENDOR_IBM,
  81. .function = OCP_FUNC_OPB,
  82. .index = 0,
  83. .paddr = 0xEF600000,
  84. .irq = OCP_IRQ_NA,
  85. .pm = OCP_CPM_NA,
  86. },
  87. { .vendor = OCP_VENDOR_IBM,
  88. .function = OCP_FUNC_16550,
  89. .index = 0,
  90. .paddr = UART0_IO_BASE,
  91. .irq = UART0_INT,
  92. .pm = IBM_CPM_UART0
  93. },
  94. { .vendor = OCP_VENDOR_IBM,
  95. .function = OCP_FUNC_16550,
  96. .index = 1,
  97. .paddr = UART1_IO_BASE,
  98. .irq = UART1_INT,
  99. .pm = IBM_CPM_UART1
  100. },
  101. { .vendor = OCP_VENDOR_IBM,
  102. .function = OCP_FUNC_IIC,
  103. .paddr = 0xEF600500,
  104. .irq = 2,
  105. .pm = IBM_CPM_IIC0,
  106. .additions = &ibmnp405h_iic0_def,
  107. .show = &ocp_show_iic_data
  108. },
  109. { .vendor = OCP_VENDOR_IBM,
  110. .function = OCP_FUNC_GPIO,
  111. .paddr = 0xEF600700,
  112. .irq = OCP_IRQ_NA,
  113. .pm = IBM_CPM_GPIO0
  114. },
  115. { .vendor = OCP_VENDOR_IBM,
  116. .function = OCP_FUNC_MAL,
  117. .paddr = OCP_PADDR_NA,
  118. .irq = OCP_IRQ_NA,
  119. .pm = OCP_CPM_NA,
  120. .additions = &ibmnp405h_mal0_def,
  121. .show = &ocp_show_mal_data,
  122. },
  123. { .vendor = OCP_VENDOR_IBM,
  124. .function = OCP_FUNC_EMAC,
  125. .index = 0,
  126. .paddr = EMAC0_BASE,
  127. .irq = 37,
  128. .pm = IBM_CPM_EMAC0,
  129. .additions = &ibmnp405h_emac0_def,
  130. .show = &ocp_show_emac_data,
  131. },
  132. { .vendor = OCP_VENDOR_IBM,
  133. .function = OCP_FUNC_EMAC,
  134. .index = 1,
  135. .paddr = 0xEF600900,
  136. .irq = 38,
  137. .pm = IBM_CPM_EMAC1,
  138. .additions = &ibmnp405h_emac1_def,
  139. .show = &ocp_show_emac_data,
  140. },
  141. { .vendor = OCP_VENDOR_IBM,
  142. .function = OCP_FUNC_EMAC,
  143. .index = 2,
  144. .paddr = 0xEF600a00,
  145. .irq = 39,
  146. .pm = IBM_CPM_EMAC2,
  147. .additions = &ibmnp405h_emac2_def,
  148. .show = &ocp_show_emac_data,
  149. },
  150. { .vendor = OCP_VENDOR_IBM,
  151. .function = OCP_FUNC_EMAC,
  152. .index = 3,
  153. .paddr = 0xEF600b00,
  154. .irq = 40,
  155. .pm = IBM_CPM_EMAC3,
  156. .additions = &ibmnp405h_emac3_def,
  157. .show = &ocp_show_emac_data,
  158. },
  159. { .vendor = OCP_VENDOR_IBM,
  160. .function = OCP_FUNC_ZMII,
  161. .paddr = 0xEF600C10,
  162. .irq = OCP_IRQ_NA,
  163. .pm = OCP_CPM_NA,
  164. },
  165. { .vendor = OCP_VENDOR_INVALID
  166. }
  167. };