rtuDataPreprocessingThread.c 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301
  1. /*
  2. * linux/arch/arm/mach-omap2/io.c
  3. *
  4. * OMAP2 I/O mapping code
  5. *
  6. * Copyright (C) 2005 Nokia Corporation
  7. * Copyright (C) 2007-2009 Texas Instruments
  8. *
  9. * Author:
  10. * Juha Yrjola <juha.yrjola@nokia.com>
  11. * Syed Khasim <x0khasim@ti.com>
  12. *
  13. * Added OMAP4 support - Santosh Shilimkar <santosh.shilimkar@ti.com>
  14. *
  15. * This program is free software; you can redistribute it and/or modify
  16. * it under the terms of the GNU General Public License version 2 as
  17. * published by the Free Software Foundation.
  18. */
  19. #include <linux/module.h>
  20. #include <linux/kernel.h>
  21. #include <linux/init.h>
  22. #include <linux/io.h>
  23. #include <linux/clk.h>
  24. #include <asm/tlb.h>
  25. #include <asm/mach/map.h>
  26. #include <linux/omap-dma.h>
  27. #include "omap_hwmod.h"
  28. #include "soc.h"
  29. #include "iomap.h"
  30. #include "voltage.h"
  31. #include "powerdomain.h"
  32. #include "clockdomain.h"
  33. #include "common.h"
  34. #include "clock.h"
  35. #include "clock2xxx.h"
  36. #include "clock3xxx.h"
  37. #include "clock44xx.h"
  38. #include "omap-pm.h"
  39. #include "sdrc.h"
  40. #include "control.h"
  41. #include "serial.h"
  42. #include "sram.h"
  43. #include "cm2xxx.h"
  44. #include "cm3xxx.h"
  45. #include "prm.h"
  46. #include "cm.h"
  47. #include "prcm_mpu44xx.h"
  48. #include "prminst44xx.h"
  49. #include "cminst44xx.h"
  50. #include "prm2xxx.h"
  51. #include "prm3xxx.h"
  52. #include "prm44xx.h"
  53. /*
  54. * omap_clk_init: points to a function that does the SoC-specific
  55. * clock initializations
  56. */
  57. int (*omap_clk_init)(void);
  58. /*
  59. * The machine specific code may provide the extra mapping besides the
  60. * default mapping provided here.
  61. */
  62. #if defined(CONFIG_SOC_OMAP2420) || defined(CONFIG_SOC_OMAP2430)
  63. static struct map_desc omap24xx_io_desc[] __initdata = {
  64. {
  65. .virtual = L3_24XX_VIRT,
  66. .pfn = __phys_to_pfn(L3_24XX_PHYS),
  67. .length = L3_24XX_SIZE,
  68. .type = MT_DEVICE
  69. },
  70. {
  71. .virtual = L4_24XX_VIRT,
  72. .pfn = __phys_to_pfn(L4_24XX_PHYS),
  73. .length = L4_24XX_SIZE,
  74. .type = MT_DEVICE
  75. },
  76. };
  77. #ifdef CONFIG_SOC_OMAP2420
  78. static struct map_desc omap242x_io_desc[] __initdata = {
  79. {
  80. .virtual = DSP_MEM_2420_VIRT,
  81. .pfn = __phys_to_pfn(DSP_MEM_2420_PHYS),
  82. .length = DSP_MEM_2420_SIZE,
  83. .type = MT_DEVICE
  84. },
  85. {
  86. .virtual = DSP_IPI_2420_VIRT,
  87. .pfn = __phys_to_pfn(DSP_IPI_2420_PHYS),
  88. .length = DSP_IPI_2420_SIZE,
  89. .type = MT_DEVICE
  90. },
  91. {
  92. .virtual = DSP_MMU_2420_VIRT,
  93. .pfn = __phys_to_pfn(DSP_MMU_2420_PHYS),
  94. .length = DSP_MMU_2420_SIZE,
  95. .type = MT_DEVICE
  96. },
  97. };
  98. #endif
  99. #ifdef CONFIG_SOC_OMAP2430
  100. static struct map_desc omap243x_io_desc[] __initdata = {
  101. {
  102. .virtual = L4_WK_243X_VIRT,
  103. .pfn = __phys_to_pfn(L4_WK_243X_PHYS),
  104. .length = L4_WK_243X_SIZE,
  105. .type = MT_DEVICE
  106. },
  107. {
  108. .virtual = OMAP243X_GPMC_VIRT,
  109. .pfn = __phys_to_pfn(OMAP243X_GPMC_PHYS),
  110. .length = OMAP243X_GPMC_SIZE,
  111. .type = MT_DEVICE
  112. },
  113. {
  114. .virtual = OMAP243X_SDRC_VIRT,
  115. .pfn = __phys_to_pfn(OMAP243X_SDRC_PHYS),
  116. .length = OMAP243X_SDRC_SIZE,
  117. .type = MT_DEVICE
  118. },
  119. {
  120. .virtual = OMAP243X_SMS_VIRT,
  121. .pfn = __phys_to_pfn(OMAP243X_SMS_PHYS),
  122. .length = OMAP243X_SMS_SIZE,
  123. .type = MT_DEVICE
  124. },
  125. };
  126. #endif
  127. #endif
  128. #ifdef CONFIG_ARCH_OMAP3
  129. static struct map_desc omap34xx_io_desc[] __initdata = {
  130. {
  131. .virtual = L3_34XX_VIRT,
  132. .pfn = __phys_to_pfn(L3_34XX_PHYS),
  133. .length = L3_34XX_SIZE,
  134. .type = MT_DEVICE
  135. },
  136. {
  137. .virtual = L4_34XX_VIRT,
  138. .pfn = __phys_to_pfn(L4_34XX_PHYS),
  139. .length = L4_34XX_SIZE,
  140. .type = MT_DEVICE
  141. },
  142. {
  143. .virtual = OMAP34XX_GPMC_VIRT,
  144. .pfn = __phys_to_pfn(OMAP34XX_GPMC_PHYS),
  145. .length = OMAP34XX_GPMC_SIZE,
  146. .type = MT_DEVICE
  147. },
  148. {
  149. .virtual = OMAP343X_SMS_VIRT,
  150. .pfn = __phys_to_pfn(OMAP343X_SMS_PHYS),
  151. .length = OMAP343X_SMS_SIZE,
  152. .type = MT_DEVICE
  153. },
  154. {
  155. .virtual = OMAP343X_SDRC_VIRT,
  156. .pfn = __phys_to_pfn(OMAP343X_SDRC_PHYS),
  157. .length = OMAP343X_SDRC_SIZE,
  158. .type = MT_DEVICE
  159. },
  160. {
  161. .virtual = L4_PER_34XX_VIRT,
  162. .pfn = __phys_to_pfn(L4_PER_34XX_PHYS),
  163. .length = L4_PER_34XX_SIZE,
  164. .type = MT_DEVICE
  165. },
  166. {
  167. .virtual = L4_EMU_34XX_VIRT,
  168. .pfn = __phys_to_pfn(L4_EMU_34XX_PHYS),
  169. .length = L4_EMU_34XX_SIZE,
  170. .type = MT_DEVICE
  171. },
  172. #if defined(CONFIG_DEBUG_LL) && \
  173. (defined(CONFIG_MACH_OMAP_ZOOM2) || defined(CONFIG_MACH_OMAP_ZOOM3))
  174. {
  175. .virtual = ZOOM_UART_VIRT,
  176. .pfn = __phys_to_pfn(ZOOM_UART_BASE),
  177. .length = SZ_1M,
  178. .type = MT_DEVICE
  179. },
  180. #endif
  181. };
  182. #endif
  183. #ifdef CONFIG_SOC_TI81XX
  184. static struct map_desc omapti81xx_io_desc[] __initdata = {
  185. {
  186. .virtual = L4_34XX_VIRT,
  187. .pfn = __phys_to_pfn(L4_34XX_PHYS),
  188. .length = L4_34XX_SIZE,
  189. .type = MT_DEVICE
  190. }
  191. };
  192. #endif
  193. #ifdef CONFIG_SOC_AM33XX
  194. static struct map_desc omapam33xx_io_desc[] __initdata = {
  195. {
  196. .virtual = L4_34XX_VIRT,
  197. .pfn = __phys_to_pfn(L4_34XX_PHYS),
  198. .length = L4_34XX_SIZE,
  199. .type = MT_DEVICE
  200. },
  201. {
  202. .virtual = L4_WK_AM33XX_VIRT,
  203. .pfn = __phys_to_pfn(L4_WK_AM33XX_PHYS),
  204. .length = L4_WK_AM33XX_SIZE,
  205. .type = MT_DEVICE
  206. }
  207. };
  208. #endif
  209. #ifdef CONFIG_ARCH_OMAP4
  210. static struct map_desc omap44xx_io_desc[] __initdata = {
  211. {
  212. .virtual = L3_44XX_VIRT,
  213. .pfn = __phys_to_pfn(L3_44XX_PHYS),
  214. .length = L3_44XX_SIZE,
  215. .type = MT_DEVICE,
  216. },
  217. {
  218. .virtual = L4_44XX_VIRT,
  219. .pfn = __phys_to_pfn(L4_44XX_PHYS),
  220. .length = L4_44XX_SIZE,
  221. .type = MT_DEVICE,
  222. },
  223. {
  224. .virtual = L4_PER_44XX_VIRT,
  225. .pfn = __phys_to_pfn(L4_PER_44XX_PHYS),
  226. .length = L4_PER_44XX_SIZE,
  227. .type = MT_DEVICE,
  228. },
  229. #ifdef CONFIG_OMAP4_ERRATA_I688
  230. {
  231. .virtual = OMAP4_SRAM_VA,
  232. .pfn = __phys_to_pfn(OMAP4_SRAM_PA),
  233. .length = PAGE_SIZE,
  234. .type = MT_MEMORY_SO,
  235. },
  236. #endif
  237. };
  238. #endif
  239. #ifdef CONFIG_SOC_OMAP5
  240. static struct map_desc omap54xx_io_desc[] __initdata = {
  241. {
  242. .virtual = L3_54XX_VIRT,
  243. .pfn = __phys_to_pfn(L3_54XX_PHYS),
  244. .length = L3_54XX_SIZE,
  245. .type = MT_DEVICE,
  246. },
  247. {
  248. .virtual = L4_54XX_VIRT,
  249. .pfn = __phys_to_pfn(L4_54XX_PHYS),
  250. .length = L4_54XX_SIZE,
  251. .type = MT_DEVICE,
  252. },
  253. {
  254. .virtual = L4_WK_54XX_VIRT,
  255. .pfn = __phys_to_pfn(L4_WK_54XX_PHYS),
  256. .length = L4_WK_54XX_SIZE,
  257. .type = MT_DEVICE,
  258. },
  259. {
  260. .virtual = L4_PER_54XX_VIRT,
  261. .pfn = __phys_to_pfn(L4_PER_54XX_PHYS),
  262. .length = L4_PER_54XX_SIZE,
  263. .type = MT_DEVICE,
  264. },
  265. };
  266. #endif
  267. #ifdef CONFIG_SOC_OMAP2420
  268. void __init omap242x_map_io(void)
  269. {
  270. iotable_init(omap24xx_io_desc, ARRAY_SIZE(omap24xx_io_desc));
  271. iotable_init(omap242x_io_desc, ARRAY_SIZE(omap242x_io_desc));
  272. }
  273. #endif
  274. #ifdef CONFIG_SOC_OMAP2430
  275. void __init omap243x_map_io(void)
  276. {
  277. iotable_init(omap24xx_io_desc, ARRAY_SIZE(omap24xx_io_desc));
  278. iotable_init(omap243x_io_desc, ARRAY_SIZE(omap243x_io_desc));
  279. }
  280. #endif
  281. #ifdef CONFIG_ARCH_OMAP3
  282. void __init omap3_map_io(void)
  283. {