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: 10603843 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2E713161F for ; Tue, 18 Sep 2018 08:17:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1E7A52A4ED for ; Tue, 18 Sep 2018 08:17:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 126522A500; Tue, 18 Sep 2018 08:17:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AD5632A4FF for ; Tue, 18 Sep 2018 08:17:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729017AbeIRNs6 (ORCPT ); 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-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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(+) 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,