mpc83xx_devices.c 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  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. .paddr = 0x24520,
  29. };
  30. static struct gianfar_platform_data mpc83xx_tsec1_pdata = {
  31. .device_flags = FSL_GIANFAR_DEV_HAS_GIGABIT |
  32. FSL_GIANFAR_DEV_HAS_COALESCE | FSL_GIANFAR_DEV_HAS_RMON |
  33. FSL_GIANFAR_DEV_HAS_MULTI_INTR,
  34. };
  35. static struct gianfar_platform_data mpc83xx_tsec2_pdata = {
  36. .device_flags = FSL_GIANFAR_DEV_HAS_GIGABIT |
  37. FSL_GIANFAR_DEV_HAS_COALESCE | FSL_GIANFAR_DEV_HAS_RMON |
  38. FSL_GIANFAR_DEV_HAS_MULTI_INTR,
  39. };
  40. static struct fsl_i2c_platform_data mpc83xx_fsl_i2c1_pdata = {
  41. .device_flags = FSL_I2C_DEV_SEPARATE_DFSRR,
  42. };
  43. static struct fsl_i2c_platform_data mpc83xx_fsl_i2c2_pdata = {
  44. .device_flags = FSL_I2C_DEV_SEPARATE_DFSRR,
  45. };
  46. static struct plat_serial8250_port serial_platform_data[] = {
  47. [0] = {
  48. .mapbase = 0x4500,
  49. .irq = MPC83xx_IRQ_UART1,
  50. .iotype = UPIO_MEM,
  51. .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
  52. },
  53. [1] = {
  54. .mapbase = 0x4600,
  55. .irq = MPC83xx_IRQ_UART2,
  56. .iotype = UPIO_MEM,
  57. .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST,
  58. },
  59. { },
  60. };
  61. struct platform_device ppc_sys_platform_devices[] = {
  62. [MPC83xx_TSEC1] = {
  63. .name = "fsl-gianfar",
  64. .id = 1,
  65. .dev.platform_data = &mpc83xx_tsec1_pdata,
  66. .num_resources = 4,
  67. .resource = (struct resource[]) {
  68. {
  69. .start = 0x24000,
  70. .end = 0x24fff,
  71. .flags = IORESOURCE_MEM,
  72. },
  73. {
  74. .name = "tx",
  75. .start = MPC83xx_IRQ_TSEC1_TX,
  76. .end = MPC83xx_IRQ_TSEC1_TX,
  77. .flags = IORESOURCE_IRQ,
  78. },
  79. {
  80. .name = "rx",
  81. .start = MPC83xx_IRQ_TSEC1_RX,
  82. .end = MPC83xx_IRQ_TSEC1_RX,
  83. .flags = IORESOURCE_IRQ,
  84. },
  85. {
  86. .name = "error",
  87. .start = MPC83xx_IRQ_TSEC1_ERROR,
  88. .end = MPC83xx_IRQ_TSEC1_ERROR,
  89. .flags = IORESOURCE_IRQ,
  90. },
  91. },
  92. },
  93. [MPC83xx_TSEC2] = {
  94. .name = "fsl-gianfar",
  95. .id = 2,
  96. .dev.platform_data = &mpc83xx_tsec2_pdata,
  97. .num_resources = 4,
  98. .resource = (struct resource[]) {
  99. {
  100. .start = 0x25000,
  101. .end = 0x25fff,
  102. .flags = IORESOURCE_MEM,
  103. },
  104. {
  105. .name = "tx",
  106. .start = MPC83xx_IRQ_TSEC2_TX,
  107. .end = MPC83xx_IRQ_TSEC2_TX,
  108. .flags = IORESOURCE_IRQ,
  109. },
  110. {
  111. .name = "rx",
  112. .start = MPC83xx_IRQ_TSEC2_RX,
  113. .end = MPC83xx_IRQ_TSEC2_RX,
  114. .flags = IORESOURCE_IRQ,
  115. },
  116. {
  117. .name = "error",
  118. .start = MPC83xx_IRQ_TSEC2_ERROR,
  119. .end = MPC83xx_IRQ_TSEC2_ERROR,
  120. .flags = IORESOURCE_IRQ,
  121. },
  122. },
  123. },
  124. [MPC83xx_IIC1] = {
  125. .name = "fsl-i2c",
  126. .id = 1,
  127. .dev.platform_data = &mpc83xx_fsl_i2c1_pdata,
  128. .num_resources = 2,
  129. .resource = (struct resource[]) {
  130. {
  131. .start = 0x3000,
  132. .end = 0x30ff,
  133. .flags = IORESOURCE_MEM,
  134. },
  135. {
  136. .start = MPC83xx_IRQ_IIC1,
  137. .end = MPC83xx_IRQ_IIC1,
  138. .flags = IORESOURCE_IRQ,
  139. },
  140. },
  141. },
  142. [MPC83xx_IIC2] = {
  143. .name = "fsl-i2c",
  144. .id = 2,
  145. .dev.platform_data = &mpc83xx_fsl_i2c2_pdata,
  146. .num_resources = 2,
  147. .resource = (struct resource[]) {
  148. {
  149. .start = 0x3100,
  150. .end = 0x31ff,
  151. .flags = IORESOURCE_MEM,
  152. },
  153. {
  154. .start = MPC83xx_IRQ_IIC2,
  155. .end = MPC83xx_IRQ_IIC2,
  156. .flags = IORESOURCE_IRQ,
  157. },
  158. },
  159. },
  160. [MPC83xx_DUART] = {
  161. .name = "serial8250",
  162. .id = PLAT8250_DEV_PLATFORM,
  163. .dev.platform_data = serial_platform_data,
  164. },
  165. [MPC83xx_SEC2] = {
  166. .name = "fsl-sec2",
  167. .id = 1,
  168. .num_resources = 2,
  169. .resource = (struct resource[]) {
  170. {
  171. .start = 0x30000,
  172. .end = 0x3ffff,
  173. .flags = IORESOURCE_MEM,
  174. },
  175. {
  176. .start = MPC83xx_IRQ_SEC2,
  177. .end = MPC83xx_IRQ_SEC2,
  178. .flags = IORESOURCE_IRQ,
  179. },
  180. },
  181. },
  182. [MPC83xx_USB2_DR] = {
  183. .name = "fsl-usb2-dr",
  184. .id = 1,
  185. .num_resources = 2,
  186. .resource = (struct resource[]) {
  187. {
  188. .start = 0x23000,
  189. .end = 0x23fff,
  190. .flags = IORESOURCE_MEM,
  191. },
  192. {
  193. .start = MPC83xx_IRQ_USB2_DR,
  194. .end = MPC83xx_IRQ_USB2_DR,
  195. .flags = IORESOURCE_IRQ,
  196. },
  197. },
  198. },
  199. [MPC83xx_USB2_MPH] = {
  200. .name = "fsl-usb2-mph",
  201. .id = 1,
  202. .num_resources = 2,
  203. .resource = (struct resource[]) {
  204. {
  205. .start = 0x22000,
  206. .end = 0x22fff,
  207. .flags = IORESOURCE_MEM,
  208. },
  209. {
  210. .start = MPC83xx_IRQ_USB2_MPH,
  211. .end = MPC83xx_IRQ_USB2_MPH,
  212. .flags = IORESOURCE_IRQ,
  213. },
  214. },
  215. },
  216. [MPC83xx_MDIO] = {
  217. .name = "fsl-gianfar_mdio",
  218. .id = 0,
  219. .dev.platform_data = &mpc83xx_mdio_pdata,
  220. .num_resources = 0,
  221. },
  222. };
  223. static int __init mach_mpc83xx_fixup(struct platform_device *pdev)
  224. {
  225. ppc_sys_fixup_mem_resource(pdev, immrbar);
  226. return 0;
  227. }
  228. static int __init mach_mpc83xx_init(void)
  229. {
  230. if (ppc_md.progress)
  231. ppc_md.progress("mach_mpc83xx_init:enter", 0);
  232. ppc_sys_device_fixup = mach_mpc83xx_fixup;
  233. return 0;
  234. }
  235. postcore_initcall(mach_mpc83xx_init);