ibm405gpr.c 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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. .dcr_base = DCRN_MAL_BASE /* MAL0_CFG DCR number */
  43. };
  44. OCP_SYSFS_MAL_DATA()
  45. static struct ocp_func_iic_data ibm405gpr_iic0_def = {
  46. .fast_mode = 0, /* Use standad mode (100Khz) */
  47. };
  48. OCP_SYSFS_IIC_DATA()
  49. struct ocp_def core_ocp[] = {
  50. { .vendor = OCP_VENDOR_IBM,
  51. .function = OCP_FUNC_OPB,
  52. .index = 0,
  53. .paddr = 0xEF600000,
  54. .irq = OCP_IRQ_NA,
  55. .pm = OCP_CPM_NA,
  56. },
  57. { .vendor = OCP_VENDOR_IBM,
  58. .function = OCP_FUNC_16550,
  59. .index = 0,
  60. .paddr = UART0_IO_BASE,
  61. .irq = UART0_INT,
  62. .pm = IBM_CPM_UART0
  63. },
  64. { .vendor = OCP_VENDOR_IBM,
  65. .function = OCP_FUNC_16550,
  66. .index = 1,
  67. .paddr = UART1_IO_BASE,
  68. .irq = UART1_INT,
  69. .pm = IBM_CPM_UART1
  70. },
  71. { .vendor = OCP_VENDOR_IBM,
  72. .function = OCP_FUNC_IIC,
  73. .paddr = 0xEF600500,
  74. .irq = 2,
  75. .pm = IBM_CPM_IIC0,
  76. .additions = &ibm405gpr_iic0_def,
  77. .show = &ocp_show_iic_data,
  78. },
  79. { .vendor = OCP_VENDOR_IBM,
  80. .function = OCP_FUNC_GPIO,
  81. .paddr = 0xEF600700,
  82. .irq = OCP_IRQ_NA,
  83. .pm = IBM_CPM_GPIO0
  84. },
  85. { .vendor = OCP_VENDOR_IBM,
  86. .function = OCP_FUNC_MAL,
  87. .paddr = OCP_PADDR_NA,
  88. .irq = OCP_IRQ_NA,
  89. .pm = OCP_CPM_NA,
  90. .additions = &ibm405gpr_mal0_def,
  91. .show = &ocp_show_mal_data,
  92. },
  93. { .vendor = OCP_VENDOR_IBM,
  94. .function = OCP_FUNC_EMAC,
  95. .index = 0,
  96. .paddr = EMAC0_BASE,
  97. .irq = 15,
  98. .pm = IBM_CPM_EMAC0,
  99. .additions = &ibm405gpr_emac0_def,
  100. .show = &ocp_show_emac_data,
  101. },
  102. { .vendor = OCP_VENDOR_INVALID
  103. }
  104. };
  105. /* Polarity and triggering settings for internal interrupt sources */
  106. struct ppc4xx_uic_settings ppc4xx_core_uic_cfg[] __initdata = {
  107. { .polarity = 0xffffe000,
  108. .triggering = 0x10000000,
  109. .ext_irq_mask = 0x00001fff, /* IRQ7 - IRQ12, IRQ0 - IRQ6 */
  110. }
  111. };