2 * OMAP2/3 System Control Module register access
4 * Copyright (C) 2007, 2012 Texas Instruments, Inc.
5 * Copyright (C) 2007 Nokia Corporation
7 * Written by Paul Walmsley
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
15 #include <linux/kernel.h>
21 #include "cm-regbits-34xx.h"
22 #include "prm-regbits-34xx.h"
29 /* Used by omap3_ctrl_save_padconf() */
30 #define START_PADCONF_SAVE 0x2
31 #define PADCONF_SAVE_DONE 0x1
33 static void __iomem
*omap2_ctrl_base
;
34 static void __iomem
*omap4_ctrl_pad_base
;
36 #if defined(CONFIG_ARCH_OMAP3) && defined(CONFIG_PM)
37 struct omap3_scratchpad
{
39 u32 public_restore_ptr
;
40 u32 secure_ram_restore_ptr
;
41 u32 sdrc_module_semaphore
;
42 u32 prcm_block_offset
;
43 u32 sdrc_block_offset
;
46 struct omap3_scratchpad_prcm_block
{
57 u32 cm_autoidle_pll_mpu
;
58 u32 cm_clksel1_pll_mpu
;
59 u32 cm_clksel2_pll_mpu
;
63 struct omap3_scratchpad_sdrc_block
{
95 void *omap3_secure_ram_storage
;
98 * This is used to store ARM registers in SDRAM before attempting
99 * an MPU OFF. The save and restore happens from the SRAM sleep code.
100 * The address is stored in scratchpad, so that it can be used
101 * during the restore path.
103 u32 omap3_arm_context
[128];
105 struct omap3_control_regs
{
132 u32 dss_dpll_spreading
;
133 u32 core_dpll_spreading
;
134 u32 per_dpll_spreading
;
135 u32 usbhost_dpll_spreading
;
141 u32 padconf_sys_nirq
;
144 static struct omap3_control_regs control_context
;
145 #endif /* CONFIG_ARCH_OMAP3 && CONFIG_PM */
147 #define OMAP_CTRL_REGADDR(reg) (omap2_ctrl_base + (reg))
148 #define OMAP4_CTRL_PAD_REGADDR(reg) (omap4_ctrl_pad_base + (reg))
150 void __init
omap2_set_globals_control(void __iomem
*ctrl
,
151 void __iomem
*ctrl_pad
)
153 omap2_ctrl_base
= ctrl
;
154 omap4_ctrl_pad_base
= ctrl_pad
;
157 void __iomem
*omap_ctrl_base_get(void)
159 return omap2_ctrl_base
;
162 u8
omap_ctrl_readb(u16 offset
)
164 return __raw_readb(OMAP_CTRL_REGADDR(offset
));
167 u16
omap_ctrl_readw(u16 offset
)
169 return __raw_readw(OMAP_CTRL_REGADDR(offset
));
172 u32
omap_ctrl_readl(u16 offset
)
174 return __raw_readl(OMAP_CTRL_REGADDR(offset
));
177 void omap_ctrl_writeb(u8 val
, u16 offset
)
179 __raw_writeb(val
, OMAP_CTRL_REGADDR(offset
));
182 void omap_ctrl_writew(u16 val
, u16 offset
)
184 __raw_writew(val
, OMAP_CTRL_REGADDR(offset
));
187 void omap_ctrl_writel(u32 val
, u16 offset
)
189 __raw_writel(val
, OMAP_CTRL_REGADDR(offset
));
193 * On OMAP4 control pad are not addressable from control
194 * core base. So the common omap_ctrl_read/write APIs breaks
195 * Hence export separate APIs to manage the omap4 pad control
196 * registers. This APIs will work only for OMAP4
199 u32
omap4_ctrl_pad_readl(u16 offset
)
201 return __raw_readl(OMAP4_CTRL_PAD_REGADDR(offset
));
204 void omap4_ctrl_pad_writel(u32 val
, u16 offset
)
206 __raw_writel(val
, OMAP4_CTRL_PAD_REGADDR(offset
));
209 #ifdef CONFIG_ARCH_OMAP3
212 * omap3_ctrl_write_boot_mode - set scratchpad boot mode for the next boot
213 * @bootmode: 8-bit value to pass to some boot code
215 * Set the bootmode in the scratchpad RAM. This is used after the
216 * system restarts. Not sure what actually uses this - it may be the
217 * bootloader, rather than the boot ROM - contrary to the preserved
218 * comment below. No return value.
220 void omap3_ctrl_write_boot_mode(u8 bootmode
)
224 l
= ('B' << 24) | ('M' << 16) | bootmode
;
227 * Reserve the first word in scratchpad for communicating
228 * with the boot ROM. A pointer to a data structure
229 * describing the boot process can be stored there,
230 * cf. OMAP34xx TRM, Initialization / Software Booting
233 * XXX This should use some omap_ctrl_writel()-type function
235 __raw_writel(l
, OMAP2_L4_IO_ADDRESS(OMAP343X_SCRATCHPAD
+ 4));
241 * omap_ctrl_write_dsp_boot_addr - set boot address for a remote processor
242 * @bootaddr: physical address of the boot loader
244 * Set boot address for the boot loader of a supported processor
245 * when a power ON sequence occurs.
247 void omap_ctrl_write_dsp_boot_addr(u32 bootaddr
)
249 u32 offset
= cpu_is_omap243x() ? OMAP243X_CONTROL_IVA2_BOOTADDR
:
250 cpu_is_omap34xx() ? OMAP343X_CONTROL_IVA2_BOOTADDR
:
251 cpu_is_omap44xx() ? OMAP4_CTRL_MODULE_CORE_DSP_BOOTADDR
:
252 soc_is_omap54xx() ? OMAP4_CTRL_MODULE_CORE_DSP_BOOTADDR
:
256 pr_err("%s: unsupported omap type\n", __func__
);
260 omap_ctrl_writel(bootaddr
, offset
);
264 * omap_ctrl_write_dsp_boot_mode - set boot mode for a remote processor
265 * @bootmode: 8-bit value to pass to some boot code
267 * Sets boot mode for the boot loader of a supported processor
268 * when a power ON sequence occurs.
270 void omap_ctrl_write_dsp_boot_mode(u8 bootmode
)
272 u32 offset
= cpu_is_omap243x() ? OMAP243X_CONTROL_IVA2_BOOTMOD
:
273 cpu_is_omap34xx() ? OMAP343X_CONTROL_IVA2_BOOTMOD
:
277 pr_err("%s: unsupported omap type\n", __func__
);
281 omap_ctrl_writel(bootmode
, offset
);
284 #if defined(CONFIG_ARCH_OMAP3) && defined(CONFIG_PM)
286 * Clears the scratchpad contents in case of cold boot-
287 * called during bootup
289 void omap3_clear_scratchpad_contents(void)
291 u32 max_offset
= OMAP343X_SCRATCHPAD_ROM_OFFSET
;
292 void __iomem
*v_addr
;
294 v_addr
= OMAP2_L4_IO_ADDRESS(OMAP343X_SCRATCHPAD_ROM
);
295 if (omap2_prm_read_mod_reg(OMAP3430_GR_MOD
, OMAP3_PRM_RSTST_OFFSET
) &
296 OMAP3430_GLOBAL_COLD_RST_MASK
) {
297 for ( ; offset
<= max_offset
; offset
+= 0x4)
298 __raw_writel(0x0, (v_addr
+ offset
));
299 omap2_prm_set_mod_reg_bits(OMAP3430_GLOBAL_COLD_RST_MASK
,
301 OMAP3_PRM_RSTST_OFFSET
);
305 /* Populate the scratchpad structure with restore structure */
306 void omap3_save_scratchpad_contents(void)
308 void __iomem
*scratchpad_address
;
309 u32 arm_context_addr
;
310 struct omap3_scratchpad scratchpad_contents
;
311 struct omap3_scratchpad_prcm_block prcm_block_contents
;
312 struct omap3_scratchpad_sdrc_block sdrc_block_contents
;
315 * Populate the Scratchpad contents
317 * The "get_*restore_pointer" functions are used to provide a
318 * physical restore address where the ROM code jumps while waking
319 * up from MPU OFF/OSWR state.
320 * The restore pointer is stored into the scratchpad.
322 scratchpad_contents
.boot_config_ptr
= 0x0;
323 if (cpu_is_omap3630())
324 scratchpad_contents
.public_restore_ptr
=
325 virt_to_phys(omap3_restore_3630
);
326 else if (omap_rev() != OMAP3430_REV_ES3_0
&&
327 omap_rev() != OMAP3430_REV_ES3_1
&&
328 omap_rev() != OMAP3430_REV_ES3_1_2
)
329 scratchpad_contents
.public_restore_ptr
=
330 virt_to_phys(omap3_restore
);
332 scratchpad_contents
.public_restore_ptr
=
333 virt_to_phys(omap3_restore_es3
);
335 if (omap_type() == OMAP2_DEVICE_TYPE_GP
)
336 scratchpad_contents
.secure_ram_restore_ptr
= 0x0;
338 scratchpad_contents
.secure_ram_restore_ptr
=
339 (u32
) __pa(omap3_secure_ram_storage
);
340 scratchpad_contents
.sdrc_module_semaphore
= 0x0;
341 scratchpad_contents
.prcm_block_offset
= 0x2C;
342 scratchpad_contents
.sdrc_block_offset
= 0x64;
344 /* Populate the PRCM block contents */
345 prcm_block_contents
.prm_clksrc_ctrl
=
346 omap2_prm_read_mod_reg(OMAP3430_GR_MOD
,
347 OMAP3_PRM_CLKSRC_CTRL_OFFSET
);
348 prcm_block_contents
.prm_clksel
=
349 omap2_prm_read_mod_reg(OMAP3430_CCR_MOD
,
350 OMAP3_PRM_CLKSEL_OFFSET
);
351 prcm_block_contents
.cm_clksel_core
=
352 omap2_cm_read_mod_reg(CORE_MOD
, CM_CLKSEL
);
353 prcm_block_contents
.cm_clksel_wkup
=
354 omap2_cm_read_mod_reg(WKUP_MOD
, CM_CLKSEL
);
355 prcm_block_contents
.cm_clken_pll
=
356 omap2_cm_read_mod_reg(PLL_MOD
, CM_CLKEN
);
358 * As per erratum i671, ROM code does not respect the PER DPLL
359 * programming scheme if CM_AUTOIDLE_PLL..AUTO_PERIPH_DPLL == 1.
360 * Then, in anycase, clear these bits to avoid extra latencies.
362 prcm_block_contents
.cm_autoidle_pll
=
363 omap2_cm_read_mod_reg(PLL_MOD
, CM_AUTOIDLE
) &
364 ~OMAP3430_AUTO_PERIPH_DPLL_MASK
;
365 prcm_block_contents
.cm_clksel1_pll
=
366 omap2_cm_read_mod_reg(PLL_MOD
, OMAP3430_CM_CLKSEL1_PLL
);
367 prcm_block_contents
.cm_clksel2_pll
=
368 omap2_cm_read_mod_reg(PLL_MOD
, OMAP3430_CM_CLKSEL2_PLL
);
369 prcm_block_contents
.cm_clksel3_pll
=
370 omap2_cm_read_mod_reg(PLL_MOD
, OMAP3430_CM_CLKSEL3
);
371 prcm_block_contents
.cm_clken_pll_mpu
=
372 omap2_cm_read_mod_reg(MPU_MOD
, OMAP3430_CM_CLKEN_PLL
);
373 prcm_block_contents
.cm_autoidle_pll_mpu
=
374 omap2_cm_read_mod_reg(MPU_MOD
, OMAP3430_CM_AUTOIDLE_PLL
);
375 prcm_block_contents
.cm_clksel1_pll_mpu
=
376 omap2_cm_read_mod_reg(MPU_MOD
, OMAP3430_CM_CLKSEL1_PLL
);
377 prcm_block_contents
.cm_clksel2_pll_mpu
=
378 omap2_cm_read_mod_reg(MPU_MOD
, OMAP3430_CM_CLKSEL2_PLL
);
379 prcm_block_contents
.prcm_block_size
= 0x0;
381 /* Populate the SDRC block contents */
382 sdrc_block_contents
.sysconfig
=
383 (sdrc_read_reg(SDRC_SYSCONFIG
) & 0xFFFF);
384 sdrc_block_contents
.cs_cfg
=
385 (sdrc_read_reg(SDRC_CS_CFG
) & 0xFFFF);
386 sdrc_block_contents
.sharing
=
387 (sdrc_read_reg(SDRC_SHARING
) & 0xFFFF);
388 sdrc_block_contents
.err_type
=
389 (sdrc_read_reg(SDRC_ERR_TYPE
) & 0xFFFF);
390 sdrc_block_contents
.dll_a_ctrl
= sdrc_read_reg(SDRC_DLLA_CTRL
);
391 sdrc_block_contents
.dll_b_ctrl
= 0x0;
393 * Due to a OMAP3 errata (1.142), on EMU/HS devices SRDC should
394 * be programed to issue automatic self refresh on timeout
395 * of AUTO_CNT = 1 prior to any transition to OFF mode.
397 if ((omap_type() != OMAP2_DEVICE_TYPE_GP
)
398 && (omap_rev() >= OMAP3430_REV_ES3_0
))
399 sdrc_block_contents
.power
= (sdrc_read_reg(SDRC_POWER
) &
400 ~(SDRC_POWER_AUTOCOUNT_MASK
|
401 SDRC_POWER_CLKCTRL_MASK
)) |
402 (1 << SDRC_POWER_AUTOCOUNT_SHIFT
) |
403 SDRC_SELF_REFRESH_ON_AUTOCOUNT
;
405 sdrc_block_contents
.power
= sdrc_read_reg(SDRC_POWER
);
407 sdrc_block_contents
.cs_0
= 0x0;
408 sdrc_block_contents
.mcfg_0
= sdrc_read_reg(SDRC_MCFG_0
);
409 sdrc_block_contents
.mr_0
= (sdrc_read_reg(SDRC_MR_0
) & 0xFFFF);
410 sdrc_block_contents
.emr_1_0
= 0x0;
411 sdrc_block_contents
.emr_2_0
= 0x0;
412 sdrc_block_contents
.emr_3_0
= 0x0;
413 sdrc_block_contents
.actim_ctrla_0
=
414 sdrc_read_reg(SDRC_ACTIM_CTRL_A_0
);
415 sdrc_block_contents
.actim_ctrlb_0
=
416 sdrc_read_reg(SDRC_ACTIM_CTRL_B_0
);
417 sdrc_block_contents
.rfr_ctrl_0
=
418 sdrc_read_reg(SDRC_RFR_CTRL_0
);
419 sdrc_block_contents
.cs_1
= 0x0;
420 sdrc_block_contents
.mcfg_1
= sdrc_read_reg(SDRC_MCFG_1
);
421 sdrc_block_contents
.mr_1
= sdrc_read_reg(SDRC_MR_1
) & 0xFFFF;
422 sdrc_block_contents
.emr_1_1
= 0x0;
423 sdrc_block_contents
.emr_2_1
= 0x0;
424 sdrc_block_contents
.emr_3_1
= 0x0;
425 sdrc_block_contents
.actim_ctrla_1
=
426 sdrc_read_reg(SDRC_ACTIM_CTRL_A_1
);
427 sdrc_block_contents
.actim_ctrlb_1
=
428 sdrc_read_reg(SDRC_ACTIM_CTRL_B_1
);
429 sdrc_block_contents
.rfr_ctrl_1
=
430 sdrc_read_reg(SDRC_RFR_CTRL_1
);
431 sdrc_block_contents
.dcdl_1_ctrl
= 0x0;
432 sdrc_block_contents
.dcdl_2_ctrl
= 0x0;
433 sdrc_block_contents
.flags
= 0x0;
434 sdrc_block_contents
.block_size
= 0x0;
436 arm_context_addr
= virt_to_phys(omap3_arm_context
);
438 /* Copy all the contents to the scratchpad location */
439 scratchpad_address
= OMAP2_L4_IO_ADDRESS(OMAP343X_SCRATCHPAD
);
440 memcpy_toio(scratchpad_address
, &scratchpad_contents
,
441 sizeof(scratchpad_contents
));
442 /* Scratchpad contents being 32 bits, a divide by 4 done here */
443 memcpy_toio(scratchpad_address
+
444 scratchpad_contents
.prcm_block_offset
,
445 &prcm_block_contents
, sizeof(prcm_block_contents
));
446 memcpy_toio(scratchpad_address
+
447 scratchpad_contents
.sdrc_block_offset
,
448 &sdrc_block_contents
, sizeof(sdrc_block_contents
));
450 * Copies the address of the location in SDRAM where ARM
451 * registers get saved during a MPU OFF transition.
453 memcpy_toio(scratchpad_address
+
454 scratchpad_contents
.sdrc_block_offset
+
455 sizeof(sdrc_block_contents
), &arm_context_addr
, 4);
458 void omap3_control_save_context(void)
460 control_context
.sysconfig
= omap_ctrl_readl(OMAP2_CONTROL_SYSCONFIG
);
461 control_context
.devconf0
= omap_ctrl_readl(OMAP2_CONTROL_DEVCONF0
);
462 control_context
.mem_dftrw0
=
463 omap_ctrl_readl(OMAP343X_CONTROL_MEM_DFTRW0
);
464 control_context
.mem_dftrw1
=
465 omap_ctrl_readl(OMAP343X_CONTROL_MEM_DFTRW1
);
466 control_context
.msuspendmux_0
=
467 omap_ctrl_readl(OMAP2_CONTROL_MSUSPENDMUX_0
);
468 control_context
.msuspendmux_1
=
469 omap_ctrl_readl(OMAP2_CONTROL_MSUSPENDMUX_1
);
470 control_context
.msuspendmux_2
=
471 omap_ctrl_readl(OMAP2_CONTROL_MSUSPENDMUX_2
);
472 control_context
.msuspendmux_3
=
473 omap_ctrl_readl(OMAP2_CONTROL_MSUSPENDMUX_3
);
474 control_context
.msuspendmux_4
=
475 omap_ctrl_readl(OMAP2_CONTROL_MSUSPENDMUX_4
);
476 control_context
.msuspendmux_5
=
477 omap_ctrl_readl(OMAP2_CONTROL_MSUSPENDMUX_5
);
478 control_context
.sec_ctrl
= omap_ctrl_readl(OMAP2_CONTROL_SEC_CTRL
);
479 control_context
.devconf1
= omap_ctrl_readl(OMAP343X_CONTROL_DEVCONF1
);
480 control_context
.csirxfe
= omap_ctrl_readl(OMAP343X_CONTROL_CSIRXFE
);
481 control_context
.iva2_bootaddr
=
482 omap_ctrl_readl(OMAP343X_CONTROL_IVA2_BOOTADDR
);
483 control_context
.iva2_bootmod
=
484 omap_ctrl_readl(OMAP343X_CONTROL_IVA2_BOOTMOD
);
485 control_context
.debobs_0
= omap_ctrl_readl(OMAP343X_CONTROL_DEBOBS(0));
486 control_context
.debobs_1
= omap_ctrl_readl(OMAP343X_CONTROL_DEBOBS(1));
487 control_context
.debobs_2
= omap_ctrl_readl(OMAP343X_CONTROL_DEBOBS(2));
488 control_context
.debobs_3
= omap_ctrl_readl(OMAP343X_CONTROL_DEBOBS(3));
489 control_context
.debobs_4
= omap_ctrl_readl(OMAP343X_CONTROL_DEBOBS(4));
490 control_context
.debobs_5
= omap_ctrl_readl(OMAP343X_CONTROL_DEBOBS(5));
491 control_context
.debobs_6
= omap_ctrl_readl(OMAP343X_CONTROL_DEBOBS(6));
492 control_context
.debobs_7
= omap_ctrl_readl(OMAP343X_CONTROL_DEBOBS(7));
493 control_context
.debobs_8
= omap_ctrl_readl(OMAP343X_CONTROL_DEBOBS(8));
494 control_context
.prog_io0
= omap_ctrl_readl(OMAP343X_CONTROL_PROG_IO0
);
495 control_context
.prog_io1
= omap_ctrl_readl(OMAP343X_CONTROL_PROG_IO1
);
496 control_context
.dss_dpll_spreading
=
497 omap_ctrl_readl(OMAP343X_CONTROL_DSS_DPLL_SPREADING
);
498 control_context
.core_dpll_spreading
=
499 omap_ctrl_readl(OMAP343X_CONTROL_CORE_DPLL_SPREADING
);
500 control_context
.per_dpll_spreading
=
501 omap_ctrl_readl(OMAP343X_CONTROL_PER_DPLL_SPREADING
);
502 control_context
.usbhost_dpll_spreading
=
503 omap_ctrl_readl(OMAP343X_CONTROL_USBHOST_DPLL_SPREADING
);
504 control_context
.pbias_lite
=
505 omap_ctrl_readl(OMAP343X_CONTROL_PBIAS_LITE
);
506 control_context
.temp_sensor
=
507 omap_ctrl_readl(OMAP343X_CONTROL_TEMP_SENSOR
);
508 control_context
.sramldo4
= omap_ctrl_readl(OMAP343X_CONTROL_SRAMLDO4
);
509 control_context
.sramldo5
= omap_ctrl_readl(OMAP343X_CONTROL_SRAMLDO5
);
510 control_context
.csi
= omap_ctrl_readl(OMAP343X_CONTROL_CSI
);
511 control_context
.padconf_sys_nirq
=
512 omap_ctrl_readl(OMAP343X_CONTROL_PADCONF_SYSNIRQ
);
516 void omap3_control_restore_context(void)
518 omap_ctrl_writel(control_context
.sysconfig
, OMAP2_CONTROL_SYSCONFIG
);
519 omap_ctrl_writel(control_context
.devconf0
, OMAP2_CONTROL_DEVCONF0
);
520 omap_ctrl_writel(control_context
.mem_dftrw0
,
521 OMAP343X_CONTROL_MEM_DFTRW0
);
522 omap_ctrl_writel(control_context
.mem_dftrw1
,
523 OMAP343X_CONTROL_MEM_DFTRW1
);
524 omap_ctrl_writel(control_context
.msuspendmux_0
,
525 OMAP2_CONTROL_MSUSPENDMUX_0
);
526 omap_ctrl_writel(control_context
.msuspendmux_1
,
527 OMAP2_CONTROL_MSUSPENDMUX_1
);
528 omap_ctrl_writel(control_context
.msuspendmux_2
,
529 OMAP2_CONTROL_MSUSPENDMUX_2
);
530 omap_ctrl_writel(control_context
.msuspendmux_3
,
531 OMAP2_CONTROL_MSUSPENDMUX_3
);
532 omap_ctrl_writel(control_context
.msuspendmux_4
,
533 OMAP2_CONTROL_MSUSPENDMUX_4
);
534 omap_ctrl_writel(control_context
.msuspendmux_5
,
535 OMAP2_CONTROL_MSUSPENDMUX_5
);
536 omap_ctrl_writel(control_context
.sec_ctrl
, OMAP2_CONTROL_SEC_CTRL
);
537 omap_ctrl_writel(control_context
.devconf1
, OMAP343X_CONTROL_DEVCONF1
);
538 omap_ctrl_writel(control_context
.csirxfe
, OMAP343X_CONTROL_CSIRXFE
);
539 omap_ctrl_writel(control_context
.iva2_bootaddr
,
540 OMAP343X_CONTROL_IVA2_BOOTADDR
);
541 omap_ctrl_writel(control_context
.iva2_bootmod
,
542 OMAP343X_CONTROL_IVA2_BOOTMOD
);
543 omap_ctrl_writel(control_context
.debobs_0
, OMAP343X_CONTROL_DEBOBS(0));
544 omap_ctrl_writel(control_context
.debobs_1
, OMAP343X_CONTROL_DEBOBS(1));
545 omap_ctrl_writel(control_context
.debobs_2
, OMAP343X_CONTROL_DEBOBS(2));
546 omap_ctrl_writel(control_context
.debobs_3
, OMAP343X_CONTROL_DEBOBS(3));
547 omap_ctrl_writel(control_context
.debobs_4
, OMAP343X_CONTROL_DEBOBS(4));
548 omap_ctrl_writel(control_context
.debobs_5
, OMAP343X_CONTROL_DEBOBS(5));
549 omap_ctrl_writel(control_context
.debobs_6
, OMAP343X_CONTROL_DEBOBS(6));
550 omap_ctrl_writel(control_context
.debobs_7
, OMAP343X_CONTROL_DEBOBS(7));
551 omap_ctrl_writel(control_context
.debobs_8
, OMAP343X_CONTROL_DEBOBS(8));
552 omap_ctrl_writel(control_context
.prog_io0
, OMAP343X_CONTROL_PROG_IO0
);
553 omap_ctrl_writel(control_context
.prog_io1
, OMAP343X_CONTROL_PROG_IO1
);
554 omap_ctrl_writel(control_context
.dss_dpll_spreading
,
555 OMAP343X_CONTROL_DSS_DPLL_SPREADING
);
556 omap_ctrl_writel(control_context
.core_dpll_spreading
,
557 OMAP343X_CONTROL_CORE_DPLL_SPREADING
);
558 omap_ctrl_writel(control_context
.per_dpll_spreading
,
559 OMAP343X_CONTROL_PER_DPLL_SPREADING
);
560 omap_ctrl_writel(control_context
.usbhost_dpll_spreading
,
561 OMAP343X_CONTROL_USBHOST_DPLL_SPREADING
);
562 omap_ctrl_writel(control_context
.pbias_lite
,
563 OMAP343X_CONTROL_PBIAS_LITE
);
564 omap_ctrl_writel(control_context
.temp_sensor
,
565 OMAP343X_CONTROL_TEMP_SENSOR
);
566 omap_ctrl_writel(control_context
.sramldo4
, OMAP343X_CONTROL_SRAMLDO4
);
567 omap_ctrl_writel(control_context
.sramldo5
, OMAP343X_CONTROL_SRAMLDO5
);
568 omap_ctrl_writel(control_context
.csi
, OMAP343X_CONTROL_CSI
);
569 omap_ctrl_writel(control_context
.padconf_sys_nirq
,
570 OMAP343X_CONTROL_PADCONF_SYSNIRQ
);
574 void omap3630_ctrl_disable_rta(void)
576 if (!cpu_is_omap3630())
578 omap_ctrl_writel(OMAP36XX_RTA_DISABLE
, OMAP36XX_CONTROL_MEM_RTA_CTRL
);
582 * omap3_ctrl_save_padconf - save padconf registers to scratchpad RAM
584 * Tell the SCM to start saving the padconf registers, then wait for
585 * the process to complete. Returns 0 unconditionally, although it
586 * should also eventually be able to return -ETIMEDOUT, if the save
589 * XXX This function is missing a timeout. What should it be?
591 int omap3_ctrl_save_padconf(void)
595 /* Save the padconf registers */
596 cpo
= omap_ctrl_readl(OMAP343X_CONTROL_PADCONF_OFF
);
597 cpo
|= START_PADCONF_SAVE
;
598 omap_ctrl_writel(cpo
, OMAP343X_CONTROL_PADCONF_OFF
);
600 /* wait for the save to complete */
601 while (!(omap_ctrl_readl(OMAP343X_CONTROL_GENERAL_PURPOSE_STATUS
)
602 & PADCONF_SAVE_DONE
))
608 #endif /* CONFIG_ARCH_OMAP3 && CONFIG_PM */