mbox series

[v2,0/3] usb: renesas_usbhs: Add RZ/A1 support

Message ID 20180105184609.24106-1-chris.brandt@renesas.com
Headers show
Series usb: renesas_usbhs: Add RZ/A1 support | expand

Message

Chris Brandt Jan. 5, 2018, 6:46 p.m. UTC
This series adds RZ/A1 gadget support to the renesas_usbhs driver.
Basically, it's almost the same HW as the R-Car (and SH) parts.
The only real difference is the some extra registers for the PHY.

This was tested on an RSK board by connecting to a PC as an
Ethernet CDC gadget.

v2:
 * Node name is now generic 'usb@'
 * GIC_SPI (73-32) is now just GIC_SPI 41
 * All hex number are lower case
 * Added Reviewed-by

Chris Brandt (3):
  usb: renesas_usbhs: Add support for RZ/A1
  dt-bindings: usb: renesas_usbhs: Add support for RZ/A1
  ARM: dts: r7s72100: add USB device to device tree

 .../devicetree/bindings/usb/renesas_usbhs.txt      |  2 +
 arch/arm/boot/dts/r7s72100.dtsi                    | 20 +++++++++
 drivers/usb/renesas_usbhs/Makefile                 |  2 +-
 drivers/usb/renesas_usbhs/common.c                 | 17 +++++++
 drivers/usb/renesas_usbhs/common.h                 |  6 +++
 drivers/usb/renesas_usbhs/rza.c                    | 52 ++++++++++++++++++++++
 drivers/usb/renesas_usbhs/rza.h                    |  4 ++
 include/linux/usb/renesas_usbhs.h                  |  1 +
 8 files changed, 103 insertions(+), 1 deletion(-)
 create mode 100644 drivers/usb/renesas_usbhs/rza.c
 create mode 100644 drivers/usb/renesas_usbhs/rza.h

Comments

Geert Uytterhoeven Jan. 5, 2018, 8:17 p.m. UTC | #1
On Fri, Jan 5, 2018 at 7:46 PM, Chris Brandt <chris.brandt@renesas.com> wrote:
> Add USB device support.
>
> Signed-off-by: Chris Brandt <chris.brandt@renesas.com>
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

> --- a/arch/arm/boot/dts/r7s72100.dtsi
> +++ b/arch/arm/boot/dts/r7s72100.dtsi
> @@ -667,4 +667,24 @@
>                 power-domains = <&cpg_clocks>;
>                 status = "disabled";
>         };
> +
> +       usbhs0: usb@e8010000 {
> +               compatible = "renesas,usbhs-r7s72100";

+ "renesas,rza1-usbhs"

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
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Geert Uytterhoeven Jan. 5, 2018, 8:18 p.m. UTC | #2
Hi Chris,

On Fri, Jan 5, 2018 at 7:46 PM, Chris Brandt <chris.brandt@renesas.com> wrote:
> This patch adds the capability to support RZ/A1 SoCs.
>
> Signed-off-by: Chris Brandt <chris.brandt@renesas.com>

Thanks for your patch!

> index c5289b3ecf8d..2abefd3d6050 100644
> --- a/drivers/usb/renesas_usbhs/common.c
> +++ b/drivers/usb/renesas_usbhs/common.c

> @@ -480,6 +481,10 @@ static const struct of_device_id usbhs_of_match[] = {
>                 .compatible = "renesas,usbhs-r8a77995",
>                 .data = (void *)USBHS_TYPE_RCAR_GEN3_WITH_PLL,
>         },
> +       {
> +               .compatible = "renesas,usbhs-r7s72100",
> +               .data = (void *)USBHS_TYPE_RZA1,
> +       },

I think it suffices to drop the part above...

>         {
>                 .compatible = "renesas,rcar-gen2-usbhs",
>                 .data = (void *)USBHS_TYPE_RCAR_GEN2,
> @@ -488,6 +493,10 @@ static const struct of_device_id usbhs_of_match[] = {
>                 .compatible = "renesas,rcar-gen3-usbhs",
>                 .data = (void *)USBHS_TYPE_RCAR_GEN3,
>         },
> +       {
> +               .compatible = "renesas,rza1-usbhs",
> +               .data = (void *)USBHS_TYPE_RZA1,
> +       },

... and just let the driver match against the generic compatible value.
But then you have to add "renesas,rza1-usbhs" to the DTS, too.

> --- /dev/null
> +++ b/drivers/usb/renesas_usbhs/rza.c
> @@ -0,0 +1,52 @@
> +// SPDX-License-Identifier: GPL-1.0+

Not GPL-2.0?

> +++ b/drivers/usb/renesas_usbhs/rza.h
> @@ -0,0 +1,4 @@
> +// SPDX-License-Identifier: GPL-2.0

like here?

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
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Chris Brandt Jan. 5, 2018, 8:26 p.m. UTC | #3
Hi Geert,

On Friday, January 05, 2018, Geert Uytterhoeven wrote:
> > +       {

> > +               .compatible = "renesas,usbhs-r7s72100",

> > +               .data = (void *)USBHS_TYPE_RZA1,

> > +       },

> 

> I think it suffices to drop the part above...

> 

> >         {

> >                 .compatible = "renesas,rcar-gen2-usbhs",

> >                 .data = (void *)USBHS_TYPE_RCAR_GEN2,

> > @@ -488,6 +493,10 @@ static const struct of_device_id usbhs_of_match[] =

> {

> >                 .compatible = "renesas,rcar-gen3-usbhs",

> >                 .data = (void *)USBHS_TYPE_RCAR_GEN3,

> >         },

> > +       {

> > +               .compatible = "renesas,rza1-usbhs",

> > +               .data = (void *)USBHS_TYPE_RZA1,

> > +       },

> 

> ... and just let the driver match against the generic compatible value.

> But then you have to add "renesas,rza1-usbhs" to the DTS, too.


OK. I can do that.

I keep forgetting all the new/old DT rules.
I thought there was something about you always need a generic name and
also a device specific name.

I'm happy with just "renesas,rza1-usbhs".


> > --- /dev/null

> > +++ b/drivers/usb/renesas_usbhs/rza.c

> > @@ -0,0 +1,52 @@

> > +// SPDX-License-Identifier: GPL-1.0+

> 

> Not GPL-2.0?


Oops. Copy/paste error.


I'll submit a V3 of the series.


Thanks!

Chris