mpc83xx_devices.c 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  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. 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 = 0,
  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 = 0x22000,
  186. .end = 0x22fff,
  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 = 0x23000,
  203. .end = 0x23fff,
  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. };
  214. static int __init mach_mpc83xx_fixup(struct platform_device *pdev)
  215. {
  216. ppc_sys_fixup_mem_resource(pdev, immrbar);
  217. return 0;
  218. }
  219. static int __init mach_mpc83xx_init(void)
  220. {
  221. if (ppc_md.progress)
  222. ppc_md.progress("mach_mpc83xx_init:enter", 0);
  223. ppc_sys_device_fixup = mach_mpc83xx_fixup;
  224. return 0;
  225. }
  226. postcore_initcall(mach_mpc83xx_init);