synchronousMemoryDatabase.c 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284
  1. /* linux/arch/arm/mach-s5pv210/mach-aquila.c
  2. *
  3. * Copyright (c) 2010 Samsung Electronics Co., Ltd.
  4. * http://www.samsung.com/
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2 as
  8. * published by the Free Software Foundation.
  9. */
  10. #include <linux/kernel.h>
  11. #include <linux/types.h>
  12. #include <linux/init.h>
  13. #include <linux/serial_core.h>
  14. #include <linux/fb.h>
  15. #include <linux/i2c.h>
  16. #include <linux/i2c-gpio.h>
  17. #include <linux/mfd/max8998.h>
  18. #include <linux/mfd/wm8994/pdata.h>
  19. #include <linux/regulator/fixed.h>
  20. #include <linux/gpio_keys.h>
  21. #include <linux/input.h>
  22. #include <linux/gpio.h>
  23. #include <asm/hardware/vic.h>
  24. #include <asm/mach/arch.h>
  25. #include <asm/mach/map.h>
  26. #include <asm/setup.h>
  27. #include <asm/mach-types.h>
  28. #include <video/samsung_fimd.h>
  29. #include <mach/map.h>
  30. #include <mach/regs-clock.h>
  31. #include <plat/gpio-cfg.h>
  32. #include <plat/regs-serial.h>
  33. #include <plat/devs.h>
  34. #include <plat/cpu.h>
  35. #include <plat/fb.h>
  36. #include <plat/fimc-core.h>
  37. #include <plat/sdhci.h>
  38. #include <plat/s5p-time.h>
  39. #include "common.h"
  40. /* Following are default values for UCON, ULCON and UFCON UART registers */
  41. #define AQUILA_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
  42. S3C2410_UCON_RXILEVEL | \
  43. S3C2410_UCON_TXIRQMODE | \
  44. S3C2410_UCON_RXIRQMODE | \
  45. S3C2410_UCON_RXFIFO_TOI | \
  46. S3C2443_UCON_RXERR_IRQEN)
  47. #define AQUILA_ULCON_DEFAULT S3C2410_LCON_CS8
  48. #define AQUILA_UFCON_DEFAULT S3C2410_UFCON_FIFOMODE
  49. static struct s3c2410_uartcfg aquila_uartcfgs[] __initdata = {
  50. [0] = {
  51. .hwport = 0,
  52. .flags = 0,
  53. .ucon = AQUILA_UCON_DEFAULT,
  54. .ulcon = AQUILA_ULCON_DEFAULT,
  55. /*
  56. * Actually UART0 can support 256 bytes fifo, but aquila board
  57. * supports 128 bytes fifo because of initial chip bug
  58. */
  59. .ufcon = AQUILA_UFCON_DEFAULT |
  60. S5PV210_UFCON_TXTRIG128 | S5PV210_UFCON_RXTRIG128,
  61. },
  62. [1] = {
  63. .hwport = 1,
  64. .flags = 0,
  65. .ucon = AQUILA_UCON_DEFAULT,
  66. .ulcon = AQUILA_ULCON_DEFAULT,
  67. .ufcon = AQUILA_UFCON_DEFAULT |
  68. S5PV210_UFCON_TXTRIG64 | S5PV210_UFCON_RXTRIG64,
  69. },
  70. [2] = {
  71. .hwport = 2,
  72. .flags = 0,
  73. .ucon = AQUILA_UCON_DEFAULT,
  74. .ulcon = AQUILA_ULCON_DEFAULT,
  75. .ufcon = AQUILA_UFCON_DEFAULT |
  76. S5PV210_UFCON_TXTRIG16 | S5PV210_UFCON_RXTRIG16,
  77. },
  78. [3] = {
  79. .hwport = 3,
  80. .flags = 0,
  81. .ucon = AQUILA_UCON_DEFAULT,
  82. .ulcon = AQUILA_ULCON_DEFAULT,
  83. .ufcon = AQUILA_UFCON_DEFAULT |
  84. S5PV210_UFCON_TXTRIG16 | S5PV210_UFCON_RXTRIG16,
  85. },
  86. };
  87. /* Frame Buffer */
  88. static struct s3c_fb_pd_win aquila_fb_win0 = {
  89. .max_bpp = 32,
  90. .default_bpp = 16,
  91. .xres = 480,
  92. .yres = 800,
  93. };
  94. static struct s3c_fb_pd_win aquila_fb_win1 = {
  95. .max_bpp = 32,
  96. .default_bpp = 16,
  97. .xres = 480,
  98. .yres = 800,
  99. };
  100. static struct fb_videomode aquila_lcd_timing = {
  101. .left_margin = 16,
  102. .right_margin = 16,
  103. .upper_margin = 3,
  104. .lower_margin = 28,
  105. .hsync_len = 2,
  106. .vsync_len = 2,
  107. .xres = 480,
  108. .yres = 800,
  109. };
  110. static struct s3c_fb_platdata aquila_lcd_pdata __initdata = {
  111. .win[0] = &aquila_fb_win0,
  112. .win[1] = &aquila_fb_win1,
  113. .vtiming = &aquila_lcd_timing,
  114. .vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB,
  115. .vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC |
  116. VIDCON1_INV_VCLK | VIDCON1_INV_VDEN,
  117. .setup_gpio = s5pv210_fb_gpio_setup_24bpp,
  118. };
  119. /* MAX8998 regulators */
  120. #if defined(CONFIG_REGULATOR_MAX8998) || defined(CONFIG_REGULATOR_MAX8998_MODULE)
  121. static struct regulator_init_data aquila_ldo2_data = {
  122. .constraints = {
  123. .name = "VALIVE_1.1V",
  124. .min_uV = 1100000,
  125. .max_uV = 1100000,
  126. .apply_uV = 1,
  127. .always_on = 1,
  128. .state_mem = {
  129. .enabled = 1,
  130. },
  131. },
  132. };
  133. static struct regulator_init_data aquila_ldo3_data = {
  134. .constraints = {
  135. .name = "VUSB+MIPI_1.1V",
  136. .min_uV = 1100000,
  137. .max_uV = 1100000,
  138. .apply_uV = 1,
  139. .always_on = 1,
  140. },
  141. };
  142. static struct regulator_init_data aquila_ldo4_data = {
  143. .constraints = {
  144. .name = "VDAC_3.3V",
  145. .min_uV = 3300000,
  146. .max_uV = 3300000,
  147. .apply_uV = 1,
  148. },
  149. };
  150. static struct regulator_init_data aquila_ldo5_data = {
  151. .constraints = {
  152. .name = "VTF_2.8V",
  153. .min_uV = 2800000,
  154. .max_uV = 2800000,
  155. .apply_uV = 1,
  156. },
  157. };
  158. static struct regulator_init_data aquila_ldo6_data = {
  159. .constraints = {
  160. .name = "VCC_3.3V",
  161. .min_uV = 3300000,
  162. .max_uV = 3300000,
  163. .apply_uV = 1,
  164. },
  165. };
  166. static struct regulator_init_data aquila_ldo7_data = {
  167. .constraints = {
  168. .name = "VCC_3.0V",
  169. .min_uV = 3000000,
  170. .max_uV = 3000000,
  171. .apply_uV = 1,
  172. .boot_on = 1,
  173. .always_on = 1,
  174. },
  175. };
  176. static struct regulator_init_data aquila_ldo8_data = {
  177. .constraints = {
  178. .name = "VUSB+VADC_3.3V",
  179. .min_uV = 3300000,
  180. .max_uV = 3300000,
  181. .apply_uV = 1,
  182. .always_on = 1,
  183. },
  184. };
  185. static struct regulator_init_data aquila_ldo9_data = {
  186. .constraints = {
  187. .name = "VCC+VCAM_2.8V",
  188. .min_uV = 2800000,
  189. .max_uV = 2800000,
  190. .apply_uV = 1,
  191. .always_on = 1,
  192. },
  193. };
  194. static struct regulator_init_data aquila_ldo10_data = {
  195. .constraints = {
  196. .name = "VPLL_1.1V",
  197. .min_uV = 1100000,
  198. .max_uV = 1100000,
  199. .apply_uV = 1,
  200. .boot_on = 1,
  201. },
  202. };
  203. static struct regulator_init_data aquila_ldo11_data = {
  204. .constraints = {
  205. .name = "CAM_IO_2.8V",
  206. .min_uV = 2800000,
  207. .max_uV = 2800000,
  208. .apply_uV = 1,
  209. .always_on = 1,
  210. },
  211. };
  212. static struct regulator_init_data aquila_ldo12_data = {
  213. .constraints = {
  214. .name = "CAM_ISP_1.2V",
  215. .min_uV = 1200000,
  216. .max_uV = 1200000,
  217. .apply_uV = 1,
  218. .always_on = 1,
  219. },
  220. };
  221. static struct regulator_init_data aquila_ldo13_data = {
  222. .constraints = {
  223. .name = "CAM_A_2.8V",
  224. .min_uV = 2800000,
  225. .max_uV = 2800000,
  226. .apply_uV = 1,
  227. .always_on = 1,
  228. },
  229. };
  230. static struct regulator_init_data aquila_ldo14_data = {
  231. .constraints = {
  232. .name = "CAM_CIF_1.8V",
  233. .min_uV = 1800000,
  234. .max_uV = 1800000,
  235. .apply_uV = 1,
  236. .always_on = 1,
  237. },
  238. };
  239. static struct regulator_init_data aquila_ldo15_data = {
  240. .constraints = {
  241. .name = "CAM_AF_3.3V",
  242. .min_uV = 3300000,
  243. .max_uV = 3300000,
  244. .apply_uV = 1,
  245. .always_on = 1,
  246. },
  247. };
  248. static struct regulator_init_data aquila_ldo16_data = {
  249. .constraints = {
  250. .name = "VMIPI_1.8V",
  251. .min_uV = 1800000,
  252. .max_uV = 1800000,
  253. .apply_uV = 1,
  254. .always_on = 1,
  255. },