usb: renesas_usbhs: Update usbhs pipe configuration for RZ/G2L family
authorBiju Das <biju.das.jz@bp.renesas.com>
Tue, 19 Mar 2024 10:53:54 +0000 (10:53 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 27 Mar 2024 06:57:16 +0000 (07:57 +0100)
The RZ/G2L family SoCs has 10 pipe buffers compared to 16 pipe buffers on
RZ/A2M. Update the pipe configuration for RZ/G2L family SoCs and use
family SoC specific compatible to handle this difference.

The pipe configuration of RZ/G2L is same as usbhsc_rzg2l_default_pipe[],
so select the default pipe configuration for RZ/G2L SoCs by setting
.has_new_pipe_configs to zero.

Add SoC specific compatible to OF table to avoid ABI breakage with old
DTB. To optimize memory usage the SoC specific compatible will be removed
later.

Based on the patch in BSP by Huy Nguyen <huy.nguyen.wh@renesas.com>

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20240319105356.87287-5-biju.das.jz@bp.renesas.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/renesas_usbhs/common.c
drivers/usb/renesas_usbhs/rza.h
drivers/usb/renesas_usbhs/rza2.c

index 177fa3144a476e79ddf0b19b2abd689846146abc..b436927c271170ee142888204f6ecc24e819c2e2 100644 (file)
@@ -363,7 +363,7 @@ static void usbhsc_clk_disable_unprepare(struct usbhs_priv *priv)
  *             platform default param
  */
 
-/* commonly used on old SH-Mobile SoCs */
+/* commonly used on old SH-Mobile and RZ/G2L family SoCs */
 static struct renesas_usbhs_driver_pipe_config usbhsc_default_pipe[] = {
        RENESAS_USBHS_PIPE(USB_ENDPOINT_XFER_CONTROL, 64, 0x00, false),
        RENESAS_USBHS_PIPE(USB_ENDPOINT_XFER_ISOC, 1024, 0x08, true),
@@ -565,6 +565,18 @@ static const struct of_device_id usbhs_of_match[] = {
                .compatible = "renesas,usbhs-r8a77995",
                .data = &usbhs_rcar_gen3_with_pll_plat_info,
        },
+       {
+               .compatible = "renesas,usbhs-r9a07g043",
+               .data = &usbhs_rzg2l_plat_info,
+       },
+       {
+               .compatible = "renesas,usbhs-r9a07g044",
+               .data = &usbhs_rzg2l_plat_info,
+       },
+       {
+               .compatible = "renesas,usbhs-r9a07g054",
+               .data = &usbhs_rzg2l_plat_info,
+       },
        {
                .compatible = "renesas,rcar-gen2-usbhs",
                .data = &usbhs_rcar_gen2_plat_info,
@@ -581,6 +593,10 @@ static const struct of_device_id usbhs_of_match[] = {
                .compatible = "renesas,rza2-usbhs",
                .data = &usbhs_rza2_plat_info,
        },
+       {
+               .compatible = "renesas,rzg2l-usbhs",
+               .data = &usbhs_rzg2l_plat_info,
+       },
        { },
 };
 MODULE_DEVICE_TABLE(of, usbhs_of_match);
index a29b75fef057c01c3df99c19b1a8941ab01280f8..8b879aa34a203fa0a34c8342ce7aa39b16672e5b 100644 (file)
@@ -3,3 +3,4 @@
 
 extern const struct renesas_usbhs_platform_info usbhs_rza1_plat_info;
 extern const struct renesas_usbhs_platform_info usbhs_rza2_plat_info;
+extern const struct renesas_usbhs_platform_info usbhs_rzg2l_plat_info;
index f079817250bbfaf7470fff9ebe8dad281bfd0ab3..b83699eab37388dcf8e4b0295f878e84c1a87a8f 100644 (file)
@@ -71,3 +71,16 @@ const struct renesas_usbhs_platform_info usbhs_rza2_plat_info = {
                .has_new_pipe_configs = 1,
        },
 };
+
+const struct renesas_usbhs_platform_info usbhs_rzg2l_plat_info = {
+       .platform_callback = {
+               .hardware_init = usbhs_rza2_hardware_init,
+               .hardware_exit = usbhs_rza2_hardware_exit,
+               .power_ctrl = usbhs_rza2_power_ctrl,
+               .get_id = usbhs_get_id_as_gadget,
+       },
+       .driver_param = {
+               .has_cnen = 1,
+               .cfifo_byte_addr = 1,
+       },
+};