ibm405gp.c 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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/config.h>
  16. #include <linux/init.h>
  17. #include <linux/smp.h>
  18. #include <linux/threads.h>
  19. #include <linux/param.h>
  20. #include <linux/string.h>
  21. #include <platforms/4xx/ibm405gp.h>
  22. #include <asm/ibm4xx.h>
  23. #include <asm/ocp.h>
  24. #include <asm/ppc4xx_pic.h>
  25. static struct ocp_func_emac_data ibm405gp_emac0_def = {
  26. .rgmii_idx = -1, /* No RGMII */
  27. .rgmii_mux = -1, /* No RGMII */
  28. .zmii_idx = -1, /* ZMII device index */
  29. .zmii_mux = 0, /* ZMII input of this EMAC */
  30. .mal_idx = 0, /* MAL device index */
  31. .mal_rx_chan = 0, /* MAL rx channel number */
  32. .mal_tx_chan = 0, /* MAL tx channel number */
  33. .wol_irq = 9, /* WOL interrupt number */
  34. .mdio_idx = -1, /* No shared MDIO */
  35. .tah_idx = -1, /* No TAH */
  36. };
  37. OCP_SYSFS_EMAC_DATA()
  38. static struct ocp_func_mal_data ibm405gp_mal0_def = {
  39. .num_tx_chans = 1, /* Number of TX channels */
  40. .num_rx_chans = 1, /* Number of RX channels */
  41. .txeob_irq = 11, /* TX End Of Buffer IRQ */
  42. .rxeob_irq = 12, /* RX End Of Buffer IRQ */
  43. .txde_irq = 13, /* TX Descriptor Error IRQ */
  44. .rxde_irq = 14, /* RX Descriptor Error IRQ */
  45. .serr_irq = 10, /* MAL System Error IRQ */
  46. .dcr_base = DCRN_MAL_BASE /* MAL0_CFG DCR number */
  47. };
  48. OCP_SYSFS_MAL_DATA()
  49. static struct ocp_func_iic_data ibm405gp_iic0_def = {
  50. .fast_mode = 0, /* Use standad mode (100Khz) */
  51. };
  52. OCP_SYSFS_IIC_DATA()
  53. struct ocp_def core_ocp[] = {
  54. { .vendor = OCP_VENDOR_IBM,
  55. .function = OCP_FUNC_OPB,
  56. .index = 0,
  57. .paddr = 0xEF600000,
  58. .irq = OCP_IRQ_NA,
  59. .pm = OCP_CPM_NA,
  60. },
  61. { .vendor = OCP_VENDOR_IBM,
  62. .function = OCP_FUNC_16550,
  63. .index = 0,
  64. .paddr = UART0_IO_BASE,
  65. .irq = UART0_INT,
  66. .pm = IBM_CPM_UART0
  67. },
  68. { .vendor = OCP_VENDOR_IBM,
  69. .function = OCP_FUNC_16550,
  70. .index = 1,
  71. .paddr = UART1_IO_BASE,
  72. .irq = UART1_INT,
  73. .pm = IBM_CPM_UART1
  74. },
  75. { .vendor = OCP_VENDOR_IBM,
  76. .function = OCP_FUNC_IIC,
  77. .paddr = 0xEF600500,
  78. .irq = 2,
  79. .pm = IBM_CPM_IIC0,
  80. .additions = &ibm405gp_iic0_def,
  81. .show = &ocp_show_iic_data,
  82. },
  83. { .vendor = OCP_VENDOR_IBM,
  84. .function = OCP_FUNC_GPIO,
  85. .paddr = 0xEF600700,
  86. .irq = OCP_IRQ_NA,
  87. .pm = IBM_CPM_GPIO0
  88. },
  89. { .vendor = OCP_VENDOR_IBM,
  90. .function = OCP_FUNC_MAL,
  91. .paddr = OCP_PADDR_NA,
  92. .irq = OCP_IRQ_NA,
  93. .pm = OCP_CPM_NA,
  94. .additions = &ibm405gp_mal0_def,
  95. .show = &ocp_show_mal_data,
  96. },
  97. { .vendor = OCP_VENDOR_IBM,
  98. .function = OCP_FUNC_EMAC,
  99. .index = 0,
  100. .paddr = EMAC0_BASE,
  101. .irq = 15,
  102. .pm = IBM_CPM_EMAC0,
  103. .additions = &ibm405gp_emac0_def,
  104. .show = &ocp_show_emac_data,
  105. },
  106. { .vendor = OCP_VENDOR_INVALID
  107. }
  108. };
  109. /* Polarity and triggering settings for internal interrupt sources */
  110. struct ppc4xx_uic_settings ppc4xx_core_uic_cfg[] __initdata = {
  111. { .polarity = 0xffffff80,
  112. .triggering = 0x10000000,
  113. .ext_irq_mask = 0x0000007f, /* IRQ0 - IRQ6 */
  114. }
  115. };