Re: [U-Boot] [PATCH v7 1/4] mx6: clock: Add thermal clock enable function

2014-11-21 Thread Stefano Babic
On 20/11/2014 14:14, Ye.Li wrote:
 From: Nitin Garg nitin.g...@freescale.com
 
 Add api to check and enable pll3 as required
 for thermal sensor driver.
 
 Signed-off-by: Ye.Li b37...@freescale.com
 Signed-off-by: Nitin Garg nitin.g...@freescale.com
 ---

After fixing:
ERROR: Bad function definition - void enable_thermal_clk() should
probably be void enable_thermal_clk(void)
#124: FILE: arch/arm/cpu/armv7/mx6/clock.c:701:
+void enable_thermal_clk()

Applied to u-boot-imx, thanks !

Best regards,
Stefano Babic



-- 
=
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v7 1/4] mx6: clock: Add thermal clock enable function

2014-11-20 Thread Ye . Li
From: Nitin Garg nitin.g...@freescale.com

Add api to check and enable pll3 as required
for thermal sensor driver.

Signed-off-by: Ye.Li b37...@freescale.com
Signed-off-by: Nitin Garg nitin.g...@freescale.com
---
 arch/arm/cpu/armv7/mx6/clock.c|   30 ++
 arch/arm/include/asm/arch-mx6/clock.h |1 +
 2 files changed, 31 insertions(+), 0 deletions(-)

diff --git a/arch/arm/cpu/armv7/mx6/clock.c b/arch/arm/cpu/armv7/mx6/clock.c
index 6c9c78c..144080e 100644
--- a/arch/arm/cpu/armv7/mx6/clock.c
+++ b/arch/arm/cpu/armv7/mx6/clock.c
@@ -673,6 +673,36 @@ void hab_caam_clock_enable(unsigned char enable)
 }
 #endif
 
+static void enable_pll3(void)
+{
+   struct anatop_regs __iomem *anatop =
+   (struct anatop_regs __iomem *)ANATOP_BASE_ADDR;
+
+   /* make sure pll3 is enabled */
+   if ((readl(anatop-usb1_pll_480_ctrl) 
+   BM_ANADIG_USB1_PLL_480_CTRL_LOCK) == 0) {
+   /* enable pll's power */
+   writel(BM_ANADIG_USB1_PLL_480_CTRL_POWER,
+  anatop-usb1_pll_480_ctrl_set);
+   writel(0x80, anatop-ana_misc2_clr);
+   /* wait for pll lock */
+   while ((readl(anatop-usb1_pll_480_ctrl) 
+   BM_ANADIG_USB1_PLL_480_CTRL_LOCK) == 0)
+   ;
+   /* disable bypass */
+   writel(BM_ANADIG_USB1_PLL_480_CTRL_BYPASS,
+  anatop-usb1_pll_480_ctrl_clr);
+   /* enable pll output */
+   writel(BM_ANADIG_USB1_PLL_480_CTRL_ENABLE,
+  anatop-usb1_pll_480_ctrl_set);
+   }
+}
+
+void enable_thermal_clk()
+{
+   enable_pll3();
+}
+
 unsigned int mxc_get_clock(enum mxc_clock clk)
 {
switch (clk) {
diff --git a/arch/arm/include/asm/arch-mx6/clock.h 
b/arch/arm/include/asm/arch-mx6/clock.h
index 3c58a0a..8e51f9b 100644
--- a/arch/arm/include/asm/arch-mx6/clock.h
+++ b/arch/arm/include/asm/arch-mx6/clock.h
@@ -66,4 +66,5 @@ int enable_spi_clk(unsigned char enable, unsigned spi_num);
 void enable_ipu_clock(void);
 int enable_fec_anatop_clock(enum enet_freq freq);
 void enable_enet_clk(unsigned char enable);
+void enable_thermal_clk(void);
 #endif /* __ASM_ARCH_CLOCK_H */
-- 
1.7.4.1

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot