generic.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766
  1. /*
  2. * linux/arch/arm/mach-pxa/generic.c
  3. *
  4. * Author: Nicolas Pitre
  5. * Created: Jun 15, 2001
  6. * Copyright: MontaVista Software Inc.
  7. *
  8. * Code common to all PXA machines.
  9. *
  10. * This program is free software; you can redistribute it and/or modify
  11. * it under the terms of the GNU General Public License version 2 as
  12. * published by the Free Software Foundation.
  13. *
  14. * Since this file should be linked before any other machine specific file,
  15. * the __initcall() here will be executed first. This serves as default
  16. * initialization stuff for PXA machines which can be overridden later if
  17. * need be.
  18. */
  19. #include <linux/module.h>
  20. #include <linux/kernel.h>
  21. #include <linux/init.h>
  22. #include <linux/delay.h>
  23. #include <linux/platform_device.h>
  24. #include <linux/ioport.h>
  25. #include <linux/pm.h>
  26. #include <linux/string.h>
  27. #include <linux/dma-mapping.h>
  28. #include <asm/hardware.h>
  29. #include <asm/irq.h>
  30. #include <asm/system.h>
  31. #include <asm/pgtable.h>
  32. #include <asm/mach/map.h>
  33. #include <asm/arch/pxa-regs.h>
  34. #include <asm/arch/gpio.h>
  35. #include <asm/arch/udc.h>
  36. #include <asm/arch/pxafb.h>
  37. #include <asm/arch/mmc.h>
  38. #include <asm/arch/irda.h>
  39. #include <asm/arch/i2c.h>
  40. #include "devices.h"
  41. #include "generic.h"
  42. /*
  43. * Get the clock frequency as reflected by CCCR and the turbo flag.
  44. * We assume these values have been applied via a fcs.
  45. * If info is not 0 we also display the current settings.
  46. */
  47. unsigned int get_clk_frequency_khz(int info)
  48. {
  49. if (cpu_is_pxa21x() || cpu_is_pxa25x())
  50. return pxa25x_get_clk_frequency_khz(info);
  51. else if (cpu_is_pxa27x())
  52. return pxa27x_get_clk_frequency_khz(info);
  53. else
  54. return pxa3xx_get_clk_frequency_khz(info);
  55. }
  56. EXPORT_SYMBOL(get_clk_frequency_khz);
  57. /*
  58. * Return the current memory clock frequency in units of 10kHz
  59. */
  60. unsigned int get_memclk_frequency_10khz(void)
  61. {
  62. if (cpu_is_pxa21x() || cpu_is_pxa25x())
  63. return pxa25x_get_memclk_frequency_10khz();
  64. else if (cpu_is_pxa27x())
  65. return pxa27x_get_memclk_frequency_10khz();
  66. else
  67. return pxa3xx_get_memclk_frequency_10khz();
  68. }
  69. EXPORT_SYMBOL(get_memclk_frequency_10khz);
  70. /*
  71. * Handy function to set GPIO alternate functions
  72. */
  73. int pxa_last_gpio;
  74. int pxa_gpio_mode(int gpio_mode)
  75. {
  76. unsigned long flags;
  77. int gpio = gpio_mode & GPIO_MD_MASK_NR;
  78. int fn = (gpio_mode & GPIO_MD_MASK_FN) >> 8;
  79. int gafr;
  80. if (gpio > pxa_last_gpio)
  81. return -EINVAL;
  82. local_irq_save(flags);
  83. if (gpio_mode & GPIO_DFLT_LOW)
  84. GPCR(gpio) = GPIO_bit(gpio);
  85. else if (gpio_mode & GPIO_DFLT_HIGH)
  86. GPSR(gpio) = GPIO_bit(gpio);
  87. if (gpio_mode & GPIO_MD_MASK_DIR)
  88. GPDR(gpio) |= GPIO_bit(gpio);
  89. else
  90. GPDR(gpio) &= ~GPIO_bit(gpio);
  91. gafr = GAFR(gpio) & ~(0x3 << (((gpio) & 0xf)*2));
  92. GAFR(gpio) = gafr | (fn << (((gpio) & 0xf)*2));
  93. local_irq_restore(flags);
  94. return 0;
  95. }
  96. EXPORT_SYMBOL(pxa_gpio_mode);
  97. int gpio_direction_input(unsigned gpio)
  98. {
  99. unsigned long flags;
  100. u32 mask;
  101. if (gpio > pxa_last_gpio)
  102. return -EINVAL;
  103. mask = GPIO_bit(gpio);
  104. local_irq_save(flags);
  105. GPDR(gpio) &= ~mask;
  106. local_irq_restore(flags);
  107. return 0;
  108. }
  109. EXPORT_SYMBOL(gpio_direction_input);
  110. int gpio_direction_output(unsigned gpio, int value)
  111. {
  112. unsigned long flags;
  113. u32 mask;
  114. if (gpio > pxa_last_gpio)
  115. return -EINVAL;
  116. mask = GPIO_bit(gpio);
  117. local_irq_save(flags);
  118. if (value)
  119. GPSR(gpio) = mask;
  120. else
  121. GPCR(gpio) = mask;
  122. GPDR(gpio) |= mask;
  123. local_irq_restore(flags);
  124. return 0;
  125. }
  126. EXPORT_SYMBOL(gpio_direction_output);
  127. /*
  128. * Return GPIO level
  129. */
  130. int pxa_gpio_get_value(unsigned gpio)
  131. {
  132. return __gpio_get_value(gpio);
  133. }
  134. EXPORT_SYMBOL(pxa_gpio_get_value);
  135. /*
  136. * Set output GPIO level
  137. */
  138. void pxa_gpio_set_value(unsigned gpio, int value)
  139. {
  140. __gpio_set_value(gpio, value);
  141. }
  142. EXPORT_SYMBOL(pxa_gpio_set_value);
  143. /*
  144. * Routine to safely enable or disable a clock in the CKEN
  145. */
  146. void __pxa_set_cken(int clock, int enable)
  147. {
  148. unsigned long flags;
  149. local_irq_save(flags);
  150. if (enable)
  151. CKEN |= (1 << clock);
  152. else
  153. CKEN &= ~(1 << clock);
  154. local_irq_restore(flags);
  155. }
  156. EXPORT_SYMBOL(__pxa_set_cken);
  157. /*
  158. * Intel PXA2xx internal register mapping.
  159. *
  160. * Note 1: not all PXA2xx variants implement all those addresses.
  161. *
  162. * Note 2: virtual 0xfffe0000-0xffffffff is reserved for the vector table
  163. * and cache flush area.
  164. */
  165. static struct map_desc standard_io_desc[] __initdata = {
  166. { /* Devs */
  167. .virtual = 0xf2000000,
  168. .pfn = __phys_to_pfn(0x40000000),
  169. .length = 0x02000000,
  170. .type = MT_DEVICE
  171. }, { /* LCD */
  172. .virtual = 0xf4000000,
  173. .pfn = __phys_to_pfn(0x44000000),
  174. .length = 0x00100000,
  175. .type = MT_DEVICE
  176. }, { /* Mem Ctl */
  177. .virtual = 0xf6000000,
  178. .pfn = __phys_to_pfn(0x48000000),
  179. .length = 0x00100000,
  180. .type = MT_DEVICE
  181. }, { /* USB host */
  182. .virtual = 0xf8000000,
  183. .pfn = __phys_to_pfn(0x4c000000),
  184. .length = 0x00100000,
  185. .type = MT_DEVICE
  186. }, { /* Camera */
  187. .virtual = 0xfa000000,
  188. .pfn = __phys_to_pfn(0x50000000),
  189. .length = 0x00100000,
  190. .type = MT_DEVICE
  191. }, { /* IMem ctl */
  192. .virtual = 0xfe000000,
  193. .pfn = __phys_to_pfn(0x58000000),
  194. .length = 0x00100000,
  195. .type = MT_DEVICE
  196. }, { /* UNCACHED_PHYS_0 */
  197. .virtual = 0xff000000,
  198. .pfn = __phys_to_pfn(0x00000000),
  199. .length = 0x00100000,
  200. .type = MT_DEVICE
  201. }
  202. };
  203. void __init pxa_map_io(void)
  204. {
  205. iotable_init(standard_io_desc, ARRAY_SIZE(standard_io_desc));
  206. get_clk_frequency_khz(1);
  207. }
  208. void __init pxa_register_device(struct platform_device *dev, void *data)
  209. {
  210. int ret;
  211. dev->dev.platform_data = data;
  212. ret = platform_device_register(dev);
  213. if (ret)
  214. dev_err(&dev->dev, "unable to register device: %d\n", ret);
  215. }
  216. static struct resource pxamci_resources[] = {
  217. [0] = {
  218. .start = 0x41100000,
  219. .end = 0x41100fff,
  220. .flags = IORESOURCE_MEM,
  221. },
  222. [1] = {
  223. .start = IRQ_MMC,
  224. .end = IRQ_MMC,
  225. .flags = IORESOURCE_IRQ,
  226. },
  227. };
  228. static u64 pxamci_dmamask = 0xffffffffUL;
  229. struct platform_device pxa_device_mci = {
  230. .name = "pxa2xx-mci",
  231. .id = -1,
  232. .dev = {
  233. .dma_mask = &pxamci_dmamask,
  234. .coherent_dma_mask = 0xffffffff,
  235. },
  236. .num_resources = ARRAY_SIZE(pxamci_resources),
  237. .resource = pxamci_resources,
  238. };
  239. void __init pxa_set_mci_info(struct pxamci_platform_data *info)
  240. {
  241. pxa_register_device(&pxa_device_mci, info);
  242. }
  243. static struct pxa2xx_udc_mach_info pxa_udc_info;
  244. void __init pxa_set_udc_info(struct pxa2xx_udc_mach_info *info)
  245. {
  246. memcpy(&pxa_udc_info, info, sizeof *info);
  247. }
  248. static struct resource pxa2xx_udc_resources[] = {
  249. [0] = {
  250. .start = 0x40600000,
  251. .end = 0x4060ffff,
  252. .flags = IORESOURCE_MEM,
  253. },
  254. [1] = {
  255. .start = IRQ_USB,
  256. .end = IRQ_USB,
  257. .flags = IORESOURCE_IRQ,
  258. },
  259. };
  260. static u64 udc_dma_mask = ~(u32)0;
  261. struct platform_device pxa_device_udc = {
  262. .name = "pxa2xx-udc",
  263. .id = -1,
  264. .resource = pxa2xx_udc_resources,
  265. .num_resources = ARRAY_SIZE(pxa2xx_udc_resources),
  266. .dev = {
  267. .platform_data = &pxa_udc_info,
  268. .dma_mask = &udc_dma_mask,
  269. }
  270. };
  271. static struct resource pxafb_resources[] = {
  272. [0] = {
  273. .start = 0x44000000,
  274. .end = 0x4400ffff,
  275. .flags = IORESOURCE_MEM,
  276. },
  277. [1] = {
  278. .start = IRQ_LCD,
  279. .end = IRQ_LCD,
  280. .flags = IORESOURCE_IRQ,
  281. },
  282. };
  283. static u64 fb_dma_mask = ~(u64)0;
  284. struct platform_device pxa_device_fb = {
  285. .name = "pxa2xx-fb",
  286. .id = -1,
  287. .dev = {
  288. .dma_mask = &fb_dma_mask,
  289. .coherent_dma_mask = 0xffffffff,
  290. },
  291. .num_resources = ARRAY_SIZE(pxafb_resources),
  292. .resource = pxafb_resources,
  293. };
  294. void __init set_pxa_fb_info(struct pxafb_mach_info *info)
  295. {
  296. pxa_register_device(&pxa_device_fb, info);
  297. }
  298. void __init set_pxa_fb_parent(struct device *parent_dev)
  299. {
  300. pxa_device_fb.dev.parent = parent_dev;
  301. }
  302. static struct resource pxa_resource_ffuart[] = {
  303. {
  304. .start = __PREG(FFUART),
  305. .end = __PREG(FFUART) + 35,
  306. .flags = IORESOURCE_MEM,
  307. }, {
  308. .start = IRQ_FFUART,
  309. .end = IRQ_FFUART,
  310. .flags = IORESOURCE_IRQ,
  311. }
  312. };
  313. struct platform_device pxa_device_ffuart= {
  314. .name = "pxa2xx-uart",
  315. .id = 0,
  316. .resource = pxa_resource_ffuart,
  317. .num_resources = ARRAY_SIZE(pxa_resource_ffuart),
  318. };
  319. static struct resource pxa_resource_btuart[] = {
  320. {
  321. .start = __PREG(BTUART),
  322. .end = __PREG(BTUART) + 35,
  323. .flags = IORESOURCE_MEM,
  324. }, {
  325. .start = IRQ_BTUART,
  326. .end = IRQ_BTUART,
  327. .flags = IORESOURCE_IRQ,
  328. }
  329. };
  330. struct platform_device pxa_device_btuart = {
  331. .name = "pxa2xx-uart",
  332. .id = 1,
  333. .resource = pxa_resource_btuart,
  334. .num_resources = ARRAY_SIZE(pxa_resource_btuart),
  335. };
  336. static struct resource pxa_resource_stuart[] = {
  337. {
  338. .start = __PREG(STUART),
  339. .end = __PREG(STUART) + 35,
  340. .flags = IORESOURCE_MEM,
  341. }, {
  342. .start = IRQ_STUART,
  343. .end = IRQ_STUART,
  344. .flags = IORESOURCE_IRQ,
  345. }
  346. };
  347. struct platform_device pxa_device_stuart = {
  348. .name = "pxa2xx-uart",
  349. .id = 2,
  350. .resource = pxa_resource_stuart,
  351. .num_resources = ARRAY_SIZE(pxa_resource_stuart),
  352. };
  353. static struct resource pxa_resource_hwuart[] = {
  354. {
  355. .start = __PREG(HWUART),
  356. .end = __PREG(HWUART) + 47,
  357. .flags = IORESOURCE_MEM,
  358. }, {
  359. .start = IRQ_HWUART,
  360. .end = IRQ_HWUART,
  361. .flags = IORESOURCE_IRQ,
  362. }
  363. };
  364. struct platform_device pxa_device_hwuart = {
  365. .name = "pxa2xx-uart",
  366. .id = 3,
  367. .resource = pxa_resource_hwuart,
  368. .num_resources = ARRAY_SIZE(pxa_resource_hwuart),
  369. };
  370. static struct resource pxai2c_resources[] = {
  371. {
  372. .start = 0x40301680,
  373. .end = 0x403016a3,
  374. .flags = IORESOURCE_MEM,
  375. }, {
  376. .start = IRQ_I2C,
  377. .end = IRQ_I2C,
  378. .flags = IORESOURCE_IRQ,
  379. },
  380. };
  381. struct platform_device pxa_device_i2c = {
  382. .name = "pxa2xx-i2c",
  383. .id = 0,
  384. .resource = pxai2c_resources,
  385. .num_resources = ARRAY_SIZE(pxai2c_resources),
  386. };
  387. void __init pxa_set_i2c_info(struct i2c_pxa_platform_data *info)
  388. {
  389. pxa_register_device(&pxa_device_i2c, info);
  390. }
  391. static struct resource pxai2s_resources[] = {
  392. {
  393. .start = 0x40400000,
  394. .end = 0x40400083,
  395. .flags = IORESOURCE_MEM,
  396. }, {
  397. .start = IRQ_I2S,
  398. .end = IRQ_I2S,
  399. .flags = IORESOURCE_IRQ,
  400. },
  401. };
  402. struct platform_device pxa_device_i2s = {
  403. .name = "pxa2xx-i2s",
  404. .id = -1,
  405. .resource = pxai2s_resources,
  406. .num_resources = ARRAY_SIZE(pxai2s_resources),
  407. };
  408. static u64 pxaficp_dmamask = ~(u32)0;
  409. struct platform_device pxa_device_ficp = {
  410. .name = "pxa2xx-ir",
  411. .id = -1,
  412. .dev = {
  413. .dma_mask = &pxaficp_dmamask,
  414. .coherent_dma_mask = 0xffffffff,
  415. },
  416. };
  417. void __init pxa_set_ficp_info(struct pxaficp_platform_data *info)
  418. {
  419. pxa_register_device(&pxa_device_ficp, info);
  420. }
  421. struct platform_device pxa_device_rtc = {
  422. .name = "sa1100-rtc",
  423. .id = -1,
  424. };
  425. #ifdef CONFIG_PXA25x
  426. static u64 pxa25x_ssp_dma_mask = DMA_BIT_MASK(32);
  427. static struct resource pxa25x_resource_ssp[] = {
  428. [0] = {
  429. .start = 0x41000000,
  430. .end = 0x4100001f,
  431. .flags = IORESOURCE_MEM,
  432. },
  433. [1] = {
  434. .start = IRQ_SSP,
  435. .end = IRQ_SSP,
  436. .flags = IORESOURCE_IRQ,
  437. },
  438. [2] = {
  439. /* DRCMR for RX */
  440. .start = 13,
  441. .end = 13,
  442. .flags = IORESOURCE_DMA,
  443. },
  444. [3] = {
  445. /* DRCMR for TX */
  446. .start = 14,
  447. .end = 14,
  448. .flags = IORESOURCE_DMA,
  449. },
  450. };
  451. struct platform_device pxa25x_device_ssp = {
  452. .name = "pxa25x-ssp",
  453. .id = 0,
  454. .dev = {
  455. .dma_mask = &pxa25x_ssp_dma_mask,
  456. .coherent_dma_mask = DMA_BIT_MASK(32),
  457. },
  458. .resource = pxa25x_resource_ssp,
  459. .num_resources = ARRAY_SIZE(pxa25x_resource_ssp),
  460. };
  461. static u64 pxa25x_nssp_dma_mask = DMA_BIT_MASK(32);
  462. static struct resource pxa25x_resource_nssp[] = {
  463. [0] = {
  464. .start = 0x41400000,
  465. .end = 0x4140002f,
  466. .flags = IORESOURCE_MEM,
  467. },
  468. [1] = {
  469. .start = IRQ_NSSP,
  470. .end = IRQ_NSSP,
  471. .flags = IORESOURCE_IRQ,
  472. },
  473. [2] = {
  474. /* DRCMR for RX */
  475. .start = 15,
  476. .end = 15,
  477. .flags = IORESOURCE_DMA,
  478. },
  479. [3] = {
  480. /* DRCMR for TX */
  481. .start = 16,
  482. .end = 16,
  483. .flags = IORESOURCE_DMA,
  484. },
  485. };
  486. struct platform_device pxa25x_device_nssp = {
  487. .name = "pxa25x-nssp",
  488. .id = 1,
  489. .dev = {
  490. .dma_mask = &pxa25x_nssp_dma_mask,
  491. .coherent_dma_mask = DMA_BIT_MASK(32),
  492. },
  493. .resource = pxa25x_resource_nssp,
  494. .num_resources = ARRAY_SIZE(pxa25x_resource_nssp),
  495. };
  496. static u64 pxa25x_assp_dma_mask = DMA_BIT_MASK(32);
  497. static struct resource pxa25x_resource_assp[] = {
  498. [0] = {
  499. .start = 0x41500000,
  500. .end = 0x4150002f,
  501. .flags = IORESOURCE_MEM,
  502. },
  503. [1] = {
  504. .start = IRQ_ASSP,
  505. .end = IRQ_ASSP,
  506. .flags = IORESOURCE_IRQ,
  507. },
  508. [2] = {
  509. /* DRCMR for RX */
  510. .start = 23,
  511. .end = 23,
  512. .flags = IORESOURCE_DMA,
  513. },
  514. [3] = {
  515. /* DRCMR for TX */
  516. .start = 24,
  517. .end = 24,
  518. .flags = IORESOURCE_DMA,
  519. },
  520. };
  521. struct platform_device pxa25x_device_assp = {
  522. /* ASSP is basically equivalent to NSSP */
  523. .name = "pxa25x-nssp",
  524. .id = 2,
  525. .dev = {
  526. .dma_mask = &pxa25x_assp_dma_mask,
  527. .coherent_dma_mask = DMA_BIT_MASK(32),
  528. },
  529. .resource = pxa25x_resource_assp,
  530. .num_resources = ARRAY_SIZE(pxa25x_resource_assp),
  531. };
  532. #endif /* CONFIG_PXA25x */
  533. #if defined(CONFIG_PXA27x) || defined(CONFIG_PXA3xx)
  534. static u64 pxa27x_ssp1_dma_mask = DMA_BIT_MASK(32);
  535. static struct resource pxa27x_resource_ssp1[] = {
  536. [0] = {
  537. .start = 0x41000000,
  538. .end = 0x4100003f,
  539. .flags = IORESOURCE_MEM,
  540. },
  541. [1] = {
  542. .start = IRQ_SSP,
  543. .end = IRQ_SSP,
  544. .flags = IORESOURCE_IRQ,
  545. },
  546. [2] = {
  547. /* DRCMR for RX */
  548. .start = 13,
  549. .end = 13,
  550. .flags = IORESOURCE_DMA,
  551. },
  552. [3] = {
  553. /* DRCMR for TX */
  554. .start = 14,
  555. .end = 14,
  556. .flags = IORESOURCE_DMA,
  557. },
  558. };
  559. struct platform_device pxa27x_device_ssp1 = {
  560. .name = "pxa27x-ssp",
  561. .id = 0,
  562. .dev = {
  563. .dma_mask = &pxa27x_ssp1_dma_mask,
  564. .coherent_dma_mask = DMA_BIT_MASK(32),
  565. },
  566. .resource = pxa27x_resource_ssp1,
  567. .num_resources = ARRAY_SIZE(pxa27x_resource_ssp1),
  568. };
  569. static u64 pxa27x_ssp2_dma_mask = DMA_BIT_MASK(32);
  570. static struct resource pxa27x_resource_ssp2[] = {
  571. [0] = {
  572. .start = 0x41700000,
  573. .end = 0x4170003f,
  574. .flags = IORESOURCE_MEM,
  575. },
  576. [1] = {
  577. .start = IRQ_SSP2,
  578. .end = IRQ_SSP2,
  579. .flags = IORESOURCE_IRQ,
  580. },
  581. [2] = {
  582. /* DRCMR for RX */
  583. .start = 15,
  584. .end = 15,
  585. .flags = IORESOURCE_DMA,
  586. },
  587. [3] = {
  588. /* DRCMR for TX */
  589. .start = 16,
  590. .end = 16,
  591. .flags = IORESOURCE_DMA,
  592. },
  593. };
  594. struct platform_device pxa27x_device_ssp2 = {
  595. .name = "pxa27x-ssp",
  596. .id = 1,
  597. .dev = {
  598. .dma_mask = &pxa27x_ssp2_dma_mask,
  599. .coherent_dma_mask = DMA_BIT_MASK(32),
  600. },
  601. .resource = pxa27x_resource_ssp2,
  602. .num_resources = ARRAY_SIZE(pxa27x_resource_ssp2),
  603. };
  604. static u64 pxa27x_ssp3_dma_mask = DMA_BIT_MASK(32);
  605. static struct resource pxa27x_resource_ssp3[] = {
  606. [0] = {
  607. .start = 0x41900000,
  608. .end = 0x4190003f,
  609. .flags = IORESOURCE_MEM,
  610. },
  611. [1] = {
  612. .start = IRQ_SSP3,
  613. .end = IRQ_SSP3,
  614. .flags = IORESOURCE_IRQ,
  615. },
  616. [2] = {
  617. /* DRCMR for RX */
  618. .start = 66,
  619. .end = 66,
  620. .flags = IORESOURCE_DMA,
  621. },
  622. [3] = {
  623. /* DRCMR for TX */
  624. .start = 67,
  625. .end = 67,
  626. .flags = IORESOURCE_DMA,
  627. },
  628. };
  629. struct platform_device pxa27x_device_ssp3 = {
  630. .name = "pxa27x-ssp",
  631. .id = 2,
  632. .dev = {
  633. .dma_mask = &pxa27x_ssp3_dma_mask,
  634. .coherent_dma_mask = DMA_BIT_MASK(32),
  635. },
  636. .resource = pxa27x_resource_ssp3,
  637. .num_resources = ARRAY_SIZE(pxa27x_resource_ssp3),
  638. };
  639. #endif /* CONFIG_PXA27x || CONFIG_PXA3xx */
  640. #ifdef CONFIG_PXA3xx
  641. static u64 pxa3xx_ssp4_dma_mask = DMA_BIT_MASK(32);
  642. static struct resource pxa3xx_resource_ssp4[] = {
  643. [0] = {
  644. .start = 0x41a00000,
  645. .end = 0x41a0003f,
  646. .flags = IORESOURCE_MEM,
  647. },
  648. [1] = {
  649. .start = IRQ_SSP4,
  650. .end = IRQ_SSP4,
  651. .flags = IORESOURCE_IRQ,
  652. },
  653. [2] = {
  654. /* DRCMR for RX */
  655. .start = 2,
  656. .end = 2,
  657. .flags = IORESOURCE_DMA,
  658. },
  659. [3] = {
  660. /* DRCMR for TX */
  661. .start = 3,
  662. .end = 3,
  663. .flags = IORESOURCE_DMA,
  664. },
  665. };
  666. struct platform_device pxa3xx_device_ssp4 = {
  667. /* PXA3xx SSP is basically equivalent to PXA27x */
  668. .name = "pxa27x-ssp",
  669. .id = 3,
  670. .dev = {
  671. .dma_mask = &pxa3xx_ssp4_dma_mask,
  672. .coherent_dma_mask = DMA_BIT_MASK(32),
  673. },
  674. .resource = pxa3xx_resource_ssp4,
  675. .num_resources = ARRAY_SIZE(pxa3xx_resource_ssp4),
  676. };
  677. #endif /* CONFIG_PXA3xx */