Patchwork [02/11] MXS: Add USB EHCI and USB PHY clock handling

login
register
mail settings
Submitter Marek Vasut
Date April 22, 2012, 12:59 p.m.
Message ID <1335099567-21056-3-git-send-email-marex@denx.de>
Download mbox | patch
Permalink /patch/154256/
State New
Headers show

Comments

Marek Vasut - April 22, 2012, 12:59 p.m.
Based on code by:
Tony Lin <tony.lin@freescale.com>

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Chen Peter-B29397 <B29397@freescale.com>
Cc: Detlev Zundel <dzu@denx.de>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Li Frank-B20596 <B20596@freescale.com>
Cc: Lin Tony-B19295 <B19295@freescale.com>
Cc: Linux USB <linux-usb@vger.kernel.org>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Shawn Guo <shawn.guo@freescale.com>
Cc: Shawn Guo <shawn.guo@linaro.org>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Subodh Nijsure <snijsure@grid-net.com>
Cc: Tony Lin <tony.lin@freescale.com>
Cc: Wolfgang Denk <wd@denx.de>
---
 arch/arm/mach-mxs/clock-mx28.c |   21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)
Shawn Guo - April 22, 2012, 2:42 p.m.
On Sun, Apr 22, 2012 at 02:59:18PM +0200, Marek Vasut wrote:
> Based on code by:
> Tony Lin <tony.lin@freescale.com>
> 
> Signed-off-by: Marek Vasut <marex@denx.de>
> Cc: Chen Peter-B29397 <B29397@freescale.com>
> Cc: Detlev Zundel <dzu@denx.de>
> Cc: Fabio Estevam <festevam@gmail.com>
> Cc: Li Frank-B20596 <B20596@freescale.com>
> Cc: Lin Tony-B19295 <B19295@freescale.com>
> Cc: Linux USB <linux-usb@vger.kernel.org>
> Cc: Sascha Hauer <s.hauer@pengutronix.de>
> Cc: Shawn Guo <shawn.guo@freescale.com>
> Cc: Shawn Guo <shawn.guo@linaro.org>
> Cc: Stefano Babic <sbabic@denx.de>
> Cc: Subodh Nijsure <snijsure@grid-net.com>
> Cc: Tony Lin <tony.lin@freescale.com>
> Cc: Wolfgang Denk <wd@denx.de>
> ---
>  arch/arm/mach-mxs/clock-mx28.c |   21 +++++++++++++++++++--
>  1 file changed, 19 insertions(+), 2 deletions(-)
> 
The first 2 patches in series are patching files to be removed.
We are switching mxs clock to common clk framework.
Marek Vasut - April 22, 2012, 3:42 p.m.
Dear Shawn Guo,

> On Sun, Apr 22, 2012 at 02:59:18PM +0200, Marek Vasut wrote:
> > Based on code by:
> > Tony Lin <tony.lin@freescale.com>
> > 
> > Signed-off-by: Marek Vasut <marex@denx.de>
> > Cc: Chen Peter-B29397 <B29397@freescale.com>
> > Cc: Detlev Zundel <dzu@denx.de>
> > Cc: Fabio Estevam <festevam@gmail.com>
> > Cc: Li Frank-B20596 <B20596@freescale.com>
> > Cc: Lin Tony-B19295 <B19295@freescale.com>
> > Cc: Linux USB <linux-usb@vger.kernel.org>
> > Cc: Sascha Hauer <s.hauer@pengutronix.de>
> > Cc: Shawn Guo <shawn.guo@freescale.com>
> > Cc: Shawn Guo <shawn.guo@linaro.org>
> > Cc: Stefano Babic <sbabic@denx.de>
> > Cc: Subodh Nijsure <snijsure@grid-net.com>
> > Cc: Tony Lin <tony.lin@freescale.com>
> > Cc: Wolfgang Denk <wd@denx.de>
> > ---
> > 
> >  arch/arm/mach-mxs/clock-mx28.c |   21 +++++++++++++++++++--
> >  1 file changed, 19 insertions(+), 2 deletions(-)
> 
> The first 2 patches in series are patching files to be removed.
> We are switching mxs clock to common clk framework.

When is this mxs clock framework scheduled to hit mainline? I obviously had to 
patch this stuff to work with mainline, once there's new framework, it should be 
easy to just change these patches.

