linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] USB_DR host support for FSL MPC831x
@ 2007-07-17  0:58 Vitaly Bordug
  2007-07-17 12:18 ` Li Yang-r58472
  2007-07-17 16:47 ` Scott Wood
  0 siblings, 2 replies; 5+ messages in thread
From: Vitaly Bordug @ 2007-07-17  0:58 UTC (permalink / raw)
  To: Greg KH; +Cc: linuxppc-dev


Modifies fsl_ehci code so that to get USB host working on
mpc831x platform. Verified with MPC8313RDB reference board.

Signed-off-by: Vitaly Bordug <vitb@kernel.crashing.org>

---

 arch/powerpc/boot/dts/mpc8313erdb.dts |    1 +
 drivers/usb/host/ehci-fsl.c           |    4 +++-
 drivers/usb/host/ehci-hcd.c           |    2 +-
 3 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/boot/dts/mpc8313erdb.dts b/arch/powerpc/boot/dts/mpc8313erdb.dts
index 1b351dc..c330e79 100644
--- a/arch/powerpc/boot/dts/mpc8313erdb.dts
+++ b/arch/powerpc/boot/dts/mpc8313erdb.dts
@@ -90,6 +90,7 @@
 			interrupt-parent = < &ipic >;
 			interrupts = <26 8>;
 			phy_type = "utmi_wide";
