ibm440ep.c 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. /*
  2. * arch/ppc/platforms/4xx/ibm440ep.c
  3. *
  4. * PPC440EP I/O descriptions
  5. *
  6. * Wade Farnsworth <wfarnsworth@mvista.com>
  7. * Copyright 2004 MontaVista Software Inc.
  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/module.h>
  17. #include <platforms/4xx/ibm440ep.h>
  18. #include <asm/ocp.h>
  19. #include <asm/ppc4xx_pic.h>
  20. static struct ocp_func_emac_data ibm440ep_emac0_def = {
  21. .rgmii_idx = -1, /* No RGMII */
  22. .rgmii_mux = -1, /* No RGMII */
  23. .zmii_idx = 0, /* ZMII device index */
  24. .zmii_mux = 0, /* ZMII input of this EMAC */
  25. .mal_idx = 0, /* MAL device index */
  26. .mal_rx_chan = 0, /* MAL rx channel number */
  27. .mal_tx_chan = 0, /* MAL tx channel number */
  28. .wol_irq = 61, /* WOL interrupt number */
  29. .mdio_idx = -1, /* No shared MDIO */
  30. .tah_idx = -1, /* No TAH */
  31. };
  32. static struct ocp_func_emac_data ibm440ep_emac1_def = {
  33. .rgmii_idx = -1, /* No RGMII */
  34. .rgmii_mux = -1, /* No RGMII */
  35. .zmii_idx = 0, /* ZMII device index */
  36. .zmii_mux = 1, /* ZMII input of this EMAC */
  37. .mal_idx = 0, /* MAL device index */
  38. .mal_rx_chan = 1, /* MAL rx channel number */
  39. .mal_tx_chan = 2, /* MAL tx channel number */
  40. .wol_irq = 63, /* WOL interrupt number */
  41. .mdio_idx = -1, /* No shared MDIO */
  42. .tah_idx = -1, /* No TAH */
  43. };
  44. OCP_SYSFS_EMAC_DATA()
  45. static struct ocp_func_mal_data ibm440ep_mal0_def = {
  46. .num_tx_chans = 4, /* Number of TX channels */
  47. .num_rx_chans = 2, /* Number of RX channels */
  48. .txeob_irq = 10, /* TX End Of Buffer IRQ */
  49. .rxeob_irq = 11, /* RX End Of Buffer IRQ */
  50. .txde_irq = 33, /* TX Descriptor Error IRQ */
  51. .rxde_irq = 34, /* RX Descriptor Error IRQ */
  52. .serr_irq = 32, /* MAL System Error IRQ */
  53. .dcr_base = DCRN_MAL_BASE /* MAL0_CFG DCR number */
  54. };
  55. OCP_SYSFS_MAL_DATA()
  56. static struct ocp_func_iic_data ibm440ep_iic0_def = {
  57. .fast_mode = 0, /* Use standad mode (100Khz) */
  58. };
  59. static struct ocp_func_iic_data ibm440ep_iic1_def = {
  60. .fast_mode = 0, /* Use standad mode (100Khz) */
  61. };
  62. OCP_SYSFS_IIC_DATA()
  63. struct ocp_def core_ocp[] = {
  64. { .vendor = OCP_VENDOR_IBM,
  65. .function = OCP_FUNC_OPB,
  66. .index = 0,
  67. .paddr = 0x0EF600000ULL,
  68. .irq = OCP_IRQ_NA,
  69. .pm = OCP_CPM_NA,
  70. },
  71. { .vendor = OCP_VENDOR_IBM,
  72. .function = OCP_FUNC_16550,
  73. .index = 0,
  74. .paddr = PPC440EP_UART0_ADDR,
  75. .irq = UART0_INT,
  76. .pm = IBM_CPM_UART0,
  77. },
  78. { .vendor = OCP_VENDOR_IBM,
  79. .function = OCP_FUNC_16550,
  80. .index = 1,
  81. .paddr = PPC440EP_UART1_ADDR,
  82. .irq = UART1_INT,
  83. .pm = IBM_CPM_UART1,
  84. },
  85. { .vendor = OCP_VENDOR_IBM,
  86. .function = OCP_FUNC_16550,
  87. .index = 2,
  88. .paddr = PPC440EP_UART2_ADDR,
  89. .irq = UART2_INT,
  90. .pm = IBM_CPM_UART2,
  91. },
  92. { .vendor = OCP_VENDOR_IBM,
  93. .function = OCP_FUNC_16550,
  94. .index = 3,
  95. .paddr = PPC440EP_UART3_ADDR,
  96. .irq = UART3_INT,
  97. .pm = IBM_CPM_UART3,
  98. },
  99. { .vendor = OCP_VENDOR_IBM,
  100. .function = OCP_FUNC_IIC,
  101. .index = 0,
  102. .paddr = 0x0EF600700ULL,
  103. .irq = 2,
  104. .pm = IBM_CPM_IIC0,
  105. .additions = &ibm440ep_iic0_def,
  106. .show = &ocp_show_iic_data
  107. },
  108. { .vendor = OCP_VENDOR_IBM,
  109. .function = OCP_FUNC_IIC,
  110. .index = 1,
  111. .paddr = 0x0EF600800ULL,
  112. .irq = 7,
  113. .pm = IBM_CPM_IIC1,
  114. .additions = &ibm440ep_iic1_def,
  115. .show = &ocp_show_iic_data
  116. },
  117. { .vendor = OCP_VENDOR_IBM,
  118. .function = OCP_FUNC_GPIO,
  119. .index = 0,
  120. .paddr = 0x0EF600B00ULL,
  121. .irq = OCP_IRQ_NA,
  122. .pm = IBM_CPM_GPIO0,
  123. },
  124. { .vendor = OCP_VENDOR_IBM,
  125. .function = OCP_FUNC_GPIO,
  126. .index = 1,
  127. .paddr = 0x0EF600C00ULL,
  128. .irq = OCP_IRQ_NA,
  129. .pm = OCP_CPM_NA,
  130. },
  131. { .vendor = OCP_VENDOR_IBM,
  132. .function = OCP_FUNC_MAL,
  133. .paddr = OCP_PADDR_NA,
  134. .irq = OCP_IRQ_NA,
  135. .pm = OCP_CPM_NA,
  136. .additions = &ibm440ep_mal0_def,
  137. .show = &ocp_show_mal_data,
  138. },
  139. { .vendor = OCP_VENDOR_IBM,
  140. .function = OCP_FUNC_EMAC,
  141. .index = 0,
  142. .paddr = 0x0EF600E00ULL,
  143. .irq = 60,
  144. .pm = OCP_CPM_NA,
  145. .additions = &ibm440ep_emac0_def,
  146. .show = &ocp_show_emac_data,
  147. },
  148. { .vendor = OCP_VENDOR_IBM,
  149. .function = OCP_FUNC_EMAC,
  150. .index = 1,
  151. .paddr = 0x0EF600F00ULL,
  152. .irq = 62,
  153. .pm = OCP_CPM_NA,
  154. .additions = &ibm440ep_emac1_def,
  155. .show = &ocp_show_emac_data,
  156. },
  157. { .vendor = OCP_VENDOR_IBM,
  158. .function = OCP_FUNC_ZMII,
  159. .paddr = 0x0EF600D00ULL,
  160. .irq = OCP_IRQ_NA,
  161. .pm = OCP_CPM_NA,
  162. },
  163. { .vendor = OCP_VENDOR_INVALID
  164. }
  165. };
  166. /* Polarity and triggering settings for internal interrupt sources */
  167. struct ppc4xx_uic_settings ppc4xx_core_uic_cfg[] __initdata = {
  168. { .polarity = 0xffbffe03,
  169. .triggering = 0xfffffe00,
  170. .ext_irq_mask = 0x000001fc, /* IRQ0 - IRQ6 */
  171. },
  172. { .polarity = 0xffffc6ef,
  173. .triggering = 0xffffc7ff,
  174. .ext_irq_mask = 0x00003800, /* IRQ7 - IRQ9 */
  175. },
  176. };
  177. static struct resource usb_gadget_resources[] = {
  178. [0] = {
  179. .start = 0x050000100ULL,
  180. .end = 0x05000017FULL,
  181. .flags = IORESOURCE_MEM,
  182. },
  183. [1] = {
  184. .start = 55,
  185. .end = 55,
  186. .flags = IORESOURCE_IRQ,
  187. },
  188. };
  189. static u64 dma_mask = 0xffffffffULL;
  190. static struct platform_device usb_gadget_device = {
  191. .name = "musbhsfc",
  192. .id = 0,
  193. .num_resources = ARRAY_SIZE(usb_gadget_resources),
  194. .resource = usb_gadget_resources,
  195. .dev = {
  196. .dma_mask = &dma_mask,
  197. .coherent_dma_mask = 0xffffffffULL,
  198. }
  199. };
  200. static struct platform_device *ibm440ep_devs[] __initdata = {
  201. &usb_gadget_device,
  202. };
  203. static int __init
  204. ibm440ep_platform_add_devices(void)
  205. {
  206. return platform_add_devices(ibm440ep_devs, ARRAY_SIZE(ibm440ep_devs));
  207. }
  208. arch_initcall(ibm440ep_platform_add_devices);