ibm405ep.c 3.8 KB

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