+			control_init  = <00000280>; // UTMI ext 48 MHz clk
 		};
 
 		mdio@24520 {
diff --git a/drivers/usb/host/ehci-fsl.c b/drivers/usb/host/ehci-fsl.c
index c7a7c59..3e3187b 100644
--- a/drivers/usb/host/ehci-fsl.c
+++ b/drivers/usb/host/ehci-fsl.c
@@ -185,12 +185,14 @@ static void mpc83xx_usb_setup(struct usb_hcd *hcd)
 	struct ehci_hcd *ehci = hcd_to_ehci(hcd);
 	struct fsl_usb2_platform_data *pdata;
 	void __iomem *non_ehci = hcd->regs;
+	u32 temp;
 
 	pdata =
 	    (struct fsl_usb2_platform_data *)hcd->self.controller->
 	    platform_data;
 	/* Enable PHY interface in the control reg. */
-	out_be32(non_ehci + FSL_SOC_USB_CTRL, 0x00000004);
+	temp = in_be32(non_ehci + FSL_SOC_USB_CTRL);
+	out_be32(non_ehci + FSL_SOC_USB_CTRL, temp | 0x00000004);
 	out_be32(non_ehci + FSL_SOC_USB_SNOOP1, 0x0000001b);
 
 #if defined(CONFIG_PPC32) && !defined(CONFIG_NOT_COHERENT_CACHE)
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index 099aff6..994a127 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -925,7 +925,7 @@ MODULE_LICENSE ("GPL");
 #define	PCI_DRIVER		ehci_pci_driver
 #endif
 
-#ifdef CONFIG_MPC834x
+#if defined(CONFIG_MPC834x) || defined(CONFIG_PPC_MPC831x)
 #include "ehci-fsl.c"
 #define	PLATFORM_DRIVER		ehci_fsl_driver
 #endif

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* RE: [PATCH] USB_DR host support for FSL MPC831x
  2007-07-17  0:58 [PATCH] USB_DR host support for FSL MPC831x Vitaly Bordug
@ 2007-07-17 12:18 ` Li Yang-r58472
  2007-07-17 14:52   ` Vitaly Bordug
  2007-07-17 16:47 ` Scott Wood
  1 sibling, 1 reply; 5+ messages in thread
From: Li Yang-r58472 @ 2007-07-17 12:18 UTC (permalink / raw)
  To: Vitaly Bordug, Greg KH; +Cc: linuxppc-dev

Hi Vitaly,

I believe that your patch is addresses by my patch in 2.6.23 queue:
http://www.kernel.org/pub/linux/kernel/people/gregkh/usb/2.6/2.6.22/usb-
ehci_fsl-update-for-mpc831x-support.patch

- Leo

> -----Original Message-----
> From: linuxppc-dev-bounces+leoli=3Dfreescale.com@ozlabs.org=20
> [mailto:linuxppc-dev-bounces+leoli=3Dfreescale.com@ozlabs.org]=20
> On Behalf Of Vitaly Bordug
> Sent: Tuesday, July 17, 2007 8:59 AM
> To: Greg KH
> Cc: linuxppc-dev@ozlabs.org
> Subject: [PATCH] USB_DR host support for FSL MPC831x
>=20
>=20
> Modifies fsl_ehci code so that to get USB host working on=20
> mpc831x platform. Verified with MPC8313RDB reference board.
>=20
> Signed-off-by: Vitaly Bordug <vitb@kernel.crashing.org>
>=20
> ---
>=20
>  arch/powerpc/boot/dts/mpc8313erdb.dts |    1 +
>  drivers/usb/host/ehci-fsl.c           |    4 +++-
>  drivers/usb/host/ehci-hcd.c           |    2 +-
>  3 files changed, 5 insertions(+), 2 deletions(-)
>=20
> diff --git a/arch/powerpc/boot/dts/mpc8313erdb.dts=20
> b/arch/powerpc/boot/dts/mpc8313erdb.dts
> index 1b351dc..c330e79 100644
> --- a/arch/powerpc/boot/dts/mpc8313erdb.dts
> +++ b/arch/powerpc/boot/dts/mpc8313erdb.dts
> @@ -90,6 +90,7 @@
>  			interrupt-parent =3D < &ipic >;
>  			interrupts =3D <26 8>;
>  			phy_type =3D "utmi_wide";
> +			control_init  =3D <00000280>; // UTMI ext=20
> 48 MHz clk
>  		};
> =20
>  		mdio@24520 {
> diff --git a/drivers/usb/host/ehci-fsl.c=20
> b/drivers/usb/host/ehci-fsl.c index c7a7c59..3e3187b 100644
> --- a/drivers/usb/host/ehci-fsl.c
> +++ b/drivers/usb/host/ehci-fsl.c
> @@ -185,12 +185,14 @@ static void mpc83xx_usb_setup(struct=20
> usb_hcd *hcd)
>  	struct ehci_hcd *ehci =3D hcd_to_ehci(hcd);
>  	struct fsl_usb2_platform_data *pdata;
>  	void __iomem *non_ehci =3D hcd->regs;
> +	u32 temp;
> =20
>  	pdata =3D
>  	    (struct fsl_usb2_platform_data *)hcd->self.controller->
>  	    platform_data;
>  	/* Enable PHY interface in the control reg. */
> -	out_be32(non_ehci + FSL_SOC_USB_CTRL, 0x00000004);
> +	temp =3D in_be32(non_ehci + FSL_SOC_USB_CTRL);
> +	out_be32(non_ehci + FSL_SOC_USB_CTRL, temp | 0x00000004);
>  	out_be32(non_ehci + FSL_SOC_USB_SNOOP1, 0x0000001b);
> =20
>  #if defined(CONFIG_PPC32) && !defined(CONFIG_NOT_COHERENT_CACHE)
> diff --git a/drivers/usb/host/ehci-hcd.c=20
> b/drivers/usb/host/ehci-hcd.c index 099aff6..994a127 100644
> --- a/drivers/usb/host/ehci-hcd.c
> +++ b/drivers/usb/host/ehci-hcd.c
> @@ -925,7 +925,7 @@ MODULE_LICENSE ("GPL");
>  #define	PCI_DRIVER		ehci_pci_driver
>  #endif
> =20
> -#ifdef CONFIG_MPC834x
> +#if defined(CONFIG_MPC834x) || defined(CONFIG_PPC_MPC831x)
>  #include "ehci-fsl.c"
>  #define	PLATFORM_DRIVER		ehci_fsl_driver
>  #endif
>=20
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev
>=20

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] USB_DR host support for FSL MPC831x
  2007-07-17 12:18 ` Li Yang-r58472
@ 2007-07-17 14:52   ` Vitaly Bordug
  2007-07-17 15:34     ` Kumar Gala
  0 siblings, 1 reply; 5+ messages in thread
From: Vitaly Bordug @ 2007-07-17 14:52 UTC (permalink / raw)
  To: Li Yang-r58472; +Cc: Greg KH, linuxppc-dev

On Tue, 17 Jul 2007 20:18:35 +0800
"Li Yang-r58472" <LeoLi@freescale.com> wrote:

> Hi Vitaly,
> 
> I believe that your patch is addresses by my patch in 2.6.23 queue:
> http://www.kernel.org/pub/linux/kernel/people/gregkh/usb/2.6/2.6.22/usb-
> ehci_fsl-update-for-mpc831x-support.patch
> 
okay, nm then. I'll revalidate with these 2 patches 
and come up with something ontop if it won't work.


> - Leo
> 
> > -----Original Message-----
> > From: linuxppc-dev-bounces+leoli=freescale.com@ozlabs.org 
> > [mailto:linuxppc-dev-bounces+leoli=freescale.com@ozlabs.org] 
> > On Behalf Of Vitaly Bordug
> > Sent: Tuesday, July 17, 2007 8:59 AM
> > To: Greg KH
> > Cc: linuxppc-dev@ozlabs.org
> > Subject: [PATCH] USB_DR host support for FSL MPC831x
> > 
> > 
> > Modifies fsl_ehci code so that to get USB host working on 
> > mpc831x platform. Verified with MPC8313RDB reference board.
> > 
> > Signed-off-by: Vitaly Bordug <vitb@kernel.crashing.org>
> > 
> > ---
> > 
> >  arch/powerpc/boot/dts/mpc8313erdb.dts |    1 +
> >  drivers/usb/host/ehci-fsl.c           |    4 +++-
> >  drivers/usb/host/ehci-hcd.c           |    2 +-
> >  3 files changed, 5 insertions(+), 2 deletions(-)
> > 
> > diff --git a/arch/powerpc/boot/dts/mpc8313erdb.dts 
> > b/arch/powerpc/boot/dts/mpc8313erdb.dts
> > index 1b351dc..c330e79 100644
> > --- a/arch/powerpc/boot/dts/mpc8313erdb.dts
> > +++ b/arch/powerpc/boot/dts/mpc8313erdb.dts
> > @@ -90,6 +90,7 @@
> >  			interrupt-parent = < &ipic >;
> >  			interrupts = <26 8>;
> >  			phy_type = "utmi_wide";
> > +			control_init  = <00000280>; // UTMI ext 
> > 48 MHz clk
> >  		};
> >  
> >  		mdio@24520 {
> > diff --git a/drivers/usb/host/ehci-fsl.c 
> > b/drivers/usb/host/ehci-fsl.c index c7a7c59..3e3187b 100644
> > --- a/drivers/usb/host/ehci-fsl.c
> > +++ b/drivers/usb/host/ehci-fsl.c
> > @@ -185,12 +185,14 @@ static void mpc83xx_usb_setup(struct 
> > usb_hcd *hcd)
> >  	struct ehci_hcd *ehci = hcd_to_ehci(hcd);
> >  	struct fsl_usb2_platform_data *pdata;
> >  	void __iomem *non_ehci = hcd->regs;
> > +	u32 temp;
> >  
> >  	pdata =
> >  	    (struct fsl_usb2_platform_data *)hcd->self.controller->
> >  	    platform_data;
> >  	/* Enable PHY interface in the control reg. */
> > -	out_be32(non_ehci + FSL_SOC_USB_CTRL, 0x00000004);
> > +	temp = in_be32(non_ehci + FSL_SOC_USB_CTRL);
> > +	out_be32(non_ehci + FSL_SOC_USB_CTRL, temp | 0x00000004);
> >  	out_be32(non_ehci + FSL_SOC_USB_SNOOP1, 0x0000001b);
> >  
> >  #if defined(CONFIG_PPC32) && !defined(CONFIG_NOT_COHERENT_CACHE)
> > diff --git a/drivers/usb/host/ehci-hcd.c 
> > b/drivers/usb/host/ehci-hcd.c index 099aff6..994a127 100644
> > --- a/drivers/usb/host/ehci-hcd.c
> > +++ b/drivers/usb/host/ehci-hcd.c
> > @@ -925,7 +925,7 @@ MODULE_LICENSE ("GPL");
> >  #define	PCI_DRIVER		ehci_pci_driver
> >  #endif
> >  
> > -#ifdef CONFIG_MPC834x
> > +#if defined(CONFIG_MPC834x) || defined(CONFIG_PPC_MPC831x)
> >  #include "ehci-fsl.c"
> >  #define	PLATFORM_DRIVER		ehci_fsl_driver
> >  #endif
> > 
> > _______________________________________________
> > Linuxppc-dev mailing list
> > Linuxppc-dev@ozlabs.org
> > https://ozlabs.org/mailman/listinfo/linuxppc-dev
> > 


-- 
Sincerely, 
Vitaly

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] USB_DR host support for FSL MPC831x
  2007-07-17 14:52   ` Vitaly Bordug
@ 2007-07-17 15:34     ` Kumar Gala
  0 siblings, 0 replies; 5+ messages in thread
