diff mbox

[4/8,v2] ARM: EXYNOS5: Add EHCI device from device tree

Message ID 1342866729-30460-5-git-send-email-gautam.vivek@samsung.com (mailing list archive)
State New, archived
Headers show

Commit Message

Vivek Gautam July 21, 2012, 10:32 a.m. UTC
This patch adds EHCI device from device tree for exynos5
and adds platform data.

Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com>
---
 .../devicetree/bindings/usb/exynos-usb.txt         |   22 ++++++++++++++++++++
 arch/arm/boot/dts/exynos5250-smdk5250.dts          |    4 +++
 arch/arm/boot/dts/exynos5250.dtsi                  |    6 +++++
 arch/arm/mach-exynos/mach-exynos5-dt.c             |    8 +++++++
 4 files changed, 40 insertions(+), 0 deletions(-)

Comments

Arnd Bergmann July 26, 2012, 11:57 a.m. UTC | #1
On Saturday 21 July 2012, Vivek Gautam wrote:
> @@ -28,6 +29,11 @@ static struct exynos4_ohci_platdata smdk5250_ohci_pdata = {
>         .phy_exit = s5p_usb_phy_exit,
>  };
>  
> +static struct s5p_ehci_platdata smdk5250_ehci_pdata = {
> +       .phy_init = s5p_usb_phy_init,
> +       .phy_exit = s5p_usb_phy_exit,
> +};
> +
>  /*
>   * The following lookup table is used to override device names when devices
>   * are registered from device tree. This is temporarily added to enable

I'm a bit confused of the purpose of setting the function pointers here
when the pointers are always to the same s5p_usb_phy_init/s5p_usb_phy_exit
identifiers, but you have different definitions of those functions
depending on which platforms you are building for.

What is the idea here? Are you going to unify the three definitions of
s5p_usb_phy_init, or is that function going away eventually when we
get to the point of building exynos/s5p/s3c64xx into the same kernel
binary?

	Arnd
Vivek Gautam July 28, 2012, 4:41 p.m. UTC | #2
Hi,

On Thu, Jul 26, 2012 at 8:57 PM, Arnd Bergmann <arnd@arndb.de> wrote:

> On Saturday 21 July 2012, Vivek Gautam wrote:
> > @@ -28,6 +29,11 @@ static struct exynos4_ohci_platdata
> smdk5250_ohci_pdata = {
> >         .phy_exit = s5p_usb_phy_exit,
> >  };
> >
> > +static struct s5p_ehci_platdata smdk5250_ehci_pdata = {
> > +       .phy_init = s5p_usb_phy_init,
> > +       .phy_exit = s5p_usb_phy_exit,
> > +};
> > +
> >  /*
> >   * The following lookup table is used to override device names when
> devices
> >   * are registered from device tree. This is temporarily added to enable
>
> I'm a bit confused of the purpose of setting the function pointers here
> when the pointers are always to the same s5p_usb_phy_init/s5p_usb_phy_exit
> identifiers, but you have different definitions of those functions
> depending on which platforms you are building for.
>
> What is the idea here? Are you going to unify the three definitions of
> s5p_usb_phy_init, or is that function going away eventually when we
> get to the point of building exynos/s5p/s3c64xx into the same kernel
> binary?
>
> Should we be differentiating here between the calls at runtime for
different SOCs.
In that case, yes i think we need a way here to have a solution here so
that the function call
goes differently for different soc while in runtime. I will work on this
and get back asap.

>         Arnd
>
> _______________________________________________
> devicetree-discuss mailing list
> devicetree-discuss@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/devicetree-discuss
>
Best regards
Vivek
diff mbox

Patch

diff --git a/Documentation/devicetree/bindings/usb/exynos-usb.txt b/Documentation/devicetree/bindings/usb/exynos-usb.txt
index 63b80b9..45dadca 100644
--- a/Documentation/devicetree/bindings/usb/exynos-usb.txt
+++ b/Documentation/devicetree/bindings/usb/exynos-usb.txt
@@ -17,3 +17,25 @@  ohci {
 	interrupts = <0 71 0>;
 };
 
+EHCI
+Required properties:
+ - compatible:	should be "samsung,exynos-ehci" for USB 2.0
+   EHCI controller in host mode.
+ - reg: physical base address of the controller and length
+   of memory mapped.
+ - interrupts: interrupt number to the cpu.
+
+Optional properties:
+ - samsung,vbus-gpio:  if present, specifies the GPIO
+   that needs to be pulled up for the bus to be powered.
+
+ehci {
+	compatible = "samsung,exynos-ehci";
+	reg = <0x12110000 0x100>;
+	interrupts = <0 71 0>;
+};
+
+ehci {
+	samsung,vbus-gpio = <&gpx2 6 1 3 3>;
+};
+
diff --git a/arch/arm/boot/dts/exynos5250-smdk5250.dts b/arch/arm/boot/dts/exynos5250-smdk5250.dts
index 8a5e348..bf18286 100644
--- a/arch/arm/boot/dts/exynos5250-smdk5250.dts
+++ b/arch/arm/boot/dts/exynos5250-smdk5250.dts
@@ -109,4 +109,8 @@ 
 	spi_2: spi@12d40000 {
 		status = "disabled";
 	};
+
+	ehci {
+		samsung,vbus-gpio = <&gpx2 6 1 3 3>;
+	};
 };
diff --git a/arch/arm/boot/dts/exynos5250.dtsi b/arch/arm/boot/dts/exynos5250.dtsi
index 3c73d15..988f52a 100644
--- a/arch/arm/boot/dts/exynos5250.dtsi
+++ b/arch/arm/boot/dts/exynos5250.dtsi
@@ -64,6 +64,12 @@ 
 		interrupts = <0 71 0>;
 	};
 
+	ehci {
+		compatible = "samsung,exynos-ehci";
+		reg = <0x12110000 0x100>;
+		interrupts = <0 71 0>;
+	};
+
 	rtc {
 		compatible = "samsung,s3c6410-rtc";
 		reg = <0x101E0000 0x100>;
diff --git a/arch/arm/mach-exynos/mach-exynos5-dt.c b/arch/arm/mach-exynos/mach-exynos5-dt.c
index 39a4b34..0cc626e 100644
--- a/arch/arm/mach-exynos/mach-exynos5-dt.c
+++ b/arch/arm/mach-exynos/mach-exynos5-dt.c
@@ -20,6 +20,7 @@ 
 #include <plat/cpu.h>
 #include <plat/regs-serial.h>
 #include <plat/usb-phy.h>
+#include <plat/ehci.h>
 
 #include "common.h"
 
@@ -28,6 +29,11 @@  static struct exynos4_ohci_platdata smdk5250_ohci_pdata = {
 	.phy_exit = s5p_usb_phy_exit,
 };
 
+static struct s5p_ehci_platdata smdk5250_ehci_pdata = {
+	.phy_init = s5p_usb_phy_init,
+	.phy_exit = s5p_usb_phy_exit,
+};
+
 /*
  * The following lookup table is used to override device names when devices
  * are registered from device tree. This is temporarily added to enable
@@ -65,6 +71,8 @@  static const struct of_dev_auxdata exynos5250_auxdata_lookup[] __initconst = {
 	OF_DEV_AUXDATA("arm,pl330", EXYNOS5_PA_MDMA1, "dma-pl330.2", NULL),
 	OF_DEV_AUXDATA("samsung,exynos-ohci", 0x12120000,
 				"exynos-ohci", &smdk5250_ohci_pdata),
+	OF_DEV_AUXDATA("samsung,exynos-ehci", 0x12110000,
+				"s5p-ehci", &smdk5250_ehci_pdata),
 	{},
 };