Best regards,
Marek Vasut
Shawn Guo - April 22, 2012, 4:34 p.m.
On Sun, Apr 22, 2012 at 05:42:05PM +0200, Marek Vasut wrote:
> Dear Shawn Guo,
> 
> > On Sun, Apr 22, 2012 at 02:59:18PM +0200, Marek Vasut wrote:
> > > Based on code by:
> > > Tony Lin <tony.lin@freescale.com>
> > > 
> > > Signed-off-by: Marek Vasut <marex@denx.de>
> > > Cc: Chen Peter-B29397 <B29397@freescale.com>
> > > Cc: Detlev Zundel <dzu@denx.de>
> > > Cc: Fabio Estevam <festevam@gmail.com>
> > > Cc: Li Frank-B20596 <B20596@freescale.com>
> > > Cc: Lin Tony-B19295 <B19295@freescale.com>
> > > Cc: Linux USB <linux-usb@vger.kernel.org>
> > > Cc: Sascha Hauer <s.hauer@pengutronix.de>
> > > Cc: Shawn Guo <shawn.guo@freescale.com>
> > > Cc: Shawn Guo <shawn.guo@linaro.org>
> > > Cc: Stefano Babic <sbabic@denx.de>
> > > Cc: Subodh Nijsure <snijsure@grid-net.com>
> > > Cc: Tony Lin <tony.lin@freescale.com>
> > > Cc: Wolfgang Denk <wd@denx.de>
> > > ---
> > > 
> > >  arch/arm/mach-mxs/clock-mx28.c |   21 +++++++++++++++++++--
> > >  1 file changed, 19 insertions(+), 2 deletions(-)
> > 
> > The first 2 patches in series are patching files to be removed.
> > We are switching mxs clock to common clk framework.
> 
> When is this mxs clock framework scheduled to hit mainline?

v3.5 merge window.

Patch

diff --git a/arch/arm/mach-mxs/clock-mx28.c b/arch/arm/mach-mxs/clock-mx28.c
index 43116ba..8784a72 100644
--- a/arch/arm/mach-mxs/clock-mx28.c
+++ b/arch/arm/mach-mxs/clock-mx28.c
@@ -577,6 +577,21 @@  static struct clk usb1_clk = {
 	.parent = &pll1_clk,
 };
 
+static struct clk usb_phy_clk0 = {
+	.parent = &pll0_clk,
+	.enable = _raw_clk_disable,
+	.disable = _raw_clk_enable,
+	.enable_reg = CLKCTRL_BASE_ADDR + HW_CLKCTRL_PLL0CTRL0,
+	.enable_shift = 18,
+};
+
+static struct clk usb_phy_clk1 = {
+	.parent = &pll1_clk,
+	.enable = _raw_clk_disable,
+	.disable = _raw_clk_enable,
+	.enable_reg = CLKCTRL_BASE_ADDR + HW_CLKCTRL_PLL1CTRL0,
+	.enable_shift = 18,
+};
 #define _DEFINE_CLOCK(name, er, es, p)					\
 	static struct clk name = {					\
 		.enable_reg	= CLKCTRL_BASE_ADDR + HW_CLKCTRL_##er,	\
@@ -636,8 +651,10 @@  static struct clk_lookup lookups[] = {
 	_REGISTER_CLOCK("mxs-mmc.3", NULL, ssp3_clk)
 	_REGISTER_CLOCK("flexcan.0", NULL, can0_clk)
 	_REGISTER_CLOCK("flexcan.1", NULL, can1_clk)
-	_REGISTER_CLOCK(NULL, "usb0", usb0_clk)
-	_REGISTER_CLOCK(NULL, "usb1", usb1_clk)
+	_REGISTER_CLOCK("imx-otg.0", "usb", usb0_clk)
+	_REGISTER_CLOCK("imx-otg.1", "usb", usb1_clk)
+	_REGISTER_CLOCK("mxs-usb-phy.0", "phy", usb_phy_clk0)
+	_REGISTER_CLOCK("mxs-usb-phy.1", "phy", usb_phy_clk1)
 	_REGISTER_CLOCK("mxs-pwm.0", NULL, pwm_clk)
 	_REGISTER_CLOCK("mxs-pwm.1", NULL, pwm_clk)
 	_REGISTER_CLOCK("mxs-pwm.2", NULL, pwm_clk)