OMAP3630 Clock changes
v6 cover OMAP3630 Clock changes
THis patch series has Clock changes related to OMAP3630. The major Clock releated changes are
1. DPLL4 type has changed to j type.
2. CLKSEL field width is increased for DPLL4 M2, M3, M4, M5 and M6
3. DPLL4 M2 o/p can be either 96MHz or 192 Mhz (to support SGX@192).
All the patches have been tested on OMAP3630 ZOOM3 and OMAP3430 ZOOM2 platforms. Comments adressed in V4:
1. Remove sd_div_mask and dco_sel_mask
2. Remove reference to FREQSEL for 3630
3. Avoid dynamically overwriting Fields in Clock nodes
Comments Addressed in V5:
1. Comments from Eduardo Valentin, cosmetic changes and splitting of the patch for freqsel changes
2. Comments from Paul regarding updation of Clock nodes
Comments Addressed in V6:
1. Cosmetic changes based on Comments from Alex and Paul
2. Added DPLL MULT Mask for 3630 based on Paul's comments
Richard Woodruff (1):
OMAP3: introduce DPLL4 Jtype
Vishwanath BS (3):
OMAP3: Introduce 3630 DPLL4 HSDivider changes
OMAP3: add support for 192Mhz DPLL4M2 output
arch/arm/mach-omap2/clock.h | 4 + arch/arm/mach-omap2/clock34xx_data.c | 240 ++++++++++++++++++++++++++++--- arch/arm/mach-omap2/clock44xx_data.c | 1 + arch/arm/mach-omap2/cm-regbits-34xx.h | 12 ++ arch/arm/mach-omap2/dpll3xxx.c | 47 ++++++- arch/arm/mach-omap2/id.c | 3 + arch/arm/plat-omap/include/plat/clock.h | 10 +- arch/arm/plat-omap/include/plat/cpu.h | 2 + 8 files changed, 299 insertions(+), 20 deletions(-)
PATCH v6 1/3 OMAP3: introduce DPLL4 Jtype
From: Richard Woodruff <[email protected]>
DPLL4 for 3630 introduces a changed block called j type dpll, requiring special divisor bits and additional reg fields. To allow for silicons to use this, this is introduced as a flag and is enabled for 3630 silicon. OMAP4 also has j type dpll for usb.
Tested with 3630 ZOOM3 and OMAP3430 ZOOM2
--- arch/arm/mach-omap2/clock.h | 4 ++ arch/arm/mach-omap2/clock34xx_data.c | 32 ++++++++++++++++++++- arch/arm/mach-omap2/clock44xx_data.c | 1 + arch/arm/mach-omap2/cm-regbits-34xx.h | 5 +++ arch/arm/mach-omap2/dpll3xxx.c | 47 ++++++++++++++++++++++++++++++- arch/arm/plat-omap/include/plat/clock.h | 5 +++ 6 files changed, 92 insertions(+), 2 deletions(-)
arch/arm/mach-omap2/clock.h +4 -0
@@ -47,6 +47,10 @@#define DPLL_LOW_POWER_BYPASS 0x5#define DPLL_LOCKED 0x7 +/* DPLL Type and DCO Selection Flags */ +#define DPLL_J_TYPE 0x1 +#define DPLL_NO_DCO_SEL 0x2 +int omap2_clk_enable (struct clk *clk);void omap2_clk_disable (struct clk *clk);long omap2_clk_round_rate (struct clk *clk,unsigned long rate);
arch/arm/mach-omap2/clock34xx_data.c +31 -1
@@ -38,6 +38,7 @@/* Maximum DPLL multiplier, divider values for OMAP3 */ #define OMAP3_MAX_DPLL_MULT 2048 +#define OMAP3630_MAX_JTYPE_DPLL_MULT 4095#define OMAP3_MAX_DPLL_DIV 128/*
@@ -529,7 +530,8 @@ static struct clk emu_core_alwon_ck = {/* DPLL4 */ /* Supplies 96MHz, 54Mhz TV DAC, DSS fclk, CAM sensor clock, emul trace clk */ /* Type: DPLL */ -static struct dpll_data dpll4_dd = { +static struct dpll_data dpll4_dd; +static struct dpll_data dpll4_dd_34xx__initdata = { .mult_div1_reg =OMAP_CM_REGADDR (PLL_MOD ,CM_CLKSEL2 ), .mult_mask =OMAP3430_PERIPH_DPLL_MULT_MASK , .div1_mask =OMAP3430_PERIPH_DPLL_DIV_MASK ,
@@ -552,6 +554,29 @@ static struct dpll_data dpll4_dd = { .rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE }; +static struct dpll_data dpll4_dd_3630__initdata = { + .mult_div1_reg =OMAP_CM_REGADDR (PLL_MOD ,CM_CLKSEL2 ), + .mult_mask =OMAP3630_PERIPH_DPLL_MULT_MASK , + .div1_mask =OMAP3430_PERIPH_DPLL_DIV_MASK , + .clk_bypass = &sys_ck, + .clk_ref = &sys_ck, + .control_reg =OMAP_CM_REGADDR (PLL_MOD ,CM_CLKEN ), + .enable_mask =OMAP3430_EN_PERIPH_DPLL_MASK , + .modes = (1 <<DPLL_LOW_POWER_STOP ) | (1 <<DPLL_LOCKED ), + .auto_recal_bit =OMAP3430_EN_PERIPH_DPLL_DRIFTGUARD_SHIFT , + .recal_en_bit =OMAP3430_PERIPH_DPLL_RECAL_EN_SHIFT , + .recal_st_bit =OMAP3430_PERIPH_DPLL_ST_SHIFT , + .autoidle_reg =OMAP_CM_REGADDR (PLL_MOD ,CM_AUTOIDLE ), + .autoidle_mask =OMAP3430_AUTO_PERIPH_DPLL_MASK , + .idlest_reg =OMAP_CM_REGADDR (PLL_MOD ,CM_IDLEST ), + .idlest_mask =OMAP3430_ST_PERIPH_CLK_MASK , + .max_multiplier =OMAP3630_MAX_JTYPE_DPLL_MULT , + .min_divider =1 , + .max_divider =OMAP3_MAX_DPLL_DIV , + .rate_tolerance =DEFAULT_DPLL_RATE_TOLERANCE , + .flags =DPLL_J_TYPE +}; +static struct clk dpll4_ck = { .name ="dpll4_ck" , .ops = &omap3_clkops_noncore_dpll_ops,
@@ -3240,6 +3265,11 @@ int __init omap3xxx_clk_init(void) } } +if (cpu_is_omap3630 ()) + dpll4_dd = dpll4_dd_3630; +else + dpll4_dd = dpll4_dd_34xx; +clk_init (&omap2_clk_functions);for (c = omap3xxx_clks; c < omap3xxx_clks +ARRAY_SIZE (omap3xxx_clks); c++)
arch/arm/mach-omap2/clock44xx_data.c +1 -0
@@ -980,6 +980,7 @@ static struct dpll_data dpll_usb_dd = { .max_multiplier = OMAP4430_MAX_DPLL_MULT, .max_divider = OMAP4430_MAX_DPLL_DIV, .min_divider = 1, + .flags = DPLL_J_TYPE | DPLL_NO_DCO_SEL };
arch/arm/mach-omap2/cm-regbits-34xx.h +5 -0
@@ -517,8 +517,13 @@/* CM_CLKSEL2_PLL */ #define OMAP3430_PERIPH_DPLL_MULT_SHIFT 8#define OMAP3430_PERIPH_DPLL_MULT_MASK (0x7ff << 8) +#define OMAP3630_PERIPH_DPLL_MULT_MASK (0xfff << 8)#define OMAP3430_PERIPH_DPLL_DIV_SHIFT 0#define OMAP3430_PERIPH_DPLL_DIV_MASK (0x7f << 0) +#define OMAP3630_PERIPH_DPLL_DCO_SEL_SHIFT 21 +#define OMAP3630_PERIPH_DPLL_DCO_SEL_MASK (0x7 << 21) +#define OMAP3630_PERIPH_DPLL_SD_DIV_SHIFT 24 +#define OMAP3630_PERIPH_DPLL_SD_DIV_MASK (0xff << 24)/* CM_CLKSEL3_PLL */ #define OMAP3430_DIV_96M_SHIFT 0
arch/arm/mach-omap2/dpll3xxx.c +46 -1
65 lines not on this page · raw message
arch/arm/plat-omap/include/plat/clock.h +5 -0
@@ -39,6 +39,10 @@ struct clksel {const struct clksel_rate *rates; }; +/* +* A new flag called flag has been added which indiciates what is the type +* of dpll (like j_type, no_dco_sel) +*/ struct dpll_data {void __iomem *mult_div1_reg;u32 mult_mask;
@@ -65,6 +69,7 @@ struct dpll_data {u8 auto_recal_bit;u8 recal_en_bit;u8 recal_st_bit; +u8 flags;# endif };
Signature · 1 line
1.5.6.3
PATCH v6 2/3 OMAP3: Introduce 3630 DPLL4 HSDivider changes
Divider (M2, M3, M4, M5 and M6) field width has been increased by 1 bit in 3630. This patch has changes to accommodate this in CM dynamically based on chip version.
Basically new clock nodes have been added for 3630 DPLL4 M2,M3,M4,M5 and M6 and value of these nodes are used if cpu type is 3630.
--- arch/arm/mach-omap2/clock34xx_data.c | 140 +++++++++++++++++++++++++++++-- arch/arm/mach-omap2/cm-regbits-34xx.h | 5 + arch/arm/plat-omap/include/plat/clock.h | 5 +- 3 files changed, 141 insertions(+), 9 deletions(-)
arch/arm/mach-omap2/clock34xx_data.c +133 -7
@@ -237,6 +237,42 @@ static const struct clksel_rate div16_dpll_rates[] = { { .div = 0 } }; +static const struct clksel_rate div32_dpll4_rates_3630[] = { + { .div =1 , .val =1 , .flags =RATE_IN_36XX |DEFAULT_RATE }, + { .div =2 , .val =2 , .flags =RATE_IN_36XX }, + { .div =3 , .val =3 , .flags =RATE_IN_36XX }, + { .div =4 , .val =4 , .flags =RATE_IN_36XX }, + { .div =5 , .val =5 , .flags =RATE_IN_36XX }, + { .div =6 , .val =6 , .flags =RATE_IN_36XX }, + { .div =7 , .val =7 , .flags =RATE_IN_36XX }, + { .div =8 , .val =8 , .flags =RATE_IN_36XX }, + { .div =9 , .val =9 , .flags =RATE_IN_36XX }, + { .div =10 , .val =10 , .flags =RATE_IN_36XX }, + { .div =11 , .val =11 , .flags =RATE_IN_36XX }, + { .div =12 , .val =12 , .flags =RATE_IN_36XX }, + { .div =13 , .val =13 , .flags =RATE_IN_36XX }, + { .div =14 , .val =14 , .flags =RATE_IN_36XX }, + { .div =15 , .val =15 , .flags =RATE_IN_36XX }, + { .div =16 , .val =16 , .flags =RATE_IN_36XX }, + { .div =17 , .val =17 , .flags =RATE_IN_36XX }, + { .div =18 , .val =18 , .flags =RATE_IN_36XX }, + { .div =19 , .val =19 , .flags =RATE_IN_36XX }, + { .div =20 , .val =20 , .flags =RATE_IN_36XX }, + { .div =21 , .val =21 , .flags =RATE_IN_36XX }, + { .div =22 , .val =22 , .flags =RATE_IN_36XX }, + { .div =23 , .val =23 , .flags =RATE_IN_36XX }, + { .div =24 , .val =24 , .flags =RATE_IN_36XX }, + { .div =25 , .val =25 , .flags =RATE_IN_36XX }, + { .div =26 , .val =26 , .flags =RATE_IN_36XX }, + { .div =27 , .val =27 , .flags =RATE_IN_36XX }, + { .div =28 , .val =28 , .flags =RATE_IN_36XX }, + { .div =29 , .val =29 , .flags =RATE_IN_36XX }, + { .div =30 , .val =30 , .flags =RATE_IN_36XX }, + { .div =31 , .val =31 , .flags =RATE_IN_36XX }, + { .div =32 , .val =32 , .flags =RATE_IN_36XX }, + { .div =0 } +}; +/* DPLL1 */ /* MPU clock source */ /* Type: DPLL */
@@ -606,8 +642,15 @@ static const struct clksel div16_dpll4_clksel[] = { { .parent = NULL } }; +static const struct clksel div32_dpll4_clksel[] = { + { .parent = &dpll4_ck, .rates = div32_dpll4_rates_3630 }, + { .parent =NULL } +}; +/* This virtual clock is the source for dpll4_m2x2_ck */ -static struct clk dpll4_m2_ck = { +static struct clk dpll4_m2_ck; + +static struct clk dpll4_m2_ck_34xx__initdata = { .name ="dpll4_m2_ck" , .ops = &clkops_null, .parent = &dpll4_ck,
@@ -619,6 +662,18 @@ static struct clk dpll4_m2_ck = { .recalc = &omap2_clksel_recalc, }; +static struct clk dpll4_m2_ck_3630__initdata = { + .name ="dpll4_m2_ck" , + .ops = &clkops_null, + .parent = &dpll4_ck, + .init = &omap2_init_clksel_parent, + .clksel_reg =OMAP_CM_REGADDR (PLL_MOD ,OMAP3430_CM_CLKSEL3 ), + .clksel_mask =OMAP3630_DIV_96M_MASK , + .clksel = div32_dpll4_clksel, + .clkdm_name ="dpll4_clkdm" , + .recalc = &omap2_clksel_recalc, +}; +/* The PWRDN bit is apparently only available on 3430ES2 and above */ static struct clk dpll4_m2x2_ck = { .name ="dpll4_m2x2_ck" ,
@@ -679,7 +734,9 @@ static struct clk omap_96m_fck = { };/* This virtual clock is the source for dpll4_m3x2_ck */ -static struct clk dpll4_m3_ck = { +static struct clk dpll4_m3_ck; + +static struct clk dpll4_m3_ck_34xx__initdata = { .name ="dpll4_m3_ck" , .ops = &clkops_null, .parent = &dpll4_ck,
@@ -691,6 +748,18 @@ static struct clk dpll4_m3_ck = { .recalc = &omap2_clksel_recalc, }; +static struct clk dpll4_m3_ck_3630__initdata = { + .name ="dpll4_m3_ck" , + .ops = &clkops_null, + .parent = &dpll4_ck, + .init = &omap2_init_clksel_parent, + .clksel_reg =OMAP_CM_REGADDR (OMAP3430_DSS_MOD ,CM_CLKSEL ), + .clksel_mask =OMAP3630_CLKSEL_TV_MASK , + .clksel = div32_dpll4_clksel, + .clkdm_name ="dpll4_clkdm" , + .recalc = &omap2_clksel_recalc, +}; +/* The PWRDN bit is apparently only available on 3430ES2 and above */ static struct clk dpll4_m3x2_ck = { .name ="dpll4_m3x2_ck" ,
@@ -764,7 +833,9 @@ static struct clk omap_12m_fck = { };/* This virstual clock is the source for dpll4_m4x2_ck */ -static struct clk dpll4_m4_ck = { +static struct clk dpll4_m4_ck; + +static struct clk dpll4_m4_ck_34xx__initdata = { .name ="dpll4_m4_ck" , .ops = &clkops_null, .parent = &dpll4_ck,
@@ -778,6 +849,20 @@ static struct clk dpll4_m4_ck = { .round_rate = &omap2_clksel_round_rate, }; +static struct clk dpll4_m4_ck_3630__initdata = { + .name ="dpll4_m4_ck" , + .ops = &clkops_null, + .parent = &dpll4_ck, + .init = &omap2_init_clksel_parent, + .clksel_reg =OMAP_CM_REGADDR (OMAP3430_DSS_MOD ,CM_CLKSEL ), + .clksel_mask =OMAP3630_CLKSEL_DSS1_MASK , + .clksel = div32_dpll4_clksel, + .clkdm_name ="dpll4_clkdm" , + .recalc = &omap2_clksel_recalc, + .set_rate = &omap2_clksel_set_rate, + .round_rate = &omap2_clksel_round_rate, +}; +/* The PWRDN bit is apparently only available on 3430ES2 and above */ static struct clk dpll4_m4x2_ck = { .name ="dpll4_m4x2_ck" ,
@@ -791,7 +876,9 @@ static struct clk dpll4_m4x2_ck = { };/* This virtual clock is the source for dpll4_m5x2_ck */ -static struct clk dpll4_m5_ck = { +static struct clk dpll4_m5_ck; + +static struct clk dpll4_m5_ck_34xx__initdata = { .name ="dpll4_m5_ck" , .ops = &clkops_null, .parent = &dpll4_ck,
@@ -805,6 +892,18 @@ static struct clk dpll4_m5_ck = { .recalc = &omap2_clksel_recalc, }; +static struct clk dpll4_m5_ck_3630__initdata = { + .name ="dpll4_m5_ck" , + .ops = &clkops_null, + .parent = &dpll4_ck, + .init = &omap2_init_clksel_parent, + .clksel_reg =OMAP_CM_REGADDR (OMAP3430_CAM_MOD ,CM_CLKSEL ), + .clksel_mask =OMAP3630_CLKSEL_CAM_MASK , + .clksel = div32_dpll4_clksel, + .clkdm_name ="dpll4_clkdm" , + .recalc = &omap2_clksel_recalc, +}; +/* The PWRDN bit is apparently only available on 3430ES2 and above */ static struct clk dpll4_m5x2_ck = { .name ="dpll4_m5x2_ck" ,
@@ -818,7 +917,9 @@ static struct clk dpll4_m5x2_ck = { };/* This virtual clock is the source for dpll4_m6x2_ck */ -static struct clk dpll4_m6_ck = { +static struct clk dpll4_m6_ck; + +static struct clk dpll4_m6_ck_34xx__initdata = { .name ="dpll4_m6_ck" , .ops = &clkops_null, .parent = &dpll4_ck,
@@ -830,6 +931,18 @@ static struct clk dpll4_m6_ck = { .recalc = &omap2_clksel_recalc, }; +static struct clk dpll4_m6_ck_3630__initdata = { + .name ="dpll4_m6_ck" , + .ops = &clkops_null, + .parent = &dpll4_ck, + .init = &omap2_init_clksel_parent, + .clksel_reg =OMAP_CM_REGADDR (OMAP3430_EMU_MOD ,CM_CLKSEL1 ), + .clksel_mask =OMAP3630_DIV_DPLL4_MASK , + .clksel = div32_dpll4_clksel, + .clkdm_name ="dpll4_clkdm" , + .recalc = &omap2_clksel_recalc, +}; +/* The PWRDN bit is apparently only available on 3430ES2 and above */ static struct clk dpll4_m6x2_ck = { .name ="dpll4_m6x2_ck" ,
@@ -3265,10 +3378,23 @@ int __init omap3xxx_clk_init(void) } } -if (cpu_is_omap3630 ()) +if (cpu_is_omap3630 ()) { + cpu_mask |=RATE_IN_36XX ; + cpu_clkflg |=CK_36XX ; dpll4_dd = dpll4_dd_3630; -else + dpll4_m2_ck = dpll4_m2_ck_3630; + dpll4_m3_ck = dpll4_m3_ck_3630; + dpll4_m4_ck = dpll4_m4_ck_3630; + dpll4_m5_ck = dpll4_m5_ck_3630; + dpll4_m6_ck = dpll4_m6_ck_3630; + }else { dpll4_dd = dpll4_dd_34xx; + dpll4_m2_ck = dpll4_m2_ck_34xx; + dpll4_m3_ck = dpll4_m3_ck_34xx; + dpll4_m4_ck = dpll4_m4_ck_34xx; + dpll4_m5_ck = dpll4_m5_ck_34xx; + dpll4_m6_ck = dpll4_m6_ck_34xx; + }clk_init (&omap2_clk_functions);
arch/arm/mach-omap2/cm-regbits-34xx.h +5 -0
@@ -528,6 +528,7 @@/* CM_CLKSEL3_PLL */ #define OMAP3430_DIV_96M_SHIFT 0#define OMAP3430_DIV_96M_MASK (0x1f << 0) +#define OMAP3630_DIV_96M_MASK (0x3f << 0)/* CM_CLKSEL4_PLL */ #define OMAP3430ES2_PERIPH2_DPLL_MULT_SHIFT 8
@@ -574,8 +575,10 @@/* CM_CLKSEL_DSS */ #define OMAP3430_CLKSEL_TV_SHIFT 8#define OMAP3430_CLKSEL_TV_MASK (0x1f << 8) +#define OMAP3630_CLKSEL_TV_MASK (0x3f << 8)#define OMAP3430_CLKSEL_DSS1_SHIFT 0#define OMAP3430_CLKSEL_DSS1_MASK (0x1f << 0) +#define OMAP3630_CLKSEL_DSS1_MASK (0x3f << 0)/* CM_SLEEPDEP_DSS specific bits */
@@ -603,6 +606,7 @@/* CM_CLKSEL_CAM */ #define OMAP3430_CLKSEL_CAM_SHIFT 0#define OMAP3430_CLKSEL_CAM_MASK (0x1f << 0) +#define OMAP3630_CLKSEL_CAM_MASK (0x3f << 0)/* CM_SLEEPDEP_CAM specific bits */
@@ -698,6 +702,7 @@/* CM_CLKSEL1_EMU */ #define OMAP3430_DIV_DPLL4_SHIFT 24#define OMAP3430_DIV_DPLL4_MASK (0x1f << 24) +#define OMAP3630_DIV_DPLL4_MASK (0x3f << 24)#define OMAP3430_DIV_DPLL3_SHIFT 16#define OMAP3430_DIV_DPLL3_MASK (0x1f << 16)#define OMAP3430_CLKSEL_TRACECLK_SHIFT 11
arch/arm/plat-omap/include/plat/clock.h +3 -2
@@ -165,8 +165,9 @@ extern const struct clkops clkops_null;#define RATE_IN_242X (1 << 1)#define RATE_IN_243X (1 << 2)#define RATE_IN_343X (1 << 3)/* rates common to all 343X */ -#define RATE_IN_3430ES2 (1 << 4)/* 3430ES2 rates only */ -#define RATE_IN_4430 (1 << 5) +#define RATE_IN_3430ES2 (1 << 4)/* 3430ES2 rates only */ +#define RATE_IN_36XX (1 << 5) +#define RATE_IN_4430 (1 << 6)#define RATE_IN_24XX (RATE_IN_242X | RATE_IN_243X)
Signature · 1 line
1.5.6.3
PATCH v6 3/3 OMAP3: add support for 192Mhz DPLL4M2 output
In 3630, DPLL4M2 o/p can be 96MH or 192MHz (for SGX to run at 192). This patch has changes to support this feature. 96MHz clock is generated by dividing 192Mhz clock by 2 using CM_CLKSEL_CORE register. SGX can select Core Clock, 192MHz clock or CM_96M_FCLK as it's functional clock. In summary changes done are 1. Added a feature called omap3_has_192mhz_clk and enabled for 3630 2. Added a new clock node called omap_192m_alwon_ck 3. Made omap_96m_alwon_fck to derive it's clock from omap_192m_alwon_ck
--- arch/arm/mach-omap2/clock34xx_data.c | 72 ++++++++++++++++++++++++++++----- arch/arm/mach-omap2/cm-regbits-34xx.h | 2 + arch/arm/mach-omap2/id.c | 3 + arch/arm/plat-omap/include/plat/cpu.h | 2 + 4 files changed, 68 insertions(+), 11 deletions(-)
arch/arm/mach-omap2/clock34xx_data.c +61 -11
@@ -692,18 +692,24 @@ static struct clk dpll4_m2x2_ck = {* 96M_ALWON_FCLK (called "omap_96m_alwon_fck" below) and * CM_96K_(F)CLK. */ -static struct clk omap_96m_alwon_fck = { - .name ="omap_96m_alwon_fck" , - .ops = &clkops_null, - .parent = &dpll4_m2x2_ck, - .recalc = &followparent_recalc, + +/* Adding 192MHz Clock node needed by SGX */ +static struct clk omap_192m_alwon_fck = { + .name ="omap_192m_alwon_fck" , + .ops = &clkops_null, + .parent = &dpll4_m2x2_ck, + .recalc = &followparent_recalc, }; -static struct clk cm_96m_fck = { - .name ="cm_96m_fck" , - .ops = &clkops_null, - .parent = &omap_96m_alwon_fck, - .recalc = &followparent_recalc, +static const struct clksel_rate omap_96m_alwon_fck_rates[] = { + { .div =1 , .val =1 , .flags =RATE_IN_36XX }, + { .div =2 , .val =2 , .flags =RATE_IN_36XX |DEFAULT_RATE }, + { .div =0 } +}; + +static const struct clksel omap_96m_alwon_fck_clksel[] = { + { .parent = &omap_192m_alwon_fck, .rates = omap_96m_alwon_fck_rates }, + { .parent =NULL } };static const struct clksel_rate omap_96m_dpll_rates[] = {
@@ -716,6 +722,31 @@ static const struct clksel_rate omap_96m_sys_rates[] = { { .div = 0 } }; +static struct clk omap_96m_alwon_fck = { + .name ="omap_96m_alwon_fck" , + .ops = &clkops_null, + .parent = &dpll4_m2x2_ck, + .recalc = &followparent_recalc, +}; + +static struct clk omap_96m_alwon_fck_3630 = { + .name ="omap_96m_alwon_fck" , + .parent = &omap_192m_alwon_fck, + .init = &omap2_init_clksel_parent, + .ops = &clkops_null, + .recalc = &omap2_clksel_recalc, + .clksel_reg =OMAP_CM_REGADDR (CORE_MOD ,CM_CLKSEL ), + .clksel_mask =OMAP3630_CLKSEL_96M_MASK , + .clksel = omap_96m_alwon_fck_clksel +}; + +static struct clk cm_96m_fck = { + .name ="cm_96m_fck" , + .ops = &clkops_null, + .parent = &omap_96m_alwon_fck, + .recalc = &followparent_recalc, +}; +static const struct clksel omap_96m_fck_clksel[] = { { .parent = &cm_96m_fck, .rates = omap_96m_dpll_rates }, { .parent = &sys_ck, .rates = omap_96m_sys_rates },
@@ -1304,12 +1335,24 @@ static struct clk gfx_cg2_ck = {/* SGX power domain - 3430ES2 only */ static const struct clksel_rate sgx_core_rates[] = { + { .div =2 , .val =5 , .flags =RATE_IN_36XX }, { .div =3 , .val =0 , .flags =RATE_IN_343X |DEFAULT_RATE }, { .div =4 , .val =1 , .flags =RATE_IN_343X }, { .div =6 , .val =2 , .flags =RATE_IN_343X }, { .div =0 }, }; +static const struct clksel_rate sgx_192m_rates[] = { + { .div =1 , .val =4 , .flags =RATE_IN_36XX |DEFAULT_RATE }, + { .div =0 }, +}; + +static const struct clksel_rate sgx_corex2_rates[] = { + { .div =3 , .val =6 , .flags =RATE_IN_36XX |DEFAULT_RATE }, + { .div =5 , .val =7 , .flags =RATE_IN_36XX }, + { .div =0 }, +}; +static const struct clksel_rate sgx_96m_rates[] = { { .div =1 , .val =3 , .flags =RATE_IN_343X |DEFAULT_RATE }, { .div =0 },
@@ -1318,7 +1361,9 @@ static const struct clksel_rate sgx_96m_rates[] = {static const struct clksel sgx_clksel[] = { { .parent = &core_ck, .rates = sgx_core_rates }, { .parent = &cm_96m_fck, .rates = sgx_96m_rates }, - { .parent =NULL }, + { .parent = &omap_192m_alwon_fck, .rates = sgx_192m_rates }, + { .parent = &corex2_fck, .rates = sgx_corex2_rates }, + { .parent =NULL } };static struct clk sgx_fck = {
@@ -1332,6 +1377,8 @@ static struct clk sgx_fck = { .clksel = sgx_clksel, .clkdm_name = "sgx_clkdm", .recalc = &omap2_clksel_recalc, + .set_rate = &omap2_clksel_set_rate, + .round_rate = &omap2_clksel_round_rate };static struct clk sgx_ick = {
@@ -3155,6 +3202,7 @@ static struct omap_clk omap3xxx_clks[] = {CLK ("etb" ,"emu_core_alwon_ck" , &emu_core_alwon_ck,CK_3XXX ),CLK (NULL ,"dpll4_ck" , &dpll4_ck,CK_3XXX ),CLK (NULL ,"dpll4_x2_ck" , &dpll4_x2_ck,CK_3XXX ), +CLK (NULL ,"omap_192m_alwon_fck" , &omap_192m_alwon_fck,CK_36XX ),CLK (NULL ,"omap_96m_alwon_fck" , &omap_96m_alwon_fck,CK_3XXX ),CLK (NULL ,"omap_96m_fck" , &omap_96m_fck,CK_3XXX ), CLK(NULL, "cm_96m_fck", &cm_96m_fck, CK_3XXX),
@@ -3395,6 +3443,8 @@ int __init omap3xxx_clk_init(void) dpll4_m5_ck = dpll4_m5_ck_34xx; dpll4_m6_ck = dpll4_m6_ck_34xx; } +if (omap3_has_192mhz_clk ()) + omap_96m_alwon_fck = omap_96m_alwon_fck_3630;clk_init (&omap2_clk_functions);
arch/arm/mach-omap2/cm-regbits-34xx.h +2 -0
@@ -336,6 +336,8 @@#define OMAP3430_CLKSEL_L4_MASK (0x3 << 2)#define OMAP3430_CLKSEL_L3_SHIFT 0#define OMAP3430_CLKSEL_L3_MASK (0x3 << 0) +#define OMAP3630_CLKSEL_96M_SHIFT 12 +#define OMAP3630_CLKSEL_96M_MASK (0x3 << 12)/* CM_CLKSTCTRL_CORE */ #define OMAP3430ES1_CLKTRCTRL_D2D_SHIFT 4
arch/arm/mach-omap2/id.c +3 -0
@@ -175,6 +175,8 @@ void __init omap3_check_features(void)OMAP3_CHECK_FEATURE (status,SGX );OMAP3_CHECK_FEATURE (status,NEON );OMAP3_CHECK_FEATURE (status,ISP ); +if (cpu_is_omap3630 ()) + omap3_features |=OMAP3_HAS_192MHZ_CLK ;/* * TODO: Get additional info (where applicable)
@@ -359,6 +361,7 @@ void __init omap3_cpuinfo(void)OMAP3_SHOW_FEATURE (sgx);OMAP3_SHOW_FEATURE (neon);OMAP3_SHOW_FEATURE (isp); + OMAP3_SHOW_FEATURE(192mhz_clk);printk (")\n" ); }
arch/arm/plat-omap/include/plat/cpu.h +2 -0
@@ -439,6 +439,7 @@ extern u32 omap3_features;#define OMAP3_HAS_SGX BIT(2)#define OMAP3_HAS_NEON BIT(3)#define OMAP3_HAS_ISP BIT(4) +#define OMAP3_HAS_192MHZ_CLK BIT(5)#define OMAP3_HAS_FEATURE (feat,flag) \ static inline unsigned int omap3_has_ ##feat(void) \
@@ -451,5 +452,6 @@ OMAP3_HAS_FEATURE(sgx, SGX) OMAP3_HAS_FEATURE(iva, IVA) OMAP3_HAS_FEATURE(neon, NEON) OMAP3_HAS_FEATURE(isp, ISP) +OMAP3_HAS_FEATURE(192mhz_clk, 192MHZ_CLK)#endif
Signature · 1 line
1.5.6.3
Paul Walmsley
maintainerRe: [PATCHV6 3/3] OMAP3: add support for 192Mhz DPLL4M2 output
Hi,
Quoted 9 lines · Vishwanath BS
In 3630, DPLL4M2 o/p can be 96MH or 192MHz (for SGX to run at 192). This patch has changes to support this feature. 96MHz clock is generated by dividing 192Mhz clock by 2 using
CM_CLKSEL_COREregister. SGX can select Core Clock, 192MHz clock orCM_96M_FCLKas it's functional clock. In summary changes done are 1. Added a feature calledomap3_has_192mhz_clkand enabled for 3630 2. Added a new clock node calledomap_192m_alwon_ck3. Madeomap_96m_alwon_fckto derive it's clock fromomap_192m_alwon_ck
Quoted 3 lines
Cc Paul Walmsley <[email protected]>Signed-off-by Vishwanath BS <[email protected]>
this patch still had a whitespace problem, but I fixed it up here and queued it for 2.6.34.
- Paul
Re: [PATCHV6 2/3] OMAP3: Introduce 3630 DPLL4 HSDivider changes
In reply to Vishwanath BSQuoted 7 lines · Vishwanath BS
Divider (M2, M3, M4, M5 and M6) field width has been increased by 1 bit in 3630. This patch has changes to accommodate this in CM dynamically based on chip version.
Basically new clock nodes have been added for 3630 DPLL4 M2,M3,M4,M5 and M6 and value of these nodes are used if cpu type is 3630.Signed-off-by Vishwanath BS <[email protected]>
thanks, applied with a few minor changes for 2.6.34; revised patch follows.
- Paul
From: Vishwanath BS <[email protected]>
Date: Wed, 10 Feb 2010 17:18:24 -0700
Subject: [PATCH] OMAP3 clock: Introduce 3630 DPLL4 HSDivider changes
Divider (M2, M3, M4, M5 and M6) field width has been increased by 1 bit in 3630. This patch has changes to accommodate this in CM dynamically based on chip version.
Basically new clock nodes have been added for 3630 DPLL4 M2,M3,M4,M5 and M6 and value of these nodes are used if cpu type is 3630.
--- arch/arm/mach-omap2/clock34xx_data.c | 146 +++++++++++++++++++++++++++++- arch/arm/mach-omap2/cm-regbits-34xx.h | 5 + arch/arm/plat-omap/include/plat/clock.h | 5 +- 3 files changed, 149 insertions(+), 7 deletions(-)
arch/arm/mach-omap2/clock34xx_data.c +141 -5
@@ -237,6 +237,42 @@ static const struct clksel_rate div16_dpll_rates[] = { { .div = 0 } }; +static const struct clksel_rate div32_dpll4_rates_3630[] = { + { .div =1 , .val =1 , .flags =RATE_IN_36XX |DEFAULT_RATE }, + { .div =2 , .val =2 , .flags =RATE_IN_36XX }, + { .div =3 , .val =3 , .flags =RATE_IN_36XX }, + { .div =4 , .val =4 , .flags =RATE_IN_36XX }, + { .div =5 , .val =5 , .flags =RATE_IN_36XX }, + { .div =6 , .val =6 , .flags =RATE_IN_36XX }, + { .div =7 , .val =7 , .flags =RATE_IN_36XX }, + { .div =8 , .val =8 , .flags =RATE_IN_36XX }, + { .div =9 , .val =9 , .flags =RATE_IN_36XX }, + { .div =10 , .val =10 , .flags =RATE_IN_36XX }, + { .div =11 , .val =11 , .flags =RATE_IN_36XX }, + { .div =12 , .val =12 , .flags =RATE_IN_36XX }, + { .div =13 , .val =13 , .flags =RATE_IN_36XX }, + { .div =14 , .val =14 , .flags =RATE_IN_36XX }, + { .div =15 , .val =15 , .flags =RATE_IN_36XX }, + { .div =16 , .val =16 , .flags =RATE_IN_36XX }, + { .div =17 , .val =17 , .flags =RATE_IN_36XX }, + { .div =18 , .val =18 , .flags =RATE_IN_36XX }, + { .div =19 , .val =19 , .flags =RATE_IN_36XX }, + { .div =20 , .val =20 , .flags =RATE_IN_36XX }, + { .div =21 , .val =21 , .flags =RATE_IN_36XX }, + { .div =22 , .val =22 , .flags =RATE_IN_36XX }, + { .div =23 , .val =23 , .flags =RATE_IN_36XX }, + { .div =24 , .val =24 , .flags =RATE_IN_36XX }, + { .div =25 , .val =25 , .flags =RATE_IN_36XX }, + { .div =26 , .val =26 , .flags =RATE_IN_36XX }, + { .div =27 , .val =27 , .flags =RATE_IN_36XX }, + { .div =28 , .val =28 , .flags =RATE_IN_36XX }, + { .div =29 , .val =29 , .flags =RATE_IN_36XX }, + { .div =30 , .val =30 , .flags =RATE_IN_36XX }, + { .div =31 , .val =31 , .flags =RATE_IN_36XX }, + { .div =32 , .val =32 , .flags =RATE_IN_36XX }, + { .div =0 } +}; +/* DPLL1 */ /* MPU clock source */ /* Type: DPLL */
@@ -606,8 +642,15 @@ static const struct clksel div16_dpll4_clksel[] = { { .parent = NULL } }; +static const struct clksel div32_dpll4_clksel[] = { + { .parent = &dpll4_ck, .rates = div32_dpll4_rates_3630 }, + { .parent =NULL } +}; +/* This virtual clock is the source for dpll4_m2x2_ck */ -static struct clk dpll4_m2_ck = { +static struct clk dpll4_m2_ck; + +static struct clk dpll4_m2_ck_34xx__initdata = { .name ="dpll4_m2_ck" , .ops = &clkops_null, .parent = &dpll4_ck,
@@ -619,6 +662,18 @@ static struct clk dpll4_m2_ck = { .recalc = &omap2_clksel_recalc, }; +static struct clk dpll4_m2_ck_3630__initdata = { + .name ="dpll4_m2_ck" , + .ops = &clkops_null, + .parent = &dpll4_ck, + .init = &omap2_init_clksel_parent, + .clksel_reg =OMAP_CM_REGADDR (PLL_MOD ,OMAP3430_CM_CLKSEL3 ), + .clksel_mask =OMAP3630_DIV_96M_MASK , + .clksel = div32_dpll4_clksel, + .clkdm_name ="dpll4_clkdm" , + .recalc = &omap2_clksel_recalc, +}; +/* The PWRDN bit is apparently only available on 3430ES2 and above */ static struct clk dpll4_m2x2_ck = { .name ="dpll4_m2x2_ck" ,
@@ -679,7 +734,9 @@ static struct clk omap_96m_fck = { };/* This virtual clock is the source for dpll4_m3x2_ck */ -static struct clk dpll4_m3_ck = { +static struct clk dpll4_m3_ck; + +static struct clk dpll4_m3_ck_34xx__initdata = { .name ="dpll4_m3_ck" , .ops = &clkops_null, .parent = &dpll4_ck,
@@ -691,6 +748,18 @@ static struct clk dpll4_m3_ck = { .recalc = &omap2_clksel_recalc, }; +static struct clk dpll4_m3_ck_3630__initdata = { + .name ="dpll4_m3_ck" , + .ops = &clkops_null, + .parent = &dpll4_ck, + .init = &omap2_init_clksel_parent, + .clksel_reg =OMAP_CM_REGADDR (OMAP3430_DSS_MOD ,CM_CLKSEL ), + .clksel_mask =OMAP3630_CLKSEL_TV_MASK , + .clksel = div32_dpll4_clksel, + .clkdm_name ="dpll4_clkdm" , + .recalc = &omap2_clksel_recalc, +}; +/* The PWRDN bit is apparently only available on 3430ES2 and above */ static struct clk dpll4_m3x2_ck = { .name ="dpll4_m3x2_ck" ,
@@ -764,7 +833,9 @@ static struct clk omap_12m_fck = { };/* This virstual clock is the source for dpll4_m4x2_ck */ -static struct clk dpll4_m4_ck = { +static struct clk dpll4_m4_ck; + +static struct clk dpll4_m4_ck_34xx__initdata = { .name ="dpll4_m4_ck" , .ops = &clkops_null, .parent = &dpll4_ck,
@@ -778,6 +849,20 @@ static struct clk dpll4_m4_ck = { .round_rate = &omap2_clksel_round_rate, }; +static struct clk dpll4_m4_ck_3630__initdata = { + .name ="dpll4_m4_ck" , + .ops = &clkops_null, + .parent = &dpll4_ck, + .init = &omap2_init_clksel_parent, + .clksel_reg =OMAP_CM_REGADDR (OMAP3430_DSS_MOD ,CM_CLKSEL ), + .clksel_mask =OMAP3630_CLKSEL_DSS1_MASK , + .clksel = div32_dpll4_clksel, + .clkdm_name ="dpll4_clkdm" , + .recalc = &omap2_clksel_recalc, + .set_rate = &omap2_clksel_set_rate, + .round_rate = &omap2_clksel_round_rate, +}; +/* The PWRDN bit is apparently only available on 3430ES2 and above */ static struct clk dpll4_m4x2_ck = { .name ="dpll4_m4x2_ck" ,
@@ -791,7 +876,9 @@ static struct clk dpll4_m4x2_ck = { };/* This virtual clock is the source for dpll4_m5x2_ck */ -static struct clk dpll4_m5_ck = { +static struct clk dpll4_m5_ck; + +static struct clk dpll4_m5_ck_34xx__initdata = { .name ="dpll4_m5_ck" , .ops = &clkops_null, .parent = &dpll4_ck,
@@ -805,6 +892,18 @@ static struct clk dpll4_m5_ck = { .recalc = &omap2_clksel_recalc, }; +static struct clk dpll4_m5_ck_3630__initdata = { + .name ="dpll4_m5_ck" , + .ops = &clkops_null, + .parent = &dpll4_ck, + .init = &omap2_init_clksel_parent, + .clksel_reg =OMAP_CM_REGADDR (OMAP3430_CAM_MOD ,CM_CLKSEL ), + .clksel_mask =OMAP3630_CLKSEL_CAM_MASK , + .clksel = div32_dpll4_clksel, + .clkdm_name ="dpll4_clkdm" , + .recalc = &omap2_clksel_recalc, +}; +/* The PWRDN bit is apparently only available on 3430ES2 and above */ static struct clk dpll4_m5x2_ck = { .name ="dpll4_m5x2_ck" ,
@@ -818,7 +917,9 @@ static struct clk dpll4_m5x2_ck = { };/* This virtual clock is the source for dpll4_m6x2_ck */ -static struct clk dpll4_m6_ck = { +static struct clk dpll4_m6_ck; + +static struct clk dpll4_m6_ck_34xx__initdata = { .name ="dpll4_m6_ck" , .ops = &clkops_null, .parent = &dpll4_ck,
@@ -830,6 +931,18 @@ static struct clk dpll4_m6_ck = { .recalc = &omap2_clksel_recalc, }; +static struct clk dpll4_m6_ck_3630__initdata = { + .name ="dpll4_m6_ck" , + .ops = &clkops_null, + .parent = &dpll4_ck, + .init = &omap2_init_clksel_parent, + .clksel_reg =OMAP_CM_REGADDR (OMAP3430_EMU_MOD ,CM_CLKSEL1 ), + .clksel_mask =OMAP3630_DIV_DPLL4_MASK , + .clksel = div32_dpll4_clksel, + .clkdm_name ="dpll4_clkdm" , + .recalc = &omap2_clksel_recalc, +}; +/* The PWRDN bit is apparently only available on 3430ES2 and above */ static struct clk dpll4_m6x2_ck = { .name ="dpll4_m6x2_ck" ,
@@ -3384,6 +3497,19 @@ int __init omap3xxx_clk_init(void) }if (cpu_is_omap3630 ()) { + cpu_mask |=RATE_IN_36XX ; + cpu_clkflg |=CK_36XX ; + +/* +* XXX This type of dynamic rewriting of the clock tree is +* deprecated and should be revised soon. +*/ + dpll4_m2_ck = dpll4_m2_ck_3630; + dpll4_m3_ck = dpll4_m3_ck_3630; + dpll4_m4_ck = dpll4_m4_ck_3630; + dpll4_m5_ck = dpll4_m5_ck_3630; + dpll4_m6_ck = dpll4_m6_ck_3630; +/* * For 3630: override clkops_omap2_dflt_wait for the * clocks affected from PWRDN reset Limitation
@@ -3400,6 +3526,16 @@ int __init omap3xxx_clk_init(void) &clkops_omap36xx_pwrdn_with_hsdiv_wait_restore; dpll4_m6x2_ck.ops = &clkops_omap36xx_pwrdn_with_hsdiv_wait_restore; + }else { +/* +* XXX This type of dynamic rewriting of the clock tree is +* deprecated and should be revised soon. +*/ + dpll4_m2_ck = dpll4_m2_ck_34xx; + dpll4_m3_ck = dpll4_m3_ck_34xx; + dpll4_m4_ck = dpll4_m4_ck_34xx; + dpll4_m5_ck = dpll4_m5_ck_34xx; + dpll4_m6_ck = dpll4_m6_ck_34xx; }if (cpu_is_omap3630 ())
arch/arm/mach-omap2/cm-regbits-34xx.h +5 -0
@@ -542,6 +542,7 @@/* CM_CLKSEL3_PLL */ #define OMAP3430_DIV_96M_SHIFT 0#define OMAP3430_DIV_96M_MASK (0x1f << 0) +#define OMAP3630_DIV_96M_MASK (0x3f << 0)/* CM_CLKSEL4_PLL */ #define OMAP3430ES2_PERIPH2_DPLL_MULT_SHIFT 8
@@ -588,8 +589,10 @@/* CM_CLKSEL_DSS */ #define OMAP3430_CLKSEL_TV_SHIFT 8#define OMAP3430_CLKSEL_TV_MASK (0x1f << 8) +#define OMAP3630_CLKSEL_TV_MASK (0x3f << 8)#define OMAP3430_CLKSEL_DSS1_SHIFT 0#define OMAP3430_CLKSEL_DSS1_MASK (0x1f << 0) +#define OMAP3630_CLKSEL_DSS1_MASK (0x3f << 0)/* CM_SLEEPDEP_DSS specific bits */
@@ -617,6 +620,7 @@/* CM_CLKSEL_CAM */ #define OMAP3430_CLKSEL_CAM_SHIFT 0#define OMAP3430_CLKSEL_CAM_MASK (0x1f << 0) +#define OMAP3630_CLKSEL_CAM_MASK (0x3f << 0)/* CM_SLEEPDEP_CAM specific bits */
@@ -712,6 +716,7 @@/* CM_CLKSEL1_EMU */ #define OMAP3430_DIV_DPLL4_SHIFT 24#define OMAP3430_DIV_DPLL4_MASK (0x1f << 24) +#define OMAP3630_DIV_DPLL4_MASK (0x3f << 24)#define OMAP3430_DIV_DPLL3_SHIFT 16#define OMAP3430_DIV_DPLL3_MASK (0x1f << 16)#define OMAP3430_CLKSEL_TRACECLK_SHIFT 11
arch/arm/plat-omap/include/plat/clock.h +3 -2
@@ -169,8 +169,9 @@ extern const struct clkops clkops_null;#define RATE_IN_242X (1 << 1)#define RATE_IN_243X (1 << 2)#define RATE_IN_343X (1 << 3)/* rates common to all 343X */ -#define RATE_IN_3430ES2 (1 << 4)/* 3430ES2 rates only */ -#define RATE_IN_4430 (1 << 5) +#define RATE_IN_3430ES2 (1 << 4)/* 3430ES2 rates only */ +#define RATE_IN_36XX (1 << 5) +#define RATE_IN_4430 (1 << 6)#define RATE_IN_24XX (RATE_IN_242X | RATE_IN_243X)
Signature · 1 line
1.6.6.GIT
Paul Walmsley
maintainerRe: [PATCHV6 1/3] OMAP3: introduce DPLL4 Jtype
In reply to Vishwanath BSHi,
Quoted 7 lines · Vishwanath BS
From: Richard Woodruff <[email protected]>
DPLL4 for 3630 introduces a changed block called j type dpll, requiring special divisor bits and additional reg fields. To allow for silicons to use this, this is introduced as a flag and is enabled for 3630 silicon. OMAP4 also has j type dpll for usb.
Quoted 7 lines
Tested with 3630 ZOOM3 and OMAP3430 ZOOM2
Cc Paul Walmsley <[email protected]>Signed-off-by Richard Woodruff <[email protected]>Signed-off-by Nishanth Menon <[email protected]>Signed-off-by Vishwanath BS <[email protected]>
I made a few changes to this patch (revised version below) and ququed it up for 2.6.34. Please let me know if you have any comments on the revised patch.
thanks,
- Paul
From 8069cd708068fa48eaf065c576455537ca4a740d Mon Sep 17 00:00:00 2001
From: Richard Woodruff <[email protected]>
Date: Wed, 10 Feb 2010 17:24:31 -0700
Subject: [PATCH] DPLL4 for 3630 introduces a changed block called j type dpll, requiring
special divisor bits and additional reg fields. To allow for silicons to use this, this is introduced as a flag and is enabled for 3630 silicon. OMAP4 also has j type dpll for usb.
Tested with 3630 ZOOM3 and OMAP3430 ZOOM2
[[email protected]: added some comments; updated copyrights and credits; fixed
some style issues]
--- arch/arm/mach-omap2/clock.h | 4 ++ arch/arm/mach-omap2/clock34xx_data.c | 32 ++++++++++++++- arch/arm/mach-omap2/clock44xx_data.c | 1 + arch/arm/mach-omap2/cm-regbits-34xx.h | 5 ++ arch/arm/mach-omap2/dpll3xxx.c | 67 +++++++++++++++++++++++++++++-- arch/arm/plat-omap/include/plat/clock.h | 5 ++ 6 files changed, 109 insertions(+), 5 deletions(-)
arch/arm/mach-omap2/clock.h +4 -0
@@ -47,6 +47,10 @@#define DPLL_LOW_POWER_BYPASS 0x5#define DPLL_LOCKED 0x7 +/* DPLL Type and DCO Selection Flags */ +#define DPLL_J_TYPE 0x1 +#define DPLL_NO_DCO_SEL 0x2 +int omap2_clk_enable (struct clk *clk);void omap2_clk_disable (struct clk *clk);long omap2_clk_round_rate (struct clk *clk,unsigned long rate);
arch/arm/mach-omap2/clock34xx_data.c +31 -1
@@ -38,6 +38,7 @@/* Maximum DPLL multiplier, divider values for OMAP3 */ #define OMAP3_MAX_DPLL_MULT 2048 +#define OMAP3630_MAX_JTYPE_DPLL_MULT 4095#define OMAP3_MAX_DPLL_DIV 128/*
@@ -529,7 +530,8 @@ static struct clk emu_core_alwon_ck = {/* DPLL4 */ /* Supplies 96MHz, 54Mhz TV DAC, DSS fclk, CAM sensor clock, emul trace clk */ /* Type: DPLL */ -static struct dpll_data dpll4_dd = { +static struct dpll_data dpll4_dd; +static struct dpll_data dpll4_dd_34xx__initdata = { .mult_div1_reg =OMAP_CM_REGADDR (PLL_MOD ,CM_CLKSEL2 ), .mult_mask =OMAP3430_PERIPH_DPLL_MULT_MASK , .div1_mask =OMAP3430_PERIPH_DPLL_DIV_MASK ,
@@ -552,6 +554,29 @@ static struct dpll_data dpll4_dd = { .rate_tolerance = DEFAULT_DPLL_RATE_TOLERANCE }; +static struct dpll_data dpll4_dd_3630__initdata = { + .mult_div1_reg =OMAP_CM_REGADDR (PLL_MOD ,CM_CLKSEL2 ), + .mult_mask =OMAP3630_PERIPH_DPLL_MULT_MASK , + .div1_mask =OMAP3430_PERIPH_DPLL_DIV_MASK , + .clk_bypass = &sys_ck, + .clk_ref = &sys_ck, + .control_reg =OMAP_CM_REGADDR (PLL_MOD ,CM_CLKEN ), + .enable_mask =OMAP3430_EN_PERIPH_DPLL_MASK , + .modes = (1 <<DPLL_LOW_POWER_STOP ) | (1 <<DPLL_LOCKED ), + .auto_recal_bit =OMAP3430_EN_PERIPH_DPLL_DRIFTGUARD_SHIFT , + .recal_en_bit =OMAP3430_PERIPH_DPLL_RECAL_EN_SHIFT , + .recal_st_bit =OMAP3430_PERIPH_DPLL_ST_SHIFT , + .autoidle_reg =OMAP_CM_REGADDR (PLL_MOD ,CM_AUTOIDLE ), + .autoidle_mask =OMAP3430_AUTO_PERIPH_DPLL_MASK , + .idlest_reg =OMAP_CM_REGADDR (PLL_MOD ,CM_IDLEST ), + .idlest_mask =OMAP3430_ST_PERIPH_CLK_MASK , + .max_multiplier =OMAP3630_MAX_JTYPE_DPLL_MULT , + .min_divider =1 , + .max_divider =OMAP3_MAX_DPLL_DIV , + .rate_tolerance =DEFAULT_DPLL_RATE_TOLERANCE , + .flags =DPLL_J_TYPE +}; +static struct clk dpll4_ck = { .name ="dpll4_ck" , .ops = &clkops_noncore_dpll_ops,
@@ -3377,6 +3402,11 @@ int __init omap3xxx_clk_init(void) &clkops_omap36xx_pwrdn_with_hsdiv_wait_restore; } +if (cpu_is_omap3630 ()) + dpll4_dd = dpll4_dd_3630; +else + dpll4_dd = dpll4_dd_34xx; +clk_init (&omap2_clk_functions);for (c = omap3xxx_clks; c < omap3xxx_clks +ARRAY_SIZE (omap3xxx_clks); c++)
arch/arm/mach-omap2/clock44xx_data.c +1 -0
@@ -980,6 +980,7 @@ static struct dpll_data dpll_usb_dd = { .max_multiplier = OMAP4430_MAX_DPLL_MULT, .max_divider = OMAP4430_MAX_DPLL_DIV, .min_divider = 1, + .flags = DPLL_J_TYPE | DPLL_NO_DCO_SEL };
arch/arm/mach-omap2/cm-regbits-34xx.h +5 -0
@@ -531,8 +531,13 @@/* CM_CLKSEL2_PLL */ #define OMAP3430_PERIPH_DPLL_MULT_SHIFT 8#define OMAP3430_PERIPH_DPLL_MULT_MASK (0x7ff << 8) +#define OMAP3630_PERIPH_DPLL_MULT_MASK (0xfff << 8)#define OMAP3430_PERIPH_DPLL_DIV_SHIFT 0#define OMAP3430_PERIPH_DPLL_DIV_MASK (0x7f << 0) +#define OMAP3630_PERIPH_DPLL_DCO_SEL_SHIFT 21 +#define OMAP3630_PERIPH_DPLL_DCO_SEL_MASK (0x7 << 21) +#define OMAP3630_PERIPH_DPLL_SD_DIV_SHIFT 24 +#define OMAP3630_PERIPH_DPLL_SD_DIV_MASK (0xff << 24)/* CM_CLKSEL3_PLL */ #define OMAP3430_DIV_96M_SHIFT 0
arch/arm/mach-omap2/dpll3xxx.c +63 -4
93 lines not on this page · raw message
arch/arm/plat-omap/include/plat/clock.h +5 -0
@@ -42,6 +42,10 @@ struct clksel {const struct clksel_rate *rates; }; +/* +* A new flag called flag has been added which indicates what is the +* type of dpll (like j_type, no_dco_sel) +*/ struct dpll_data {void __iomem *mult_div1_reg;u32 mult_mask;
@@ -68,6 +72,7 @@ struct dpll_data {u8 auto_recal_bit;u8 recal_en_bit;u8 recal_st_bit; +u8 flags;# endif };
Signature · 1 line
1.6.6.GIT
Paul Walmsley
maintainerRe: [PATCHV6 1/3] OMAP3: introduce DPLL4 Jtype
by the way, just noticed that the subject line got dropped; fixed that here.
- Paul