2021-03-23 07:05:03

by Chunfeng Yun

[permalink] [raw]
Subject: [PATCH v2 01/13] dt-bindings: usb: mtk-xhci: support property usb2-lpm-disable

Add support common property usb2-lpm-disable

Signed-off-by: Chunfeng Yun <[email protected]>
---
v2: no changes
---
Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml b/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml
index 14f40efb3b22..2246d29a5e4e 100644
--- a/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml
+++ b/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml
@@ -103,6 +103,10 @@ properties:
description: supports USB3.0 LPM
type: boolean

+ usb2-lpm-disable:
+ description: disable USB2 HW LPM
+ type: boolean
+
imod-interval-ns:
description:
Interrupt moderation interval value, it is 8 times as much as that
--
2.18.0


2021-03-23 07:05:09

by Chunfeng Yun

[permalink] [raw]
Subject: [PATCH v2 03/13] dt-bindings: usb: mtu3: support wakeup for mt8183 and mt8192

These two HW of wakeup don't follow MediaTek internal IPM rule,
and both use a specific way, like as early revision of mt8173.

Due to the index 2 already used by many DTS, it's better to keep
it unchanged for backward compatibility, treat specific ones without
following IPM rule as revision 1.x, meanwhile reserve 3~99 for
later revision that following the IPM rule.

Signed-off-by: Chunfeng Yun <[email protected]>
---
v2: modify revision format
---
.../devicetree/bindings/usb/mediatek,mtu3.yaml | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/Documentation/devicetree/bindings/usb/mediatek,mtu3.yaml b/Documentation/devicetree/bindings/usb/mediatek,mtu3.yaml
index f5c04b9d2de9..8e37403520ff 100644
--- a/Documentation/devicetree/bindings/usb/mediatek,mtu3.yaml
+++ b/Documentation/devicetree/bindings/usb/mediatek,mtu3.yaml
@@ -24,6 +24,7 @@ properties:
- mediatek,mt2712-mtu3
- mediatek,mt8173-mtu3
- mediatek,mt8183-mtu3
+ - mediatek,mt8192-mtu3
- const: mediatek,mtu3

reg:
@@ -152,10 +153,13 @@ properties:
- description:
The second cell represents the register base address of the glue
layer in syscon
- - description:
+ - description: |
The third cell represents the hardware version of the glue layer,
- 1 is used by mt8173 etc, 2 is used by mt2712 etc
- enum: [1, 2]
+ 1 - used by mt8173 etc, revision 1 without following IPM rule;
+ 2 - used by mt2712 etc, revision 2 with following IPM rule;
+ 101 - used by mt8183, specific 1.01;
+ 102 - used by mt8192, specific 1.02;
+ enum: [1, 2, 101, 102]

mediatek,u3p-dis-msk:
$ref: /schemas/types.yaml#/definitions/uint32
--
2.18.0

2021-03-23 07:05:35

by Chunfeng Yun

[permalink] [raw]
Subject: [PATCH v2 04/13] usb: xhci-mtk: fix broken streams issue on 0.96 xHCI

The MediaTek 0.96 xHCI controller on some platforms does not
support bulk stream even HCCPARAMS says supporting, due to MaxPSASize
is set a default value 1 by mistake, here use XHCI_BROKEN_STREAMS
quirk to fix it.

Fixes: 94a631d91ad3 ("usb: xhci-mtk: check hcc_params after adding primary hcd")
Signed-off-by: Chunfeng Yun <[email protected]>
---
v2: no changes
---
drivers/usb/host/xhci-mtk.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/host/xhci-mtk.c b/drivers/usb/host/xhci-mtk.c
index 57bcfdfa0465..1b9f10048fe0 100644
--- a/drivers/usb/host/xhci-mtk.c
+++ b/drivers/usb/host/xhci-mtk.c
@@ -388,6 +388,13 @@ static void xhci_mtk_quirks(struct device *dev, struct xhci_hcd *xhci)
xhci->quirks |= XHCI_SPURIOUS_SUCCESS;
if (mtk->lpm_support)
xhci->quirks |= XHCI_LPM_SUPPORT;
+
+ /*
+ * MTK xHCI 0.96: PSA is 1 by default even if doesn't support stream,
+ * and it's 3 when support it.
+ */
+ if (xhci->hci_version < 0x100 && HCC_MAX_PSA(xhci->hcc_params) == 4)
+ xhci->quirks |= XHCI_BROKEN_STREAMS;
}

