All of lore.kernel.org
 help / color / mirror / Atom feed
From: Biju Das <biju.das.jz@bp.renesas.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: "Huy Nguyen" <huy.nguyen.wh@renesas.com>,
	"Geert Uytterhoeven" <geert+renesas@glider.be>,
	"Magnus Damm" <magnus.damm@gmail.com>,
	"Biju Das" <biju.das.jz@bp.renesas.com>,
	"Rob Herring" <robh@kernel.org>,
	"Yoshihiro Shimoda" <yoshihiro.shimoda.uh@renesas.com>,
	"Krzysztof Kozlowski" <krzysztof.kozlowski@linaro.org>,
	"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	linux-usb@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
	"Prabhakar Mahadev Lad" <prabhakar.mahadev-lad.rj@bp.renesas.com>,
	"Biju Das" <biju.das.au@gmail.com>
Subject: [PATCH 2/4] usb: renesas_usbhs: Update usbhs pipe configuration for RZ/G2L family
Date: Fri,  8 Mar 2024 18:09:17 +0000	[thread overview]
Message-ID: <20240308180919.6603-3-biju.das.jz@bp.renesas.com> (raw)
In-Reply-To: <20240308180919.6603-1-biju.das.jz@bp.renesas.com>

From: Huy Nguyen <huy.nguyen.wh@renesas.com>

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. For the backward compatibility SoC specific compatible is used
and will remove the same after few kernel releases.

Signed-off-by: Huy Nguyen <huy.nguyen.wh@renesas.com>
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
 drivers/usb/renesas_usbhs/common.c | 31 ++++++++++++++++++++++++++++--
 1 file changed, 29 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/renesas_usbhs/common.c b/drivers/usb/renesas_usbhs/common.c
index dd1c17542439..030ec36deb64 100644
--- a/drivers/usb/renesas_usbhs/common.c
+++ b/drivers/usb/renesas_usbhs/common.c
@@ -397,6 +397,20 @@ static struct renesas_usbhs_driver_pipe_config usbhsc_new_pipe[] = {
 	RENESAS_USBHS_PIPE(USB_ENDPOINT_XFER_BULK, 512, 0xd8, true),
 };
 
+/* commonly used on RZ/G2L family */
+static struct renesas_usbhs_driver_pipe_config usbhsc_rzg2l_pipe[] = {
+	RENESAS_USBHS_PIPE(USB_ENDPOINT_XFER_CONTROL, 64, 0x00, false),
+	RENESAS_USBHS_PIPE(USB_ENDPOINT_XFER_ISOC, 1024, 0x08, true),
+	RENESAS_USBHS_PIPE(USB_ENDPOINT_XFER_ISOC, 1024, 0x28, true),
+	RENESAS_USBHS_PIPE(USB_ENDPOINT_XFER_BULK, 512, 0x48, true),
+	RENESAS_USBHS_PIPE(USB_ENDPOINT_XFER_BULK, 512, 0x58, true),
+	RENESAS_USBHS_PIPE(USB_ENDPOINT_XFER_BULK, 512, 0x68, true),
+	RENESAS_USBHS_PIPE(USB_ENDPOINT_XFER_INT, 64, 0x04, false),
+	RENESAS_USBHS_PIPE(USB_ENDPOINT_XFER_INT, 64, 0x05, false),
+	RENESAS_USBHS_PIPE(USB_ENDPOINT_XFER_INT, 64, 0x06, false),
+	RENESAS_USBHS_PIPE(USB_ENDPOINT_XFER_INT, 64, 0x07, false),
+};
+
 /*
  *		power control
  */
@@ -581,6 +595,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_rza2_plat_info,
+	},
 	{ },
 };
 MODULE_DEVICE_TABLE(of, usbhs_of_match);
