ibm405ep.c 3.8 KB

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