pxa3xx.c 14 KB

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