OMAP3 SRF: Add virt clk nodes for VDD1/VDD2
Subsystems (5)
PATCH 3/8 OMAP3 SRF: Add virt clk nodes for VDD1/VDD2
The patch defines virtual nodes for VDD1 and VDD2
Signed-off-by Rajendra Nayak <[email protected]>
--- arch/arm/mach-omap2/clock34xx.c | 197 +++++++++++++++++++++++++----- arch/arm/mach-omap2/clock34xx.h | 25 +++ arch/arm/mach-omap2/io.c | 5 arch/arm/plat-omap/include/mach/omap-pm.h | 18 +- arch/arm/plat-omap/omap-pm-noop.c | 20 +-- arch/arm/plat-omap/omap-pm-srf.c | 20 +-- 6 files changed, 229 insertions(+), 56 deletions(-)
arch/arm/mach-omap2/clock34xx.h +25 -0
@@ -20,6 +20,7 @@#define __ARCH_ARM_MACH_OMAP2_CLOCK34XX_H#include <mach/control.h> +#include <mach/omap-pm.h> #include "clock.h" #include "cm.h"
@@ -36,6 +37,9 @@ static int omap3_noncore_dpll_enable(strstatic void omap3_noncore_dpll_disable (struct clk *clk);static int omap3_noncore_dpll_set_rate (struct clk *clk,unsigned long rate);static int omap3_core_dpll_m2_set_rate (struct clk *clk,unsigned long rate); +static void omap3_table_recalc (struct clk *clk); +static long omap3_round_to_table_rate (struct clk *clk,unsigned long rate); +static int omap3_select_table_rate (struct clk *clk,unsigned long rate);/* Maximum DPLL multiplier, divider values for OMAP3 */ #define OMAP3_MAX_DPLL_MULT 2048
@@ -3388,6 +3392,24 @@ static struct clk wdt1_fck = { .recalc = &followparent_recalc, }; +static struct clk virt_vdd1_prcm_set = { + .name ="virt_vdd1_prcm_set" , + .flags =CLOCK_IN_OMAP343X |VIRTUAL_CLOCK |ALWAYS_ENABLED , + .parent = &mpu_ck,/* Indexed by mpu speed, no parent */ + .recalc = &omap3_table_recalc,/*sets are keyed on mpu rate */ + .set_rate = &omap3_select_table_rate, + .round_rate = &omap3_round_to_table_rate, +}; + +static struct clk virt_vdd2_prcm_set = { + .name ="virt_vdd2_prcm_set" , + .flags =CLOCK_IN_OMAP343X |VIRTUAL_CLOCK |ALWAYS_ENABLED , + .parent = &core_ck, + .recalc = &omap3_table_recalc, + .set_rate = &omap3_select_table_rate, + .round_rate = &omap3_round_to_table_rate, +}; +static struct clk *onchip_34xx_clks[]__initdata = { &omap_32k_fck, &virt_12m_ck,
@@ -3610,6 +3632,9 @@ static struct clk *onchip_34xx_clks[] __ &secure_32k_fck, &gpt12_fck, &wdt1_fck, +/* virtual group clock */ + &virt_vdd1_prcm_set, + &virt_vdd2_prcm_set, };#endif
arch/arm/mach-omap2/clock34xx.c +170 -27
245 lines not on this page · raw message
arch/arm/plat-omap/omap-pm-srf.c +10 -10
@@ -27,9 +27,9 @@#include <mach/resource.h> #include <mach/omapdev.h> -static struct omap_opp *dsp_opps; -static struct omap_opp *mpu_opps; -static struct omap_opp *l3_opps; +struct omap_opp *dsp_opps; +struct omap_opp *mpu_opps; +struct omap_opp *l3_opps;#define LAT_RES_POSTAMBLE "_latency"#define MAX_LATENCY_RES_NAME 30
@@ -340,19 +340,19 @@ void omap_pm_pwrdm_inactive(struct power* Should be called before clk framework since clk fw will call * omap_pm_pwrdm_{in,}active() */ -int __init omap_pm_if_early_init (void ) +int __init omap_pm_if_early_init (struct omap_opp *mpu_opp_table, +struct omap_opp *dsp_opp_table, +struct omap_opp *l3_opp_table) { + mpu_opps = mpu_opp_table; + dsp_opps = dsp_opp_table; + l3_opps = l3_opp_table;return 0 ; }/* Must be called after clock framework is initialized */ -int __init omap_pm_if_init (struct omap_opp *mpu_opp_table, -struct omap_opp *dsp_opp_table, -struct omap_opp *l3_opp_table) +int __init omap_pm_if_init (void ) { - mpu_opps = mpu_opp_table; - dsp_opps = dsp_opp_table; - l3_opps = l3_opp_table;resource_init (resources_omap);return 0 ; }
arch/arm/plat-omap/include/mach/omap-pm.h +11 -7
@@ -33,6 +33,10 @@ struct omap_opp {u16 min_vdd; }; +extern struct omap_opp *mpu_opps; +extern struct omap_opp *dsp_opps; +extern struct omap_opp *l3_opps; +/* * agent_id values for use with omap_pm_set_min_bus_tput(): *
@@ -46,25 +50,25 @@ struct omap_opp {/** * omap_pm_if_early_init - OMAP PM init code called before clock fw init +* @mpu_opp_table: array ptr to struct omap_opp for MPU +* @dsp_opp_table: array ptr to struct omap_opp for DSP +* @l3_opp_table : array ptr to struct omap_opp for CORE * * Initialize anything that must be configured before the clock * framework starts. The "_if_" is to avoid name collisions with the * PM idle-loop code. */ -int __init omap_pm_if_early_init (void ); +int __init omap_pm_if_early_init (struct omap_opp *mpu_opp_table, +struct omap_opp *dsp_opp_table, +struct omap_opp *l3_opp_table);/** * omap_pm_if_init - OMAP PM init code called after clock fw init -* @mpu_opp_table: array ptr to struct omap_opp for MPU -* @dsp_opp_table: array ptr to struct omap_opp for DSP -* @l3_opp_table : array ptr to struct omap_opp for CORE * * The main initialization code. OPP tables are passed in here. The * "_if_" is to avoid name collisions with the PM idle-loop code. */ -int __init omap_pm_if_init (struct omap_opp *mpu_opp_table, -struct omap_opp *dsp_opp_table, -struct omap_opp *l3_opp_table); +int __init omap_pm_if_init (void );/** * omap_pm_if_exit - OMAP PM exit code
arch/arm/mach-omap2/io.c +3 -2
@@ -204,12 +204,13 @@ void __init omap2_init_common_hw(struct struct omap_opp *l3_opps) {omap2_mux_init (); -omap_pm_if_early_init (); +/* The OPP tables have to be registered before a clk init */ +omap_pm_if_early_init (mpu_opps, dsp_opps, l3_opps);pwrdm_init (powerdomains_omap);clkdm_init (clockdomains_omap, clkdm_pwrdm_autodeps);omapdev_init (omapdevs);omap2_clk_init (); -omap_pm_if_init (mpu_opps, dsp_opps, l3_opps); +omap_pm_if_init ();omap2_sdrc_init (sp);gpmc_init (); }
arch/arm/plat-omap/omap-pm-noop.c +10 -10
@@ -26,9 +26,9 @@#include <mach/powerdomain.h> -static struct omap_opp *dsp_opps; -static struct omap_opp *mpu_opps; -static struct omap_opp *l3_opps; +struct omap_opp *dsp_opps; +struct omap_opp *mpu_opps; +struct omap_opp *l3_opps;/* * Device-driver-originated constraints (via board-*.c files)
@@ -310,19 +310,19 @@ void omap_pm_pwrdm_inactive(struct power* Should be called before clk framework since clk fw will call * omap_pm_pwrdm_{in,}active() */ -int __init omap_pm_if_early_init (void ) +int __init omap_pm_if_early_init (struct omap_opp *mpu_opp_table, +struct omap_opp *dsp_opp_table, +struct omap_opp *l3_opp_table) { + mpu_opps = mpu_opp_table; + dsp_opps = dsp_opp_table; + l3_opps = l3_opp_table;return 0 ; }/* Must be called after clock framework is initialized */ -int __init omap_pm_if_init (struct omap_opp *mpu_opp_table, -struct omap_opp *dsp_opp_table, -struct omap_opp *l3_opp_table) +int __init omap_pm_if_init (void ) { - mpu_opps = mpu_opp_table; - dsp_opps = dsp_opp_table; - l3_opps = l3_opp_table;return 0 ; }