ibm405ep.c 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. /*
  2. * Support for IBM PPC 405EP processors.
  3. *
  4. * Author: SAW (IBM), derived from ibmnp405l.c.
  5. * Maintained by MontaVista Software <source@mvista.com>
  6. *
  7. * 2003 (c) MontaVista Softare Inc. This file is licensed under the
  8. * terms of the GNU General Public License version 2. This program is
  9. * licensed "as is" without any warranty of any kind, whether express
  10. * or implied.
  11. */
  12. #include <linux/config.h>
  13. #include <linux/init.h>
  14. #include <linux/smp.h>
  15. #include <linux/threads.h>
  16. #include <linux/param.h>
  17. #include <linux/string.h>
  18. #include <asm/ibm4xx.h>
  19. #include <asm/ocp.h>
  20. #include <asm/ppc4xx_pic.h>
  21. #include <platforms/4xx/ibm405ep.h>
  22. static struct ocp_func_mal_data ibm405ep_mal0_def = {
  23. .num_tx_chans = 4, /* Number of TX channels */
  24. .num_rx_chans = 2, /* Number of RX channels */
  25. .txeob_irq = 11, /* TX End Of Buffer IRQ */
  26. .rxeob_irq = 12, /* RX End Of Buffer IRQ */
  27. .txde_irq = 13, /* TX Descriptor Error IRQ */
  28. .rxde_irq = 14, /* RX Descriptor Error IRQ */
  29. .serr_irq = 10, /* MAL System Error IRQ */
  30. .dcr_base = DCRN_MAL_BASE /* MAL0_CFG DCR number */
  31. };
  32. OCP_SYSFS_MAL_DATA()
  33. static struct ocp_func_emac_data ibm405ep_emac0_def = {
  34. .rgmii_idx = -1, /* No RGMII */
  35. .rgmii_mux = -1, /* No RGMII */
  36. .zmii_idx = -1, /* ZMII device index */
  37. .zmii_mux = 0, /* ZMII input of this EMAC */
  38. .mal_idx = 0, /* MAL device index */
  39. .mal_rx_chan = 0, /* MAL rx channel number */
  40. .mal_tx_chan = 0, /* MAL tx channel number */
  41. .wol_irq = 9, /* WOL interrupt number */
  42. .mdio_idx = 0, /* MDIO via EMAC0 */
  43. .tah_idx = -1, /* No TAH */
  44. };
  45. static struct ocp_func_emac_data ibm405ep_emac1_def = {
  46. .rgmii_idx = -1, /* No RGMII */
  47. .rgmii_mux = -1, /* No RGMII */
  48. .zmii_idx = -1, /* ZMII device index */
  49. .zmii_mux = 0, /* ZMII input of this EMAC */
  50. .mal_idx = 0, /* MAL device index */
  51. .mal_rx_chan = 1, /* MAL rx channel number */
  52. .mal_tx_chan = 2, /* MAL tx channel number */
  53. .wol_irq = 9, /* WOL interrupt number */
  54. .mdio_idx = 0, /* MDIO via EMAC0 */
  55. .tah_idx = -1, /* No TAH */
  56. };
  57. OCP_SYSFS_EMAC_DATA()
  58. static struct ocp_func_iic_data ibm405ep_iic0_def = {
  59. .fast_mode = 0, /* Use standad mode (100Khz) */
  60. };
  61. OCP_SYSFS_IIC_DATA()
  62. struct ocp_def core_ocp[] = {
  63. { .vendor = OCP_VENDOR_IBM,
  64. .function = OCP_FUNC_OPB,
  65. .index = 0,
  66. .paddr = 0xEF600000,
  67. .irq = OCP_IRQ_NA,
  68. .pm = OCP_CPM_NA,
  69. },
  70. { .vendor = OCP_VENDOR_IBM,
  71. .function = OCP_FUNC_16550,
  72. .index = 0,
  73. .paddr = UART0_IO_BASE,
  74. .irq = UART0_INT,
  75. .pm = IBM_CPM_UART0
  76. },
  77. { .vendor = OCP_VENDOR_IBM,
  78. .function = OCP_FUNC_16550,
  79. .index = 1,
  80. .paddr = UART1_IO_BASE,
  81. .irq = UART1_INT,
  82. .pm = IBM_CPM_UART1
  83. },
  84. { .vendor = OCP_VENDOR_IBM,
  85. .function = OCP_FUNC_IIC,
  86. .paddr = 0xEF600500,
  87. .irq = 2,
  88. .pm = IBM_CPM_IIC0,
  89. .additions = &ibm405ep_iic0_def,
  90. .show = &ocp_show_iic_data
  91. },
  92. { .vendor = OCP_VENDOR_IBM,
  93. .function = OCP_FUNC_GPIO,
  94. .paddr = 0xEF600700,
  95. .irq = OCP_IRQ_NA,
  96. .pm = IBM_CPM_GPIO0
  97. },
  98. { .vendor = OCP_VENDOR_IBM,
  99. .function = OCP_FUNC_MAL,
  100. .paddr = OCP_PADDR_NA,
  101. .irq = OCP_IRQ_NA,
  102. .pm = OCP_CPM_NA,
  103. .additions = &ibm405ep_mal0_def,
  104. .show = &ocp_show_mal_data
  105. },
  106. { .vendor = OCP_VENDOR_IBM,
  107. .function = OCP_FUNC_EMAC,
  108. .index = 0,
  109. .paddr = EMAC0_BASE,
  110. .irq = 15,
  111. .pm = OCP_CPM_NA,
  112. .additions = &ibm405ep_emac0_def,
  113. .show = &ocp_show_emac_data
  114. },
  115. { .vendor = OCP_VENDOR_IBM,
  116. .function = OCP_FUNC_EMAC,
  117. .index = 1,
  118. .paddr = 0xEF600900,
  119. .irq = 17,
  120. .pm = OCP_CPM_NA,
  121. .additions = &ibm405ep_emac1_def,
  122. .show = &ocp_show_emac_data
  123. },
  124. { .vendor = OCP_VENDOR_INVALID
  125. }
  126. };
  127. /* Polarity and triggering settings for internal interrupt sources */
  128. struct ppc4xx_uic_settings ppc4xx_core_uic_cfg[] __initdata = {
  129. { .polarity = 0xffff7f80,
  130. .triggering = 0x00000000,
  131. .ext_irq_mask = 0x0000007f, /* IRQ0 - IRQ6 */
  132. }
  133. };