All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] Add USB support for Mediatek MT8189 SoC
@ 2026-12-02 12:55 Louis-Alexis Eyraud
  2026-12-02 12:55 ` [PATCH 1/3] dt-bindings: usb: mtu3: Add support for " Louis-Alexis Eyraud
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Louis-Alexis Eyraud @ 2026-12-02 12:55 UTC (permalink / raw)
  To: Chunfeng Yun, Greg Kroah-Hartman, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	AngeloGioacchino Del Regno, Mathias Nyman
  Cc: kernel, linux-usb, linux-arm-kernel, linux-mediatek, devicetree,
	linux-kernel, Louis-Alexis Eyraud, Mingjin Ge

This patch series adds the USB support for Mediatek MT8189 SoC and its
variants (MT8371 and MT8391).

The MT8189 SoC has five USB controllers, with different
capabilities:
- 0: Supports USB 3.2 Gen1 and USB 2.0 dual role capability
- 1: Supports USB 2.0 host only capability
- 2: Supports USB 2.0 host only capability
- 3: Supports USB 3.2 Gen1 host only and USB 2.0 host only capability
- 4: Supports USB 2.0 host only capability
Only the first controller (0) is behind the Mediatek USB3 DRD
Controller (MTU3).

The series is a continuation of a previous one ([1]) that was never
completed. The review [2] points several required fixes but no new
revision was sent on mailing lists. Though, the MT8189 compatible
was added later to the Mediatek xHCI bindings as a patch by
23bba7f33bb1 ("dt-bindings: usb: Support MediaTek MT8189 xhci")
but the remote wakeup support changes in the xhci-mtk driver were
not submitted.

About the differences with [1], the original patch was rebased on
current linux-next tree. Its title and description were reworded
and the SSUSB_UWK_V1_10 definition value was modified so its matches
mediatek,syscon-wakeup parameter value defined for MT8189 in the
Mediatek xHCI bindings ([3]).
Since only one controller of the five is behind MTU3 controller, 
as stated in review [2], new patches were added to add the MT8189
comptible and the remote wakeup support for MT8189 in the MTU3 bindings
and driver.

The series been tested with a kernel based on linux-next tree (tag:
next-20261201) on the Mediatek Genio 720-EVK (MT8391) and 520-EVK
(MT8371) boards.

[1]: https://lore.kernel.org/linux-mediatek/20251203013521.2038888-1-mingjin.ge@mediatek.com/
[2]: https://lore.kernel.org/linux-mediatek/a709ada6-eb68-4609-ae8c-b3bb8bcf01ae@collabora.com/
[3]: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml?h=next-20261130#n172

Signed-off-by: Louis-Alexis Eyraud <louisalexis.eyraud@collabora.com>
---
Louis-Alexis Eyraud (2):
      dt-bindings: usb: mtu3: Add support for MT8189 SoC
      usb: mtu3: add MT8189 remote wakeup support

Mingjin Ge (1):
      usb: xhci-mtk: add MT8189 remote wakeup support

 Documentation/devicetree/bindings/usb/mediatek,mtu3.yaml |  4 +++-
 drivers/usb/host/xhci-mtk.c                              | 10 ++++++++++
 drivers/usb/mtu3/mtu3_host.c                             | 10 ++++++++++
 3 files changed, 23 insertions(+), 1 deletion(-)
---
base-commit: 7de7fb8ebb0c9ebc7ad6677974d715ee630496ea
change-id: 20261130-mt8189-add-usb-support-a283a5541769

Best regards,
-- 
Louis-Alexis Eyraud <louisalexis.eyraud@collabora.com>


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/3] dt-bindings: usb: mtu3: Add support for MT8189 SoC
  2026-12-02 12:55 [PATCH 0/3] Add USB support for Mediatek MT8189 SoC Louis-Alexis Eyraud
@ 2026-12-02 12:55 ` Louis-Alexis Eyraud
  2026-12-02 13:08   ` sashiko-bot
  2026-12-02 12:55 ` [PATCH 2/3] usb: mtu3: add MT8189 remote wakeup support Louis-Alexis Eyraud
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 6+ messages in thread
From: Louis-Alexis Eyraud @ 2026-12-02 12:55 UTC (permalink / raw)
  To: Chunfeng Yun, Greg Kroah-Hartman, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	AngeloGioacchino Del Regno, Mathias Nyman
  Cc: kernel, linux-usb, linux-arm-kernel, linux-mediatek, devicetree,
	linux-kernel, Louis-Alexis Eyraud

