From patchwork Wed May 6 07:50:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1155 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pj1-f69.google.com (mail-pj1-f69.google.com [209.85.216.69]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id A16983F1D2 for ; Wed, 6 May 2020 09:51:16 +0200 (CEST) Received: by mail-pj1-f69.google.com with SMTP id l11sf1617693pjz.4 for ; Wed, 06 May 2020 00:51:16 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1588751475; cv=pass; d=google.com; s=arc-20160816; b=GVAfNbbXfAvaH3dFFx4/cz5kAI7Td/hGQQxmuZErHYibmQx4MhFnTxY5GsGhsu48zc segO7TlTIMIteW+kQOgjCS+UMcuS//A7HdxNnKxCtW490s5oxYe+xlzMRaLenVKji/zF GL/6p00GsMRd1huWiXjf7tg2sOxTLWFsPd4CpMEhtvYdTorqXkpd7quppzbrFESueSoj sfSExVHlau9TTPp4pQEvJ0L6TT3dnia3JQr0cJXLpzDXp5CtV1qWw2Bztp0XvYk+akOy cAzzoXdNAJ7gtKJctfnh0LApWeW3H1gsujTZdCxcxQSokLuIRztzkWyj9aZSkg/nuh4i dW4w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:references:in-reply-to:message-id:date :subject:cc:to:from:mime-version:dkim-signature; bh=jZ62OsspO1I4k0P5tmrTwQtOGmxYvSuhYb92e7R4MfI=; b=Lj4vKUquK1f14jqyUw36f5oPM73lVXA+5lJbweVe5O41vMyaDUwjxI/VDnJRKiKLKg jCHA52YFAieoyTOj6AoiXptL8a5vp++ChdltO5cyRfADBK9Wk3eMSOWS+HrMWIbvB57X Y1tsUhQdEbek22smHKinagsLiu0cpXPLgTI7zy/9xUOzxbyc5ZkhUN9NX6alw9V1rT6U TKUDTJir/D0w50mSUl5kn6MijGT5vqpFPD1Hj+/qlG4TykxRFBGoCOB2RNqQzcxViABL atPhN7Ay5MxGpfFp+XZ0Lf4M32WnPDLHw47sLfvVUhm0HR/qVWQ3PEpYqzORwPAFcvxN h2Rw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=SP24HoaQ; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=mime-version:from:to:cc:subject:date:message-id:in-reply-to :references:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=jZ62OsspO1I4k0P5tmrTwQtOGmxYvSuhYb92e7R4MfI=; b=UBOqmkrR0IYaKgJSSYoLMegUZjdqwa8KCgB7nZ1yIa7fY3Dq8G3vivfncj1EaRBHz0 UzzQCwHjGPHS/cB97sDAq4wc+PTMC9fB2iRYPwkp4eVCCm9fXiAlMoqpQmDyd0Y/uZGi yMoSGqREoSfbW0LH/8Z3tQWiPpDr/vRzZhx8Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:to:cc:subject:date:message-id :in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=jZ62OsspO1I4k0P5tmrTwQtOGmxYvSuhYb92e7R4MfI=; b=ppt1AkvvIq/GR26Hxqln7REzh5zohdsymFsoXvo+vKMcS8ZcLufd+/rtTfP5aqAOCj k/1QxX4BxJE85wWH5wILWTUYeFe4g33sQyH9ZKKRd1ODdv1ztgaAusQ7K7J7PxrQVT3M Pxnob/MbJv2HU2kVIDGW3YJSPyhbHcu7sevBrOoTazswWGCNd12N4cc6j8HXFFuwZngE UxxxEsZKUlR68+90GDD8m7obK1cujypq+dcMPKOOZy0FLQN0tjlGYGIpTE55/cpOqioN fgnrQ+P0Euc8sPTsCBFtrnCHZEx8n1KYDNt3EMxfPFaPVttmdRD8RlNmYxy0j8Vt+9By a89g== X-Gm-Message-State: AGi0PuZWYrLqoEZI/ASNWX7oYIeP69QmYYbAnyNn2b4VCK26UOfV7CgC kl+GS1UsXMcH4rlGtOLVrjxs7UJP X-Google-Smtp-Source: APiQypJpyJAqeCHmLRXHFCg3NF7WSjZ/LMaR8PSol/ttZNXlRVYGTkyhdPLYQH6Hq4zKWzt/snPjEw== X-Received: by 2002:a17:90a:d0c3:: with SMTP id y3mr7593765pjw.133.1588751475407; Wed, 06 May 2020 00:51:15 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:9a03:: with SMTP id v3ls1691882plp.11.gmail; Wed, 06 May 2020 00:51:15 -0700 (PDT) X-Received: by 2002:a17:902:bf08:: with SMTP id bi8mr5995297plb.319.1588751474930; Wed, 06 May 2020 00:51:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588751474; cv=none; d=google.com; s=arc-20160816; b=eUMw/4AMyfjMnDXrH3z1S90C+ecbjvjkSHgDa6WZlHqcjXTM3CRVxmhn8A2d4tjU1t cdbcPjEvoD+eSlKQXWAqncj0jHZh+Dxv9psLlgdJSEBMhZ7Z8ozmgQJ86YFnhYiap4sp /H0MxHZT8FE+hjos2l/CLmiIkzD/D1DbyBQh2Q3+Ea1WAPc2mZRbtwRNkpXICHG8RaZp Mk6LncKd9SJQ5Ll45b/nWbbKBvhQt5F6YT0XnPM+cl5RLtRTb7P6JcIBwulsn4Wh2uUk wGKsubEmjjJqXcqv4Og8UQvY/+3tPWDk6KHlrHfdDQ917kujGAyF8hwOp4vFhLYjM8JD FnKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=gUJPo9co6Z5KOWvrWwwrf+/d75bLFFIFHCHrCqTsa6w=; b=omsmAmdZMbKPRy67jiWt/QhOMAMG/u1HLIOREBehNNOd1k8pHp3Cpmi6RG5xqAy5IZ 12oC6lvanysCW1P7wCLzkFwYHfpS3+OJAX3Gzad1KdrQ/FeR/hmEDjrXqmalcEeRvpeM GcTIaqyX6F6YQJV7UF7QcwZ4len+jzRDJ85jZDckPXQiRrUKzOokl9ocGKIfgSFAVbJe G3cSgM48viy+MtW4mgyEe2XxC3D7v8vIKEvSm/7AH64wEAOAVvgOUBGST964mj+jtuk4 +k1n5BLIYJ39dYY3wIwKn1sMS50xd8pI3RjsaH9C6TdZcYdVQGA8F17Lal+SZVCaJZw1 wyCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=SP24HoaQ; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id a1sor1550251plp.28.2020.05.06.00.51.14 for (Google Transport Security); Wed, 06 May 2020 00:51:14 -0700 (PDT) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; X-Received: by 2002:a17:902:7444:: with SMTP id e4mr7140437plt.130.1588751474575; Wed, 06 May 2020 00:51:14 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c809:c7d5:c598:8eeb:af7:7f36]) by smtp.gmail.com with ESMTPSA id y186sm1011133pfy.66.2020.05.06.00.51.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 May 2020 00:51:13 -0700 (PDT) From: Jagan Teki To: kever.yang@rock-chips.com, philipp.tomsich@theobroma-systems.com, Simon Glass , Frank Wang , wmc@rock-chips.com, chenjh@rock-chips.com, heiko@sntech.de Cc: u-boot@lists.denx.de, linux-rockchip@lists.infradead.org, Belisko Marek , linux-amarula@amarulasolutions.com, Jagan Teki , Marek Vasut Subject: [PATCH v2 7/7] usb: dwc3: add dis_del_phy_power_chg_quirk Date: Wed, 6 May 2020 13:20:25 +0530 Message-Id: <20200506075025.1677-8-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200506075025.1677-1-jagan@amarulasolutions.com> References: <20200506075025.1677-1-jagan@amarulasolutions.com> X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=SP24HoaQ; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Add a quirk to clear the GUSB3PIPECTL.DELAYP1TRANS bit, which specifies whether disable delay PHY power change from P0 to P1/P2/P3 when link state changing from U0 to U1/U2/U3 respectively. Reference from below Linux commit, commit <00fe081dc3a3> ("usb: dwc3: add dis_del_phy_power_chg_quirk") Cc: Marek Vasut Signed-off-by: Jagan Teki --- Changes for v2: - new patch drivers/usb/dwc3/core.c | 6 ++++++ drivers/usb/dwc3/core.h | 1 + include/dwc3-uboot.h | 1 + 3 files changed, 8 insertions(+) diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index 4ec3f6df6a..6e438e5604 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -377,6 +377,9 @@ static void dwc3_phy_setup(struct dwc3 *dwc) if (dwc->dis_u3_susphy_quirk) reg &= ~DWC3_GUSB3PIPECTL_SUSPHY; + if (dwc->dis_del_phy_power_chg_quirk) + reg &= ~DWC3_GUSB3PIPECTL_DEPOCHANGE; + dwc3_writel(dwc->regs, DWC3_GUSB3PIPECTL(0), reg); mdelay(100); @@ -715,6 +718,7 @@ int dwc3_uboot_init(struct dwc3_device *dwc3_dev) dwc->rx_detect_poll_quirk = dwc3_dev->rx_detect_poll_quirk; dwc->dis_u3_susphy_quirk = dwc3_dev->dis_u3_susphy_quirk; dwc->dis_u2_susphy_quirk = dwc3_dev->dis_u2_susphy_quirk; + dwc->dis_del_phy_power_chg_quirk = dwc3_dev->dis_del_phy_power_chg_quirk; dwc->tx_de_emphasis_quirk = dwc3_dev->tx_de_emphasis_quirk; if (dwc3_dev->tx_de_emphasis) @@ -975,6 +979,8 @@ void dwc3_of_parse(struct dwc3 *dwc) "snps,dis_u3_susphy_quirk"); dwc->dis_u2_susphy_quirk = dev_read_bool(dev, "snps,dis_u2_susphy_quirk"); + dwc->dis_del_phy_power_chg_quirk = dev_read_bool(dev, + "snps,dis-del-phy-power-chg-quirk"); dwc->tx_de_emphasis_quirk = dev_read_bool(dev, "snps,tx_de_emphasis_quirk"); tmp = dev_read_u8_array_ptr(dev, "snps,tx_de_emphasis", 1); diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h index 1c08a2c5b6..7f45a9c459 100644 --- a/drivers/usb/dwc3/core.h +++ b/drivers/usb/dwc3/core.h @@ -821,6 +821,7 @@ struct dwc3 { unsigned rx_detect_poll_quirk:1; unsigned dis_u3_susphy_quirk:1; unsigned dis_u2_susphy_quirk:1; + unsigned dis_del_phy_power_chg_quirk:1; unsigned tx_de_emphasis_quirk:1; unsigned tx_de_emphasis:2; diff --git a/include/dwc3-uboot.h b/include/dwc3-uboot.h index 3c9e204cf0..f5086fb946 100644 --- a/include/dwc3-uboot.h +++ b/include/dwc3-uboot.h @@ -32,6 +32,7 @@ struct dwc3_device { unsigned rx_detect_poll_quirk; unsigned dis_u3_susphy_quirk; unsigned dis_u2_susphy_quirk; + unsigned dis_del_phy_power_chg_quirk; unsigned tx_de_emphasis_quirk; unsigned tx_de_emphasis; int index;