diff options
author | Tony Lindgren <tony@atomide.com> | 2012-07-05 05:13:04 -0400 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2012-07-05 05:13:04 -0400 |
commit | ac5b0ea3d00d231dd9cedd45636b29defc368a4c (patch) | |
tree | 9649d193558e7c662257063a77ab7422379ac45b | |
parent | 3f96a2d90e6923e2dd1e35d2f149a70a4d0f678c (diff) | |
parent | 8cb8de5d87b75f2ecaa1189079764340ea366c0e (diff) |
Merge tag 'omap-devel-f-for-3.6' of git://git.kernel.org/pub/scm/linux/kernel/git/pjw/omap-pending into cleanup-part2
Miscellaneous OMAP clock, hwmod, clockdomain, and powerdomain patches
for 3.6. Mostly small infrastructure improvements, and preparation
for OMAP5 and AM33xx code.
Conflicts:
arch/arm/mach-omap2/omap_hwmod.c
arch/arm/plat-omap/include/plat/omap_hwmod.h
-rw-r--r-- | arch/arm/mach-omap2/clockdomain44xx.c | 10 | ||||
-rw-r--r-- | arch/arm/mach-omap2/cminst44xx.c | 14 | ||||
-rw-r--r-- | arch/arm/mach-omap2/cminst44xx.h | 25 | ||||
-rw-r--r-- | arch/arm/mach-omap2/control.h | 1 | ||||
-rw-r--r-- | arch/arm/mach-omap2/dpll3xxx.c | 12 | ||||
-rw-r--r-- | arch/arm/mach-omap2/omap_hwmod.c | 61 | ||||
-rw-r--r-- | arch/arm/mach-omap2/omap_hwmod_common_data.c | 10 | ||||
-rw-r--r-- | arch/arm/mach-omap2/powerdomain.c | 6 | ||||
-rw-r--r-- | arch/arm/mach-omap2/prcm.c | 23 | ||||
-rw-r--r-- | arch/arm/mach-omap2/prm2xxx_3xxx.h | 65 | ||||
-rw-r--r-- | arch/arm/mach-omap2/prm_common.c | 62 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/omap_hwmod.h | 17 |
12 files changed, 192 insertions, 114 deletions
diff --git a/arch/arm/mach-omap2/clockdomain44xx.c b/arch/arm/mach-omap2/clockdomain44xx.c index 4f04dd11d655..762f2cc542ce 100644 --- a/arch/arm/mach-omap2/clockdomain44xx.c +++ b/arch/arm/mach-omap2/clockdomain44xx.c | |||
@@ -70,7 +70,7 @@ static int omap4_clkdm_clear_all_wkup_sleep_deps(struct clockdomain *clkdm) | |||
70 | 70 | ||
71 | static int omap4_clkdm_sleep(struct clockdomain *clkdm) | 71 | static int omap4_clkdm_sleep(struct clockdomain *clkdm) |
72 | { | 72 | { |
73 | omap4_cminst_clkdm_force_sleep(clkdm->prcm_partition, | 73 | omap4_cminst_clkdm_enable_hwsup(clkdm->prcm_partition, |
74 | clkdm->cm_inst, clkdm->clkdm_offs); | 74 | clkdm->cm_inst, clkdm->clkdm_offs); |
75 | return 0; | 75 | return 0; |
76 | } | 76 | } |
@@ -90,8 +90,12 @@ static void omap4_clkdm_allow_idle(struct clockdomain *clkdm) | |||
90 | 90 | ||
91 | static void omap4_clkdm_deny_idle(struct clockdomain *clkdm) | 91 | static void omap4_clkdm_deny_idle(struct clockdomain *clkdm) |
92 | { | 92 | { |
93 | omap4_cminst_clkdm_disable_hwsup(clkdm->prcm_partition, | 93 | if (clkdm->flags & CLKDM_CAN_FORCE_WAKEUP) |
94 | clkdm->cm_inst, clkdm->clkdm_offs); | 94 | omap4_clkdm_wakeup(clkdm); |
95 | else | ||
96 | omap4_cminst_clkdm_disable_hwsup(clkdm->prcm_partition, | ||
97 | clkdm->cm_inst, | ||
98 | clkdm->clkdm_offs); | ||
95 | } | 99 | } |
96 | 100 | ||
97 | static int omap4_clkdm_clk_enable(struct clockdomain *clkdm) | 101 | static int omap4_clkdm_clk_enable(struct clockdomain *clkdm) |
diff --git a/arch/arm/mach-omap2/cminst44xx.c b/arch/arm/mach-omap2/cminst44xx.c index 1a39945d9ff8..1894015ff04b 100644 --- a/arch/arm/mach-omap2/cminst44xx.c +++ b/arch/arm/mach-omap2/cminst44xx.c | |||
@@ -235,20 +235,6 @@ void omap4_cminst_clkdm_disable_hwsup(u8 part, s16 inst, u16 cdoffs) | |||
235 | } | 235 | } |
236 | 236 | ||
237 | /** | 237 | /** |
238 | * omap4_cminst_clkdm_force_sleep - try to put a clockdomain into idle | ||
239 | * @part: PRCM partition ID that the clockdomain registers exist in | ||
240 | * @inst: CM instance register offset (*_INST macro) | ||
241 | * @cdoffs: Clockdomain register offset (*_CDOFFS macro) | ||
242 | * | ||
243 | * Put a clockdomain referred to by (@part, @inst, @cdoffs) into idle | ||
244 | * No return value. | ||
245 | */ | ||
246 | void omap4_cminst_clkdm_force_sleep(u8 part, s16 inst, u16 cdoffs) | ||
247 | { | ||
248 | _clktrctrl_write(OMAP34XX_CLKSTCTRL_FORCE_SLEEP, part, inst, cdoffs); | ||
249 | } | ||
250 | |||
251 | /** | ||
252 | * omap4_cminst_clkdm_force_sleep - try to take a clockdomain out of idle | 238 | * omap4_cminst_clkdm_force_sleep - try to take a clockdomain out of idle |
253 | * @part: PRCM partition ID that the clockdomain registers exist in | 239 | * @part: PRCM partition ID that the clockdomain registers exist in |
254 | * @inst: CM instance register offset (*_INST macro) | 240 | * @inst: CM instance register offset (*_INST macro) |
diff --git a/arch/arm/mach-omap2/cminst44xx.h b/arch/arm/mach-omap2/cminst44xx.h index a018a7327879..d69fdefef985 100644 --- a/arch/arm/mach-omap2/cminst44xx.h +++ b/arch/arm/mach-omap2/cminst44xx.h | |||
@@ -16,38 +16,13 @@ extern void omap4_cminst_clkdm_enable_hwsup(u8 part, s16 inst, u16 cdoffs); | |||
16 | extern void omap4_cminst_clkdm_disable_hwsup(u8 part, s16 inst, u16 cdoffs); | 16 | extern void omap4_cminst_clkdm_disable_hwsup(u8 part, s16 inst, u16 cdoffs); |
17 | extern void omap4_cminst_clkdm_force_sleep(u8 part, s16 inst, u16 cdoffs); | 17 | extern void omap4_cminst_clkdm_force_sleep(u8 part, s16 inst, u16 cdoffs); |
18 | extern void omap4_cminst_clkdm_force_wakeup(u8 part, s16 inst, u16 cdoffs); | 18 | extern void omap4_cminst_clkdm_force_wakeup(u8 part, s16 inst, u16 cdoffs); |
19 | |||
20 | extern int omap4_cminst_wait_module_ready(u8 part, u16 inst, s16 cdoffs, u16 clkctrl_offs); | 19 | extern int omap4_cminst_wait_module_ready(u8 part, u16 inst, s16 cdoffs, u16 clkctrl_offs); |
21 | |||
22 | # ifdef CONFIG_ARCH_OMAP4 | ||
23 | extern int omap4_cminst_wait_module_idle(u8 part, u16 inst, s16 cdoffs, | 20 | extern int omap4_cminst_wait_module_idle(u8 part, u16 inst, s16 cdoffs, |
24 | u16 clkctrl_offs); | 21 | u16 clkctrl_offs); |
25 | |||
26 | extern void omap4_cminst_module_enable(u8 mode, u8 part, u16 inst, s16 cdoffs, | 22 | extern void omap4_cminst_module_enable(u8 mode, u8 part, u16 inst, s16 cdoffs, |
27 | u16 clkctrl_offs); | 23 | u16 clkctrl_offs); |
28 | extern void omap4_cminst_module_disable(u8 part, u16 inst, s16 cdoffs, | 24 | extern void omap4_cminst_module_disable(u8 part, u16 inst, s16 cdoffs, |
29 | u16 clkctrl_offs); | 25 | u16 clkctrl_offs); |
30 | |||
31 | # else | ||
32 | |||
33 | static inline int omap4_cminst_wait_module_idle(u8 part, u16 inst, s16 cdoffs, | ||
34 | u16 clkctrl_offs) | ||
35 | { | ||
36 | return 0; | ||
37 | } | ||
38 | |||
39 | static inline void omap4_cminst_module_enable(u8 mode, u8 part, u16 inst, | ||
40 | s16 cdoffs, u16 clkctrl_offs) | ||
41 | { | ||
42 | } | ||
43 | |||
44 | static inline void omap4_cminst_module_disable(u8 part, u16 inst, s16 cdoffs, | ||
45 | u16 clkctrl_offs) | ||
46 | { | ||
47 | } | ||
48 | |||
49 | # endif | ||
50 | |||
51 | /* | 26 | /* |
52 | * In an ideal world, we would not export these low-level functions, | 27 | * In an ideal world, we would not export these low-level functions, |
53 | * but this will probably take some time to fix properly | 28 | * but this will probably take some time to fix properly |
diff --git a/arch/arm/mach-omap2/control.h b/arch/arm/mach-omap2/control.h index 5baf305386e9..295b39047a71 100644 --- a/arch/arm/mach-omap2/control.h +++ b/arch/arm/mach-omap2/control.h | |||
@@ -188,6 +188,7 @@ | |||
188 | #define OMAP3630_CONTROL_FUSE_OPP120_VDD1 (OMAP2_CONTROL_GENERAL + 0x0120) | 188 | #define OMAP3630_CONTROL_FUSE_OPP120_VDD1 (OMAP2_CONTROL_GENERAL + 0x0120) |
189 | #define OMAP3630_CONTROL_FUSE_OPP50_VDD2 (OMAP2_CONTROL_GENERAL + 0x0128) | 189 | #define OMAP3630_CONTROL_FUSE_OPP50_VDD2 (OMAP2_CONTROL_GENERAL + 0x0128) |
190 | #define OMAP3630_CONTROL_FUSE_OPP100_VDD2 (OMAP2_CONTROL_GENERAL + 0x012C) | 190 | #define OMAP3630_CONTROL_FUSE_OPP100_VDD2 (OMAP2_CONTROL_GENERAL + 0x012C) |
191 | #define OMAP3630_CONTROL_CAMERA_PHY_CTRL (OMAP2_CONTROL_GENERAL + 0x02f0) | ||
191 | 192 | ||
192 | /* OMAP44xx control efuse offsets */ | 193 | /* OMAP44xx control efuse offsets */ |
193 | #define OMAP44XX_CONTROL_FUSE_IVA_OPP50 0x22C | 194 | #define OMAP44XX_CONTROL_FUSE_IVA_OPP50 0x22C |
diff --git a/arch/arm/mach-omap2/dpll3xxx.c b/arch/arm/mach-omap2/dpll3xxx.c index f0f10beeffe8..c310dc0d40b4 100644 --- a/arch/arm/mach-omap2/dpll3xxx.c +++ b/arch/arm/mach-omap2/dpll3xxx.c | |||
@@ -135,11 +135,20 @@ static u16 _omap3_dpll_compute_freqsel(struct clk *clk, u8 n) | |||
135 | */ | 135 | */ |
136 | static int _omap3_noncore_dpll_lock(struct clk *clk) | 136 | static int _omap3_noncore_dpll_lock(struct clk *clk) |
137 | { | 137 | { |
138 | const struct dpll_data *dd; | ||
138 | u8 ai; | 139 | u8 ai; |
139 | int r; | 140 | u8 state = 1; |
141 | int r = 0; | ||
140 | 142 | ||
141 | pr_debug("clock: locking DPLL %s\n", clk->name); | 143 | pr_debug("clock: locking DPLL %s\n", clk->name); |
142 | 144 | ||
145 | dd = clk->dpll_data; | ||
146 | state <<= __ffs(dd->idlest_mask); | ||
147 | |||
148 | /* Check if already locked */ | ||
149 | if ((__raw_readl(dd->idlest_reg) & dd->idlest_mask) == state) | ||
150 | goto done; | ||
151 | |||
143 | ai = omap3_dpll_autoidle_read(clk); | 152 | ai = omap3_dpll_autoidle_read(clk); |
144 | 153 | ||
145 | if (ai) | 154 | if (ai) |
@@ -152,6 +161,7 @@ static int _omap3_noncore_dpll_lock(struct clk *clk) | |||
152 | if (ai) | 161 | if (ai) |
153 | omap3_dpll_allow_idle(clk); | 162 | omap3_dpll_allow_idle(clk); |
154 | 163 | ||
164 | done: | ||
155 | return r; | 165 | return r; |
156 | } | 166 | } |
157 | 167 | ||
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c index f97f0624bca0..ebdf0016e536 100644 --- a/arch/arm/mach-omap2/omap_hwmod.c +++ b/arch/arm/mach-omap2/omap_hwmod.c | |||
@@ -416,6 +416,49 @@ static int _set_softreset(struct omap_hwmod *oh, u32 *v) | |||
416 | } | 416 | } |
417 | 417 | ||
418 | /** | 418 | /** |
419 | * _set_dmadisable: set OCP_SYSCONFIG.DMADISABLE bit in @v | ||
420 | * @oh: struct omap_hwmod * | ||
421 | * | ||
422 | * The DMADISABLE bit is a semi-automatic bit present in sysconfig register | ||
423 | * of some modules. When the DMA must perform read/write accesses, the | ||
424 | * DMADISABLE bit is cleared by the hardware. But when the DMA must stop | ||
425 | * for power management, software must set the DMADISABLE bit back to 1. | ||
426 | * | ||
427 | * Set the DMADISABLE bit in @v for hwmod @oh. Returns -EINVAL upon | ||
428 | * error or 0 upon success. | ||
429 | */ | ||
430 | static int _set_dmadisable(struct omap_hwmod *oh) | ||
431 | { | ||
432 | u32 v; | ||
433 | u32 dmadisable_mask; | ||
434 | |||
435 | if (!oh->class->sysc || | ||
436 | !(oh->class->sysc->sysc_flags & SYSC_HAS_DMADISABLE)) | ||
437 | return -EINVAL; | ||
438 | |||
439 | if (!oh->class->sysc->sysc_fields) { | ||
440 | WARN(1, "omap_hwmod: %s: offset struct for sysconfig not provided in class\n", oh->name); | ||
441 | return -EINVAL; | ||
442 | } | ||
443 | |||
444 | /* clocks must be on for this operation */ | ||
445 | if (oh->_state != _HWMOD_STATE_ENABLED) { | ||
446 | pr_warn("omap_hwmod: %s: dma can be disabled only from enabled state\n", oh->name); | ||
447 | return -EINVAL; | ||
448 | } | ||
449 | |||
450 | pr_debug("omap_hwmod: %s: setting DMADISABLE\n", oh->name); | ||
451 | |||
452 | v = oh->_sysc_cache; | ||
453 | dmadisable_mask = | ||
454 | (0x1 << oh->class->sysc->sysc_fields->dmadisable_shift); | ||
455 | v |= dmadisable_mask; | ||
456 | _write_sysconfig(v, oh); | ||
457 | |||
458 | return 0; | ||
459 | } | ||
460 | |||
461 | /** | ||
419 | * _set_module_autoidle: set the OCP_SYSCONFIG AUTOIDLE field in @v | 462 | * _set_module_autoidle: set the OCP_SYSCONFIG AUTOIDLE field in @v |
420 | * @oh: struct omap_hwmod * | 463 | * @oh: struct omap_hwmod * |
421 | * @autoidle: desired AUTOIDLE bitfield value (0 or 1) | 464 | * @autoidle: desired AUTOIDLE bitfield value (0 or 1) |
@@ -1652,11 +1695,17 @@ dis_opt_clks: | |||
1652 | * therefore have no OCP header registers to access. Others (like the | 1695 | * therefore have no OCP header registers to access. Others (like the |
1653 | * IVA) have idiosyncratic reset sequences. So for these relatively | 1696 | * IVA) have idiosyncratic reset sequences. So for these relatively |
1654 | * rare cases, custom reset code can be supplied in the struct | 1697 | * rare cases, custom reset code can be supplied in the struct |
1655 | * omap_hwmod_class .reset function pointer. Passes along the return | 1698 | * omap_hwmod_class .reset function pointer. |
1656 | * value from either _ocp_softreset() or the custom reset function - | 1699 | * |
1657 | * these must return -EINVAL if the hwmod cannot be reset this way or | 1700 | * _set_dmadisable() is called to set the DMADISABLE bit so that it |
1658 | * if the hwmod is in the wrong state, -ETIMEDOUT if the module did | 1701 | * does not prevent idling of the system. This is necessary for cases |
1659 | * not reset in time, or 0 upon success. | 1702 | * where ROMCODE/BOOTLOADER uses dma and transfers control to the |
1703 | * kernel without disabling dma. | ||
1704 | * | ||
1705 | * Passes along the return value from either _ocp_softreset() or the | ||
1706 | * custom reset function - these must return -EINVAL if the hwmod | ||
1707 | * cannot be reset this way or if the hwmod is in the wrong state, | ||
1708 | * -ETIMEDOUT if the module did not reset in time, or 0 upon success. | ||
1660 | */ | 1709 | */ |
1661 | static int _reset(struct omap_hwmod *oh) | 1710 | static int _reset(struct omap_hwmod *oh) |
1662 | { | 1711 | { |
@@ -1678,6 +1727,8 @@ static int _reset(struct omap_hwmod *oh) | |||
1678 | } | 1727 | } |
1679 | } | 1728 | } |
1680 | 1729 | ||
1730 | _set_dmadisable(oh); | ||
1731 | |||
1681 | /* | 1732 | /* |
1682 | * OCP_SYSCONFIG bits need to be reprogrammed after a | 1733 | * OCP_SYSCONFIG bits need to be reprogrammed after a |
1683 | * softreset. The _enable() function should be split to avoid | 1734 | * softreset. The _enable() function should be split to avoid |
diff --git a/arch/arm/mach-omap2/omap_hwmod_common_data.c b/arch/arm/mach-omap2/omap_hwmod_common_data.c index 51e5418899fb..9f1ccdc8cc8c 100644 --- a/arch/arm/mach-omap2/omap_hwmod_common_data.c +++ b/arch/arm/mach-omap2/omap_hwmod_common_data.c | |||
@@ -47,6 +47,16 @@ struct omap_hwmod_sysc_fields omap_hwmod_sysc_type2 = { | |||
47 | .midle_shift = SYSC_TYPE2_MIDLEMODE_SHIFT, | 47 | .midle_shift = SYSC_TYPE2_MIDLEMODE_SHIFT, |
48 | .sidle_shift = SYSC_TYPE2_SIDLEMODE_SHIFT, | 48 | .sidle_shift = SYSC_TYPE2_SIDLEMODE_SHIFT, |
49 | .srst_shift = SYSC_TYPE2_SOFTRESET_SHIFT, | 49 | .srst_shift = SYSC_TYPE2_SOFTRESET_SHIFT, |
50 | .dmadisable_shift = SYSC_TYPE2_DMADISABLE_SHIFT, | ||
51 | }; | ||
52 | |||
53 | /** | ||
54 | * struct omap_hwmod_sysc_type3 - TYPE3 sysconfig scheme. | ||
55 | * Used by some IPs on AM33xx | ||
56 | */ | ||
57 | struct omap_hwmod_sysc_fields omap_hwmod_sysc_type3 = { | ||
58 | .midle_shift = SYSC_TYPE3_MIDLEMODE_SHIFT, | ||
59 | .sidle_shift = SYSC_TYPE3_SIDLEMODE_SHIFT, | ||
50 | }; | 60 | }; |
51 | 61 | ||
52 | struct omap_dss_dispc_dev_attr omap2_3_dss_dispc_dev_attr = { | 62 | struct omap_dss_dispc_dev_attr omap2_3_dss_dispc_dev_attr = { |
diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c index 96114901b932..2f963f702a05 100644 --- a/arch/arm/mach-omap2/powerdomain.c +++ b/arch/arm/mach-omap2/powerdomain.c | |||
@@ -526,7 +526,8 @@ int pwrdm_read_next_pwrst(struct powerdomain *pwrdm) | |||
526 | * | 526 | * |
527 | * Return the powerdomain @pwrdm's current power state. Returns -EINVAL | 527 | * Return the powerdomain @pwrdm's current power state. Returns -EINVAL |
528 | * if the powerdomain pointer is null or returns the current power state | 528 | * if the powerdomain pointer is null or returns the current power state |
529 | * upon success. | 529 | * upon success. Note that if the power domain only supports the ON state |
530 | * then just return ON as the current state. | ||
530 | */ | 531 | */ |
531 | int pwrdm_read_pwrst(struct powerdomain *pwrdm) | 532 | int pwrdm_read_pwrst(struct powerdomain *pwrdm) |
532 | { | 533 | { |
@@ -535,6 +536,9 @@ int pwrdm_read_pwrst(struct powerdomain *pwrdm) | |||
535 | if (!pwrdm) | 536 | if (!pwrdm) |
536 | return -EINVAL; | 537 | return -EINVAL; |
537 | 538 | ||
539 | if (pwrdm->pwrsts == PWRSTS_ON) | ||
540 | return PWRDM_POWER_ON; | ||
541 | |||
538 | if (arch_pwrdm && arch_pwrdm->pwrdm_read_pwrst) | 542 | if (arch_pwrdm && arch_pwrdm->pwrdm_read_pwrst) |
539 | ret = arch_pwrdm->pwrdm_read_pwrst(pwrdm); | 543 | ret = arch_pwrdm->pwrdm_read_pwrst(pwrdm); |
540 | 544 | ||
diff --git a/arch/arm/mach-omap2/prcm.c b/arch/arm/mach-omap2/prcm.c index 480f40a5ee42..28cbfb2b5733 100644 --- a/arch/arm/mach-omap2/prcm.c +++ b/arch/arm/mach-omap2/prcm.c | |||
@@ -35,6 +35,7 @@ | |||
35 | #include "prm2xxx_3xxx.h" | 35 | #include "prm2xxx_3xxx.h" |
36 | #include "prm44xx.h" | 36 | #include "prm44xx.h" |
37 | #include "prminst44xx.h" | 37 | #include "prminst44xx.h" |
38 | #include "cminst44xx.h" | ||
38 | #include "prm-regbits-24xx.h" | 39 | #include "prm-regbits-24xx.h" |
39 | #include "prm-regbits-44xx.h" | 40 | #include "prm-regbits-44xx.h" |
40 | #include "control.h" | 41 | #include "control.h" |
@@ -164,3 +165,25 @@ void __init omap2_set_globals_prcm(struct omap_globals *omap2_globals) | |||
164 | omap_cm_base_init(); | 165 | omap_cm_base_init(); |
165 | } | 166 | } |
166 | } | 167 | } |
168 | |||
169 | /* | ||
170 | * Stubbed functions so that common files continue to build when | ||
171 | * custom builds are used | ||
172 | * XXX These are temporary and should be removed at the earliest possible | ||
173 | * opportunity | ||
174 | */ | ||
175 | int __weak omap4_cminst_wait_module_idle(u8 part, u16 inst, s16 cdoffs, | ||
176 | u16 clkctrl_offs) | ||
177 | { | ||
178 | return 0; | ||
179 | } | ||
180 | |||
181 | void __weak omap4_cminst_module_enable(u8 mode, u8 part, u16 inst, | ||
182 | s16 cdoffs, u16 clkctrl_offs) | ||
183 | { | ||
184 | } | ||
185 | |||
186 | void __weak omap4_cminst_module_disable(u8 part, u16 inst, s16 cdoffs, | ||
187 | u16 clkctrl_offs) | ||
188 | { | ||
189 | } | ||
diff --git a/arch/arm/mach-omap2/prm2xxx_3xxx.h b/arch/arm/mach-omap2/prm2xxx_3xxx.h index 70ac2a19dc5f..f7bb57fff416 100644 --- a/arch/arm/mach-omap2/prm2xxx_3xxx.h +++ b/arch/arm/mach-omap2/prm2xxx_3xxx.h | |||
@@ -228,68 +228,6 @@ | |||
228 | 228 | ||
229 | 229 | ||
230 | #ifndef __ASSEMBLER__ | 230 | #ifndef __ASSEMBLER__ |
231 | /* | ||
232 | * Stub omap2xxx/omap3xxx functions so that common files | ||
233 | * continue to build when custom builds are used | ||
234 | */ | ||
235 | #if defined(CONFIG_ARCH_OMAP4) && !(defined(CONFIG_ARCH_OMAP2) || \ | ||
236 | defined(CONFIG_ARCH_OMAP3)) | ||
237 | static inline u32 omap2_prm_read_mod_reg(s16 module, u16 idx) | ||
238 | { | ||
239 | WARN(1, "prm: omap2xxx/omap3xxx specific function and " | ||
240 | "not suppose to be used on omap4\n"); | ||
241 | return 0; | ||
242 | } | ||
243 | static inline void omap2_prm_write_mod_reg(u32 val, s16 module, u16 idx) | ||
244 | { | ||
245 | WARN(1, "prm: omap2xxx/omap3xxx specific function and " | ||
246 | "not suppose to be used on omap4\n"); | ||
247 | } | ||
248 | static inline u32 omap2_prm_rmw_mod_reg_bits(u32 mask, u32 bits, | ||
249 | s16 module, s16 idx) | ||
250 | { | ||
251 | WARN(1, "prm: omap2xxx/omap3xxx specific function and " | ||
252 | "not suppose to be used on omap4\n"); | ||
253 | return 0; | ||
254 | } | ||
255 | static inline u32 omap2_prm_set_mod_reg_bits(u32 bits, s16 module, s16 idx) | ||
256 | { | ||
257 | WARN(1, "prm: omap2xxx/omap3xxx specific function and " | ||
258 | "not suppose to be used on omap4\n"); | ||
259 | return 0; | ||
260 | } | ||
261 | static inline u32 omap2_prm_clear_mod_reg_bits(u32 bits, s16 module, s16 idx) | ||
262 | { | ||
263 | WARN(1, "prm: omap2xxx/omap3xxx specific function and " | ||
264 | "not suppose to be used on omap4\n"); | ||
265 | return 0; | ||
266 | } | ||
267 | static inline u32 omap2_prm_read_mod_bits_shift(s16 domain, s16 idx, u32 mask) | ||
268 | { | ||
269 | WARN(1, "prm: omap2xxx/omap3xxx specific function and " | ||
270 | "not suppose to be used on omap4\n"); | ||
271 | return 0; | ||
272 | } | ||
273 | static inline int omap2_prm_is_hardreset_asserted(s16 prm_mod, u8 shift) | ||
274 | { | ||
275 | WARN(1, "prm: omap2xxx/omap3xxx specific function and " | ||
276 | "not suppose to be used on omap4\n"); | ||
277 | return 0; | ||
278 | } | ||
279 | static inline int omap2_prm_assert_hardreset(s16 prm_mod, u8 shift) | ||
280 | { | ||
281 | WARN(1, "prm: omap2xxx/omap3xxx specific function and " | ||
282 | "not suppose to be used on omap4\n"); | ||
283 | return 0; | ||
284 | } | ||
285 | static inline int omap2_prm_deassert_hardreset(s16 prm_mod, u8 rst_shift, | ||
286 | u8 st_shift) | ||
287 | { | ||
288 | WARN(1, "prm: omap2xxx/omap3xxx specific function and " | ||
289 | "not suppose to be used on omap4\n"); | ||
290 | return 0; | ||
291 | } | ||
292 | #else | ||
293 | /* Power/reset management domain register get/set */ | 231 | /* Power/reset management domain register get/set */ |
294 | extern u32 omap2_prm_read_mod_reg(s16 module, u16 idx); | 232 | extern u32 omap2_prm_read_mod_reg(s16 module, u16 idx); |
295 | extern void omap2_prm_write_mod_reg(u32 val, s16 module, u16 idx); | 233 | extern void omap2_prm_write_mod_reg(u32 val, s16 module, u16 idx); |
@@ -320,9 +258,6 @@ extern void omap3xxx_prm_read_pending_irqs(unsigned long *events); | |||
320 | extern void omap3xxx_prm_ocp_barrier(void); | 258 | extern void omap3xxx_prm_ocp_barrier(void); |
321 | extern void omap3xxx_prm_save_and_clear_irqen(u32 *saved_mask); | 259 | extern void omap3xxx_prm_save_and_clear_irqen(u32 *saved_mask); |
322 | extern void omap3xxx_prm_restore_irqen(u32 *saved_mask); | 260 | extern void omap3xxx_prm_restore_irqen(u32 *saved_mask); |
323 | |||
324 | #endif /* CONFIG_ARCH_OMAP4 */ | ||
325 | |||
326 | #endif | 261 | #endif |
327 | 262 | ||
328 | /* | 263 | /* |
diff --git a/arch/arm/mach-omap2/prm_common.c b/arch/arm/mach-omap2/prm_common.c index dfe00ddb5c60..663ade3b2f45 100644 --- a/arch/arm/mach-omap2/prm_common.c +++ b/arch/arm/mach-omap2/prm_common.c | |||
@@ -319,3 +319,65 @@ err: | |||
319 | omap_prcm_irq_cleanup(); | 319 | omap_prcm_irq_cleanup(); |
320 | return -ENOMEM; | 320 | return -ENOMEM; |
321 | } | 321 | } |
322 | |||
323 | /* | ||
324 | * Stubbed functions so that common files continue to build when | ||
325 | * custom builds are used | ||
326 | * XXX These are temporary and should be removed at the earliest possible | ||
327 | * opportunity | ||
328 | */ | ||
329 | u32 __weak omap2_prm_read_mod_reg(s16 module, u16 idx) | ||
330 | { | ||
331 | WARN(1, "prm: omap2xxx/omap3xxx specific function called on non-omap2xxx/3xxx\n"); | ||
332 | return 0; | ||
333 | } | ||
334 | |||
335 | void __weak omap2_prm_write_mod_reg(u32 val, s16 module, u16 idx) | ||
336 | { | ||
337 | WARN(1, "prm: omap2xxx/omap3xxx specific function called on non-omap2xxx/3xxx\n"); | ||
338 | } | ||
339 | |||
340 | u32 __weak omap2_prm_rmw_mod_reg_bits(u32 mask, u32 bits, | ||
341 | s16 module, s16 idx) | ||
342 | { | ||
343 | WARN(1, "prm: omap2xxx/omap3xxx specific function called on non-omap2xxx/3xxx\n"); | ||
344 | return 0; | ||
345 | } | ||
346 | |||
347 | u32 __weak omap2_prm_set_mod_reg_bits(u32 bits, s16 module, s16 idx) | ||
348 | { | ||
349 | WARN(1, "prm: omap2xxx/omap3xxx specific function called on non-omap2xxx/3xxx\n"); | ||
350 | return 0; | ||
351 | } | ||
352 | |||
353 | u32 __weak omap2_prm_clear_mod_reg_bits(u32 bits, s16 module, s16 idx) | ||
354 | { | ||
355 | WARN(1, "prm: omap2xxx/omap3xxx specific function called on non-omap2xxx/3xxx\n"); | ||
356 | return 0; | ||
357 | } | ||
358 | |||
359 | u32 __weak omap2_prm_read_mod_bits_shift(s16 domain, s16 idx, u32 mask) | ||
360 | { | ||
361 | WARN(1, "prm: omap2xxx/omap3xxx specific function called on non-omap2xxx/3xxx\n"); | ||
362 | return 0; | ||
363 | } | ||
364 | |||
365 | int __weak omap2_prm_is_hardreset_asserted(s16 prm_mod, u8 shift) | ||
366 | { | ||
367 | WARN(1, "prm: omap2xxx/omap3xxx specific function called on non-omap2xxx/3xxx\n"); | ||
368 | return 0; | ||
369 | } | ||
370 | |||
371 | int __weak omap2_prm_assert_hardreset(s16 prm_mod, u8 shift) | ||
372 | { | ||
373 | WARN(1, "prm: omap2xxx/omap3xxx specific function called on non-omap2xxx/3xxx\n"); | ||
374 | return 0; | ||
375 | } | ||
376 | |||
377 | int __weak omap2_prm_deassert_hardreset(s16 prm_mod, u8 rst_shift, | ||
378 | u8 st_shift) | ||
379 | { | ||
380 | WARN(1, "prm: omap2xxx/omap3xxx specific function called on non-omap2xxx/3xxx\n"); | ||
381 | return 0; | ||
382 | } | ||
383 | |||
diff --git a/arch/arm/plat-omap/include/plat/omap_hwmod.h b/arch/arm/plat-omap/include/plat/omap_hwmod.h index a8ecc53b3670..30f55eb8b0bc 100644 --- a/arch/arm/plat-omap/include/plat/omap_hwmod.h +++ b/arch/arm/plat-omap/include/plat/omap_hwmod.h | |||
@@ -41,6 +41,7 @@ struct omap_device; | |||
41 | 41 | ||
42 | extern struct omap_hwmod_sysc_fields omap_hwmod_sysc_type1; | 42 | extern struct omap_hwmod_sysc_fields omap_hwmod_sysc_type1; |
43 | extern struct omap_hwmod_sysc_fields omap_hwmod_sysc_type2; | 43 | extern struct omap_hwmod_sysc_fields omap_hwmod_sysc_type2; |
44 | extern struct omap_hwmod_sysc_fields omap_hwmod_sysc_type3; | ||
44 | 45 | ||
45 | /* | 46 | /* |
46 | * OCP SYSCONFIG bit shifts/masks TYPE1. These are for IPs compliant | 47 | * OCP SYSCONFIG bit shifts/masks TYPE1. These are for IPs compliant |
@@ -69,6 +70,17 @@ extern struct omap_hwmod_sysc_fields omap_hwmod_sysc_type2; | |||
69 | #define SYSC_TYPE2_SIDLEMODE_MASK (0x3 << SYSC_TYPE2_SIDLEMODE_SHIFT) | 70 | #define SYSC_TYPE2_SIDLEMODE_MASK (0x3 << SYSC_TYPE2_SIDLEMODE_SHIFT) |
70 | #define SYSC_TYPE2_MIDLEMODE_SHIFT 4 | 71 | #define SYSC_TYPE2_MIDLEMODE_SHIFT 4 |
71 | #define SYSC_TYPE2_MIDLEMODE_MASK (0x3 << SYSC_TYPE2_MIDLEMODE_SHIFT) | 72 | #define SYSC_TYPE2_MIDLEMODE_MASK (0x3 << SYSC_TYPE2_MIDLEMODE_SHIFT) |
73 | #define SYSC_TYPE2_DMADISABLE_SHIFT 16 | ||
74 | #define SYSC_TYPE2_DMADISABLE_MASK (0x1 << SYSC_TYPE2_DMADISABLE_SHIFT) | ||
75 | |||
76 | /* | ||
77 | * OCP SYSCONFIG bit shifts/masks TYPE3. | ||
78 | * This is applicable for some IPs present in AM33XX | ||
79 | */ | ||
80 | #define SYSC_TYPE3_SIDLEMODE_SHIFT 0 | ||
81 | #define SYSC_TYPE3_SIDLEMODE_MASK (0x3 << SYSC_TYPE3_SIDLEMODE_SHIFT) | ||
82 | #define SYSC_TYPE3_MIDLEMODE_SHIFT 2 | ||
83 | #define SYSC_TYPE3_MIDLEMODE_MASK (0x3 << SYSC_TYPE3_MIDLEMODE_SHIFT) | ||
72 | 84 | ||
73 | /* OCP SYSSTATUS bit shifts/masks */ | 85 | /* OCP SYSSTATUS bit shifts/masks */ |
74 | #define SYSS_RESETDONE_SHIFT 0 | 86 | #define SYSS_RESETDONE_SHIFT 0 |
@@ -283,6 +295,7 @@ struct omap_hwmod_ocp_if { | |||
283 | #define SYSS_HAS_RESET_STATUS (1 << 7) | 295 | #define SYSS_HAS_RESET_STATUS (1 << 7) |
284 | #define SYSC_NO_CACHE (1 << 8) /* XXX SW flag, belongs elsewhere */ | 296 | #define SYSC_NO_CACHE (1 << 8) /* XXX SW flag, belongs elsewhere */ |
285 | #define SYSC_HAS_RESET_STATUS (1 << 9) | 297 | #define SYSC_HAS_RESET_STATUS (1 << 9) |
298 | #define SYSC_HAS_DMADISABLE (1 << 10) | ||
286 | 299 | ||
287 | /* omap_hwmod_sysconfig.clockact flags */ | 300 | /* omap_hwmod_sysconfig.clockact flags */ |
288 | #define CLOCKACT_TEST_BOTH 0x0 | 301 | #define CLOCKACT_TEST_BOTH 0x0 |
@@ -298,6 +311,7 @@ struct omap_hwmod_ocp_if { | |||
298 | * @enwkup_shift: Offset of the enawakeup bit | 311 | * @enwkup_shift: Offset of the enawakeup bit |
299 | * @srst_shift: Offset of the softreset bit | 312 | * @srst_shift: Offset of the softreset bit |
300 | * @autoidle_shift: Offset of the autoidle bit | 313 | * @autoidle_shift: Offset of the autoidle bit |
314 | * @dmadisable_shift: Offset of the dmadisable bit | ||
301 | */ | 315 | */ |
302 | struct omap_hwmod_sysc_fields { | 316 | struct omap_hwmod_sysc_fields { |
303 | u8 midle_shift; | 317 | u8 midle_shift; |
@@ -306,6 +320,7 @@ struct omap_hwmod_sysc_fields { | |||
306 | u8 enwkup_shift; | 320 | u8 enwkup_shift; |
307 | u8 srst_shift; | 321 | u8 srst_shift; |
308 | u8 autoidle_shift; | 322 | u8 autoidle_shift; |
323 | u8 dmadisable_shift; | ||
309 | }; | 324 | }; |
310 | 325 | ||
311 | /** | 326 | /** |
@@ -374,11 +389,13 @@ struct omap_hwmod_omap2_prcm { | |||
374 | * struct omap_hwmod_omap4_prcm - OMAP4-specific PRCM data | 389 | * struct omap_hwmod_omap4_prcm - OMAP4-specific PRCM data |
375 | * @clkctrl_reg: PRCM address of the clock control register | 390 | * @clkctrl_reg: PRCM address of the clock control register |
376 | * @rstctrl_reg: address of the XXX_RSTCTRL register located in the PRM | 391 | * @rstctrl_reg: address of the XXX_RSTCTRL register located in the PRM |
392 | * @rstst_reg: (AM33XX only) address of the XXX_RSTST register in the PRM | ||
377 | * @submodule_wkdep_bit: bit shift of the WKDEP range | 393 | * @submodule_wkdep_bit: bit shift of the WKDEP range |
378 | */ | 394 | */ |
379 | struct omap_hwmod_omap4_prcm { | 395 | struct omap_hwmod_omap4_prcm { |
380 | u16 clkctrl_offs; | 396 | u16 clkctrl_offs; |
381 | u16 rstctrl_offs; | 397 | u16 rstctrl_offs; |
398 | u16 rstst_offs; | ||
382 | u16 context_offs; | 399 | u16 context_offs; |
383 | u8 submodule_wkdep_bit; | 400 | u8 submodule_wkdep_bit; |
384 | u8 modulemode; | 401 | u8 modulemode; |