ibm405gp.c 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. /*
  2. *
  3. * Copyright 2000-2001 MontaVista Software Inc.
  4. * Original author: Armin Kuster akuster@mvista.com
  5. *
  6. * Module name: ibm405gp.c
  7. *
  8. *
  9. * This program is free software; you can redistribute it and/or modify it
  10. * under the terms of the GNU General Public License as published by the
  11. * Free Software Foundation; either version 2 of the License, or (at your
  12. * option) any later version.
  13. *
  14. */
  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 <platforms/4xx/ibm405gp.h>
  21. #include <asm/ibm4xx.h>
  22. #include <asm/ocp.h>
  23. #include <asm/ppc4xx_pic.h>
  24. static struct ocp_func_emac_data ibm405gp_emac0_def = {
  25. .rgmii_idx = -1, /* No RGMII */
  26. .rgmii_mux = -1, /* No RGMII */
  27. .zmii_idx = -1, /* ZMII device index */
  28. .zmii_mux = 0, /* ZMII input of this EMAC */
  29. .mal_idx = 0, /* MAL device index */
  30. .mal_rx_chan = 0, /* MAL rx channel number */
  31. .mal_tx_chan = 0, /* MAL tx channel number */
  32. .wol_irq = 9, /* WOL interrupt number */
  33. .mdio_idx = -1, /* No shared MDIO */
  34. .tah_idx = -1, /* No TAH */
  35. };
  36. OCP_SYSFS_EMAC_DATA()
  37. static struct ocp_func_mal_data ibm405gp_mal0_def = {
  38. .num_tx_chans = 1, /* Number of TX channels */
  39. .num_rx_chans = 1, /* Number of RX channels */
  40. .txeob_irq = 11, /* TX End Of Buffer IRQ */
  41. .rxeob_irq = 12, /* RX End Of Buffer IRQ */
  42. .txde_irq = 13, /* TX Descriptor Error IRQ */
  43. .rxde_irq = 14, /* RX Descriptor Error IRQ */
  44. .serr_irq = 10, /* MAL System Error IRQ */
  45. .dcr_base = DCRN_MAL_BASE /* MAL0_CFG DCR number */
  46. };
  47. OCP_SYSFS_MAL_DATA()
  48. static struct ocp_func_iic_data ibm405gp_iic0_def = {
  49. .fast_mode = 0, /* Use standad mode (100Khz) */
  50. };
  51. OCP_SYSFS_IIC_DATA()
  52. struct ocp_def core_ocp[] = {
  53. { .vendor = OCP_VENDOR_IBM,
  54. .function = OCP_FUNC_OPB,
  55. .index = 0,
  56. .paddr = 0xEF600000,
  57. .irq = OCP_IRQ_NA,
  58. .pm = OCP_CPM_NA,
  59. },
  60. { .vendor = OCP_VENDOR_IBM,
  61. .function = OCP_FUNC_16550,
  62. .index = 0,
  63. .paddr = UART0_IO_BASE,
  64. .irq = UART0_INT,
  65. .pm = IBM_CPM_UART0
  66. },
  67. { .vendor = OCP_VENDOR_IBM,
  68. .function = OCP_FUNC_16550,
  69. .index = 1,
  70. .paddr = UART1_IO_BASE,
  71. .irq = UART1_INT,
  72. .pm = IBM_CPM_UART1
  73. },
  74. { .vendor = OCP_VENDOR_IBM,
  75. .function = OCP_FUNC_IIC,
  76. .paddr = 0xEF600500,
  77. .irq = 2,
  78. .pm = IBM_CPM_IIC0,
  79. .additions = &ibm405gp_iic0_def,
  80. .show = &ocp_show_iic_data,
  81. },
  82. { .vendor = OCP_VENDOR_IBM,
  83. .function = OCP_FUNC_GPIO,
  84. .paddr = 0xEF600700,
  85. .irq = OCP_IRQ_NA,
  86. .pm = IBM_CPM_GPIO0
  87. },
  88. { .vendor = OCP_VENDOR_IBM,
  89. .function = OCP_FUNC_MAL,
  90. .paddr = OCP_PADDR_NA,
  91. .irq = OCP_IRQ_NA,
  92. .pm = OCP_CPM_NA,
  93. .additions = &ibm405gp_mal0_def,
  94. .show = &ocp_show_mal_data,
  95. },
  96. { .vendor = OCP_VENDOR_IBM,
  97. .function = OCP_FUNC_EMAC,
  98. .index = 0,
  99. .paddr = EMAC0_BASE,
  100. .irq = 15,
  101. .pm = IBM_CPM_EMAC0,
  102. .additions = &ibm405gp_emac0_def,
  103. .show = &ocp_show_emac_data,
  104. },
  105. { .vendor = OCP_VENDOR_INVALID
  106. }
  107. };
  108. /* Polarity and triggering settings for internal interrupt sources */
  109. struct ppc4xx_uic_settings ppc4xx_core_uic_cfg[] __initdata = {
  110. { .polarity = 0xffffff80,
  111. .triggering = 0x10000000,
  112. .ext_irq_mask = 0x0000007f, /* IRQ0 - IRQ6 */
  113. }
  114. };