From patchwork Wed Aug 28 07:34:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?Q2h1bmZlbmcgWXVuICjkupHmmKXls7Ap?= X-Patchwork-Id: 11118049 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C5B6913B1 for ; Wed, 28 Aug 2019 07:35:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A7AF7233A1 for ; Wed, 28 Aug 2019 07:35:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726454AbfH1He7 (ORCPT ); Wed, 28 Aug 2019 03:34:59 -0400 Received: from Mailgw01.mediatek.com ([1.203.163.78]:53342 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726397AbfH1He7 (ORCPT ); Wed, 28 Aug 2019 03:34:59 -0400 X-UUID: 638168f7de3041aca607c8e381ca67b7-20190828 X-UUID: 638168f7de3041aca607c8e381ca67b7-20190828 Received: from mtkcas32.mediatek.inc [(172.27.4.253)] by mailgw01.mediatek.com (envelope-from ) (mailgw01.mediatek.com ESMTP with TLS) with ESMTP id 1720530424; Wed, 28 Aug 2019 15:34:41 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by MTKMBS31DR.mediatek.inc (172.27.6.102) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Wed, 28 Aug 2019 15:34:42 +0800 Received: from localhost.localdomain (10.17.3.153) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Wed, 28 Aug 2019 15:34:41 +0800 From: Chunfeng Yun To: Greg Kroah-Hartman , Rob Herring CC: Mark Rutland , Matthias Brugger , Mathias Nyman , Chunfeng Yun , , , , , Subject: [PATCH v2 1/7] dt-bindings: usb: mtu3: support USB wakeup for MT8183 Date: Wed, 28 Aug 2019 15:34:25 +0800 Message-ID: <1566977671-22191-2-git-send-email-chunfeng.yun@mediatek.com> X-Mailer: git-send-email 1.8.1.1.dirty In-Reply-To: <1566977671-22191-1-git-send-email-chunfeng.yun@mediatek.com> References: <1566977671-22191-1-git-send-email-chunfeng.yun@mediatek.com> MIME-Version: 1.0 X-TM-SNTS-SMTP: 208BA8BCFEDE1CBD161026543F25E0DA2D57AAD24C203025BB8A003AE7FB85082000:8 X-MTK: N Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Support USB wakeup by ip-sleep mode for MT8183 Signed-off-by: Chunfeng Yun --- v2: no changes --- Documentation/devicetree/bindings/usb/mediatek,mtu3.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/usb/mediatek,mtu3.txt b/Documentation/devicetree/bindings/usb/mediatek,mtu3.txt index 3382b5cb471d..ed954bedcd2f 100644 --- a/Documentation/devicetree/bindings/usb/mediatek,mtu3.txt +++ b/Documentation/devicetree/bindings/usb/mediatek,mtu3.txt @@ -48,6 +48,7 @@ Optional properties: "wakeup-source", and has two arguments: - the first one : register base address of the glue layer in syscon; - the second one : hardware version of the glue layer + - 0 : used by mt8183 etc - 1 : used by mt8173 etc - 2 : used by mt2712 etc - mediatek,u3p-dis-msk : mask to disable u3ports, bit0 for u3port0, From patchwork Wed Aug 28 07:34:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?Q2h1bmZlbmcgWXVuICjkupHmmKXls7Ap?= X-Patchwork-Id: 11118041 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6351D13B1 for ; Wed, 28 Aug 2019 07:34:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4D86A2189D for ; Wed, 28 Aug 2019 07:34:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726439AbfH1Hev (ORCPT ); Wed, 28 Aug 2019 03:34:51 -0400 Received: from mailgw02.mediatek.com ([1.203.163.81]:41803 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726341AbfH1Hev (ORCPT ); Wed, 28 Aug 2019 03:34:51 -0400 X-UUID: a9f024a4eade4060b192299bafd224ce-20190828 X-UUID: a9f024a4eade4060b192299bafd224ce-20190828 Received: from mtkcas36.mediatek.inc [(172.27.4.253)] by mailgw02.mediatek.com (envelope-from ) (mailgw01.mediatek.com ESMTP with TLS) with ESMTP id 720177889; Wed, 28 Aug 2019 15:34:38 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by MTKMBS31N1.mediatek.inc (172.27.4.69) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Wed, 28 Aug 2019 15:34:43 +0800 Received: from localhost.localdomain (10.17.3.153) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Wed, 28 Aug 2019 15:34:42 +0800 From: Chunfeng Yun To: Greg Kroah-Hartman , Rob Herring CC: Mark Rutland , Matthias Brugger , Mathias Nyman , Chunfeng Yun , , , , , Subject: [PATCH v2 2/7] dt-bindings: usb: mtk-xhci: support USB wakeup for MT8183 Date: Wed, 28 Aug 2019 15:34:26 +0800 Message-ID: <1566977671-22191-3-git-send-email-chunfeng.yun@mediatek.com> X-Mailer: git-send-email 1.8.1.1.dirty In-Reply-To: <1566977671-22191-1-git-send-email-chunfeng.yun@mediatek.com> References: <1566977671-22191-1-git-send-email-chunfeng.yun@mediatek.com> MIME-Version: 1.0 X-TM-SNTS-SMTP: 4439CDF3D4D595987813F254181810B9A41149B17B2F03E36F015F0A849F2EED2000:8 X-MTK: N Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Support USB wakeup by ip-sleep mode for MT8183 Signed-off-by: Chunfeng Yun --- v2: no changes --- Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.txt b/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.txt index 266c2d917a28..9a0a9eb0456f 100644 --- a/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.txt +++ b/Documentation/devicetree/bindings/usb/mediatek,mtk-xhci.txt @@ -41,6 +41,7 @@ Optional properties: "wakeup-source", and has two arguments: - the first one : register base address of the glue layer in syscon; - the second one : hardware version of the glue layer + - 0 : used by mt8183 etc - 1 : used by mt8173 etc - 2 : used by mt2712 etc - mediatek,u3p-dis-msk : mask to disable u3ports, bit0 for u3port0, From patchwork Wed Aug 28 07:34:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?Q2h1bmZlbmcgWXVuICjkupHmmKXls7Ap?= X-Patchwork-Id: 11118057 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E891613B1 for ; Wed, 28 Aug 2019 07:35:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D38E42339E for ; Wed, 28 Aug 2019 07:35:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726827AbfH1Hfe (ORCPT ); Wed, 28 Aug 2019 03:35:34 -0400 Received: from mailgw02.mediatek.com ([1.203.163.81]:16773 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726394AbfH1Hfd (ORCPT ); Wed, 28 Aug 2019 03:35:33 -0400 X-UUID: dfd3046cced040ecb031fcf1603c09fb-20190828 X-UUID: dfd3046cced040ecb031fcf1603c09fb-20190828 Received: from mtkcas36.mediatek.inc [(172.27.4.253)] by mailgw02.mediatek.com (envelope-from ) (mailgw01.mediatek.com ESMTP with TLS) with ESMTP id 603457158; Wed, 28 Aug 2019 15:34:38 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by MTKMBS31N1.mediatek.inc (172.27.4.69) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Wed, 28 Aug 2019 15:34:44 +0800 Received: from localhost.localdomain (10.17.3.153) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Wed, 28 Aug 2019 15:34:43 +0800 From: Chunfeng Yun To: Greg Kroah-Hartman , Rob Herring CC: Mark Rutland , Matthias Brugger , Mathias Nyman , Chunfeng Yun , , , , , Subject: [PATCH v2 3/7] usb: mtu3: support ip-sleep wakeup for MT8183 Date: Wed, 28 Aug 2019 15:34:27 +0800 Message-ID: <1566977671-22191-4-git-send-email-chunfeng.yun@mediatek.com> X-Mailer: git-send-email 1.8.1.1.dirty In-Reply-To: <1566977671-22191-1-git-send-email-chunfeng.yun@mediatek.com> References: <1566977671-22191-1-git-send-email-chunfeng.yun@mediatek.com> MIME-Version: 1.0 X-TM-SNTS-SMTP: A93D25B7752DFCCAA1E313424F326E5427E061F3DAD0B9FAF1BE8E3BFD18DB442000:8 X-MTK: N Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Support USB wakeup by ip-sleep mode for MT8183, it's similar to MT8173 Signed-off-by: Chunfeng Yun --- v2: no changes --- drivers/usb/mtu3/mtu3_host.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/usb/mtu3/mtu3_host.c b/drivers/usb/mtu3/mtu3_host.c index c871b94f3e6f..001b17aeb1eb 100644 --- a/drivers/usb/mtu3/mtu3_host.c +++ b/drivers/usb/mtu3/mtu3_host.c @@ -18,6 +18,12 @@ #include "mtu3.h" #include "mtu3_dr.h" +/* mt8183 etc */ +#define PERI_WK_CTRL0 0x20 +#define WC0_IS_C(x) (((x) & 0xf) << 28) /* cycle debounce */ +#define WC0_IS_EN BIT(12) +#define WC0_IS_P BIT(6) /* polarity for ip sleep */ + /* mt8173 etc */ #define PERI_WK_CTRL1 0x4 #define WC1_IS_C(x) (((x) & 0xf) << 26) /* cycle debounce */ @@ -30,7 +36,8 @@ #define SSC_SPM_INT_EN BIT(1) enum ssusb_uwk_vers { - SSUSB_UWK_V1 = 1, + SSUSB_UWK_V0 = 0, + SSUSB_UWK_V1, SSUSB_UWK_V2, }; @@ -43,6 +50,11 @@ static void ssusb_wakeup_ip_sleep_set(struct ssusb_mtk *ssusb, bool enable) u32 reg, msk, val; switch (ssusb->uwk_vers) { + case SSUSB_UWK_V0: + 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_V1: reg = ssusb->uwk_reg_base + PERI_WK_CTRL1; msk = WC1_IS_EN | WC1_IS_C(0xf) | WC1_IS_P; From patchwork Wed Aug 28 07:34:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?Q2h1bmZlbmcgWXVuICjkupHmmKXls7Ap?= X-Patchwork-Id: 11118053 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9C88418B7 for ; Wed, 28 Aug 2019 07:35:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8806522CF8 for ; Wed, 28 Aug 2019 07:35:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726436AbfH1HfT (ORCPT ); Wed, 28 Aug 2019 03:35:19 -0400 Received: from mailgw02.mediatek.com ([1.203.163.81]:45153 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726395AbfH1HfT (ORCPT ); Wed, 28 Aug 2019 03:35:19 -0400 X-UUID: 9b742425ff6241cd89ad9afadc695588-20190828 X-UUID: 9b742425ff6241cd89ad9afadc695588-20190828 Received: from mtkcas34.mediatek.inc [(172.27.4.253)] by mailgw02.mediatek.com (envelope-from ) (mailgw01.mediatek.com ESMTP with TLS) with ESMTP id 1884125678; Wed, 28 Aug 2019 15:34:40 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by MTKMBS31N1.mediatek.inc (172.27.4.69) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Wed, 28 Aug 2019 15:34:45 +0800 Received: from localhost.localdomain (10.17.3.153) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Wed, 28 Aug 2019 15:34:44 +0800 From: Chunfeng Yun To: Greg Kroah-Hartman , Rob Herring CC: Mark Rutland , Matthias Brugger , Mathias Nyman , Chunfeng Yun , , , , , Subject: [PATCH v2 4/7] usb: mtk-xhci: support ip-sleep wakeup for MT8183 Date: Wed, 28 Aug 2019 15:34:28 +0800 Message-ID: <1566977671-22191-5-git-send-email-chunfeng.yun@mediatek.com> X-Mailer: git-send-email 1.8.1.1.dirty In-Reply-To: <1566977671-22191-1-git-send-email-chunfeng.yun@mediatek.com> References: <1566977671-22191-1-git-send-email-chunfeng.yun@mediatek.com> MIME-Version: 1.0 X-TM-SNTS-SMTP: 3E76496D948A34D0FB0F9D8D4E935CFC13EE2BE8EA6B56F920518B44536F2D7B2000:8 X-MTK: N Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Support USB wakeup by ip-sleep mode for MT8183, it's similar to MT8173 Signed-off-by: Chunfeng Yun Acked-by: Mathias Nyman --- v2: no changes --- drivers/usb/host/xhci-mtk.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/usb/host/xhci-mtk.c b/drivers/usb/host/xhci-mtk.c index 026fe18972d3..4b59f2978954 100644 --- a/drivers/usb/host/xhci-mtk.c +++ b/drivers/usb/host/xhci-mtk.c @@ -57,6 +57,12 @@ #define CTRL_U2_FORCE_PLL_STB BIT(28) /* usb remote wakeup registers in syscon */ +/* mt8183 etc */ +#define PERI_WK_CTRL0 0x20 +#define WC0_IS_C(x) (((x) & 0xf) << 28) /* cycle debounce */ +#define WC0_IS_EN BIT(12) +#define WC0_IS_P BIT(6) /* polarity for ip sleep */ + /* mt8173 etc */ #define PERI_WK_CTRL1 0x4 #define WC1_IS_C(x) (((x) & 0xf) << 26) /* cycle debounce */ @@ -69,7 +75,8 @@ #define SSC_SPM_INT_EN BIT(1) enum ssusb_uwk_vers { - SSUSB_UWK_V1 = 1, + SSUSB_UWK_V0 = 0, + SSUSB_UWK_V1, SSUSB_UWK_V2, }; @@ -282,6 +289,11 @@ static void usb_wakeup_ip_sleep_set(struct xhci_hcd_mtk *mtk, bool enable) u32 reg, msk, val; switch (mtk->uwk_vers) { + case SSUSB_UWK_V0: + 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_V1: reg = mtk->uwk_reg_base + PERI_WK_CTRL1; msk = WC1_IS_EN | WC1_IS_C(0xf) | WC1_IS_P; From patchwork Wed Aug 28 07:34:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?Q2h1bmZlbmcgWXVuICjkupHmmKXls7Ap?= X-Patchwork-Id: 11118047 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EBBCF16B1 for ; Wed, 28 Aug 2019 07:35:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D62E72189D for ; Wed, 28 Aug 2019 07:35:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726592AbfH1HfB (ORCPT ); Wed, 28 Aug 2019 03:35:01 -0400 Received: from mailgw02.mediatek.com ([1.203.163.81]:60750 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726399AbfH1HfA (ORCPT ); Wed, 28 Aug 2019 03:35:00 -0400 X-UUID: bdc6a124f8ff4b929faf6b8a46b0f3b0-20190828 X-UUID: bdc6a124f8ff4b929faf6b8a46b0f3b0-20190828 Received: from mtkcas34.mediatek.inc [(172.27.4.253)] by mailgw02.mediatek.com (envelope-from ) (mailgw01.mediatek.com ESMTP with TLS) with ESMTP id 627355585; Wed, 28 Aug 2019 15:34:40 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by MTKMBS31N1.mediatek.inc (172.27.4.69) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Wed, 28 Aug 2019 15:34:46 +0800 Received: from localhost.localdomain (10.17.3.153) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Wed, 28 Aug 2019 15:34:45 +0800 From: Chunfeng Yun To: Greg Kroah-Hartman , Rob Herring CC: Mark Rutland , Matthias Brugger , Mathias Nyman , Chunfeng Yun , , , , , Subject: [PATCH v2 5/7] arm64: dts: mt8183: add usb and phy nodes Date: Wed, 28 Aug 2019 15:34:29 +0800 Message-ID: <1566977671-22191-6-git-send-email-chunfeng.yun@mediatek.com> X-Mailer: git-send-email 1.8.1.1.dirty In-Reply-To: <1566977671-22191-1-git-send-email-chunfeng.yun@mediatek.com> References: <1566977671-22191-1-git-send-email-chunfeng.yun@mediatek.com> MIME-Version: 1.0 X-TM-SNTS-SMTP: C2202A2ACE133EBAA9C1278064E4172904F83763A585DA09B1DD051FC59BA4DF2000:8 X-MTK: N Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Add USB related nodes for MT8183, set it as host mode by default. Signed-off-by: Chunfeng Yun --- v2: no changes --- arch/arm64/boot/dts/mediatek/mt8183-evb.dts | 22 +++++++++ arch/arm64/boot/dts/mediatek/mt8183.dtsi | 55 +++++++++++++++++++++ 2 files changed, 77 insertions(+) diff --git a/arch/arm64/boot/dts/mediatek/mt8183-evb.dts b/arch/arm64/boot/dts/mediatek/mt8183-evb.dts index d8e555cbb5d3..142ff52f0f42 100644 --- a/arch/arm64/boot/dts/mediatek/mt8183-evb.dts +++ b/arch/arm64/boot/dts/mediatek/mt8183-evb.dts @@ -6,7 +6,9 @@ */ /dts-v1/; +#include #include "mt8183.dtsi" +#include "mt6358.dtsi" / { model = "MediaTek MT8183 evaluation board"; @@ -24,6 +26,16 @@ chosen { stdout-path = "serial0:921600n8"; }; + + usb_vbus: regulator@0 { + compatible = "regulator-fixed"; + regulator-name = "p0_vbus"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + gpio = <&pio 42 GPIO_ACTIVE_HIGH>; + enable-active-high; + regulator-always-on; + }; }; &auxadc { @@ -135,6 +147,16 @@ }; +&ssusb { + vusb33-supply = <&mt6358_vusb_reg>; + dr_mode = "host"; + status = "okay"; +}; + +&usb_host { + status = "okay"; +}; + &uart0 { status = "okay"; }; diff --git a/arch/arm64/boot/dts/mediatek/mt8183.dtsi b/arch/arm64/boot/dts/mediatek/mt8183.dtsi index c2749c4631bc..28da334237c6 100644 --- a/arch/arm64/boot/dts/mediatek/mt8183.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt8183.dtsi @@ -8,6 +8,7 @@ #include #include #include +#include #include "mt8183-pinfunc.h" / { @@ -372,6 +373,35 @@ status = "disabled"; }; + ssusb: usb@11201000 { + compatible = "mediatek,mt8183-mtu3", "mediatek,mtu3"; + reg = <0 0x11201000 0 0x2e00>, + <0 0x11203e00 0 0x0100>; + reg-names = "mac", "ippc"; + interrupts = ; + phys = <&u2port0 PHY_TYPE_USB2>, + <&u3port0 PHY_TYPE_USB3>; + clocks = <&infracfg CLK_INFRA_UNIPRO_SCK>, + <&infracfg CLK_INFRA_USB>; + clock-names = "sys_ck", "ref_ck"; + #address-cells = <2>; + #size-cells = <2>; + ranges; + status = "disabled"; + + usb_host: xhci@11200000 { + compatible = "mediatek,mt8183-xhci", + "mediatek,mtk-xhci"; + reg = <0 0x11200000 0 0x1000>; + reg-names = "mac"; + interrupts = ; + clocks = <&infracfg CLK_INFRA_UNIPRO_SCK>, + <&infracfg CLK_INFRA_USB>; + clock-names = "sys_ck", "ref_ck"; + status = "disabled"; + }; + }; + audiosys: syscon@11220000 { compatible = "mediatek,mt8183-audiosys", "syscon"; reg = <0 0x11220000 0 0x1000>; @@ -384,6 +414,31 @@ reg = <0 0x11f10000 0 0x1000>; }; + u3phy: usb-phy@11f40000 { + compatible = "mediatek,mt8183-tphy", + "mediatek,generic-tphy-v2"; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 0 0x11f40000 0x1000>; + status = "okay"; + + u2port0: usb-phy@0 { + reg = <0x0 0x700>; + clocks = <&clk26m>; + clock-names = "ref"; + #phy-cells = <1>; + status = "okay"; + }; + + u3port0: usb-phy@0700 { + reg = <0x0700 0x900>; + clocks = <&clk26m>; + clock-names = "ref"; + #phy-cells = <1>; + status = "okay"; + }; + }; + mfgcfg: syscon@13000000 { compatible = "mediatek,mt8183-mfgcfg", "syscon"; reg = <0 0x13000000 0 0x1000>; From patchwork Wed Aug 28 07:34:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?Q2h1bmZlbmcgWXVuICjkupHmmKXls7Ap?= X-Patchwork-Id: 11118055 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1768C13B1 for ; Wed, 28 Aug 2019 07:35:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 02B502189D for ; Wed, 28 Aug 2019 07:35:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726775AbfH1Hf0 (ORCPT ); Wed, 28 Aug 2019 03:35:26 -0400 Received: from mailgw02.mediatek.com ([1.203.163.81]:30192 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726341AbfH1Hf0 (ORCPT ); Wed, 28 Aug 2019 03:35:26 -0400 X-UUID: cdcabb9fb01c4363ab5bde0c08546f09-20190828 X-UUID: cdcabb9fb01c4363ab5bde0c08546f09-20190828 Received: from mtkcas32.mediatek.inc [(172.27.4.253)] by mailgw02.mediatek.com (envelope-from ) (mailgw01.mediatek.com ESMTP with TLS) with ESMTP id 1331790739; Wed, 28 Aug 2019 15:34:45 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by MTKMBS31N2.mediatek.inc (172.27.4.87) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Wed, 28 Aug 2019 15:34:47 +0800 Received: from localhost.localdomain (10.17.3.153) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Wed, 28 Aug 2019 15:34:47 +0800 From: Chunfeng Yun To: Greg Kroah-Hartman , Rob Herring CC: Mark Rutland , Matthias Brugger , Mathias Nyman , Chunfeng Yun , , , , , Subject: [PATCH v2 6/7] arm64: dts: mt8183: enable USB remote wakeup Date: Wed, 28 Aug 2019 15:34:30 +0800 Message-ID: <1566977671-22191-7-git-send-email-chunfeng.yun@mediatek.com> X-Mailer: git-send-email 1.8.1.1.dirty In-Reply-To: <1566977671-22191-1-git-send-email-chunfeng.yun@mediatek.com> References: <1566977671-22191-1-git-send-email-chunfeng.yun@mediatek.com> MIME-Version: 1.0 X-TM-SNTS-SMTP: E3F177876D8E668AC2BF6B284E95ED231091A9C129078D527649E7B86BDE2F222000:8 X-MTK: N Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Enable USB remote wakeup for MT8183 Signed-off-by: Chunfeng Yun --- v2: no changes --- arch/arm64/boot/dts/mediatek/mt8183-evb.dts | 1 + arch/arm64/boot/dts/mediatek/mt8183.dtsi | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/arch/arm64/boot/dts/mediatek/mt8183-evb.dts b/arch/arm64/boot/dts/mediatek/mt8183-evb.dts index 142ff52f0f42..077256f3397b 100644 --- a/arch/arm64/boot/dts/mediatek/mt8183-evb.dts +++ b/arch/arm64/boot/dts/mediatek/mt8183-evb.dts @@ -150,6 +150,7 @@ &ssusb { vusb33-supply = <&mt6358_vusb_reg>; dr_mode = "host"; + wakeup-source; status = "okay"; }; diff --git a/arch/arm64/boot/dts/mediatek/mt8183.dtsi b/arch/arm64/boot/dts/mediatek/mt8183.dtsi index 28da334237c6..c20cc0e8c2b4 100644 --- a/arch/arm64/boot/dts/mediatek/mt8183.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt8183.dtsi @@ -215,6 +215,13 @@ #clock-cells = <1>; }; + pericfg: syscon@10003000 { + compatible = "mediatek,mt8183-pericfg", "syscon"; + reg = <0 0x10003000 0 0x1000>; + #clock-cells = <1>; + #reset-cells = <1>; + }; + pio: pinctrl@10005000 { compatible = "mediatek,mt8183-pinctrl"; reg = <0 0x10005000 0 0x1000>, @@ -384,6 +391,7 @@ clocks = <&infracfg CLK_INFRA_UNIPRO_SCK>, <&infracfg CLK_INFRA_USB>; clock-names = "sys_ck", "ref_ck"; + mediatek,syscon-wakeup = <&pericfg 0x400 0>; #address-cells = <2>; #size-cells = <2>; ranges; From patchwork Wed Aug 28 07:34:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?Q2h1bmZlbmcgWXVuICjkupHmmKXls7Ap?= X-Patchwork-Id: 11118043 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1C39413B1 for ; Wed, 28 Aug 2019 07:35:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 052BA2189D for ; Wed, 28 Aug 2019 07:35:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726691AbfH1HfD (ORCPT ); Wed, 28 Aug 2019 03:35:03 -0400 Received: from mailgw02.mediatek.com ([1.203.163.81]:3427 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726408AbfH1HfC (ORCPT ); Wed, 28 Aug 2019 03:35:02 -0400 X-UUID: bfeccd8ce5a842e4bc0666dcabe35438-20190828 X-UUID: bfeccd8ce5a842e4bc0666dcabe35438-20190828 Received: from mtkcas36.mediatek.inc [(172.27.4.253)] by mailgw02.mediatek.com (envelope-from ) (mailgw01.mediatek.com ESMTP with TLS) with ESMTP id 648055607; Wed, 28 Aug 2019 15:34:44 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by MTKMBS31DR.mediatek.inc (172.27.6.102) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Wed, 28 Aug 2019 15:34:48 +0800 Received: from localhost.localdomain (10.17.3.153) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Wed, 28 Aug 2019 15:34:48 +0800 From: Chunfeng Yun To: Greg Kroah-Hartman , Rob Herring CC: Mark Rutland , Matthias Brugger , Mathias Nyman , Chunfeng Yun , , , , , Subject: [PATCH v2 7/7] arm64: dts: mt8183: tune disconnect threshold of u2phy Date: Wed, 28 Aug 2019 15:34:31 +0800 Message-ID: <1566977671-22191-8-git-send-email-chunfeng.yun@mediatek.com> X-Mailer: git-send-email 1.8.1.1.dirty In-Reply-To: <1566977671-22191-1-git-send-email-chunfeng.yun@mediatek.com> References: <1566977671-22191-1-git-send-email-chunfeng.yun@mediatek.com> MIME-Version: 1.0 X-TM-SNTS-SMTP: 5787E9730A8413291603EC2353E35BFB7BA89DA7287F447A1B1A7E92E04CFCE82000:8 X-MTK: N Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Set DISCTH to max-15, replace the default value 8, due to default disconnect threshold is lower than USB SPEC define Signed-off-by: Chunfeng Yun --- v2: new patch --- arch/arm64/boot/dts/mediatek/mt8183.dtsi | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/boot/dts/mediatek/mt8183.dtsi b/arch/arm64/boot/dts/mediatek/mt8183.dtsi index c20cc0e8c2b4..4f4d4a5ed422 100644 --- a/arch/arm64/boot/dts/mediatek/mt8183.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt8183.dtsi @@ -435,6 +435,7 @@ clocks = <&clk26m>; clock-names = "ref"; #phy-cells = <1>; + mediatek,discth = <15>; status = "okay"; };