diff options
author | Abhijit Pagare <abhijitpagare@ti.com> | 2010-01-26 22:12:54 -0500 |
---|---|---|
committer | Paul Walmsley <paul@pwsan.com> | 2010-01-26 22:12:54 -0500 |
commit | 8a3ddc759b33d3b3b3953d001c8d3d9107becbb9 (patch) | |
tree | 7d6072694d33ef23b5a289c8ab688dc1568ad7e0 | |
parent | 1a422724c6995004d0b9e95596ec4623e8ca1fc2 (diff) |
ARM: OMAP4: PM: Refine the APIs to support OMAP4 features.
Port the APIs to support the OMAP4 clockdomain framework.
Also take care of the compiling requirements for the same.
Signed-off-by: Abhijit Pagare <abhijitpagare@ti.com>
Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Benoit Cousson <b-cousson@ti.com>
Cc: Rajendra Nayak <rnayak@ti.com>
-rw-r--r-- | arch/arm/mach-omap2/Makefile | 2 | ||||
-rw-r--r-- | arch/arm/mach-omap2/clockdomain.c | 21 | ||||
-rw-r--r-- | arch/arm/mach-omap2/io.c | 2 |
3 files changed, 14 insertions, 11 deletions
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile index 4a54e5afbac5..64de2fdf6556 100644 --- a/arch/arm/mach-omap2/Makefile +++ b/arch/arm/mach-omap2/Makefile | |||
@@ -13,7 +13,7 @@ clock-common = clock.o clock_common_data.o clockdomain.o | |||
13 | obj-$(CONFIG_ARCH_OMAP2) += $(omap-2-3-common) $(prcm-common) $(clock-common) | 13 | obj-$(CONFIG_ARCH_OMAP2) += $(omap-2-3-common) $(prcm-common) $(clock-common) |
14 | obj-$(CONFIG_ARCH_OMAP3) += $(omap-2-3-common) $(prcm-common) $(clock-common) \ | 14 | obj-$(CONFIG_ARCH_OMAP3) += $(omap-2-3-common) $(prcm-common) $(clock-common) \ |
15 | $(omap-3-4-common) | 15 | $(omap-3-4-common) |
16 | obj-$(CONFIG_ARCH_OMAP4) += $(omap-3-4-common) $(prcm-common) clock.o | 16 | obj-$(CONFIG_ARCH_OMAP4) += $(omap-3-4-common) $(prcm-common) $(clock-common) |
17 | 17 | ||
18 | obj-$(CONFIG_OMAP_MCBSP) += mcbsp.o | 18 | obj-$(CONFIG_OMAP_MCBSP) += mcbsp.o |
19 | 19 | ||
diff --git a/arch/arm/mach-omap2/clockdomain.c b/arch/arm/mach-omap2/clockdomain.c index 5366a10d8597..8c9e78c2c17f 100644 --- a/arch/arm/mach-omap2/clockdomain.c +++ b/arch/arm/mach-omap2/clockdomain.c | |||
@@ -1,10 +1,11 @@ | |||
1 | /* | 1 | /* |
2 | * OMAP2/3 clockdomain framework functions | 2 | * OMAP2/3/4 clockdomain framework functions |
3 | * | 3 | * |
4 | * Copyright (C) 2008 Texas Instruments, Inc. | 4 | * Copyright (C) 2008-2009 Texas Instruments, Inc. |
5 | * Copyright (C) 2008-2009 Nokia Corporation | 5 | * Copyright (C) 2008-2009 Nokia Corporation |
6 | * | 6 | * |
7 | * Written by Paul Walmsley and Jouni Högander | 7 | * Written by Paul Walmsley and Jouni Högander |
8 | * Added OMAP4 specific support by Abhijit Pagare <abhijitpagare@ti.com> | ||
8 | * | 9 | * |
9 | * This program is free software; you can redistribute it and/or modify | 10 | * 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 | * it under the terms of the GNU General Public License version 2 as |
@@ -152,7 +153,7 @@ static void _omap2_clkdm_set_hwsup(struct clockdomain *clkdm, int enable) | |||
152 | bits = OMAP24XX_CLKSTCTRL_ENABLE_AUTO; | 153 | bits = OMAP24XX_CLKSTCTRL_ENABLE_AUTO; |
153 | else | 154 | else |
154 | bits = OMAP24XX_CLKSTCTRL_DISABLE_AUTO; | 155 | bits = OMAP24XX_CLKSTCTRL_DISABLE_AUTO; |
155 | } else if (cpu_is_omap34xx()) { | 156 | } else if (cpu_is_omap34xx() | cpu_is_omap44xx()) { |
156 | if (enable) | 157 | if (enable) |
157 | bits = OMAP34XX_CLKSTCTRL_ENABLE_AUTO; | 158 | bits = OMAP34XX_CLKSTCTRL_ENABLE_AUTO; |
158 | else | 159 | else |
@@ -213,10 +214,12 @@ void clkdm_init(struct clockdomain **clkdms, | |||
213 | for (c = clkdms; *c; c++) | 214 | for (c = clkdms; *c; c++) |
214 | clkdm_register(*c); | 215 | clkdm_register(*c); |
215 | 216 | ||
216 | autodeps = init_autodeps; | 217 | if (!cpu_is_omap44xx()) { |
217 | if (autodeps) | 218 | autodeps = init_autodeps; |
218 | for (autodep = autodeps; autodep->pwrdm.ptr; autodep++) | 219 | if (autodeps) |
219 | _autodep_lookup(autodep); | 220 | for (autodep = autodeps; autodep->pwrdm.ptr; autodep++) |
221 | _autodep_lookup(autodep); | ||
222 | } | ||
220 | } | 223 | } |
221 | 224 | ||
222 | /** | 225 | /** |
@@ -419,7 +422,7 @@ int omap2_clkdm_sleep(struct clockdomain *clkdm) | |||
419 | cm_set_mod_reg_bits(OMAP24XX_FORCESTATE, | 422 | cm_set_mod_reg_bits(OMAP24XX_FORCESTATE, |
420 | clkdm->pwrdm.ptr->prcm_offs, OMAP2_PM_PWSTCTRL); | 423 | clkdm->pwrdm.ptr->prcm_offs, OMAP2_PM_PWSTCTRL); |
421 | 424 | ||
422 | } else if (cpu_is_omap34xx()) { | 425 | } else if (cpu_is_omap34xx() | cpu_is_omap44xx()) { |
423 | 426 | ||
424 | u32 bits = (OMAP34XX_CLKSTCTRL_FORCE_SLEEP << | 427 | u32 bits = (OMAP34XX_CLKSTCTRL_FORCE_SLEEP << |
425 | __ffs(clkdm->clktrctrl_mask)); | 428 | __ffs(clkdm->clktrctrl_mask)); |
@@ -463,7 +466,7 @@ int omap2_clkdm_wakeup(struct clockdomain *clkdm) | |||
463 | cm_clear_mod_reg_bits(OMAP24XX_FORCESTATE, | 466 | cm_clear_mod_reg_bits(OMAP24XX_FORCESTATE, |
464 | clkdm->pwrdm.ptr->prcm_offs, OMAP2_PM_PWSTCTRL); | 467 | clkdm->pwrdm.ptr->prcm_offs, OMAP2_PM_PWSTCTRL); |
465 | 468 | ||
466 | } else if (cpu_is_omap34xx()) { | 469 | } else if (cpu_is_omap34xx() | cpu_is_omap44xx()) { |
467 | 470 | ||
468 | u32 bits = (OMAP34XX_CLKSTCTRL_FORCE_WAKEUP << | 471 | u32 bits = (OMAP34XX_CLKSTCTRL_FORCE_WAKEUP << |
469 | __ffs(clkdm->clktrctrl_mask)); | 472 | __ffs(clkdm->clktrctrl_mask)); |
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c index aa237ff644d6..51d7453f406d 100644 --- a/arch/arm/mach-omap2/io.c +++ b/arch/arm/mach-omap2/io.c | |||
@@ -313,12 +313,12 @@ void __init omap2_init_common_hw(struct omap_sdrc_params *sdrc_cs0, | |||
313 | hwmods = omap34xx_hwmods; | 313 | hwmods = omap34xx_hwmods; |
314 | 314 | ||
315 | pwrdm_init(powerdomains_omap); | 315 | pwrdm_init(powerdomains_omap); |
316 | clkdm_init(clockdomains_omap, clkdm_pwrdm_autodeps); | ||
316 | #ifndef CONFIG_ARCH_OMAP4 /* FIXME: Remove this once the clkdev is ready */ | 317 | #ifndef CONFIG_ARCH_OMAP4 /* FIXME: Remove this once the clkdev is ready */ |
317 | /* The OPP tables have to be registered before a clk init */ | 318 | /* The OPP tables have to be registered before a clk init */ |
318 | omap_hwmod_init(hwmods); | 319 | omap_hwmod_init(hwmods); |
319 | omap2_mux_init(); | 320 | omap2_mux_init(); |
320 | omap_pm_if_early_init(mpu_opps, dsp_opps, l3_opps); | 321 | omap_pm_if_early_init(mpu_opps, dsp_opps, l3_opps); |
321 | clkdm_init(clockdomains_omap, clkdm_pwrdm_autodeps); | ||
322 | #endif | 322 | #endif |
323 | omap2_clk_init(); | 323 | omap2_clk_init(); |
324 | omap_serial_early_init(); | 324 | omap_serial_early_init(); |