mpc83xx_devices.c 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  1. /*
  2. * arch/ppc/platforms/83xx/mpc83xx_devices.c
  3. *
  4. * MPC83xx Device descriptions
  5. *
  6. * Maintainer: Kumar Gala <galak@kernel.crashing.org>
  7. *
  8. * Copyright 2005 Freescale Semiconductor Inc.
  9. *
  10. * This program is free software; you can redistribute it and/or modify it
  11. * under the terms of the GNU General Public License as published by the
  12. * Free Software Foundation; either version 2 of the License, or (at your
  13. * option) any later version.
  14. */
  15. #include <linux/init.h>
  16. #include <linux/module.h>
  17. #include <linux/device.h>
  18. #include <linux/serial_8250.h>
  19. #include <linux/fsl_devices.h>
  20. #include <asm/mpc83xx.h>
  21. #include <asm/irq.h>
  22. #include <asm/ppc_sys.h>
  23. #include <asm/machdep.h>
  24. /* We use offsets for IORESOURCE_MEM since we do not know at compile time
  25. * what IMMRBAR is, will get fixed up by mach_mpc83xx_fixup
  26. */
  27. struct gianfar_mdio_data mpc83xx_mdio_pdata = {
  28. };
  29. static struct gianfar_platform_data mpc83xx_tsec1_pdata = {
  30. .device_flags = FSL_GIANFAR_DEV_HAS_GIGABIT |
  31. FSL_GIANFAR_DEV_HAS_COALESCE | FSL_GIANFAR_DEV_HAS_RMON |
  32. FSL_GIANFAR_DEV_HAS_MULTI_INTR,
  33. };
  34. static struct gianfar_platform_data mpc83xx_tsec2_pdata = {
  35. .device_flags = FSL_GIANFAR_DEV_HAS_GIGABIT |
  36. FSL_GIANFAR_DEV_HAS_COALESCE | FSL_GIANFAR_DEV_HAS_RMON |
  37. FSL_GIANFAR_DEV_HAS_MULTI_INTR,
  38. };
  39. static struct fsl_i2c_platform_data mpc83xx_fsl_i2c1_pdata = {
  40. .device_flags = FSL_I2C_DEV_SEPARATE_DFSRR,
  41. };
  42. static struct fsl_i2c_platform_data mpc83xx_fsl_i2c2_pdata = {
  43. .device_flags = FSL_I2C_DEV_SEPARATE_DFSRR,
  44. };
  45. static struct plat_serial8250_port serial_platform_data[] = {
  46. [0] = {
  47. .mapbase = 0x4500,
  48. .irq = MPC83xx_IRQ_UART1,
  49. .iotype = UPIO_MEM,
  50. .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
  51. },
  52. [1] = {
  53. .mapbase = 0x4600,
  54. .irq = MPC83xx_IRQ_UART2,
  55. .iotype = UPIO_MEM,
  56. .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
  57. },
  58. { },
  59. };
  60. struct platform_device ppc_sys_platform_devices[] = {
  61. [MPC83xx_TSEC1] = {
  62. .name = "fsl-gianfar",
  63. .id = 1,
  64. .dev.platform_data = &mpc83xx_tsec1_pdata,
  65. .num_resources = 4,
  66. .resource = (struct resource[]) {
  67. {
  68. .start = 0x24000,
  69. .end = 0x24fff,
  70. .flags = IORESOURCE_MEM,
  71. },
  72. {
  73. .name = "tx",
  74. .start = MPC83xx_IRQ_TSEC1_TX,
  75. .end = MPC83xx_IRQ_TSEC1_TX,
  76. .flags = IORESOURCE_IRQ,
  77. },
  78. {
  79. .name = "rx",
  80. .start = MPC83xx_IRQ_TSEC1_RX,
  81. .end = MPC83xx_IRQ_TSEC1_RX,
  82. .flags = IORESOURCE_IRQ,
  83. },
  84. {
  85. .name = "error",
  86. .start = MPC83xx_IRQ_TSEC1_ERROR,
  87. .end = MPC83xx_IRQ_TSEC1_ERROR,
  88. .flags = IORESOURCE_IRQ,
  89. },
  90. },
  91. },
  92. [MPC83xx_TSEC2] = {
  93. .name = "fsl-gianfar",
  94. .id = 2,
  95. .dev.platform_data = &mpc83xx_tsec2_pdata,
  96. .num_resources = 4,
  97. .resource = (struct resource[]) {
  98. {
  99. .start = 0x25000,
  100. .end = 0x25fff,
  101. .flags = IORESOURCE_MEM,
  102. },
  103. {
  104. .name = "tx",
  105. .start = MPC83xx_IRQ_TSEC2_TX,
  106. .end = MPC83xx_IRQ_TSEC2_TX,
  107. .flags = IORESOURCE_IRQ,
  108. },
  109. {
  110. .name = "rx",
  111. .start = MPC83xx_IRQ_TSEC2_RX,
  112. .end = MPC83xx_IRQ_TSEC2_RX,
  113. .flags = IORESOURCE_IRQ,
  114. },
  115. {
  116. .name = "error",
  117. .start = MPC83xx_IRQ_TSEC2_ERROR,
  118. .end = MPC83xx_IRQ_TSEC2_ERROR,
  119. .flags = IORESOURCE_IRQ,
  120. },
  121. },
  122. },
  123. [MPC83xx_IIC1] = {
  124. .name = "fsl-i2c",
  125. .id = 1,
  126. .dev.platform_data = &mpc83xx_fsl_i2c1_pdata,
  127. .num_resources = 2,
  128. .resource = (struct resource[]) {
  129. {
  130. .start = 0x3000,
  131. .end = 0x30ff,
  132. .flags = IORESOURCE_MEM,
  133. },
  134. {
  135. .start = MPC83xx_IRQ_IIC1,
  136. .end = MPC83xx_IRQ_IIC1,
  137. .flags = IORESOURCE_IRQ,
  138. },
  139. },
  140. },
  141. [MPC83xx_IIC2] = {
  142. .name = "fsl-i2c",
  143. .id = 2,
  144. .dev.platform_data = &mpc83xx_fsl_i2c2_pdata,
  145. .num_resources = 2,
  146. .resource = (struct resource[]) {
  147. {
  148. .start = 0x3100,
  149. .end = 0x31ff,
  150. .flags = IORESOURCE_MEM,
  151. },
  152. {
  153. .start = MPC83xx_IRQ_IIC2,
  154. .end = MPC83xx_IRQ_IIC2,
  155. .flags = IORESOURCE_IRQ,
  156. },
  157. },
  158. },
  159. [MPC83xx_DUART] = {
  160. .name = "serial8250",
  161. .id = PLAT8250_DEV_PLATFORM,
  162. .dev.platform_data = serial_platform_data,
  163. },
  164. [MPC83xx_SEC2] = {
  165. .name = "fsl-sec2",
  166. .id = 1,
  167. .num_resources = 2,
  168. .resource = (struct resource[]) {
  169. {
  170. .start = 0x30000,
  171. .end = 0x3ffff,
  172. .flags = IORESOURCE_MEM,
  173. },
  174. {
  175. .start = MPC83xx_IRQ_SEC2,
  176. .end = MPC83xx_IRQ_SEC2,
  177. .flags = IORESOURCE_IRQ,
  178. },
  179. },
  180. },
  181. [MPC83xx_USB2_DR] = {
  182. .name = "fsl-usb2-dr",
  183. .id = 1,
  184. .num_resources = 2,
  185. .resource = (struct resource[]) {
  186. {
  187. .start = 0x23000,
  188. .end = 0x23fff,
  189. .flags = IORESOURCE_MEM,
  190. },
  191. {
  192. .start = MPC83xx_IRQ_USB2_DR,
  193. .end = MPC83xx_IRQ_USB2_DR,
  194. .flags = IORESOURCE_IRQ,
  195. },
  196. },
  197. },
  198. [MPC83xx_USB2_MPH] = {
  199. .name = "fsl-usb2-mph",
  200. .id = 1,
  201. .num_resources = 2,
  202. .resource = (struct resource[]) {
  203. {
  204. .start = 0x22000,
  205. .end = 0x22fff,
  206. .flags = IORESOURCE_MEM,
  207. },
  208. {
  209. .start = MPC83xx_IRQ_USB2_MPH,
  210. .end = MPC83xx_IRQ_USB2_MPH,
  211. .flags = IORESOURCE_IRQ,
  212. },
  213. },
  214. },
  215. [MPC83xx_MDIO] = {
  216. .name = "fsl-gianfar_mdio",
  217. .id = 0,
  218. .dev.platform_data = &mpc83xx_mdio_pdata,
  219. .num_resources = 1,
  220. .resource = (struct resource[]) {
  221. {
  222. .start = 0x24520,
  223. .end = 0x2453f,
  224. .flags = IORESOURCE_MEM,
  225. },
  226. },
  227. },
  228. };
  229. static int __init mach_mpc83xx_fixup(struct platform_device *pdev)
  230. {
  231. ppc_sys_fixup_mem_resource(pdev, immrbar);
  232. return 0;
  233. }
  234. static int __init mach_mpc83xx_init(void)
  235. {
  236. if (ppc_md.progress)
  237. ppc_md.progress("mach_mpc83xx_init:enter", 0);
  238. ppc_sys_device_fixup = mach_mpc83xx_fixup;
  239. return 0;
  240. }
  241. postcore_initcall(mach_mpc83xx_init);