From 5f03937700e3991a0de801ade8374628f2c982d5 Mon Sep 17 00:00:00 2001 From: Paul Walmsley Date: Mon, 29 Oct 2012 20:55:53 -0600 Subject: ARM: OMAP2xxx: clock: remove global 'dclk' variable Remove the global 'dclk' variable, instead replacing it with a variable local to the dpllcore clock type C file. This removes some of the special-case code surrounding the OMAP2xxx clock init. This patch is a prerequisite for the removal of the omap_prcm_restart() code from arch/arm/mach-omap2/prcm.c. It also cleans up some special-case OMAP2xxx clock code in the process. Signed-off-by: Paul Walmsley Tested-by: Vaibhav Hiremath --- arch/arm/mach-omap2/clock2430_data.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'arch/arm/mach-omap2/clock2430_data.c') diff --git a/arch/arm/mach-omap2/clock2430_data.c b/arch/arm/mach-omap2/clock2430_data.c index c97dafef894d..3e16eab4691d 100644 --- a/arch/arm/mach-omap2/clock2430_data.c +++ b/arch/arm/mach-omap2/clock2430_data.c @@ -123,6 +123,7 @@ static struct clk dpll_ck = { .name = "dpll_ck", .ops = &clkops_omap2xxx_dpll_ops, .parent = &sys_ck, /* Can be func_32k also */ + .init = &omap2xxx_clkt_dpllcore_init, .dpll_data = &dpll_dd, .clkdm_name = "wkup_clkdm", .recalc = &omap2_dpllcore_recalc, @@ -2052,7 +2053,7 @@ int __init omap2430_clk_init(void) omap_clk_disable_autoidle_all(); /* Check the MPU rate set by bootloader */ - clkrate = omap2xxx_clk_get_core_rate(&dpll_ck); + clkrate = omap2xxx_clk_get_core_rate(); for (prcm = rate_table; prcm->mpu_speed; prcm++) { if (!(prcm->flags & cpu_mask)) continue; @@ -2078,7 +2079,6 @@ int __init omap2430_clk_init(void) /* Avoid sleeping sleeping during omap2_clk_prepare_for_reboot() */ vclk = clk_get(NULL, "virt_prcm_set"); sclk = clk_get(NULL, "sys_ck"); - dclk = clk_get(NULL, "dpll_ck"); return 0; } -- cgit v1.2.3 From baa689b8b2e9a6ae1eb7aa49246276d838345a39 Mon Sep 17 00:00:00 2001 From: Paul Walmsley Date: Mon, 29 Oct 2012 20:56:00 -0600 Subject: ARM: OMAP2xxx: clock: move virt_prcm_set code into clkt2xxx_virt_prcm_set.c Collect all of the virt_prcm_set-specific clocktype code into mach-omap2/clkt2xxx_virt_prcm_set.c. Remove its dependency on the 'sclk' and 'vclk' global variables. Those variables will be removed by subsequent patches. This is part of the process of cleaning up the OMAP2xxx clock code and preparing for the removal of the omap_prcm_restart() function. Signed-off-by: Paul Walmsley Tested-by: Vaibhav Hiremath --- arch/arm/mach-omap2/clock2430_data.c | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) (limited to 'arch/arm/mach-omap2/clock2430_data.c') diff --git a/arch/arm/mach-omap2/clock2430_data.c b/arch/arm/mach-omap2/clock2430_data.c index 3e16eab4691d..15d859ae283b 100644 --- a/arch/arm/mach-omap2/clock2430_data.c +++ b/arch/arm/mach-omap2/clock2430_data.c @@ -1,7 +1,7 @@ /* * OMAP2430 clock data * - * Copyright (C) 2005-2009 Texas Instruments, Inc. + * Copyright (C) 2005-2009, 2012 Texas Instruments, Inc. * Copyright (C) 2004-2011 Nokia Corporation * * Contacts: @@ -2024,9 +2024,7 @@ static struct omap_clk omap2430_clks[] = { int __init omap2430_clk_init(void) { - const struct prcm_config *prcm; struct omap_clk *c; - u32 clkrate; prcm_clksrc_ctrl = OMAP2430_PRCM_CLKSRC_CTRL; cm_idlest_pll = OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST); @@ -2049,20 +2047,13 @@ int __init omap2430_clk_init(void) omap2_init_clk_clkdm(c->lk.clk); } + omap2xxx_clkt_vps_late_init(); + /* Disable autoidle on all clocks; let the PM code enable it later */ omap_clk_disable_autoidle_all(); - /* Check the MPU rate set by bootloader */ - clkrate = omap2xxx_clk_get_core_rate(); - for (prcm = rate_table; prcm->mpu_speed; prcm++) { - if (!(prcm->flags & cpu_mask)) - continue; - if (prcm->xtal_speed != sys_ck.rate) - continue; - if (prcm->dpll_speed <= clkrate) - break; - } - curr_prcm_set = prcm; + /* XXX Can this be done from the virt_prcm_set clk init function? */ + omap2xxx_clkt_vps_check_bootloader_rates(); recalculate_root_clocks(); -- cgit v1.2.3 From 187e3e06e8d7050a77c3208f54edff1e1bfae31d Mon Sep 17 00:00:00 2001 From: Paul Walmsley Date: Mon, 29 Oct 2012 20:56:12 -0600 Subject: ARM: OMAP2+: board files: use SoC-specific system restart functions Modify the board files to use the SoC-specific system restart functions. At this point it's possible to remove omap_prcm_restart() from mach-omap2/prcm.c. While removing the prototypes for the now-unused restart functions, clean up a few more obsolete prototypes in mach-omap2/clock.h. Signed-off-by: Paul Walmsley Tested-by: Vaibhav Hiremath --- arch/arm/mach-omap2/clock2430_data.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'arch/arm/mach-omap2/clock2430_data.c') diff --git a/arch/arm/mach-omap2/clock2430_data.c b/arch/arm/mach-omap2/clock2430_data.c index 15d859ae283b..6f1e26c21b91 100644 --- a/arch/arm/mach-omap2/clock2430_data.c +++ b/arch/arm/mach-omap2/clock2430_data.c @@ -2067,10 +2067,6 @@ int __init omap2430_clk_init(void) */ clk_enable_init_clocks(); - /* Avoid sleeping sleeping during omap2_clk_prepare_for_reboot() */ - vclk = clk_get(NULL, "virt_prcm_set"); - sclk = clk_get(NULL, "sys_ck"); - return 0; } -- cgit v1.2.3 From b6ffa05091978c68e94d2802200f2aaa06a598d9 Mon Sep 17 00:00:00 2001 From: Paul Walmsley Date: Mon, 29 Oct 2012 20:56:17 -0600 Subject: ARM: OMAP2xxx: APLL/CM: convert to use omap2_cm_wait_module_ready() Convert the OMAP2xxx APLL code to use omap2_cm_wait_module_ready(), and move the low-level CM register manipulation functions to mach-omap2/cm2xxx.c. The objectives here are to remove the dependency on the deprecated omap2_cm_wait_idlest() function in mach-omap2/prcm.c, so that code can be removed later; and move low-level register accesses to the CM IP block to the CM code, which will soon be moved into drivers/. Signed-off-by: Paul Walmsley Tested-by: Vaibhav Hiremath --- arch/arm/mach-omap2/clock2430_data.c | 1 - 1 file changed, 1 deletion(-) (limited to 'arch/arm/mach-omap2/clock2430_data.c') diff --git a/arch/arm/mach-omap2/clock2430_data.c b/arch/arm/mach-omap2/clock2430_data.c index 6f1e26c21b91..b179b6ef4329 100644 --- a/arch/arm/mach-omap2/clock2430_data.c +++ b/arch/arm/mach-omap2/clock2430_data.c @@ -2027,7 +2027,6 @@ int __init omap2430_clk_init(void) struct omap_clk *c; prcm_clksrc_ctrl = OMAP2430_PRCM_CLKSRC_CTRL; - cm_idlest_pll = OMAP_CM_REGADDR(PLL_MOD, CM_IDLEST); cpu_mask = RATE_IN_243X; rate_table = omap2430_rate_table; -- cgit v1.2.3