From patchwork Fri Mar 8 18:09:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Biju Das X-Patchwork-Id: 779388 Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3AD8536D; Fri, 8 Mar 2024 18:09:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.160.252.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709921380; cv=none; b=kHTOSSY1SjWFBwhjtydTIJYJKrmR5rqo1Yy5fIitZxJb3J8fsFwbL4xHlBQ4oPSFeRVQFwcv+YyRYtV7bzFJq4f4UmsxISfvG3XwE4qRmG4VJBx3GEpfjyqak2X6ohWroO01XqTPD262XCBNlXyN8Ido/Rhbts47WnPtk41FPX0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709921380; c=relaxed/simple; bh=RBKBxT5+2zN+i54r6L8tnxdS3A0R/Ql/8jk1yCWNgDQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ZlAmw+Yrj98u2c0dLxAWtnowUgqjMqkdn3P4TKEgbhx0jcvKmKLYxoAcaQdXLfLLCHwvzZH74xDDAm3ofYuNJ9RkP3eDh/6VG0es6/jvRU/1N8AE3jGSIHv68nkkZ4IEKRkwv6sYxKZlTpTjvet2e7Nmr8LBT6AMz/jv6709EVs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=bp.renesas.com; spf=pass smtp.mailfrom=bp.renesas.com; arc=none smtp.client-ip=210.160.252.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=bp.renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bp.renesas.com X-IronPort-AV: E=Sophos;i="6.07,110,1708354800"; d="scan'208";a="200889926" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie6.idc.renesas.com with ESMTP; 09 Mar 2024 03:09:30 +0900 Received: from localhost.localdomain (unknown [10.226.92.24]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 2B23B40158E6; Sat, 9 Mar 2024 03:09:26 +0900 (JST) From: Biju Das To: Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Biju Das , Greg Kroah-Hartman , Geert Uytterhoeven , Magnus Damm , Yoshihiro Shimoda , linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Prabhakar Mahadev Lad , Biju Das Subject: [PATCH 1/4] dt-bindings: usb: renesas,usbhs: Document RZ/G2L family compatible Date: Fri, 8 Mar 2024 18:09:16 +0000 Message-Id: <20240308180919.6603-2-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240308180919.6603-1-biju.das.jz@bp.renesas.com> References: <20240308180919.6603-1-biju.das.jz@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The USBHS IP found on RZ/G2L SoCs only has 10 pipe buffers compared to 16 pipe buffers on RZ/A2M. Document renesas,rzg2l-usbhs family compatible to handle this difference for RZ/G2L family SoCs. Signed-off-by: Biju Das --- Documentation/devicetree/bindings/usb/renesas,usbhs.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/usb/renesas,usbhs.yaml b/Documentation/devicetree/bindings/usb/renesas,usbhs.yaml index 40ada78f2328..c63db3ebd07b 100644 --- a/Documentation/devicetree/bindings/usb/renesas,usbhs.yaml +++ b/Documentation/devicetree/bindings/usb/renesas,usbhs.yaml @@ -19,10 +19,14 @@ properties: - items: - enum: - renesas,usbhs-r7s9210 # RZ/A2 + - const: renesas,rza2-usbhs + + - items: + - enum: - renesas,usbhs-r9a07g043 # RZ/G2UL and RZ/Five - renesas,usbhs-r9a07g044 # RZ/G2{L,LC} - renesas,usbhs-r9a07g054 # RZ/V2L - - const: renesas,rza2-usbhs + - const: renesas,rzg2l-usbhs - items: - enum: From patchwork Fri Mar 8 18:09:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Biju Das X-Patchwork-Id: 779387 Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1B0AA56478; Fri, 8 Mar 2024 18:09:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.160.252.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709921383; cv=none; b=vBYA8Z+O92+R5Ru2c2pFxCYD0uYjxYHEVb2TeWZ59rYTMiC0HHseIn/A1AHmUM9wrSFbx7Q3jM4i/aPv0PiW1JL3GTpgnggjd5zmlFwdfLedNTMQ29i6VgHrUlbM7SI9OIgeDHnsV/jqD3F2dMUzjZ4ZE3XKBGhaGSjjbkw1sis= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709921383; c=relaxed/simple; bh=n9EB9OEUJhcepHPTJ6GNjobg2zfPZjJCry1HFFr1mtA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=XEm3MkD8RiHLGrXRyIYG+7YKVt+ETOWEh1kmx3KdICtiFngoUtJMMjoj7QaHIpkRrIPutML471y9zq2xpul18Gy7nW1mQNPDLm0+9B4L2i++HUupuyH6fWRPlOHse2LyOE6+zt2GbfH8XEe2NSlh8UnPmpL0OBl1GUmxx23BBCo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=bp.renesas.com; spf=pass smtp.mailfrom=bp.renesas.com; arc=none smtp.client-ip=210.160.252.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=bp.renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bp.renesas.com X-IronPort-AV: E=Sophos;i="6.07,110,1708354800"; d="scan'208";a="200889932" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie6.idc.renesas.com with ESMTP; 09 Mar 2024 03:09:35 +0900 Received: from localhost.localdomain (unknown [10.226.92.24]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 70CB940158E6; Sat, 9 Mar 2024 03:09:31 +0900 (JST) From: Biju Das To: Greg Kroah-Hartman Cc: Huy Nguyen , Geert Uytterhoeven , Magnus Damm , Biju Das , Rob Herring , Yoshihiro Shimoda , Krzysztof Kozlowski , =?utf-8?q?Uwe_Kleine-?= =?utf-8?q?K=C3=B6nig?= , linux-usb@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Prabhakar Mahadev Lad , Biju Das Subject: [PATCH 2/4] usb: renesas_usbhs: Update usbhs pipe configuration for RZ/G2L family Date: Fri, 8 Mar 2024 18:09:17 +0000 Message-Id: <20240308180919.6603-3-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240308180919.6603-1-biju.das.jz@bp.renesas.com> References: <20240308180919.6603-1-biju.das.jz@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Huy Nguyen 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 Signed-off-by: Biju Das --- 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); From patchwork Fri Mar 8 18:09:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Biju Das X-Patchwork-Id: 779136 Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0E40950251; Fri, 8 Mar 2024 18:09:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.160.252.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709921382; cv=none; b=e+FgUijRNCtm8mb7ZP3U3xccGjl5kZawlPi8vApANsHdXBNuZ5+e09sWwaJmWELGQNRDUmBYvIGo5R/kVwQG4Wy15GDNxht763qf1oC6Q4vY1RGzO4MVjvI9/G2UVz0C3EqXQ9DBsj9vFYZYNeGNdpE4TnBN/Mr0ez4DiURzjB4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709921382; c=relaxed/simple; bh=Zr6zzX8zyrUcnqW0M6au7J1N1WCZ1A1Gz3sOHWw9etY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=s/hzZzDz1plcoGxj6gXPzPoHQXS8cQH8hQcAbNhKgoWHCC4XQk0eXbGYx/ppDySJsM71itWmnPDMSmWc8QH7Gz5LemFAC4yw23HtorXsPhaj8jf+8Q2i9k954+BOFrn/rDqALHlwVFlwSTDskiz4iFkuDTCsQF1DeNCIA9OJ4dQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=bp.renesas.com; spf=pass smtp.mailfrom=bp.renesas.com; arc=none smtp.client-ip=210.160.252.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=bp.renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bp.renesas.com X-IronPort-AV: E=Sophos;i="6.07,110,1708354800"; d="scan'208";a="196951386" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie5.idc.renesas.com with ESMTP; 09 Mar 2024 03:09:39 +0900 Received: from localhost.localdomain (unknown [10.226.92.24]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id D84E940158E6; Sat, 9 Mar 2024 03:09:35 +0900 (JST) From: Biju Das To: Greg Kroah-Hartman Cc: Biju Das , Geert Uytterhoeven , Magnus Damm , Huy Nguyen , Rob Herring , Yoshihiro Shimoda , Krzysztof Kozlowski , =?utf-8?q?Uwe_Kleine-?= =?utf-8?q?K=C3=B6nig?= , linux-usb@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Prabhakar Mahadev Lad , Biju Das Subject: [PATCH 3/4] usb: renesas_usbhs: Remove trailing comma in the terminator entry for OF table Date: Fri, 8 Mar 2024 18:09:18 +0000 Message-Id: <20240308180919.6603-4-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240308180919.6603-1-biju.das.jz@bp.renesas.com> References: <20240308180919.6603-1-biju.das.jz@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Remove the trailing comma in the terminator entry for the OF table making code robust against (theoretical) misrebases or other similar things where the new entry goes _after_ the termination without the compiler noticing. Signed-off-by: Biju Das Reviewed-by: Geert Uytterhoeven --- drivers/usb/renesas_usbhs/common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/renesas_usbhs/common.c b/drivers/usb/renesas_usbhs/common.c index 030ec36deb64..7f8fc86fc687 100644 --- a/drivers/usb/renesas_usbhs/common.c +++ b/drivers/usb/renesas_usbhs/common.c @@ -599,7 +599,7 @@ static const struct of_device_id usbhs_of_match[] = { .compatible = "renesas,rzg2l-usbhs", .data = &usbhs_rza2_plat_info, }, - { }, + { } }; MODULE_DEVICE_TABLE(of, usbhs_of_match);