public inbox for linux-usb@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 1/4] dt-bindings: usb: mtk-xhci: add support mt8196
@ 2025-02-15 10:06 Chunfeng Yun
  2025-02-15 10:06 ` [PATCH v3 2/4] dt-bindings: usb: mtu3: " Chunfeng Yun
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Chunfeng Yun @ 2025-02-15 10:06 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rob Herring, AngeloGioacchino Del Regno
  Cc: Chunfeng Yun, Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	Mathias Nyman, linux-usb, linux-arm-kernel, linux-mediatek,
	devicetree, linux-kernel, Conor Dooley

There are three USB controllers on mt8196, each controller's wakeup
control is different, add some specific versions for them, and add
a new compatilbe for mt8196.

Acked-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
---
v3: add acked by Conor
v2: no changes
---
 .../devicetree/bindings/usb/mediatek,mtk-xhci.yaml          | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml b/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml
index ef3143f4b794..cacb3d3dc4ac 100644
--- a/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml
+++ b/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml
@@ -36,6 +36,7 @@ properties:
           - mediatek,mt8188-xhci
           - mediatek,mt8192-xhci
           - mediatek,mt8195-xhci
+          - mediatek,mt8196-xhci
           - mediatek,mt8365-xhci
       - const: mediatek,mtk-xhci
 
@@ -164,7 +165,10 @@ properties:
             104 - used by mt8195, IP1, specific 1.04;
             105 - used by mt8195, IP2, specific 1.05;
             106 - used by mt8195, IP3, specific 1.06;
-          enum: [1, 2, 101, 102, 103, 104, 105, 106]
+            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, 104, 105, 106, 107, 108, 109]
 
   mediatek,u3p-dis-msk:
     $ref: /schemas/types.yaml#/definitions/uint32
-- 
2.46.0


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

* [PATCH v3 2/4] dt-bindings: usb: mtu3: add support mt8196
  2025-02-15 10:06 [PATCH v3 1/4] dt-bindings: usb: mtk-xhci: add support mt8196 Chunfeng Yun
@ 2025-02-15 10:06 ` Chunfeng Yun
  2025-02-18  8:57   ` AngeloGioacchino Del Regno
  2025-02-15 10:06 ` [PATCH v3 3/4] usb: mtk-xhci: add support remote wakeup of mt8196 Chunfeng Yun
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 11+ messages in thread
From: Chunfeng Yun @ 2025-02-15 10:06 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rob Herring, AngeloGioacchino Del Regno
  Cc: Chunfeng Yun, Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	Mathias Nyman, linux-usb, linux-arm-kernel, linux-mediatek,
	devicetree, linux-kernel, Conor Dooley

There are three USB controllers on mt8196, each controller's wakeup
control is different, add some specific versions for them, and add
compatilbe for mt8196.

Acked-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
---
v3: add the ommitted third dual-role controller
    add acked by Conor
v2: new patch for dual-role controllers
---
 Documentation/devicetree/bindings/usb/mediatek,mtu3.yaml | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/usb/mediatek,mtu3.yaml b/Documentation/devicetree/bindings/usb/mediatek,mtu3.yaml
index d4e187c78a0b..aa411568704b 100644
--- a/Documentation/devicetree/bindings/usb/mediatek,mtu3.yaml
+++ b/Documentation/devicetree/bindings/usb/mediatek,mtu3.yaml
@@ -28,6 +28,7 @@ properties:
           - mediatek,mt8188-mtu3
           - mediatek,mt8192-mtu3
           - mediatek,mt8195-mtu3
+          - mediatek,mt8196-mtu3
           - mediatek,mt8365-mtu3
       - const: mediatek,mtu3
 
@@ -188,7 +189,10 @@ properties:
             103 - used by mt8195, IP0, specific 1.03;
             105 - used by mt8195, IP2, specific 1.05;
             106 - used by mt8195, IP3, specific 1.06;
-          enum: [1, 2, 101, 102, 103, 105, 106]
+            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]
 
   mediatek,u3p-dis-msk:
     $ref: /schemas/types.yaml#/definitions/uint32
-- 
2.46.0


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

