pci-rcar-gen2: add of match table
Subsystems (6)
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/8 pci-rcar-gen2: add of match table
Add OF match table for pci-rcar-gen2 driver for device tree support.
---
Cc: Bjorn Helgaas <[email protected]>
Cc: Simon Horman <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
--- drivers/pci/host/pci-rcar-gen2.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/pci/host/pci-rcar-gen2.c +8 -0
@@ -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, }, };
Signature · 1 line
1.8.5.2
Hello.
Quoted 18 lines · Ben Dooks
Add OF match table for pci-rcar-gen2 driver for device tree support.
Signed-off-by Ben Dooks <[email protected]>---
Cc: Bjorn Helgaas <[email protected]>
Cc: Simon Horman <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]--- drivers/pci/host/pci-rcar-gen2.c | 8 ++++++++ 1 file changed, 8 insertions(+)drivers/pci/host/pci-rcar-gen2.c +0
-0
drivers/pci/host/pci-rcar-gen2.c static int __init rcar_pci_probe(struct platform_device *pdev) · line 315
Quoted 5 lines
drivers/pci/host/pci-rcar-gen2.c +2
-0@@ -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
Quoted 27 lines · Sergei Shtylyov
Hello.
Quoted 23 lines · Ben Dooks
Add OF match table for pci-rcar-gen2 driver for device tree support.
Signed-off-by Ben Dooks <[email protected]>---
Cc: Bjorn Helgaas <[email protected]>
Cc: Simon Horman <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]--- drivers/pci/host/pci-rcar-gen2.c | 8 ++++++++ 1 file changed, 8 insertions(+)drivers/pci/host/pci-rcar-gen2.c +0
-0@@ -311,9 +311,17 @@ static int __init rcar_pci_probe(struct platform_device *pdev)return rcar_pci_add_controller (priv); }
Quoted 4 lines
drivers/pci/host/pci-rcar-gen2.c static int __init rcar_pci_probe(struct platform_device *pdev) · line 315
Quoted 2 lines
drivers/pci/host/pci-rcar-gen2.c +2
-0+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.
Signature · 2 lines
Ben Dooks http://www.codethink.co.uk/ Senior Engineer Codethink - Providing Genius
Quoted 28 lines · Ben Dooks
Quoted 27 lines · Sergei Shtylyov
Hello.
Quoted 23 lines · Ben Dooks
Add OF match table for pci-rcar-gen2 driver for device tree support.
Signed-off-by Ben Dooks <[email protected]>---
Cc: Bjorn Helgaas <[email protected]>
Cc: Simon Horman <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]--- drivers/pci/host/pci-rcar-gen2.c | 8 ++++++++ 1 file changed, 8 insertions(+)drivers/pci/host/pci-rcar-gen2.c +0
-0@@ -311,9 +311,17 @@ static int __init rcar_pci_probe(struct platform_device *pdev)return rcar_pci_add_controller (priv); }
Quoted 8 lines
Quoted 4 lines
drivers/pci/host/pci-rcar-gen2.c static int __init rcar_pci_probe(struct platform_device *pdev) · line 315
Quoted 2 lines
drivers/pci/host/pci-rcar-gen2.c +2
-0+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.
Quoted 11 lines · Simon Horman
Quoted 8 lines
Quoted 4 lines
drivers/pci/host/pci-rcar-gen2.c static int __init rcar_pci_probe(struct platform_device *pdev) · line 315
Quoted 2 lines
drivers/pci/host/pci-rcar-gen2.c +2
-0+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.
Quoted 2 lines
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 -- [email protected]
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
Quoted 28 lines · Geert Uytterhoeven
Quoted 11 lines · Simon Horman
Quoted 8 lines
Quoted 4 lines
drivers/pci/host/pci-rcar-gen2.c static int __init rcar_pci_probe(struct platform_device *pdev) · line 315
Quoted 2 lines
drivers/pci/host/pci-rcar-gen2.c +2
-0+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.
Quoted 2 lines
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"
Quoted 7 lines
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 :)
PATCH 2/8 pci-rcar-gen2: add initial device tree documentation
In reply to a message not in the archiveAdd 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.
---
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
--- .../devicetree/bindings/pci/renessas,pci-r8a7790.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 Documentation/devicetree/bindings/pci/renessas,pci-r8a7790.txt
Documentation/devicetree/bindings/pci/renessas,pci-r8a7790.txt new file +12 -0
@@ -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
Signature · 1 line
1.8.5.2
Re: [PATCH 2/8] pci-rcar-gen2: add initial device tree documentation
Documentation/devicetree/bindings/pci/renessas,pci-r8a7790.txt line 10
Quoted 3 lines · Ben Dooks
+ - reg : A list of physical regions to access the device. The first is
Documentation/devicetree/bindings/pci/renessas,pci-r8a7790.txt new file +2
-0+ 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 -- [email protected]
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
Re: [PATCH 2/8] pci-rcar-gen2: add initial device tree documentation
Quoted 7 lines · Geert Uytterhoeven
Documentation/devicetree/bindings/pci/renessas,pci-r8a7790.txt line 10
Quoted 3 lines · Ben Dooks
+ - reg : A list of physical regions to access the device. The first is
Documentation/devicetree/bindings/pci/renessas,pci-r8a7790.txt new file +2
-0+ 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...
Signature · 2 lines
Ben Dooks http://www.codethink.co.uk/ Senior Engineer Codethink - Providing Genius
Re: [PATCH 2/8] pci-rcar-gen2: add initial device tree documentation
In reply to Geert UytterhoevenHello.
Quoted 6 lines · Geert Uytterhoeven
Documentation/devicetree/bindings/pci/renessas,pci-r8a7790.txt line 10
Quoted 3 lines
+ - reg : A list of physical regions to access the device. The first is
Documentation/devicetree/bindings/pci/renessas,pci-r8a7790.txt new file +2
-0+ 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
Re: [PATCH 2/8] pci-rcar-gen2: add initial device tree documentation
Quoted 9 lines · Sergei Shtylyov
Hello.
Quoted 4 lines · Geert Uytterhoeven
Quoted 4 lines
+ - reg : A list of physical regions to access the device. The first is
(quoted diff) +2
-0+ the operational registers for the OHCI/EHCI controller and the + second region is for the bridge configuration and controlregisters.
Quoted 5 lines
Quoted 2 lines
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.
Signature · 2 lines
Ben Dooks http://www.codethink.co.uk/ Senior Engineer Codethink - Providing Genius
Re: [PATCH 2/8] pci-rcar-gen2: add initial device tree documentation
Hello.
Quoted 5 lines · Ben Dooks
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
+ - reg : A list of physical regions to access the device. The first is
(quoted diff) +2
-0+ the operational registers for the OHCI/EHCI controller and the + second region is for the bridge configuration and controlregisters.
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
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
PATCH 3/8 ARM: shmbobile: r8a7790.dtsi: add pci0/1/2 nodes
In reply to a message not in the archiveAdd nodes for USB PCI bridge devices.
---
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
--- arch/arm/boot/dts/r8a7790.dtsi | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+)
arch/arm/boot/dts/r8a7790.dtsi +30 -0
@@ -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"; + }; };
Signature · 1 line
1.8.5.2
A message that is not in the archive (sent off-list or not yet received): 1390754945-28142-1-git-send-email-ben.dooks-4yDnlxn2s6sWdaTGBSpHTA@public.gmane.org
PATCH 4/8 ARM: shmobile: lager.dts: add pci 0/1/2
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.
---
Cc: [email protected]
Cc: [email protected]
Cc: Magnus Damm <[email protected]>
Cc: Simon Horman <horms-/[email protected]>
--- arch/arm/boot/dts/r8a7790-lager.dts | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+)
arch/arm/boot/dts/r8a7790-lager.dts +34 -0
@@ -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"; +};
Signature · 6 lines
1.8.5.2 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 8/8 ARM: shmobile: lager.dtb: add usbphy reference
In reply to a message not in the archiveEnable the usbphy node so that the phy driver is available.
---
Cc: [email protected]
Cc: [email protected]
Cc: Magnus Damm <[email protected]>
Cc: Simon Horman <horms-/[email protected]>
--- arch/arm/boot/dts/r8a7790-lager.dts | 4 ++++ 1 file changed, 4 insertions(+)
arch/arm/boot/dts/r8a7790-lager.dts +4 -0
@@ -125,3 +125,7 @@ pinctrl-0 = <&usb2_pins>; pinctrl-names = "default"; }; + +&usbphy { + status = "okay"; +};
Signature · 6 lines
1.8.5.2 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 5/8 phy-rcar-usb-gen2: add device tree support
In reply to a message not in the archiveAdd support for the phy-rcar-gen2-usb driver to be probed from device tree.
---
Fixes from v1:
- use of_property_reasd-bool()
- remove unused of_id variable
--- drivers/usb/phy/phy-rcar-gen2-usb.c | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-)
drivers/usb/phy/phy-rcar-gen2-usb.c +26 -5
@@ -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,
Signature · 1 line
1.8.5.2
A message that is not in the archive (sent off-list or not yet received): 1390754945-28142-6-git-send-email-ben.dooks-4yDnlxn2s6sWdaTGBSpHTA@public.gmane.org
Re: [PATCH 5/8] phy-rcar-usb-gen2: add device tree support
Hello.
Quoted 22 lines · Ben Dooks
Add support for the phy-rcar-gen2-usb driver to be probed from device tree.
Signed-off-by Ben Dooks <[email protected]>Reviewed-by Ian Molton <[email protected]>---
Fixes from v1:
- use of_property_reasd-bool()
- remove unusedof_idvariableCc Magnus Damm <[email protected]>Cc Simon Horman <[email protected]>--- drivers/usb/phy/phy-rcar-gen2-usb.c | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-)drivers/usb/phy/phy-rcar-gen2-usb.c +0
-0
[...]
Quoted 1 line
drivers/usb/phy/phy-rcar-gen2-usb.c +0
-0@@ -203,16 +210,29 @@ static int rcar_gen2_usb_phy_probe(struct platform_device *pdev)
[...]
drivers/usb/phy/phy-rcar-gen2-usb.c static int rcar_gen2_usb_phy_probe(struct platform_device *pdev) · line 219
Quoted 1 line
drivers/usb/phy/phy-rcar-gen2-usb.c +1
-0+if (of_id) {
You've removed the variable but not its use. Have you tried to compile
this patch?
Quoted 9 lines
drivers/usb/phy/phy-rcar-gen2-usb.c +9
-0+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 ;
drivers/usb/phy/phy-rcar-gen2-usb.c static int rcar_gen2_usb_phy_probe(struct platform_device *pdev) · line 238
Quoted 10 lines
drivers/usb/phy/phy-rcar-gen2-usb.c +7
-0+ }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" );
WBR, Sergei
Re: [PATCH 5/8] phy-rcar-usb-gen2: add device tree support
Quoted 30 lines · Sergei Shtylyov
Hello.
Quoted 25 lines · Ben Dooks
Add support for the phy-rcar-gen2-usb driver to be probed from device tree.
Signed-off-by Ben Dooks <[email protected]>Reviewed-by Ian Molton <[email protected]>---
Fixes from v1:
- use of_property_reasd-bool()
- remove unusedof_idvariableCc Magnus Damm <[email protected]>Cc Simon Horman <[email protected]>--- drivers/usb/phy/phy-rcar-gen2-usb.c | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-)drivers/usb/phy/phy-rcar-gen2-usb.c +0
-0[...]
Quoted 7 lines
Quoted 2 lines
drivers/usb/phy/phy-rcar-gen2-usb.c +0
-0@@ -203,16 +210,29 @@ static int rcar_gen2_usb_phy_probe(struct platform_device *pdev)[...]
Quoted 1 line
+ if (
of_id) {You've removed the variable but not its use. Have you tried to
compile this patch?
Thanks, already noticed that and produced v3.
I should not be let near git-rebase when hungry.
Signature · 2 lines
Ben Dooks http://www.codethink.co.uk/ Senior Engineer Codethink - Providing Genius
PATCH 1/1 phy-rcar-usb-gen2: add device tree support
In reply to a message not in the archiveAdd support for the phy-rcar-gen2-usb driver to be probed from device tree.
---
Fixes from v2:
- fix missing of_if patch
(I clearly should not be let near git-rebase when hungry)
Fixes from v1:
- use of_property_reasd-bool()
- remove unused of_id variable
--- drivers/usb/phy/phy-rcar-gen2-usb.c | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-)
drivers/usb/phy/phy-rcar-gen2-usb.c +26 -5
@@ -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 (dev->of_node) { +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,
Signature · 6 lines
1.8.5.2 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] phy-rcar-usb-gen2: add device tree support
Hi,
Quoted 13 lines · Ben Dooks
Add support for the phy-rcar-gen2-usb driver to be probed from device tree.
Signed-off-by Ben Dooks <[email protected]>Reviewed-by Ian Molton <[email protected]>---
Fixes from v2:
- fix missingof_ifpatch
(I clearly should not be let near git-rebase when hungry)Fixes from v1:
- use of_property_reasd-bool()
- remove unusedof_idvariable
Quoted 5 lines
Cc Magnus Damm <[email protected]>Cc Simon Horman <[email protected]>
it's a good practice to Cc maintainers ;-)
patch looks good to me, but I'd like to get an Ack from one of DT maintainers
Quoted 87 lines
--- drivers/usb/phy/phy-rcar-gen2-usb.c | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-)drivers/usb/phy/phy-rcar-gen2-usb.c +26
-5@@ -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 (dev->of_node) { +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,Signature · 6 lines
1.8.5.2 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 1 line
balbi
Re: [PATCH] phy-rcar-usb-gen2: add device tree support
In reply to Ben DooksHello.
Quoted 26 lines · Ben Dooks
Add support for the phy-rcar-gen2-usb driver to be probed from device tree.
Signed-off-by Ben Dooks <[email protected]>Reviewed-by Ian Molton <[email protected]>---
Fixes from v2:
- fix missingof_ifpatch
(I clearly should not be let near git-rebase when hungry)Fixes from v1:
- use of_property_reasd-bool()
- remove unusedof_idvariableCc Magnus Damm <[email protected]>Cc Simon Horman <[email protected]>--- drivers/usb/phy/phy-rcar-gen2-usb.c | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-)drivers/usb/phy/phy-rcar-gen2-usb.c +0
-0
[...]
drivers/usb/phy/phy-rcar-gen2-usb.c out: · line 173
Quoted 7 lines
drivers/usb/phy/phy-rcar-gen2-usb.c +3
-0@@ -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" , },
Frankly speaking, I don't understand the need for the clearly duplicate
entries.
WBR, Sergei
Re: [PATCH] phy-rcar-usb-gen2: add device tree support
Quoted 3 lines · Sergei Shtylyov
Hello.
On 01/26/2014 08:05 PM, Ben Dooks wrote:
[snip]
Quoted 7 lines
drivers/usb/phy/phy-rcar-gen2-usb.c out: · line 173
Quoted 4 lines
drivers/usb/phy/phy-rcar-gen2-usb.c +3
-0+static struct of_device_id rcar_gen2_usb_phy_ofmatch[] = { + { .compatible ="renesas,usb-phy-r8a7790" , }, + { .compatible ="renesas,rcar-gen2-usb-phy" , },Frankly speaking, I don't understand the need for the clearly
duplicate entries.
Thanks, will look into remove it.
Anyone else have any comments on this?
Signature · 2 lines
Ben Dooks http://www.codethink.co.uk/ Senior Engineer Codethink - Providing Genius
A message that is not in the archive (sent off-list or not yet received): [email protected]
Re: [PATCH] phy-rcar-usb-gen2: add device tree support
Quoted 12 lines · Ben Dooks
Quoted 3 lines · Sergei Shtylyov
Hello.
On 01/26/2014 08:05 PM, Ben Dooks wrote:
[snip]
Quoted 5 lines
Quoted 4 lines
drivers/usb/phy/phy-rcar-gen2-usb.c +3
-0+static struct of_device_id rcar_gen2_usb_phy_ofmatch[] = { + { .compatible ="renesas,usb-phy-r8a7790" , }, + { .compatible ="renesas,rcar-gen2-usb-phy" , },
Quoted 5 lines
Quoted 2 lines
Frankly speaking, I don't understand the need for the clearly
duplicate entries.Thanks, will look into remove it.
Anyone else have any comments on this?
I would like you to leave it there.
As we know the r8a7790 is an R-Car Gen2 SoC. But there are other R-Car Gen2 SoCs, such as the r8a7791, they it could plausibly make use of rcar-gen2-usb-phy until the driver is updated with a usb-phy-r8a7791 entry. --
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 20140129062212.GD23833-/[email protected]
Re: [PATCH] phy-rcar-usb-gen2: add device tree support
Hello.
Quoted 9 lines · Simon Horman
Quoted 8 lines
[snip]
Quoted 6 lines
drivers/usb/phy/phy-rcar-gen2-usb.c out: · line 173
Quoted 3 lines
drivers/usb/phy/phy-rcar-gen2-usb.c +3
-0+static struct of_device_id rcar_gen2_usb_phy_ofmatch[] = { + { .compatible ="renesas,usb-phy-r8a7790" , }, + { .compatible ="renesas,rcar-gen2-usb-phy" , },Frankly speaking, I don't understand the need for the clearly
duplicate entries.
Quoted 8 lines
Quoted 2 lines
Thanks, will look into remove it.
Anyone else have any comments on this?I would like you to leave it there.
As we know the r8a7790 is an R-Car Gen2 SoC. But there are other R-Car Gen2 SoCs, such as the r8a7791, they it could plausibly make use of rcar-gen2-usb-phy until the driver is updated with a usb-phy-r8a7791 entry.
Why not just "update" the driver this way now, may I ask?
WBR, Sergei
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] phy-rcar-usb-gen2: add device tree support
Quoted 16 lines · Sergei Shtylyov
Hello.
Quoted 11 lines · Simon Horman
Quoted 11 lines
[snip]
Quoted 6 lines
Review
Quoted 3 lines
(quoted diff) +3
-0+static struct of_device_id rcar_gen2_usb_phy_ofmatch[] = { + { .compatible = "renesas,usb-phy-r8a7790", }, + { .compatible = "renesas,rcar-gen2-usb-phy", },Frankly speaking, I don't understand the need for the clearly
duplicate entries.Thanks, will look into remove it.
Anyone else have any comments on this?
Quoted 7 lines
Quoted 5 lines
I would like you to leave it there.
As we know the r8a7790 is an R-Car Gen2 SoC. But there are other R-Car Gen2 SoCs, such as the r8a7791, they it could plausibly make use of rcar-gen2-usb-phy until the driver is updated with a usb-phy-r8a7791 entry.
Why not just "update" the driver this way now, may I ask?
Because I don't believe that Ben has access to r8a7791 hardware to test the change and thus it makes sense to handle it separately.
A message that is not in the archive (sent off-list or not yet received): 20140129122202.GB26253-/[email protected]
Re: [PATCH] phy-rcar-usb-gen2: add device tree support
Hello.
Quoted 14 lines · Simon Horman
Quoted 13 lines
Quoted 13 lines
Quoted 11 lines
[snip]
Quoted 6 lines
Review
Quoted 3 lines
(quoted diff) +3
-0+static struct of_device_id rcar_gen2_usb_phy_ofmatch[] = { + { .compatible = "renesas,usb-phy-r8a7790", }, + { .compatible = "renesas,rcar-gen2-usb-phy", },Frankly speaking, I don't understand the need for the clearly
duplicate entries.Thanks, will look into remove it.
Anyone else have any comments on this?I would like you to leave it there.
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
As we know the r8a7790 is an R-Car Gen2 SoC. But there are other R-Car Gen2 SoCs, such as the r8a7791, they it could plausibly make use of rcar-gen2-usb-phy until the driver is updated with a usb-phy-r8a7791 entry.
Why not just "update" the driver this way now, may I ask?
Because I don't believe that Ben has access to r8a7791 hardware to test the change and thus it makes sense to handle it separately.
I believe Valentine has already tested the driver with both SoCs.
WBR, Sergei
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 52E8F38F.9030609-M4DtvfQ/[email protected]
Re: [PATCH] phy-rcar-usb-gen2: add device tree support
Quoted 22 lines · Sergei Shtylyov
Hello.
Quoted 17 lines · Simon Horman
Quoted 17 lines
Quoted 17 lines
Quoted 11 lines
[snip]
Quoted 6 lines
Review
Quoted 3 lines
(quoted diff) +3
-0+static struct of_device_id rcar_gen2_usb_phy_ofmatch[] = { + { .compatible = "renesas,usb-phy-r8a7790", }, + { .compatible = "renesas,rcar-gen2-usb-phy", },Frankly speaking, I don't understand the need for the clearly
duplicate entries.Thanks, will look into remove it.
Anyone else have any comments on this?I would like you to leave it there.
As we know the r8a7790 is an R-Car Gen2 SoC. But there are other R-Car Gen2 SoCs, such as the r8a7791, they it could plausibly make use of rcar-gen2-usb-phy until the driver is updated with a usb-phy-r8a7791 entry.
Quoted 6 lines
Quoted 4 lines
Quoted 1 line
Why not just "update" the driver this way now, may I ask?
Because I don't believe that Ben has access to r8a7791 hardware to test the change and thus it makes sense to handle it separately.
I believe Valentine has already tested the driver with both SoCs.
Oh, great. Then I guess the compat string for r8a7791 can be added as you suggest.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 6/8 phy-rcar-usb-gen2: add device tree documentation
In reply to a message not in the archiveDocumentation for phy-rcar-usb-gen2 device tree binding.
--
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
--- .../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
Documentation/devicetree/bindings/usb/renesas,rcar-gen2-usb-phy.txt new file +16 -0
@@ -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.
Signature · 1 line
1.8.5.2
Re: [PATCH 6/8] phy-rcar-usb-gen2: add device tree documentation
Quoted 4 lines · Ben Dooks
Documentation/devicetree/bindings/usb/renesas,rcar-gen2-usb-phy.txt new file +1
-0@@ -0,0 +1,16 @@ +Renesas RCar gen2 USB PHY bindings
Documentation/devicetree/bindings/usb/renesas,rcar-gen2-usb-phy.txt line 11
Quoted 10 lines
Documentation/devicetree/bindings/usb/renesas,rcar-gen2-usb-phy.txt new file +10
-0+ +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 -- [email protected]
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
PATCH 7/8 ARM: shmobile: r8a7790.dtsi: add usbphy node
In reply to a message not in the archiveAdd 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.
---
Cc: [email protected]
Cc: Magnus Damm <[email protected]>
Cc: Simon Horman <[email protected]>
Cc: [email protected]
--- arch/arm/boot/dts/r8a7790.dtsi | 8 ++++++++ 1 file changed, 8 insertions(+)
arch/arm/boot/dts/r8a7790.dtsi +8 -0
@@ -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"; + }; };
Signature · 1 line
1.8.5.2