From patchwork Sun Jun 30 16:01:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Kettenis X-Patchwork-Id: 1124932 X-Patchwork-Delegate: ykai007@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=openbsd.org Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45cFdR5qfcz9sBp for ; Mon, 1 Jul 2019 02:02:35 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 69EB1C21DFD; Sun, 30 Jun 2019 16:02:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id A34D5C21D56; Sun, 30 Jun 2019 16:02:07 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id E8483C21D56; Sun, 30 Jun 2019 16:02:05 +0000 (UTC) Received: from lb3-smtp-cloud9.xs4all.net (lb3-smtp-cloud9.xs4all.net [194.109.24.30]) by lists.denx.de (Postfix) with ESMTPS id 88FC8C21C27 for ; Sun, 30 Jun 2019 16:02:05 +0000 (UTC) Received: from barber.sibelius.xs4all.nl ([83.163.83.176]) by smtp-cloud9.xs4all.net with ESMTP id hcHChhlcYAOfNhcHEhina2; Sun, 30 Jun 2019 18:02:04 +0200 From: Mark Kettenis To: u-boot@lists.denx.de Date: Sun, 30 Jun 2019 18:01:53 +0200 Message-Id: <20190630160156.51934-2-kettenis@openbsd.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190630160156.51934-1-kettenis@openbsd.org> References: <20190630160156.51934-1-kettenis@openbsd.org> MIME-Version: 1.0 X-CMAE-Envelope: MS4wfLmEqKVrnQUzr99m+sewry4ejdvlsajihZ5fdwiyysrW7rHASkwT0EpvsDOXqW6cF7dQRh9fkLtTaJfdf4G0dKtcZjzy8i16ml/DtpRuO9PJFqcz0gBT 8elsIXsJQPTnECIi3VFXugCXTgv8xgf9nsYOGsNpMpAop2NQ0gD5nksNRwnypHXYRO0b9cbZq82nwtPShl36CmI5hfMTI+zBeEEVjesvYmW9K73GUT503U6P N/ohWQ8Ta35iWY0w5Rz2gMrBId0UTcIU4s5vRIp+cNmXPjnu09qT22WLAZcTT1PwhNb672Tji0a2TUU/zZkfVKI/ZmTvN6utmGPOx9GkOXPYpNJw2jzpwKhq aMYImgg7RpoqHrOttDtjtRD8sohh3w== Cc: Mark Kettenis Subject: [U-Boot] [PATCH v2 1/4] rockchip: clk: rk3399: handle clk_enable requests for USB3 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" The "simple" OF glue layer for the Designware USB3 core enables all refernced clocks. These need to be need to be implemented otherwise the driver fails to probe. A dummy implementation that simply returns success is sufficient since the RK3399 comes out of reset with all clock gates open. Signed-off-by: Mark Kettenis Reviewed-by: Kever Yang --- drivers/clk/rockchip/clk_rk3399.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/clk/rockchip/clk_rk3399.c b/drivers/clk/rockchip/clk_rk3399.c index 79007b8682..d9950c159b 100644 --- a/drivers/clk/rockchip/clk_rk3399.c +++ b/drivers/clk/rockchip/clk_rk3399.c @@ -1080,6 +1080,18 @@ static int rk3399_clk_enable(struct clk *clk) case PCLK_GMAC: /* Required to successfully probe the Designware GMAC driver */ return 0; + + case SCLK_USB3OTG0_REF: + case SCLK_USB3OTG1_REF: + case SCLK_USB3OTG0_SUSPEND: + case SCLK_USB3OTG1_SUSPEND: + case ACLK_USB3OTG0: + case ACLK_USB3OTG1: + case ACLK_USB3_RKSOC_AXI_PERF: + case ACLK_USB3: + case ACLK_USB3_GRF: + /* Required to successfully probe the Designware USB3 driver */ + return 0; } debug("%s: unsupported clk %ld\n", __func__, clk->id); From patchwork Sun Jun 30 16:01:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Kettenis X-Patchwork-Id: 1124933 X-Patchwork-Delegate: ykai007@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=openbsd.org Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45cFff0fKJz9sBp for ; Mon, 1 Jul 2019 02:03:37 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id B9E06C21E08; Sun, 30 Jun 2019 16:02:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 3FB43C21DE8; Sun, 30 Jun 2019 16:02:08 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 6525AC21D56; Sun, 30 Jun 2019 16:02:06 +0000 (UTC) Received: from lb3-smtp-cloud9.xs4all.net (lb3-smtp-cloud9.xs4all.net [194.109.24.30]) by lists.denx.de (Postfix) with ESMTPS id 1AF59C21C27 for ; Sun, 30 Jun 2019 16:02:06 +0000 (UTC) Received: from barber.sibelius.xs4all.nl ([83.163.83.176]) by smtp-cloud9.xs4all.net with ESMTP id hcHChhlcYAOfNhcHFhinaO; Sun, 30 Jun 2019 18:02:06 +0200 From: Mark Kettenis To: u-boot@lists.denx.de Date: Sun, 30 Jun 2019 18:01:54 +0200 Message-Id: <20190630160156.51934-3-kettenis@openbsd.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190630160156.51934-1-kettenis@openbsd.org> References: <20190630160156.51934-1-kettenis@openbsd.org> MIME-Version: 1.0 X-CMAE-Envelope: MS4wfKRPj13LkDsqDLlh3dPjepDM22UaNHBR/NtZWFq6HmRoAycq/QLfscmB7RQ6Qr1EzV6RrTtOvCYZiuXKQbTJzDBJd2l/C/wPc01PHXZYBVSolpSIx7Ly hMIN5wJInIHRjMUa8hqeaSNSBFz2GpCd4GNFk2Jv/DgHOiymkEftLBJQaPXPh0rdCGL8BGlEXKM1wseWX1aDf8efNApZ7outHAjzlrnS1hELt4c9zmfVQCMQ lLQCSp7/S40oWg5OqC4X+ShBDOf9hrWZAHsoVInsS+diZkcnbIo7vT3N6zADrDcZoVO1I4NDa9c/YcVbLDdJv9yoHVHjFSNI3i0gBRMmnctZfmlWaYN0IrLC 820zukHfOpaNEqKNAvPamCZLovpdOQ== Cc: Mark Kettenis Subject: [U-Boot] [PATCH v2 2/4] usb: dwc3-of-simple: Add support for RK3399 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Add compatible string for RK3399 and enable it by default on Rockchip platforms with USB3 support. Signed-off-by: Mark Kettenis Reviewed-by: Kever Yang --- drivers/usb/host/Kconfig | 1 + drivers/usb/host/dwc3-of-simple.c | 1 + 2 files changed, 2 insertions(+) diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig index b1188bcbf5..ac68aa2d27 100644 --- a/drivers/usb/host/Kconfig +++ b/drivers/usb/host/Kconfig @@ -24,6 +24,7 @@ config USB_XHCI_DWC3 config USB_XHCI_DWC3_OF_SIMPLE bool "DesignWare USB3 DRD Generic OF Simple Glue Layer" depends on DM_USB + default y if ARCH_ROCKCHIP default y if DRA7XX help Support USB2/3 functionality in simple SoC integrations with diff --git a/drivers/usb/host/dwc3-of-simple.c b/drivers/usb/host/dwc3-of-simple.c index b118997f6e..45df614b09 100644 --- a/drivers/usb/host/dwc3-of-simple.c +++ b/drivers/usb/host/dwc3-of-simple.c @@ -92,6 +92,7 @@ static int dwc3_of_simple_remove(struct udevice *dev) static const struct udevice_id dwc3_of_simple_ids[] = { { .compatible = "amlogic,meson-gxl-dwc3" }, + { .compatible = "rockchip,rk3399-dwc3" }, { .compatible = "ti,dwc3" }, { } }; From patchwork Sun Jun 30 16:01:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Kettenis X-Patchwork-Id: 1124934 X-Patchwork-Delegate: ykai007@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=openbsd.org Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45cFg20RQ2z9sBp for ; Mon, 1 Jul 2019 02:03:57 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id BB0E3C21D8E; Sun, 30 Jun 2019 16:02:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id D894FC21DC1; Sun, 30 Jun 2019 16:02:12 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 5461AC21C27; Sun, 30 Jun 2019 16:02:07 +0000 (UTC) Received: from lb2-smtp-cloud9.xs4all.net (lb2-smtp-cloud9.xs4all.net [194.109.24.26]) by lists.denx.de (Postfix) with ESMTPS id 05FE4C21C27 for ; Sun, 30 Jun 2019 16:02:07 +0000 (UTC) Received: from barber.sibelius.xs4all.nl ([83.163.83.176]) by smtp-cloud9.xs4all.net with ESMTP id hcHChhlcYAOfNhcHGhinal; Sun, 30 Jun 2019 18:02:07 +0200 From: Mark Kettenis To: u-boot@lists.denx.de Date: Sun, 30 Jun 2019 18:01:55 +0200 Message-Id: <20190630160156.51934-4-kettenis@openbsd.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190630160156.51934-1-kettenis@openbsd.org> References: <20190630160156.51934-1-kettenis@openbsd.org> MIME-Version: 1.0 X-CMAE-Envelope: MS4wfLs+8eVNa+4q5xvZxgD/7JFk5FDJvpyZbd3cSrXacdnFSq2kAy8QdBLQqG7pFgMwbbkh/zgisVHcqIrbLR4AS1bVVdY9OiI3glthx583ANub4fv/+FYG p2vXmJ/g7+CCFcVSIOoJhY+thnwEIzY6/Azt309X5FXHFUhNyCIBYgwmeyfWokqW63nRuxAp4EwLljFsrFdd+RFtBY1nL3qyzpTszLkJg1yWdTar2dRe4svQ oKXYd53kLhrnEWbesbCU0A2fpCT0KpWLXQGntr26HUrGujJxrdYRV4v9LX7FF4B1E5SuWpr3TmT0h9a7Z8CVprD6p5ZwpVLJ1GjFlgQGHB97Y1CKq2I0khV6 JLYxojKfL1uhNq0F7gI/5ImOsua0rw== Cc: Mark Kettenis Subject: [U-Boot] [PATCH v2 3/4] usb: xhci-dwc3: Add USB2 PHY configuration X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Configure USB2 PHY register based on "phy_type" property and handle all the quirks that are relevant for Rockchip RK3399 SoCs. Signed-off-by: Mark Kettenis Reviewed-by: Kever Yang --- drivers/usb/host/xhci-dwc3.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/drivers/usb/host/xhci-dwc3.c b/drivers/usb/host/xhci-dwc3.c index 83b9f119e7..9e8cae7ae4 100644 --- a/drivers/usb/host/xhci-dwc3.c +++ b/drivers/usb/host/xhci-dwc3.c @@ -118,6 +118,8 @@ static int xhci_dwc3_probe(struct udevice *dev) struct dwc3 *dwc3_reg; enum usb_dr_mode dr_mode; struct xhci_dwc3_platdata *plat = dev_get_platdata(dev); + const char *phy; + u32 reg; int ret; hccr = (struct xhci_hccr *)((uintptr_t)dev_read_addr(dev)); @@ -132,6 +134,24 @@ static int xhci_dwc3_probe(struct udevice *dev) dwc3_core_init(dwc3_reg); + /* Set dwc3 usb2 phy config */ + reg = readl(&dwc3_reg->g_usb2phycfg[0]); + + phy = dev_read_string(dev, "phy_type"); + if (phy && strcmp(phy, "utmi_wide") == 0) { + reg |= DWC3_GUSB2PHYCFG_PHYIF; + reg &= ~DWC3_GUSB2PHYCFG_USBTRDTIM_MASK; + reg |= DWC3_GUSB2PHYCFG_USBTRDTIM_16BIT; + } + + if (dev_read_bool(dev, "snps,dis_enblslpm-quirk")) + reg &= ~DWC3_GUSB2PHYCFG_ENBLSLPM; + + if (dev_read_bool(dev, "snps,dis-u2-freeclk-exists-quirk")) + reg &= ~DWC3_GUSB2PHYCFG_U2_FREECLK_EXISTS; + + writel(reg, &dwc3_reg->g_usb2phycfg[0]); + dr_mode = usb_get_dr_mode(dev_of_offset(dev)); if (dr_mode == USB_DR_MODE_UNKNOWN) /* by default set dual role mode to HOST */ From patchwork Sun Jun 30 16:01:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Kettenis X-Patchwork-Id: 1124935 X-Patchwork-Delegate: ykai007@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=openbsd.org Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45cFgS2Mb4z9sBp for ; Mon, 1 Jul 2019 02:04:20 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id D32B4C21DD3; Sun, 30 Jun 2019 16:03:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 5BF87C21E08; Sun, 30 Jun 2019 16:02:22 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id EBB2FC21E2F; Sun, 30 Jun 2019 16:02:11 +0000 (UTC) Received: from lb3-smtp-cloud9.xs4all.net (lb3-smtp-cloud9.xs4all.net [194.109.24.30]) by lists.denx.de (Postfix) with ESMTPS id 0D156C21DD7 for ; Sun, 30 Jun 2019 16:02:08 +0000 (UTC) Received: from barber.sibelius.xs4all.nl ([83.163.83.176]) by smtp-cloud9.xs4all.net with ESMTP id hcHChhlcYAOfNhcHHhinbC; Sun, 30 Jun 2019 18:02:08 +0200 From: Mark Kettenis To: u-boot@lists.denx.de Date: Sun, 30 Jun 2019 18:01:56 +0200 Message-Id: <20190630160156.51934-5-kettenis@openbsd.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190630160156.51934-1-kettenis@openbsd.org> References: <20190630160156.51934-1-kettenis@openbsd.org> MIME-Version: 1.0 X-CMAE-Envelope: MS4wfJt9aWnppnn1FrjUcIi+mVdSRXltWTpfX80VJftNdkow/RTDLd6RZhxL11k74NYLPOqe/UXQb2nIzkxqBuBVF3W1CvkWIgzYeNmbJTAbSmMsNnS491Uk prEsRguT84I6QPh+YWtHv2yd9XN9NF5OkpHj05XsG0kmkXk0lLv42fxlsheATPb7hRo4UrN94niQPmKEWbW7fbHZgiIpp3W8JZ9ei3TLOx+t1TdA6uz3mFki Xbwobdnaw3EpuVLHgTbKQWpdVl1n3+c2VK61rlNusZ+c8+ofBbSsiA3rybSGzm2gOBWDQiMrw05hTuZs2lluyqocc/i5dK+ODagwBGwH7IIgKBq2qMaKA6Sl ymPOVIvlveSrgV/bugKVyUGhkerl7A== Cc: Mark Kettenis Subject: [U-Boot] [PATCH v2 4/4] rockchip: xhci: Remove RK3399 support X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Remove RK3399 compatible strings as this driver is no longer used on that SoC. Signed-off-by: Mark Kettenis Reviewed-by: Kever Yang --- drivers/usb/host/xhci-rockchip.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/usb/host/xhci-rockchip.c b/drivers/usb/host/xhci-rockchip.c index f19bea3a91..e7b0dbcca5 100644 --- a/drivers/usb/host/xhci-rockchip.c +++ b/drivers/usb/host/xhci-rockchip.c @@ -167,7 +167,6 @@ static int xhci_usb_remove(struct udevice *dev) } static const struct udevice_id xhci_usb_ids[] = { - { .compatible = "rockchip,rk3399-xhci" }, { .compatible = "rockchip,rk3328-xhci" }, { } }; @@ -187,7 +186,6 @@ U_BOOT_DRIVER(usb_xhci) = { }; static const struct udevice_id usb_phy_ids[] = { - { .compatible = "rockchip,rk3399-usb3-phy" }, { .compatible = "rockchip,rk3328-usb3-phy" }, { } };