core.c 54 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870
  1. /*
  2. *
  3. * arch/arm/mach-u300/core.c
  4. *
  5. *
  6. * Copyright (C) 2007-2010 ST-Ericsson SA
  7. * License terms: GNU General Public License (GPL) version 2
  8. * Core platform support, IRQ handling and device definitions.
  9. * Author: Linus Walleij <linus.walleij@stericsson.com>
  10. */
  11. #include <linux/kernel.h>
  12. #include <linux/init.h>
  13. #include <linux/spinlock.h>
  14. #include <linux/interrupt.h>
  15. #include <linux/bitops.h>
  16. #include <linux/device.h>
  17. #include <linux/mm.h>
  18. #include <linux/termios.h>
  19. #include <linux/dmaengine.h>
  20. #include <linux/amba/bus.h>
  21. #include <linux/amba/mmci.h>
  22. #include <linux/amba/serial.h>
  23. #include <linux/platform_device.h>
  24. #include <linux/gpio.h>
  25. #include <linux/clk.h>
  26. #include <linux/err.h>
  27. #include <linux/mtd/nand.h>
  28. #include <linux/mtd/fsmc.h>
  29. #include <linux/pinctrl/machine.h>
  30. #include <linux/pinctrl/consumer.h>
  31. #include <linux/pinctrl/pinconf-generic.h>
  32. #include <linux/dma-mapping.h>
  33. #include <asm/types.h>
  34. #include <asm/setup.h>
  35. #include <asm/memory.h>
  36. #include <asm/hardware/vic.h>
  37. #include <asm/mach/map.h>
  38. #include <asm/mach/irq.h>
  39. #include <mach/coh901318.h>
  40. #include <mach/hardware.h>
  41. #include <mach/syscon.h>
  42. #include <mach/dma_channels.h>
  43. #include <mach/gpio-u300.h>
  44. #include "clock.h"
  45. #include "spi.h"
  46. #include "i2c.h"
  47. #include "u300-gpio.h"
  48. /*
  49. * Static I/O mappings that are needed for booting the U300 platforms. The
  50. * only things we need are the areas where we find the timer, syscon and
  51. * intcon, since the remaining device drivers will map their own memory
  52. * physical to virtual as the need arise.
  53. */
  54. static struct map_desc u300_io_desc[] __initdata = {
  55. {
  56. .virtual = U300_SLOW_PER_VIRT_BASE,
  57. .pfn = __phys_to_pfn(U300_SLOW_PER_PHYS_BASE),
  58. .length = SZ_64K,
  59. .type = MT_DEVICE,
  60. },
  61. {
  62. .virtual = U300_AHB_PER_VIRT_BASE,
  63. .pfn = __phys_to_pfn(U300_AHB_PER_PHYS_BASE),
  64. .length = SZ_32K,
  65. .type = MT_DEVICE,
  66. },
  67. {
  68. .virtual = U300_FAST_PER_VIRT_BASE,
  69. .pfn = __phys_to_pfn(U300_FAST_PER_PHYS_BASE),
  70. .length = SZ_32K,
  71. .type = MT_DEVICE,
  72. },
  73. };
  74. void __init u300_map_io(void)
  75. {
  76. iotable_init(u300_io_desc, ARRAY_SIZE(u300_io_desc));
  77. /* We enable a real big DMA buffer if need be. */
  78. init_consistent_dma_size(SZ_4M);
  79. }
  80. /*
  81. * Declaration of devices found on the U300 board and
  82. * their respective memory locations.
  83. */
  84. static struct amba_pl011_data uart0_plat_data = {
  85. #ifdef CONFIG_COH901318
  86. .dma_filter = coh901318_filter_id,
  87. .dma_rx_param = (void *) U300_DMA_UART0_RX,
  88. .dma_tx_param = (void *) U300_DMA_UART0_TX,
  89. #endif
  90. };
  91. /* Slow device at 0x3000 offset */
  92. static AMBA_APB_DEVICE(uart0, "uart0", 0, U300_UART0_BASE,
  93. { IRQ_U300_UART0 }, &uart0_plat_data);
  94. /* The U335 have an additional UART1 on the APP CPU */
  95. #ifdef CONFIG_MACH_U300_BS335
  96. static struct amba_pl011_data uart1_plat_data = {
  97. #ifdef CONFIG_COH901318
  98. .dma_filter = coh901318_filter_id,
  99. .dma_rx_param = (void *) U300_DMA_UART1_RX,
  100. .dma_tx_param = (void *) U300_DMA_UART1_TX,
  101. #endif
  102. };
  103. /* Fast device at 0x7000 offset */
  104. static AMBA_APB_DEVICE(uart1, "uart1", 0, U300_UART1_BASE,
  105. { IRQ_U300_UART1 }, &uart1_plat_data);
  106. #endif
  107. /* AHB device at 0x4000 offset */
  108. static AMBA_APB_DEVICE(pl172, "pl172", 0, U300_EMIF_CFG_BASE, { }, NULL);
  109. /* Fast device at 0x6000 offset */
  110. static AMBA_APB_DEVICE(pl022, "pl022", 0, U300_SPI_BASE,
  111. { IRQ_U300_SPI }, NULL);
  112. /* Fast device at 0x1000 offset */
  113. #define U300_MMCSD_IRQS { IRQ_U300_MMCSD_MCIINTR0, IRQ_U300_MMCSD_MCIINTR1 }
  114. static struct mmci_platform_data mmcsd_platform_data = {
  115. /*
  116. * Do not set ocr_mask or voltage translation function,
  117. * we have a regulator we can control instead.
  118. */
  119. .f_max = 24000000,
  120. .gpio_wp = -1,
  121. .gpio_cd = U300_GPIO_PIN_MMC_CD,
  122. .cd_invert = true,
  123. .capabilities = MMC_CAP_MMC_HIGHSPEED |
  124. MMC_CAP_SD_HIGHSPEED | MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA,
  125. #ifdef CONFIG_COH901318
  126. .dma_filter = coh901318_filter_id,
  127. .dma_rx_param = (void *) U300_DMA_MMCSD_RX_TX,
  128. /* Don't specify a TX channel, this RX channel is bidirectional */
  129. #endif
  130. };
  131. static AMBA_APB_DEVICE(mmcsd, "mmci", 0, U300_MMCSD_BASE,
  132. U300_MMCSD_IRQS, &mmcsd_platform_data);
  133. /*
  134. * The order of device declaration may be important, since some devices
  135. * have dependencies on other devices being initialized first.
  136. */
  137. static struct amba_device *amba_devs[] __initdata = {
  138. &uart0_device,
  139. #ifdef CONFIG_MACH_U300_BS335
  140. &uart1_device,
  141. #endif
  142. &pl022_device,
  143. &pl172_device,
  144. &mmcsd_device,
  145. };
  146. /* Here follows a list of all hw resources that the platform devices
  147. * allocate. Note, clock dependencies are not included
  148. */
  149. static struct resource gpio_resources[] = {
  150. {
  151. .start = U300_GPIO_BASE,
  152. .end = (U300_GPIO_BASE + SZ_4K - 1),
  153. .flags = IORESOURCE_MEM,
  154. },
  155. {
  156. .name = "gpio0",
  157. .start = IRQ_U300_GPIO_PORT0,
  158. .end = IRQ_U300_GPIO_PORT0,
  159. .flags = IORESOURCE_IRQ,
  160. },
  161. {
  162. .name = "gpio1",
  163. .start = IRQ_U300_GPIO_PORT1,
  164. .end = IRQ_U300_GPIO_PORT1,
  165. .flags = IORESOURCE_IRQ,
  166. },
  167. {
  168. .name = "gpio2",
  169. .start = IRQ_U300_GPIO_PORT2,
  170. .end = IRQ_U300_GPIO_PORT2,
  171. .flags = IORESOURCE_IRQ,
  172. },
  173. #if defined(CONFIG_MACH_U300_BS365) || defined(CONFIG_MACH_U300_BS335)
  174. {
  175. .name = "gpio3",
  176. .start = IRQ_U300_GPIO_PORT3,
  177. .end = IRQ_U300_GPIO_PORT3,
  178. .flags = IORESOURCE_IRQ,
  179. },
  180. {
  181. .name = "gpio4",
  182. .start = IRQ_U300_GPIO_PORT4,
  183. .end = IRQ_U300_GPIO_PORT4,
  184. .flags = IORESOURCE_IRQ,
  185. },
  186. #endif
  187. #ifdef CONFIG_MACH_U300_BS335
  188. {
  189. .name = "gpio5",
  190. .start = IRQ_U300_GPIO_PORT5,
  191. .end = IRQ_U300_GPIO_PORT5,
  192. .flags = IORESOURCE_IRQ,
  193. },
  194. {
  195. .name = "gpio6",
  196. .start = IRQ_U300_GPIO_PORT6,
  197. .end = IRQ_U300_GPIO_PORT6,
  198. .flags = IORESOURCE_IRQ,
  199. },
  200. #endif /* CONFIG_MACH_U300_BS335 */
  201. };
  202. static struct resource keypad_resources[] = {
  203. {
  204. .start = U300_KEYPAD_BASE,
  205. .end = U300_KEYPAD_BASE + SZ_4K - 1,
  206. .flags = IORESOURCE_MEM,
  207. },
  208. {
  209. .name = "coh901461-press",
  210. .start = IRQ_U300_KEYPAD_KEYBF,
  211. .end = IRQ_U300_KEYPAD_KEYBF,
  212. .flags = IORESOURCE_IRQ,
  213. },
  214. {
  215. .name = "coh901461-release",
  216. .start = IRQ_U300_KEYPAD_KEYBR,
  217. .end = IRQ_U300_KEYPAD_KEYBR,
  218. .flags = IORESOURCE_IRQ,
  219. },
  220. };
  221. static struct resource rtc_resources[] = {
  222. {
  223. .start = U300_RTC_BASE,
  224. .end = U300_RTC_BASE + SZ_4K - 1,
  225. .flags = IORESOURCE_MEM,
  226. },
  227. {
  228. .start = IRQ_U300_RTC,
  229. .end = IRQ_U300_RTC,
  230. .flags = IORESOURCE_IRQ,
  231. },
  232. };
  233. /*
  234. * Fsmc does have IRQs: #43 and #44 (NFIF and NFIF2)
  235. * but these are not yet used by the driver.
  236. */
  237. static struct resource fsmc_resources[] = {
  238. {
  239. .name = "nand_data",
  240. .start = U300_NAND_CS0_PHYS_BASE,
  241. .end = U300_NAND_CS0_PHYS_BASE + SZ_16K - 1,
  242. .flags = IORESOURCE_MEM,
  243. },
  244. {
  245. .name = "fsmc_regs",
  246. .start = U300_NAND_IF_PHYS_BASE,
  247. .end = U300_NAND_IF_PHYS_BASE + SZ_4K - 1,
  248. .flags = IORESOURCE_MEM,
  249. },
  250. };
  251. static struct resource i2c0_resources[] = {
  252. {
  253. .start = U300_I2C0_BASE,
  254. .end = U300_I2C0_BASE + SZ_4K - 1,
  255. .flags = IORESOURCE_MEM,
  256. },
  257. {
  258. .start = IRQ_U300_I2C0,
  259. .end = IRQ_U300_I2C0,
  260. .flags = IORESOURCE_IRQ,
  261. },
  262. };
  263. static struct resource i2c1_resources[] = {
  264. {
  265. .start = U300_I2C1_BASE,
  266. .end = U300_I2C1_BASE + SZ_4K - 1,
  267. .flags = IORESOURCE_MEM,
  268. },
  269. {
  270. .start = IRQ_U300_I2C1,
  271. .end = IRQ_U300_I2C1,
  272. .flags = IORESOURCE_IRQ,
  273. },
  274. };
  275. static struct resource wdog_resources[] = {
  276. {
  277. .start = U300_WDOG_BASE,
  278. .end = U300_WDOG_BASE + SZ_4K - 1,
  279. .flags = IORESOURCE_MEM,
  280. },
  281. {
  282. .start = IRQ_U300_WDOG,
  283. .end = IRQ_U300_WDOG,
  284. .flags = IORESOURCE_IRQ,
  285. }
  286. };
  287. static struct resource dma_resource[] = {
  288. {
  289. .start = U300_DMAC_BASE,
  290. .end = U300_DMAC_BASE + PAGE_SIZE - 1,
  291. .flags = IORESOURCE_MEM,
  292. },
  293. {
  294. .start = IRQ_U300_DMA,
  295. .end = IRQ_U300_DMA,
  296. .flags = IORESOURCE_IRQ,
  297. }
  298. };
  299. #ifdef CONFIG_MACH_U300_BS335
  300. /* points out all dma slave channels.
  301. * Syntax is [A1, B1, A2, B2, .... ,-1,-1]
  302. * Select all channels from A to B, end of list is marked with -1,-1
  303. */
  304. static int dma_slave_channels[] = {
  305. U300_DMA_MSL_TX_0, U300_DMA_SPI_RX,
  306. U300_DMA_UART1_TX, U300_DMA_UART1_RX, -1, -1};
  307. /* points out all dma memcpy channels. */
  308. static int dma_memcpy_channels[] = {
  309. U300_DMA_GENERAL_PURPOSE_0, U300_DMA_GENERAL_PURPOSE_8, -1, -1};
  310. #else /* CONFIG_MACH_U300_BS335 */
  311. static int dma_slave_channels[] = {U300_DMA_MSL_TX_0, U300_DMA_SPI_RX, -1, -1};
  312. static int dma_memcpy_channels[] = {
  313. U300_DMA_GENERAL_PURPOSE_0, U300_DMA_GENERAL_PURPOSE_10, -1, -1};
  314. #endif
  315. /** register dma for memory access
  316. *
  317. * active 1 means dma intends to access memory
  318. * 0 means dma wont access memory
  319. */
  320. static void coh901318_access_memory_state(struct device *dev, bool active)
  321. {
  322. }
  323. #define flags_memcpy_config (COH901318_CX_CFG_CH_DISABLE | \
  324. COH901318_CX_CFG_RM_MEMORY_TO_MEMORY | \
  325. COH901318_CX_CFG_LCR_DISABLE | \
  326. COH901318_CX_CFG_TC_IRQ_ENABLE | \
  327. COH901318_CX_CFG_BE_IRQ_ENABLE)
  328. #define flags_memcpy_lli_chained (COH901318_CX_CTRL_TC_ENABLE | \
  329. COH901318_CX_CTRL_BURST_COUNT_32_BYTES | \
  330. COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS | \
  331. COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE | \
  332. COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS | \
  333. COH901318_CX_CTRL_DST_ADDR_INC_ENABLE | \
  334. COH901318_CX_CTRL_MASTER_MODE_M1RW | \
  335. COH901318_CX_CTRL_TCP_DISABLE | \
  336. COH901318_CX_CTRL_TC_IRQ_DISABLE | \
  337. COH901318_CX_CTRL_HSP_DISABLE | \
  338. COH901318_CX_CTRL_HSS_DISABLE | \
  339. COH901318_CX_CTRL_DDMA_LEGACY | \
  340. COH901318_CX_CTRL_PRDD_SOURCE)
  341. #define flags_memcpy_lli (COH901318_CX_CTRL_TC_ENABLE | \
  342. COH901318_CX_CTRL_BURST_COUNT_32_BYTES | \
  343. COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS | \
  344. COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE | \
  345. COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS | \
  346. COH901318_CX_CTRL_DST_ADDR_INC_ENABLE | \
  347. COH901318_CX_CTRL_MASTER_MODE_M1RW | \
  348. COH901318_CX_CTRL_TCP_DISABLE | \
  349. COH901318_CX_CTRL_TC_IRQ_DISABLE | \
  350. COH901318_CX_CTRL_HSP_DISABLE | \
  351. COH901318_CX_CTRL_HSS_DISABLE | \
  352. COH901318_CX_CTRL_DDMA_LEGACY | \
  353. COH901318_CX_CTRL_PRDD_SOURCE)
  354. #define flags_memcpy_lli_last (COH901318_CX_CTRL_TC_ENABLE | \
  355. COH901318_CX_CTRL_BURST_COUNT_32_BYTES | \
  356. COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS | \
  357. COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE | \
  358. COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS | \
  359. COH901318_CX_CTRL_DST_ADDR_INC_ENABLE | \
  360. COH901318_CX_CTRL_MASTER_MODE_M1RW | \
  361. COH901318_CX_CTRL_TCP_DISABLE | \
  362. COH901318_CX_CTRL_TC_IRQ_ENABLE | \
  363. COH901318_CX_CTRL_HSP_DISABLE | \
  364. COH901318_CX_CTRL_HSS_DISABLE | \
  365. COH901318_CX_CTRL_DDMA_LEGACY | \
  366. COH901318_CX_CTRL_PRDD_SOURCE)
  367. const struct coh_dma_channel chan_config[U300_DMA_CHANNELS] = {
  368. {
  369. .number = U300_DMA_MSL_TX_0,
  370. .name = "MSL TX 0",
  371. .priority_high = 0,
  372. .dev_addr = U300_MSL_BASE + 0 * 0x40 + 0x20,
  373. },
  374. {
  375. .number = U300_DMA_MSL_TX_1,
  376. .name = "MSL TX 1",
  377. .priority_high = 0,
  378. .dev_addr = U300_MSL_BASE + 1 * 0x40 + 0x20,
  379. .param.config = COH901318_CX_CFG_CH_DISABLE |
  380. COH901318_CX_CFG_LCR_DISABLE |
  381. COH901318_CX_CFG_TC_IRQ_ENABLE |
  382. COH901318_CX_CFG_BE_IRQ_ENABLE,
  383. .param.ctrl_lli_chained = 0 |
  384. COH901318_CX_CTRL_TC_ENABLE |
  385. COH901318_CX_CTRL_BURST_COUNT_32_BYTES |
  386. COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
  387. COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE |
  388. COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
  389. COH901318_CX_CTRL_DST_ADDR_INC_DISABLE |
  390. COH901318_CX_CTRL_MASTER_MODE_M1R_M2W |
  391. COH901318_CX_CTRL_TCP_DISABLE |
  392. COH901318_CX_CTRL_TC_IRQ_DISABLE |
  393. COH901318_CX_CTRL_HSP_ENABLE |
  394. COH901318_CX_CTRL_HSS_DISABLE |
  395. COH901318_CX_CTRL_DDMA_LEGACY |
  396. COH901318_CX_CTRL_PRDD_SOURCE,
  397. .param.ctrl_lli = 0 |
  398. COH901318_CX_CTRL_TC_ENABLE |
  399. COH901318_CX_CTRL_BURST_COUNT_32_BYTES |
  400. COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
  401. COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE |
  402. COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
  403. COH901318_CX_CTRL_DST_ADDR_INC_DISABLE |
  404. COH901318_CX_CTRL_MASTER_MODE_M1R_M2W |
  405. COH901318_CX_CTRL_TCP_ENABLE |
  406. COH901318_CX_CTRL_TC_IRQ_DISABLE |
  407. COH901318_CX_CTRL_HSP_ENABLE |
  408. COH901318_CX_CTRL_HSS_DISABLE |
  409. COH901318_CX_CTRL_DDMA_LEGACY |
  410. COH901318_CX_CTRL_PRDD_SOURCE,
  411. .param.ctrl_lli_last = 0 |
  412. COH901318_CX_CTRL_TC_ENABLE |
  413. COH901318_CX_CTRL_BURST_COUNT_32_BYTES |
  414. COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
  415. COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE |
  416. COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
  417. COH901318_CX_CTRL_DST_ADDR_INC_DISABLE |
  418. COH901318_CX_CTRL_MASTER_MODE_M1R_M2W |
  419. COH901318_CX_CTRL_TCP_ENABLE |
  420. COH901318_CX_CTRL_TC_IRQ_ENABLE |
  421. COH901318_CX_CTRL_HSP_ENABLE |
  422. COH901318_CX_CTRL_HSS_DISABLE |
  423. COH901318_CX_CTRL_DDMA_LEGACY |
  424. COH901318_CX_CTRL_PRDD_SOURCE,
  425. },
  426. {
  427. .number = U300_DMA_MSL_TX_2,
  428. .name = "MSL TX 2",
  429. .priority_high = 0,
  430. .dev_addr = U300_MSL_BASE + 2 * 0x40 + 0x20,
  431. .param.config = COH901318_CX_CFG_CH_DISABLE |
  432. COH901318_CX_CFG_LCR_DISABLE |
  433. COH901318_CX_CFG_TC_IRQ_ENABLE |
  434. COH901318_CX_CFG_BE_IRQ_ENABLE,
  435. .param.ctrl_lli_chained = 0 |
  436. COH901318_CX_CTRL_TC_ENABLE |
  437. COH901318_CX_CTRL_BURST_COUNT_32_BYTES |
  438. COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
  439. COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE |
  440. COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
  441. COH901318_CX_CTRL_DST_ADDR_INC_DISABLE |
  442. COH901318_CX_CTRL_MASTER_MODE_M1R_M2W |
  443. COH901318_CX_CTRL_TCP_DISABLE |
  444. COH901318_CX_CTRL_TC_IRQ_DISABLE |
  445. COH901318_CX_CTRL_HSP_ENABLE |
  446. COH901318_CX_CTRL_HSS_DISABLE |
  447. COH901318_CX_CTRL_DDMA_LEGACY |
  448. COH901318_CX_CTRL_PRDD_SOURCE,
  449. .param.ctrl_lli = 0 |
  450. COH901318_CX_CTRL_TC_ENABLE |
  451. COH901318_CX_CTRL_BURST_COUNT_32_BYTES |
  452. COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
  453. COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE |
  454. COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
  455. COH901318_CX_CTRL_DST_ADDR_INC_DISABLE |
  456. COH901318_CX_CTRL_MASTER_MODE_M1R_M2W |
  457. COH901318_CX_CTRL_TCP_ENABLE |
  458. COH901318_CX_CTRL_TC_IRQ_DISABLE |
  459. COH901318_CX_CTRL_HSP_ENABLE |
  460. COH901318_CX_CTRL_HSS_DISABLE |
  461. COH901318_CX_CTRL_DDMA_LEGACY |
  462. COH901318_CX_CTRL_PRDD_SOURCE,
  463. .param.ctrl_lli_last = 0 |
  464. COH901318_CX_CTRL_TC_ENABLE |
  465. COH901318_CX_CTRL_BURST_COUNT_32_BYTES |
  466. COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
  467. COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE |
  468. COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
  469. COH901318_CX_CTRL_DST_ADDR_INC_DISABLE |
  470. COH901318_CX_CTRL_MASTER_MODE_M1R_M2W |
  471. COH901318_CX_CTRL_TCP_ENABLE |
  472. COH901318_CX_CTRL_TC_IRQ_ENABLE |
  473. COH901318_CX_CTRL_HSP_ENABLE |
  474. COH901318_CX_CTRL_HSS_DISABLE |
  475. COH901318_CX_CTRL_DDMA_LEGACY |
  476. COH901318_CX_CTRL_PRDD_SOURCE,
  477. .desc_nbr_max = 10,
  478. },
  479. {
  480. .number = U300_DMA_MSL_TX_3,
  481. .name = "MSL TX 3",
  482. .priority_high = 0,
  483. .dev_addr = U300_MSL_BASE + 3 * 0x40 + 0x20,
  484. .param.config = COH901318_CX_CFG_CH_DISABLE |
  485. COH901318_CX_CFG_LCR_DISABLE |
  486. COH901318_CX_CFG_TC_IRQ_ENABLE |
  487. COH901318_CX_CFG_BE_IRQ_ENABLE,
  488. .param.ctrl_lli_chained = 0 |
  489. COH901318_CX_CTRL_TC_ENABLE |
  490. COH901318_CX_CTRL_BURST_COUNT_32_BYTES |
  491. COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
  492. COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE |
  493. COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
  494. COH901318_CX_CTRL_DST_ADDR_INC_DISABLE |
  495. COH901318_CX_CTRL_MASTER_MODE_M1R_M2W |
  496. COH901318_CX_CTRL_TCP_DISABLE |
  497. COH901318_CX_CTRL_TC_IRQ_DISABLE |
  498. COH901318_CX_CTRL_HSP_ENABLE |
  499. COH901318_CX_CTRL_HSS_DISABLE |
  500. COH901318_CX_CTRL_DDMA_LEGACY |
  501. COH901318_CX_CTRL_PRDD_SOURCE,
  502. .param.ctrl_lli = 0 |
  503. COH901318_CX_CTRL_TC_ENABLE |
  504. COH901318_CX_CTRL_BURST_COUNT_32_BYTES |
  505. COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
  506. COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE |
  507. COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
  508. COH901318_CX_CTRL_DST_ADDR_INC_DISABLE |
  509. COH901318_CX_CTRL_MASTER_MODE_M1R_M2W |
  510. COH901318_CX_CTRL_TCP_ENABLE |
  511. COH901318_CX_CTRL_TC_IRQ_DISABLE |
  512. COH901318_CX_CTRL_HSP_ENABLE |
  513. COH901318_CX_CTRL_HSS_DISABLE |
  514. COH901318_CX_CTRL_DDMA_LEGACY |
  515. COH901318_CX_CTRL_PRDD_SOURCE,
  516. .param.ctrl_lli_last = 0 |
  517. COH901318_CX_CTRL_TC_ENABLE |
  518. COH901318_CX_CTRL_BURST_COUNT_32_BYTES |
  519. COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
  520. COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE |
  521. COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
  522. COH901318_CX_CTRL_DST_ADDR_INC_DISABLE |
  523. COH901318_CX_CTRL_MASTER_MODE_M1R_M2W |
  524. COH901318_CX_CTRL_TCP_ENABLE |
  525. COH901318_CX_CTRL_TC_IRQ_ENABLE |
  526. COH901318_CX_CTRL_HSP_ENABLE |
  527. COH901318_CX_CTRL_HSS_DISABLE |
  528. COH901318_CX_CTRL_DDMA_LEGACY |
  529. COH901318_CX_CTRL_PRDD_SOURCE,
  530. },
  531. {
  532. .number = U300_DMA_MSL_TX_4,
  533. .name = "MSL TX 4",
  534. .priority_high = 0,
  535. .dev_addr = U300_MSL_BASE + 4 * 0x40 + 0x20,
  536. .param.config = COH901318_CX_CFG_CH_DISABLE |
  537. COH901318_CX_CFG_LCR_DISABLE |
  538. COH901318_CX_CFG_TC_IRQ_ENABLE |
  539. COH901318_CX_CFG_BE_IRQ_ENABLE,
  540. .param.ctrl_lli_chained = 0 |
  541. COH901318_CX_CTRL_TC_ENABLE |
  542. COH901318_CX_CTRL_BURST_COUNT_32_BYTES |
  543. COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
  544. COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE |
  545. COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
  546. COH901318_CX_CTRL_DST_ADDR_INC_DISABLE |
  547. COH901318_CX_CTRL_MASTER_MODE_M1R_M2W |
  548. COH901318_CX_CTRL_TCP_DISABLE |
  549. COH901318_CX_CTRL_TC_IRQ_DISABLE |
  550. COH901318_CX_CTRL_HSP_ENABLE |
  551. COH901318_CX_CTRL_HSS_DISABLE |
  552. COH901318_CX_CTRL_DDMA_LEGACY |
  553. COH901318_CX_CTRL_PRDD_SOURCE,
  554. .param.ctrl_lli = 0 |
  555. COH901318_CX_CTRL_TC_ENABLE |
  556. COH901318_CX_CTRL_BURST_COUNT_32_BYTES |
  557. COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
  558. COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE |
  559. COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
  560. COH901318_CX_CTRL_DST_ADDR_INC_DISABLE |
  561. COH901318_CX_CTRL_MASTER_MODE_M1R_M2W |
  562. COH901318_CX_CTRL_TCP_ENABLE |
  563. COH901318_CX_CTRL_TC_IRQ_DISABLE |
  564. COH901318_CX_CTRL_HSP_ENABLE |
  565. COH901318_CX_CTRL_HSS_DISABLE |
  566. COH901318_CX_CTRL_DDMA_LEGACY |
  567. COH901318_CX_CTRL_PRDD_SOURCE,
  568. .param.ctrl_lli_last = 0 |
  569. COH901318_CX_CTRL_TC_ENABLE |
  570. COH901318_CX_CTRL_BURST_COUNT_32_BYTES |
  571. COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
  572. COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE |
  573. COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
  574. COH901318_CX_CTRL_DST_ADDR_INC_DISABLE |
  575. COH901318_CX_CTRL_MASTER_MODE_M1R_M2W |
  576. COH901318_CX_CTRL_TCP_ENABLE |
  577. COH901318_CX_CTRL_TC_IRQ_ENABLE |
  578. COH901318_CX_CTRL_HSP_ENABLE |
  579. COH901318_CX_CTRL_HSS_DISABLE |
  580. COH901318_CX_CTRL_DDMA_LEGACY |
  581. COH901318_CX_CTRL_PRDD_SOURCE,
  582. },
  583. {
  584. .number = U300_DMA_MSL_TX_5,
  585. .name = "MSL TX 5",
  586. .priority_high = 0,
  587. .dev_addr = U300_MSL_BASE + 5 * 0x40 + 0x20,
  588. },
  589. {
  590. .number = U300_DMA_MSL_TX_6,
  591. .name = "MSL TX 6",
  592. .priority_high = 0,
  593. .dev_addr = U300_MSL_BASE + 6 * 0x40 + 0x20,
  594. },
  595. {
  596. .number = U300_DMA_MSL_RX_0,
  597. .name = "MSL RX 0",
  598. .priority_high = 0,
  599. .dev_addr = U300_MSL_BASE + 0 * 0x40 + 0x220,
  600. },
  601. {
  602. .number = U300_DMA_MSL_RX_1,
  603. .name = "MSL RX 1",
  604. .priority_high = 0,
  605. .dev_addr = U300_MSL_BASE + 1 * 0x40 + 0x220,
  606. .param.config = COH901318_CX_CFG_CH_DISABLE |
  607. COH901318_CX_CFG_LCR_DISABLE |
  608. COH901318_CX_CFG_TC_IRQ_ENABLE |
  609. COH901318_CX_CFG_BE_IRQ_ENABLE,
  610. .param.ctrl_lli_chained = 0 |
  611. COH901318_CX_CTRL_TC_ENABLE |
  612. COH901318_CX_CTRL_BURST_COUNT_32_BYTES |
  613. COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
  614. COH901318_CX_CTRL_SRC_ADDR_INC_DISABLE |
  615. COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
  616. COH901318_CX_CTRL_DST_ADDR_INC_ENABLE |
  617. COH901318_CX_CTRL_MASTER_MODE_M2R_M1W |
  618. COH901318_CX_CTRL_TCP_DISABLE |
  619. COH901318_CX_CTRL_TC_IRQ_DISABLE |
  620. COH901318_CX_CTRL_HSP_ENABLE |
  621. COH901318_CX_CTRL_HSS_DISABLE |
  622. COH901318_CX_CTRL_DDMA_DEMAND_DMA1 |
  623. COH901318_CX_CTRL_PRDD_DEST,
  624. .param.ctrl_lli = 0,
  625. .param.ctrl_lli_last = 0 |
  626. COH901318_CX_CTRL_TC_ENABLE |
  627. COH901318_CX_CTRL_BURST_COUNT_32_BYTES |
  628. COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
  629. COH901318_CX_CTRL_SRC_ADDR_INC_DISABLE |
  630. COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
  631. COH901318_CX_CTRL_DST_ADDR_INC_ENABLE |
  632. COH901318_CX_CTRL_MASTER_MODE_M2R_M1W |
  633. COH901318_CX_CTRL_TCP_DISABLE |
  634. COH901318_CX_CTRL_TC_IRQ_ENABLE |
  635. COH901318_CX_CTRL_HSP_ENABLE |
  636. COH901318_CX_CTRL_HSS_DISABLE |
  637. COH901318_CX_CTRL_DDMA_DEMAND_DMA1 |
  638. COH901318_CX_CTRL_PRDD_DEST,
  639. },
  640. {
  641. .number = U300_DMA_MSL_RX_2,
  642. .name = "MSL RX 2",
  643. .priority_high = 0,
  644. .dev_addr = U300_MSL_BASE + 2 * 0x40 + 0x220,
  645. .param.config = COH901318_CX_CFG_CH_DISABLE |
  646. COH901318_CX_CFG_LCR_DISABLE |
  647. COH901318_CX_CFG_TC_IRQ_ENABLE |
  648. COH901318_CX_CFG_BE_IRQ_ENABLE,
  649. .param.ctrl_lli_chained = 0 |
  650. COH901318_CX_CTRL_TC_ENABLE |
  651. COH901318_CX_CTRL_BURST_COUNT_32_BYTES |
  652. COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
  653. COH901318_CX_CTRL_SRC_ADDR_INC_DISABLE |
  654. COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
  655. COH901318_CX_CTRL_DST_ADDR_INC_ENABLE |
  656. COH901318_CX_CTRL_MASTER_MODE_M2R_M1W |
  657. COH901318_CX_CTRL_TCP_DISABLE |
  658. COH901318_CX_CTRL_TC_IRQ_DISABLE |
  659. COH901318_CX_CTRL_HSP_ENABLE |
  660. COH901318_CX_CTRL_HSS_DISABLE |
  661. COH901318_CX_CTRL_DDMA_DEMAND_DMA1 |
  662. COH901318_CX_CTRL_PRDD_DEST,
  663. .param.ctrl_lli = 0 |
  664. COH901318_CX_CTRL_TC_ENABLE |
  665. COH901318_CX_CTRL_BURST_COUNT_32_BYTES |
  666. COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
  667. COH901318_CX_CTRL_SRC_ADDR_INC_DISABLE |
  668. COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
  669. COH901318_CX_CTRL_DST_ADDR_INC_ENABLE |
  670. COH901318_CX_CTRL_MASTER_MODE_M2R_M1W |
  671. COH901318_CX_CTRL_TCP_DISABLE |
  672. COH901318_CX_CTRL_TC_IRQ_ENABLE |
  673. COH901318_CX_CTRL_HSP_ENABLE |
  674. COH901318_CX_CTRL_HSS_DISABLE |
  675. COH901318_CX_CTRL_DDMA_DEMAND_DMA1 |
  676. COH901318_CX_CTRL_PRDD_DEST,
  677. .param.ctrl_lli_last = 0 |
  678. COH901318_CX_CTRL_TC_ENABLE |
  679. COH901318_CX_CTRL_BURST_COUNT_32_BYTES |
  680. COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
  681. COH901318_CX_CTRL_SRC_ADDR_INC_DISABLE |
  682. COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
  683. COH901318_CX_CTRL_DST_ADDR_INC_ENABLE |
  684. COH901318_CX_CTRL_MASTER_MODE_M2R_M1W |
  685. COH901318_CX_CTRL_TCP_DISABLE |
  686. COH901318_CX_CTRL_TC_IRQ_ENABLE |
  687. COH901318_CX_CTRL_HSP_ENABLE |
  688. COH901318_CX_CTRL_HSS_DISABLE |
  689. COH901318_CX_CTRL_DDMA_DEMAND_DMA1 |
  690. COH901318_CX_CTRL_PRDD_DEST,
  691. },
  692. {
  693. .number = U300_DMA_MSL_RX_3,
  694. .name = "MSL RX 3",
  695. .priority_high = 0,
  696. .dev_addr = U300_MSL_BASE + 3 * 0x40 + 0x220,
  697. .param.config = COH901318_CX_CFG_CH_DISABLE |
  698. COH901318_CX_CFG_LCR_DISABLE |
  699. COH901318_CX_CFG_TC_IRQ_ENABLE |
  700. COH901318_CX_CFG_BE_IRQ_ENABLE,
  701. .param.ctrl_lli_chained = 0 |
  702. COH901318_CX_CTRL_TC_ENABLE |
  703. COH901318_CX_CTRL_BURST_COUNT_32_BYTES |
  704. COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
  705. COH901318_CX_CTRL_SRC_ADDR_INC_DISABLE |
  706. COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
  707. COH901318_CX_CTRL_DST_ADDR_INC_ENABLE |
  708. COH901318_CX_CTRL_MASTER_MODE_M2R_M1W |
  709. COH901318_CX_CTRL_TCP_DISABLE |
  710. COH901318_CX_CTRL_TC_IRQ_DISABLE |
  711. COH901318_CX_CTRL_HSP_ENABLE |
  712. COH901318_CX_CTRL_HSS_DISABLE |
  713. COH901318_CX_CTRL_DDMA_DEMAND_DMA1 |
  714. COH901318_CX_CTRL_PRDD_DEST,
  715. .param.ctrl_lli = 0 |
  716. COH901318_CX_CTRL_TC_ENABLE |
  717. COH901318_CX_CTRL_BURST_COUNT_32_BYTES |
  718. COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
  719. COH901318_CX_CTRL_SRC_ADDR_INC_DISABLE |
  720. COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
  721. COH901318_CX_CTRL_DST_ADDR_INC_ENABLE |
  722. COH901318_CX_CTRL_MASTER_MODE_M2R_M1W |
  723. COH901318_CX_CTRL_TCP_DISABLE |
  724. COH901318_CX_CTRL_TC_IRQ_ENABLE |
  725. COH901318_CX_CTRL_HSP_ENABLE |
  726. COH901318_CX_CTRL_HSS_DISABLE |
  727. COH901318_CX_CTRL_DDMA_DEMAND_DMA1 |
  728. COH901318_CX_CTRL_PRDD_DEST,
  729. .param.ctrl_lli_last = 0 |
  730. COH901318_CX_CTRL_TC_ENABLE |
  731. COH901318_CX_CTRL_BURST_COUNT_32_BYTES |
  732. COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
  733. COH901318_CX_CTRL_SRC_ADDR_INC_DISABLE |
  734. COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
  735. COH901318_CX_CTRL_DST_ADDR_INC_ENABLE |
  736. COH901318_CX_CTRL_MASTER_MODE_M2R_M1W |
  737. COH901318_CX_CTRL_TCP_DISABLE |
  738. COH901318_CX_CTRL_TC_IRQ_ENABLE |
  739. COH901318_CX_CTRL_HSP_ENABLE |
  740. COH901318_CX_CTRL_HSS_DISABLE |
  741. COH901318_CX_CTRL_DDMA_DEMAND_DMA1 |
  742. COH901318_CX_CTRL_PRDD_DEST,
  743. },
  744. {
  745. .number = U300_DMA_MSL_RX_4,
  746. .name = "MSL RX 4",
  747. .priority_high = 0,
  748. .dev_addr = U300_MSL_BASE + 4 * 0x40 + 0x220,
  749. .param.config = COH901318_CX_CFG_CH_DISABLE |
  750. COH901318_CX_CFG_LCR_DISABLE |
  751. COH901318_CX_CFG_TC_IRQ_ENABLE |
  752. COH901318_CX_CFG_BE_IRQ_ENABLE,
  753. .param.ctrl_lli_chained = 0 |
  754. COH901318_CX_CTRL_TC_ENABLE |
  755. COH901318_CX_CTRL_BURST_COUNT_32_BYTES |
  756. COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
  757. COH901318_CX_CTRL_SRC_ADDR_INC_DISABLE |
  758. COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
  759. COH901318_CX_CTRL_DST_ADDR_INC_ENABLE |
  760. COH901318_CX_CTRL_MASTER_MODE_M2R_M1W |
  761. COH901318_CX_CTRL_TCP_DISABLE |
  762. COH901318_CX_CTRL_TC_IRQ_DISABLE |
  763. COH901318_CX_CTRL_HSP_ENABLE |
  764. COH901318_CX_CTRL_HSS_DISABLE |
  765. COH901318_CX_CTRL_DDMA_DEMAND_DMA1 |
  766. COH901318_CX_CTRL_PRDD_DEST,
  767. .param.ctrl_lli = 0 |
  768. COH901318_CX_CTRL_TC_ENABLE |
  769. COH901318_CX_CTRL_BURST_COUNT_32_BYTES |
  770. COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
  771. COH901318_CX_CTRL_SRC_ADDR_INC_DISABLE |
  772. COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
  773. COH901318_CX_CTRL_DST_ADDR_INC_ENABLE |
  774. COH901318_CX_CTRL_MASTER_MODE_M2R_M1W |
  775. COH901318_CX_CTRL_TCP_DISABLE |
  776. COH901318_CX_CTRL_TC_IRQ_ENABLE |
  777. COH901318_CX_CTRL_HSP_ENABLE |
  778. COH901318_CX_CTRL_HSS_DISABLE |
  779. COH901318_CX_CTRL_DDMA_DEMAND_DMA1 |
  780. COH901318_CX_CTRL_PRDD_DEST,
  781. .param.ctrl_lli_last = 0 |
  782. COH901318_CX_CTRL_TC_ENABLE |
  783. COH901318_CX_CTRL_BURST_COUNT_32_BYTES |
  784. COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
  785. COH901318_CX_CTRL_SRC_ADDR_INC_DISABLE |
  786. COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
  787. COH901318_CX_CTRL_DST_ADDR_INC_ENABLE |
  788. COH901318_CX_CTRL_MASTER_MODE_M2R_M1W |
  789. COH901318_CX_CTRL_TCP_DISABLE |
  790. COH901318_CX_CTRL_TC_IRQ_ENABLE |
  791. COH901318_CX_CTRL_HSP_ENABLE |
  792. COH901318_CX_CTRL_HSS_DISABLE |
  793. COH901318_CX_CTRL_DDMA_DEMAND_DMA1 |
  794. COH901318_CX_CTRL_PRDD_DEST,
  795. },
  796. {
  797. .number = U300_DMA_MSL_RX_5,
  798. .name = "MSL RX 5",
  799. .priority_high = 0,
  800. .dev_addr = U300_MSL_BASE + 5 * 0x40 + 0x220,
  801. .param.config = COH901318_CX_CFG_CH_DISABLE |
  802. COH901318_CX_CFG_LCR_DISABLE |
  803. COH901318_CX_CFG_TC_IRQ_ENABLE |
  804. COH901318_CX_CFG_BE_IRQ_ENABLE,
  805. .param.ctrl_lli_chained = 0 |
  806. COH901318_CX_CTRL_TC_ENABLE |
  807. COH901318_CX_CTRL_BURST_COUNT_32_BYTES |
  808. COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
  809. COH901318_CX_CTRL_SRC_ADDR_INC_DISABLE |
  810. COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
  811. COH901318_CX_CTRL_DST_ADDR_INC_ENABLE |
  812. COH901318_CX_CTRL_MASTER_MODE_M2R_M1W |
  813. COH901318_CX_CTRL_TCP_DISABLE |
  814. COH901318_CX_CTRL_TC_IRQ_DISABLE |
  815. COH901318_CX_CTRL_HSP_ENABLE |
  816. COH901318_CX_CTRL_HSS_DISABLE |
  817. COH901318_CX_CTRL_DDMA_DEMAND_DMA1 |
  818. COH901318_CX_CTRL_PRDD_DEST,
  819. .param.ctrl_lli = 0 |
  820. COH901318_CX_CTRL_TC_ENABLE |
  821. COH901318_CX_CTRL_BURST_COUNT_32_BYTES |
  822. COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
  823. COH901318_CX_CTRL_SRC_ADDR_INC_DISABLE |
  824. COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
  825. COH901318_CX_CTRL_DST_ADDR_INC_ENABLE |
  826. COH901318_CX_CTRL_MASTER_MODE_M2R_M1W |
  827. COH901318_CX_CTRL_TCP_DISABLE |
  828. COH901318_CX_CTRL_TC_IRQ_ENABLE |
  829. COH901318_CX_CTRL_HSP_ENABLE |
  830. COH901318_CX_CTRL_HSS_DISABLE |
  831. COH901318_CX_CTRL_DDMA_DEMAND_DMA1 |
  832. COH901318_CX_CTRL_PRDD_DEST,
  833. .param.ctrl_lli_last = 0 |
  834. COH901318_CX_CTRL_TC_ENABLE |
  835. COH901318_CX_CTRL_BURST_COUNT_32_BYTES |
  836. COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
  837. COH901318_CX_CTRL_SRC_ADDR_INC_DISABLE |
  838. COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
  839. COH901318_CX_CTRL_DST_ADDR_INC_ENABLE |
  840. COH901318_CX_CTRL_MASTER_MODE_M2R_M1W |
  841. COH901318_CX_CTRL_TCP_DISABLE |
  842. COH901318_CX_CTRL_TC_IRQ_ENABLE |
  843. COH901318_CX_CTRL_HSP_ENABLE |
  844. COH901318_CX_CTRL_HSS_DISABLE |
  845. COH901318_CX_CTRL_DDMA_DEMAND_DMA1 |
  846. COH901318_CX_CTRL_PRDD_DEST,
  847. },
  848. {
  849. .number = U300_DMA_MSL_RX_6,
  850. .name = "MSL RX 6",
  851. .priority_high = 0,
  852. .dev_addr = U300_MSL_BASE + 6 * 0x40 + 0x220,
  853. },
  854. /*
  855. * Don't set up device address, burst count or size of src
  856. * or dst bus for this peripheral - handled by PrimeCell
  857. * DMA extension.
  858. */
  859. {
  860. .number = U300_DMA_MMCSD_RX_TX,
  861. .name = "MMCSD RX TX",
  862. .priority_high = 0,
  863. .param.config = COH901318_CX_CFG_CH_DISABLE |
  864. COH901318_CX_CFG_LCR_DISABLE |
  865. COH901318_CX_CFG_TC_IRQ_ENABLE |
  866. COH901318_CX_CFG_BE_IRQ_ENABLE,
  867. .param.ctrl_lli_chained = 0 |
  868. COH901318_CX_CTRL_TC_ENABLE |
  869. COH901318_CX_CTRL_MASTER_MODE_M1RW |
  870. COH901318_CX_CTRL_TCP_ENABLE |
  871. COH901318_CX_CTRL_TC_IRQ_DISABLE |
  872. COH901318_CX_CTRL_HSP_ENABLE |
  873. COH901318_CX_CTRL_HSS_DISABLE |
  874. COH901318_CX_CTRL_DDMA_LEGACY,
  875. .param.ctrl_lli = 0 |
  876. COH901318_CX_CTRL_TC_ENABLE |
  877. COH901318_CX_CTRL_MASTER_MODE_M1RW |
  878. COH901318_CX_CTRL_TCP_ENABLE |
  879. COH901318_CX_CTRL_TC_IRQ_DISABLE |
  880. COH901318_CX_CTRL_HSP_ENABLE |
  881. COH901318_CX_CTRL_HSS_DISABLE |
  882. COH901318_CX_CTRL_DDMA_LEGACY,
  883. .param.ctrl_lli_last = 0 |
  884. COH901318_CX_CTRL_TC_ENABLE |
  885. COH901318_CX_CTRL_MASTER_MODE_M1RW |
  886. COH901318_CX_CTRL_TCP_DISABLE |
  887. COH901318_CX_CTRL_TC_IRQ_ENABLE |
  888. COH901318_CX_CTRL_HSP_ENABLE |
  889. COH901318_CX_CTRL_HSS_DISABLE |
  890. COH901318_CX_CTRL_DDMA_LEGACY,
  891. },
  892. {
  893. .number = U300_DMA_MSPRO_TX,
  894. .name = "MSPRO TX",
  895. .priority_high = 0,
  896. },
  897. {
  898. .number = U300_DMA_MSPRO_RX,
  899. .name = "MSPRO RX",
  900. .priority_high = 0,
  901. },
  902. /*
  903. * Don't set up device address, burst count or size of src
  904. * or dst bus for this peripheral - handled by PrimeCell
  905. * DMA extension.
  906. */
  907. {
  908. .number = U300_DMA_UART0_TX,
  909. .name = "UART0 TX",
  910. .priority_high = 0,
  911. .param.config = COH901318_CX_CFG_CH_DISABLE |
  912. COH901318_CX_CFG_LCR_DISABLE |
  913. COH901318_CX_CFG_TC_IRQ_ENABLE |
  914. COH901318_CX_CFG_BE_IRQ_ENABLE,
  915. .param.ctrl_lli_chained = 0 |
  916. COH901318_CX_CTRL_TC_ENABLE |
  917. COH901318_CX_CTRL_MASTER_MODE_M1RW |
  918. COH901318_CX_CTRL_TCP_ENABLE |
  919. COH901318_CX_CTRL_TC_IRQ_DISABLE |
  920. COH901318_CX_CTRL_HSP_ENABLE |
  921. COH901318_CX_CTRL_HSS_DISABLE |
  922. COH901318_CX_CTRL_DDMA_LEGACY,
  923. .param.ctrl_lli = 0 |
  924. COH901318_CX_CTRL_TC_ENABLE |
  925. COH901318_CX_CTRL_MASTER_MODE_M1RW |
  926. COH901318_CX_CTRL_TCP_ENABLE |
  927. COH901318_CX_CTRL_TC_IRQ_ENABLE |
  928. COH901318_CX_CTRL_HSP_ENABLE |
  929. COH901318_CX_CTRL_HSS_DISABLE |
  930. COH901318_CX_CTRL_DDMA_LEGACY,
  931. .param.ctrl_lli_last = 0 |
  932. COH901318_CX_CTRL_TC_ENABLE |
  933. COH901318_CX_CTRL_MASTER_MODE_M1RW |
  934. COH901318_CX_CTRL_TCP_ENABLE |
  935. COH901318_CX_CTRL_TC_IRQ_ENABLE |
  936. COH901318_CX_CTRL_HSP_ENABLE |
  937. COH901318_CX_CTRL_HSS_DISABLE |
  938. COH901318_CX_CTRL_DDMA_LEGACY,
  939. },
  940. {
  941. .number = U300_DMA_UART0_RX,
  942. .name = "UART0 RX",
  943. .priority_high = 0,
  944. .param.config = COH901318_CX_CFG_CH_DISABLE |
  945. COH901318_CX_CFG_LCR_DISABLE |
  946. COH901318_CX_CFG_TC_IRQ_ENABLE |
  947. COH901318_CX_CFG_BE_IRQ_ENABLE,
  948. .param.ctrl_lli_chained = 0 |
  949. COH901318_CX_CTRL_TC_ENABLE |
  950. COH901318_CX_CTRL_MASTER_MODE_M1RW |
  951. COH901318_CX_CTRL_TCP_ENABLE |
  952. COH901318_CX_CTRL_TC_IRQ_DISABLE |
  953. COH901318_CX_CTRL_HSP_ENABLE |
  954. COH901318_CX_CTRL_HSS_DISABLE |
  955. COH901318_CX_CTRL_DDMA_LEGACY,
  956. .param.ctrl_lli = 0 |
  957. COH901318_CX_CTRL_TC_ENABLE |
  958. COH901318_CX_CTRL_MASTER_MODE_M1RW |
  959. COH901318_CX_CTRL_TCP_ENABLE |
  960. COH901318_CX_CTRL_TC_IRQ_ENABLE |
  961. COH901318_CX_CTRL_HSP_ENABLE |
  962. COH901318_CX_CTRL_HSS_DISABLE |
  963. COH901318_CX_CTRL_DDMA_LEGACY,
  964. .param.ctrl_lli_last = 0 |
  965. COH901318_CX_CTRL_TC_ENABLE |
  966. COH901318_CX_CTRL_MASTER_MODE_M1RW |
  967. COH901318_CX_CTRL_TCP_ENABLE |
  968. COH901318_CX_CTRL_TC_IRQ_ENABLE |
  969. COH901318_CX_CTRL_HSP_ENABLE |
  970. COH901318_CX_CTRL_HSS_DISABLE |
  971. COH901318_CX_CTRL_DDMA_LEGACY,
  972. },
  973. {
  974. .number = U300_DMA_APEX_TX,
  975. .name = "APEX TX",
  976. .priority_high = 0,
  977. },
  978. {
  979. .number = U300_DMA_APEX_RX,
  980. .name = "APEX RX",
  981. .priority_high = 0,
  982. },
  983. {
  984. .number = U300_DMA_PCM_I2S0_TX,
  985. .name = "PCM I2S0 TX",
  986. .priority_high = 1,
  987. .dev_addr = U300_PCM_I2S0_BASE + 0x14,
  988. .param.config = COH901318_CX_CFG_CH_DISABLE |
  989. COH901318_CX_CFG_LCR_DISABLE |
  990. COH901318_CX_CFG_TC_IRQ_ENABLE |
  991. COH901318_CX_CFG_BE_IRQ_ENABLE,
  992. .param.ctrl_lli_chained = 0 |
  993. COH901318_CX_CTRL_TC_ENABLE |
  994. COH901318_CX_CTRL_BURST_COUNT_16_BYTES |
  995. COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
  996. COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE |
  997. COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
  998. COH901318_CX_CTRL_DST_ADDR_INC_DISABLE |
  999. COH901318_CX_CTRL_MASTER_MODE_M1RW |
  1000. COH901318_CX_CTRL_TCP_DISABLE |
  1001. COH901318_CX_CTRL_TC_IRQ_DISABLE |
  1002. COH901318_CX_CTRL_HSP_ENABLE |
  1003. COH901318_CX_CTRL_HSS_DISABLE |
  1004. COH901318_CX_CTRL_DDMA_LEGACY |
  1005. COH901318_CX_CTRL_PRDD_SOURCE,
  1006. .param.ctrl_lli = 0 |
  1007. COH901318_CX_CTRL_TC_ENABLE |
  1008. COH901318_CX_CTRL_BURST_COUNT_16_BYTES |
  1009. COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
  1010. COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE |
  1011. COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
  1012. COH901318_CX_CTRL_DST_ADDR_INC_DISABLE |
  1013. COH901318_CX_CTRL_MASTER_MODE_M1RW |
  1014. COH901318_CX_CTRL_TCP_ENABLE |
  1015. COH901318_CX_CTRL_TC_IRQ_DISABLE |
  1016. COH901318_CX_CTRL_HSP_ENABLE |
  1017. COH901318_CX_CTRL_HSS_DISABLE |
  1018. COH901318_CX_CTRL_DDMA_LEGACY |
  1019. COH901318_CX_CTRL_PRDD_SOURCE,
  1020. .param.ctrl_lli_last = 0 |
  1021. COH901318_CX_CTRL_TC_ENABLE |
  1022. COH901318_CX_CTRL_BURST_COUNT_16_BYTES |
  1023. COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
  1024. COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE |
  1025. COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
  1026. COH901318_CX_CTRL_DST_ADDR_INC_DISABLE |
  1027. COH901318_CX_CTRL_MASTER_MODE_M1RW |
  1028. COH901318_CX_CTRL_TCP_ENABLE |
  1029. COH901318_CX_CTRL_TC_IRQ_DISABLE |
  1030. COH901318_CX_CTRL_HSP_ENABLE |
  1031. COH901318_CX_CTRL_HSS_DISABLE |
  1032. COH901318_CX_CTRL_DDMA_LEGACY |
  1033. COH901318_CX_CTRL_PRDD_SOURCE,
  1034. },
  1035. {
  1036. .number = U300_DMA_PCM_I2S0_RX,
  1037. .name = "PCM I2S0 RX",
  1038. .priority_high = 1,
  1039. .dev_addr = U300_PCM_I2S0_BASE + 0x10,
  1040. .param.config = COH901318_CX_CFG_CH_DISABLE |
  1041. COH901318_CX_CFG_LCR_DISABLE |
  1042. COH901318_CX_CFG_TC_IRQ_ENABLE |
  1043. COH901318_CX_CFG_BE_IRQ_ENABLE,
  1044. .param.ctrl_lli_chained = 0 |
  1045. COH901318_CX_CTRL_TC_ENABLE |
  1046. COH901318_CX_CTRL_BURST_COUNT_16_BYTES |
  1047. COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
  1048. COH901318_CX_CTRL_SRC_ADDR_INC_DISABLE |
  1049. COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
  1050. COH901318_CX_CTRL_DST_ADDR_INC_ENABLE |
  1051. COH901318_CX_CTRL_MASTER_MODE_M1RW |
  1052. COH901318_CX_CTRL_TCP_DISABLE |
  1053. COH901318_CX_CTRL_TC_IRQ_DISABLE |
  1054. COH901318_CX_CTRL_HSP_ENABLE |
  1055. COH901318_CX_CTRL_HSS_DISABLE |
  1056. COH901318_CX_CTRL_DDMA_LEGACY |
  1057. COH901318_CX_CTRL_PRDD_DEST,
  1058. .param.ctrl_lli = 0 |
  1059. COH901318_CX_CTRL_TC_ENABLE |
  1060. COH901318_CX_CTRL_BURST_COUNT_16_BYTES |
  1061. COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
  1062. COH901318_CX_CTRL_SRC_ADDR_INC_DISABLE |
  1063. COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
  1064. COH901318_CX_CTRL_DST_ADDR_INC_ENABLE |
  1065. COH901318_CX_CTRL_MASTER_MODE_M1RW |
  1066. COH901318_CX_CTRL_TCP_ENABLE |
  1067. COH901318_CX_CTRL_TC_IRQ_DISABLE |
  1068. COH901318_CX_CTRL_HSP_ENABLE |
  1069. COH901318_CX_CTRL_HSS_DISABLE |
  1070. COH901318_CX_CTRL_DDMA_LEGACY |
  1071. COH901318_CX_CTRL_PRDD_DEST,
  1072. .param.ctrl_lli_last = 0 |
  1073. COH901318_CX_CTRL_TC_ENABLE |
  1074. COH901318_CX_CTRL_BURST_COUNT_16_BYTES |
  1075. COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
  1076. COH901318_CX_CTRL_SRC_ADDR_INC_DISABLE |
  1077. COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
  1078. COH901318_CX_CTRL_DST_ADDR_INC_ENABLE |
  1079. COH901318_CX_CTRL_MASTER_MODE_M1RW |
  1080. COH901318_CX_CTRL_TCP_ENABLE |
  1081. COH901318_CX_CTRL_TC_IRQ_ENABLE |
  1082. COH901318_CX_CTRL_HSP_ENABLE |
  1083. COH901318_CX_CTRL_HSS_DISABLE |
  1084. COH901318_CX_CTRL_DDMA_LEGACY |
  1085. COH901318_CX_CTRL_PRDD_DEST,
  1086. },
  1087. {
  1088. .number = U300_DMA_PCM_I2S1_TX,
  1089. .name = "PCM I2S1 TX",
  1090. .priority_high = 1,
  1091. .dev_addr = U300_PCM_I2S1_BASE + 0x14,
  1092. .param.config = COH901318_CX_CFG_CH_DISABLE |
  1093. COH901318_CX_CFG_LCR_DISABLE |
  1094. COH901318_CX_CFG_TC_IRQ_ENABLE |
  1095. COH901318_CX_CFG_BE_IRQ_ENABLE,
  1096. .param.ctrl_lli_chained = 0 |
  1097. COH901318_CX_CTRL_TC_ENABLE |
  1098. COH901318_CX_CTRL_BURST_COUNT_16_BYTES |
  1099. COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
  1100. COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE |
  1101. COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
  1102. COH901318_CX_CTRL_DST_ADDR_INC_DISABLE |
  1103. COH901318_CX_CTRL_MASTER_MODE_M1RW |
  1104. COH901318_CX_CTRL_TCP_DISABLE |
  1105. COH901318_CX_CTRL_TC_IRQ_DISABLE |
  1106. COH901318_CX_CTRL_HSP_ENABLE |
  1107. COH901318_CX_CTRL_HSS_DISABLE |
  1108. COH901318_CX_CTRL_DDMA_LEGACY |
  1109. COH901318_CX_CTRL_PRDD_SOURCE,
  1110. .param.ctrl_lli = 0 |
  1111. COH901318_CX_CTRL_TC_ENABLE |
  1112. COH901318_CX_CTRL_BURST_COUNT_16_BYTES |
  1113. COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
  1114. COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE |
  1115. COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
  1116. COH901318_CX_CTRL_DST_ADDR_INC_DISABLE |
  1117. COH901318_CX_CTRL_MASTER_MODE_M1RW |
  1118. COH901318_CX_CTRL_TCP_ENABLE |
  1119. COH901318_CX_CTRL_TC_IRQ_DISABLE |
  1120. COH901318_CX_CTRL_HSP_ENABLE |
  1121. COH901318_CX_CTRL_HSS_DISABLE |
  1122. COH901318_CX_CTRL_DDMA_LEGACY |
  1123. COH901318_CX_CTRL_PRDD_SOURCE,
  1124. .param.ctrl_lli_last = 0 |
  1125. COH901318_CX_CTRL_TC_ENABLE |
  1126. COH901318_CX_CTRL_BURST_COUNT_16_BYTES |
  1127. COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
  1128. COH901318_CX_CTRL_SRC_ADDR_INC_ENABLE |
  1129. COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
  1130. COH901318_CX_CTRL_DST_ADDR_INC_DISABLE |
  1131. COH901318_CX_CTRL_MASTER_MODE_M1RW |
  1132. COH901318_CX_CTRL_TCP_ENABLE |
  1133. COH901318_CX_CTRL_TC_IRQ_ENABLE |
  1134. COH901318_CX_CTRL_HSP_ENABLE |
  1135. COH901318_CX_CTRL_HSS_DISABLE |
  1136. COH901318_CX_CTRL_DDMA_LEGACY |
  1137. COH901318_CX_CTRL_PRDD_SOURCE,
  1138. },
  1139. {
  1140. .number = U300_DMA_PCM_I2S1_RX,
  1141. .name = "PCM I2S1 RX",
  1142. .priority_high = 1,
  1143. .dev_addr = U300_PCM_I2S1_BASE + 0x10,
  1144. .param.config = COH901318_CX_CFG_CH_DISABLE |
  1145. COH901318_CX_CFG_LCR_DISABLE |
  1146. COH901318_CX_CFG_TC_IRQ_ENABLE |
  1147. COH901318_CX_CFG_BE_IRQ_ENABLE,
  1148. .param.ctrl_lli_chained = 0 |
  1149. COH901318_CX_CTRL_TC_ENABLE |
  1150. COH901318_CX_CTRL_BURST_COUNT_16_BYTES |
  1151. COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
  1152. COH901318_CX_CTRL_SRC_ADDR_INC_DISABLE |
  1153. COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
  1154. COH901318_CX_CTRL_DST_ADDR_INC_ENABLE |
  1155. COH901318_CX_CTRL_MASTER_MODE_M1RW |
  1156. COH901318_CX_CTRL_TCP_DISABLE |
  1157. COH901318_CX_CTRL_TC_IRQ_DISABLE |
  1158. COH901318_CX_CTRL_HSP_ENABLE |
  1159. COH901318_CX_CTRL_HSS_DISABLE |
  1160. COH901318_CX_CTRL_DDMA_LEGACY |
  1161. COH901318_CX_CTRL_PRDD_DEST,
  1162. .param.ctrl_lli = 0 |
  1163. COH901318_CX_CTRL_TC_ENABLE |
  1164. COH901318_CX_CTRL_BURST_COUNT_16_BYTES |
  1165. COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
  1166. COH901318_CX_CTRL_SRC_ADDR_INC_DISABLE |
  1167. COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
  1168. COH901318_CX_CTRL_DST_ADDR_INC_ENABLE |
  1169. COH901318_CX_CTRL_MASTER_MODE_M1RW |
  1170. COH901318_CX_CTRL_TCP_ENABLE |
  1171. COH901318_CX_CTRL_TC_IRQ_DISABLE |
  1172. COH901318_CX_CTRL_HSP_ENABLE |
  1173. COH901318_CX_CTRL_HSS_DISABLE |
  1174. COH901318_CX_CTRL_DDMA_LEGACY |
  1175. COH901318_CX_CTRL_PRDD_DEST,
  1176. .param.ctrl_lli_last = 0 |
  1177. COH901318_CX_CTRL_TC_ENABLE |
  1178. COH901318_CX_CTRL_BURST_COUNT_16_BYTES |
  1179. COH901318_CX_CTRL_SRC_BUS_SIZE_32_BITS |
  1180. COH901318_CX_CTRL_SRC_ADDR_INC_DISABLE |
  1181. COH901318_CX_CTRL_DST_BUS_SIZE_32_BITS |
  1182. COH901318_CX_CTRL_DST_ADDR_INC_ENABLE |
  1183. COH901318_CX_CTRL_MASTER_MODE_M1RW |
  1184. COH901318_CX_CTRL_TCP_ENABLE |
  1185. COH901318_CX_CTRL_TC_IRQ_ENABLE |
  1186. COH901318_CX_CTRL_HSP_ENABLE |
  1187. COH901318_CX_CTRL_HSS_DISABLE |
  1188. COH901318_CX_CTRL_DDMA_LEGACY |
  1189. COH901318_CX_CTRL_PRDD_DEST,
  1190. },
  1191. {
  1192. .number = U300_DMA_XGAM_CDI,
  1193. .name = "XGAM CDI",
  1194. .priority_high = 0,
  1195. },
  1196. {
  1197. .number = U300_DMA_XGAM_PDI,
  1198. .name = "XGAM PDI",
  1199. .priority_high = 0,
  1200. },
  1201. /*
  1202. * Don't set up device address, burst count or size of src
  1203. * or dst bus for this peripheral - handled by PrimeCell
  1204. * DMA extension.
  1205. */
  1206. {
  1207. .number = U300_DMA_SPI_TX,
  1208. .name = "SPI TX",
  1209. .priority_high = 0,
  1210. .param.config = COH901318_CX_CFG_CH_DISABLE |
  1211. COH901318_CX_CFG_LCR_DISABLE |
  1212. COH901318_CX_CFG_TC_IRQ_ENABLE |
  1213. COH901318_CX_CFG_BE_IRQ_ENABLE,
  1214. .param.ctrl_lli_chained = 0 |
  1215. COH901318_CX_CTRL_TC_ENABLE |
  1216. COH901318_CX_CTRL_MASTER_MODE_M1RW |
  1217. COH901318_CX_CTRL_TCP_DISABLE |
  1218. COH901318_CX_CTRL_TC_IRQ_DISABLE |
  1219. COH901318_CX_CTRL_HSP_ENABLE |
  1220. COH901318_CX_CTRL_HSS_DISABLE |
  1221. COH901318_CX_CTRL_DDMA_LEGACY,
  1222. .param.ctrl_lli = 0 |
  1223. COH901318_CX_CTRL_TC_ENABLE |
  1224. COH901318_CX_CTRL_MASTER_MODE_M1RW |
  1225. COH901318_CX_CTRL_TCP_DISABLE |
  1226. COH901318_CX_CTRL_TC_IRQ_ENABLE |
  1227. COH901318_CX_CTRL_HSP_ENABLE |
  1228. COH901318_CX_CTRL_HSS_DISABLE |
  1229. COH901318_CX_CTRL_DDMA_LEGACY,
  1230. .param.ctrl_lli_last = 0 |
  1231. COH901318_CX_CTRL_TC_ENABLE |
  1232. COH901318_CX_CTRL_MASTER_MODE_M1RW |
  1233. COH901318_CX_CTRL_TCP_DISABLE |
  1234. COH901318_CX_CTRL_TC_IRQ_ENABLE |
  1235. COH901318_CX_CTRL_HSP_ENABLE |
  1236. COH901318_CX_CTRL_HSS_DISABLE |
  1237. COH901318_CX_CTRL_DDMA_LEGACY,
  1238. },
  1239. {
  1240. .number = U300_DMA_SPI_RX,
  1241. .name = "SPI RX",
  1242. .priority_high = 0,
  1243. .param.config = COH901318_CX_CFG_CH_DISABLE |
  1244. COH901318_CX_CFG_LCR_DISABLE |
  1245. COH901318_CX_CFG_TC_IRQ_ENABLE |
  1246. COH901318_CX_CFG_BE_IRQ_ENABLE,
  1247. .param.ctrl_lli_chained = 0 |
  1248. COH901318_CX_CTRL_TC_ENABLE |
  1249. COH901318_CX_CTRL_MASTER_MODE_M1RW |
  1250. COH901318_CX_CTRL_TCP_DISABLE |
  1251. COH901318_CX_CTRL_TC_IRQ_DISABLE |
  1252. COH901318_CX_CTRL_HSP_ENABLE |
  1253. COH901318_CX_CTRL_HSS_DISABLE |
  1254. COH901318_CX_CTRL_DDMA_LEGACY,
  1255. .param.ctrl_lli = 0 |
  1256. COH901318_CX_CTRL_TC_ENABLE |
  1257. COH901318_CX_CTRL_MASTER_MODE_M1RW |
  1258. COH901318_CX_CTRL_TCP_DISABLE |
  1259. COH901318_CX_CTRL_TC_IRQ_ENABLE |
  1260. COH901318_CX_CTRL_HSP_ENABLE |
  1261. COH901318_CX_CTRL_HSS_DISABLE |
  1262. COH901318_CX_CTRL_DDMA_LEGACY,
  1263. .param.ctrl_lli_last = 0 |
  1264. COH901318_CX_CTRL_TC_ENABLE |
  1265. COH901318_CX_CTRL_MASTER_MODE_M1RW |
  1266. COH901318_CX_CTRL_TCP_DISABLE |
  1267. COH901318_CX_CTRL_TC_IRQ_ENABLE |
  1268. COH901318_CX_CTRL_HSP_ENABLE |
  1269. COH901318_CX_CTRL_HSS_DISABLE |
  1270. COH901318_CX_CTRL_DDMA_LEGACY,
  1271. },
  1272. {
  1273. .number = U300_DMA_GENERAL_PURPOSE_0,
  1274. .name = "GENERAL 00",
  1275. .priority_high = 0,
  1276. .param.config = flags_memcpy_config,
  1277. .param.ctrl_lli_chained = flags_memcpy_lli_chained,
  1278. .param.ctrl_lli = flags_memcpy_lli,
  1279. .param.ctrl_lli_last = flags_memcpy_lli_last,
  1280. },
  1281. {
  1282. .number = U300_DMA_GENERAL_PURPOSE_1,
  1283. .name = "GENERAL 01",
  1284. .priority_high = 0,
  1285. .param.config = flags_memcpy_config,
  1286. .param.ctrl_lli_chained = flags_memcpy_lli_chained,
  1287. .param.ctrl_lli = flags_memcpy_lli,
  1288. .param.ctrl_lli_last = flags_memcpy_lli_last,
  1289. },
  1290. {
  1291. .number = U300_DMA_GENERAL_PURPOSE_2,
  1292. .name = "GENERAL 02",
  1293. .priority_high = 0,
  1294. .param.config = flags_memcpy_config,
  1295. .param.ctrl_lli_chained = flags_memcpy_lli_chained,
  1296. .param.ctrl_lli = flags_memcpy_lli,
  1297. .param.ctrl_lli_last = flags_memcpy_lli_last,
  1298. },
  1299. {
  1300. .number = U300_DMA_GENERAL_PURPOSE_3,
  1301. .name = "GENERAL 03",
  1302. .priority_high = 0,
  1303. .param.config = flags_memcpy_config,
  1304. .param.ctrl_lli_chained = flags_memcpy_lli_chained,
  1305. .param.ctrl_lli = flags_memcpy_lli,
  1306. .param.ctrl_lli_last = flags_memcpy_lli_last,
  1307. },
  1308. {
  1309. .number = U300_DMA_GENERAL_PURPOSE_4,
  1310. .name = "GENERAL 04",
  1311. .priority_high = 0,
  1312. .param.config = flags_memcpy_config,
  1313. .param.ctrl_lli_chained = flags_memcpy_lli_chained,
  1314. .param.ctrl_lli = flags_memcpy_lli,
  1315. .param.ctrl_lli_last = flags_memcpy_lli_last,
  1316. },
  1317. {
  1318. .number = U300_DMA_GENERAL_PURPOSE_5,
  1319. .name = "GENERAL 05",
  1320. .priority_high = 0,
  1321. .param.config = flags_memcpy_config,
  1322. .param.ctrl_lli_chained = flags_memcpy_lli_chained,
  1323. .param.ctrl_lli = flags_memcpy_lli,
  1324. .param.ctrl_lli_last = flags_memcpy_lli_last,
  1325. },
  1326. {
  1327. .number = U300_DMA_GENERAL_PURPOSE_6,
  1328. .name = "GENERAL 06",
  1329. .priority_high = 0,
  1330. .param.config = flags_memcpy_config,
  1331. .param.ctrl_lli_chained = flags_memcpy_lli_chained,
  1332. .param.ctrl_lli = flags_memcpy_lli,
  1333. .param.ctrl_lli_last = flags_memcpy_lli_last,
  1334. },
  1335. {
  1336. .number = U300_DMA_GENERAL_PURPOSE_7,
  1337. .name = "GENERAL 07",
  1338. .priority_high = 0,
  1339. .param.config = flags_memcpy_config,
  1340. .param.ctrl_lli_chained = flags_memcpy_lli_chained,
  1341. .param.ctrl_lli = flags_memcpy_lli,
  1342. .param.ctrl_lli_last = flags_memcpy_lli_last,
  1343. },
  1344. {
  1345. .number = U300_DMA_GENERAL_PURPOSE_8,
  1346. .name = "GENERAL 08",
  1347. .priority_high = 0,
  1348. .param.config = flags_memcpy_config,
  1349. .param.ctrl_lli_chained = flags_memcpy_lli_chained,
  1350. .param.ctrl_lli = flags_memcpy_lli,
  1351. .param.ctrl_lli_last = flags_memcpy_lli_last,
  1352. },
  1353. #ifdef CONFIG_MACH_U300_BS335
  1354. {
  1355. .number = U300_DMA_UART1_TX,
  1356. .name = "UART1 TX",
  1357. .priority_high = 0,
  1358. },
  1359. {
  1360. .number = U300_DMA_UART1_RX,
  1361. .name = "UART1 RX",
  1362. .priority_high = 0,
  1363. }
  1364. #else
  1365. {
  1366. .number = U300_DMA_GENERAL_PURPOSE_9,
  1367. .name = "GENERAL 09",
  1368. .priority_high = 0,
  1369. .param.config = flags_memcpy_config,
  1370. .param.ctrl_lli_chained = flags_memcpy_lli_chained,
  1371. .param.ctrl_lli = flags_memcpy_lli,
  1372. .param.ctrl_lli_last = flags_memcpy_lli_last,
  1373. },
  1374. {
  1375. .number = U300_DMA_GENERAL_PURPOSE_10,
  1376. .name = "GENERAL 10",
  1377. .priority_high = 0,
  1378. .param.config = flags_memcpy_config,
  1379. .param.ctrl_lli_chained = flags_memcpy_lli_chained,
  1380. .param.ctrl_lli = flags_memcpy_lli,
  1381. .param.ctrl_lli_last = flags_memcpy_lli_last,
  1382. }
  1383. #endif
  1384. };
  1385. static struct coh901318_platform coh901318_platform = {
  1386. .chans_slave = dma_slave_channels,
  1387. .chans_memcpy = dma_memcpy_channels,
  1388. .access_memory_state = coh901318_access_memory_state,
  1389. .chan_conf = chan_config,
  1390. .max_channels = U300_DMA_CHANNELS,
  1391. };
  1392. static struct resource pinctrl_resources[] = {
  1393. {
  1394. .start = U300_SYSCON_BASE,
  1395. .end = U300_SYSCON_BASE + SZ_4K - 1,
  1396. .flags = IORESOURCE_MEM,
  1397. },
  1398. };
  1399. static struct platform_device wdog_device = {
  1400. .name = "coh901327_wdog",
  1401. .id = -1,
  1402. .num_resources = ARRAY_SIZE(wdog_resources),
  1403. .resource = wdog_resources,
  1404. };
  1405. static struct platform_device i2c0_device = {
  1406. .name = "stu300",
  1407. .id = 0,
  1408. .num_resources = ARRAY_SIZE(i2c0_resources),
  1409. .resource = i2c0_resources,
  1410. };
  1411. static struct platform_device i2c1_device = {
  1412. .name = "stu300",
  1413. .id = 1,
  1414. .num_resources = ARRAY_SIZE(i2c1_resources),
  1415. .resource = i2c1_resources,
  1416. };
  1417. static struct platform_device pinctrl_device = {
  1418. .name = "pinctrl-u300",
  1419. .id = -1,
  1420. .num_resources = ARRAY_SIZE(pinctrl_resources),
  1421. .resource = pinctrl_resources,
  1422. };
  1423. /*
  1424. * The different variants have a few different versions of the
  1425. * GPIO block, with different number of ports.
  1426. */
  1427. static struct u300_gpio_platform u300_gpio_plat = {
  1428. #if defined(CONFIG_MACH_U300_BS2X) || defined(CONFIG_MACH_U300_BS330)
  1429. .variant = U300_GPIO_COH901335,
  1430. .ports = 3,
  1431. #endif
  1432. #ifdef CONFIG_MACH_U300_BS335
  1433. .variant = U300_GPIO_COH901571_3_BS335,
  1434. .ports = 7,
  1435. #endif
  1436. #ifdef CONFIG_MACH_U300_BS365
  1437. .variant = U300_GPIO_COH901571_3_BS365,
  1438. .ports = 5,
  1439. #endif
  1440. .gpio_base = 0,
  1441. .gpio_irq_base = IRQ_U300_GPIO_BASE,
  1442. .pinctrl_device = &pinctrl_device,
  1443. };
  1444. static struct platform_device gpio_device = {
  1445. .name = "u300-gpio",
  1446. .id = -1,
  1447. .num_resources = ARRAY_SIZE(gpio_resources),
  1448. .resource = gpio_resources,
  1449. .dev = {
  1450. .platform_data = &u300_gpio_plat,
  1451. },
  1452. };
  1453. static struct platform_device keypad_device = {
  1454. .name = "keypad",
  1455. .id = -1,
  1456. .num_resources = ARRAY_SIZE(keypad_resources),
  1457. .resource = keypad_resources,
  1458. };
  1459. static struct platform_device rtc_device = {
  1460. .name = "rtc-coh901331",
  1461. .id = -1,
  1462. .num_resources = ARRAY_SIZE(rtc_resources),
  1463. .resource = rtc_resources,
  1464. };
  1465. static struct mtd_partition u300_partitions[] = {
  1466. {
  1467. .name = "bootrecords",
  1468. .offset = 0,
  1469. .size = SZ_128K,
  1470. },
  1471. {
  1472. .name = "free",
  1473. .offset = SZ_128K,
  1474. .size = 8064 * SZ_1K,
  1475. },
  1476. {
  1477. .name = "platform",
  1478. .offset = 8192 * SZ_1K,
  1479. .size = 253952 * SZ_1K,
  1480. },
  1481. };
  1482. static struct fsmc_nand_platform_data nand_platform_data = {
  1483. .partitions = u300_partitions,
  1484. .nr_partitions = ARRAY_SIZE(u300_partitions),
  1485. .options = NAND_SKIP_BBTSCAN,
  1486. .width = FSMC_NAND_BW8,
  1487. .ale_off = PLAT_NAND_ALE,
  1488. .cle_off = PLAT_NAND_CLE,
  1489. };
  1490. static struct platform_device nand_device = {
  1491. .name = "fsmc-nand",
  1492. .id = -1,
  1493. .resource = fsmc_resources,
  1494. .num_resources = ARRAY_SIZE(fsmc_resources),
  1495. .dev = {
  1496. .platform_data = &nand_platform_data,
  1497. },
  1498. };
  1499. static struct platform_device dma_device = {
  1500. .name = "coh901318",
  1501. .id = -1,
  1502. .resource = dma_resource,
  1503. .num_resources = ARRAY_SIZE(dma_resource),
  1504. .dev = {
  1505. .platform_data = &coh901318_platform,
  1506. .coherent_dma_mask = ~0,
  1507. },
  1508. };
  1509. static unsigned long pin_pullup_conf[] = {
  1510. PIN_CONF_PACKED(PIN_CONFIG_BIAS_PULL_UP, 1),
  1511. };
  1512. static unsigned long pin_highz_conf[] = {
  1513. PIN_CONF_PACKED(PIN_CONFIG_BIAS_HIGH_IMPEDANCE, 0),
  1514. };
  1515. /* Pin control settings */
  1516. static struct pinctrl_map __initdata u300_pinmux_map[] = {
  1517. /* anonymous maps for chip power and EMIFs */
  1518. PIN_MAP_MUX_GROUP_HOG_DEFAULT("pinctrl-u300", NULL, "power"),
  1519. PIN_MAP_MUX_GROUP_HOG_DEFAULT("pinctrl-u300", NULL, "emif0"),
  1520. PIN_MAP_MUX_GROUP_HOG_DEFAULT("pinctrl-u300", NULL, "emif1"),
  1521. /* per-device maps for MMC/SD, SPI and UART */
  1522. PIN_MAP_MUX_GROUP_DEFAULT("mmci", "pinctrl-u300", NULL, "mmc0"),
  1523. PIN_MAP_MUX_GROUP_DEFAULT("pl022", "pinctrl-u300", NULL, "spi0"),
  1524. PIN_MAP_MUX_GROUP_DEFAULT("uart0", "pinctrl-u300", NULL, "uart0"),
  1525. /* This pin is used for clock return rather than GPIO */
  1526. PIN_MAP_CONFIGS_PIN_DEFAULT("mmci", "pinctrl-u300", "PIO APP GPIO 11",
  1527. pin_pullup_conf),
  1528. /* This pin is used for card detect */
  1529. PIN_MAP_CONFIGS_PIN_DEFAULT("mmci", "pinctrl-u300", "PIO MS INS",
  1530. pin_highz_conf),
  1531. };
  1532. struct u300_mux_hog {
  1533. struct device *dev;
  1534. struct pinctrl *p;
  1535. };
  1536. static struct u300_mux_hog u300_mux_hogs[] = {
  1537. {
  1538. .dev = &uart0_device.dev,
  1539. },
  1540. {
  1541. .dev = &pl022_device.dev,
  1542. },
  1543. {
  1544. .dev = &mmcsd_device.dev,
  1545. },
  1546. };
  1547. static int __init u300_pinctrl_fetch(void)
  1548. {
  1549. int i;
  1550. for (i = 0; i < ARRAY_SIZE(u300_mux_hogs); i++) {
  1551. struct pinctrl *p;
  1552. p = pinctrl_get_select_default(u300_mux_hogs[i].dev);
  1553. if (IS_ERR(p)) {
  1554. pr_err("u300: could not get pinmux hog for dev %s\n",
  1555. dev_name(u300_mux_hogs[i].dev));
  1556. continue;
  1557. }
  1558. u300_mux_hogs[i].p = p;
  1559. }
  1560. return 0;
  1561. }
  1562. subsys_initcall(u300_pinctrl_fetch);
  1563. /*
  1564. * Notice that AMBA devices are initialized before platform devices.
  1565. *
  1566. */
  1567. static struct platform_device *platform_devs[] __initdata = {
  1568. &dma_device,
  1569. &i2c0_device,
  1570. &i2c1_device,
  1571. &keypad_device,
  1572. &rtc_device,
  1573. &gpio_device,
  1574. &nand_device,
  1575. &wdog_device,
  1576. };
  1577. /*
  1578. * Interrupts: the U300 platforms have two pl190 ARM PrimeCells connected
  1579. * together so some interrupts are connected to the first one and some
  1580. * to the second one.
  1581. */
  1582. void __init u300_init_irq(void)
  1583. {
  1584. u32 mask[2] = {0, 0};
  1585. struct clk *clk;
  1586. int i;
  1587. /* initialize clocking early, we want to clock the INTCON */
  1588. u300_clock_init();
  1589. /* Clock the interrupt controller */
  1590. clk = clk_get_sys("intcon", NULL);
  1591. BUG_ON(IS_ERR(clk));
  1592. clk_enable(clk);
  1593. for (i = 0; i < U300_VIC_IRQS_END; i++)
  1594. set_bit(i, (unsigned long *) &mask[0]);
  1595. vic_init((void __iomem *) U300_INTCON0_VBASE, IRQ_U300_INTCON0_START,
  1596. mask[0], mask[0]);
  1597. vic_init((void __iomem *) U300_INTCON1_VBASE, IRQ_U300_INTCON1_START,
  1598. mask[1], mask[1]);
  1599. }
  1600. /*
  1601. * U300 platforms peripheral handling
  1602. */
  1603. struct db_chip {
  1604. u16 chipid;
  1605. const char *name;
  1606. };
  1607. /*
  1608. * This is a list of the Digital Baseband chips used in the U300 platform.
  1609. */
  1610. static struct db_chip db_chips[] __initdata = {
  1611. {
  1612. .chipid = 0xb800,
  1613. .name = "DB3000",
  1614. },
  1615. {
  1616. .chipid = 0xc000,
  1617. .name = "DB3100",
  1618. },
  1619. {
  1620. .chipid = 0xc800,
  1621. .name = "DB3150",
  1622. },
  1623. {
  1624. .chipid = 0xd800,
  1625. .name = "DB3200",
  1626. },
  1627. {
  1628. .chipid = 0xe000,
  1629. .name = "DB3250",
  1630. },
  1631. {
  1632. .chipid = 0xe800,
  1633. .name = "DB3210",
  1634. },
  1635. {
  1636. .chipid = 0xf000,
  1637. .name = "DB3350 P1x",
  1638. },
  1639. {
  1640. .chipid = 0xf100,
  1641. .name = "DB3350 P2x",
  1642. },
  1643. {
  1644. .chipid = 0x0000, /* List terminator */
  1645. .name = NULL,
  1646. }
  1647. };
  1648. static void __init u300_init_check_chip(void)
  1649. {
  1650. u16 val;
  1651. struct db_chip *chip;
  1652. const char *chipname;
  1653. const char unknown[] = "UNKNOWN";
  1654. /* Read out and print chip ID */
  1655. val = readw(U300_SYSCON_VBASE + U300_SYSCON_CIDR);
  1656. /* This is in funky bigendian order... */
  1657. val = (val & 0xFFU) << 8 | (val >> 8);
  1658. chip = db_chips;
  1659. chipname = unknown;
  1660. for ( ; chip->chipid; chip++) {
  1661. if (chip->chipid == (val & 0xFF00U)) {
  1662. chipname = chip->name;
  1663. break;
  1664. }
  1665. }
  1666. printk(KERN_INFO "Initializing U300 system on %s baseband chip " \
  1667. "(chip ID 0x%04x)\n", chipname, val);
  1668. #ifdef CONFIG_MACH_U300_BS330
  1669. if ((val & 0xFF00U) != 0xd800) {
  1670. printk(KERN_ERR "Platform configured for BS330 " \
  1671. "with DB3200 but %s detected, expect problems!",
  1672. chipname);
  1673. }
  1674. #endif
  1675. #ifdef CONFIG_MACH_U300_BS335
  1676. if ((val & 0xFF00U) != 0xf000 && (val & 0xFF00U) != 0xf100) {
  1677. printk(KERN_ERR "Platform configured for BS335 " \
  1678. " with DB3350 but %s detected, expect problems!",
  1679. chipname);
  1680. }
  1681. #endif
  1682. #ifdef CONFIG_MACH_U300_BS365
  1683. if ((val & 0xFF00U) != 0xe800) {
  1684. printk(KERN_ERR "Platform configured for BS365 " \
  1685. "with DB3210 but %s detected, expect problems!",
  1686. chipname);
  1687. }
  1688. #endif
  1689. }
  1690. /*
  1691. * Some devices and their resources require reserved physical memory from
  1692. * the end of the available RAM. This function traverses the list of devices
  1693. * and assigns actual addresses to these.
  1694. */
  1695. static void __init u300_assign_physmem(void)
  1696. {
  1697. unsigned long curr_start = __pa(high_memory);
  1698. int i, j;
  1699. for (i = 0; i < ARRAY_SIZE(platform_devs); i++) {
  1700. for (j = 0; j < platform_devs[i]->num_resources; j++) {
  1701. struct resource *const res =
  1702. &platform_devs[i]->resource[j];
  1703. if (IORESOURCE_MEM == res->flags &&
  1704. 0 == res->start) {
  1705. res->start = curr_start;
  1706. res->end += curr_start;
  1707. curr_start += resource_size(res);
  1708. printk(KERN_INFO "core.c: Mapping RAM " \
  1709. "%#x-%#x to device %s:%s\n",
  1710. res->start, res->end,
  1711. platform_devs[i]->name, res->name);
  1712. }
  1713. }
  1714. }
  1715. }
  1716. void __init u300_init_devices(void)
  1717. {
  1718. int i;
  1719. u16 val;
  1720. /* Check what platform we run and print some status information */
  1721. u300_init_check_chip();
  1722. /* Set system to run at PLL208, max performance, a known state. */
  1723. val = readw(U300_SYSCON_VBASE + U300_SYSCON_CCR);
  1724. val &= ~U300_SYSCON_CCR_CLKING_PERFORMANCE_MASK;
  1725. writew(val, U300_SYSCON_VBASE + U300_SYSCON_CCR);
  1726. /* Wait for the PLL208 to lock if not locked in yet */
  1727. while (!(readw(U300_SYSCON_VBASE + U300_SYSCON_CSR) &
  1728. U300_SYSCON_CSR_PLL208_LOCK_IND));
  1729. /* Initialize SPI device with some board specifics */
  1730. u300_spi_init(&pl022_device);
  1731. /* Register the AMBA devices in the AMBA bus abstraction layer */
  1732. for (i = 0; i < ARRAY_SIZE(amba_devs); i++) {
  1733. struct amba_device *d = amba_devs[i];
  1734. amba_device_register(d, &iomem_resource);
  1735. }
  1736. u300_assign_physmem();
  1737. /* Initialize pinmuxing */
  1738. pinctrl_register_mappings(u300_pinmux_map,
  1739. ARRAY_SIZE(u300_pinmux_map));
  1740. /* Register subdevices on the I2C buses */
  1741. u300_i2c_register_board_devices();
  1742. /* Register the platform devices */
  1743. platform_add_devices(platform_devs, ARRAY_SIZE(platform_devs));
  1744. /* Register subdevices on the SPI bus */
  1745. u300_spi_register_board_devices();
  1746. /* Enable SEMI self refresh */
  1747. val = readw(U300_SYSCON_VBASE + U300_SYSCON_SMCR) |
  1748. U300_SYSCON_SMCR_SEMI_SREFREQ_ENABLE;
  1749. writew(val, U300_SYSCON_VBASE + U300_SYSCON_SMCR);
  1750. }
  1751. /* Forward declare this function from the watchdog */
  1752. void coh901327_watchdog_reset(void);
  1753. void u300_restart(char mode, const char *cmd)
  1754. {
  1755. switch (mode) {
  1756. case 's':
  1757. case 'h':
  1758. #ifdef CONFIG_COH901327_WATCHDOG
  1759. coh901327_watchdog_reset();
  1760. #endif
  1761. break;
  1762. default:
  1763. /* Do nothing */
  1764. break;
  1765. }
  1766. /* Wait for system do die/reset. */
  1767. while (1);
  1768. }