* [PATCH v3 3/4] usb: mtk-xhci: add support remote wakeup of mt8196
  2025-02-15 10:06 [PATCH v3 1/4] dt-bindings: usb: mtk-xhci: add support mt8196 Chunfeng Yun
  2025-02-15 10:06 ` [PATCH v3 2/4] dt-bindings: usb: mtu3: " Chunfeng Yun
@ 2025-02-15 10:06 ` Chunfeng Yun
  2025-02-18  8:57   ` AngeloGioacchino Del Regno
  2025-02-15 10:06 ` [PATCH v3 4/4] usb: mtu3: " Chunfeng Yun
  2025-02-18  8:57 ` [PATCH v3 1/4] dt-bindings: usb: mtk-xhci: add support mt8196 AngeloGioacchino Del Regno
  3 siblings, 1 reply; 11+ messages in thread
From: Chunfeng Yun @ 2025-02-15 10:06 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rob Herring, AngeloGioacchino Del Regno
  Cc: Chunfeng Yun, Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	Mathias Nyman, linux-usb, linux-arm-kernel, linux-mediatek,
	devicetree, linux-kernel

There are three USB controllers on mt8196, each controller's wakeup
control is different, add some specific versions for them.

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
---
v3: no changes
v2: modify marcos name
---
 drivers/usb/host/xhci-mtk.c | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/drivers/usb/host/xhci-mtk.c b/drivers/usb/host/xhci-mtk.c
index 904831344440..3f8e37b25322 100644
--- a/drivers/usb/host/xhci-mtk.c
+++ b/drivers/usb/host/xhci-mtk.c
@@ -113,6 +113,14 @@
 #define WC1_IS_P_95		BIT(12)
 #define WC1_IS_EN_P0_95		BIT(6)
 
+/* mt8196 */
+#define PERI_WK_CTRL0_8196	0x08
+#define WC0_IS_EN_P0_96		BIT(0)
+#define WC0_IS_EN_P1_96		BIT(7)
+
+#define PERI_WK_CTRL1_8196	0x10
+#define WC1_IS_EN_P2_96		BIT(0)
+
 /* mt2712 etc */
 #define PERI_SSUSB_SPM_CTRL	0x0
 #define SSC_IP_SLEEP_EN	BIT(4)
@@ -129,6 +137,9 @@ 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_7,		/* mt8196 IP0 */
+	SSUSB_UWK_V1_8,		/* mt8196 IP1 */
+	SSUSB_UWK_V1_9,		/* mt8196 IP2 */
 };
 
 /*
@@ -381,6 +392,21 @@ 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_7:
+		reg = mtk->uwk_reg_base + PERI_WK_CTRL0_8196;
+		msk = WC0_IS_EN_P0_96;
+		val = enable ? msk : 0;
+		break;
+	case SSUSB_UWK_V1_8:
+		reg = mtk->uwk_reg_base + PERI_WK_CTRL0_8196;
+		msk = WC0_IS_EN_P1_96;
+		val = enable ? msk : 0;
+		break;
+	case SSUSB_UWK_V1_9:
+		reg = mtk->uwk_reg_base + PERI_WK_CTRL1_8196;
+		msk = WC1_IS_EN_P2_96;
+		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.46.0


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

* [PATCH v3 4/4] usb: mtu3: add support remote wakeup of mt8196
  2025-02-15 10:06 [PATCH v3 1/4] dt-bindings: usb: mtk-xhci: add support mt8196 Chunfeng Yun
  2025-02-15 10:06 ` [PATCH v3 2/4] dt-bindings: usb: mtu3: " Chunfeng Yun
  2025-02-15 10:06 ` [PATCH v3 3/4] usb: mtk-xhci: add support remote wakeup of mt8196 Chunfeng Yun
@ 2025-02-15 10:06 ` Chunfeng Yun
  2025-02-18  8:57   ` AngeloGioacchino Del Regno
  2025-02-18  8:57 ` [PATCH v3 1/4] dt-bindings: usb: mtk-xhci: add support mt8196 AngeloGioacchino Del Regno
  3 siblings, 1 reply; 11+ messages in thread
From: Chunfeng Yun @ 2025-02-15 10:06 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rob Herring, AngeloGioacchino Del Regno
  Cc: Chunfeng Yun, Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	Mathias Nyman, linux-usb, linux-arm-kernel, linux-mediatek,
	devicetree, linux-kernel

