From patchwork Fri May 31 06:07:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jung Daehwan X-Patchwork-Id: 802289 Received: from mailout4.samsung.com (mailout4.samsung.com [203.254.224.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0EE6180605 for ; Fri, 31 May 2024 06:07:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=203.254.224.34 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717135660; cv=none; b=uoknCd+9/Weoqh89c/+W19RhuEST7UfNduVPLPuiFnpMVmeh66GDg9FR4xSNlNsbDj+BlmURa7IRc9eoU15LN2+YmgK11osmNdCIS+jz+RcSW01xZX/Ho6Y65PHrjuFjvkLlv88rb+PzLLqqyATncV48wiyKNKAgPbUHFCQunjM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717135660; c=relaxed/simple; bh=ztBD1+4ywqM0nXn1kAdyVLehSdMYI6JTkjbKqKWqqoI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:Content-Type: References; b=ryNUhlWqM/b65etBREF66zHbubMa1IZ1OecsY529jB1nCJhMIMIOg/3BkNBfvaFRUJpD5Sx4oNH7DS5GaERUGAwPjBbQJiP1uUionlGGMyuHIK4nG8GsU/PxO1WBBwVffO717kLUvf+UkD0OZxyR9VZuF/zNwjwB/j6+wK410+U= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com; spf=pass smtp.mailfrom=samsung.com; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b=vNhOn7LM; arc=none smtp.client-ip=203.254.224.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=samsung.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="vNhOn7LM" Received: from epcas2p4.samsung.com (unknown [182.195.41.56]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20240531060730epoutp04bd49a2780803f334aa3d147b5ff78e1c~UfcbQgaX60512105121epoutp043 for ; Fri, 31 May 2024 06:07:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20240531060730epoutp04bd49a2780803f334aa3d147b5ff78e1c~UfcbQgaX60512105121epoutp043 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1717135650; bh=3V4t3/0ViKN3UkTN27Ig4BCruu4Zw1qFxlhky6SuapE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vNhOn7LMoghUVqMo+QUosmkUk+/Yogcl1MhcxwnIHiAz5hsAnSnQGg32DmGgpTTcf xtImDonIGw5f+PuRxXIp9IsulqEdlPZoTQU/aGXKlkZDdpW8MKGeeEufcL5lk+ew9r 5PCIGk49UFQ9pgjgWFtiSNZf1yzIBhVHe5oijyyI= Received: from epsnrtp4.localdomain (unknown [182.195.42.165]) by epcas2p3.samsung.com (KnoxPortal) with ESMTP id 20240531060730epcas2p33fd374ae51704f064c2ea62e4e41f6dc~UfcayXOZC1346913469epcas2p3m; Fri, 31 May 2024 06:07:30 +0000 (GMT) Received: from epsmges2p3.samsung.com (unknown [182.195.36.91]) by epsnrtp4.localdomain (Postfix) with ESMTP id 4VrCMP5Fmpz4x9Px; Fri, 31 May 2024 06:07:29 +0000 (GMT) Received: from epcas2p3.samsung.com ( [182.195.41.55]) by epsmges2p3.samsung.com (Symantec Messaging Gateway) with SMTP id 18.FC.09806.12969566; Fri, 31 May 2024 15:07:29 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas2p2.samsung.com (KnoxPortal) with ESMTPA id 20240531060729epcas2p2d895a441b017f1797b1bc1e2558d9e1b~UfcZ13d9M0800108001epcas2p2V; Fri, 31 May 2024 06:07:29 +0000 (GMT) Received: from epsmgms1p2new.samsung.com (unknown [182.195.42.42]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20240531060729epsmtrp2601b90f299bcb9298ce4ad92243bff4b~UfcZ06qn13247032470epsmtrp24; Fri, 31 May 2024 06:07:29 +0000 (GMT) X-AuditID: b6c32a47-ecbfa7000000264e-57-665969214e10 Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgms1p2new.samsung.com (Symantec Messaging Gateway) with SMTP id 1D.9F.08622.12969566; Fri, 31 May 2024 15:07:29 +0900 (KST) Received: from ubuntu.dsn.sec.samsung.com (unknown [10.229.95.128]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20240531060729epsmtip1c777a53131abaf67f0c939c1450f7604~UfcZnE_nt0034900349epsmtip1R; Fri, 31 May 2024 06:07:29 +0000 (GMT) From: Daehwan Jung To: Greg Kroah-Hartman , Rob Herring , Krzysztof Kozlowski , Conor Dooley , 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), Daehwan Jung Subject: [PATCH v2 2/5] usb: dwc3: Support quirk for writing high-low order Date: Fri, 31 May 2024 15:07:34 +0900 Message-Id: <1717135657-120818-3-git-send-email-dh10.jung@samsung.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1717135657-120818-1-git-send-email-dh10.jung@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrOKsWRmVeSWpSXmKPExsWy7bCmua5iZmSawZ0NKhbH2p6wW6zZe47J Yv6Rc6wWdxZMY7JoXryezeLlrHtsFpd3zWGzWLSsldmiedMUVov/e3awW6xacIDdgdtj8Z6X TB6b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A X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20240531060729epcas2p2d895a441b017f1797b1bc1e2558d9e1b References: <1717135657-120818-1-git-send-email-dh10.jung@samsung.com> Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Set xhci "write-64-hi-lo-quirk" property via "snps,xhci-write-64-hi-lo-quirk" property. Signed-off-by: Daehwan Jung --- drivers/usb/dwc3/core.c | 3 +++ drivers/usb/dwc3/core.h | 2 ++ drivers/usb/dwc3/host.c | 5 ++++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index 7ee61a8..89985fd 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -1716,6 +1716,9 @@ static void dwc3_get_properties(struct dwc3 *dwc) dwc->dis_split_quirk = device_property_read_bool(dev, "snps,dis-split-quirk"); + dwc->xhci_write_64_hi_lo_quirk = device_property_read_bool(dev, + "snps,xhci-write-64-hi-lo-quirk"); + dwc->lpm_nyet_threshold = lpm_nyet_threshold; dwc->tx_de_emphasis = tx_de_emphasis; diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h index 3781c73..ab5913c 100644 --- a/drivers/usb/dwc3/core.h +++ b/drivers/usb/dwc3/core.h @@ -1142,6 +1142,7 @@ struct dwc3_scratchpad_array { * 3 - Reserved * @dis_metastability_quirk: set to disable metastability quirk. * @dis_split_quirk: set to disable split boundary. + * @xhci_write_64_hi_lo_quirk: set if we enable quirk for writing in high-low order. * @sys_wakeup: set if the device may do system wakeup. * @wakeup_configured: set if the device is configured for remote wakeup. * @suspended: set to track suspend event due to U3/L2. @@ -1369,6 +1370,7 @@ struct dwc3 { unsigned dis_metastability_quirk:1; unsigned dis_split_quirk:1; + unsigned xhci_write_64_hi_lo_quirk:1; unsigned async_callbacks:1; unsigned sys_wakeup:1; unsigned wakeup_configured:1; diff --git a/drivers/usb/dwc3/host.c b/drivers/usb/dwc3/host.c index a171b27..8cc0def 100644 --- a/drivers/usb/dwc3/host.c +++ b/drivers/usb/dwc3/host.c @@ -126,7 +126,7 @@ static int dwc3_host_get_irq(struct dwc3 *dwc) int dwc3_host_init(struct dwc3 *dwc) { - struct property_entry props[5]; + struct property_entry props[6]; struct platform_device *xhci; int ret, irq; int prop_idx = 0; @@ -162,6 +162,9 @@ int dwc3_host_init(struct dwc3 *dwc) props[prop_idx++] = PROPERTY_ENTRY_BOOL("xhci-sg-trb-cache-size-quirk"); + if (dwc->xhci_write_64_hi_lo_quirk) + props[prop_idx++] = PROPERTY_ENTRY_BOOL("write-64-hi-lo-quirk"); + if (dwc->usb3_lpm_capable) props[prop_idx++] = PROPERTY_ENTRY_BOOL("usb3-lpm-capable");