diff options
author | Tony Lindgren <tony@atomide.com> | 2012-05-08 14:49:09 -0400 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2012-05-08 14:49:09 -0400 |
commit | 743a6d923f803c861a24d173e1d1818ca8ac0384 (patch) | |
tree | 29a1c1e8a6a45f7b9319de9155d5346603ee202b /arch | |
parent | 1df82cd6d7673006ae2ecbe8745bcf44f61c53a8 (diff) | |
parent | 0135f6a04642c192bdf4b36e06937d3387e174ff (diff) |
Merge tag 'omap-devel-b-for-3.5' of git://git.kernel.org/pub/scm/linux/kernel/git/pjw/omap-pending into devel-prcm
Some OMAP PRCM updates for 3.5. Includes some clock, clockdomain,
powerdomain, PRM, and CM changes.
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-omap2/clock.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-omap2/clock3xxx_data.c | 25 | ||||
-rw-r--r-- | arch/arm/mach-omap2/clock44xx_data.c | 11 | ||||
-rw-r--r-- | arch/arm/mach-omap2/clockdomain.c | 7 | ||||
-rw-r--r-- | arch/arm/mach-omap2/clockdomains3xxx_data.c | 6 | ||||
-rw-r--r-- | arch/arm/mach-omap2/cm-regbits-34xx.h | 4 | ||||
-rw-r--r-- | arch/arm/mach-omap2/cminst44xx.c | 28 | ||||
-rw-r--r-- | arch/arm/mach-omap2/common.c | 1 | ||||
-rw-r--r-- | arch/arm/mach-omap2/common.h | 1 | ||||
-rw-r--r-- | arch/arm/mach-omap2/dpll3xxx.c | 23 | ||||
-rw-r--r-- | arch/arm/mach-omap2/powerdomain.c | 10 | ||||
-rw-r--r-- | arch/arm/mach-omap2/powerdomain.h | 1 | ||||
-rw-r--r-- | arch/arm/mach-omap2/prcm-common.h | 17 | ||||
-rw-r--r-- | arch/arm/mach-omap2/prcm.c | 8 | ||||
-rw-r--r-- | arch/arm/mach-omap2/prminst44xx.c | 27 | ||||
-rw-r--r-- | arch/arm/mach-omap2/timer.c | 7 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/clkdev_omap.h | 4 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/dmtimer.h | 2 |
18 files changed, 97 insertions, 87 deletions
diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c index d9f4931513f9..5c4e66542169 100644 --- a/arch/arm/mach-omap2/clock.c +++ b/arch/arm/mach-omap2/clock.c | |||
@@ -439,7 +439,7 @@ void omap2_clk_disable_unused(struct clk *clk) | |||
439 | clk->ops->disable(clk); | 439 | clk->ops->disable(clk); |
440 | } | 440 | } |
441 | if (clk->clkdm != NULL) | 441 | if (clk->clkdm != NULL) |
442 | pwrdm_clkdm_state_switch(clk->clkdm); | 442 | pwrdm_state_switch(clk->clkdm->pwrdm.ptr); |
443 | } | 443 | } |
444 | #endif | 444 | #endif |
445 | 445 | ||
diff --git a/arch/arm/mach-omap2/clock3xxx_data.c b/arch/arm/mach-omap2/clock3xxx_data.c index f4a626f7c79e..4e1a3b0e8cc8 100644 --- a/arch/arm/mach-omap2/clock3xxx_data.c +++ b/arch/arm/mach-omap2/clock3xxx_data.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * OMAP3 clock data | 2 | * OMAP3 clock data |
3 | * | 3 | * |
4 | * Copyright (C) 2007-2010 Texas Instruments, Inc. | 4 | * Copyright (C) 2007-2010, 2012 Texas Instruments, Inc. |
5 | * Copyright (C) 2007-2011 Nokia Corporation | 5 | * Copyright (C) 2007-2011 Nokia Corporation |
6 | * | 6 | * |
7 | * Written by Paul Walmsley | 7 | * Written by Paul Walmsley |
@@ -1640,6 +1640,7 @@ static struct clk hdq_fck = { | |||
1640 | .name = "hdq_fck", | 1640 | .name = "hdq_fck", |
1641 | .ops = &clkops_omap2_dflt_wait, | 1641 | .ops = &clkops_omap2_dflt_wait, |
1642 | .parent = &core_12m_fck, | 1642 | .parent = &core_12m_fck, |
1643 | .clkdm_name = "core_l4_clkdm", | ||
1643 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | 1644 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
1644 | .enable_bit = OMAP3430_EN_HDQ_SHIFT, | 1645 | .enable_bit = OMAP3430_EN_HDQ_SHIFT, |
1645 | .recalc = &followparent_recalc, | 1646 | .recalc = &followparent_recalc, |
@@ -3294,8 +3295,8 @@ static struct omap_clk omap3xxx_clks[] = { | |||
3294 | CLK(NULL, "gfx_l3_ick", &gfx_l3_ick, CK_3430ES1), | 3295 | CLK(NULL, "gfx_l3_ick", &gfx_l3_ick, CK_3430ES1), |
3295 | CLK(NULL, "gfx_cg1_ck", &gfx_cg1_ck, CK_3430ES1), | 3296 | CLK(NULL, "gfx_cg1_ck", &gfx_cg1_ck, CK_3430ES1), |
3296 | CLK(NULL, "gfx_cg2_ck", &gfx_cg2_ck, CK_3430ES1), | 3297 | CLK(NULL, "gfx_cg2_ck", &gfx_cg2_ck, CK_3430ES1), |
3297 | CLK(NULL, "sgx_fck", &sgx_fck, CK_3430ES2PLUS | CK_3517 | CK_36XX), | 3298 | CLK(NULL, "sgx_fck", &sgx_fck, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), |
3298 | CLK(NULL, "sgx_ick", &sgx_ick, CK_3430ES2PLUS | CK_3517 | CK_36XX), | 3299 | CLK(NULL, "sgx_ick", &sgx_ick, CK_3430ES2PLUS | CK_AM35XX | CK_36XX), |
3299 | CLK(NULL, "d2d_26m_fck", &d2d_26m_fck, CK_3430ES1), | 3300 | CLK(NULL, "d2d_26m_fck", &d2d_26m_fck, CK_3430ES1), |
3300 | CLK(NULL, "modem_fck", &modem_fck, CK_34XX | CK_36XX), | 3301 | CLK(NULL, "modem_fck", &modem_fck, CK_34XX | CK_36XX), |
3301 | CLK(NULL, "sad2d_ick", &sad2d_ick, CK_34XX | CK_36XX), | 3302 | CLK(NULL, "sad2d_ick", &sad2d_ick, CK_34XX | CK_36XX), |
@@ -3419,7 +3420,7 @@ static struct omap_clk omap3xxx_clks[] = { | |||
3419 | CLK(NULL, "per_48m_fck", &per_48m_fck, CK_3XXX), | 3420 | CLK(NULL, "per_48m_fck", &per_48m_fck, CK_3XXX), |
3420 | CLK(NULL, "uart3_fck", &uart3_fck, CK_3XXX), | 3421 | CLK(NULL, "uart3_fck", &uart3_fck, CK_3XXX), |
3421 | CLK(NULL, "uart4_fck", &uart4_fck, CK_36XX), | 3422 | CLK(NULL, "uart4_fck", &uart4_fck, CK_36XX), |
3422 | CLK(NULL, "uart4_fck", &uart4_fck_am35xx, CK_3505 | CK_3517), | 3423 | CLK(NULL, "uart4_fck", &uart4_fck_am35xx, CK_AM35XX), |
3423 | CLK(NULL, "gpt2_fck", &gpt2_fck, CK_3XXX), | 3424 | CLK(NULL, "gpt2_fck", &gpt2_fck, CK_3XXX), |
3424 | CLK(NULL, "gpt3_fck", &gpt3_fck, CK_3XXX), | 3425 | CLK(NULL, "gpt3_fck", &gpt3_fck, CK_3XXX), |
3425 | CLK(NULL, "gpt4_fck", &gpt4_fck, CK_3XXX), | 3426 | CLK(NULL, "gpt4_fck", &gpt4_fck, CK_3XXX), |
@@ -3513,21 +3514,9 @@ int __init omap3xxx_clk_init(void) | |||
3513 | struct omap_clk *c; | 3514 | struct omap_clk *c; |
3514 | u32 cpu_clkflg = 0; | 3515 | u32 cpu_clkflg = 0; |
3515 | 3516 | ||
3516 | /* | 3517 | if (cpu_is_omap3517()) { |
3517 | * 3505 must be tested before 3517, since 3517 returns true | ||
3518 | * for both AM3517 chips and AM3517 family chips, which | ||
3519 | * includes 3505. Unfortunately there's no obvious family | ||
3520 | * test for 3517/3505 :-( | ||
3521 | */ | ||
3522 | if (cpu_is_omap3505()) { | ||
3523 | cpu_mask = RATE_IN_34XX; | ||
3524 | cpu_clkflg = CK_3505; | ||
3525 | } else if (cpu_is_omap3517()) { | ||
3526 | cpu_mask = RATE_IN_34XX; | ||
3527 | cpu_clkflg = CK_3517; | ||
3528 | } else if (cpu_is_omap3505()) { | ||
3529 | cpu_mask = RATE_IN_34XX; | 3518 | cpu_mask = RATE_IN_34XX; |
3530 | cpu_clkflg = CK_3505; | 3519 | cpu_clkflg = CK_AM35XX; |
3531 | } else if (cpu_is_omap3630()) { | 3520 | } else if (cpu_is_omap3630()) { |
3532 | cpu_mask = (RATE_IN_34XX | RATE_IN_36XX); | 3521 | cpu_mask = (RATE_IN_34XX | RATE_IN_36XX); |
3533 | cpu_clkflg = CK_36XX; | 3522 | cpu_clkflg = CK_36XX; |
diff --git a/arch/arm/mach-omap2/clock44xx_data.c b/arch/arm/mach-omap2/clock44xx_data.c index fa6ea65ad44b..2172f6603848 100644 --- a/arch/arm/mach-omap2/clock44xx_data.c +++ b/arch/arm/mach-omap2/clock44xx_data.c | |||
@@ -3355,17 +3355,6 @@ static struct omap_clk omap44xx_clks[] = { | |||
3355 | CLK(NULL, "auxclk5_ck", &auxclk5_ck, CK_443X), | 3355 | CLK(NULL, "auxclk5_ck", &auxclk5_ck, CK_443X), |
3356 | CLK(NULL, "auxclkreq5_ck", &auxclkreq5_ck, CK_443X), | 3356 | CLK(NULL, "auxclkreq5_ck", &auxclkreq5_ck, CK_443X), |
3357 | CLK(NULL, "gpmc_ck", &dummy_ck, CK_443X), | 3357 | CLK(NULL, "gpmc_ck", &dummy_ck, CK_443X), |
3358 | CLK(NULL, "gpt1_ick", &dummy_ck, CK_443X), | ||
3359 | CLK(NULL, "gpt2_ick", &dummy_ck, CK_443X), | ||
3360 | CLK(NULL, "gpt3_ick", &dummy_ck, CK_443X), | ||
3361 | CLK(NULL, "gpt4_ick", &dummy_ck, CK_443X), | ||
3362 | CLK(NULL, "gpt5_ick", &dummy_ck, CK_443X), | ||
3363 | CLK(NULL, "gpt6_ick", &dummy_ck, CK_443X), | ||
3364 | CLK(NULL, "gpt7_ick", &dummy_ck, CK_443X), | ||
3365 | CLK(NULL, "gpt8_ick", &dummy_ck, CK_443X), | ||
3366 | CLK(NULL, "gpt9_ick", &dummy_ck, CK_443X), | ||
3367 | CLK(NULL, "gpt10_ick", &dummy_ck, CK_443X), | ||
3368 | CLK(NULL, "gpt11_ick", &dummy_ck, CK_443X), | ||
3369 | CLK("omap_i2c.1", "ick", &dummy_ck, CK_443X), | 3358 | CLK("omap_i2c.1", "ick", &dummy_ck, CK_443X), |
3370 | CLK("omap_i2c.2", "ick", &dummy_ck, CK_443X), | 3359 | CLK("omap_i2c.2", "ick", &dummy_ck, CK_443X), |
3371 | CLK("omap_i2c.3", "ick", &dummy_ck, CK_443X), | 3360 | CLK("omap_i2c.3", "ick", &dummy_ck, CK_443X), |
diff --git a/arch/arm/mach-omap2/clockdomain.c b/arch/arm/mach-omap2/clockdomain.c index ad07689e1563..8664f5a8bfb6 100644 --- a/arch/arm/mach-omap2/clockdomain.c +++ b/arch/arm/mach-omap2/clockdomain.c | |||
@@ -840,7 +840,7 @@ void clkdm_allow_idle(struct clockdomain *clkdm) | |||
840 | spin_lock_irqsave(&clkdm->lock, flags); | 840 | spin_lock_irqsave(&clkdm->lock, flags); |
841 | clkdm->_flags |= _CLKDM_FLAG_HWSUP_ENABLED; | 841 | clkdm->_flags |= _CLKDM_FLAG_HWSUP_ENABLED; |
842 | arch_clkdm->clkdm_allow_idle(clkdm); | 842 | arch_clkdm->clkdm_allow_idle(clkdm); |
843 | pwrdm_clkdm_state_switch(clkdm); | 843 | pwrdm_state_switch(clkdm->pwrdm.ptr); |
844 | spin_unlock_irqrestore(&clkdm->lock, flags); | 844 | spin_unlock_irqrestore(&clkdm->lock, flags); |
845 | } | 845 | } |
846 | 846 | ||
@@ -924,8 +924,7 @@ static int _clkdm_clk_hwmod_enable(struct clockdomain *clkdm) | |||
924 | 924 | ||
925 | spin_lock_irqsave(&clkdm->lock, flags); | 925 | spin_lock_irqsave(&clkdm->lock, flags); |
926 | arch_clkdm->clkdm_clk_enable(clkdm); | 926 | arch_clkdm->clkdm_clk_enable(clkdm); |
927 | pwrdm_wait_transition(clkdm->pwrdm.ptr); | 927 | pwrdm_state_switch(clkdm->pwrdm.ptr); |
928 | pwrdm_clkdm_state_switch(clkdm); | ||
929 | spin_unlock_irqrestore(&clkdm->lock, flags); | 928 | spin_unlock_irqrestore(&clkdm->lock, flags); |
930 | 929 | ||
931 | pr_debug("clockdomain: clkdm %s: enabled\n", clkdm->name); | 930 | pr_debug("clockdomain: clkdm %s: enabled\n", clkdm->name); |
@@ -950,7 +949,7 @@ static int _clkdm_clk_hwmod_disable(struct clockdomain *clkdm) | |||
950 | 949 | ||
951 | spin_lock_irqsave(&clkdm->lock, flags); | 950 | spin_lock_irqsave(&clkdm->lock, flags); |
952 | arch_clkdm->clkdm_clk_disable(clkdm); | 951 | arch_clkdm->clkdm_clk_disable(clkdm); |
953 | pwrdm_clkdm_state_switch(clkdm); | 952 | pwrdm_state_switch(clkdm->pwrdm.ptr); |
954 | spin_unlock_irqrestore(&clkdm->lock, flags); | 953 | spin_unlock_irqrestore(&clkdm->lock, flags); |
955 | 954 | ||
956 | pr_debug("clockdomain: clkdm %s: disabled\n", clkdm->name); | 955 | pr_debug("clockdomain: clkdm %s: disabled\n", clkdm->name); |
diff --git a/arch/arm/mach-omap2/clockdomains3xxx_data.c b/arch/arm/mach-omap2/clockdomains3xxx_data.c index b84e138d99c8..6038adb97710 100644 --- a/arch/arm/mach-omap2/clockdomains3xxx_data.c +++ b/arch/arm/mach-omap2/clockdomains3xxx_data.c | |||
@@ -53,9 +53,9 @@ | |||
53 | * 3430ES2 PM_WKDEP_SGX: adds IVA2, removes CORE | 53 | * 3430ES2 PM_WKDEP_SGX: adds IVA2, removes CORE |
54 | */ | 54 | */ |
55 | static struct clkdm_dep gfx_sgx_3xxx_wkdeps[] = { | 55 | static struct clkdm_dep gfx_sgx_3xxx_wkdeps[] = { |
56 | { .clkdm_name = "iva2_clkdm", }, | 56 | { .clkdm_name = "iva2_clkdm" }, |
57 | { .clkdm_name = "mpu_clkdm", }, | 57 | { .clkdm_name = "mpu_clkdm" }, |
58 | { .clkdm_name = "wkup_clkdm", }, | 58 | { .clkdm_name = "wkup_clkdm" }, |
59 | { NULL }, | 59 | { NULL }, |
60 | }; | 60 | }; |
61 | 61 | ||
diff --git a/arch/arm/mach-omap2/cm-regbits-34xx.h b/arch/arm/mach-omap2/cm-regbits-34xx.h index b91275908f33..8083a8cdc55f 100644 --- a/arch/arm/mach-omap2/cm-regbits-34xx.h +++ b/arch/arm/mach-omap2/cm-regbits-34xx.h | |||
@@ -79,7 +79,7 @@ | |||
79 | 79 | ||
80 | /* CM_CLKSEL1_PLL_IVA2 */ | 80 | /* CM_CLKSEL1_PLL_IVA2 */ |
81 | #define OMAP3430_IVA2_CLK_SRC_SHIFT 19 | 81 | #define OMAP3430_IVA2_CLK_SRC_SHIFT 19 |
82 | #define OMAP3430_IVA2_CLK_SRC_MASK (0x3 << 19) | 82 | #define OMAP3430_IVA2_CLK_SRC_MASK (0x7 << 19) |
83 | #define OMAP3430_IVA2_DPLL_MULT_SHIFT 8 | 83 | #define OMAP3430_IVA2_DPLL_MULT_SHIFT 8 |
84 | #define OMAP3430_IVA2_DPLL_MULT_MASK (0x7ff << 8) | 84 | #define OMAP3430_IVA2_DPLL_MULT_MASK (0x7ff << 8) |
85 | #define OMAP3430_IVA2_DPLL_DIV_SHIFT 0 | 85 | #define OMAP3430_IVA2_DPLL_DIV_SHIFT 0 |
@@ -124,7 +124,7 @@ | |||
124 | 124 | ||
125 | /* CM_CLKSEL1_PLL_MPU */ | 125 | /* CM_CLKSEL1_PLL_MPU */ |
126 | #define OMAP3430_MPU_CLK_SRC_SHIFT 19 | 126 | #define OMAP3430_MPU_CLK_SRC_SHIFT 19 |
127 | #define OMAP3430_MPU_CLK_SRC_MASK (0x3 << 19) | 127 | #define OMAP3430_MPU_CLK_SRC_MASK (0x7 << 19) |
128 | #define OMAP3430_MPU_DPLL_MULT_SHIFT 8 | 128 | #define OMAP3430_MPU_DPLL_MULT_SHIFT 8 |
129 | #define OMAP3430_MPU_DPLL_MULT_MASK (0x7ff << 8) | 129 | #define OMAP3430_MPU_DPLL_MULT_MASK (0x7ff << 8) |
130 | #define OMAP3430_MPU_DPLL_DIV_SHIFT 0 | 130 | #define OMAP3430_MPU_DPLL_DIV_SHIFT 0 |
diff --git a/arch/arm/mach-omap2/cminst44xx.c b/arch/arm/mach-omap2/cminst44xx.c index bd8810c3753f..8c86d294b1a3 100644 --- a/arch/arm/mach-omap2/cminst44xx.c +++ b/arch/arm/mach-omap2/cminst44xx.c | |||
@@ -32,6 +32,7 @@ | |||
32 | #include "prcm44xx.h" | 32 | #include "prcm44xx.h" |
33 | #include "prm44xx.h" | 33 | #include "prm44xx.h" |
34 | #include "prcm_mpu44xx.h" | 34 | #include "prcm_mpu44xx.h" |
35 | #include "prcm-common.h" | ||
35 | 36 | ||
36 | /* | 37 | /* |
37 | * CLKCTRL_IDLEST_*: possible values for the CM_*_CLKCTRL.IDLEST bitfield: | 38 | * CLKCTRL_IDLEST_*: possible values for the CM_*_CLKCTRL.IDLEST bitfield: |
@@ -49,14 +50,21 @@ | |||
49 | #define CLKCTRL_IDLEST_INTERFACE_IDLE 0x2 | 50 | #define CLKCTRL_IDLEST_INTERFACE_IDLE 0x2 |
50 | #define CLKCTRL_IDLEST_DISABLED 0x3 | 51 | #define CLKCTRL_IDLEST_DISABLED 0x3 |
51 | 52 | ||
52 | static u32 _cm_bases[OMAP4_MAX_PRCM_PARTITIONS] = { | 53 | static void __iomem *_cm_bases[OMAP4_MAX_PRCM_PARTITIONS]; |
53 | [OMAP4430_INVALID_PRCM_PARTITION] = 0, | 54 | |
54 | [OMAP4430_PRM_PARTITION] = OMAP4430_PRM_BASE, | 55 | /** |
55 | [OMAP4430_CM1_PARTITION] = OMAP4430_CM1_BASE, | 56 | * omap_cm_base_init - Populates the cm partitions |
56 | [OMAP4430_CM2_PARTITION] = OMAP4430_CM2_BASE, | 57 | * |
57 | [OMAP4430_SCRM_PARTITION] = 0, | 58 | * Populates the base addresses of the _cm_bases |
58 | [OMAP4430_PRCM_MPU_PARTITION] = OMAP4430_PRCM_MPU_BASE, | 59 | * array used for read/write of cm module registers. |
59 | }; | 60 | */ |
61 | void omap_cm_base_init(void) | ||
62 | { | ||
63 | _cm_bases[OMAP4430_PRM_PARTITION] = prm_base; | ||
64 | _cm_bases[OMAP4430_CM1_PARTITION] = cm_base; | ||
65 | _cm_bases[OMAP4430_CM2_PARTITION] = cm2_base; | ||
66 | _cm_bases[OMAP4430_PRCM_MPU_PARTITION] = prcm_mpu_base; | ||
67 | } | ||
60 | 68 | ||
61 | /* Private functions */ | 69 | /* Private functions */ |
62 | 70 | ||
@@ -106,7 +114,7 @@ u32 omap4_cminst_read_inst_reg(u8 part, s16 inst, u16 idx) | |||
106 | BUG_ON(part >= OMAP4_MAX_PRCM_PARTITIONS || | 114 | BUG_ON(part >= OMAP4_MAX_PRCM_PARTITIONS || |
107 | part == OMAP4430_INVALID_PRCM_PARTITION || | 115 | part == OMAP4430_INVALID_PRCM_PARTITION || |
108 | !_cm_bases[part]); | 116 | !_cm_bases[part]); |
109 | return __raw_readl(OMAP2_L4_IO_ADDRESS(_cm_bases[part] + inst + idx)); | 117 | return __raw_readl(_cm_bases[part] + inst + idx); |
110 | } | 118 | } |
111 | 119 | ||
112 | /* Write into a register in a CM instance */ | 120 | /* Write into a register in a CM instance */ |
@@ -115,7 +123,7 @@ void omap4_cminst_write_inst_reg(u32 val, u8 part, s16 inst, u16 idx) | |||
115 | BUG_ON(part >= OMAP4_MAX_PRCM_PARTITIONS || | 123 | BUG_ON(part >= OMAP4_MAX_PRCM_PARTITIONS || |
116 | part == OMAP4430_INVALID_PRCM_PARTITION || | 124 | part == OMAP4430_INVALID_PRCM_PARTITION || |
117 | !_cm_bases[part]); | 125 | !_cm_bases[part]); |
118 | __raw_writel(val, OMAP2_L4_IO_ADDRESS(_cm_bases[part] + inst + idx)); | 126 | __raw_writel(val, _cm_bases[part] + inst + idx); |
119 | } | 127 | } |
120 | 128 | ||
121 | /* Read-modify-write a register in CM1. Caller must lock */ | 129 | /* Read-modify-write a register in CM1. Caller must lock */ |
diff --git a/arch/arm/mach-omap2/common.c b/arch/arm/mach-omap2/common.c index 1549c11000d3..8a6953a34fe2 100644 --- a/arch/arm/mach-omap2/common.c +++ b/arch/arm/mach-omap2/common.c | |||
@@ -166,6 +166,7 @@ static struct omap_globals omap4_globals = { | |||
166 | .prm = OMAP2_L4_IO_ADDRESS(OMAP4430_PRM_BASE), | 166 | .prm = OMAP2_L4_IO_ADDRESS(OMAP4430_PRM_BASE), |
167 | .cm = OMAP2_L4_IO_ADDRESS(OMAP4430_CM_BASE), | 167 | .cm = OMAP2_L4_IO_ADDRESS(OMAP4430_CM_BASE), |
168 | .cm2 = OMAP2_L4_IO_ADDRESS(OMAP4430_CM2_BASE), | 168 | .cm2 = OMAP2_L4_IO_ADDRESS(OMAP4430_CM2_BASE), |
169 | .prcm_mpu = OMAP2_L4_IO_ADDRESS(OMAP4430_PRCM_MPU_BASE), | ||
169 | }; | 170 | }; |
170 | 171 | ||
171 | void __init omap2_set_globals_443x(void) | 172 | void __init omap2_set_globals_443x(void) |
diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h index 57da7f406e28..0672fc54b30f 100644 --- a/arch/arm/mach-omap2/common.h +++ b/arch/arm/mach-omap2/common.h | |||
@@ -111,6 +111,7 @@ struct omap_globals { | |||
111 | void __iomem *prm; /* Power and Reset Management */ | 111 | void __iomem *prm; /* Power and Reset Management */ |
112 | void __iomem *cm; /* Clock Management */ | 112 | void __iomem *cm; /* Clock Management */ |
113 | void __iomem *cm2; | 113 | void __iomem *cm2; |
114 | void __iomem *prcm_mpu; | ||
114 | }; | 115 | }; |
115 | 116 | ||
116 | void omap2_set_globals_242x(void); | 117 | void omap2_set_globals_242x(void); |
diff --git a/arch/arm/mach-omap2/dpll3xxx.c b/arch/arm/mach-omap2/dpll3xxx.c index fc56745676fa..f0f10beeffe8 100644 --- a/arch/arm/mach-omap2/dpll3xxx.c +++ b/arch/arm/mach-omap2/dpll3xxx.c | |||
@@ -142,7 +142,8 @@ static int _omap3_noncore_dpll_lock(struct clk *clk) | |||
142 | 142 | ||
143 | ai = omap3_dpll_autoidle_read(clk); | 143 | ai = omap3_dpll_autoidle_read(clk); |
144 | 144 | ||
145 | omap3_dpll_deny_idle(clk); | 145 | if (ai) |
146 | omap3_dpll_deny_idle(clk); | ||
146 | 147 | ||
147 | _omap3_dpll_write_clken(clk, DPLL_LOCKED); | 148 | _omap3_dpll_write_clken(clk, DPLL_LOCKED); |
148 | 149 | ||
@@ -186,8 +187,6 @@ static int _omap3_noncore_dpll_bypass(struct clk *clk) | |||
186 | 187 | ||
187 | if (ai) | 188 | if (ai) |
188 | omap3_dpll_allow_idle(clk); | 189 | omap3_dpll_allow_idle(clk); |
189 | else | ||
190 | omap3_dpll_deny_idle(clk); | ||
191 | 190 | ||
192 | return r; | 191 | return r; |
193 | } | 192 | } |
@@ -216,8 +215,6 @@ static int _omap3_noncore_dpll_stop(struct clk *clk) | |||
216 | 215 | ||
217 | if (ai) | 216 | if (ai) |
218 | omap3_dpll_allow_idle(clk); | 217 | omap3_dpll_allow_idle(clk); |
219 | else | ||
220 | omap3_dpll_deny_idle(clk); | ||
221 | 218 | ||
222 | return 0; | 219 | return 0; |
223 | } | 220 | } |
@@ -519,6 +516,9 @@ u32 omap3_dpll_autoidle_read(struct clk *clk) | |||
519 | 516 | ||
520 | dd = clk->dpll_data; | 517 | dd = clk->dpll_data; |
521 | 518 | ||
519 | if (!dd->autoidle_reg) | ||
520 | return -EINVAL; | ||
521 | |||
522 | v = __raw_readl(dd->autoidle_reg); | 522 | v = __raw_readl(dd->autoidle_reg); |
523 | v &= dd->autoidle_mask; | 523 | v &= dd->autoidle_mask; |
524 | v >>= __ffs(dd->autoidle_mask); | 524 | v >>= __ffs(dd->autoidle_mask); |
@@ -545,6 +545,12 @@ void omap3_dpll_allow_idle(struct clk *clk) | |||
545 | 545 | ||
546 | dd = clk->dpll_data; | 546 | dd = clk->dpll_data; |
547 | 547 | ||
548 | if (!dd->autoidle_reg) { | ||
549 | pr_debug("clock: DPLL %s: autoidle not supported\n", | ||
550 | clk->name); | ||
551 | return; | ||
552 | } | ||
553 | |||
548 | /* | 554 | /* |
549 | * REVISIT: CORE DPLL can optionally enter low-power bypass | 555 | * REVISIT: CORE DPLL can optionally enter low-power bypass |
550 | * by writing 0x5 instead of 0x1. Add some mechanism to | 556 | * by writing 0x5 instead of 0x1. Add some mechanism to |
@@ -554,6 +560,7 @@ void omap3_dpll_allow_idle(struct clk *clk) | |||
554 | v &= ~dd->autoidle_mask; | 560 | v &= ~dd->autoidle_mask; |
555 | v |= DPLL_AUTOIDLE_LOW_POWER_STOP << __ffs(dd->autoidle_mask); | 561 | v |= DPLL_AUTOIDLE_LOW_POWER_STOP << __ffs(dd->autoidle_mask); |
556 | __raw_writel(v, dd->autoidle_reg); | 562 | __raw_writel(v, dd->autoidle_reg); |
563 | |||
557 | } | 564 | } |
558 | 565 | ||
559 | /** | 566 | /** |
@@ -572,6 +579,12 @@ void omap3_dpll_deny_idle(struct clk *clk) | |||
572 | 579 | ||
573 | dd = clk->dpll_data; | 580 | dd = clk->dpll_data; |
574 | 581 | ||
582 | if (!dd->autoidle_reg) { | ||
583 | pr_debug("clock: DPLL %s: autoidle not supported\n", | ||
584 | clk->name); | ||
585 | return; | ||
586 | } | ||
587 | |||
575 | v = __raw_readl(dd->autoidle_reg); | 588 | v = __raw_readl(dd->autoidle_reg); |
576 | v &= ~dd->autoidle_mask; | 589 | v &= ~dd->autoidle_mask; |
577 | v |= DPLL_AUTOIDLE_DISABLE << __ffs(dd->autoidle_mask); | 590 | v |= DPLL_AUTOIDLE_DISABLE << __ffs(dd->autoidle_mask); |
diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c index 96ad3dbeac34..96114901b932 100644 --- a/arch/arm/mach-omap2/powerdomain.c +++ b/arch/arm/mach-omap2/powerdomain.c | |||
@@ -981,16 +981,6 @@ int pwrdm_state_switch(struct powerdomain *pwrdm) | |||
981 | return ret; | 981 | return ret; |
982 | } | 982 | } |
983 | 983 | ||
984 | int pwrdm_clkdm_state_switch(struct clockdomain *clkdm) | ||
985 | { | ||
986 | if (clkdm != NULL && clkdm->pwrdm.ptr != NULL) { | ||
987 | pwrdm_wait_transition(clkdm->pwrdm.ptr); | ||
988 | return pwrdm_state_switch(clkdm->pwrdm.ptr); | ||
989 | } | ||
990 | |||
991 | return -EINVAL; | ||
992 | } | ||
993 | |||
994 | int pwrdm_pre_transition(void) | 984 | int pwrdm_pre_transition(void) |
995 | { | 985 | { |
996 | pwrdm_for_each(_pwrdm_pre_transition_cb, NULL); | 986 | pwrdm_for_each(_pwrdm_pre_transition_cb, NULL); |
diff --git a/arch/arm/mach-omap2/powerdomain.h b/arch/arm/mach-omap2/powerdomain.h index 0d72a8a8ce4d..8f88d65c46ea 100644 --- a/arch/arm/mach-omap2/powerdomain.h +++ b/arch/arm/mach-omap2/powerdomain.h | |||
@@ -213,7 +213,6 @@ bool pwrdm_has_hdwr_sar(struct powerdomain *pwrdm); | |||
213 | int pwrdm_wait_transition(struct powerdomain *pwrdm); | 213 | int pwrdm_wait_transition(struct powerdomain *pwrdm); |
214 | 214 | ||
215 | int pwrdm_state_switch(struct powerdomain *pwrdm); | 215 | int pwrdm_state_switch(struct powerdomain *pwrdm); |
216 | int pwrdm_clkdm_state_switch(struct clockdomain *clkdm); | ||
217 | int pwrdm_pre_transition(void); | 216 | int pwrdm_pre_transition(void); |
218 | int pwrdm_post_transition(void); | 217 | int pwrdm_post_transition(void); |
219 | int pwrdm_set_lowpwrstchange(struct powerdomain *pwrdm); | 218 | int pwrdm_set_lowpwrstchange(struct powerdomain *pwrdm); |
diff --git a/arch/arm/mach-omap2/prcm-common.h b/arch/arm/mach-omap2/prcm-common.h index 5aa5435e3ff1..6da3ba483ad1 100644 --- a/arch/arm/mach-omap2/prcm-common.h +++ b/arch/arm/mach-omap2/prcm-common.h | |||
@@ -177,6 +177,8 @@ | |||
177 | /* PM_WKST_WKUP, CM_IDLEST_WKUP shared bits */ | 177 | /* PM_WKST_WKUP, CM_IDLEST_WKUP shared bits */ |
178 | #define OMAP24XX_ST_GPIOS_SHIFT 2 | 178 | #define OMAP24XX_ST_GPIOS_SHIFT 2 |
179 | #define OMAP24XX_ST_GPIOS_MASK (1 << 2) | 179 | #define OMAP24XX_ST_GPIOS_MASK (1 << 2) |
180 | #define OMAP24XX_ST_32KSYNC_SHIFT 1 | ||
181 | #define OMAP24XX_ST_32KSYNC_MASK (1 << 1) | ||
180 | #define OMAP24XX_ST_GPT1_SHIFT 0 | 182 | #define OMAP24XX_ST_GPT1_SHIFT 0 |
181 | #define OMAP24XX_ST_GPT1_MASK (1 << 0) | 183 | #define OMAP24XX_ST_GPT1_MASK (1 << 0) |
182 | 184 | ||
@@ -307,6 +309,8 @@ | |||
307 | #define OMAP3430_ST_SR1_MASK (1 << 6) | 309 | #define OMAP3430_ST_SR1_MASK (1 << 6) |
308 | #define OMAP3430_ST_GPIO1_SHIFT 3 | 310 | #define OMAP3430_ST_GPIO1_SHIFT 3 |
309 | #define OMAP3430_ST_GPIO1_MASK (1 << 3) | 311 | #define OMAP3430_ST_GPIO1_MASK (1 << 3) |
312 | #define OMAP3430_ST_32KSYNC_SHIFT 2 | ||
313 | #define OMAP3430_ST_32KSYNC_MASK (1 << 2) | ||
310 | #define OMAP3430_ST_GPT12_SHIFT 1 | 314 | #define OMAP3430_ST_GPT12_SHIFT 1 |
311 | #define OMAP3430_ST_GPT12_MASK (1 << 1) | 315 | #define OMAP3430_ST_GPT12_MASK (1 << 1) |
312 | #define OMAP3430_ST_GPT1_SHIFT 0 | 316 | #define OMAP3430_ST_GPT1_SHIFT 0 |
@@ -410,6 +414,19 @@ | |||
410 | extern void __iomem *prm_base; | 414 | extern void __iomem *prm_base; |
411 | extern void __iomem *cm_base; | 415 | extern void __iomem *cm_base; |
412 | extern void __iomem *cm2_base; | 416 | extern void __iomem *cm2_base; |
417 | extern void __iomem *prcm_mpu_base; | ||
418 | |||
419 | #if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_ARCH_OMAP5) | ||
420 | extern void omap_prm_base_init(void); | ||
421 | extern void omap_cm_base_init(void); | ||
422 | #else | ||
423 | static inline void omap_prm_base_init(void) | ||
424 | { | ||
425 | } | ||
426 | static inline void omap_cm_base_init(void) | ||
427 | { | ||
428 | } | ||
429 | #endif | ||
413 | 430 | ||
414 | /** | 431 | /** |
415 | * struct omap_prcm_irq - describes a PRCM interrupt bit | 432 | * struct omap_prcm_irq - describes a PRCM interrupt bit |
diff --git a/arch/arm/mach-omap2/prcm.c b/arch/arm/mach-omap2/prcm.c index 626acfad7190..480f40a5ee42 100644 --- a/arch/arm/mach-omap2/prcm.c +++ b/arch/arm/mach-omap2/prcm.c | |||
@@ -42,6 +42,7 @@ | |||
42 | void __iomem *prm_base; | 42 | void __iomem *prm_base; |
43 | void __iomem *cm_base; | 43 | void __iomem *cm_base; |
44 | void __iomem *cm2_base; | 44 | void __iomem *cm2_base; |
45 | void __iomem *prcm_mpu_base; | ||
45 | 46 | ||
46 | #define MAX_MODULE_ENABLE_WAIT 100000 | 47 | #define MAX_MODULE_ENABLE_WAIT 100000 |
47 | 48 | ||
@@ -155,4 +156,11 @@ void __init omap2_set_globals_prcm(struct omap_globals *omap2_globals) | |||
155 | cm_base = omap2_globals->cm; | 156 | cm_base = omap2_globals->cm; |
156 | if (omap2_globals->cm2) | 157 | if (omap2_globals->cm2) |
157 | cm2_base = omap2_globals->cm2; | 158 | cm2_base = omap2_globals->cm2; |
159 | if (omap2_globals->prcm_mpu) | ||
160 | prcm_mpu_base = omap2_globals->prcm_mpu; | ||
161 | |||
162 | if (cpu_is_omap44xx()) { | ||
163 | omap_prm_base_init(); | ||
164 | omap_cm_base_init(); | ||
165 | } | ||
158 | } | 166 | } |
diff --git a/arch/arm/mach-omap2/prminst44xx.c b/arch/arm/mach-omap2/prminst44xx.c index 9b3898a3ac9b..c12320c0ae95 100644 --- a/arch/arm/mach-omap2/prminst44xx.c +++ b/arch/arm/mach-omap2/prminst44xx.c | |||
@@ -18,20 +18,26 @@ | |||
18 | 18 | ||
19 | #include "iomap.h" | 19 | #include "iomap.h" |
20 | #include "common.h" | 20 | #include "common.h" |
21 | #include "prcm-common.h" | ||
21 | #include "prm44xx.h" | 22 | #include "prm44xx.h" |
22 | #include "prminst44xx.h" | 23 | #include "prminst44xx.h" |
23 | #include "prm-regbits-44xx.h" | 24 | #include "prm-regbits-44xx.h" |
24 | #include "prcm44xx.h" | 25 | #include "prcm44xx.h" |
25 | #include "prcm_mpu44xx.h" | 26 | #include "prcm_mpu44xx.h" |
26 | 27 | ||
27 | static u32 _prm_bases[OMAP4_MAX_PRCM_PARTITIONS] = { | 28 | static void __iomem *_prm_bases[OMAP4_MAX_PRCM_PARTITIONS]; |
28 | [OMAP4430_INVALID_PRCM_PARTITION] = 0, | 29 | |
29 | [OMAP4430_PRM_PARTITION] = OMAP4430_PRM_BASE, | 30 | /** |
30 | [OMAP4430_CM1_PARTITION] = 0, | 31 | * omap_prm_base_init - Populates the prm partitions |
31 | [OMAP4430_CM2_PARTITION] = 0, | 32 | * |
32 | [OMAP4430_SCRM_PARTITION] = 0, | 33 | * Populates the base addresses of the _prm_bases |
33 | [OMAP4430_PRCM_MPU_PARTITION] = OMAP4430_PRCM_MPU_BASE, | 34 | * array used for read/write of prm module registers. |
34 | }; | 35 | */ |
36 | void omap_prm_base_init(void) | ||
37 | { | ||
38 | _prm_bases[OMAP4430_PRM_PARTITION] = prm_base; | ||
39 | _prm_bases[OMAP4430_PRCM_MPU_PARTITION] = prcm_mpu_base; | ||
40 | } | ||
35 | 41 | ||
36 | /* Read a register in a PRM instance */ | 42 | /* Read a register in a PRM instance */ |
37 | u32 omap4_prminst_read_inst_reg(u8 part, s16 inst, u16 idx) | 43 | u32 omap4_prminst_read_inst_reg(u8 part, s16 inst, u16 idx) |
@@ -39,8 +45,7 @@ u32 omap4_prminst_read_inst_reg(u8 part, s16 inst, u16 idx) | |||
39 | BUG_ON(part >= OMAP4_MAX_PRCM_PARTITIONS || | 45 | BUG_ON(part >= OMAP4_MAX_PRCM_PARTITIONS || |
40 | part == OMAP4430_INVALID_PRCM_PARTITION || | 46 | part == OMAP4430_INVALID_PRCM_PARTITION || |
41 | !_prm_bases[part]); | 47 | !_prm_bases[part]); |
42 | return __raw_readl(OMAP2_L4_IO_ADDRESS(_prm_bases[part] + inst + | 48 | return __raw_readl(_prm_bases[part] + inst + idx); |
43 | idx)); | ||
44 | } | 49 | } |
45 | 50 | ||
46 | /* Write into a register in a PRM instance */ | 51 | /* Write into a register in a PRM instance */ |
@@ -49,7 +54,7 @@ void omap4_prminst_write_inst_reg(u32 val, u8 part, s16 inst, u16 idx) | |||
49 | BUG_ON(part >= OMAP4_MAX_PRCM_PARTITIONS || | 54 | BUG_ON(part >= OMAP4_MAX_PRCM_PARTITIONS || |
50 | part == OMAP4430_INVALID_PRCM_PARTITION || | 55 | part == OMAP4430_INVALID_PRCM_PARTITION || |
51 | !_prm_bases[part]); | 56 | !_prm_bases[part]); |
52 | __raw_writel(val, OMAP2_L4_IO_ADDRESS(_prm_bases[part] + inst + idx)); | 57 | __raw_writel(val, _prm_bases[part] + inst + idx); |
53 | } | 58 | } |
54 | 59 | ||
55 | /* Read-modify-write a register in PRM. Caller must lock */ | 60 | /* Read-modify-write a register in PRM. Caller must lock */ |
diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c index ecec873e78cd..1b7835865c83 100644 --- a/arch/arm/mach-omap2/timer.c +++ b/arch/arm/mach-omap2/timer.c | |||
@@ -178,13 +178,6 @@ static int __init omap_dm_timer_init_one(struct omap_dm_timer *timer, | |||
178 | if (IS_ERR(timer->fclk)) | 178 | if (IS_ERR(timer->fclk)) |
179 | return -ENODEV; | 179 | return -ENODEV; |
180 | 180 | ||
181 | sprintf(name, "gpt%d_ick", gptimer_id); | ||
182 | timer->iclk = clk_get(NULL, name); | ||
183 | if (IS_ERR(timer->iclk)) { | ||
184 | clk_put(timer->fclk); | ||
185 | return -ENODEV; | ||
186 | } | ||
187 | |||
188 | omap_hwmod_enable(oh); | 181 | omap_hwmod_enable(oh); |
189 | 182 | ||
190 | sys_timer_reserved |= (1 << (gptimer_id - 1)); | 183 | sys_timer_reserved |= (1 << (gptimer_id - 1)); |
diff --git a/arch/arm/plat-omap/include/plat/clkdev_omap.h b/arch/arm/plat-omap/include/plat/clkdev_omap.h index b299b8d201c8..d0ed8c443a63 100644 --- a/arch/arm/plat-omap/include/plat/clkdev_omap.h +++ b/arch/arm/plat-omap/include/plat/clkdev_omap.h | |||
@@ -34,8 +34,7 @@ struct omap_clk { | |||
34 | #define CK_243X (1 << 5) /* 243x, 253x */ | 34 | #define CK_243X (1 << 5) /* 243x, 253x */ |
35 | #define CK_3430ES1 (1 << 6) /* 34xxES1 only */ | 35 | #define CK_3430ES1 (1 << 6) /* 34xxES1 only */ |
36 | #define CK_3430ES2PLUS (1 << 7) /* 34xxES2, ES3, non-Sitara 35xx only */ | 36 | #define CK_3430ES2PLUS (1 << 7) /* 34xxES2, ES3, non-Sitara 35xx only */ |
37 | #define CK_3505 (1 << 8) | 37 | #define CK_AM35XX (1 << 9) /* Sitara AM35xx */ |
38 | #define CK_3517 (1 << 9) | ||
39 | #define CK_36XX (1 << 10) /* 36xx/37xx-specific clocks */ | 38 | #define CK_36XX (1 << 10) /* 36xx/37xx-specific clocks */ |
40 | #define CK_443X (1 << 11) | 39 | #define CK_443X (1 << 11) |
41 | #define CK_TI816X (1 << 12) | 40 | #define CK_TI816X (1 << 12) |
@@ -44,7 +43,6 @@ struct omap_clk { | |||
44 | 43 | ||
45 | 44 | ||
46 | #define CK_34XX (CK_3430ES1 | CK_3430ES2PLUS) | 45 | #define CK_34XX (CK_3430ES1 | CK_3430ES2PLUS) |
47 | #define CK_AM35XX (CK_3505 | CK_3517) /* all Sitara AM35xx */ | ||
48 | #define CK_3XXX (CK_34XX | CK_AM35XX | CK_36XX) | 46 | #define CK_3XXX (CK_34XX | CK_AM35XX | CK_36XX) |
49 | 47 | ||
50 | 48 | ||
diff --git a/arch/arm/plat-omap/include/plat/dmtimer.h b/arch/arm/plat-omap/include/plat/dmtimer.h index 9418f00b6c38..be2b8c48a9bf 100644 --- a/arch/arm/plat-omap/include/plat/dmtimer.h +++ b/arch/arm/plat-omap/include/plat/dmtimer.h | |||
@@ -259,7 +259,7 @@ struct omap_dm_timer { | |||
259 | unsigned long phys_base; | 259 | unsigned long phys_base; |
260 | int id; | 260 | int id; |
261 | int irq; | 261 | int irq; |
262 | struct clk *iclk, *fclk; | 262 | struct clk *fclk; |
263 | 263 | ||
264 | void __iomem *io_base; | 264 | void __iomem *io_base; |
265 | void __iomem *sys_stat; /* TISTAT timer status */ | 265 | void __iomem *sys_stat; /* TISTAT timer status */ |