ibm440gp.c 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. /*
  2. * arch/ppc/platforms/4xx/ibm440gp.c
  3. *
  4. * PPC440GP 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/ibm440gp.h>
  21. #include <asm/ocp.h>
  22. #include <asm/ppc4xx_pic.h>
  23. static struct ocp_func_emac_data ibm440gp_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 ibm440gp_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 = 2, /* 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. OCP_SYSFS_EMAC_DATA()
  48. static struct ocp_func_mal_data ibm440gp_mal0_def = {
  49. .num_tx_chans = 4, /* Number of TX channels */
  50. .num_rx_chans = 2, /* Number of RX channels */
  51. .txeob_irq = 10, /* TX End Of Buffer IRQ */
  52. .rxeob_irq = 11, /* RX End Of Buffer IRQ */
  53. .txde_irq = 33, /* TX Descriptor Error IRQ */
  54. .rxde_irq = 34, /* RX Descriptor Error IRQ */
  55. .serr_irq = 32, /* MAL System Error IRQ */
  56. .dcr_base = DCRN_MAL_BASE /* MAL0_CFG DCR number */
  57. };
  58. OCP_SYSFS_MAL_DATA()
  59. static struct ocp_func_iic_data ibm440gp_iic0_def = {
  60. .fast_mode = 0, /* Use standad mode (100Khz) */
  61. };
  62. static struct ocp_func_iic_data ibm440gp_iic1_def = {
  63. .fast_mode = 0, /* Use standad mode (100Khz) */
  64. };
  65. OCP_SYSFS_IIC_DATA()
  66. struct ocp_def core_ocp[] = {
  67. { .vendor = OCP_VENDOR_IBM,
  68. .function = OCP_FUNC_OPB,
  69. .index = 0,
  70. .paddr = 0x0000000140000000ULL,
  71. .irq = OCP_IRQ_NA,
  72. .pm = OCP_CPM_NA,
  73. },
  74. { .vendor = OCP_VENDOR_IBM,
  75. .function = OCP_FUNC_16550,
  76. .index = 0,
  77. .paddr = PPC440GP_UART0_ADDR,
  78. .irq = UART0_INT,
  79. .pm = IBM_CPM_UART0,
  80. },
  81. { .vendor = OCP_VENDOR_IBM,
  82. .function = OCP_FUNC_16550,
  83. .index = 1,
  84. .paddr = PPC440GP_UART1_ADDR,
  85. .irq = UART1_INT,
  86. .pm = IBM_CPM_UART1,
  87. },
  88. { .vendor = OCP_VENDOR_IBM,
  89. .function = OCP_FUNC_IIC,
  90. .index = 0,
  91. .paddr = 0x0000000140000400ULL,
  92. .irq = 2,
  93. .pm = IBM_CPM_IIC0,
  94. .additions = &ibm440gp_iic0_def,
  95. .show = &ocp_show_iic_data
  96. },
  97. { .vendor = OCP_VENDOR_IBM,
  98. .function = OCP_FUNC_IIC,
  99. .index = 1,
  100. .paddr = 0x0000000140000500ULL,
  101. .irq = 3,
  102. .pm = IBM_CPM_IIC1,
  103. .additions = &ibm440gp_iic1_def,
  104. .show = &ocp_show_iic_data
  105. },
  106. { .vendor = OCP_VENDOR_IBM,
  107. .function = OCP_FUNC_GPIO,
  108. .index = 0,
  109. .paddr = 0x0000000140000700ULL,
  110. .irq = OCP_IRQ_NA,
  111. .pm = IBM_CPM_GPIO0,
  112. },
  113. { .vendor = OCP_VENDOR_IBM,
  114. .function = OCP_FUNC_MAL,
  115. .paddr = OCP_PADDR_NA,
  116. .irq = OCP_IRQ_NA,
  117. .pm = OCP_CPM_NA,
  118. .additions = &ibm440gp_mal0_def,
  119. .show = &ocp_show_mal_data,
  120. },
  121. { .vendor = OCP_VENDOR_IBM,
  122. .function = OCP_FUNC_EMAC,
  123. .index = 0,
  124. .paddr = 0x0000000140000800ULL,
  125. .irq = 60,
  126. .pm = OCP_CPM_NA,
  127. .additions = &ibm440gp_emac0_def,
  128. .show = &ocp_show_emac_data,
  129. },
  130. { .vendor = OCP_VENDOR_IBM,
  131. .function = OCP_FUNC_EMAC,
  132. .index = 1,
  133. .paddr = 0x0000000140000900ULL,
  134. .irq = 62,
  135. .pm = OCP_CPM_NA,
  136. .additions = &ibm440gp_emac1_def,
  137. .show = &ocp_show_emac_data,
  138. },
  139. { .vendor = OCP_VENDOR_IBM,
  140. .function = OCP_FUNC_ZMII,
  141. .paddr = 0x0000000140000780ULL,
  142. .irq = OCP_IRQ_NA,
  143. .pm = OCP_CPM_NA,
  144. },
  145. { .vendor = OCP_VENDOR_INVALID
  146. }
  147. };
  148. /* Polarity and triggering settings for internal interrupt sources */
  149. struct ppc4xx_uic_settings ppc4xx_core_uic_cfg[] __initdata = {
  150. { .polarity = 0xfffffe03,
  151. .triggering = 0x01c00000,
  152. .ext_irq_mask = 0x000001fc, /* IRQ0 - IRQ6 */
  153. },
  154. { .polarity = 0xffffc0ff,
  155. .triggering = 0x00ff8000,
  156. .ext_irq_mask = 0x00003f00, /* IRQ7 - IRQ12 */
  157. },
  158. };