edb93xx.c 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  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/platform_device.h>
  29. #include <linux/i2c.h>
  30. #include <linux/mtd/physmap.h>
  31. #include <mach/hardware.h>
  32. #include <asm/mach-types.h>
  33. #include <asm/mach/arch.h>
  34. static struct physmap_flash_data edb93xx_flash_data;
  35. static struct resource edb93xx_flash_resource = {
  36. .flags = IORESOURCE_MEM,
  37. };
  38. static struct platform_device edb93xx_flash = {
  39. .name = "physmap-flash",
  40. .id = 0,
  41. .dev = {
  42. .platform_data = &edb93xx_flash_data,
  43. },
  44. .num_resources = 1,
  45. .resource = &edb93xx_flash_resource,
  46. };
  47. static void __init __edb93xx_register_flash(unsigned int width,
  48. resource_size_t start, resource_size_t size)
  49. {
  50. edb93xx_flash_data.width = width;
  51. edb93xx_flash_resource.start = start;
  52. edb93xx_flash_resource.end = start + size - 1;
  53. platform_device_register(&edb93xx_flash);
  54. }
  55. static void __init edb93xx_register_flash(void)
  56. {
  57. if (machine_is_edb9307() || machine_is_edb9312() ||
  58. machine_is_edb9315()) {
  59. __edb93xx_register_flash(4, EP93XX_CS6_PHYS_BASE, SZ_32M);
  60. } else {
  61. __edb93xx_register_flash(2, EP93XX_CS6_PHYS_BASE, SZ_16M);
  62. }
  63. }
  64. static struct ep93xx_eth_data edb93xx_eth_data = {
  65. .phy_id = 1,
  66. };
  67. static struct i2c_board_info __initdata edb93xxa_i2c_data[] = {
  68. {
  69. I2C_BOARD_INFO("isl1208", 0x6f),
  70. },
  71. };
  72. static struct i2c_board_info __initdata edb93xx_i2c_data[] = {
  73. {
  74. I2C_BOARD_INFO("ds1337", 0x68),
  75. },
  76. };
  77. static void __init edb93xx_register_i2c(void)
  78. {
  79. if (machine_is_edb9302a() || machine_is_edb9307a() ||
  80. machine_is_edb9315a()) {
  81. ep93xx_register_i2c(edb93xxa_i2c_data,
  82. ARRAY_SIZE(edb93xxa_i2c_data));
  83. } else if (machine_is_edb9307() || machine_is_edb9312() ||
  84. machine_is_edb9315()) {
  85. ep93xx_register_i2c(edb93xx_i2c_data,
  86. ARRAY_SIZE(edb93xx_i2c_data));
  87. }
  88. }
  89. static void __init edb93xx_init_machine(void)
  90. {
  91. ep93xx_init_devices();
  92. edb93xx_register_flash();
  93. ep93xx_register_eth(&edb93xx_eth_data, 1);
  94. edb93xx_register_i2c();
  95. }
  96. #ifdef CONFIG_MACH_EDB9301
  97. MACHINE_START(EDB9301, "Cirrus Logic EDB9301 Evaluation Board")
  98. /* Maintainer: H Hartley Sweeten <hsweeten@visionengravers.com> */
  99. .phys_io = EP93XX_APB_PHYS_BASE,
  100. .io_pg_offst = ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc,
  101. .boot_params = EP93XX_SDCE3_PHYS_BASE_SYNC + 0x100,
  102. .map_io = ep93xx_map_io,
  103. .init_irq = ep93xx_init_irq,
  104. .timer = &ep93xx_timer,
  105. .init_machine = edb93xx_init_machine,
  106. MACHINE_END
  107. #endif
  108. #ifdef CONFIG_MACH_EDB9302
  109. MACHINE_START(EDB9302, "Cirrus Logic EDB9302 Evaluation Board")
  110. /* Maintainer: George Kashperko <george@chas.com.ua> */
  111. .phys_io = EP93XX_APB_PHYS_BASE,
  112. .io_pg_offst = ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc,
  113. .boot_params = EP93XX_SDCE3_PHYS_BASE_SYNC + 0x100,
  114. .map_io = ep93xx_map_io,
  115. .init_irq = ep93xx_init_irq,
  116. .timer = &ep93xx_timer,
  117. .init_machine = edb93xx_init_machine,
  118. MACHINE_END
  119. #endif
  120. #ifdef CONFIG_MACH_EDB9302A
  121. MACHINE_START(EDB9302A, "Cirrus Logic EDB9302A Evaluation Board")
  122. /* Maintainer: Lennert Buytenhek <buytenh@wantstofly.org> */
  123. .phys_io = EP93XX_APB_PHYS_BASE,
  124. .io_pg_offst = ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc,
  125. .boot_params = EP93XX_SDCE0_PHYS_BASE + 0x100,
  126. .map_io = ep93xx_map_io,
  127. .init_irq = ep93xx_init_irq,
  128. .timer = &ep93xx_timer,
  129. .init_machine = edb93xx_init_machine,
  130. MACHINE_END
  131. #endif
  132. #ifdef CONFIG_MACH_EDB9307
  133. MACHINE_START(EDB9307, "Cirrus Logic EDB9307 Evaluation Board")
  134. /* Maintainer: Herbert Valerio Riedel <hvr@gnu.org> */
  135. .phys_io = EP93XX_APB_PHYS_BASE,
  136. .io_pg_offst = ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc,
  137. .boot_params = EP93XX_SDCE3_PHYS_BASE_SYNC + 0x100,
  138. .map_io = ep93xx_map_io,
  139. .init_irq = ep93xx_init_irq,
  140. .timer = &ep93xx_timer,
  141. .init_machine = edb93xx_init_machine,
  142. MACHINE_END
  143. #endif
  144. #ifdef CONFIG_MACH_EDB9307A
  145. MACHINE_START(EDB9307A, "Cirrus Logic EDB9307A Evaluation Board")
  146. /* Maintainer: H Hartley Sweeten <hsweeten@visionengravers.com> */
  147. .phys_io = EP93XX_APB_PHYS_BASE,
  148. .io_pg_offst = ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc,
  149. .boot_params = EP93XX_SDCE0_PHYS_BASE + 0x100,
  150. .map_io = ep93xx_map_io,
  151. .init_irq = ep93xx_init_irq,
  152. .timer = &ep93xx_timer,
  153. .init_machine = edb93xx_init_machine,
  154. MACHINE_END
  155. #endif
  156. #ifdef CONFIG_MACH_EDB9312
  157. MACHINE_START(EDB9312, "Cirrus Logic EDB9312 Evaluation Board")
  158. /* Maintainer: Toufeeq Hussain <toufeeq_hussain@infosys.com> */
  159. .phys_io = EP93XX_APB_PHYS_BASE,
  160. .io_pg_offst = ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc,
  161. .boot_params = EP93XX_SDCE3_PHYS_BASE_SYNC + 0x100,
  162. .map_io = ep93xx_map_io,
  163. .init_irq = ep93xx_init_irq,
  164. .timer = &ep93xx_timer,
  165. .init_machine = edb93xx_init_machine,
  166. MACHINE_END
  167. #endif
  168. #ifdef CONFIG_MACH_EDB9315
  169. MACHINE_START(EDB9315, "Cirrus Logic EDB9315 Evaluation Board")
  170. /* Maintainer: Lennert Buytenhek <buytenh@wantstofly.org> */
  171. .phys_io = EP93XX_APB_PHYS_BASE,
  172. .io_pg_offst = ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc,
  173. .boot_params = EP93XX_SDCE3_PHYS_BASE_SYNC + 0x100,
  174. .map_io = ep93xx_map_io,
  175. .init_irq = ep93xx_init_irq,
  176. .timer = &ep93xx_timer,
  177. .init_machine = edb93xx_init_machine,
  178. MACHINE_END
  179. #endif
  180. #ifdef CONFIG_MACH_EDB9315A
  181. MACHINE_START(EDB9315A, "Cirrus Logic EDB9315A Evaluation Board")
  182. /* Maintainer: Lennert Buytenhek <buytenh@wantstofly.org> */
  183. .phys_io = EP93XX_APB_PHYS_BASE,
  184. .io_pg_offst = ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc,
  185. .boot_params = EP93XX_SDCE0_PHYS_BASE + 0x100,
  186. .map_io = ep93xx_map_io,
  187. .init_irq = ep93xx_init_irq,
  188. .timer = &ep93xx_timer,
  189. .init_machine = edb93xx_init_machine,
  190. MACHINE_END
  191. #endif