diff options
author | Olof Johansson <olof@lixom.net> | 2013-02-12 18:33:39 -0500 |
---|---|---|
committer | Olof Johansson <olof@lixom.net> | 2013-02-12 18:33:39 -0500 |
commit | ebcfe0faf969fe64060132a455db64bcc3517e5c (patch) | |
tree | fadeb32f8820bfa53a5a37f967bf0d58aafeb82f /arch/arm/mach-omap2 | |
parent | 488c77c961e65894d864af4da720a880a5fbb066 (diff) | |
parent | 93b23711b7132400d4d76f31c660d27a2bb0afdb (diff) |
Merge tag 'omap-for-v3.9/pm-omap4-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into late/omap
From Tony Lindgren:
omap4 pm changes via Paul Walmsley <paul@pwsan.com>:
Some OMAP4 power management fixes and audio device integration
patches. This pull request contains a fix for an issue discovered during
branch integration.
Basic test logs are available at:
http://www.pwsan.com/omap/testlogs/omap4_prcm_devel_a_3.9/20130210112717/
* tag 'omap-for-v3.9/pm-omap4-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap:
ARM: OMAP4: hwmod data: Enable AESS hwmod device
ARM: OMAP4: hwmod data: Update AESS data with memory bank area
ARM: OMAP4+: AESS: enable internal auto-gating during initial setup
ASoC: TI AESS: add autogating-enable function, callable from architecture code
ARM: OMAP2+: hwmod: add enable_preprogram hook
ARM: OMAP2+: PM: Fix the dt return condition in pm_late_init()
ARM: OMAP4: PM: Warn users about usage of older bootloaders
Diffstat (limited to 'arch/arm/mach-omap2')
-rw-r--r-- | arch/arm/mach-omap2/Makefile | 2 | ||||
-rw-r--r-- | arch/arm/mach-omap2/omap_hwmod.c | 18 | ||||
-rw-r--r-- | arch/arm/mach-omap2/omap_hwmod.h | 8 | ||||
-rw-r--r-- | arch/arm/mach-omap2/omap_hwmod_44xx_data.c | 51 | ||||
-rw-r--r-- | arch/arm/mach-omap2/omap_hwmod_reset.c | 52 | ||||
-rw-r--r-- | arch/arm/mach-omap2/pm.c | 20 | ||||
-rw-r--r-- | arch/arm/mach-omap2/pm44xx.c | 21 |
7 files changed, 155 insertions, 17 deletions
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile index d1156cfa9745..9a14ae527319 100644 --- a/arch/arm/mach-omap2/Makefile +++ b/arch/arm/mach-omap2/Makefile | |||
@@ -8,7 +8,7 @@ obj-y := id.o io.o control.o mux.o devices.o fb.o serial.o gpmc.o timer.o pm.o \ | |||
8 | omap_device.o sram.o | 8 | omap_device.o sram.o |
9 | 9 | ||
10 | omap-2-3-common = irq.o | 10 | omap-2-3-common = irq.o |
11 | hwmod-common = omap_hwmod.o \ | 11 | hwmod-common = omap_hwmod.o omap_hwmod_reset.o \ |
12 | omap_hwmod_common_data.o | 12 | omap_hwmod_common_data.o |
13 | clock-common = clock.o clock_common_data.o \ | 13 | clock-common = clock.o clock_common_data.o \ |
14 | clkt_dpll.o clkt_clksel.o | 14 | clkt_dpll.o clkt_clksel.o |
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c index 30657b7c3e33..ffe7a69cd17f 100644 --- a/arch/arm/mach-omap2/omap_hwmod.c +++ b/arch/arm/mach-omap2/omap_hwmod.c | |||
@@ -2055,6 +2055,23 @@ static int _omap4_get_context_lost(struct omap_hwmod *oh) | |||
2055 | } | 2055 | } |
2056 | 2056 | ||
2057 | /** | 2057 | /** |
2058 | * _enable_preprogram - Pre-program an IP block during the _enable() process | ||
2059 | * @oh: struct omap_hwmod * | ||
2060 | * | ||
2061 | * Some IP blocks (such as AESS) require some additional programming | ||
2062 | * after enable before they can enter idle. If a function pointer to | ||
2063 | * do so is present in the hwmod data, then call it and pass along the | ||
2064 | * return value; otherwise, return 0. | ||
2065 | */ | ||
2066 | static int __init _enable_preprogram(struct omap_hwmod *oh) | ||
2067 | { | ||
2068 | if (!oh->class->enable_preprogram) | ||
2069 | return 0; | ||
2070 | |||
2071 | return oh->class->enable_preprogram(oh); | ||
2072 | } | ||
2073 | |||
2074 | /** | ||
2058 | * _enable - enable an omap_hwmod | 2075 | * _enable - enable an omap_hwmod |
2059 | * @oh: struct omap_hwmod * | 2076 | * @oh: struct omap_hwmod * |
2060 | * | 2077 | * |
@@ -2160,6 +2177,7 @@ static int _enable(struct omap_hwmod *oh) | |||
2160 | _update_sysc_cache(oh); | 2177 | _update_sysc_cache(oh); |
2161 | _enable_sysc(oh); | 2178 | _enable_sysc(oh); |
2162 | } | 2179 | } |
2180 | r = _enable_preprogram(oh); | ||
2163 | } else { | 2181 | } else { |
2164 | if (soc_ops.disable_module) | 2182 | if (soc_ops.disable_module) |
2165 | soc_ops.disable_module(oh); | 2183 | soc_ops.disable_module(oh); |
diff --git a/arch/arm/mach-omap2/omap_hwmod.h b/arch/arm/mach-omap2/omap_hwmod.h index 80c00e706d69..d43d9b608eda 100644 --- a/arch/arm/mach-omap2/omap_hwmod.h +++ b/arch/arm/mach-omap2/omap_hwmod.h | |||
@@ -510,6 +510,7 @@ struct omap_hwmod_omap4_prcm { | |||
510 | * @rev: revision of the IP class | 510 | * @rev: revision of the IP class |
511 | * @pre_shutdown: ptr to fn to be executed immediately prior to device shutdown | 511 | * @pre_shutdown: ptr to fn to be executed immediately prior to device shutdown |
512 | * @reset: ptr to fn to be executed in place of the standard hwmod reset fn | 512 | * @reset: ptr to fn to be executed in place of the standard hwmod reset fn |
513 | * @enable_preprogram: ptr to fn to be executed during device enable | ||
513 | * | 514 | * |
514 | * Represent the class of a OMAP hardware "modules" (e.g. timer, | 515 | * Represent the class of a OMAP hardware "modules" (e.g. timer, |
515 | * smartreflex, gpio, uart...) | 516 | * smartreflex, gpio, uart...) |
@@ -533,6 +534,7 @@ struct omap_hwmod_class { | |||
533 | u32 rev; | 534 | u32 rev; |
534 | int (*pre_shutdown)(struct omap_hwmod *oh); | 535 | int (*pre_shutdown)(struct omap_hwmod *oh); |
535 | int (*reset)(struct omap_hwmod *oh); | 536 | int (*reset)(struct omap_hwmod *oh); |
537 | int (*enable_preprogram)(struct omap_hwmod *oh); | ||
536 | }; | 538 | }; |
537 | 539 | ||
538 | /** | 540 | /** |
@@ -680,6 +682,12 @@ extern void __init omap_hwmod_init(void); | |||
680 | const char *omap_hwmod_get_main_clk(struct omap_hwmod *oh); | 682 | const char *omap_hwmod_get_main_clk(struct omap_hwmod *oh); |
681 | 683 | ||
682 | /* | 684 | /* |
685 | * | ||
686 | */ | ||
687 | |||
688 | extern int omap_hwmod_aess_preprogram(struct omap_hwmod *oh); | ||
689 | |||
690 | /* | ||
683 | * Chip variant-specific hwmod init routines - XXX should be converted | 691 | * Chip variant-specific hwmod init routines - XXX should be converted |
684 | * to use initcalls once the initial boot ordering is straightened out | 692 | * to use initcalls once the initial boot ordering is straightened out |
685 | */ | 693 | */ |
diff --git a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c index a1849a883702..1e2993883b4f 100644 --- a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c +++ b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c | |||
@@ -322,6 +322,7 @@ static struct omap_hwmod_class_sysconfig omap44xx_aess_sysc = { | |||
322 | static struct omap_hwmod_class omap44xx_aess_hwmod_class = { | 322 | static struct omap_hwmod_class omap44xx_aess_hwmod_class = { |
323 | .name = "aess", | 323 | .name = "aess", |
324 | .sysc = &omap44xx_aess_sysc, | 324 | .sysc = &omap44xx_aess_sysc, |
325 | .enable_preprogram = omap_hwmod_aess_preprogram, | ||
325 | }; | 326 | }; |
326 | 327 | ||
327 | /* aess */ | 328 | /* aess */ |
@@ -348,7 +349,7 @@ static struct omap_hwmod omap44xx_aess_hwmod = { | |||
348 | .clkdm_name = "abe_clkdm", | 349 | .clkdm_name = "abe_clkdm", |
349 | .mpu_irqs = omap44xx_aess_irqs, | 350 | .mpu_irqs = omap44xx_aess_irqs, |
350 | .sdma_reqs = omap44xx_aess_sdma_reqs, | 351 | .sdma_reqs = omap44xx_aess_sdma_reqs, |
351 | .main_clk = "aess_fck", | 352 | .main_clk = "aess_fclk", |
352 | .prcm = { | 353 | .prcm = { |
353 | .omap4 = { | 354 | .omap4 = { |
354 | .clkctrl_offs = OMAP4_CM1_ABE_AESS_CLKCTRL_OFFSET, | 355 | .clkctrl_offs = OMAP4_CM1_ABE_AESS_CLKCTRL_OFFSET, |
@@ -4248,6 +4249,27 @@ static struct omap_hwmod_ocp_if omap44xx_l4_cfg__ocp_wp_noc = { | |||
4248 | 4249 | ||
4249 | static struct omap_hwmod_addr_space omap44xx_aess_addrs[] = { | 4250 | static struct omap_hwmod_addr_space omap44xx_aess_addrs[] = { |
4250 | { | 4251 | { |
4252 | .name = "dmem", | ||
4253 | .pa_start = 0x40180000, | ||
4254 | .pa_end = 0x4018ffff | ||
4255 | }, | ||
4256 | { | ||
4257 | .name = "cmem", | ||
4258 | .pa_start = 0x401a0000, | ||
4259 | .pa_end = 0x401a1fff | ||
4260 | }, | ||
4261 | { | ||
4262 | .name = "smem", | ||
4263 | .pa_start = 0x401c0000, | ||
4264 | .pa_end = 0x401c5fff | ||
4265 | }, | ||
4266 | { | ||
4267 | .name = "pmem", | ||
4268 | .pa_start = 0x401e0000, | ||
4269 | .pa_end = 0x401e1fff | ||
4270 | }, | ||
4271 | { | ||
4272 | .name = "mpu", | ||
4251 | .pa_start = 0x401f1000, | 4273 | .pa_start = 0x401f1000, |
4252 | .pa_end = 0x401f13ff, | 4274 | .pa_end = 0x401f13ff, |
4253 | .flags = ADDR_TYPE_RT | 4275 | .flags = ADDR_TYPE_RT |
@@ -4266,6 +4288,27 @@ static struct omap_hwmod_ocp_if __maybe_unused omap44xx_l4_abe__aess = { | |||
4266 | 4288 | ||
4267 | static struct omap_hwmod_addr_space omap44xx_aess_dma_addrs[] = { | 4289 | static struct omap_hwmod_addr_space omap44xx_aess_dma_addrs[] = { |
4268 | { | 4290 | { |
4291 | .name = "dmem_dma", | ||
4292 | .pa_start = 0x49080000, | ||
4293 | .pa_end = 0x4908ffff | ||
4294 | }, | ||
4295 | { | ||
4296 | .name = "cmem_dma", | ||
4297 | .pa_start = 0x490a0000, | ||
4298 | .pa_end = 0x490a1fff | ||
4299 | }, | ||
4300 | { | ||
4301 | .name = "smem_dma", | ||
4302 | .pa_start = 0x490c0000, | ||
4303 | .pa_end = 0x490c5fff | ||
4304 | }, | ||
4305 | { | ||
4306 | .name = "pmem_dma", | ||
4307 | .pa_start = 0x490e0000, | ||
4308 | .pa_end = 0x490e1fff | ||
4309 | }, | ||
4310 | { | ||
4311 | .name = "dma", | ||
4269 | .pa_start = 0x490f1000, | 4312 | .pa_start = 0x490f1000, |
4270 | .pa_end = 0x490f13ff, | 4313 | .pa_end = 0x490f13ff, |
4271 | .flags = ADDR_TYPE_RT | 4314 | .flags = ADDR_TYPE_RT |
@@ -6281,7 +6324,7 @@ static struct omap_hwmod_ocp_if *omap44xx_hwmod_ocp_ifs[] __initdata = { | |||
6281 | &omap44xx_l3_main_1__l3_main_3, | 6324 | &omap44xx_l3_main_1__l3_main_3, |
6282 | &omap44xx_l3_main_2__l3_main_3, | 6325 | &omap44xx_l3_main_2__l3_main_3, |
6283 | &omap44xx_l4_cfg__l3_main_3, | 6326 | &omap44xx_l4_cfg__l3_main_3, |
6284 | /* &omap44xx_aess__l4_abe, */ | 6327 | &omap44xx_aess__l4_abe, |
6285 | &omap44xx_dsp__l4_abe, | 6328 | &omap44xx_dsp__l4_abe, |
6286 | &omap44xx_l3_main_1__l4_abe, | 6329 | &omap44xx_l3_main_1__l4_abe, |
6287 | &omap44xx_mpu__l4_abe, | 6330 | &omap44xx_mpu__l4_abe, |
@@ -6290,8 +6333,8 @@ static struct omap_hwmod_ocp_if *omap44xx_hwmod_ocp_ifs[] __initdata = { | |||
6290 | &omap44xx_l4_cfg__l4_wkup, | 6333 | &omap44xx_l4_cfg__l4_wkup, |
6291 | &omap44xx_mpu__mpu_private, | 6334 | &omap44xx_mpu__mpu_private, |
6292 | &omap44xx_l4_cfg__ocp_wp_noc, | 6335 | &omap44xx_l4_cfg__ocp_wp_noc, |
6293 | /* &omap44xx_l4_abe__aess, */ | 6336 | &omap44xx_l4_abe__aess, |
6294 | /* &omap44xx_l4_abe__aess_dma, */ | 6337 | &omap44xx_l4_abe__aess_dma, |
6295 | &omap44xx_l3_main_2__c2c, | 6338 | &omap44xx_l3_main_2__c2c, |
6296 | &omap44xx_l4_wkup__counter_32k, | 6339 | &omap44xx_l4_wkup__counter_32k, |
6297 | &omap44xx_l4_cfg__ctrl_module_core, | 6340 | &omap44xx_l4_cfg__ctrl_module_core, |
diff --git a/arch/arm/mach-omap2/omap_hwmod_reset.c b/arch/arm/mach-omap2/omap_hwmod_reset.c new file mode 100644 index 000000000000..bba43fa627d3 --- /dev/null +++ b/arch/arm/mach-omap2/omap_hwmod_reset.c | |||
@@ -0,0 +1,52 @@ | |||
1 | /* | ||
2 | * OMAP IP block custom reset and preprogramming stubs | ||
3 | * | ||
4 | * Copyright (C) 2012 Texas Instruments, Inc. | ||
5 | * Paul Walmsley | ||
6 | * | ||
7 | * A small number of IP blocks need custom reset and preprogramming | ||
8 | * functions. The stubs in this file provide a standard way for the | ||
9 | * hwmod code to call these functions, which are to be located under | ||
10 | * drivers/. | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License as | ||
14 | * published by the Free Software Foundation version 2. | ||
15 | * | ||
16 | * This program is distributed "as is" WITHOUT ANY WARRANTY of any | ||
17 | * kind, whether express or implied; without even the implied warranty | ||
18 | * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
19 | * GNU General Public License for more details. | ||
20 | * | ||
21 | * You should have received a copy of the GNU General Public License | ||
22 | * along with this program; if not, write to the Free Software | ||
23 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
24 | * 02110-1301 USA | ||
25 | */ | ||
26 | #include <linux/kernel.h> | ||
27 | |||
28 | #include <sound/aess.h> | ||
29 | |||
30 | #include "omap_hwmod.h" | ||
31 | |||
32 | /** | ||
33 | * omap_hwmod_aess_preprogram - enable AESS internal autogating | ||
34 | * @oh: struct omap_hwmod * | ||
35 | * | ||
36 | * The AESS will not IdleAck to the PRCM until its internal autogating | ||
37 | * is enabled. Since internal autogating is disabled by default after | ||
38 | * AESS reset, we must enable autogating after the hwmod code resets | ||
39 | * the AESS. Returns 0. | ||
40 | */ | ||
41 | int omap_hwmod_aess_preprogram(struct omap_hwmod *oh) | ||
42 | { | ||
43 | void __iomem *va; | ||
44 | |||
45 | va = omap_hwmod_get_mpu_rt_va(oh); | ||
46 | if (!va) | ||
47 | return -EINVAL; | ||
48 | |||
49 | aess_enable_autogating(va); | ||
50 | |||
51 | return 0; | ||
52 | } | ||
diff --git a/arch/arm/mach-omap2/pm.c b/arch/arm/mach-omap2/pm.c index 9a9be3c9f208..8d5e6e6b14ad 100644 --- a/arch/arm/mach-omap2/pm.c +++ b/arch/arm/mach-omap2/pm.c | |||
@@ -282,19 +282,19 @@ int __init omap2_common_pm_late_init(void) | |||
282 | * a completely different mechanism. | 282 | * a completely different mechanism. |
283 | * Disable this part if a DT blob is available. | 283 | * Disable this part if a DT blob is available. |
284 | */ | 284 | */ |
285 | if (of_have_populated_dt()) | 285 | if (!of_have_populated_dt()) { |
286 | return 0; | ||
287 | 286 | ||
288 | /* Init the voltage layer */ | 287 | /* Init the voltage layer */ |
289 | omap_pmic_late_init(); | 288 | omap_pmic_late_init(); |
290 | omap_voltage_late_init(); | 289 | omap_voltage_late_init(); |
291 | 290 | ||
292 | /* Initialize the voltages */ | 291 | /* Initialize the voltages */ |
293 | omap3_init_voltages(); | 292 | omap3_init_voltages(); |
294 | omap4_init_voltages(); | 293 | omap4_init_voltages(); |
295 | 294 | ||
296 | /* Smartreflex device init */ | 295 | /* Smartreflex device init */ |
297 | omap_devinit_smartreflex(); | 296 | omap_devinit_smartreflex(); |
297 | } | ||
298 | 298 | ||
299 | #ifdef CONFIG_SUSPEND | 299 | #ifdef CONFIG_SUSPEND |
300 | suspend_set_ops(&omap_pm_ops); | 300 | suspend_set_ops(&omap_pm_ops); |
diff --git a/arch/arm/mach-omap2/pm44xx.c b/arch/arm/mach-omap2/pm44xx.c index aa6fd98f606e..ea62e75ef21d 100644 --- a/arch/arm/mach-omap2/pm44xx.c +++ b/arch/arm/mach-omap2/pm44xx.c | |||
@@ -77,10 +77,20 @@ static int omap4_pm_suspend(void) | |||
77 | omap_set_pwrdm_state(pwrst->pwrdm, pwrst->saved_state); | 77 | omap_set_pwrdm_state(pwrst->pwrdm, pwrst->saved_state); |
78 | pwrdm_set_logic_retst(pwrst->pwrdm, pwrst->saved_logic_state); | 78 | pwrdm_set_logic_retst(pwrst->pwrdm, pwrst->saved_logic_state); |
79 | } | 79 | } |
80 | if (ret) | 80 | if (ret) { |
81 | pr_crit("Could not enter target state in pm_suspend\n"); | 81 | pr_crit("Could not enter target state in pm_suspend\n"); |
82 | else | 82 | /* |
83 | * OMAP4 chip PM currently works only with certain (newer) | ||
84 | * versions of bootloaders. This is due to missing code in the | ||
85 | * kernel to properly reset and initialize some devices. | ||
86 | * Warn the user about the bootloader version being one of the | ||
87 | * possible causes. | ||
88 | * http://www.spinics.net/lists/arm-kernel/msg218641.html | ||
89 | */ | ||
90 | pr_warn("A possible cause could be an old bootloader - try u-boot >= v2012.07\n"); | ||
91 | } else { | ||
83 | pr_info("Successfully put all powerdomains to target state\n"); | 92 | pr_info("Successfully put all powerdomains to target state\n"); |
93 | } | ||
84 | 94 | ||
85 | return 0; | 95 | return 0; |
86 | } | 96 | } |
@@ -146,6 +156,13 @@ int __init omap4_pm_init(void) | |||
146 | } | 156 | } |
147 | 157 | ||
148 | pr_err("Power Management for TI OMAP4.\n"); | 158 | pr_err("Power Management for TI OMAP4.\n"); |
159 | /* | ||
160 | * OMAP4 chip PM currently works only with certain (newer) | ||
161 | * versions of bootloaders. This is due to missing code in the | ||
162 | * kernel to properly reset and initialize some devices. | ||
163 | * http://www.spinics.net/lists/arm-kernel/msg218641.html | ||
164 | */ | ||
165 | pr_warn("OMAP4 PM: u-boot >= v2012.07 is required for full PM support\n"); | ||
149 | 166 | ||
150 | ret = pwrdm_for_each(pwrdms_setup, NULL); | 167 | ret = pwrdm_for_each(pwrdms_setup, NULL); |
151 | if (ret) { | 168 | if (ret) { |