Skip to contentSkip to conversation

arm, davinci: add PLL0 prediv to da850 lowlevel setup

PATCH New Ben Gardiner 4 participants 4 messages Jan 16, 2012 – Jan 17, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm, davinci: add PLL0 prediv to da850 lowlevel setup

The OMAP-L138 has a pre-divider available on PLL0.

Add support to da850_lowlevel.c for configuring PLL0's pre-divider. This is to achieve certain OPP's -- e.g. the 372MHz OPP used also by Linux.

Cc Christian Riesch <[email protected]>
CC Heiko Schocher <[email protected]>
Cc Sandeep Paulraj <[email protected]>
Cc Tom Rini <[email protected]>
Cc Albert ARIBAUD <[email protected]>
---
 arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c |    7 +++++++
 arch/arm/include/asm/arch-davinci/pll_defs.h    |    3 ++-
 2 files changed, 9 insertions(+), 1 deletions(-)
arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c +7 -0
index a532f8a..eec06bc 100644
@@ -85,6 +85,13 @@ int da850_pll_init(struct davinci_pllc_regs *reg, unsigned long pllmult)
 	/* Enable the PLL from Disable Mode PLLDIS bit to 0 */
 	clrbits_le32(&reg->pllctl, PLLCTL_PLLDIS);
 
+#if defined(CONFIG_SYS_DA850_PLL0_PREDIV)
+	/* program the prediv */
+	if (reg == davinci_pllc0_regs && CONFIG_SYS_DA850_PLL0_PREDIV)
+		writel((PLL_DIVEN | CONFIG_SYS_DA850_PLL0_PREDIV),
+			&reg->prediv);
+#endif
+
 	/* Program the required multiplier value in PLLM */
 	writel(pllmult, &reg->pllm);
 
arch/arm/include/asm/arch-davinci/pll_defs.h +2 -1
index f1396e3..1c8d83f 100644
@@ -68,7 +68,8 @@ struct dv_pll_regs {
 #define PLLCTL_RES_9	(1 << 8)
 #define PLLCTL_EXTCLKSRC	(1 << 9)
 
-#define PLL_POSTDEN	(1 << 15)
+#define PLL_DIVEN	(1 << 15)
+#define PLL_POSTDEN	PLL_DIVEN
 
 #define PLL_SCSCFG3_DIV45PENA	(1 << 2)
 #define PLL_SCSCFG3_EMA_CLKSRC	(1 << 1)
Signature · 1 line
1.7.4.1
#1 lore raw

PATCH 1/1 arm, davinci: add PLL0 prediv to da850 lowlevel setup

Hello Ben,

Quoted 11 lines · Ben Gardiner

The OMAP-L138 has a pre-divider available on PLL0.

Add support to da850_lowlevel.c for configuring PLL0's pre-divider. This is to achieve certain OPP's -- e.g. the 372MHz OPP used also by Linux.

Cc Christian Riesch <[email protected]>
CC Heiko Schocher <[email protected]>
Cc Sandeep Paulraj <[email protected]>
Cc Tom Rini <[email protected]>
Cc Albert ARIBAUD <[email protected]>
Quoted 4 lines
---
 arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c |    7 +++++++
 arch/arm/include/asm/arch-davinci/pll_defs.h    |    3 ++-
 2 files changed, 9 insertions(+), 1 deletions(-)

bye,
Heiko

Signature · 2 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
#2 lore raw

PATCH 1/1 arm, davinci: add PLL0 prediv to da850 lowlevel setup

In reply to Ben Gardiner

Hello Ben,

Quoted 4 lines · Ben Gardiner

The OMAP-L138 has a pre-divider available on PLL0.

Add support to da850_lowlevel.c for configuring PLL0's pre-divider. This is to achieve certain OPP's -- e.g. the 372MHz OPP used also by Linux.

I noticed that that pre-divider configuration was missing while working on the lowlevel setup, but then I forgot to add it (and I was fine with the default)... Thank you for adding it!

Regards, Christian

#3 lore raw

PATCH 1/1 arm, davinci: add PLL0 prediv to da850 lowlevel setup

In reply to Ben Gardiner
Quoted 11 lines · Ben Gardiner

The OMAP-L138 has a pre-divider available on PLL0.

Add support to da850_lowlevel.c for configuring PLL0's pre-divider. This is to achieve certain OPP's -- e.g. the 372MHz OPP used also by Linux.

Cc Christian Riesch <[email protected]>
CC Heiko Schocher <[email protected]>
Cc Sandeep Paulraj <[email protected]>
Cc Tom Rini <[email protected]>
Cc Albert ARIBAUD <[email protected]>

Applied to u-boot-ti/master, thanks!

Signature · 1 line
Tom