From patchwork Tue Sep 18 08:16:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 146882 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp4736152ljw; Tue, 18 Sep 2018 01:17:30 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZUYHwNk/E+Xa3Jm7qakX4yh0VgSj7SPFipB/YHoYYx1oVGNwdcUib642O7YtXO6q14JBr3 X-Received: by 2002:a63:f:: with SMTP id 15-v6mr27155441pga.430.1537258649939; Tue, 18 Sep 2018 01:17:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537258649; cv=none; d=google.com; s=arc-20160816; b=0WKmTjMEKugZf9aCkA2GBdtxMHurqBuNYuFEmCps6WKhizcqU1QqdxbEKku/LMeTkP mM5nYfF7LQtNlbAbtkSkQHAVhgQl6M60mb2EX5sJ5elPIlFXMpUGAE+LxEKBe6uvQ6Au fqfwzjDF69xV0HgXMLz1sJJZX7nD251/cnuY3vs/CXUa8KoItUiYEwtpIJNf7BQ99JMh HCznQDJY01xn9JOixnSfc04IBtFCwl66mJDDHhW0OdM2H4FtegD811v/lo0922P9kPcb huRm1T3D4VfsNNBbNAztNp2CeOAdQA5B1Io07gijWAoKzxILxsBXxzkuixAeJaDZc8Rt p+aw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:cms-type:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature:dkim-filter; bh=7rbPwsHgEgD8pVuma5f3A3rp0o+0GQ10xg81X6QAsZc=; b=YFk1f2bharzWcVK9wOYoiWL09a7y6yef+lYsZsj83HLhQQ69syKMGWeQQBrlLJEjkx /rQJR6VTCmPxy/00iPpCTgJD5jYiFOgI8XNcuVSCS3RRG4NXc+PUcNeKD6IdW3DLrGLq 2fCLbXePl5pPD5arjH+Za1iWBLSVPGenZE9cQJuRp45XT7K5jC97tasJ/eYV3gemboTK z+UBl3FTFZf4N85Cr4fUksZt1ifZd3SClXruyZv/kz5nJy7cKcksNJLwc+OwSgJUt83Y +9LEg9kJWxFmF5fkl54QnvGOIpUlIvMia0+cJcHBYJjdwxM9K0oCZa1R64/8XLfkd/hD vtMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=U+qohUCr; spf=pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y15-v6si18364541pff.117.2018.09.18.01.17.29; Tue, 18 Sep 2018 01:17:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=U+qohUCr; spf=pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729112AbeIRNs6 (ORCPT + 3 others); Tue, 18 Sep 2018 09:48:58 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:34075 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728681AbeIRNsk (ORCPT ); Tue, 18 Sep 2018 09:48:40 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20180918081709euoutp0129a2e1a9cc8f9f2073a6911897fa3306~VcJQa4Lr40716807168euoutp01i; Tue, 18 Sep 2018 08:17:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20180918081709euoutp0129a2e1a9cc8f9f2073a6911897fa3306~VcJQa4Lr40716807168euoutp01i DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1537258629; bh=7rbPwsHgEgD8pVuma5f3A3rp0o+0GQ10xg81X6QAsZc=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=U+qohUCrlqJLhe2vPLb3Q79fmPXOzfYwoHPb9qe6Aj7be1eTq3aFg4VlyoIAy6XrL 3OxCuDYSEpq3TB+51VS8rbo8lVQw1DrjwFpFrvTkTU2fP/eg5ZOSIHl1t/cCxQuDJN pxYttmaOl0j9HedBEOVnkipEjG6qc9x2uFLEqn7A= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20180918081708eucas1p266a1651c125598dec6b31f9c80f6f35e~VcJP6HLO10417104171eucas1p2O; Tue, 18 Sep 2018 08:17:08 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id C4.4D.04294.484B0AB5; Tue, 18 Sep 2018 09:17:08 +0100 (BST) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20180918081707eucas1p1723fe82ab62b7d321f0e49bad8e3edf1~VcJPCsmWN1590615906eucas1p1-; Tue, 18 Sep 2018 08:17:07 +0000 (GMT) X-AuditID: cbfec7f4-c77a99c0000010c6-66-5ba0b484eeb0 Received: from eusync4.samsung.com ( [203.254.199.214]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 0A.6B.04128.384B0AB5; Tue, 18 Sep 2018 09:17:07 +0100 (BST) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0PF800C5KSCD4H70@eusync4.samsung.com>; Tue, 18 Sep 2018 09:17:07 +0100 (BST) From: Marek Szyprowski To: linux-usb@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Greg Kroah-Hartman , Felipe Balbi , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz Subject: [PATCH 3/4] usb: dwc3: exynos: Add support for Exynos5433 variant with all clocks Date: Tue, 18 Sep 2018 10:16:52 +0200 Message-id: <20180918081653.314-4-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.17.1 In-reply-to: <20180918081653.314-1-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrGIsWRmVeSWpSXmKPExsWy7djP87otWxZEG2y5JmyxccZ6VotjbU/Y LZoXr2ezOH9+A7vFjPP7mCwWLWtltlh75C67A7vHplWdbB77565h9+jbsorR4/MmuQCWKC6b lNSczLLUIn27BK6Mn813WAuWSVRsO/CJuYFxikgXIyeHhICJxNmWn4xdjFwcQgIrGCVm/z7P CuF8ZpTo7LvPBlN1Z91BZojEMkaJ3fdOskM4DUwSO9seM4JUsQkYSnS97QLrEBFwkFiy9A4b SBGzwBOgjs1fwIqEBWIk7h/uZQexWQRUJf7MvwsU5+DgFbCWmLjLGGKbvMTqDQeYQWxOARuJ nRsfsYDMkRD4yyrxZt8uRogiF4lzxx+yQ9jCEq+Ob4GyZSQuT+6GamhmlGifMYsdwulhlNg6 ZwfUQ9YSh49fZAWxmQX4JCZtm84McoWEAK9ER5sQRImHxL1HB6De7GeU+N2zn3ECo+QCRoZV jOKppcW56anFRnmp5XrFibnFpXnpesn5uZsYgbF3+t/xLzsYd/1JOsQowMGoxMO7YMH8aCHW xLLiytxDjBIczEoivJw5C6KFeFMSK6tSi/Lji0pzUosPMUpzsCiJ8/JppUULCaQnlqRmp6YW pBbBZJk4OKUaGFN902qWrc5xrHtbtLZJPWiyxeIbKx31g73ZLfYaTWK5tXvdLvOPh4prf5ZZ LXpZcNQ3kKN+gdaG+tqzgsIJm2eUexwy2Xd4/cTzm1fUfU8rsC3n05lTzrCA13T7M75CrhWC AYklbvx3J9lP3yTZdH7hgcqbipzfM5UyZu40PyZ4ULEoJ/mQhxJLcUaioRZzUXEiAFdjM8O5 AgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpkluLIzCtJLcpLzFFi42I5/e/4Nd3mLQuiDbZM1bHYOGM9q8Wxtifs Fs2L17NZnD+/gd1ixvl9TBaLlrUyW6w9cpfdgd1j06pONo/9c9ewe/RtWcXo8XmTXABLFJdN SmpOZllqkb5dAlfGz+Y7rAXLJCq2HfjE3MA4RaSLkZNDQsBE4s66g8xdjFwcQgJLGCV6f85i BEkICTQxSTy5FwpiswkYSnS97WIDsUUEHCSWLL3DBtLALPCEUeLGlflgCWGBGIl1HQtYQGwW AVWJP/PvAg3i4OAVsJaYuMsYYpm8xOoNB5hBbE4BG4mdGx+xQOyylljWdpl1AiPPAkaGVYwi qaXFuem5xUZ6xYm5xaV56XrJ+bmbGIEBs+3Yzy07GLveBR9iFOBgVOLh/bFofrQQa2JZcWXu IUYJDmYlEV7OnAXRQrwpiZVVqUX58UWlOanFhxilOViUxHnPG1RGCQmkJ5akZqemFqQWwWSZ ODilgCGStU+B0+DZq2eM1869WvFg/rukllu2z7L8+vKPfdDd0xin/lLF8ZqNV7oUn7XR23aZ KUKf6xtmSblGeNc47i38+mj7j8wGfzkTPnmNBafYHrlrn3op+PAo5w7Ga9H2K7a3CobHaIp2 VyatZw3hcC58ErXMc9XZrdXr3m3ht5mTNHUq66HAciWW4oxEQy3mouJEACMGhnUUAgAA X-CMS-MailID: 20180918081707eucas1p1723fe82ab62b7d321f0e49bad8e3edf1 X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180918081707eucas1p1723fe82ab62b7d321f0e49bad8e3edf1 References: <20180918081653.314-1-m.szyprowski@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org DWC3 variant found in Exynos5433 SoCs requires keeping all DRD30/UHOST30 clocks enabled all the time the driver does any access to DWC3 registers, otherwise external abort happens. So far DWC3 hardware module worked with samsung,exynos5250-dwusb3 compatible only by luck when built into kernel: all DRD30 clocks were left enabled by bootloader and later kept enabled by the DRD PHY driver. However, if one tried to use Exnos DWC3 driver as a module or performed system suspend/resume cycle, external abort happened. This patch finally fixes this issue. Signed-off-by: Marek Szyprowski --- Documentation/devicetree/bindings/usb/dwc3.txt | 1 + Documentation/devicetree/bindings/usb/exynos-usb.txt | 2 ++ drivers/usb/dwc3/dwc3-exynos.c | 9 +++++++++ 3 files changed, 12 insertions(+) -- 2.17.1 diff --git a/Documentation/devicetree/bindings/usb/dwc3.txt b/Documentation/devicetree/bindings/usb/dwc3.txt index 3e4c38b806ac..636630fb92d7 100644 --- a/Documentation/devicetree/bindings/usb/dwc3.txt +++ b/Documentation/devicetree/bindings/usb/dwc3.txt @@ -19,6 +19,7 @@ Exception for clocks: "cavium,octeon-7130-usb-uctl" "qcom,dwc3" "samsung,exynos5250-dwusb3" + "samsung,exynos5433-dwusb3" "samsung,exynos7-dwusb3" "sprd,sc9860-dwc3" "st,stih407-dwc3" diff --git a/Documentation/devicetree/bindings/usb/exynos-usb.txt b/Documentation/devicetree/bindings/usb/exynos-usb.txt index c97374315049..b7111f43fa59 100644 --- a/Documentation/devicetree/bindings/usb/exynos-usb.txt +++ b/Documentation/devicetree/bindings/usb/exynos-usb.txt @@ -83,6 +83,8 @@ Required properties: - compatible: should be one of the following - "samsung,exynos5250-dwusb3": for USB 3.0 DWC3 controller on Exynos5250/5420. + "samsung,exynos5433-dwusb3": for USB 3.0 DWC3 controller on + Exynos5433. "samsung,exynos7-dwusb3": for USB 3.0 DWC3 controller on Exynos7. - #address-cells, #size-cells : should be '1' if the device has sub-nodes with 'reg' property. diff --git a/drivers/usb/dwc3/dwc3-exynos.c b/drivers/usb/dwc3/dwc3-exynos.c index 3f434a53be8e..cb7fcd7c0ad8 100644 --- a/drivers/usb/dwc3/dwc3-exynos.c +++ b/drivers/usb/dwc3/dwc3-exynos.c @@ -162,6 +162,12 @@ static const struct dwc3_exynos_driverdata exynos5250_drvdata = { .suspend_clk_idx = -1, }; +static const struct dwc3_exynos_driverdata exynos5433_drvdata = { + .clk_names = { "aclk", "susp_clk", "pipe_pclk", "phyclk" }, + .num_clks = 4, + .suspend_clk_idx = 1, +}; + static const struct dwc3_exynos_driverdata exynos7_drvdata = { .clk_names = { "usbdrd30", "usbdrd30_susp_clk", "usbdrd30_axius_clk" }, .num_clks = 3, @@ -172,6 +178,9 @@ static const struct of_device_id exynos_dwc3_match[] = { { .compatible = "samsung,exynos5250-dwusb3", .data = &exynos5250_drvdata, + }, { + .compatible = "samsung,exynos5433-dwusb3", + .data = &exynos5433_drvdata, }, { .compatible = "samsung,exynos7-dwusb3", .data = &exynos7_drvdata,