Re: [PATCH 2/2] usb: gadget: udc: renesas_usb3: Add support for RZ/V2M

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Phil,

On Mon, Jul 18, 2022 at 3:45 PM Phil Edworthy <phil.edworthy@xxxxxxxxxxx> wrote:
> RZ/V2M (r9a09g011) has a few differences:
>  - The USB3_DRD_CON register has moved, its called USB_PERI_DRD_CON in
>    the RZ/V2M hardware manual.
>    It has additional bits for host and peripheral reset that need to
>    cleared to use usb host and peripheral respectively.
>  - The USB3_OTG_STA, USB3_OTG_INT_STA and USB3_OTG_INT_ENA registers
>    have been moved and renamed to USB_PERI_DRD_STA, USB_PERI_DRD_INT_STA
>    and USB_PERI_DRD_INT_E.
>  - The IDMON bit used in the above regs for role detection have moved
>    from bit 4 to bit 0.
>  - RZ/V2M has an separate interrupt for DRD, i.e. for changes to IDMON.
>  - There are reset lines for DRD and USBP
>  - There is another clock, managed by runtime PM.
>
> Signed-off-by: Phil Edworthy <phil.edworthy@xxxxxxxxxxx>
> Reviewed-by: Biju Das <biju.das.jz@xxxxxxxxxxxxxx>

Thanks for your patch!

> --- a/drivers/usb/gadget/udc/renesas_usb3.c
> +++ b/drivers/usb/gadget/udc/renesas_usb3.c

> @@ -363,6 +368,7 @@ struct renesas_usb3 {
>         bool forced_b_device;
>         bool start_to_connect;
>         bool role_sw_by_connector;
> +       bool r9a09g011;

Any better name for this feature flag?

>  };

> @@ -2707,6 +2733,12 @@ static const struct renesas_usb3_priv renesas_usb3_priv_r8a77990 = {
>         .workaround_for_vbus = true,
>  };
>
> +static const struct renesas_usb3_priv renesas_usb3_priv_r9a09g011 = {

renesas_usb3_priv_rzv2m?

> +       .ramsize_per_ramif = SZ_32K,
> +       .num_ramif = 1,
> +       .ramsize_per_pipe = SZ_4K,
> +};
> +
>  static const struct of_device_id usb3_of_match[] = {
>         {
>                 .compatible = "renesas,r8a774c0-usb3-peri",
> @@ -2717,6 +2749,9 @@ static const struct of_device_id usb3_of_match[] = {
>         }, {
>                 .compatible = "renesas,r8a77990-usb3-peri",
>                 .data = &renesas_usb3_priv_r8a77990,
> +       }, {
> +               .compatible = "renesas,r9a09g011-usb3-peri",

As the bindings include a family-specific compatible value, you should
use that ("renesas,rzv2m-usb3-peri") here.

> +               .data = &renesas_usb3_priv_r9a09g011,
>         }, {
>                 .compatible = "renesas,rcar-gen3-usb3-peri",
>                 .data = &renesas_usb3_priv_gen3,

> @@ -2758,13 +2793,22 @@ static int renesas_usb3_probe(struct platform_device *pdev)
>         else
>                 priv = of_device_get_match_data(&pdev->dev);
>
> +       usb3 = devm_kzalloc(&pdev->dev, sizeof(*usb3), GFP_KERNEL);
> +       if (!usb3)
> +               return -ENOMEM;
> +
> +       if (priv == &renesas_usb3_priv_r9a09g011)

Please store the feature flag in renesas_usb3_priv instead of doing an
explicit comparison.

> +               usb3->r9a09g011 = true;
> +

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

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



[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux