ibm405gpr.c 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. /*
  2. * arch/ppc/platforms/4xx/ibm405gpr.c
  3. *
  4. * Author: Armin Kuster <akuster@mvista.com>
  5. *
  6. * 2002 (c) MontaVista, Software, Inc. This file is licensed under
  7. * the terms of the GNU General Public License version 2. This program
  8. * is licensed "as is" without any warranty of any kind, whether express
  9. * or implied.
  10. */
  11. #include <linux/config.h>
  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 <platforms/4xx/ibm405gpr.h>
  18. #include <asm/ibm4xx.h>
  19. #include <asm/ocp.h>
  20. #include <asm/ppc4xx_pic.h>
  21. static struct ocp_func_emac_data ibm405gpr_emac0_def = {
  22. .rgmii_idx = -1, /* No RGMII */
  23. .rgmii_mux = -1, /* No RGMII */
  24. .zmii_idx = -1, /* 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 = 9, /* WOL interrupt number */
  30. .mdio_idx = -1, /* No shared MDIO */
  31. .tah_idx = -1, /* No TAH */
  32. };
  33. OCP_SYSFS_EMAC_DATA()
  34. static struct ocp_func_mal_data ibm405gpr_mal0_def = {
  35. .num_tx_chans = 1, /* Number of TX channels */
  36. .num_rx_chans = 1, /* Number of RX channels */
  37. .txeob_irq = 11, /* TX End Of Buffer IRQ */
  38. .rxeob_irq = 12, /* RX End Of Buffer IRQ */
  39. .txde_irq = 13, /* TX Descriptor Error IRQ */
  40. .rxde_irq = 14, /* RX Descriptor Error IRQ */
  41. .serr_irq = 10, /* MAL System Error IRQ */
  42. };
  43. OCP_SYSFS_MAL_DATA()
  44. static struct ocp_func_iic_data ibm405gpr_iic0_def = {
  45. .fast_mode = 0, /* Use standad mode (100Khz) */
  46. };
  47. OCP_SYSFS_IIC_DATA()
  48. struct ocp_def core_ocp[] = {
  49. { .vendor = OCP_VENDOR_IBM,
  50. .function = OCP_FUNC_OPB,
  51. .index = 0,
  52. .paddr = 0xEF600000,
  53. .irq = OCP_IRQ_NA,
  54. .pm = OCP_CPM_NA,
  55. },
  56. { .vendor = OCP_VENDOR_IBM,
  57. .function = OCP_FUNC_16550,
  58. .index = 0,
  59. .paddr = UART0_IO_BASE,
  60. .irq = UART0_INT,
  61. .pm = IBM_CPM_UART0
  62. },
  63. { .vendor = OCP_VENDOR_IBM,
  64. .function = OCP_FUNC_16550,
  65. .index = 1,
  66. .paddr = UART1_IO_BASE,
  67. .irq = UART1_INT,
  68. .pm = IBM_CPM_UART1
  69. },
  70. { .vendor = OCP_VENDOR_IBM,
  71. .function = OCP_FUNC_IIC,
  72. .paddr = 0xEF600500,
  73. .irq = 2,
  74. .pm = IBM_CPM_IIC0,
  75. .additions = &ibm405gpr_iic0_def,
  76. .show = &ocp_show_iic_data,
  77. },
  78. { .vendor = OCP_VENDOR_IBM,
  79. .function = OCP_FUNC_GPIO,
  80. .paddr = 0xEF600700,
  81. .irq = OCP_IRQ_NA,
  82. .pm = IBM_CPM_GPIO0
  83. },
  84. { .vendor = OCP_VENDOR_IBM,
  85. .function = OCP_FUNC_MAL,
  86. .paddr = OCP_PADDR_NA,
  87. .irq = OCP_IRQ_NA,
  88. .pm = OCP_CPM_NA,
  89. .additions = &ibm405gpr_mal0_def,
  90. .show = &ocp_show_mal_data,
  91. },
  92. { .vendor = OCP_VENDOR_IBM,
  93. .function = OCP_FUNC_EMAC,
  94. .index = 0,
  95. .paddr = EMAC0_BASE,
  96. .irq = 15,
  97. .pm = IBM_CPM_EMAC0,
  98. .additions = &ibm405gpr_emac0_def,
  99. .show = &ocp_show_emac_data,
  100. },
  101. { .vendor = OCP_VENDOR_INVALID
  102. }
  103. };
  104. /* Polarity and triggering settings for internal interrupt sources */
  105. struct ppc4xx_uic_settings ppc4xx_core_uic_cfg[] __initdata = {
  106. { .polarity = 0xffffe000,
  107. .triggering = 0x10000000,
  108. .ext_irq_mask = 0x00001fff, /* IRQ7 - IRQ12, IRQ0 - IRQ6 */
  109. }
  110. };