/* called during probe() after chip reset completes */
@@ -549,7 +556,8 @@ static int xhci_mtk_probe(struct platform_device *pdev)
if (ret)
goto put_usb3_hcd;

- if (HCC_MAX_PSA(xhci->hcc_params) >= 4)
+ if (HCC_MAX_PSA(xhci->hcc_params) >= 4 &&
+ !(xhci->quirks & XHCI_BROKEN_STREAMS))
xhci->shared_hcd->can_do_streams = 1;

ret = usb_add_hcd(xhci->shared_hcd, irq, IRQF_SHARED);
--
2.18.0

2021-03-23 07:05:39

by Chunfeng Yun

[permalink] [raw]
Subject: [PATCH v2 09/13] usb: xhci-mtk: remove MODULE_ALIAS

Since the driver only supports the devices created by the OF
core, seems no need MODULE_ALIAS() anymore.

Signed-off-by: Chunfeng Yun <[email protected]>
---
v2: no changes
---
drivers/usb/host/xhci-mtk.c | 1 -
1 file changed, 1 deletion(-)

diff --git a/drivers/usb/host/xhci-mtk.c b/drivers/usb/host/xhci-mtk.c
index 832c5b8bb8a8..744639d23fa8 100644
--- a/drivers/usb/host/xhci-mtk.c
+++ b/drivers/usb/host/xhci-mtk.c
@@ -705,7 +705,6 @@ static struct platform_driver mtk_xhci_driver = {
.of_match_table = mtk_xhci_of_match,
},
};
-MODULE_ALIAS("platform:xhci-mtk");

static int __init xhci_mtk_init(void)
{
--
2.18.0

2021-03-23 07:05:49

by Chunfeng Yun

[permalink] [raw]
Subject: [PATCH v2 05/13] usb: xhci-mtk: support quirk to disable usb2 lpm

The xHCI driver support usb2 HW LPM by default, here add support
XHCI_HW_LPM_DISABLE quirk, then we can disable usb2 lpm when
need it.

Signed-off-by: Chunfeng Yun <[email protected]>
---
v2: no changes
---
drivers/usb/host/xhci-mtk.c | 3 +++
drivers/usb/host/xhci-mtk.h | 1 +
2 files changed, 4 insertions(+)

diff --git a/drivers/usb/host/xhci-mtk.c b/drivers/usb/host/xhci-mtk.c
index 1b9f10048fe0..09f2ddbfe8b9 100644
--- a/drivers/usb/host/xhci-mtk.c
+++ b/drivers/usb/host/xhci-mtk.c
@@ -388,6 +388,8 @@ static void xhci_mtk_quirks(struct device *dev, struct xhci_hcd *xhci)
xhci->quirks |= XHCI_SPURIOUS_SUCCESS;
if (mtk->lpm_support)
xhci->quirks |= XHCI_LPM_SUPPORT;
+ if (mtk->u2_lpm_disable)
+ xhci->quirks |= XHCI_HW_LPM_DISABLE;

/*
* MTK xHCI 0.96: PSA is 1 by default even if doesn't support stream,
@@ -470,6 +472,7 @@ static int xhci_mtk_probe(struct platform_device *pdev)
return ret;

mtk->lpm_support = of_property_read_bool(node, "usb3-lpm-capable");
+ mtk->u2_lpm_disable = of_property_read_bool(node, "usb2-lpm-disable");
/* optional property, ignore the error if it does not exist */
of_property_read_u32(node, "mediatek,u3p-dis-msk",
&mtk->u3p_dis_msk);
diff --git a/drivers/usb/host/xhci-mtk.h b/drivers/usb/host/xhci-mtk.h
index 621ec1a85009..4ccd08e20a15 100644
--- a/drivers/usb/host/xhci-mtk.h
+++ b/drivers/usb/host/xhci-mtk.h
@@ -149,6 +149,7 @@ struct xhci_hcd_mtk {
struct phy **phys;
int num_phys;
bool lpm_support;
+ bool u2_lpm_disable;
/* usb remote wakeup */
bool uwk_en;
struct regmap *uwk;
--
2.18.0

2021-03-23 07:06:00

by Chunfeng Yun

[permalink] [raw]
Subject: [PATCH v2 11/13] usb: mtu3: add support ip-sleep wakeup for MT8192

Add add support ip-sleep wakeup for MT8192, it's a specific
revision, not following IPM rule.

Signed-off-by: Chunfeng Yun <[email protected]>
---
v2:
1. fix typo suggested by Sergei
2. modify revision format
---
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 398ce0014606..e3c923e6529f 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)

+/* mt8192 */
+#define WC0_SSUSB0_CDEN BIT(6)
+#define WC0_IS_SPM_EN BIT(1)
+
/* mt2712 etc */
#define PERI_SSUSB_SPM_CTRL 0x0
#define SSC_IP_SLEEP_EN BIT(4)
@@ -39,6 +43,7 @@ enum ssusb_uwk_vers {
SSUSB_UWK_V1 = 1,
SSUSB_UWK_V2,
SSUSB_UWK_V1_1 = 101, /* specific revision 1.01 */
+ SSUSB_UWK_V1_2, /* specific revision 1.02 */
};

/*
@@ -60,6 +65,11 @@ static void ssusb_wakeup_ip_sleep_set(struct ssusb_mtk *ssusb, bool enable)
msk = WC0_IS_EN | WC0_IS_C(0xf) | WC0_IS_P;
val = enable ? (WC0_IS_EN | WC0_IS_C(0x8)) : 0;
break;
+ case SSUSB_UWK_V1_2:
+ reg = ssusb->uwk_reg_base + PERI_WK_CTRL0;
+ msk = WC0_SSUSB0_CDEN | WC0_IS_SPM_EN;
+ 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.18.0

2021-03-23 07:06:21

by Chunfeng Yun

[permalink] [raw]
Subject: [PATCH v2 13/13] arm64: dts: mt8183: update wakeup register offset

Use wakeup control register offset exactly, and update revision
number

Signed-off-by: Chunfeng Yun <[email protected]>
---
v2: modify revision format
---
arch/arm64/boot/dts/mediatek/mt8183.dtsi | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/mediatek/mt8183.dtsi b/arch/arm64/boot/dts/mediatek/mt8183.dtsi
index 80519a145f13..9ea84d636556 100644
--- a/arch/arm64/boot/dts/mediatek/mt8183.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8183.dtsi
@@ -874,7 +874,7 @@
clocks = <&infracfg CLK_INFRA_UNIPRO_SCK>,
<&infracfg CLK_INFRA_USB>;
clock-names = "sys_ck", "ref_ck";
- mediatek,syscon-wakeup = <&pericfg 0x400 0>;
+ mediatek,syscon-wakeup = <&pericfg 0x420 101>;
#address-cells = <2>;
#size-cells = <2>;
ranges;
--
2.18.0

2021-03-23 07:06:58

by Chunfeng Yun

[permalink] [raw]
Subject: [PATCH v2 10/13] usb: mtu3: support ip-sleep wakeup for MT8183

Add support ip-sleep wakeup for MT8183, it's similar to MT8173,
and it's also a specific one, but not following IPM rule.
Due to the index 2 already used by many DTS, it's better to keep
it unchanged for backward compatibility, treat specific ones without
following IPM rule as revision 1.x, meanwhile reserve 3~10 for later
revision that follows the IPM rule.

Signed-off-by: Chunfeng Yun <[email protected]>
---
v2:
1. fix typo suggested by Sergei
2. fix build warning - Woverflow
3. modify revision format
---
drivers/usb/mtu3/mtu3_host.c | 12 ++++++++++++
1 file changed, 12 insertions(+)

diff --git a/drivers/usb/mtu3/mtu3_host.c b/drivers/usb/mtu3/mtu3_host.c
index c871b94f3e6f..398ce0014606 100644
--- a/drivers/usb/mtu3/mtu3_host.c
+++ b/drivers/usb/mtu3/mtu3_host.c
@@ -24,6 +24,12 @@
#define WC1_IS_EN BIT(25)
#define WC1_IS_P BIT(6) /* polarity for ip sleep */

+/* mt8183 */
+#define PERI_WK_CTRL0 0x0
+#define WC0_IS_C(x) ((u32)(((x) & 0xf) << 28)) /* cycle debounce */
+#define WC0_IS_P BIT(12) /* polarity */
+#define WC0_IS_EN BIT(6)
+
/* mt2712 etc */
#define PERI_SSUSB_SPM_CTRL 0x0
#define SSC_IP_SLEEP_EN BIT(4)
@@ -32,6 +38,7 @@
enum ssusb_uwk_vers {
SSUSB_UWK_V1 = 1,
SSUSB_UWK_V2,
+ SSUSB_UWK_V1_1 = 101, /* specific revision 1.01 */
};

/*
@@ -48,6 +55,11 @@ static void ssusb_wakeup_ip_sleep_set(struct ssusb_mtk *ssusb, bool enable)
msk = WC1_IS_EN | WC1_IS_C(0xf) | WC1_IS_P;
val = enable ? (WC1_IS_EN | WC1_IS_C(0x8)) : 0;
break;
+ case SSUSB_UWK_V1_1:
+ reg = ssusb->uwk_reg_base + PERI_WK_CTRL0;
+ msk = WC0_IS_EN | WC0_IS_C(0xf) | WC0_IS_P;
+ val = enable ? (WC0_IS_EN | WC0_IS_C(0x8)) : 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.18.0

2021-03-23 07:07:00

by Chunfeng Yun

[permalink] [raw]
Subject: [PATCH v2 08/13] usb: xhci-mtk: drop CONFIG_OF

The driver can match only the devices created by the OF core
via the DT table, so the table should be always used.

Signed-off-by: Chunfeng Yun <[email protected]>
---
v2: no changes
---
drivers/usb/host/xhci-mtk.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/usb/host/xhci-mtk.c b/drivers/usb/host/xhci-mtk.c
index 24342112cd1d..832c5b8bb8a8 100644
--- a/drivers/usb/host/xhci-mtk.c
+++ b/drivers/usb/host/xhci-mtk.c
@@ -689,14 +689,12 @@ static const struct dev_pm_ops xhci_mtk_pm_ops = {
};
#define DEV_PM_OPS IS_ENABLED(CONFIG_PM) ? &xhci_mtk_pm_ops : NULL

-#ifdef CONFIG_OF
static const struct of_device_id mtk_xhci_of_match[] = {
{ .compatible = "mediatek,mt8173-xhci"},
{ .compatible = "mediatek,mtk-xhci"},
{ },
};
MODULE_DEVICE_TABLE(of, mtk_xhci_of_match);
-#endif

static struct platform_driver mtk_xhci_driver = {
.probe = xhci_mtk_probe,
@@ -704,7 +702,7 @@ static struct platform_driver mtk_xhci_driver = {
.driver = {
.name = "xhci-mtk",
.pm = DEV_PM_OPS,
- .of_match_table = of_match_ptr(mtk_xhci_of_match),
+ .of_match_table = mtk_xhci_of_match,
},
};
MODULE_ALIAS("platform:xhci-mtk");
--
2.18.0

2021-03-23 07:07:13

by Chunfeng Yun

[permalink] [raw]
Subject: [PATCH v2 07/13] usb: xhci-mtk: add support ip-sleep wakeup for mT8192

Add support ip-sleep wakeup for mT8192, it's a specific revision,
and not following IPM rule.

Signed-off-by: Chunfeng Yun <[email protected]>
---
v2:
1. fix typo suggested by Sergei
2. modify revision format
---
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 ef2c74281ab4..24342112cd1d 100644
--- a/drivers/usb/host/xhci-mtk.c
+++ b/drivers/usb/host/xhci-mtk.c
@@ -70,6 +70,10 @@
#define WC0_IS_P BIT(12) /* polarity */
#define WC0_IS_EN BIT(6)

+/* mt8192 */
+#define WC0_SSUSB0_CDEN BIT(6)
+#define WC0_IS_SPM_EN BIT(1)
+
/* mt2712 etc */
#define PERI_SSUSB_SPM_CTRL 0x0
#define SSC_IP_SLEEP_EN BIT(4)
@@ -79,6 +83,7 @@ enum ssusb_uwk_vers {
SSUSB_UWK_V1 = 1,
SSUSB_UWK_V2,
SSUSB_UWK_V1_1 = 101, /* specific revision 1.01 */
+ SSUSB_UWK_V1_2, /* specific revision 1.2 */
};

static int xhci_mtk_host_enable(struct xhci_hcd_mtk *mtk)
@@ -313,6 +318,11 @@ static void usb_wakeup_ip_sleep_set(struct xhci_hcd_mtk *mtk, bool enable)
msk = WC0_IS_EN | WC0_IS_C(0xf) | WC0_IS_P;
val = enable ? (WC0_IS_EN | WC0_IS_C(0x8)) : 0;
break;
+ case SSUSB_UWK_V1_2:
+ reg = mtk->uwk_reg_base + PERI_WK_CTRL0;
+ msk = WC0_SSUSB0_CDEN | WC0_IS_SPM_EN;
+ 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.18.0

2021-03-23 07:08:26

by Chunfeng Yun

[permalink] [raw]
Subject: [PATCH v2 12/13] usb: mtu3: drop CONFIG_OF

The driver can match only the devices created by the OF core
via the DT table, so the table should be always used.

Signed-off-by: Chunfeng Yun <[email protected]>
---
v2: no changes
---
drivers/usb/mtu3/mtu3_plat.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/usb/mtu3/mtu3_plat.c b/drivers/usb/mtu3/mtu3_plat.c
index d44d5417438d..7786a95a874e 100644
--- a/drivers/usb/mtu3/mtu3_plat.c
+++ b/drivers/usb/mtu3/mtu3_plat.c
@@ -502,25 +502,20 @@ static const struct dev_pm_ops mtu3_pm_ops = {

#define DEV_PM_OPS (IS_ENABLED(CONFIG_PM) ? &mtu3_pm_ops : NULL)

-#ifdef CONFIG_OF
-
static const struct of_device_id mtu3_of_match[] = {
{.compatible = "mediatek,mt8173-mtu3",},
{.compatible = "mediatek,mtu3",},
{},
};
-
MODULE_DEVICE_TABLE(of, mtu3_of_match);

-#endif
-
static struct platform_driver mtu3_driver = {
.probe = mtu3_probe,
.remove = mtu3_remove,
.driver = {
.name = MTU3_DRIVER_NAME,
.pm = DEV_PM_OPS,
- .of_match_table = of_match_ptr(mtu3_of_match),
+ .of_match_table = mtu3_of_match,
},
};
module_platform_driver(mtu3_driver);
--
2.18.0

2021-03-23 07:08:42

by Chunfeng Yun

[permalink] [raw]
Subject: [PATCH v2 06/13] usb: xhci-mtk: support ip-sleep wakeup for MT8183

Add support ip-sleep wakeup for MT8183, it's similar to MT8173,
and it's also a specific one, but not following IPM rule.
Due to the index 2 already used by many DTS, it's better to keep
it unchanged for backward compatibility, treat specific ones without
following IPM rule as revision 1.x, meanwhile reserve 3~10 for
later revision that follows the IPM rule.

Signed-off-by: Chunfeng Yun <[email protected]>
---
v2:
1. fix typo suggested by Sergei
2. fix build warning - Woverflow
3. modify revision format
---
drivers/usb/host/xhci-mtk.c | 13 +++++++++++++
1 file changed, 13 insertions(+)

diff --git a/drivers/usb/host/xhci-mtk.c b/drivers/usb/host/xhci-mtk.c
index 09f2ddbfe8b9..ef2c74281ab4 100644
--- a/drivers/usb/host/xhci-mtk.c
+++ b/drivers/usb/host/xhci-mtk.c
@@ -57,12 +57,19 @@
#define CTRL_U2_FORCE_PLL_STB BIT(28)

/* usb remote wakeup registers in syscon */
+
/* mt8173 etc */
#define PERI_WK_CTRL1 0x4
#define WC1_IS_C(x) (((x) & 0xf) << 26) /* cycle debounce */
#define WC1_IS_EN BIT(25)
#define WC1_IS_P BIT(6) /* polarity for ip sleep */

+/* mt8183 */
+#define PERI_WK_CTRL0 0x0
+#define WC0_IS_C(x) ((u32)(((x) & 0xf) << 28)) /* cycle debounce */
+#define WC0_IS_P BIT(12) /* polarity */
+#define WC0_IS_EN BIT(6)
+
/* mt2712 etc */
#define PERI_SSUSB_SPM_CTRL 0x0
#define SSC_IP_SLEEP_EN BIT(4)
@@ -71,6 +78,7 @@
enum ssusb_uwk_vers {
SSUSB_UWK_V1 = 1,
SSUSB_UWK_V2,
+ SSUSB_UWK_V1_1 = 101, /* specific revision 1.01 */
};

static int xhci_mtk_host_enable(struct xhci_hcd_mtk *mtk)
@@ -300,6 +308,11 @@ static void usb_wakeup_ip_sleep_set(struct xhci_hcd_mtk *mtk, bool enable)
msk = WC1_IS_EN | WC1_IS_C(0xf) | WC1_IS_P;
val = enable ? (WC1_IS_EN | WC1_IS_C(0x8)) : 0;
break;
+ case SSUSB_UWK_V1_1:
+ reg = mtk->uwk_reg_base + PERI_WK_CTRL0;
+ msk = WC0_IS_EN | WC0_IS_C(0xf) | WC0_IS_P;
+ val = enable ? (WC0_IS_EN | WC0_IS_C(0x8)) : 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.18.0

2021-03-23 09:09:04

by Sergei Shtylyov

[permalink] [raw]
Subject: Re: [PATCH v2 01/13] dt-bindings: usb: mtk-xhci: support property usb2-lpm-disable

Hello!

On 23.03.2021 10:02, Chunfeng Yun wrote:

> Add support common property usb2-lpm-disable
^ for

> Signed-off-by: Chunfeng Yun <[email protected]>
[...]

MBR, Sergei

2021-03-27 17:26:38

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [PATCH v2 01/13] dt-bindings: usb: mtk-xhci: support property usb2-lpm-disable

On Tue, Mar 23, 2021 at 03:02:43PM +0800, Chunfeng Yun wrote:
> Add support common property usb2-lpm-disable
>
> Signed-off-by: Chunfeng Yun <[email protected]>
> ---
> v2: no changes
> ---
> Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml b/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml
> index 14f40efb3b22..2246d29a5e4e 100644
> --- a/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml
> +++ b/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml
> @@ -103,6 +103,10 @@ properties:
> description: supports USB3.0 LPM
> type: boolean
>
> + usb2-lpm-disable:
> + description: disable USB2 HW LPM
> + type: boolean

Already has a type. Don't redefine here. Just 'usb2-lpm-disable: true'
and make sure usb-xhci.yaml is referenced.

> +
> imod-interval-ns:
> description:
> Interrupt moderation interval value, it is 8 times as much as that
> --
> 2.18.0
>

2021-03-27 17:30:29

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [PATCH v2 03/13] dt-bindings: usb: mtu3: support wakeup for mt8183 and mt8192

On Tue, 23 Mar 2021 15:02:45 +0800, Chunfeng Yun wrote:
> These two HW of wakeup don't follow MediaTek internal IPM rule,
> and both use a specific way, like as early revision of mt8173.
>
> Due to the index 2 already used by many DTS, it's better to keep
> it unchanged for backward compatibility, treat specific ones without
> following IPM rule as revision 1.x, meanwhile reserve 3~99 for
> later revision that following the IPM rule.
>
> Signed-off-by: Chunfeng Yun <[email protected]>
> ---
> v2: modify revision format
> ---
> .../devicetree/bindings/usb/mediatek,mtu3.yaml | 10 +++++++---
> 1 file changed, 7 insertions(+), 3 deletions(-)
>

Reviewed-by: Rob Herring <[email protected]>

2021-03-29 03:11:45

by Chunfeng Yun

[permalink] [raw]
Subject: Re: [PATCH v2 01/13] dt-bindings: usb: mtk-xhci: support property usb2-lpm-disable

On Sat, 2021-03-27 at 11:24 -0600, Rob Herring wrote:
> On Tue, Mar 23, 2021 at 03:02:43PM +0800, Chunfeng Yun wrote:
> > Add support common property usb2-lpm-disable
> >
> > Signed-off-by: Chunfeng Yun <[email protected]>
> > ---
> > v2: no changes
> > ---
> > Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml | 4 ++++
> > 1 file changed, 4 insertions(+)
> >
> > diff --git a/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml b/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml
> > index 14f40efb3b22..2246d29a5e4e 100644
> > --- a/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml
> > +++ b/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.yaml
> > @@ -103,6 +103,10 @@ properties:
> > description: supports USB3.0 LPM
> > type: boolean
> >
> > + usb2-lpm-disable:
> > + description: disable USB2 HW LPM
> > + type: boolean
>
> Already has a type. Don't redefine here. Just 'usb2-lpm-disable: true'
> and make sure usb-xhci.yaml is referenced.
Ok, thanks
>
> > +
> > imod-interval-ns:
> > description:
> > Interrupt moderation interval value, it is 8 times as much as that
> > --
> > 2.18.0
> >

2021-03-29 11:27:05

by Matthias Brugger

[permalink] [raw]
Subject: Re: [PATCH v2 13/13] arm64: dts: mt8183: update wakeup register offset



On 23/03/2021 08:02, Chunfeng Yun wrote:
> Use wakeup control register offset exactly, and update revision
> number
>
> Signed-off-by: Chunfeng Yun <[email protected]>
> ---
> v2: modify revision format
> ---
> arch/arm64/boot/dts/mediatek/mt8183.dtsi | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/arm64/boot/dts/mediatek/mt8183.dtsi b/arch/arm64/boot/dts/mediatek/mt8183.dtsi
> index 80519a145f13..9ea84d636556 100644
> --- a/arch/arm64/boot/dts/mediatek/mt8183.dtsi
> +++ b/arch/arm64/boot/dts/mediatek/mt8183.dtsi
> @@ -874,7 +874,7 @@
> clocks = <&infracfg CLK_INFRA_UNIPRO_SCK>,
> <&infracfg CLK_INFRA_USB>;
> clock-names = "sys_ck", "ref_ck";
> - mediatek,syscon-wakeup = <&pericfg 0x400 0>;
> + mediatek,syscon-wakeup = <&pericfg 0x420 101>;

applied to v5.12-next/dts64

Thanks

> #address-cells = <2>;
> #size-cells = <2>;
> ranges;
>