* [PATCH 1/8] pci-rcar-gen2: add of match table
[not found] <1390754945-28142-1-git-send-email-ben.dooks@codethink.co.uk>
@ 2014-01-26 16:48 ` Ben Dooks
2014-01-27 12:48 ` Sergei Shtylyov
2014-01-26 16:48 ` [PATCH 2/8] pci-rcar-gen2: add initial device tree documentation Ben Dooks
` (5 subsequent siblings)
6 siblings, 1 reply; 30+ messages in thread
From: Ben Dooks @ 2014-01-26 16:48 UTC (permalink / raw)
To: linux-kernel
Cc: Ben Dooks, Bjorn Helgaas, Simon Horman, linux-pci, linux-sh,
devicetree
Add OF match table for pci-rcar-gen2 driver for device tree support.
Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
---
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Simon Horman <horms@verge.net.au>
Cc: linux-pci@vger.kernel.org
Cc: linux-sh@vger.kernel.org
Cc: devicetree@vger.kernel.org
---
drivers/pci/host/pci-rcar-gen2.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/pci/host/pci-rcar-gen2.c b/drivers/pci/host/pci-rcar-gen2.c
index ceec147..ea65bac 100644
--- a/drivers/pci/host/pci-rcar-gen2.c
+++ b/drivers/pci/host/pci-rcar-gen2.c
@@ -311,9 +311,17 @@ static int __init rcar_pci_probe(struct platform_device *pdev)
return rcar_pci_add_controller(priv);
}
+static struct of_device_id rcar_pci_of_match[] = {
+ { .compatible = "renesas,pci-r8a7790", },
+ { },
+};
+
+MODULE_DEVICE_TABLE(of, rcar_pci_of_match);
+
static struct platform_driver rcar_pci_driver = {
.driver = {
.name = "pci-rcar-gen2",
+ .of_match_table = rcar_pci_of_match,
},
};
--
1.8.5.2
^ permalink raw reply related [flat|nested] 30+ messages in thread
* Re: [PATCH 1/8] pci-rcar-gen2: add of match table
2014-01-26 16:48 ` [PATCH 1/8] pci-rcar-gen2: add of match table Ben Dooks
@ 2014-01-27 12:48 ` Sergei Shtylyov
2014-01-27 13:27 ` Ben Dooks
0 siblings, 1 reply; 30+ messages in thread
From: Sergei Shtylyov @ 2014-01-27 12:48 UTC (permalink / raw)
To: Ben Dooks, linux-kernel
Cc: Bjorn Helgaas, Simon Horman, linux-pci, linux-sh, devicetree
Hello.
On 26-01-2014 20:48, Ben Dooks wrote:
> Add OF match table for pci-rcar-gen2 driver for device tree support.
> Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
> ---
> Cc: Bjorn Helgaas <bhelgaas@google.com>
> Cc: Simon Horman <horms@verge.net.au>
> Cc: linux-pci@vger.kernel.org
> Cc: linux-sh@vger.kernel.org
> Cc: devicetree@vger.kernel.org
> ---
> drivers/pci/host/pci-rcar-gen2.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
> diff --git a/drivers/pci/host/pci-rcar-gen2.c b/drivers/pci/host/pci-rcar-gen2.c
> index ceec147..ea65bac 100644
> --- a/drivers/pci/host/pci-rcar-gen2.c
> +++ b/drivers/pci/host/pci-rcar-gen2.c
> @@ -311,9 +311,17 @@ static int __init rcar_pci_probe(struct platform_device *pdev)
> return rcar_pci_add_controller(priv);
> }
>
> +static struct of_device_id rcar_pci_of_match[] = {
> + { .compatible = "renesas,pci-r8a7790", },
Why only H2 SoC, if the driver is for both Gen2 SoCs?
WBR, Sergei
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH 1/8] pci-rcar-gen2: add of match table
2014-01-27 12:48 ` Sergei Shtylyov
@ 2014-01-27 13:27 ` Ben Dooks
2014-01-29 6:17 ` Simon Horman
0 siblings, 1 reply; 30+ messages in thread
From: Ben Dooks @ 2014-01-27 13:27 UTC (permalink / raw)
To: Sergei Shtylyov
Cc: linux-kernel, Bjorn Helgaas, Simon Horman, linux-pci, linux-sh,
devicetree
On 27/01/14 12:48, Sergei Shtylyov wrote:
> Hello.
>
> On 26-01-2014 20:48, Ben Dooks wrote:
>
>> Add OF match table for pci-rcar-gen2 driver for device tree support.
>
>> Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
>> ---
>> Cc: Bjorn Helgaas <bhelgaas@google.com>
>> Cc: Simon Horman <horms@verge.net.au>
>> Cc: linux-pci@vger.kernel.org
>> Cc: linux-sh@vger.kernel.org
>> Cc: devicetree@vger.kernel.org
>> ---
>> drivers/pci/host/pci-rcar-gen2.c | 8 ++++++++
>> 1 file changed, 8 insertions(+)
>
>> diff --git a/drivers/pci/host/pci-rcar-gen2.c
>> b/drivers/pci/host/pci-rcar-gen2.c
>> index ceec147..ea65bac 100644
>> --- a/drivers/pci/host/pci-rcar-gen2.c
>> +++ b/drivers/pci/host/pci-rcar-gen2.c
>> @@ -311,9 +311,17 @@ static int __init rcar_pci_probe(struct
>> platform_device *pdev)
>> return rcar_pci_add_controller(priv);
>> }
>>
>> +static struct of_device_id rcar_pci_of_match[] = {
>> + { .compatible = "renesas,pci-r8a7790", },
>
> Why only H2 SoC, if the driver is for both Gen2 SoCs?
I can add a "renesas,pci-rcar-gen2" as a fallback match however
I've not got anything other than an r8a7790 to test on. Also the
compatible properties are preferably named after the soc.
--
Ben Dooks http://www.codethink.co.uk/
Senior Engineer Codethink - Providing Genius
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH 1/8] pci-rcar-gen2: add of match table
2014-01-27 13:27 ` Ben Dooks
@ 2014-01-29 6:17 ` Simon Horman
2014-01-29 10:06 ` Geert Uytterhoeven
0 siblings, 1 reply; 30+ messages in thread
From: Simon Horman @ 2014-01-29 6:17 UTC (permalink / raw)
To: Ben Dooks
Cc: Sergei Shtylyov, linux-kernel, Bjorn Helgaas, linux-pci, linux-sh,
devicetree
On Mon, Jan 27, 2014 at 01:27:09PM +0000, Ben Dooks wrote:
> On 27/01/14 12:48, Sergei Shtylyov wrote:
> >Hello.
> >
> >On 26-01-2014 20:48, Ben Dooks wrote:
> >
> >>Add OF match table for pci-rcar-gen2 driver for device tree support.
> >
> >>Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
> >>---
> >>Cc: Bjorn Helgaas <bhelgaas@google.com>
> >>Cc: Simon Horman <horms@verge.net.au>
> >>Cc: linux-pci@vger.kernel.org
> >>Cc: linux-sh@vger.kernel.org
> >>Cc: devicetree@vger.kernel.org
> >>---
> >> drivers/pci/host/pci-rcar-gen2.c | 8 ++++++++
> >> 1 file changed, 8 insertions(+)
> >
> >>diff --git a/drivers/pci/host/pci-rcar-gen2.c
> >>b/drivers/pci/host/pci-rcar-gen2.c
> >>index ceec147..ea65bac 100644
> >>--- a/drivers/pci/host/pci-rcar-gen2.c
> >>+++ b/drivers/pci/host/pci-rcar-gen2.c
> >>@@ -311,9 +311,17 @@ static int __init rcar_pci_probe(struct
> >>platform_device *pdev)
> >> return rcar_pci_add_controller(priv);
> >> }
> >>
> >>+static struct of_device_id rcar_pci_of_match[] = {
> >>+ { .compatible = "renesas,pci-r8a7790", },
> >
> > Why only H2 SoC, if the driver is for both Gen2 SoCs?
>
> I can add a "renesas,pci-rcar-gen2" as a fallback match however
> I've not got anything other than an r8a7790 to test on. Also the
> compatible properties are preferably named after the soc.
I'm not sure what the "best practice" is here but I propose that
you add both "renesas,pci-rcar-gen2" and "renesas,pci-r8a7790" now.
And that "renesas,pci-r8a7791" can be added once the code has been
integrated and tested on that platform.
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH 1/8] pci-rcar-gen2: add of match table
2014-01-29 6:17 ` Simon Horman
@ 2014-01-29 10:06 ` Geert Uytterhoeven
2014-01-29 12:20 ` Simon Horman
0 siblings, 1 reply; 30+ messages in thread
From: Geert Uytterhoeven @ 2014-01-29 10:06 UTC (permalink / raw)
To: Simon Horman
Cc: Ben Dooks, Sergei Shtylyov, linux-kernel, Bjorn Helgaas,
linux-pci, Linux-sh list, devicetree@vger.kernel.org
On Wed, Jan 29, 2014 at 7:17 AM, Simon Horman <horms@verge.net.au> wrote:
>> >>+static struct of_device_id rcar_pci_of_match[] = {
>> >>+ { .compatible = "renesas,pci-r8a7790", },
>> >
>> > Why only H2 SoC, if the driver is for both Gen2 SoCs?
>>
>> I can add a "renesas,pci-rcar-gen2" as a fallback match however
>> I've not got anything other than an r8a7790 to test on. Also the
>> compatible properties are preferably named after the soc.
>
> I'm not sure what the "best practice" is here but I propose that
> you add both "renesas,pci-rcar-gen2" and "renesas,pci-r8a7790" now.
To the driver or to the '90 DTS?
If the DTS says
compatible = "renesas,pci-r8a7790", "renesas,pci-rcar-gen2"
then the driver can just live with "renesas,pci-rcar-gen2" for now.
> And that "renesas,pci-r8a7791" can be added once the code has been
> integrated and tested on that platform.
And later we can add
compatible = "renesas,pci-r8a7791", "renesas,pci-rcar-gen2"
to the '91 DTS if it turns out to be compatible.
If the '91 turns out to be incompatible, or partially compatible, the driver
can be updated later to handle both "renesas,pci-r8a7790" and
"renesas,pci-r8a7791" and differentiate between them.
(That's what I was instructed to do with SPI ;-)
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH 1/8] pci-rcar-gen2: add of match table
2014-01-29 10:06 ` Geert Uytterhoeven
@ 2014-01-29 12:20 ` Simon Horman
0 siblings, 0 replies; 30+ messages in thread
From: Simon Horman @ 2014-01-29 12:20 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Ben Dooks, Sergei Shtylyov, linux-kernel, Bjorn Helgaas,
linux-pci, Linux-sh list, devicetree@vger.kernel.org
On Wed, Jan 29, 2014 at 11:06:42AM +0100, Geert Uytterhoeven wrote:
> On Wed, Jan 29, 2014 at 7:17 AM, Simon Horman <horms@verge.net.au> wrote:
> >> >>+static struct of_device_id rcar_pci_of_match[] = {
> >> >>+ { .compatible = "renesas,pci-r8a7790", },
> >> >
> >> > Why only H2 SoC, if the driver is for both Gen2 SoCs?
> >>
> >> I can add a "renesas,pci-rcar-gen2" as a fallback match however
> >> I've not got anything other than an r8a7790 to test on. Also the
> >> compatible properties are preferably named after the soc.
> >
> > I'm not sure what the "best practice" is here but I propose that
> > you add both "renesas,pci-rcar-gen2" and "renesas,pci-r8a7790" now.
>
> To the driver or to the '90 DTS?
>
> If the DTS says
>
> compatible = "renesas,pci-r8a7790", "renesas,pci-rcar-gen2"
>
> then the driver can just live with "renesas,pci-rcar-gen2" for now.
>
> > And that "renesas,pci-r8a7791" can be added once the code has been
> > integrated and tested on that platform.
>
> And later we can add
>
> compatible = "renesas,pci-r8a7791", "renesas,pci-rcar-gen2"
>
> to the '91 DTS if it turns out to be compatible.
>
> If the '91 turns out to be incompatible, or partially compatible, the driver
> can be updated later to handle both "renesas,pci-r8a7790" and
> "renesas,pci-r8a7791" and differentiate between them.
>
> (That's what I was instructed to do with SPI ;-)
Thanks, that is more or less how I thought things work :)
^ permalink raw reply [flat|nested] 30+ messages in thread
* [PATCH 2/8] pci-rcar-gen2: add initial device tree documentation
[not found] <1390754945-28142-1-git-send-email-ben.dooks@codethink.co.uk>
2014-01-26 16:48 ` [PATCH 1/8] pci-rcar-gen2: add of match table Ben Dooks
@ 2014-01-26 16:48 ` Ben Dooks
2014-01-26 19:09 ` Geert Uytterhoeven
2014-01-26 16:49 ` [PATCH 3/8] ARM: shmbobile: r8a7790.dtsi: add pci0/1/2 nodes Ben Dooks
` (4 subsequent siblings)
6 siblings, 1 reply; 30+ messages in thread
From: Ben Dooks @ 2014-01-26 16:48 UTC (permalink / raw)
To: linux-kernel; +Cc: Ben Dooks, linux-sh, devicetree, horms+renesas
Add initial documentation for the pci-rcar-gen2 driver device tree bindings.
This is not yet complete and needs work on the sub-nodes for the PCI bus.
Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
---
Cc: linux-sh@vger.kernel.org
Cc: devicetree@vger.kernel.org
Cc: horms+renesas@verge.net.au
---
.../devicetree/bindings/pci/renessas,pci-r8a7790.txt | 12 ++++++++++++
1 file changed, 12 insertions(+)
create mode 100644 Documentation/devicetree/bindings/pci/renessas,pci-r8a7790.txt
diff --git a/Documentation/devicetree/bindings/pci/renessas,pci-r8a7790.txt b/Documentation/devicetree/bindings/pci/renessas,pci-r8a7790.txt
new file mode 100644
index 0000000..a6fd432
--- /dev/null
+++ b/Documentation/devicetree/bindings/pci/renessas,pci-r8a7790.txt
@@ -0,0 +1,12 @@
+Renesas internal AHB to PCI bridge
+
+This is the bridge used internally to connect the USB controllers to the
+AHB.
+
+Required properties:
+ - compatible: "renesas,pci-r8a7790" for the R8A7790 SoC
+ - reg : A list of physical regions to access the device. The first is
+ the operational registers for the OHCI/EHCI controller and the
+ second region is for the bridge configuration and control registers.
+ - interrupts : interrupt for the device
+ - clocks : The reference to the device clock
--
1.8.5.2
^ permalink raw reply related [flat|nested] 30+ messages in thread
* Re: [PATCH 2/8] pci-rcar-gen2: add initial device tree documentation
2014-01-26 16:48 ` [PATCH 2/8] pci-rcar-gen2: add initial device tree documentation Ben Dooks
@ 2014-01-26 19:09 ` Geert Uytterhoeven
2014-01-27 12:07 ` Ben Dooks
2014-01-27 13:31 ` Sergei Shtylyov
0 siblings, 2 replies; 30+ messages in thread
From: Geert Uytterhoeven @ 2014-01-26 19:09 UTC (permalink / raw)
To: Ben Dooks
Cc: linux-kernel, Linux-sh list, devicetree@vger.kernel.org,
horms+renesas
On Sun, Jan 26, 2014 at 5:48 PM, Ben Dooks <ben.dooks@codethink.co.uk> wrote:
> + - reg : A list of physical regions to access the device. The first is
> + the operational registers for the OHCI/EHCI controller and the
> + second region is for the bridge configuration and control registers.
You may want to add "reg-names" to use named regions, as there
is more than one region.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH 2/8] pci-rcar-gen2: add initial device tree documentation
2014-01-26 19:09 ` Geert Uytterhoeven
@ 2014-01-27 12:07 ` Ben Dooks
2014-01-27 13:31 ` Sergei Shtylyov
1 sibling, 0 replies; 30+ messages in thread
From: Ben Dooks @ 2014-01-27 12:07 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: linux-kernel, Linux-sh list, devicetree@vger.kernel.org,
horms+renesas
On 26/01/14 19:09, Geert Uytterhoeven wrote:
> On Sun, Jan 26, 2014 at 5:48 PM, Ben Dooks <ben.dooks@codethink.co.uk> wrote:
>> + - reg : A list of physical regions to access the device. The first is
>> + the operational registers for the OHCI/EHCI controller and the
>> + second region is for the bridge configuration and control registers.
>
> You may want to add "reg-names" to use named regions, as there
> is more than one region.
I will sort that out, it may require further patching...
--
Ben Dooks http://www.codethink.co.uk/
Senior Engineer Codethink - Providing Genius
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH 2/8] pci-rcar-gen2: add initial device tree documentation
2014-01-26 19:09 ` Geert Uytterhoeven
2014-01-27 12:07 ` Ben Dooks
@ 2014-01-27 13:31 ` Sergei Shtylyov
2014-01-27 13:33 ` Ben Dooks
1 sibling, 1 reply; 30+ messages in thread
From: Sergei Shtylyov @ 2014-01-27 13:31 UTC (permalink / raw)
To: Geert Uytterhoeven, Ben Dooks
Cc: linux-kernel, Linux-sh list, devicetree@vger.kernel.org,
horms+renesas
Hello.
On 26-01-2014 23:09, Geert Uytterhoeven wrote:
>> + - reg : A list of physical regions to access the device. The first is
>> + the operational registers for the OHCI/EHCI controller and the
>> + second region is for the bridge configuration and control registers.
> You may want to add "reg-names" to use named regions, as there
> is more than one region.
I've already told Ben he can't claim EHCI/OHCI register ranges at the
bridge node, so there should be only one "reg" specifier.
WBR, Sergei
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH 2/8] pci-rcar-gen2: add initial device tree documentation
2014-01-27 13:31 ` Sergei Shtylyov
@ 2014-01-27 13:33 ` Ben Dooks
2014-01-27 17:13 ` Sergei Shtylyov
0 siblings, 1 reply; 30+ messages in thread
From: Ben Dooks @ 2014-01-27 13:33 UTC (permalink / raw)
To: Sergei Shtylyov
Cc: Geert Uytterhoeven, linux-kernel, Linux-sh list,
devicetree@vger.kernel.org, horms+renesas
On 27/01/14 13:31, Sergei Shtylyov wrote:
> Hello.
>
> On 26-01-2014 23:09, Geert Uytterhoeven wrote:
>
>>> + - reg : A list of physical regions to access the device. The first is
>>> + the operational registers for the OHCI/EHCI controller and the
>>> + second region is for the bridge configuration and control
>>> registers.
>
>> You may want to add "reg-names" to use named regions, as there
>> is more than one region.
>
> I've already told Ben he can't claim EHCI/OHCI register ranges at
> the bridge node, so there should be only one "reg" specifier.
Well, that's going to take quite a bit of changing the driver as
it already assumes two nodes from the platform device definition.
--
Ben Dooks http://www.codethink.co.uk/
Senior Engineer Codethink - Providing Genius
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH 2/8] pci-rcar-gen2: add initial device tree documentation
2014-01-27 13:33 ` Ben Dooks
@ 2014-01-27 17:13 ` Sergei Shtylyov
0 siblings, 0 replies; 30+ messages in thread
From: Sergei Shtylyov @ 2014-01-27 17:13 UTC (permalink / raw)
To: Ben Dooks
Cc: Geert Uytterhoeven, linux-kernel, Linux-sh list,
devicetree@vger.kernel.org, horms+renesas
Hello.
On 01/27/2014 04:33 PM, Ben Dooks wrote:
>>>> + - reg : A list of physical regions to access the device. The first is
>>>> + the operational registers for the OHCI/EHCI controller and the
>>>> + second region is for the bridge configuration and control
>>>> registers.
>>> You may want to add "reg-names" to use named regions, as there
>>> is more than one region.
>> I've already told Ben he can't claim EHCI/OHCI register ranges at
>> the bridge node, so there should be only one "reg" specifier.
> Well, that's going to take quite a bit of changing the driver as
> it already assumes two nodes from the platform device definition.
Ah, I failed to realize it's not your mistake, sorry.
WBR, Sergei
^ permalink raw reply [flat|nested] 30+ messages in thread
* [PATCH 3/8] ARM: shmbobile: r8a7790.dtsi: add pci0/1/2 nodes
[not found] <1390754945-28142-1-git-send-email-ben.dooks@codethink.co.uk>
2014-01-26 16:48 ` [PATCH 1/8] pci-rcar-gen2: add of match table Ben Dooks
2014-01-26 16:48 ` [PATCH 2/8] pci-rcar-gen2: add initial device tree documentation Ben Dooks
@ 2014-01-26 16:49 ` Ben Dooks
2014-01-26 16:49 ` [PATCH 5/8] phy-rcar-usb-gen2: add device tree support Ben Dooks
` (3 subsequent siblings)
6 siblings, 0 replies; 30+ messages in thread
From: Ben Dooks @ 2014-01-26 16:49 UTC (permalink / raw)
To: linux-kernel; +Cc: Ben Dooks, devicetree, linux-sh, horms+renesas
Add nodes for USB PCI bridge devices.
Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
Reviewed-by: Ian Molton <ian.molton@codethink.co.uk>
---
Cc: devicetree@vger.kernel.org
Cc: linux-sh@vger.kernel.org
Cc: horms+renesas@verge.net.au
---
arch/arm/boot/dts/r8a7790.dtsi | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
diff --git a/arch/arm/boot/dts/r8a7790.dtsi b/arch/arm/boot/dts/r8a7790.dtsi
index 3cc834b..e716df8 100644
--- a/arch/arm/boot/dts/r8a7790.dtsi
+++ b/arch/arm/boot/dts/r8a7790.dtsi
@@ -728,4 +728,34 @@
"rcan1", "rcan0", "qspi_mod", "i2c3", "i2c2", "i2c1", "i2c0";
};
};
+
+ pci0: pci@ee090000 {
+ compatible = "renesas,pci-r8a7790";
+ clocks = <&mstp7_clks R8A7790_CLK_EHCI>;
+ reg = <0x0 0xee090000 0x0 0xc00>,
+ <0x0 0xee080000 0x0 0x1100>;
+ interrupt-parent = <&gic>;
+ interrupts = <0 108 IRQ_TYPE_LEVEL_HIGH>;
+ status = "disabled";
+ };
+
+ pci1: pci@ee0b0000 {
+ compatible = "renesas,pci-r8a7790";
+ clocks = <&mstp7_clks R8A7790_CLK_EHCI>;
+ reg = <0x0 0xee0b0000 0x0 0xc00>,
+ <0x0 0xee0a0000 0x0 0x1100>;
+ interrupt-parent = <&gic>;
+ interrupts = <0 112 IRQ_TYPE_LEVEL_HIGH>;
+ status = "disabled";
+ };
+
+ pci2: pci@ee0d0000 {
+ compatible = "renesas,pci-r8a7790";
+ clocks = <&mstp7_clks R8A7790_CLK_EHCI>;
+ reg = <0x0 0xee0d0000 0x0 0xc00>,
+ <0x0 0xee0c0000 0x0 0x1100>;
+ interrupt-parent = <&gic>;
+ interrupts = <0 113 IRQ_TYPE_LEVEL_HIGH>;
+ status = "disabled";
+ };
};
--
1.8.5.2
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH 5/8] phy-rcar-usb-gen2: add device tree support
[not found] <1390754945-28142-1-git-send-email-ben.dooks@codethink.co.uk>
` (2 preceding siblings ...)
2014-01-26 16:49 ` [PATCH 3/8] ARM: shmbobile: r8a7790.dtsi: add pci0/1/2 nodes Ben Dooks
@ 2014-01-26 16:49 ` Ben Dooks
[not found] ` <1390754945-28142-6-git-send-email-ben.dooks-4yDnlxn2s6sWdaTGBSpHTA@public.gmane.org>
2014-01-26 16:49 ` [PATCH 6/8] phy-rcar-usb-gen2: add device tree documentation Ben Dooks
` (2 subsequent siblings)
6 siblings, 1 reply; 30+ messages in thread
From: Ben Dooks @ 2014-01-26 16:49 UTC (permalink / raw)
To: linux-kernel
Cc: Ben Dooks, linux-usb, linux-sh, Magnus Damm, Simon Horman,
devicetree
Add support for the phy-rcar-gen2-usb driver to be probed from device tree.
Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
Reviewed-by: Ian Molton <ian.molton@codethink.co.uk>
---
Fixes from v1:
- use of_property_reasd-bool()
- remove unused of_id variable
Cc: linux-usb@vger.kernel.org
Cc: linux-sh@vger.kernel.org
Cc: Magnus Damm <magnus.damm@gmail.com>
Cc: Simon Horman <horms@verge.net.au>
Cc: devicetree@vger.kernel.org
---
drivers/usb/phy/phy-rcar-gen2-usb.c | 31 ++++++++++++++++++++++++++-----
1 file changed, 26 insertions(+), 5 deletions(-)
diff --git a/drivers/usb/phy/phy-rcar-gen2-usb.c b/drivers/usb/phy/phy-rcar-gen2-usb.c
index db3ab34..d146388 100644
--- a/drivers/usb/phy/phy-rcar-gen2-usb.c
+++ b/drivers/usb/phy/phy-rcar-gen2-usb.c
@@ -15,6 +15,7 @@
#include <linux/module.h>
#include <linux/platform_data/usb-rcar-gen2-phy.h>
#include <linux/platform_device.h>
+#include <linux/of_device.h>
#include <linux/spinlock.h>
#include <linux/usb/otg.h>
@@ -167,6 +168,12 @@ out:
spin_unlock_irqrestore(&priv->lock, flags);
}
+static struct of_device_id rcar_gen2_usb_phy_ofmatch[] = {
+ { .compatible = "renesas,usb-phy-r8a7790", },
+ { .compatible = "renesas,rcar-gen2-usb-phy", },
+ { },
+};
+
static int rcar_gen2_usb_phy_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
@@ -178,7 +185,7 @@ static int rcar_gen2_usb_phy_probe(struct platform_device *pdev)
int retval;
pdata = dev_get_platdata(&pdev->dev);
- if (!pdata) {
+ if (!pdata && !dev->of_node) {
dev_err(dev, "No platform data\n");
return -EINVAL;
}
@@ -203,16 +210,29 @@ static int rcar_gen2_usb_phy_probe(struct platform_device *pdev)
spin_lock_init(&priv->lock);
priv->clk = clk;
priv->base = base;
- priv->ugctrl2 = pdata->chan0_pci ?
- USBHS_UGCTRL2_USB0_PCI : USBHS_UGCTRL2_USB0_HS;
- priv->ugctrl2 |= pdata->chan2_pci ?
- USBHS_UGCTRL2_USB2_PCI : USBHS_UGCTRL2_USB2_SS;
priv->phy.dev = dev;
priv->phy.label = dev_name(dev);
priv->phy.init = rcar_gen2_usb_phy_init;
priv->phy.shutdown = rcar_gen2_usb_phy_shutdown;
priv->phy.set_suspend = rcar_gen2_usb_phy_set_suspend;
+ if (of_id) {
+ if (of_property_read_bool(dev->of_node, "renesas,usb0-hs"))
+ priv->ugctrl2 = USBHS_UGCTRL2_USB0_HS;
+ else
+ priv->ugctrl2 = USBHS_UGCTRL2_USB0_PCI;
+
+ if (of_property_read_bool(dev->of_node, "renesas,usb2-ss"))
+ priv->ugctrl2 |= USBHS_UGCTRL2_USB2_SS;
+ else
+ priv->ugctrl2 |= USBHS_UGCTRL2_USB2_PCI;
+ } else {
+ priv->ugctrl2 = pdata->chan0_pci ?
+ USBHS_UGCTRL2_USB0_PCI : USBHS_UGCTRL2_USB0_HS;
+ priv->ugctrl2 |= pdata->chan2_pci ?
+ USBHS_UGCTRL2_USB2_PCI : USBHS_UGCTRL2_USB2_SS;
+ }
+
retval = usb_add_phy(&priv->phy, USB_PHY_TYPE_USB2);
if (retval < 0) {
dev_err(dev, "Failed to add USB phy\n");
@@ -236,6 +256,7 @@ static int rcar_gen2_usb_phy_remove(struct platform_device *pdev)
static struct platform_driver rcar_gen2_usb_phy_driver = {
.driver = {
.name = "usb_phy_rcar_gen2",
+ .of_match_table = rcar_gen2_usb_phy_ofmatch,
},
.probe = rcar_gen2_usb_phy_probe,
.remove = rcar_gen2_usb_phy_remove,
--
1.8.5.2
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH 6/8] phy-rcar-usb-gen2: add device tree documentation
[not found] <1390754945-28142-1-git-send-email-ben.dooks@codethink.co.uk>
` (3 preceding siblings ...)
2014-01-26 16:49 ` [PATCH 5/8] phy-rcar-usb-gen2: add device tree support Ben Dooks
@ 2014-01-26 16:49 ` Ben Dooks
2014-01-26 19:07 ` Geert Uytterhoeven
2014-01-26 16:49 ` [PATCH 7/8] ARM: shmobile: r8a7790.dtsi: add usbphy node Ben Dooks
[not found] ` <1390754945-28142-1-git-send-email-ben.dooks-4yDnlxn2s6sWdaTGBSpHTA@public.gmane.org>
6 siblings, 1 reply; 30+ messages in thread
From: Ben Dooks @ 2014-01-26 16:49 UTC (permalink / raw)
To: linux-kernel; +Cc: Ben Dooks, linux-sh, devicetree, horms+renesas
Documentation for phy-rcar-usb-gen2 device tree binding.
Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
--
Cc: linux-sh@vger.kernel.org
Cc: devicetree@vger.kernel.org
Cc: horms+renesas@verge.net.au
---
.../bindings/usb/renesas,rcar-gen2-usb-phy.txt | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
create mode 100644 Documentation/devicetree/bindings/usb/renesas,rcar-gen2-usb-phy.txt
diff --git a/Documentation/devicetree/bindings/usb/renesas,rcar-gen2-usb-phy.txt b/Documentation/devicetree/bindings/usb/renesas,rcar-gen2-usb-phy.txt
new file mode 100644
index 0000000..e1d2dd9
--- /dev/null
+++ b/Documentation/devicetree/bindings/usb/renesas,rcar-gen2-usb-phy.txt
@@ -0,0 +1,16 @@
+Renesas RCar gen2 USB PHY bindings
+
+Required properties:
+ - compatible: "renesas,usb-phy-r8a7790" for the R8A7790 SoC or
+ "renesas,rcar-gen2-usb-phy" for any generic comaptible device.
+ - reg : A single region to access device registers
+ - clocks : The reference to the clock to use for this block
+ - clock-names : The name for the clock at index 0 (must be "usbhs")
+
+Note, interrupt is currently not supported by the driver, but there should
+be a node in the device tree for it.
+
+Optional properties:
+
+ - renesas,usb0-hs: boolean, if present USB0 is connected to HS device.
+ - renesas,usb2-ss: boolean, if present USB2 is connected to XHCI controller.
--
1.8.5.2
^ permalink raw reply related [flat|nested] 30+ messages in thread
* Re: [PATCH 6/8] phy-rcar-usb-gen2: add device tree documentation
2014-01-26 16:49 ` [PATCH 6/8] phy-rcar-usb-gen2: add device tree documentation Ben Dooks
@ 2014-01-26 19:07 ` Geert Uytterhoeven
0 siblings, 0 replies; 30+ messages in thread
From: Geert Uytterhoeven @ 2014-01-26 19:07 UTC (permalink / raw)
To: Ben Dooks
Cc: linux-kernel, Linux-sh list, devicetree@vger.kernel.org,
horms+renesas
On Sun, Jan 26, 2014 at 5:49 PM, Ben Dooks <ben.dooks@codethink.co.uk> wrote:
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/usb/renesas,rcar-gen2-usb-phy.txt
> @@ -0,0 +1,16 @@
> +Renesas RCar gen2 USB PHY bindings
> +
> +Required properties:
> + - compatible: "renesas,usb-phy-r8a7790" for the R8A7790 SoC or
> + "renesas,rcar-gen2-usb-phy" for any generic comaptible device.
> + - reg : A single region to access device registers
> + - clocks : The reference to the clock to use for this block
> + - clock-names : The name for the clock at index 0 (must be "usbhs")
> +
> +Note, interrupt is currently not supported by the driver, but there should
> +be a node in the device tree for it.
s/node/property/?
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 30+ messages in thread
* [PATCH 7/8] ARM: shmobile: r8a7790.dtsi: add usbphy node
[not found] <1390754945-28142-1-git-send-email-ben.dooks@codethink.co.uk>
` (4 preceding siblings ...)
2014-01-26 16:49 ` [PATCH 6/8] phy-rcar-usb-gen2: add device tree documentation Ben Dooks
@ 2014-01-26 16:49 ` Ben Dooks
[not found] ` <1390754945-28142-1-git-send-email-ben.dooks-4yDnlxn2s6sWdaTGBSpHTA@public.gmane.org>
6 siblings, 0 replies; 30+ messages in thread
From: Ben Dooks @ 2014-01-26 16:49 UTC (permalink / raw)
To: linux-kernel; +Cc: Ben Dooks, devicetree, Magnus Damm, Simon Horman, linux-sh
Add node for USB PHY driver to the base R8A7790 device tree include file.
It is up to the board file to enable and configure it as necessary.
Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
Reviewed-by: Ian Molton <ian.molton@codethink.co.uk>
---
Cc: devicetree@vger.kernel.org
Cc: Magnus Damm <magnus.damm@gmail.com>
Cc: Simon Horman <horms@verge.net.au>
Cc: linux-sh@vger.kernel.org
---
arch/arm/boot/dts/r8a7790.dtsi | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/arch/arm/boot/dts/r8a7790.dtsi b/arch/arm/boot/dts/r8a7790.dtsi
index e716df8..5542859 100644
--- a/arch/arm/boot/dts/r8a7790.dtsi
+++ b/arch/arm/boot/dts/r8a7790.dtsi
@@ -758,4 +758,12 @@
interrupts = <0 113 IRQ_TYPE_LEVEL_HIGH>;
status = "disabled";
};
+
+ usbphy: usbphy@e6590100 {
+ compatible = "renesas,usb-phy-r8a7790";
+ clocks = <&mstp7_clks R8A7790_CLK_HSUSB>;
+ clock-names = "usbhs";
+ reg = < 0x0 0xe6590100 0x0 0x100>;
+ status = "disabled";
+ };
};
--
1.8.5.2
^ permalink raw reply related [flat|nested] 30+ messages in thread
[parent not found: <1390754945-28142-1-git-send-email-ben.dooks-4yDnlxn2s6sWdaTGBSpHTA@public.gmane.org>]
* [PATCH 4/8] ARM: shmobile: lager.dts: add pci 0/1/2
[not found] ` <1390754945-28142-1-git-send-email-ben.dooks-4yDnlxn2s6sWdaTGBSpHTA@public.gmane.org>
@ 2014-01-26 16:49 ` Ben Dooks
2014-01-26 16:49 ` [PATCH 8/8] ARM: shmobile: lager.dtb: add usbphy reference Ben Dooks
1 sibling, 0 replies; 30+ messages in thread
From: Ben Dooks @ 2014-01-26 16:49 UTC (permalink / raw)
To: linux-kernel-81qHHgoATdFT9dQujB1mzip2UmYkHbXO
Cc: Ben Dooks, linux-sh-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA, Magnus Damm, Simon Horman
Enable pci1 and pci2 nodes for USB controllers attached to the AHB<>PCI
bridge devices. Node pci0 is enabled for the moment as a device, but
could be switched to usb-gadget mode later.
Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
Reviewed-by: Ian Molton <ian.molton@codethink.co.uk>
---
Cc: linux-sh@vger.kernel.org
Cc: devicetree@vger.kernel.org
Cc: Magnus Damm <magnus.damm@gmail.com>
Cc: Simon Horman <horms@verge.net.au>
---
arch/arm/boot/dts/r8a7790-lager.dts | 34 ++++++++++++++++++++++++++++++++++
1 file changed, 34 insertions(+)
diff --git a/arch/arm/boot/dts/r8a7790-lager.dts b/arch/arm/boot/dts/r8a7790-lager.dts
index 57569cb..8dfcd25 100644
--- a/arch/arm/boot/dts/r8a7790-lager.dts
+++ b/arch/arm/boot/dts/r8a7790-lager.dts
@@ -80,6 +80,22 @@
renesas,groups = "mmc1_data8", "mmc1_ctrl";
renesas,function = "mmc1";
};
+
+ usb0_pins: usb0 {
+ renesas,groups = "usb0";
+ renesas,function = "usb";
+ };
+
+ usb1_pins: usb1 {
+ renesas,groups = "usb1";
+ renesas,function = "usb";
+ };
+
+ usb2_pins: usb2 {
+ renesas,groups = "usb2";
+ renesas,function = "usb";
+ };
+
};
&mmcif1 {
@@ -91,3 +107,21 @@
non-removable;
status = "okay";
};
+
+&pci0 {
+ status = "okay";
+ pinctrl-0 = <&usb0_pins>;
+ pinctrl-names = "default";
+};
+
+&pci1 {
+ status = "okay";
+ pinctrl-0 = <&usb1_pins>;
+ pinctrl-names = "default";
+};
+
+&pci2 {
+ status = "okay";
+ pinctrl-0 = <&usb2_pins>;
+ pinctrl-names = "default";
+};
--
1.8.5.2
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH 8/8] ARM: shmobile: lager.dtb: add usbphy reference
[not found] ` <1390754945-28142-1-git-send-email-ben.dooks-4yDnlxn2s6sWdaTGBSpHTA@public.gmane.org>
2014-01-26 16:49 ` [PATCH 4/8] ARM: shmobile: lager.dts: add pci 0/1/2 Ben Dooks
@ 2014-01-26 16:49 ` Ben Dooks
1 sibling, 0 replies; 30+ messages in thread
From: Ben Dooks @ 2014-01-26 16:49 UTC (permalink / raw)
To: linux-kernel-81qHHgoATdFT9dQujB1mzip2UmYkHbXO
Cc: Ben Dooks, linux-sh-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA, Magnus Damm, Simon Horman
Enable the usbphy node so that the phy driver is available.
Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
Reviewed-by: Ian Molton <ian.molton@codethink.co.uk>
---
Cc: linux-sh@vger.kernel.org
Cc: devicetree@vger.kernel.org
Cc: Magnus Damm <magnus.damm@gmail.com>
Cc: Simon Horman <horms@verge.net.au>
---
arch/arm/boot/dts/r8a7790-lager.dts | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/arm/boot/dts/r8a7790-lager.dts b/arch/arm/boot/dts/r8a7790-lager.dts
index 8dfcd25..83bf18d 100644
--- a/arch/arm/boot/dts/r8a7790-lager.dts
+++ b/arch/arm/boot/dts/r8a7790-lager.dts
@@ -125,3 +125,7 @@
pinctrl-0 = <&usb2_pins>;
pinctrl-names = "default";
};
+
+&usbphy {
+ status = "okay";
+};
--
1.8.5.2
^ permalink raw reply related [flat|nested] 30+ messages in thread