Of the five USB controllers present on the MediaTek MT8189 SoC, only
one (0) is behind the Mediatek USB3 DRD Controller (MTU3).

Add compatible and wakeup control for it on MT8189 SoC.

Signed-off-by: Louis-Alexis Eyraud <louisalexis.eyraud@collabora.com>
---
 Documentation/devicetree/bindings/usb/mediatek,mtu3.yaml | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/usb/mediatek,mtu3.yaml b/Documentation/devicetree/bindings/usb/mediatek,mtu3.yaml
index bfcf13acede0..69c060566e7f 100644
--- a/Documentation/devicetree/bindings/usb/mediatek,mtu3.yaml
+++ b/Documentation/devicetree/bindings/usb/mediatek,mtu3.yaml
@@ -27,6 +27,7 @@ properties:
           - mediatek,mt8183-mtu3
           - mediatek,mt8186-mtu3
           - mediatek,mt8188-mtu3
+          - mediatek,mt8189-mtu3
           - mediatek,mt8192-mtu3
           - mediatek,mt8195-mtu3
           - mediatek,mt8196-mtu3
@@ -206,7 +207,8 @@ properties:
             107 - used by mt8196, IP0, specific 1.07;
             108 - used by mt8196, IP1, specific 1.08;
             109 - used by mt8196, IP2, specific 1.09;
-            enum: [1, 2, 101, 102, 103, 105, 106, 107, 108, 109]
+            110 - used by mt8189, IP4, specific 1.10;
+            enum: [1, 2, 101, 102, 103, 105, 106, 107, 108, 109, 110]
 
   mediatek,u3p-dis-msk:
     $ref: /schemas/types.yaml#/definitions/uint32

-- 
2.56.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/3] usb: mtu3: add MT8189 remote wakeup support
  2026-12-02 12:55 [PATCH 0/3] Add USB support for Mediatek MT8189 SoC Louis-Alexis Eyraud
  2026-12-02 12:55 ` [PATCH 1/3] dt-bindings: usb: mtu3: Add support for " Louis-Alexis Eyraud
@ 2026-12-02 12:55 ` Louis-Alexis Eyraud
  2026-12-02 12:55 ` [PATCH 3/3] usb: xhci-mtk: " Louis-Alexis Eyraud
  2026-12-02 13:08 ` [PATCH 0/3] Add USB support for Mediatek MT8189 SoC sashiko-bot
  3 siblings, 0 replies; 6+ messages in thread
From: Louis-Alexis Eyraud @ 2026-12-02 12:55 UTC (permalink / raw)
  To: Chunfeng Yun, Greg Kroah-Hartman, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	AngeloGioacchino Del Regno, Mathias Nyman
  Cc: kernel, linux-usb, linux-arm-kernel, linux-mediatek, devicetree,
	linux-kernel, Louis-Alexis Eyraud

Add specific register definitions and handling to support
remote wakeup for the MT8189 SoC.

Signed-off-by: Louis-Alexis Eyraud <louisalexis.eyraud@collabora.com>
---
 drivers/usb/mtu3/mtu3_host.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/usb/mtu3/mtu3_host.c b/drivers/usb/mtu3/mtu3_host.c
index 8138b3f3096a..e7ab0fe81b73 100644
--- a/drivers/usb/mtu3/mtu3_host.c
+++ b/drivers/usb/mtu3/mtu3_host.c
@@ -30,6 +30,10 @@
 #define WC0_IS_P	BIT(12)	/* polarity */
 #define WC0_IS_EN	BIT(6)
 
+/* mt8189 */
+#define PERI_WK_CTRL0_8189	0x0
+#define WC0_IS_EN_P_89		BIT(18)
+
 /* mt8192 */
 #define WC0_SSUSB0_CDEN		BIT(6)
 #define WC0_IS_SPM_EN		BIT(1)