There are three USB controllers on mt8196, each controller's wakeup
control is different, add some specific versions for them.

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
---
v3: add the ommitted third dual-role controller suggested by Angelo
v2: add wakeup for dual-role controllers
---
 drivers/usb/mtu3/mtu3_host.c | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/drivers/usb/mtu3/mtu3_host.c b/drivers/usb/mtu3/mtu3_host.c
index 7c657ea2dabd..8138b3f3096a 100644
--- a/drivers/usb/mtu3/mtu3_host.c
+++ b/drivers/usb/mtu3/mtu3_host.c
@@ -46,6 +46,14 @@
 #define WC1_IS_P_95		BIT(12)
 #define WC1_IS_EN_P0_95		BIT(6)
 
+/* mt8196 */
+#define PERI_WK_CTRL0_8196	0x08
+#define WC0_IS_EN_P0_96		BIT(0)
+#define WC0_IS_EN_P1_96		BIT(7)
+
+#define PERI_WK_CTRL1_8196	0x10
+#define WC1_IS_EN_P2_96		BIT(0)
+
 /* mt2712 etc */
 #define PERI_SSUSB_SPM_CTRL	0x0
 #define SSC_IP_SLEEP_EN	BIT(4)
@@ -59,6 +67,9 @@ enum ssusb_uwk_vers {
 	SSUSB_UWK_V1_3,		/* mt8195 IP0 */
 	SSUSB_UWK_V1_5 = 105,	/* mt8195 IP2 */
 	SSUSB_UWK_V1_6,		/* mt8195 IP3 */
+	SSUSB_UWK_V1_7, 	/* mt8196 IP0 */
+	SSUSB_UWK_V1_8, 	/* mt8196 IP1 */
+	SSUSB_UWK_V1_9, 	/* mt8196 IP2 */
 };
 
 /*
@@ -100,6 +111,21 @@ static void ssusb_wakeup_ip_sleep_set(struct ssusb_mtk *ssusb, 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_7:
+		reg = ssusb->uwk_reg_base + PERI_WK_CTRL0_8196;
+		msk = WC0_IS_EN_P0_96;
+		val = enable ? msk : 0;
+		break;
+	case SSUSB_UWK_V1_8:
+		reg = ssusb->uwk_reg_base + PERI_WK_CTRL0_8196;
+		msk = WC0_IS_EN_P1_96;
+		val = enable ? msk : 0;
+		break;
+	case SSUSB_UWK_V1_9:
+		reg = ssusb->uwk_reg_base + PERI_WK_CTRL1_8196;
+		msk = WC1_IS_EN_P2_96;
+		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.46.0


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

* Re: [PATCH v3 1/4] dt-bindings: usb: mtk-xhci: add support mt8196
  2025-02-15 10:06 [PATCH v3 1/4] dt-bindings: usb: mtk-xhci: add support mt8196 Chunfeng Yun
                   ` (2 preceding siblings ...)
  2025-02-15 10:06 ` [PATCH v3 4/4] usb: mtu3: " Chunfeng Yun
@ 2025-02-18  8:57 ` AngeloGioacchino Del Regno
  3 siblings, 0 replies; 11+ messages in thread
From: AngeloGioacchino Del Regno @ 2025-02-18  8:57 UTC (permalink / raw)
  To: Chunfeng Yun, Greg Kroah-Hartman, Rob Herring
  Cc: Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	Mathias Nyman, linux-usb, linux-arm-kernel, linux-mediatek,
	devicetree, linux-kernel, Conor Dooley

Il 15/02/25 11:06, Chunfeng Yun ha scritto:
> There are three USB controllers on mt8196, each controller's wakeup
> control is different, add some specific versions for them, and add
> a new compatilbe for mt8196.
> 
> Acked-by: Conor Dooley <conor.dooley@microchip.com>
> Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>


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

* Re: [PATCH v3 2/4] dt-bindings: usb: mtu3: add support mt8196
  2025-02-15 10:06 ` [PATCH v3 2/4] dt-bindings: usb: mtu3: " Chunfeng Yun
@ 2025-02-18  8:57   ` AngeloGioacchino Del Regno
  0 siblings, 0 replies; 11+ messages in thread
From: AngeloGioacchino Del Regno @ 2025-02-18  8:57 UTC (permalink / raw)
  To: Chunfeng Yun, Greg Kroah-Hartman, Rob Herring
  Cc: Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	Mathias Nyman, linux-usb, linux-arm-kernel, linux-mediatek,
	devicetree, linux-kernel, Conor Dooley

Il 15/02/25 11:06, Chunfeng Yun ha scritto:
> There are three USB controllers on mt8196, each controller's wakeup
> control is different, add some specific versions for them, and add
> compatilbe for mt8196.
> 
> Acked-by: Conor Dooley <conor.dooley@microchip.com>
> Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>



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

* Re: [PATCH v3 4/4] usb: mtu3: add support remote wakeup of mt8196
  2025-02-15 10:06 ` [PATCH v3 4/4] usb: mtu3: " Chunfeng Yun
@ 2025-02-18  8:57   ` AngeloGioacchino Del Regno
  0 siblings, 0 replies; 11+ messages in thread
From: AngeloGioacchino Del Regno @ 2025-02-18  8:57 UTC (permalink / raw)
  To: Chunfeng Yun, Greg Kroah-Hartman, Rob Herring
  Cc: Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	Mathias Nyman, linux-usb, linux-arm-kernel, linux-mediatek,
	devicetree, linux-kernel

Il 15/02/25 11:06, Chunfeng Yun ha scritto:
> There are three USB controllers on mt8196, each controller's wakeup
> control is different, add some specific versions for them.
> 
> Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>

> ---
> v3: add the ommitted third dual-role controller suggested by Angelo
> v2: add wakeup for dual-role controllers
> ---
>   drivers/usb/mtu3/mtu3_host.c | 26 ++++++++++++++++++++++++++
>   1 file changed, 26 insertions(+)
> 
> diff --git a/drivers/usb/mtu3/mtu3_host.c b/drivers/usb/mtu3/mtu3_host.c
> index 7c657ea2dabd..8138b3f3096a 100644
> --- a/drivers/usb/mtu3/mtu3_host.c
> +++ b/drivers/usb/mtu3/mtu3_host.c
> @@ -46,6 +46,14 @@
>   #define WC1_IS_P_95		BIT(12)
>   #define WC1_IS_EN_P0_95		BIT(6)
>   
> +/* mt8196 */
> +#define PERI_WK_CTRL0_8196	0x08
> +#define WC0_IS_EN_P0_96		BIT(0)
> +#define WC0_IS_EN_P1_96		BIT(7)
> +
> +#define PERI_WK_CTRL1_8196	0x10
> +#define WC1_IS_EN_P2_96		BIT(0)
> +
>   /* mt2712 etc */
>   #define PERI_SSUSB_SPM_CTRL	0x0
>   #define SSC_IP_SLEEP_EN	BIT(4)
> @@ -59,6 +67,9 @@ enum ssusb_uwk_vers {
>   	SSUSB_UWK_V1_3,		/* mt8195 IP0 */
>   	SSUSB_UWK_V1_5 = 105,	/* mt8195 IP2 */
>   	SSUSB_UWK_V1_6,		/* mt8195 IP3 */
> +	SSUSB_UWK_V1_7, 	/* mt8196 IP0 */
> +	SSUSB_UWK_V1_8, 	/* mt8196 IP1 */
> +	SSUSB_UWK_V1_9, 	/* mt8196 IP2 */
>   };
>   
>   /*
> @@ -100,6 +111,21 @@ static void ssusb_wakeup_ip_sleep_set(struct ssusb_mtk *ssusb, 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_7:
> +		reg = ssusb->uwk_reg_base + PERI_WK_CTRL0_8196;
> +		msk = WC0_IS_EN_P0_96;
> +		val = enable ? msk : 0;
> +		break;
> +	case SSUSB_UWK_V1_8:
> +		reg = ssusb->uwk_reg_base + PERI_WK_CTRL0_8196;
> +		msk = WC0_IS_EN_P1_96;
> +		val = enable ? msk : 0;
> +		break;
> +	case SSUSB_UWK_V1_9:
> +		reg = ssusb->uwk_reg_base + PERI_WK_CTRL1_8196;
> +		msk = WC1_IS_EN_P2_96;
> +		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;



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

* Re: [PATCH v3 3/4] usb: mtk-xhci: add support remote wakeup of mt8196
  2025-02-15 10:06 ` [PATCH v3 3/4] usb: mtk-xhci: add support remote wakeup of mt8196 Chunfeng Yun
@ 2025-02-18  8:57   ` AngeloGioacchino Del Regno
  2025-02-22  8:07     ` Chunfeng Yun (云春峰)
  2025-02-22  8:33     ` Chunfeng Yun (云春峰)
  0 siblings, 2 replies; 11+ messages in thread
From: AngeloGioacchino Del Regno @ 2025-02-18  8:57 UTC (permalink / raw)
  To: Chunfeng Yun, Greg Kroah-Hartman, Rob Herring
  Cc: Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	Mathias Nyman, linux-usb, linux-arm-kernel, linux-mediatek,
	devicetree, linux-kernel

Il 15/02/25 11:06, Chunfeng Yun ha scritto:
> There are three USB controllers on mt8196, each controller's wakeup
> control is different, add some specific versions for them.
> 
> Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>

Since all of the USB controllers of the MT8196 SoC are behind MTU3, and
since the wakeup control for all of them will be handled by the MTU3 driver
and *not* by the xhci-mtk driver....

NACK!

Please drop this commit.

Cheers,
Angelo

> ---
> v3: no changes
> v2: modify marcos name
> ---
>   drivers/usb/host/xhci-mtk.c | 26 ++++++++++++++++++++++++++
>   1 file changed, 26 insertions(+)
> 
> diff --git a/drivers/usb/host/xhci-mtk.c b/drivers/usb/host/xhci-mtk.c
> index 904831344440..3f8e37b25322 100644
> --- a/drivers/usb/host/xhci-mtk.c
> +++ b/drivers/usb/host/xhci-mtk.c
> @@ -113,6 +113,14 @@
>   #define WC1_IS_P_95		BIT(12)
>   #define WC1_IS_EN_P0_95		BIT(6)
>   
> +/* mt8196 */
> +#define PERI_WK_CTRL0_8196	0x08
> +#define WC0_IS_EN_P0_96		BIT(0)
> +#define WC0_IS_EN_P1_96		BIT(7)
> +
> +#define PERI_WK_CTRL1_8196	0x10
> +#define WC1_IS_EN_P2_96		BIT(0)
> +
>   /* mt2712 etc */
>   #define PERI_SSUSB_SPM_CTRL	0x0
>   #define SSC_IP_SLEEP_EN	BIT(4)
> @@ -129,6 +137,9 @@ 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_7,		/* mt8196 IP0 */
> +	SSUSB_UWK_V1_8,		/* mt8196 IP1 */
> +	SSUSB_UWK_V1_9,		/* mt8196 IP2 */
>   };
>   
>   /*
> @@ -381,6 +392,21 @@ 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_7:
> +		reg = mtk->uwk_reg_base + PERI_WK_CTRL0_8196;
> +		msk = WC0_IS_EN_P0_96;
> +		val = enable ? msk : 0;
> +		break;
> +	case SSUSB_UWK_V1_8:
> +		reg = mtk->uwk_reg_base + PERI_WK_CTRL0_8196;
> +		msk = WC0_IS_EN_P1_96;
> +		val = enable ? msk : 0;
> +		break;
> +	case SSUSB_UWK_V1_9:
> +		reg = mtk->uwk_reg_base + PERI_WK_CTRL1_8196;
> +		msk = WC1_IS_EN_P2_96;
> +		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;




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

* Re: [PATCH v3 3/4] usb: mtk-xhci: add support remote wakeup of mt8196
  2025-02-18  8:57   ` AngeloGioacchino Del Regno
@ 2025-02-22  8:07     ` Chunfeng Yun (云春峰)
  2025-02-22  8:33     ` Chunfeng Yun (云春峰)
  1 sibling, 0 replies; 11+ messages in thread
From: Chunfeng Yun (云春峰) @ 2025-02-22  8:07 UTC (permalink / raw)
  To: robh@kernel.org, AngeloGioacchino Del Regno,
	gregkh@linuxfoundation.org
  Cc: linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org,
	linux-usb@vger.kernel.org, devicetree@vger.kernel.org,
	mathias.nyman@intel.com, conor+dt@kernel.org,
	linux-arm-kernel@lists.infradead.org, matthias.bgg@gmail.com,
	krzk+dt@kernel.org

On Tue, 2025-02-18 at 09:57 +0100, AngeloGioacchino Del Regno wrote:
> External email : Please do not click links or open attachments until
> you have verified the sender or the content.
> 
> 
> Il 15/02/25 11:06, Chunfeng Yun ha scritto:
> > There are three USB controllers on mt8196, each controller's wakeup
> > control is different, add some specific versions for them.
> > 
> > Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
> 
> Since all of the USB controllers of the MT8196 SoC are behind MTU3,
> and
> since the wakeup control for all of them will be handled by the MTU3
> driver
> and *not* by the xhci-mtk driver....
As I explained before, this is used for back compatible, and we always
use host only for some projects, and don not use mtu3 driver, that will
make dts complicated.

> 
> NACK!
> 
> Please drop this commit.
And xhci-mtk's patch is higher priority than mtu3's, I already add
mtu3's patch as you suggestion, but I still hope to keep it. provide
one more option is better for our customers.

Thanks.

> 
> Cheers,
> Angelo
> 
> > ---
> > v3: no changes
> > v2: modify marcos name
> > ---
> >   drivers/usb/host/xhci-mtk.c | 26 ++++++++++++++++++++++++++
> >   1 file changed, 26 insertions(+)
> > 
> > diff --git a/drivers/usb/host/xhci-mtk.c b/drivers/usb/host/xhci-
> > mtk.c
> > index 904831344440..3f8e37b25322 100644
> > --- a/drivers/usb/host/xhci-mtk.c
> > +++ b/drivers/usb/host/xhci-mtk.c
> > @@ -113,6 +113,14 @@
> >   #define WC1_IS_P_95         BIT(12)
> >   #define WC1_IS_EN_P0_95             BIT(6)
> > 
> > +/* mt8196 */
> > +#define PERI_WK_CTRL0_8196   0x08
> > +#define WC0_IS_EN_P0_96              BIT(0)
> > +#define WC0_IS_EN_P1_96              BIT(7)
> > +
> > +#define PERI_WK_CTRL1_8196   0x10
> > +#define WC1_IS_EN_P2_96              BIT(0)
> > +
> >   /* mt2712 etc */
> >   #define PERI_SSUSB_SPM_CTRL 0x0
> >   #define SSC_IP_SLEEP_EN     BIT(4)
> > @@ -129,6 +137,9 @@ 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_7,         /* mt8196 IP0 */
> > +     SSUSB_UWK_V1_8,         /* mt8196 IP1 */
> > +     SSUSB_UWK_V1_9,         /* mt8196 IP2 */
> >   };
> > 
> >   /*
> > @@ -381,6 +392,21 @@ 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_7:
> > +             reg = mtk->uwk_reg_base + PERI_WK_CTRL0_8196;
> > +             msk = WC0_IS_EN_P0_96;
> > +             val = enable ? msk : 0;
> > +             break;
> > +     case SSUSB_UWK_V1_8:
> > +             reg = mtk->uwk_reg_base + PERI_WK_CTRL0_8196;
> > +             msk = WC0_IS_EN_P1_96;
> > +             val = enable ? msk : 0;
> > +             break;
> > +     case SSUSB_UWK_V1_9:
> > +             reg = mtk->uwk_reg_base + PERI_WK_CTRL1_8196;
> > +             msk = WC1_IS_EN_P2_96;
> > +             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;
> 
> 
> 

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

* Re: [PATCH v3 3/4] usb: mtk-xhci: add support remote wakeup of mt8196
  2025-02-18  8:57   ` AngeloGioacchino Del Regno
  2025-02-22  8:07     ` Chunfeng Yun (云春峰)
@ 2025-02-22  8:33     ` Chunfeng Yun (云春峰)
  2025-02-24 12:16       ` AngeloGioacchino Del Regno
  1 sibling, 1 reply; 11+ messages in thread
From: Chunfeng Yun (云春峰) @ 2025-02-22  8:33 UTC (permalink / raw)
  To: robh@kernel.org, AngeloGioacchino Del Regno,
	gregkh@linuxfoundation.org
  Cc: linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org,
	linux-usb@vger.kernel.org, devicetree@vger.kernel.org,
	mathias.nyman@intel.com, conor+dt@kernel.org,
	linux-arm-kernel@lists.infradead.org, matthias.bgg@gmail.com,
	krzk+dt@kernel.org

On Tue, 2025-02-18 at 09:57 +0100, AngeloGioacchino Del Regno wrote:
> External email : Please do not click links or open attachments until
> you have verified the sender or the content.
> 
> 
> Il 15/02/25 11:06, Chunfeng Yun ha scritto:
> > There are three USB controllers on mt8196, each controller's wakeup
> > control is different, add some specific versions for them.
> > 
> > Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
> 
> Since all of the USB controllers of the MT8196 SoC are behind MTU3,
> and
> since the wakeup control for all of them will be handled by the MTU3
> driver
> and *not* by the xhci-mtk driver....
> 
> NACK!
> 
> Please drop this commit.
Please help to pick up these patches, I also hate to add these specific
wakeup ways, but our haredware designer do not follow the hwip rules
sometimes.

Thank you.

> 
> Cheers,
> Angelo
> 
> > ---
> > v3: no changes
> > v2: modify marcos name
> > ---
> >   drivers/usb/host/xhci-mtk.c | 26 ++++++++++++++++++++++++++
> >   1 file changed, 26 insertions(+)
> > 
> > diff --git a/drivers/usb/host/xhci-mtk.c b/drivers/usb/host/xhci-
> > mtk.c
> > index 904831344440..3f8e37b25322 100644
> > --- a/drivers/usb/host/xhci-mtk.c
> > +++ b/drivers/usb/host/xhci-mtk.c
> > @@ -113,6 +113,14 @@
> >   #define WC1_IS_P_95         BIT(12)
> >   #define WC1_IS_EN_P0_95             BIT(6)
> > 
> > +/* mt8196 */
> > +#define PERI_WK_CTRL0_8196   0x08
> > +#define WC0_IS_EN_P0_96              BIT(0)
> > +#define WC0_IS_EN_P1_96              BIT(7)
> > +
> > +#define PERI_WK_CTRL1_8196   0x10
> > +#define WC1_IS_EN_P2_96              BIT(0)
> > +
> >   /* mt2712 etc */
> >   #define PERI_SSUSB_SPM_CTRL 0x0
> >   #define SSC_IP_SLEEP_EN     BIT(4)
> > @@ -129,6 +137,9 @@ 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_7,         /* mt8196 IP0 */
> > +     SSUSB_UWK_V1_8,         /* mt8196 IP1 */
> > +     SSUSB_UWK_V1_9,         /* mt8196 IP2 */
> >   };
> > 
> >   /*
> > @@ -381,6 +392,21 @@ 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_7:
> > +             reg = mtk->uwk_reg_base + PERI_WK_CTRL0_8196;
> > +             msk = WC0_IS_EN_P0_96;
> > +             val = enable ? msk : 0;
> > +             break;
> > +     case SSUSB_UWK_V1_8:
> > +             reg = mtk->uwk_reg_base + PERI_WK_CTRL0_8196;
> > +             msk = WC0_IS_EN_P1_96;
> > +             val = enable ? msk : 0;
> > +             break;
> > +     case SSUSB_UWK_V1_9:
> > +             reg = mtk->uwk_reg_base + PERI_WK_CTRL1_8196;
> > +             msk = WC1_IS_EN_P2_96;
> > +             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;
> 
> 
> 

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

* Re: [PATCH v3 3/4] usb: mtk-xhci: add support remote wakeup of mt8196
  2025-02-22  8:33     ` Chunfeng Yun (云春峰)
@ 2025-02-24 12:16       ` AngeloGioacchino Del Regno
  0 siblings, 0 replies; 11+ messages in thread
From: AngeloGioacchino Del Regno @ 2025-02-24 12:16 UTC (permalink / raw)
  To: Chunfeng Yun (云春峰), robh@kernel.org,
	gregkh@linuxfoundation.org
  Cc: linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org,
	linux-usb@vger.kernel.org, devicetree@vger.kernel.org,
	mathias.nyman@intel.com, conor+dt@kernel.org,
	linux-arm-kernel@lists.infradead.org, matthias.bgg@gmail.com,
	krzk+dt@kernel.org

Il 22/02/25 09:33, Chunfeng Yun (云春峰) ha scritto:
> On Tue, 2025-02-18 at 09:57 +0100, AngeloGioacchino Del Regno wrote:
>> External email : Please do not click links or open attachments until
>> you have verified the sender or the content.
>>
>>
>> Il 15/02/25 11:06, Chunfeng Yun ha scritto:
>>> There are three USB controllers on mt8196, each controller's wakeup
>>> control is different, add some specific versions for them.
>>>
>>> Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
>>
>> Since all of the USB controllers of the MT8196 SoC are behind MTU3,
>> and
>> since the wakeup control for all of them will be handled by the MTU3
>> driver
>> and *not* by the xhci-mtk driver....
>>
>> NACK!
>>
>> Please drop this commit.
> Please help to pick up these patches, I also hate to add these specific
> wakeup ways, but our haredware designer do not follow the hwip rules
> sometimes.
> 

That makes this commit have sense, then.

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>

> Thank you.
> 
>>
>> Cheers,
>> Angelo
>>
>>> ---
>>> v3: no changes
>>> v2: modify marcos name
>>> ---
>>>    drivers/usb/host/xhci-mtk.c | 26 ++++++++++++++++++++++++++
>>>    1 file changed, 26 insertions(+)
>>>
>>> diff --git a/drivers/usb/host/xhci-mtk.c b/drivers/usb/host/xhci-
>>> mtk.c
>>> index 904831344440..3f8e37b25322 100644
>>> --- a/drivers/usb/host/xhci-mtk.c
>>> +++ b/drivers/usb/host/xhci-mtk.c
>>> @@ -113,6 +113,14 @@
>>>    #define WC1_IS_P_95         BIT(12)
>>>    #define WC1_IS_EN_P0_95             BIT(6)
>>>
>>> +/* mt8196 */
>>> +#define PERI_WK_CTRL0_8196   0x08
>>> +#define WC0_IS_EN_P0_96              BIT(0)
>>> +#define WC0_IS_EN_P1_96              BIT(7)
>>> +
>>> +#define PERI_WK_CTRL1_8196   0x10
>>> +#define WC1_IS_EN_P2_96              BIT(0)
>>> +
>>>    /* mt2712 etc */
>>>    #define PERI_SSUSB_SPM_CTRL 0x0
>>>    #define SSC_IP_SLEEP_EN     BIT(4)
>>> @@ -129,6 +137,9 @@ 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_7,         /* mt8196 IP0 */
>>> +     SSUSB_UWK_V1_8,         /* mt8196 IP1 */
>>> +     SSUSB_UWK_V1_9,         /* mt8196 IP2 */
>>>    };
>>>
>>>    /*
>>> @@ -381,6 +392,21 @@ 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_7:
>>> +             reg = mtk->uwk_reg_base + PERI_WK_CTRL0_8196;
>>> +             msk = WC0_IS_EN_P0_96;
>>> +             val = enable ? msk : 0;
>>> +             break;
>>> +     case SSUSB_UWK_V1_8:
>>> +             reg = mtk->uwk_reg_base + PERI_WK_CTRL0_8196;
>>> +             msk = WC0_IS_EN_P1_96;
>>> +             val = enable ? msk : 0;
>>> +             break;
>>> +     case SSUSB_UWK_V1_9:
>>> +             reg = mtk->uwk_reg_base + PERI_WK_CTRL1_8196;
>>> +             msk = WC1_IS_EN_P2_96;
>>> +             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;
>>
>>
>>

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

end of thread, other threads:[~2025-02-24 12:16 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-15 10:06 [PATCH v3 1/4] dt-bindings: usb: mtk-xhci: add support mt8196 Chunfeng Yun
2025-02-15 10:06 ` [PATCH v3 2/4] dt-bindings: usb: mtu3: " Chunfeng Yun
2025-02-18  8:57   ` AngeloGioacchino Del Regno
2025-02-15 10:06 ` [PATCH v3 3/4] usb: mtk-xhci: add support remote wakeup of mt8196 Chunfeng Yun
2025-02-18  8:57   ` AngeloGioacchino Del Regno
2025-02-22  8:07     ` Chunfeng Yun (云春峰)
2025-02-22  8:33     ` Chunfeng Yun (云春峰)
2025-02-24 12:16       ` AngeloGioacchino Del Regno
2025-02-15 10:06 ` [PATCH v3 4/4] usb: mtu3: " Chunfeng Yun
2025-02-18  8:57   ` AngeloGioacchino Del Regno
2025-02-18  8:57 ` [PATCH v3 1/4] dt-bindings: usb: mtk-xhci: add support mt8196 AngeloGioacchino Del Regno

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox