edb93xx.c 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  1. /*
  2. * arch/arm/mach-ep93xx/edb93xx.c
  3. * Cirrus Logic EDB93xx Development Board support.
  4. *
  5. * EDB93XX, EDB9301, EDB9307A
  6. * Copyright (C) 2008-2009 H Hartley Sweeten <hsweeten@visionengravers.com>
  7. *
  8. * EDB9302
  9. * Copyright (C) 2006 George Kashperko <george@chas.com.ua>
  10. *
  11. * EDB9302A, EDB9315, EDB9315A
  12. * Copyright (C) 2006 Lennert Buytenhek <buytenh@wantstofly.org>
  13. *
  14. * EDB9307
  15. * Copyright (C) 2007 Herbert Valerio Riedel <hvr@gnu.org>
  16. *
  17. * EDB9312
  18. * Copyright (C) 2006 Infosys Technologies Limited
  19. * Toufeeq Hussain <toufeeq_hussain@infosys.com>
  20. *
  21. * This program is free software; you can redistribute it and/or modify
  22. * it under the terms of the GNU General Public License as published by
  23. * the Free Software Foundation; either version 2 of the License, or (at
  24. * your option) any later version.
  25. */
  26. #include <linux/kernel.h>
  27. #include <linux/init.h>
  28. #include <linux/mm.h>
  29. #include <linux/sched.h>
  30. #include <linux/interrupt.h>
  31. #include <linux/ioport.h>
  32. #include <linux/mtd/physmap.h>
  33. #include <linux/platform_device.h>
  34. #include <linux/io.h>
  35. #include <linux/i2c.h>
  36. #include <mach/hardware.h>
  37. #include <asm/mach-types.h>
  38. #include <asm/mach/arch.h>
  39. static struct physmap_flash_data edb93xx_flash_data;
  40. static struct resource edb93xx_flash_resource = {
  41. .flags = IORESOURCE_MEM,
  42. };
  43. static struct platform_device edb93xx_flash = {
  44. .name = "physmap-flash",
  45. .id = 0,
  46. .dev = {
  47. .platform_data = &edb93xx_flash_data,
  48. },
  49. .num_resources = 1,
  50. .resource = &edb93xx_flash_resource,
  51. };
  52. static void __init __edb93xx_register_flash(unsigned int width,
  53. resource_size_t start, resource_size_t size)
  54. {
  55. edb93xx_flash_data.width = width;
  56. edb93xx_flash_resource.start = start;
  57. edb93xx_flash_resource.end = start + size - 1;
  58. platform_device_register(&edb93xx_flash);
  59. }
  60. static void __init edb93xx_register_flash(void)
  61. {
  62. if (machine_is_edb9307() || machine_is_edb9312() ||
  63. machine_is_edb9315()) {
  64. __edb93xx_register_flash(4, EP93XX_CS6_PHYS_BASE, SZ_32M);
  65. } else {
  66. __edb93xx_register_flash(2, EP93XX_CS6_PHYS_BASE, SZ_16M);
  67. }
  68. }
  69. static struct ep93xx_eth_data edb93xx_eth_data = {
  70. .phy_id = 1,
  71. };
  72. static struct i2c_board_info __initdata edb93xxa_i2c_data[] = {
  73. {
  74. I2C_BOARD_INFO("isl1208", 0x6f),
  75. },
  76. };
  77. static struct i2c_board_info __initdata edb93xx_i2c_data[] = {
  78. {
  79. I2C_BOARD_INFO("ds1337", 0x68),
  80. },
  81. };
  82. static void __init edb93xx_register_i2c(void)
  83. {
  84. if (machine_is_edb9302a() || machine_is_edb9307a() ||
  85. machine_is_edb9315a()) {
  86. ep93xx_register_i2c(edb93xxa_i2c_data,
  87. ARRAY_SIZE(edb93xxa_i2c_data));
  88. } else if (machine_is_edb9307() || machine_is_edb9312() ||
  89. machine_is_edb9315()) {
  90. ep93xx_register_i2c(edb93xx_i2c_data,
  91. ARRAY_SIZE(edb93xx_i2c_data));
  92. }
  93. }
  94. static void __init edb93xx_init_machine(void)
  95. {
  96. ep93xx_init_devices();
  97. edb93xx_register_flash();
  98. ep93xx_register_eth(&edb93xx_eth_data, 1);
  99. edb93xx_register_i2c();
  100. }
  101. #ifdef CONFIG_MACH_EDB9301
  102. MACHINE_START(EDB9301, "Cirrus Logic EDB9301 Evaluation Board")
  103. /* Maintainer: H Hartley Sweeten <hsweeten@visionengravers.com> */
  104. .phys_io = EP93XX_APB_PHYS_BASE,
  105. .io_pg_offst = ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc,
  106. .boot_params = EP93XX_SDCE3_PHYS_BASE_SYNC + 0x100,
  107. .map_io = ep93xx_map_io,
  108. .init_irq = ep93xx_init_irq,
  109. .timer = &ep93xx_timer,
  110. .init_machine = edb93xx_init_machine,
  111. MACHINE_END
  112. #endif
  113. #ifdef CONFIG_MACH_EDB9302
  114. MACHINE_START(EDB9302, "Cirrus Logic EDB9302 Evaluation Board")
  115. /* Maintainer: George Kashperko <george@chas.com.ua> */
  116. .phys_io = EP93XX_APB_PHYS_BASE,
  117. .io_pg_offst = ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc,
  118. .boot_params = EP93XX_SDCE3_PHYS_BASE_SYNC + 0x100,
  119. .map_io = ep93xx_map_io,
  120. .init_irq = ep93xx_init_irq,
  121. .timer = &ep93xx_timer,
  122. .init_machine = edb93xx_init_machine,
  123. MACHINE_END
  124. #endif
  125. #ifdef CONFIG_MACH_EDB9302A
  126. MACHINE_START(EDB9302A, "Cirrus Logic EDB9302A Evaluation Board")
  127. /* Maintainer: Lennert Buytenhek <buytenh@wantstofly.org> */
  128. .phys_io = EP93XX_APB_PHYS_BASE,
  129. .io_pg_offst = ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc,
  130. .boot_params = EP93XX_SDCE0_PHYS_BASE + 0x100,
  131. .map_io = ep93xx_map_io,
  132. .init_irq = ep93xx_init_irq,
  133. .timer = &ep93xx_timer,
  134. .init_machine = edb93xx_init_machine,
  135. MACHINE_END
  136. #endif
  137. #ifdef CONFIG_MACH_EDB9307
  138. MACHINE_START(EDB9307, "Cirrus Logic EDB9307 Evaluation Board")
  139. /* Maintainer: Herbert Valerio Riedel <hvr@gnu.org> */
  140. .phys_io = EP93XX_APB_PHYS_BASE,
  141. .io_pg_offst = ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc,
  142. .boot_params = EP93XX_SDCE3_PHYS_BASE_SYNC + 0x100,
  143. .map_io = ep93xx_map_io,
  144. .init_irq = ep93xx_init_irq,
  145. .timer = &ep93xx_timer,
  146. .init_machine = edb93xx_init_machine,
  147. MACHINE_END
  148. #endif
  149. #ifdef CONFIG_MACH_EDB9307A
  150. MACHINE_START(EDB9307A, "Cirrus Logic EDB9307A Evaluation Board")
  151. /* Maintainer: H Hartley Sweeten <hsweeten@visionengravers.com> */
  152. .phys_io = EP93XX_APB_PHYS_BASE,
  153. .io_pg_offst = ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc,
  154. .boot_params = EP93XX_SDCE0_PHYS_BASE + 0x100,
  155. .map_io = ep93xx_map_io,
  156. .init_irq = ep93xx_init_irq,
  157. .timer = &ep93xx_timer,
  158. .init_machine = edb93xx_init_machine,
  159. MACHINE_END
  160. #endif
  161. #ifdef CONFIG_MACH_EDB9312
  162. MACHINE_START(EDB9312, "Cirrus Logic EDB9312 Evaluation Board")
  163. /* Maintainer: Toufeeq Hussain <toufeeq_hussain@infosys.com> */
  164. .phys_io = EP93XX_APB_PHYS_BASE,
  165. .io_pg_offst = ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc,
  166. .boot_params = EP93XX_SDCE3_PHYS_BASE_SYNC + 0x100,
  167. .map_io = ep93xx_map_io,
  168. .init_irq = ep93xx_init_irq,
  169. .timer = &ep93xx_timer,
  170. .init_machine = edb93xx_init_machine,
  171. MACHINE_END
  172. #endif
  173. #ifdef CONFIG_MACH_EDB9315
  174. MACHINE_START(EDB9315, "Cirrus Logic EDB9315 Evaluation Board")
  175. /* Maintainer: Lennert Buytenhek <buytenh@wantstofly.org> */
  176. .phys_io = EP93XX_APB_PHYS_BASE,
  177. .io_pg_offst = ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc,
  178. .boot_params = EP93XX_SDCE3_PHYS_BASE_SYNC + 0x100,
  179. .map_io = ep93xx_map_io,
  180. .init_irq = ep93xx_init_irq,
  181. .timer = &ep93xx_timer,
  182. .init_machine = edb93xx_init_machine,
  183. MACHINE_END
  184. #endif
  185. #ifdef CONFIG_MACH_EDB9315A
  186. MACHINE_START(EDB9315A, "Cirrus Logic EDB9315A Evaluation Board")
  187. /* Maintainer: Lennert Buytenhek <buytenh@wantstofly.org> */
  188. .phys_io = EP93XX_APB_PHYS_BASE,
  189. .io_pg_offst = ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc,
  190. .boot_params = EP93XX_SDCE0_PHYS_BASE + 0x100,
  191. .map_io = ep93xx_map_io,
  192. .init_irq = ep93xx_init_irq,
  193. .timer = &ep93xx_timer,
  194. .init_machine = edb93xx_init_machine,
  195. MACHINE_END
  196. #endif