mpc83xx_devices.c 5.1 KB

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