From patchwork Thu Dec 29 09:57:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jung Daehwan X-Patchwork-Id: 13083392 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 46D0CC3DA79 for ; Thu, 29 Dec 2022 10:14:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233257AbiL2KOe (ORCPT ); Thu, 29 Dec 2022 05:14:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45402 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229625AbiL2KMb (ORCPT ); Thu, 29 Dec 2022 05:12:31 -0500 Received: from mailout2.samsung.com (mailout2.samsung.com [203.254.224.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8A95313F65 for ; Thu, 29 Dec 2022 02:04:18 -0800 (PST) Received: from epcas2p3.samsung.com (unknown [182.195.41.55]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20221229100415epoutp02afd404c478ffd48e70eb7236652330b7~1O3_PznSw0652506525epoutp02- for ; Thu, 29 Dec 2022 10:04:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20221229100415epoutp02afd404c478ffd48e70eb7236652330b7~1O3_PznSw0652506525epoutp02- DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1672308255; bh=dplttHGWL97k9zkZU+DBVvNgaW6tStyWd3q2Kneia8E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oJbk5Btr99+hzonJmYOnPotSjCdz1x8E7iAmkTJP0qOpmPMKJCoIvyiEoLxCsKiE6 hqN060I2v9QCGQiqeuzVu+hyxwRvgIEQky/U7wxiNwup0uaSIgkuGWjebi58LKEhOR wMgXpl7p1M4ANE426djCgL0WMzP2/9Hv89Y0OrvY= Received: from epsnrtp1.localdomain (unknown [182.195.42.162]) by epcas2p4.samsung.com (KnoxPortal) with ESMTP id 20221229100415epcas2p42a49b9e99c5f8b95a8e05175b2948466~1O39u7IvY1198811988epcas2p4O; Thu, 29 Dec 2022 10:04:15 +0000 (GMT) Received: from epsmges2p1.samsung.com (unknown [182.195.36.91]) by epsnrtp1.localdomain (Postfix) with ESMTP id 4NjPB64Gn5z4x9Ps; Thu, 29 Dec 2022 10:04:14 +0000 (GMT) Received: from epcas2p4.samsung.com ( [182.195.41.56]) by epsmges2p1.samsung.com (Symantec Messaging Gateway) with SMTP id C2.EB.03803.E166DA36; Thu, 29 Dec 2022 19:04:14 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas2p3.samsung.com (KnoxPortal) with ESMTPA id 20221229100413epcas2p34c702faf8c96d207cf1659b1173f8858~1O38Xq-mM2202722027epcas2p39; Thu, 29 Dec 2022 10:04:13 +0000 (GMT) Received: from epsmgms1p2.samsung.com (unknown [182.195.42.42]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20221229100413epsmtrp1f2ae4b5010939a31ae2db49becf99d82~1O38W2YLJ2828628286epsmtrp1B; Thu, 29 Dec 2022 10:04:13 +0000 (GMT) X-AuditID: b6c32a45-f47ff70000020edb-92-63ad661e70ae Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p2.samsung.com (Symantec Messaging Gateway) with SMTP id DF.CE.10542.D166DA36; Thu, 29 Dec 2022 19:04:13 +0900 (KST) Received: from ubuntu.dsn.sec.samsung.com (unknown [10.229.95.128]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20221229100413epsmtip224864ad58e8955358c4f490b97eb7bae~1O38FbIaa1657916579epsmtip2w; Thu, 29 Dec 2022 10:04:13 +0000 (GMT) From: Daehwan Jung To: Greg Kroah-Hartman , Rob Herring , Krzysztof Kozlowski , Thinh Nguyen , Mathias Nyman , Felipe Balbi Cc: linux-usb@vger.kernel.org (open list:USB SUBSYSTEM), devicetree@vger.kernel.org (open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS), linux-kernel@vger.kernel.org (open list), sc.suh@samsung.com, taehyun.cho@samsung.com, jh0801.jung@samsung.com, eomji.oh@samsung.com, Daehwan Jung Subject: [RFC PATCH v2 1/3] usb: support Samsung Exynos xHCI Controller Date: Thu, 29 Dec 2022 18:57:44 +0900 Message-Id: <1672307866-25839-2-git-send-email-dh10.jung@samsung.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1672307866-25839-1-git-send-email-dh10.jung@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupgk+LIzCtJLcpLzFFi42LZdljTQlcubW2ywbV/shbH2p6wW8w/co7V 4s6CaUwWp5YvZLJoXryezeLuwx8sFn0vHjJbXN41h81i0bJWZovmTVNYLVr3HmG36Lp7g9Fi 0kFRi1ULDrA78Hks3vOSyWPTqk42jzvX9rB57J+7ht2jb8sqRo8t+z8zenzeJBfAHpVtk5Ga mJJapJCal5yfkpmXbqvkHRzvHG9qZmCoa2hpYa6kkJeYm2qr5OIToOuWmQN0spJCWWJOKVAo ILG4WEnfzqYov7QkVSEjv7jEVim1ICWnwLxArzgxt7g0L10vL7XEytDAwMgUqDAhO2Nh60vG gk+uFT8urmFtYHxp2cXIySEhYCJx9Oh1ti5GLg4hgR2MEheO3GGEcD4xStze2Q7lfGaU6Nj5 kRmm5fDyrWwgtpDALkaJN+9FIIp+MEq833KFqYuRg4NNQEvi+0KwZhGBLiaJbXe+soA4zAJH mCQ2zjjFCNItLOAucb6jC8xmEVCVuDLpNJjNK+Aq8Wb+ZjaIbXISN891gm3mFHCTaN/6A2yQ hEAvh8Ttp9Ohilwkfn64CmULS7w6voUdwpaSeNnfBmVnS1z/1s0CYVdIrNgLYxtLzHoG8icH 0HWaEut36YOYE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f7BAXOQq caH7H9sERr4FjAyrGCVTC4pz03OLDQuM8lLL9YoTc4tL89L1kvNzNzGCw1lLawfjnlUf9A4x MnEwHmKU4GBWEuHVOLs6WYg3JbGyKrUoP76oNCe1+BCjNAeLkjjvha6T8UIC6YklqdmpqQWp RTBZJg5OqQamsufTcpMUJraUX+WPUe8uUJS9eCaournuuuk+9j2L1yZcPfLY/t+/Ct0HGVdY lxyY0bv5/qXMY4/DfsQpa7wzOOO9XSjYXuiWfOvJ7EVuIdNPvAhIDtns6bRPP/X85OXqE57u vKcp+4X1l419DfvZ49VTGFuy90+2kNe0MdWwiPk+1WtJV3yaxIKmJt1q6/XKtwKOe2Y4rXDX jN/W9U/LIv+Y1dxin8tast6Vyy8fPPXSIu/Ikeq5U1Mcfc2Nbz1gjGD85Ms8ZVHO1+Yvhx+J Nvneq3kS3uXy0JllR+rTK/x1N8///Sd/8PuVtPqlLv8ixKO2xl7RXzdnwpqGU/9KHvq73TXn yemrXjrn5vbvSizFGYmGWsxFxYkAj39CQ9YCAAA= X-CMS-MailID: 20221229100413epcas2p34c702faf8c96d207cf1659b1173f8858 X-Msg-Generator: CA X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20221229100413epcas2p34c702faf8c96d207cf1659b1173f8858 References: <1672307866-25839-1-git-send-email-dh10.jung@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Currently, dwc3 invokes just xhci platform driver without any data. We add xhci node as child of dwc3 node in order to get data from device tree. It populates "xhci" child by name during initialization of host. This patch only effects if dwc3 node has a child named "xhci" not to disturb original path. We add "samsung,exynos-xhci" compatible in xhci platform driver to support Exynos SOCs. We introduce roothub wakeup, which uses roothub as system wakeup source. It needs xhci platform driver to override roothub ops. Signed-off-by: Daehwan Jung --- drivers/usb/dwc3/drd.c | 7 +++++ drivers/usb/dwc3/host.c | 33 ++++++++++++++++++-- drivers/usb/host/xhci-plat.c | 60 +++++++++++++++++++++++++++++++++++- drivers/usb/host/xhci.c | 4 +++ drivers/usb/host/xhci.h | 5 +++ 5 files changed, 106 insertions(+), 3 deletions(-) diff --git a/drivers/usb/dwc3/drd.c b/drivers/usb/dwc3/drd.c index 039bf241769a..7263fd7bdf4f 100644 --- a/drivers/usb/dwc3/drd.c +++ b/drivers/usb/dwc3/drd.c @@ -496,6 +496,8 @@ static enum usb_role dwc3_usb_role_switch_get(struct usb_role_switch *sw) static int dwc3_setup_role_switch(struct dwc3 *dwc) { struct usb_role_switch_desc dwc3_role_switch = {NULL}; + struct device_node *dwc3_np = dev_of_node(dwc->dev); + struct device_node *xhci_np; u32 mode; dwc->role_switch_default_mode = usb_get_role_switch_default_mode(dwc->dev); @@ -514,6 +516,10 @@ static int dwc3_setup_role_switch(struct dwc3 *dwc) if (IS_ERR(dwc->role_sw)) return PTR_ERR(dwc->role_sw); + xhci_np = of_get_child_by_name(dwc3_np, "xhci"); + if (xhci_np) + goto populate_skip; + if (dwc->dev->of_node) { /* populate connector entry */ int ret = devm_of_platform_populate(dwc->dev); @@ -526,6 +532,7 @@ static int dwc3_setup_role_switch(struct dwc3 *dwc) } } +populate_skip: dwc3_set_mode(dwc, mode); return 0; } diff --git a/drivers/usb/dwc3/host.c b/drivers/usb/dwc3/host.c index f6f13e7f1ba1..8adfe45d9681 100644 --- a/drivers/usb/dwc3/host.c +++ b/drivers/usb/dwc3/host.c @@ -9,6 +9,7 @@ #include #include +#include #include #include "core.h" @@ -68,9 +69,22 @@ int dwc3_host_init(struct dwc3 *dwc) { struct property_entry props[4]; struct platform_device *xhci; + struct device_node *dwc3_np = dev_of_node(dwc->dev); + struct device_node *xhci_np; int ret, irq; int prop_idx = 0; + xhci_np = of_get_child_by_name(dwc3_np, "xhci"); + if (xhci_np) { + ret = of_platform_populate(dwc3_np, NULL, NULL, dwc->dev); + if (ret) { + dev_err(dwc->dev, "failed to register xhci - %d\n", ret); + goto err; + } + dwc->xhci = of_find_device_by_node(xhci_np); + goto populate_done; + } + irq = dwc3_host_get_irq(dwc); if (irq < 0) return irq; @@ -126,14 +140,29 @@ int dwc3_host_init(struct dwc3 *dwc) goto err; } +populate_done: return 0; + err: - platform_device_put(xhci); + if (xhci_np) + of_platform_depopulate(dwc->dev); + else + platform_device_put(xhci); + return ret; } void dwc3_host_exit(struct dwc3 *dwc) { - platform_device_unregister(dwc->xhci); + struct device_node *dwc3_np = dev_of_node(dwc->dev); + struct device_node *xhci_np; + + xhci_np = of_get_child_by_name(dwc3_np, "xhci"); + + if (xhci_np) + of_platform_depopulate(dwc->dev); + else + platform_device_unregister(dwc->xhci); + dwc->xhci = NULL; } diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c index 5fb55bf19493..0eeaf306076a 100644 --- a/drivers/usb/host/xhci-plat.c +++ b/drivers/usb/host/xhci-plat.c @@ -29,11 +29,15 @@ static struct hc_driver __read_mostly xhci_plat_hc_driver; static int xhci_plat_setup(struct usb_hcd *hcd); static int xhci_plat_start(struct usb_hcd *hcd); +static int xhci_plat_bus_suspend(struct usb_hcd *hcd); +static int xhci_plat_bus_resume(struct usb_hcd *hcd); static const struct xhci_driver_overrides xhci_plat_overrides __initconst = { .extra_priv_size = sizeof(struct xhci_plat_priv), .reset = xhci_plat_setup, .start = xhci_plat_start, + .bus_suspend = xhci_plat_bus_suspend, + .bus_resume = xhci_plat_bus_resume, }; static void xhci_priv_plat_start(struct usb_hcd *hcd) @@ -86,6 +90,33 @@ static void xhci_plat_quirks(struct device *dev, struct xhci_hcd *xhci) xhci->quirks |= XHCI_PLAT | priv->quirks; } +static int xhci_plat_bus_suspend(struct usb_hcd *hcd) +{ + struct xhci_hcd *xhci = hcd_to_xhci(hcd); + + if (xhci->quirks & XHCI_ROOTHUB_WAKEUP) { + if (hcd == xhci->main_hcd) + __pm_relax(xhci->main_wakelock); + else + __pm_relax(xhci->shared_wakelock); + } + + return xhci_bus_suspend(hcd); +} + +static int xhci_plat_bus_resume(struct usb_hcd *hcd) +{ + struct xhci_hcd *xhci = hcd_to_xhci(hcd); + + if (xhci->quirks & XHCI_ROOTHUB_WAKEUP) { + if (hcd == xhci->main_hcd) + __pm_stay_awake(xhci->main_wakelock); + else + __pm_stay_awake(xhci->shared_wakelock); + } + return xhci_bus_resume(hcd); +} + /* called during probe() after chip reset completes */ static int xhci_plat_setup(struct usb_hcd *hcd) { @@ -126,6 +157,10 @@ static const struct xhci_plat_priv xhci_plat_brcm = { .quirks = XHCI_RESET_ON_RESUME | XHCI_SUSPEND_RESUME_CLKS, }; +static const struct xhci_plat_priv xhci_plat_exynos = { + .quirks = XHCI_ROOTHUB_WAKEUP, +}; + static const struct of_device_id usb_xhci_of_match[] = { { .compatible = "generic-xhci", @@ -167,6 +202,9 @@ static const struct of_device_id usb_xhci_of_match[] = { }, { .compatible = "brcm,bcm7445-xhci", .data = &xhci_plat_brcm, + }, { + .compatible = "samsung,exynos-xhci", + .data = &xhci_plat_exynos, }, {}, }; @@ -185,7 +223,6 @@ static int xhci_plat_probe(struct platform_device *pdev) int irq; struct xhci_plat_priv *priv = NULL; - if (usb_disabled()) return -ENODEV; @@ -350,6 +387,21 @@ static int xhci_plat_probe(struct platform_device *pdev) goto put_usb3_hcd; } + if (xhci->quirks & XHCI_ROOTHUB_WAKEUP) { + /* Initialization wakelock for HCD */ + xhci->main_wakelock = wakeup_source_register(&pdev->dev, + dev_name(&pdev->dev)); + __pm_stay_awake(xhci->main_wakelock); + device_set_wakeup_enable(&xhci->main_hcd->self.root_hub->dev, true); + + if (xhci->shared_hcd) { + xhci->shared_wakelock = wakeup_source_register(&pdev->dev, + dev_name(&pdev->dev)); + __pm_stay_awake(xhci->shared_wakelock); + device_set_wakeup_enable(&xhci->shared_hcd->self.root_hub->dev, true); + } + } + device_enable_async_suspend(&pdev->dev); pm_runtime_put_noidle(&pdev->dev); @@ -398,6 +450,12 @@ static int xhci_plat_remove(struct platform_device *dev) pm_runtime_get_sync(&dev->dev); xhci->xhc_state |= XHCI_STATE_REMOVING; + if (xhci->quirks & XHCI_ROOTHUB_WAKEUP) { + wakeup_source_unregister(xhci->main_wakelock); + if (xhci->shared_wakelock) + wakeup_source_unregister(xhci->shared_wakelock); + } + if (shared_hcd) { usb_remove_hcd(shared_hcd); xhci->shared_hcd = NULL; diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 79d7931c048a..693495054001 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -5502,6 +5502,10 @@ void xhci_init_driver(struct hc_driver *drv, drv->check_bandwidth = over->check_bandwidth; if (over->reset_bandwidth) drv->reset_bandwidth = over->reset_bandwidth; + if (over->bus_suspend) + drv->bus_suspend = over->bus_suspend; + if (over->bus_resume) + drv->bus_resume = over->bus_resume; } } EXPORT_SYMBOL_GPL(xhci_init_driver); diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h index c9f06c5e4e9d..cb9c54a6a22c 100644 --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h @@ -1752,6 +1752,8 @@ struct xhci_hub { struct xhci_hcd { struct usb_hcd *main_hcd; struct usb_hcd *shared_hcd; + struct wakeup_source *main_wakelock; + struct wakeup_source *shared_wakelock; /* glue to PCI and HCD framework */ struct xhci_cap_regs __iomem *cap_regs; struct xhci_op_regs __iomem *op_regs; @@ -1898,6 +1900,7 @@ struct xhci_hcd { #define XHCI_EP_CTX_BROKEN_DCS BIT_ULL(42) #define XHCI_SUSPEND_RESUME_CLKS BIT_ULL(43) #define XHCI_RESET_TO_DEFAULT BIT_ULL(44) +#define XHCI_ROOTHUB_WAKEUP BIT_ULL(45) unsigned int num_active_eps; unsigned int limit_active_eps; @@ -1943,6 +1946,8 @@ struct xhci_driver_overrides { struct usb_host_endpoint *ep); int (*check_bandwidth)(struct usb_hcd *, struct usb_device *); void (*reset_bandwidth)(struct usb_hcd *, struct usb_device *); + int (*bus_suspend)(struct usb_hcd *hcd); + int (*bus_resume)(struct usb_hcd *hcd); }; #define XHCI_CFC_DELAY 10 From patchwork Thu Dec 29 09:57:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jung Daehwan X-Patchwork-Id: 13083394 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 57A63C4708D for ; Thu, 29 Dec 2022 10:14:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233260AbiL2KOh (ORCPT ); Thu, 29 Dec 2022 05:14:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45408 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233139AbiL2KMd (ORCPT ); Thu, 29 Dec 2022 05:12:33 -0500 Received: from mailout4.samsung.com (mailout4.samsung.com [203.254.224.34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 79F2813F76 for ; Thu, 29 Dec 2022 02:04:19 -0800 (PST) Received: from epcas2p4.samsung.com (unknown [182.195.41.56]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20221229100417epoutp04927739054d8a2327e0e780406ad49541~1O3-51ZGk1153611536epoutp04g for ; Thu, 29 Dec 2022 10:04:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20221229100417epoutp04927739054d8a2327e0e780406ad49541~1O3-51ZGk1153611536epoutp04g DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1672308257; bh=+7UyEP8u7ZuEOhQRmNW84KzrakctEPHUNlyDedOD7bs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nz2MhRezRPV8hdsVDWrbfujBB7kPKag81yJw2oFbahBK9jz7KW9AAUkFEKvhX6M7j 0gX/q9X999C7r2ocAzAAyTaDbWtZwnzLLbF207LcZfTrVhdCSyn4ynfXx1apPdycuS fJWAIjpONmlGADFV0wtjSpT4HBITej4SkfqzHbLc= Received: from epsnrtp1.localdomain (unknown [182.195.42.162]) by epcas2p4.samsung.com (KnoxPortal) with ESMTP id 20221229100416epcas2p4e0c641d59e399d6522489b2359c6d2a2~1O3-R5qUl3162931629epcas2p4d; Thu, 29 Dec 2022 10:04:16 +0000 (GMT) Received: from epsmges2p1.samsung.com (unknown [182.195.36.99]) by epsnrtp1.localdomain (Postfix) with ESMTP id 4NjPB83Lzlz4x9Py; Thu, 29 Dec 2022 10:04:16 +0000 (GMT) Received: from epcas2p4.samsung.com ( [182.195.41.56]) by epsmges2p1.samsung.com (Symantec Messaging Gateway) with SMTP id A5.EB.03803.0266DA36; Thu, 29 Dec 2022 19:04:16 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas2p3.samsung.com (KnoxPortal) with ESMTPA id 20221229100416epcas2p3614b693ab922aadbdc76c0387f768de9~1O3_kFpj_2202722027epcas2p3G; Thu, 29 Dec 2022 10:04:16 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20221229100416epsmtrp25c50de5f0a0bab34845bdb931ccac126~1O3_jPy0Z1682316823epsmtrp28; Thu, 29 Dec 2022 10:04:16 +0000 (GMT) X-AuditID: b6c32a45-f47ff70000020edb-a2-63ad662021b5 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id F4.1F.02211.F166DA36; Thu, 29 Dec 2022 19:04:15 +0900 (KST) Received: from ubuntu.dsn.sec.samsung.com (unknown [10.229.95.128]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20221229100415epsmtip27cfcd0df77c9a2dd60399d41060203df~1O3_VUet_2159721597epsmtip2e; Thu, 29 Dec 2022 10:04:15 +0000 (GMT) From: Daehwan Jung To: Greg Kroah-Hartman , Rob Herring , Krzysztof Kozlowski , Thinh Nguyen , Mathias Nyman , Felipe Balbi Cc: linux-usb@vger.kernel.org (open list:USB SUBSYSTEM), devicetree@vger.kernel.org (open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS), linux-kernel@vger.kernel.org (open list), sc.suh@samsung.com, taehyun.cho@samsung.com, jh0801.jung@samsung.com, eomji.oh@samsung.com, Daehwan Jung Subject: [RFC PATCH v2 2/3] dt-bindings: usb: generic-xhci: add Samsung Exynos compatible Date: Thu, 29 Dec 2022 18:57:45 +0900 Message-Id: <1672307866-25839-3-git-send-email-dh10.jung@samsung.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1672307866-25839-1-git-send-email-dh10.jung@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupgk+LIzCtJLcpLzFFi42LZdljTQlchbW2yweT94hbH2p6wW8w/co7V 4s6CaUwWp5YvZLJoXryezeLuwx8sFn0vHjJbXN41h81i0bJWZovmTVNYLVr3HmG36Lp7g9Fi 0kFRi1ULDrA78Hks3vOSyWPTqk42jzvX9rB57J+7ht2jb8sqRo8t+z8zenzeJBfAHpVtk5Ga mJJapJCal5yfkpmXbqvkHRzvHG9qZmCoa2hpYa6kkJeYm2qr5OIToOuWmQN0spJCWWJOKVAo ILG4WEnfzqYov7QkVSEjv7jEVim1ICWnwLxArzgxt7g0L10vL7XEytDAwMgUqDAhO+NpX3HB WraKx4+XMzcw9rJ2MXJySAiYSOzd08bUxcjFISSwg1Hi2cV3bBDOJ0aJn/sWQjnfGCVuHjnC BtNy7upWdojEXkaJ5u+ToZwfjBLzvs0AGszBwSagJfF9ISNIXESgi0li252vLCAOs8ARJomN M04xgowSFoiWOLptKthYFgFViVvb3rGD2LwCrhKLFjYzQayTk7h5rpMZxOYUcJNo3/oDbJCE QC+HxNsnDVBvuEgcmNbFDmELS7w6vgXKlpL4/G4v1N3ZEte/dbNA2BU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i19NVjCA2i4CqxK1t78Cm8gq4Sixa2MwEsUFO4ua5TrDNnAJuEu1bf7CA2EJA NRe6/7FNYORbwMiwilEytaA4Nz232LDAMC+1XK84Mbe4NC9dLzk/dxMjOJy1NHcwbl/1Qe8Q IxMH4yFGCQ5mJRFejbOrk4V4UxIrq1KL8uOLSnNSiw8xSnOwKInzXug6GS8kkJ5YkpqdmlqQ WgSTZeLglGpgWvHBeXah+r1mhm1hD8V53h04/OMnyy/jNVncx03nrDwvUh3y7dL2OC3BbyKe xWGZj6oCNrC8m7zBTpRDW6E9KJfrp+nezCXbj5gIG9rKPDW+cnBJ5/3J1xL7dy9yUKv56GPz VWD5+61T+HNW3ZBVjGULajr0vvLcqkDhkia7Gda9Nu+qfblLpjjohNw4rNQ1YdblbxPitWe8 2dLObnBp1zHHNWwbzTx/hYnLnan1E/timKdokeb8VvvkAw1R149nK6P0HFKnfPng5a9x8Zrw tnCFE3NvJX6YW5l88cJBK8Urc58Gc/nPXfYiRvCTfvedl7aXtbW2rrBb6L74zzdRiavqF/iv exssu8vZrXI7SImlOCPRUIu5qDgRAKmdlnXWAgAA X-CMS-MailID: 20221229100416epcas2p3614b693ab922aadbdc76c0387f768de9 X-Msg-Generator: CA X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20221229100416epcas2p3614b693ab922aadbdc76c0387f768de9 References: <1672307866-25839-1-git-send-email-dh10.jung@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Add compatible for Samsung Exynos SOCs Signed-off-by: Daehwan Jung --- Documentation/devicetree/bindings/usb/generic-xhci.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/usb/generic-xhci.yaml b/Documentation/devicetree/bindings/usb/generic-xhci.yaml index db841589fc33..f54aff477637 100644 --- a/Documentation/devicetree/bindings/usb/generic-xhci.yaml +++ b/Documentation/devicetree/bindings/usb/generic-xhci.yaml @@ -29,6 +29,8 @@ properties: enum: - brcm,xhci-brcm-v2 - brcm,bcm7445-xhci + - description: Samsung Exynos SoCs with xHCI + const: samsung,exynos-xhci - description: Generic xHCI device const: xhci-platform deprecated: true From patchwork Thu Dec 29 09:57:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jung Daehwan X-Patchwork-Id: 13083395 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A8C9BC4332F for ; Thu, 29 Dec 2022 10:15:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233288AbiL2KOk (ORCPT ); Thu, 29 Dec 2022 05:14:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230272AbiL2KMg (ORCPT ); Thu, 29 Dec 2022 05:12:36 -0500 Received: from mailout1.samsung.com (mailout1.samsung.com [203.254.224.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA91413F79 for ; Thu, 29 Dec 2022 02:04:19 -0800 (PST) Received: from epcas2p1.samsung.com (unknown [182.195.41.53]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20221229100418epoutp0164a2c51af6b4df1458dee7c721804c43~1O4Aabt3R1118911189epoutp01U for ; Thu, 29 Dec 2022 10:04:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20221229100418epoutp0164a2c51af6b4df1458dee7c721804c43~1O4Aabt3R1118911189epoutp01U DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1672308258; bh=yrMrH+zAEllRQiyZ4imQyuFdt3JAySbiorsThIUkVOY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=P/0QEuXQe2r3g86038BRbd3/qPxkhUBjfqg3yuThldgKwADC5wWc5DfxVGHvrB/eD Kn1twQiUMSXHqItFANaAGdiJtPZ30cvCFqEfJjfw2BrlG628YOuk+rgNCnfNbj6squ 89gWsXauE7W9zx/AMwaJoouX3ibEvryq78MPOmik= Received: from epsnrtp1.localdomain (unknown [182.195.42.162]) by epcas2p2.samsung.com (KnoxPortal) with ESMTP id 20221229100417epcas2p2b5eb2b3af79011011765ea5ddc2cf7db~1O3-7vx8r1066110661epcas2p2P; Thu, 29 Dec 2022 10:04:17 +0000 (GMT) Received: from epsmges2p4.samsung.com (unknown [182.195.36.100]) by epsnrtp1.localdomain (Postfix) with ESMTP id 4NjPB91Js1z4x9Py; Thu, 29 Dec 2022 10:04:17 +0000 (GMT) Received: from epcas2p1.samsung.com ( [182.195.41.53]) by epsmges2p4.samsung.com (Symantec Messaging Gateway) with SMTP id 56.28.15497.1266DA36; Thu, 29 Dec 2022 19:04:17 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas2p1.samsung.com (KnoxPortal) with ESMTPA id 20221229100416epcas2p18f7600737b8f4149a1d75d2d8db3317a~1O3-LFLOT1797217972epcas2p1J; Thu, 29 Dec 2022 10:04:16 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20221229100416epsmtrp1748bb5a2d8b4f1b8a8e088f7428482d6~1O3-KNsJz2828628286epsmtrp1C; Thu, 29 Dec 2022 10:04:16 +0000 (GMT) X-AuditID: b6c32a48-225ff70000023c89-91-63ad6621f569 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 16.1F.02211.0266DA36; Thu, 29 Dec 2022 19:04:16 +0900 (KST) Received: from ubuntu.dsn.sec.samsung.com (unknown [10.229.95.128]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20221229100416epsmtip2379f4dc3c814cbc84ac01355a185ef29~1O3_7jeuy2157121571epsmtip2Y; Thu, 29 Dec 2022 10:04:16 +0000 (GMT) From: Daehwan Jung To: Greg Kroah-Hartman , Rob Herring , Krzysztof Kozlowski , Thinh Nguyen , Mathias Nyman , Felipe Balbi Cc: linux-usb@vger.kernel.org (open list:USB SUBSYSTEM), devicetree@vger.kernel.org (open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS), linux-kernel@vger.kernel.org (open list), sc.suh@samsung.com, taehyun.cho@samsung.com, jh0801.jung@samsung.com, eomji.oh@samsung.com, Daehwan Jung Subject: [RFC PATCH v2 3/3] dt-bindings: usb: snps,dwc3: add generic-xhci as child Date: Thu, 29 Dec 2022 18:57:46 +0900 Message-Id: <1672307866-25839-4-git-send-email-dh10.jung@samsung.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1672307866-25839-1-git-send-email-dh10.jung@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupgk+LIzCtJLcpLzFFi42LZdljTVFcxbW2ywZ8Z7BbH2p6wW8w/co7V 4s6CaUwWp5YvZLJoXryezeLuwx8sFn0vHjJbXN41h81i0bJWZovmTVNYLVr3HmG36Lp7g9Fi 0kFRi1ULDrA78Hks3vOSyWPTqk42jzvX9rB57J+7ht2jb8sqRo8t+z8zenzeJBfAHpVtk5Ga mJJapJCal5yfkpmXbqvkHRzvHG9qZmCoa2hpYa6kkJeYm2qr5OIToOuWmQN0spJCWWJOKVAo ILG4WEnfzqYov7QkVSEjv7jEVim1ICWnwLxArzgxt7g0L10vL7XEytDAwMgUqDAhO+P2hOWM Bed4Kr7NXczWwHiWs4uRk0NCwETi1fI5zF2MXBxCAjsYJT5cncAO4XxilPg8+yQLhPONUWLN ltVsMC077p1mhUjsZZRY/uElVMsPRomeVw+AWjg42AS0JL4vZASJiwh0MUlsu/MVbBSzwBEm iY0zTjGCjBIWCJF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G5Gib4XWRBxSYml c2+wQ9jCEvdbjgDVcAHVfGOUODjrAlsXIwcHm4CWxPeFjCBxEYEeJomFU7aygTjMAqeYJG4d f8UE0i0sECTRcacFbBKLgKrE9v+rmEFsXgFXiZZVfVAb5CRunusEi3MKuEm0b/3BAnGRq8SF 7n9sExj5FjAyrGKUTC0ozk3PLTYsMMxLLdcrTswtLs1L10vOz93ECA5nLc0djNtXfdA7xMjE wXiIUYKDWUmEV+Ps6mQh3pTEyqrUovz4otKc1OJDjNIcLErivBe6TsYLCaQnlqRmp6YWpBbB ZJk4OKUamHIzNF6rFnCZbzhY9PK5BItBSOqmvwaWKcc2fN7Y/6L2dfUUx073ZcefPLcxvMK7 pYOfU36h/y4m59MObKr6zBOck90unDCsPyGoGi/F2lnq4um+PHTLaa6zZZcdmlbLR+hNO7Yu 6lr0+n8nVy/8ciznT5hDoHOEz3GRDT133olmZWufbju2kfOytMoktlNRdy8cYLj06PZLuVVL 3+3R+uQ2y8diY98Wm6S7IVt/8639l6n6vlLW7rq1YoBkX3SDZrNO6Kr93cs92lg+XhcPiJFc f3ny2UcJgg67JXwqD32bGN6511XQS7/pnLbQ3l0zOBOyded1+T2cFrymxWh/OefMcwLzzG/t UJDpMJs6Q4mlOCPRUIu5qDgRAAJnJWXWAgAA X-CMS-MailID: 20221229100416epcas2p18f7600737b8f4149a1d75d2d8db3317a X-Msg-Generator: CA X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20221229100416epcas2p18f7600737b8f4149a1d75d2d8db3317a References: <1672307866-25839-1-git-send-email-dh10.jung@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Currently, dwc3 invokes just xhci platform driver(generic-xhci) without DT schema even though xhci works as child of dwc3. It makes sense to add xhci as child of dwc3 with DT schema. It also supports to use another compatible in xhci platform driver. Signed-off-by: Daehwan Jung --- .../devicetree/bindings/usb/snps,dwc3.yaml | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/Documentation/devicetree/bindings/usb/snps,dwc3.yaml b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml index 6d78048c4613..83ed7c526dba 100644 --- a/Documentation/devicetree/bindings/usb/snps,dwc3.yaml +++ b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml @@ -360,8 +360,22 @@ properties: description: Enable USB remote wakeup. + "#address-cells": + enum: [ 1, 2 ] + + "#size-cells": + enum: [ 1, 2 ] + + ranges: true + unevaluatedProperties: false +# Required child node: +patternProperties: + "^usb@[0-9a-f]+$": + $ref: generic-xhci.yaml# + description: Required child node + required: - compatible - reg @@ -388,4 +402,19 @@ examples: snps,dis_u2_susphy_quirk; snps,dis_enblslpm_quirk; }; + - | + usb@4a200000 { + compatible = "snps,dwc3"; + reg = <0x4a200000 0xcfff>; + interrupts = <0 92 4>; + #address-cells = <1>; + #size-cells = <1>; + ranges; + + xhci: usb@4a200000 { + compatible = "generic-xhci"; + reg = <0x4a200000 0x7fff>; + interrupts = <0 92 4>; + }; + }; ...