From: Kumar Gala @ 2007-07-17 15:34 UTC (permalink / raw)
  To: Vitaly Bordug; +Cc: Greg KH, linuxppc-dev


On Jul 17, 2007, at 9:52 AM, Vitaly Bordug wrote:

> On Tue, 17 Jul 2007 20:18:35 +0800
> "Li Yang-r58472" <LeoLi@freescale.com> wrote:
>
>> Hi Vitaly,
>>
>> I believe that your patch is addresses by my patch in 2.6.23 queue:
>> http://www.kernel.org/pub/linux/kernel/people/gregkh/usb/ 
>> 2.6/2.6.22/usb-
>> ehci_fsl-update-for-mpc831x-support.patch
>>
> okay, nm then. I'll revalidate with these 2 patches
> and come up with something ontop if it won't work.
>

FYI, Leo's patches are now in Linus's tree.

- k

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] USB_DR host support for FSL MPC831x
  2007-07-17  0:58 [PATCH] USB_DR host support for FSL MPC831x Vitaly Bordug
  2007-07-17 12:18 ` Li Yang-r58472
@ 2007-07-17 16:47 ` Scott Wood
  1 sibling, 0 replies; 5+ messages in thread
From: Scott Wood @ 2007-07-17 16:47 UTC (permalink / raw)
  To: Vitaly Bordug; +Cc: Greg KH, linuxppc-dev

