/arch/ppc/platforms/4xx/ibm405ep.c

https://bitbucket.org/evzijst/gittest · C · 143 lines · 120 code · 9 blank · 14 comment · 0 complexity · 54af830cfbe553147fb7851174cac597 MD5 · raw file

  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. };
  33. OCP_SYSFS_MAL_DATA()
  34. static struct ocp_func_emac_data ibm405ep_emac0_def = {
  35. .rgmii_idx = -1, /* No RGMII */
  36. .rgmii_mux = -1, /* No RGMII */
  37. .zmii_idx = -1, /* ZMII device index */
  38. .zmii_mux = 0, /* ZMII input of this EMAC */
  39. .mal_idx = 0, /* MAL device index */
  40. .mal_rx_chan = 0, /* MAL rx channel number */
  41. .mal_tx_chan = 0, /* MAL tx channel number */
  42. .wol_irq = 9, /* WOL interrupt number */
  43. .mdio_idx = 0, /* MDIO via EMAC0 */
  44. .tah_idx = -1, /* No TAH */
  45. };
  46. static struct ocp_func_emac_data ibm405ep_emac1_def = {
  47. .rgmii_idx = -1, /* No RGMII */
  48. .rgmii_mux = -1, /* No RGMII */
  49. .zmii_idx = -1, /* ZMII device index */
  50. .zmii_mux = 0, /* ZMII input of this EMAC */
  51. .mal_idx = 0, /* MAL device index */
  52. .mal_rx_chan = 1, /* MAL rx channel number */
  53. .mal_tx_chan = 2, /* MAL tx channel number */
  54. .wol_irq = 9, /* WOL interrupt number */
  55. .mdio_idx = 0, /* MDIO via EMAC0 */
  56. .tah_idx = -1, /* No TAH */
  57. };
  58. OCP_SYSFS_EMAC_DATA()
  59. static struct ocp_func_iic_data ibm405ep_iic0_def = {
  60. .fast_mode = 0, /* Use standad mode (100Khz) */
  61. };
  62. OCP_SYSFS_IIC_DATA()
  63. struct ocp_def core_ocp[] = {
  64. { .vendor = OCP_VENDOR_IBM,
  65. .function = OCP_FUNC_OPB,
  66. .index = 0,
  67. .paddr = 0xEF600000,
  68. .irq = OCP_IRQ_NA,
  69. .pm = OCP_CPM_NA,
  70. },
  71. { .vendor = OCP_VENDOR_IBM,
  72. .function = OCP_FUNC_16550,
  73. .index = 0,
  74. .paddr = UART0_IO_BASE,
  75. .irq = UART0_INT,
  76. .pm = IBM_CPM_UART0
  77. },
  78. { .vendor = OCP_VENDOR_IBM,
  79. .function = OCP_FUNC_16550,
  80. .index = 1,
  81. .paddr = UART1_IO_BASE,
  82. .irq = UART1_INT,
  83. .pm = IBM_CPM_UART1
  84. },
  85. { .vendor = OCP_VENDOR_IBM,
  86. .function = OCP_FUNC_IIC,
  87. .paddr = 0xEF600500,
  88. .irq = 2,
  89. .pm = IBM_CPM_IIC0,
  90. .additions = &ibm405ep_iic0_def,
  91. .show = &ocp_show_iic_data
  92. },
  93. { .vendor = OCP_VENDOR_IBM,
  94. .function = OCP_FUNC_GPIO,
  95. .paddr = 0xEF600700,
  96. .irq = OCP_IRQ_NA,
  97. .pm = IBM_CPM_GPIO0
  98. },
  99. { .vendor = OCP_VENDOR_IBM,
  100. .function = OCP_FUNC_MAL,
  101. .paddr = OCP_PADDR_NA,
  102. .irq = OCP_IRQ_NA,
  103. .pm = OCP_CPM_NA,
  104. .additions = &ibm405ep_mal0_def,
  105. .show = &ocp_show_mal_data
  106. },
  107. { .vendor = OCP_VENDOR_IBM,
  108. .function = OCP_FUNC_EMAC,
  109. .index = 0,
  110. .paddr = EMAC0_BASE,
  111. .irq = 15,
  112. .pm = OCP_CPM_NA,
  113. .additions = &ibm405ep_emac0_def,
  114. .show = &ocp_show_emac_data
  115. },
  116. { .vendor = OCP_VENDOR_IBM,
  117. .function = OCP_FUNC_EMAC,
  118. .index = 1,
  119. .paddr = 0xEF600900,
  120. .irq = 17,
  121. .pm = OCP_CPM_NA,
  122. .additions = &ibm405ep_emac1_def,
  123. .show = &ocp_show_emac_data
  124. },
  125. { .vendor = OCP_VENDOR_INVALID
  126. }
  127. };
  128. /* Polarity and triggering settings for internal interrupt sources */
  129. struct ppc4xx_uic_settings ppc4xx_core_uic_cfg[] __initdata = {
  130. { .polarity = 0xffff7f80,
  131. .triggering = 0x00000000,
  132. .ext_irq_mask = 0x0000007f, /* IRQ0 - IRQ6 */
  133. }
  134. };