ibm405gpr.c 3.1 KB

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