On Tue, Jul 17, 2007 at 04:58:32AM +0400, Vitaly Bordug wrote:
> diff --git a/arch/powerpc/boot/dts/mpc8313erdb.dts b/arch/powerpc/boot/dts/mpc8313erdb.dts
> index 1b351dc..c330e79 100644
> --- a/arch/powerpc/boot/dts/mpc8313erdb.dts
> +++ b/arch/powerpc/boot/dts/mpc8313erdb.dts
> @@ -90,6 +90,7 @@
>  			interrupt-parent = < &ipic >;
>  			interrupts = <26 8>;
>  			phy_type = "utmi_wide";
> +			control_init  = <00000280>; // UTMI ext 48 MHz clk

fsl,usb-control-init, please.

> diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
> index 099aff6..994a127 100644
> --- a/drivers/usb/host/ehci-hcd.c
> +++ b/drivers/usb/host/ehci-hcd.c
> @@ -925,7 +925,7 @@ MODULE_LICENSE ("GPL");
>  #define	PCI_DRIVER		ehci_pci_driver
>  #endif
>  
> -#ifdef CONFIG_MPC834x
> +#if defined(CONFIG_MPC834x) || defined(CONFIG_PPC_MPC831x)
>  #include "ehci-fsl.c"
>  #define	PLATFORM_DRIVER		ehci_fsl_driver
>  #endif

It'd be better to define a CONFIG_FSL_EHCI and have the 834x and 831x
configs enable it.

-Scott

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-07-17 16:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-17  0:58 [PATCH] USB_DR host support for FSL MPC831x Vitaly Bordug
2007-07-17 12:18 ` Li Yang-r58472
2007-07-17 14:52   ` Vitaly Bordug
2007-07-17 15:34     ` Kumar Gala
2007-07-17 16:47 ` Scott Wood

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).