mpc83xx_devices.c 5.4 KB

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