pxa3xx.c 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614
  1. /*
  2. * linux/arch/arm/mach-pxa/pxa3xx.c
  3. *
  4. * code specific to pxa3xx aka Monahans
  5. *
  6. * Copyright (C) 2006 Marvell International Ltd.
  7. *
  8. * 2007-09-02: eric miao <eric.miao@marvell.com>
  9. * initial version
  10. *
  11. * This program is free software; you can redistribute it and/or modify
  12. * it under the terms of the GNU General Public License version 2 as
  13. * published by the Free Software Foundation.
  14. */
  15. #include <linux/module.h>
  16. #include <linux/kernel.h>
  17. #include <linux/init.h>
  18. #include <linux/pm.h>
  19. #include <linux/platform_device.h>
  20. #include <linux/irq.h>
  21. #include <linux/io.h>
  22. #include <linux/sysdev.h>
  23. #include <mach/hardware.h>
  24. #include <mach/pxa3xx-regs.h>
  25. #include <mach/reset.h>
  26. #include <mach/ohci.h>
  27. #include <mach/pm.h>
  28. #include <mach/dma.h>
  29. #include <mach/ssp.h>
  30. #include <mach/i2c.h>
  31. #include "generic.h"
  32. #include "devices.h"
  33. #include "clock.h"
  34. /* Crystal clock: 13MHz */
  35. #define BASE_CLK 13000000
  36. /* Ring Oscillator Clock: 60MHz */
  37. #define RO_CLK 60000000
  38. #define ACCR_D0CS (1 << 26)
  39. #define ACCR_PCCE (1 << 11)
  40. /* crystal frequency to static memory controller multiplier (SMCFS) */
  41. static unsigned char smcfs_mult[8] = { 6, 0, 8, 0, 0, 16, };
  42. /* crystal frequency to HSIO bus frequency multiplier (HSS) */
  43. static unsigned char hss_mult[4] = { 8, 12, 16, 0 };
  44. /*
  45. * Get the clock frequency as reflected by CCSR and the turbo flag.
  46. * We assume these values have been applied via a fcs.
  47. * If info is not 0 we also display the current settings.
  48. */
  49. unsigned int pxa3xx_get_clk_frequency_khz(int info)
  50. {
  51. unsigned long acsr, xclkcfg;
  52. unsigned int t, xl, xn, hss, ro, XL, XN, CLK, HSS;
  53. /* Read XCLKCFG register turbo bit */
  54. __asm__ __volatile__("mrc\tp14, 0, %0, c6, c0, 0" : "=r"(xclkcfg));
  55. t = xclkcfg & 0x1;
  56. acsr = ACSR;
  57. xl = acsr & 0x1f;
  58. xn = (acsr >> 8) & 0x7;
  59. hss = (acsr >> 14) & 0x3;
  60. XL = xl * BASE_CLK;
  61. XN = xn * XL;
  62. ro = acsr & ACCR_D0CS;
  63. CLK = (ro) ? RO_CLK : ((t) ? XN : XL);
  64. HSS = (ro) ? RO_CLK : hss_mult[hss] * BASE_CLK;
  65. if (info) {
  66. pr_info("RO Mode clock: %d.%02dMHz (%sactive)\n",
  67. RO_CLK / 1000000, (RO_CLK % 1000000) / 10000,
  68. (ro) ? "" : "in");
  69. pr_info("Run Mode clock: %d.%02dMHz (*%d)\n",
  70. XL / 1000000, (XL % 1000000) / 10000, xl);
  71. pr_info("Turbo Mode clock: %d.%02dMHz (*%d, %sactive)\n",
  72. XN / 1000000, (XN % 1000000) / 10000, xn,
  73. (t) ? "" : "in");
  74. pr_info("HSIO bus clock: %d.%02dMHz\n",
  75. HSS / 1000000, (HSS % 1000000) / 10000);
  76. }
  77. return CLK / 1000;
  78. }
  79. /*
  80. * Return the current static memory controller clock frequency
  81. * in units of 10kHz
  82. */
  83. unsigned int pxa3xx_get_memclk_frequency_10khz(void)
  84. {
  85. unsigned long acsr;
  86. unsigned int smcfs, clk = 0;
  87. acsr = ACSR;
  88. smcfs = (acsr >> 23) & 0x7;
  89. clk = (acsr & ACCR_D0CS) ? RO_CLK : smcfs_mult[smcfs] * BASE_CLK;
  90. return (clk / 10000);
  91. }
  92. void pxa3xx_clear_reset_status(unsigned int mask)
  93. {
  94. /* RESET_STATUS_* has a 1:1 mapping with ARSR */
  95. ARSR = mask;
  96. }
  97. /*
  98. * Return the current AC97 clock frequency.
  99. */
  100. static unsigned long clk_pxa3xx_ac97_getrate(struct clk *clk)
  101. {
  102. unsigned long rate = 312000000;
  103. unsigned long ac97_div;
  104. ac97_div = AC97_DIV;
  105. /* This may loose precision for some rates but won't for the
  106. * standard 24.576MHz.
  107. */
  108. rate /= (ac97_div >> 12) & 0x7fff;
  109. rate *= (ac97_div & 0xfff);
  110. return rate;
  111. }
  112. /*
  113. * Return the current HSIO bus clock frequency
  114. */
  115. static unsigned long clk_pxa3xx_hsio_getrate(struct clk *clk)
  116. {
  117. unsigned long acsr;
  118. unsigned int hss, hsio_clk;
  119. acsr = ACSR;
  120. hss = (acsr >> 14) & 0x3;
  121. hsio_clk = (acsr & ACCR_D0CS) ? RO_CLK : hss_mult[hss] * BASE_CLK;
  122. return hsio_clk;
  123. }
  124. void clk_pxa3xx_cken_enable(struct clk *clk)
  125. {
  126. unsigned long mask = 1ul << (clk->cken & 0x1f);
  127. if (clk->cken < 32)
  128. CKENA |= mask;
  129. else
  130. CKENB |= mask;
  131. }
  132. void clk_pxa3xx_cken_disable(struct clk *clk)
  133. {
  134. unsigned long mask = 1ul << (clk->cken & 0x1f);
  135. if (clk->cken < 32)
  136. CKENA &= ~mask;
  137. else
  138. CKENB &= ~mask;
  139. }
  140. const struct clkops clk_pxa3xx_cken_ops = {
  141. .enable = clk_pxa3xx_cken_enable,
  142. .disable = clk_pxa3xx_cken_disable,
  143. };
  144. static const struct clkops clk_pxa3xx_hsio_ops = {
  145. .enable = clk_pxa3xx_cken_enable,
  146. .disable = clk_pxa3xx_cken_disable,
  147. .getrate = clk_pxa3xx_hsio_getrate,
  148. };
  149. static const struct clkops clk_pxa3xx_ac97_ops = {
  150. .enable = clk_pxa3xx_cken_enable,
  151. .disable = clk_pxa3xx_cken_disable,
  152. .getrate = clk_pxa3xx_ac97_getrate,
  153. };
  154. static void clk_pout_enable(struct clk *clk)
  155. {
  156. OSCC |= OSCC_PEN;
  157. }
  158. static void clk_pout_disable(struct clk *clk)
  159. {
  160. OSCC &= ~OSCC_PEN;
  161. }
  162. static const struct clkops clk_pout_ops = {
  163. .enable = clk_pout_enable,
  164. .disable = clk_pout_disable,
  165. };
  166. static void clk_dummy_enable(struct clk *clk)
  167. {
  168. }
  169. static void clk_dummy_disable(struct clk *clk)
  170. {
  171. }
  172. static const struct clkops clk_dummy_ops = {
  173. .enable = clk_dummy_enable,
  174. .disable = clk_dummy_disable,
  175. };
  176. static struct clk clk_pxa3xx_pout = {
  177. .ops = &clk_pout_ops,
  178. .rate = 13000000,
  179. .delay = 70,
  180. };
  181. static struct clk clk_dummy = {
  182. .ops = &clk_dummy_ops,
  183. };
  184. static DEFINE_PXA3_CK(pxa3xx_lcd, LCD, &clk_pxa3xx_hsio_ops);
  185. static DEFINE_PXA3_CK(pxa3xx_camera, CAMERA, &clk_pxa3xx_hsio_ops);
  186. static DEFINE_PXA3_CK(pxa3xx_ac97, AC97, &clk_pxa3xx_ac97_ops);
  187. static DEFINE_PXA3_CKEN(pxa3xx_ffuart, FFUART, 14857000, 1);
  188. static DEFINE_PXA3_CKEN(pxa3xx_btuart, BTUART, 14857000, 1);
  189. static DEFINE_PXA3_CKEN(pxa3xx_stuart, STUART, 14857000, 1);
  190. static DEFINE_PXA3_CKEN(pxa3xx_i2c, I2C, 32842000, 0);
  191. static DEFINE_PXA3_CKEN(pxa3xx_udc, UDC, 48000000, 5);
  192. static DEFINE_PXA3_CKEN(pxa3xx_usbh, USBH, 48000000, 0);
  193. static DEFINE_PXA3_CKEN(pxa3xx_keypad, KEYPAD, 32768, 0);
  194. static DEFINE_PXA3_CKEN(pxa3xx_ssp1, SSP1, 13000000, 0);
  195. static DEFINE_PXA3_CKEN(pxa3xx_ssp2, SSP2, 13000000, 0);
  196. static DEFINE_PXA3_CKEN(pxa3xx_ssp3, SSP3, 13000000, 0);
  197. static DEFINE_PXA3_CKEN(pxa3xx_ssp4, SSP4, 13000000, 0);
  198. static DEFINE_PXA3_CKEN(pxa3xx_pwm0, PWM0, 13000000, 0);
  199. static DEFINE_PXA3_CKEN(pxa3xx_pwm1, PWM1, 13000000, 0);
  200. static DEFINE_PXA3_CKEN(pxa3xx_mmc1, MMC1, 19500000, 0);
  201. static DEFINE_PXA3_CKEN(pxa3xx_mmc2, MMC2, 19500000, 0);
  202. static struct clk_lookup pxa3xx_clkregs[] = {
  203. INIT_CLKREG(&clk_pxa3xx_pout, NULL, "CLK_POUT"),
  204. /* Power I2C clock is always on */
  205. INIT_CLKREG(&clk_dummy, "pxa2xx-i2c.1", NULL),
  206. INIT_CLKREG(&clk_pxa3xx_lcd, "pxa2xx-fb", NULL),
  207. INIT_CLKREG(&clk_pxa3xx_camera, NULL, "CAMCLK"),
  208. INIT_CLKREG(&clk_pxa3xx_ac97, NULL, "AC97CLK"),
  209. INIT_CLKREG(&clk_pxa3xx_ffuart, "pxa2xx-uart.0", NULL),
  210. INIT_CLKREG(&clk_pxa3xx_btuart, "pxa2xx-uart.1", NULL),
  211. INIT_CLKREG(&clk_pxa3xx_stuart, "pxa2xx-uart.2", NULL),
  212. INIT_CLKREG(&clk_pxa3xx_stuart, "pxa2xx-ir", "UARTCLK"),
  213. INIT_CLKREG(&clk_pxa3xx_i2c, "pxa2xx-i2c.0", NULL),
  214. INIT_CLKREG(&clk_pxa3xx_udc, "pxa27x-udc", NULL),
  215. INIT_CLKREG(&clk_pxa3xx_usbh, "pxa27x-ohci", NULL),
  216. INIT_CLKREG(&clk_pxa3xx_keypad, "pxa27x-keypad", NULL),
  217. INIT_CLKREG(&clk_pxa3xx_ssp1, "pxa27x-ssp.0", NULL),
  218. INIT_CLKREG(&clk_pxa3xx_ssp2, "pxa27x-ssp.1", NULL),
  219. INIT_CLKREG(&clk_pxa3xx_ssp3, "pxa27x-ssp.2", NULL),
  220. INIT_CLKREG(&clk_pxa3xx_ssp4, "pxa27x-ssp.3", NULL),
  221. INIT_CLKREG(&clk_pxa3xx_pwm0, "pxa27x-pwm.0", NULL),
  222. INIT_CLKREG(&clk_pxa3xx_pwm1, "pxa27x-pwm.1", NULL),
  223. INIT_CLKREG(&clk_pxa3xx_mmc1, "pxa2xx-mci.0", NULL),
  224. INIT_CLKREG(&clk_pxa3xx_mmc2, "pxa2xx-mci.1", NULL),
  225. };
  226. #ifdef CONFIG_PM
  227. #define ISRAM_START 0x5c000000
  228. #define ISRAM_SIZE SZ_256K
  229. static void __iomem *sram;
  230. static unsigned long wakeup_src;
  231. #define SAVE(x) sleep_save[SLEEP_SAVE_##x] = x
  232. #define RESTORE(x) x = sleep_save[SLEEP_SAVE_##x]
  233. enum { SLEEP_SAVE_CKENA,
  234. SLEEP_SAVE_CKENB,
  235. SLEEP_SAVE_ACCR,
  236. SLEEP_SAVE_COUNT,
  237. };
  238. static void pxa3xx_cpu_pm_save(unsigned long *sleep_save)
  239. {
  240. SAVE(CKENA);
  241. SAVE(CKENB);
  242. SAVE(ACCR);
  243. }
  244. static void pxa3xx_cpu_pm_restore(unsigned long *sleep_save)
  245. {
  246. RESTORE(ACCR);
  247. RESTORE(CKENA);
  248. RESTORE(CKENB);
  249. }
  250. /*
  251. * Enter a standby mode (S0D1C2 or S0D2C2). Upon wakeup, the dynamic
  252. * memory controller has to be reinitialised, so we place some code
  253. * in the SRAM to perform this function.
  254. *
  255. * We disable FIQs across the standby - otherwise, we might receive a
  256. * FIQ while the SDRAM is unavailable.
  257. */
  258. static void pxa3xx_cpu_standby(unsigned int pwrmode)
  259. {
  260. extern const char pm_enter_standby_start[], pm_enter_standby_end[];
  261. void (*fn)(unsigned int) = (void __force *)(sram + 0x8000);
  262. memcpy_toio(sram + 0x8000, pm_enter_standby_start,
  263. pm_enter_standby_end - pm_enter_standby_start);
  264. AD2D0SR = ~0;
  265. AD2D1SR = ~0;
  266. AD2D0ER = wakeup_src;
  267. AD2D1ER = 0;
  268. ASCR = ASCR;
  269. ARSR = ARSR;
  270. local_fiq_disable();
  271. fn(pwrmode);
  272. local_fiq_enable();
  273. AD2D0ER = 0;
  274. AD2D1ER = 0;
  275. }
  276. /*
  277. * NOTE: currently, the OBM (OEM Boot Module) binary comes along with
  278. * PXA3xx development kits assumes that the resuming process continues
  279. * with the address stored within the first 4 bytes of SDRAM. The PSPR
  280. * register is used privately by BootROM and OBM, and _must_ be set to
  281. * 0x5c014000 for the moment.
  282. */
  283. static void pxa3xx_cpu_pm_suspend(void)
  284. {
  285. volatile unsigned long *p = (volatile void *)0xc0000000;
  286. unsigned long saved_data = *p;
  287. extern void pxa3xx_cpu_suspend(void);
  288. extern void pxa3xx_cpu_resume(void);
  289. /* resuming from D2 requires the HSIO2/BOOT/TPM clocks enabled */
  290. CKENA |= (1 << CKEN_BOOT) | (1 << CKEN_TPM);
  291. CKENB |= 1 << (CKEN_HSIO2 & 0x1f);
  292. /* clear and setup wakeup source */
  293. AD3SR = ~0;
  294. AD3ER = wakeup_src;
  295. ASCR = ASCR;
  296. ARSR = ARSR;
  297. PCFR |= (1u << 13); /* L1_DIS */
  298. PCFR &= ~((1u << 12) | (1u << 1)); /* L0_EN | SL_ROD */
  299. PSPR = 0x5c014000;
  300. /* overwrite with the resume address */
  301. *p = virt_to_phys(pxa3xx_cpu_resume);
  302. pxa3xx_cpu_suspend();
  303. *p = saved_data;
  304. AD3ER = 0;
  305. }
  306. static void pxa3xx_cpu_pm_enter(suspend_state_t state)
  307. {
  308. /*
  309. * Don't sleep if no wakeup sources are defined
  310. */
  311. if (wakeup_src == 0) {
  312. printk(KERN_ERR "Not suspending: no wakeup sources\n");
  313. return;
  314. }
  315. switch (state) {
  316. case PM_SUSPEND_STANDBY:
  317. pxa3xx_cpu_standby(PXA3xx_PM_S0D2C2);
  318. break;
  319. case PM_SUSPEND_MEM:
  320. pxa3xx_cpu_pm_suspend();
  321. break;
  322. }
  323. }
  324. static int pxa3xx_cpu_pm_valid(suspend_state_t state)
  325. {
  326. return state == PM_SUSPEND_MEM || state == PM_SUSPEND_STANDBY;
  327. }
  328. static struct pxa_cpu_pm_fns pxa3xx_cpu_pm_fns = {
  329. .save_count = SLEEP_SAVE_COUNT,
  330. .save = pxa3xx_cpu_pm_save,
  331. .restore = pxa3xx_cpu_pm_restore,
  332. .valid = pxa3xx_cpu_pm_valid,
  333. .enter = pxa3xx_cpu_pm_enter,
  334. };
  335. static void __init pxa3xx_init_pm(void)
  336. {
  337. sram = ioremap(ISRAM_START, ISRAM_SIZE);
  338. if (!sram) {
  339. printk(KERN_ERR "Unable to map ISRAM: disabling standby/suspend\n");
  340. return;
  341. }
  342. /*
  343. * Since we copy wakeup code into the SRAM, we need to ensure
  344. * that it is preserved over the low power modes. Note: bit 8
  345. * is undocumented in the developer manual, but must be set.
  346. */
  347. AD1R |= ADXR_L2 | ADXR_R0;
  348. AD2R |= ADXR_L2 | ADXR_R0;
  349. AD3R |= ADXR_L2 | ADXR_R0;
  350. /*
  351. * Clear the resume enable registers.
  352. */
  353. AD1D0ER = 0;
  354. AD2D0ER = 0;
  355. AD2D1ER = 0;
  356. AD3ER = 0;
  357. pxa_cpu_pm_fns = &pxa3xx_cpu_pm_fns;
  358. }
  359. static int pxa3xx_set_wake(unsigned int irq, unsigned int on)
  360. {
  361. unsigned long flags, mask = 0;
  362. switch (irq) {
  363. case IRQ_SSP3:
  364. mask = ADXER_MFP_WSSP3;
  365. break;
  366. case IRQ_MSL:
  367. mask = ADXER_WMSL0;
  368. break;
  369. case IRQ_USBH2:
  370. case IRQ_USBH1:
  371. mask = ADXER_WUSBH;
  372. break;
  373. case IRQ_KEYPAD:
  374. mask = ADXER_WKP;
  375. break;
  376. case IRQ_AC97:
  377. mask = ADXER_MFP_WAC97;
  378. break;
  379. case IRQ_USIM:
  380. mask = ADXER_WUSIM0;
  381. break;
  382. case IRQ_SSP2:
  383. mask = ADXER_MFP_WSSP2;
  384. break;
  385. case IRQ_I2C:
  386. mask = ADXER_MFP_WI2C;
  387. break;
  388. case IRQ_STUART:
  389. mask = ADXER_MFP_WUART3;
  390. break;
  391. case IRQ_BTUART:
  392. mask = ADXER_MFP_WUART2;
  393. break;
  394. case IRQ_FFUART:
  395. mask = ADXER_MFP_WUART1;
  396. break;
  397. case IRQ_MMC:
  398. mask = ADXER_MFP_WMMC1;
  399. break;
  400. case IRQ_SSP:
  401. mask = ADXER_MFP_WSSP1;
  402. break;
  403. case IRQ_RTCAlrm:
  404. mask = ADXER_WRTC;
  405. break;
  406. case IRQ_SSP4:
  407. mask = ADXER_MFP_WSSP4;
  408. break;
  409. case IRQ_TSI:
  410. mask = ADXER_WTSI;
  411. break;
  412. case IRQ_USIM2:
  413. mask = ADXER_WUSIM1;
  414. break;
  415. case IRQ_MMC2:
  416. mask = ADXER_MFP_WMMC2;
  417. break;
  418. case IRQ_NAND:
  419. mask = ADXER_MFP_WFLASH;
  420. break;
  421. case IRQ_USB2:
  422. mask = ADXER_WUSB2;
  423. break;
  424. case IRQ_WAKEUP0:
  425. mask = ADXER_WEXTWAKE0;
  426. break;
  427. case IRQ_WAKEUP1:
  428. mask = ADXER_WEXTWAKE1;
  429. break;
  430. case IRQ_MMC3:
  431. mask = ADXER_MFP_GEN12;
  432. break;
  433. default:
  434. return -EINVAL;
  435. }
  436. local_irq_save(flags);
  437. if (on)
  438. wakeup_src |= mask;
  439. else
  440. wakeup_src &= ~mask;
  441. local_irq_restore(flags);
  442. return 0;
  443. }
  444. #else
  445. static inline void pxa3xx_init_pm(void) {}
  446. #define pxa3xx_set_wake NULL
  447. #endif
  448. void __init pxa3xx_init_irq(void)
  449. {
  450. /* enable CP6 access */
  451. u32 value;
  452. __asm__ __volatile__("mrc p15, 0, %0, c15, c1, 0\n": "=r"(value));
  453. value |= (1 << 6);
  454. __asm__ __volatile__("mcr p15, 0, %0, c15, c1, 0\n": :"r"(value));
  455. pxa_init_irq(56, pxa3xx_set_wake);
  456. pxa_init_gpio(128, NULL);
  457. }
  458. /*
  459. * device registration specific to PXA3xx.
  460. */
  461. void __init pxa3xx_set_i2c_power_info(struct i2c_pxa_platform_data *info)
  462. {
  463. pxa_register_device(&pxa3xx_device_i2c_power, info);
  464. }
  465. static struct platform_device *devices[] __initdata = {
  466. /* &pxa_device_udc, The UDC driver is PXA25x only */
  467. &pxa_device_ffuart,
  468. &pxa_device_btuart,
  469. &pxa_device_stuart,
  470. &pxa_device_i2s,
  471. &sa1100_device_rtc,
  472. &pxa_device_rtc,
  473. &pxa27x_device_ssp1,
  474. &pxa27x_device_ssp2,
  475. &pxa27x_device_ssp3,
  476. &pxa3xx_device_ssp4,
  477. &pxa27x_device_pwm0,
  478. &pxa27x_device_pwm1,
  479. };
  480. static struct sys_device pxa3xx_sysdev[] = {
  481. {
  482. .cls = &pxa_irq_sysclass,
  483. }, {
  484. .cls = &pxa3xx_mfp_sysclass,
  485. }, {
  486. .cls = &pxa_gpio_sysclass,
  487. },
  488. };
  489. static int __init pxa3xx_init(void)
  490. {
  491. int i, ret = 0;
  492. if (cpu_is_pxa3xx()) {
  493. reset_status = ARSR;
  494. /*
  495. * clear RDH bit every time after reset
  496. *
  497. * Note: the last 3 bits DxS are write-1-to-clear so carefully
  498. * preserve them here in case they will be referenced later
  499. */
  500. ASCR &= ~(ASCR_RDH | ASCR_D1S | ASCR_D2S | ASCR_D3S);
  501. clks_register(pxa3xx_clkregs, ARRAY_SIZE(pxa3xx_clkregs));
  502. if ((ret = pxa_init_dma(32)))
  503. return ret;
  504. pxa3xx_init_pm();
  505. for (i = 0; i < ARRAY_SIZE(pxa3xx_sysdev); i++) {
  506. ret = sysdev_register(&pxa3xx_sysdev[i]);
  507. if (ret)
  508. pr_err("failed to register sysdev[%d]\n", i);
  509. }
  510. ret = platform_add_devices(devices, ARRAY_SIZE(devices));
  511. }
  512. return ret;
  513. }
  514. postcore_initcall(pxa3xx_init);