@@ -70,6 +74,7 @@ enum ssusb_uwk_vers {
 	SSUSB_UWK_V1_7, 	/* mt8196 IP0 */
 	SSUSB_UWK_V1_8, 	/* mt8196 IP1 */
 	SSUSB_UWK_V1_9, 	/* mt8196 IP2 */
+	SSUSB_UWK_V1_10,	/* mt8189 all */
 };
 
 /*
@@ -126,6 +131,11 @@ static void ssusb_wakeup_ip_sleep_set(struct ssusb_mtk *ssusb, bool enable)
 		msk = WC1_IS_EN_P2_96;
 		val = enable ? msk : 0;
 		break;
+	case SSUSB_UWK_V1_10:
+		reg = ssusb->uwk_reg_base + PERI_WK_CTRL0_8189;
+		msk = WC0_IS_EN_P_89;
+		val = enable ? msk : 0;
+		break;
 	case SSUSB_UWK_V2:
 		reg = ssusb->uwk_reg_base + PERI_SSUSB_SPM_CTRL;
 		msk = SSC_IP_SLEEP_EN | SSC_SPM_INT_EN;

-- 
2.56.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 3/3] usb: xhci-mtk: add MT8189 remote wakeup support
  2026-12-02 12:55 [PATCH 0/3] Add USB support for Mediatek MT8189 SoC Louis-Alexis Eyraud
  2026-12-02 12:55 ` [PATCH 1/3] dt-bindings: usb: mtu3: Add support for " Louis-Alexis Eyraud
  2026-12-02 12:55 ` [PATCH 2/3] usb: mtu3: add MT8189 remote wakeup support Louis-Alexis Eyraud
@ 2026-12-02 12:55 ` Louis-Alexis Eyraud
  2026-12-02 13:08 ` [PATCH 0/3] Add USB support for Mediatek MT8189 SoC sashiko-bot
  3 siblings, 0 replies; 6+ messages in thread
From: Louis-Alexis Eyraud @ 2026-12-02 12:55 UTC (permalink / raw)
  To: Chunfeng Yun, Greg Kroah-Hartman, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	AngeloGioacchino Del Regno, Mathias Nyman
  Cc: kernel, linux-usb, linux-arm-kernel, linux-mediatek, devicetree,
	linux-kernel, Louis-Alexis Eyraud, Mingjin Ge

From: Mingjin Ge <mingjin.ge@mediatek.com>

Add specific register definitions and handling to support
remote wakeup for the MT8189 SoC.

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Signed-off-by: Mingjin Ge <mingjin.ge@mediatek.com>
[Louis-Alexis Eyraud: reworded title and description, modified
SSUSB_UWK_V1_10 value to match MT8189 mediatek,syscon-wakeup
parameter value from bindings]
Signed-off-by: Louis-Alexis Eyraud <louisalexis.eyraud@collabora.com>
---
 drivers/usb/host/xhci-mtk.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/usb/host/xhci-mtk.c b/drivers/usb/host/xhci-mtk.c
index 122104eea048..45ec1e98c287 100644
--- a/drivers/usb/host/xhci-mtk.c
+++ b/drivers/usb/host/xhci-mtk.c
@@ -96,6 +96,10 @@
 #define WC0_IS_P	BIT(12)	/* polarity */
 #define WC0_IS_EN	BIT(6)
 
+/* mt8189*/
+#define PERI_WK_CTRL0_8189	0x0
+#define WC0_IS_EN_P_89		BIT(18)
+
 /* mt8192 */
 #define WC0_SSUSB0_CDEN		BIT(6)
 #define WC0_IS_SPM_EN		BIT(1)
@@ -129,6 +133,7 @@ enum ssusb_uwk_vers {
 	SSUSB_UWK_V1_4,		/* mt8195 IP1 */
 	SSUSB_UWK_V1_5,		/* mt8195 IP2 */
 	SSUSB_UWK_V1_6,		/* mt8195 IP3 */
+	SSUSB_UWK_V1_10 = 110,	/* mt8189 IP all */
 };
 
 /*
@@ -381,6 +386,11 @@ static void usb_wakeup_ip_sleep_set(struct xhci_hcd_mtk *mtk, bool enable)
 		msk = WC0_IS_EN_P3_95 | WC0_IS_C_95(0x7) | WC0_IS_P_95;
 		val = enable ? (WC0_IS_EN_P3_95 | WC0_IS_C_95(0x1)) : 0;
 		break;
+	case SSUSB_UWK_V1_10:
+		reg = mtk->uwk_reg_base + PERI_WK_CTRL0_8189;
+		msk = WC0_IS_EN_P_89;
+		val = enable ? msk : 0;
+		break;
 	case SSUSB_UWK_V2:
 		reg = mtk->uwk_reg_base + PERI_SSUSB_SPM_CTRL;
 		msk = SSC_IP_SLEEP_EN | SSC_SPM_INT_EN;

-- 
2.56.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/3] dt-bindings: usb: mtu3: Add support for MT8189 SoC
  2026-12-02 12:55 ` [PATCH 1/3] dt-bindings: usb: mtu3: Add support for " Louis-Alexis Eyraud
@ 2026-12-02 13:08   ` sashiko-bot
  0 siblings, 0 replies; 6+ messages in thread
From: sashiko-bot @ 2026-12-02 13:08 UTC (permalink / raw)
  To: Louis-Alexis Eyraud; +Cc: linux-usb, devicetree, robh, conor+dt

Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [Low] dt-bindings: usb: mtu3: enum indented inside description block
  scalar
- [Low] dt-bindings: usb: mtu3: wakeup version 110 description refers to
  IP4 not IP0
--

commit 3a71b356bd3e7dcfca5dcbdb628d6ee96815a1c6
Author: Louis-Alexis Eyraud <louisalexis.eyraud@collabora.com>

dt-bindings: usb: mtu3: Add support for MT8189 SoC

This commit adds the MT8189 SoC compatible string and wakeup glue version
110 to the MediaTek MTU3 device tree binding.

> diff --git a/Documentation/devicetree/bindings/usb/mediatek,mtu3.yaml b/Documentation/devicetree/bindings/usb/mediatek,mtu3.yaml
> index bfcf13acede06..69c060566e7fc 100644
> --- a/Documentation/devicetree/bindings/usb/mediatek,mtu3.yaml
> +++ b/Documentation/devicetree/bindings/usb/mediatek,mtu3.yaml

[ ... ]

> @@ -206,7 +207,8 @@ properties:
>              107 - used by mt8196, IP0, specific 1.07;
>              108 - used by mt8196, IP1, specific 1.08;
>              109 - used by mt8196, IP2, specific 1.09;
> -            enum: [1, 2, 101, 102, 103, 105, 106, 107, 108, 109]
> +            110 - used by mt8189, IP4, specific 1.10;

[Severity: Low]
Should this description refer to IP0 (or all IPs) rather than IP4?  As
noted in the commit message, only controller 0 is behind MTU3 on MT8189.

> +            enum: [1, 2, 101, 102, 103, 105, 106, 107, 108, 109, 110]

[Severity: Low]
Is this enum indented two spaces too far?

At 12 spaces of indentation, YAML parses the enum line as part of the
preceding "description: |" literal block scalar rather than as a sibling
schema keyword at 10 spaces (as shifted in 0cde051e5465 ("dt-bindings:
usb: mtu3: add support mt8196")), so dtschema does not validate the third
cell of mediatek,syscon-wakeup against the allowed values.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261202-mt8189-add-usb-support-v1-0-5749ab20ec84@collabora.com?part=1

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 0/3] Add USB support for Mediatek MT8189 SoC
  2026-12-02 12:55 [PATCH 0/3] Add USB support for Mediatek MT8189 SoC Louis-Alexis Eyraud
                   ` (2 preceding siblings ...)
  2026-12-02 12:55 ` [PATCH 3/3] usb: xhci-mtk: " Louis-Alexis Eyraud
@ 2026-12-02 13:08 ` sashiko-bot
  3 siblings, 0 replies; 6+ messages in thread
From: sashiko-bot @ 2026-12-02 13:08 UTC (permalink / raw)
  To: Louis-Alexis Eyraud; +Cc: linux-usb

Sashiko has finished reviewing this 3-patch series:

- Patches 2 and 3: no issues found.
- Patch 1 ("dt-bindings: usb: mtu3: Add support for MT8189 SoC"): 2
  potential issues (2 Low)

A detailed review has been sent as a separate reply to patch 1.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261202-mt8189-add-usb-support-v1-0-5749ab20ec84@collabora.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-12-02 13:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-02 12:55 [PATCH 0/3] Add USB support for Mediatek MT8189 SoC Louis-Alexis Eyraud
2026-12-02 12:55 ` [PATCH 1/3] dt-bindings: usb: mtu3: Add support for " Louis-Alexis Eyraud
2026-12-02 13:08   ` sashiko-bot
2026-12-02 12:55 ` [PATCH 2/3] usb: mtu3: add MT8189 remote wakeup support Louis-Alexis Eyraud
2026-12-02 12:55 ` [PATCH 3/3] usb: xhci-mtk: " Louis-Alexis Eyraud
2026-12-02 13:08 ` [PATCH 0/3] Add USB support for Mediatek MT8189 SoC sashiko-bot

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.