ibm440gp.c 4.7 KB

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