@@ -645,8 +663,17 @@ static int usbhs_probe(struct platform_device *pdev)
 
 	/* set default param if platform doesn't have */
 	if (usbhs_get_dparam(priv, has_new_pipe_configs)) {
-		priv->dparam.pipe_configs = usbhsc_new_pipe;
-		priv->dparam.pipe_size = ARRAY_SIZE(usbhsc_new_pipe);
+		/* for backward compatibility check soc specific compatible */
+		if (of_device_is_compatible(pdev->dev.of_node, "renesas,usbhs-r9a07g043") ||
+		    of_device_is_compatible(pdev->dev.of_node, "renesas,usbhs-r9a07g044") ||
+		    of_device_is_compatible(pdev->dev.of_node, "renesas,usbhs-r9a07g054") ||
+		    of_device_is_compatible(pdev->dev.of_node, "renesas,rzg2l-usbhs")) {
+			priv->dparam.pipe_configs = usbhsc_rzg2l_pipe;
+			priv->dparam.pipe_size = ARRAY_SIZE(usbhsc_rzg2l_pipe);
+		} else {
+			priv->dparam.pipe_configs = usbhsc_new_pipe;
+			priv->dparam.pipe_size = ARRAY_SIZE(usbhsc_new_pipe);
+		}
 	} else if (!priv->dparam.pipe_configs) {
 		priv->dparam.pipe_configs = usbhsc_default_pipe;
 		priv->dparam.pipe_size = ARRAY_SIZE(usbhsc_default_pipe);
-- 
2.25.1


  parent reply	other threads:[~2024-03-08 18:09 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-08 18:09 [PATCH 0/4] Fix USB pipe configuration for RZ/G2L Biju Das
2024-03-08 18:09 ` [PATCH 1/4] dt-bindings: usb: renesas,usbhs: Document RZ/G2L family compatible Biju Das
2024-03-09 12:07   ` Krzysztof Kozlowski
2024-03-08 18:09 ` Biju Das [this message]
2024-03-08 19:39   ` [PATCH 2/4] usb: renesas_usbhs: Update usbhs pipe configuration for RZ/G2L family Geert Uytterhoeven
2024-03-09 10:20     ` Biju Das
2024-03-08 18:09 ` [PATCH 3/4] usb: renesas_usbhs: Remove trailing comma in the terminator entry for OF table Biju Das
2024-03-08 19:40   ` Geert Uytterhoeven
2024-03-08 18:09 ` [PATCH 4/4] arm64: dts: renesas: r9a07g0{43,44,54}: Update usbhs family compatible Biju Das
2024-03-09 12:08   ` Krzysztof Kozlowski
2024-03-09 12:14     ` Biju Das
2024-03-09 12:25       ` Krzysztof Kozlowski
2024-03-09 12:32         ` Biju Das
2024-03-09 13:30           ` Krzysztof Kozlowski
2024-03-09 15:43             ` Biju Das
2024-03-09 15:53               ` Biju Das
2024-03-10  7:57                 ` Biju Das
2024-03-10  8:06                   ` Krzysztof Kozlowski
2024-03-10  8:16                     ` Biju Das
2024-03-10  8:39                       ` Krzysztof Kozlowski
2024-03-10  9:59                         ` Biju Das
2024-03-10  8:03               ` Krzysztof Kozlowski
2024-03-11  9:03             ` Geert Uytterhoeven
2024-03-12 10:58               ` Krzysztof Kozlowski
2024-03-12 18:13                 ` Biju Das

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240308180919.6603-3-biju.das.jz@bp.renesas.com \
    --to=biju.das.jz@bp.renesas.com \
    --cc=biju.das.au@gmail.com \
    --cc=geert+renesas@glider.be \
    --cc=gregkh@linuxfoundation.org \
    --cc=huy.nguyen.wh@renesas.com \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=magnus.damm@gmail.com \
    --cc=prabhakar.mahadev-lad.rj@bp.renesas.com \
    --cc=robh@kernel.org \
    --cc=u.kleine-koenig@pengutronix.de \
    --cc=yoshihiro.shimoda.uh@renesas.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.