From patchwork Wed May 13 07:15:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Wang X-Patchwork-Id: 1197 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pj1-f70.google.com (mail-pj1-f70.google.com [209.85.216.70]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id D2F2C3F066 for ; Wed, 13 May 2020 09:17:56 +0200 (CEST) Received: by mail-pj1-f70.google.com with SMTP id 9sf22634717pjz.6 for ; Wed, 13 May 2020 00:17:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1589354275; cv=pass; d=google.com; s=arc-20160816; b=S5om3lq09Bi1P5DoXnGK8bkM2EQQpDhSRz+cu1GQAQFPwjoFT3q7DaEA4kOq8NV/4X znEYz5+KnVJcv5G6lBRQ/YABAxJjsw+Qk+wkT4HtTrMaLXHha3oWyC0i/BuZ6x738JU0 cvwcVui+8a4WuchHWBbIJJsk+ZIJtOcPuyVZ/sZoxvO4b6f4EaxzdsMGgSI+u1CPvOSE D7KM68ChIVmlSzpuCO80IiFtDAnxw5JsV9OPlqTrdenLyHGEARmt7gpyA2zvFBKbCr0j 3rZPl3g9UWhR4IfhqB4VXKG68XAIR/IjrIT8sLCe3lrUQivZlwaNDYPWkGIwT0/6AFAK BxOg== 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:sender:dkim-signature; bh=4AOiEItqNQBMBaG5MJlym4sDbASnhFe3lZDElJulYKI=; b=Oebbd20HMjzamMgDuAug3LPZOCT6jJdPzEpY+URnfXW6UaucUoYVkmifT0s3G+opXy /Mevy8nZJGoZr6JfsXvWh/brpnHPooEbSajsY/ryreOQhq/nM0GFzB86NrPP61ZZVnbp 5Z8y+ZWuE0oIM4sX5te2iTRiyuCpC90j1s3PinCwVeHJSiiTAtDlPcW9WBTbqSeogWk2 ItKDuLE2SH6i77hwJyXNz8dZsNFGXC7NftOWep9sNGldRg0RNcc7SOFsrjKoU9Y8CnsJ MY7bgwO4psyhjvkOX2+TVnMXYIArjetD/GjYVT/jVYzO7KvZf8q6JwVOB/BQz2MoL7ws Bfag== ARC-Authentication-Results: i=2; mx.google.com; spf=pass (google.com: domain of frank.wang@rock-chips.com designates 211.157.147.130 as permitted sender) smtp.mailfrom=frank.wang@rock-chips.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=sender: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=4AOiEItqNQBMBaG5MJlym4sDbASnhFe3lZDElJulYKI=; b=Ndy/WBREB9/Y5dWKzs8crOP1drXR/MtjQBFGuPDPj422nreWL9klrHXQJYWykjA6cr jgsj3OGg+ziFP35n95hfDdyvOzLldkgoHhlGssisH9/wMr34MgGj4G52bqrYw+jUPIRE 05CeYh11HuTFOX/vMqK7Uopz2cPeagQiqJg04= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender: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=4AOiEItqNQBMBaG5MJlym4sDbASnhFe3lZDElJulYKI=; b=E+G99Ft1m2X4mzDH1T7CWCZsOhm6QcfB0QSF39Qy24GPW+VlrPZP6JgLcnuwgoYYZ8 pTxq/h6Q0m+ZsQlziABDjtglI4QQuCXawt9ypiewbpirK7m7MBfw7YxUVOxFV60JLVH+ Ukv8+LlEK2YU1ohgpQu6Rph6elmBZuiK76/Ib2XiC2Wlah2h+MP8D6SUZVmT5CIRr6iF hMdfYsfscJ0x0VkslPQYUXpGjmNQ2aeVP0TV2k/adjTxpELeWsml4se9e7csV+qrjATK YvCJ/3YnHJbkyMXtHF9aFooTXqvpG8+yM+V5bhmfLfbmYz/AvbkAH7d+UfqDOb+WKaeh bYng== Sender: linux-amarula@amarulasolutions.com X-Gm-Message-State: AGi0Pua+DoXk01W9UJmyXdoxqimVywVfyHZHKXzkvtwW+/jA1ezAguAU RPV5CEOqNR5ABHJgoSJuH375dmIC X-Google-Smtp-Source: APiQypJkFrvbXi8IUsqr19eKj48iACNwygAJgbIh6KIiDDbnZVJs7pZ60FZSEBN4ZC54xES84+1RPw== X-Received: by 2002:a62:2bcb:: with SMTP id r194mr24864373pfr.26.1589354275587; Wed, 13 May 2020 00:17:55 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90a:e283:: with SMTP id d3ls600692pjz.2.gmail; Wed, 13 May 2020 00:17:55 -0700 (PDT) X-Received: by 2002:a17:902:76c6:: with SMTP id j6mr21776337plt.342.1589354274933; Wed, 13 May 2020 00:17:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589354274; cv=none; d=google.com; s=arc-20160816; b=dkMRkJ7Kf+hYNTPgMuuqs9SP7qs1MrHjodldb7HQyAJloODNszC8faEy7nRWAVDq3G ktaiHjBbKLKen+GI6dAscriU4YODxNy34ludzd3yojbdNtpMKcoJZpEhQy/R7XVMBddD iJtE8d65ihGMF87TjY58LoT1al2MU56SbtDl4LwxqqIFEuuk2nEcyQ4jiQEf9SXHuzrf IggtlBC6GU5epee8RISGMvFl1gacOdvwCZ1YkC76GewbirWOEdEmNqkw49eBef7Ftb5Y wA8m9cJP5aHXHQZFePASku2anp4t65tVQ5099C18E8R9F9ck8WMUeRRks1AoToXcaeGm 67Kg== 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; bh=voR2mC0dTFw76/rCrO/CMjej4Bfdg0/gQJz9bWnsGIU=; b=Zs61ajumtlWmGhVDqpSSzB4UOowkPfnUG2qgaid5ayYQNfsJbkd4kOrF3ToOT5O3KW 8md/4DiDAjjsTtKXNNA6X9/sjz8TL7mdNvepCv9lsR/p44ll5cnvG2JyqseuRK05mGM9 H2vIbZOocGETI49kKM4qpDImT6NU5OjRfpPTLNN6aqlFUiLRj3E6Cl8DwSSbofIlq6oZ LeC+PcWhynz9oaI97BvEsUuACikqmYj31lvpF4ciKjeJ1NCnHbt6+mp0GFB2lZe/kzx9 8+NW4yYC/s9IoNZhDYRjzELFmG6yhADbCpOSLBYP7c4w3ZDI47i05Ixl+M0QPo1VTuYL jO5A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of frank.wang@rock-chips.com designates 211.157.147.130 as permitted sender) smtp.mailfrom=frank.wang@rock-chips.com Received: from lucky1.263xmail.com (lucky1.263xmail.com. [211.157.147.130]) by mx.google.com with ESMTPS id w25si6998990pgc.114.2020.05.13.00.17.54 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 May 2020 00:17:54 -0700 (PDT) Received-SPF: pass (google.com: domain of frank.wang@rock-chips.com designates 211.157.147.130 as permitted sender) client-ip=211.157.147.130; Received: from localhost (unknown [192.168.167.16]) by lucky1.263xmail.com (Postfix) with ESMTP id CBAEAB601A; Wed, 13 May 2020 15:15:53 +0800 (CST) X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-ADDR-CHECKED4: 1 X-ANTISPAM-LEVEL: 2 X-ABS-CHECKED: 0 Received: from localhost.localdomain (unknown [58.22.7.114]) by smtp.263.net (postfix) whith ESMTP id P15407T140446440306432S1589354149129638_; Wed, 13 May 2020 15:15:54 +0800 (CST) X-IP-DOMAINF: 1 X-UNIQUE-TAG: X-RL-SENDER: frank.wang@rock-chips.com X-SENDER: wmc@rock-chips.com X-LOGIN-NAME: frank.wang@rock-chips.com X-FST-TO: heiko@sntech.de X-SENDER-IP: 58.22.7.114 X-ATTACHMENT-NUM: 0 X-DNS-TYPE: 0 X-System-Flag: 0 From: Frank Wang To: heiko@sntech.de, marex@denx.de, bmeng.cn@gmail.com, philipp.tomsich@theobroma-systems.com, klaus.goger@theobroma-systems.com, jagan@amarulasolutions.com, sjg@chromium.org, kever.yang@rock-chips.com Cc: u-boot@lists.denx.de, linux-rockchip@lists.infradead.org, linux-amarula@amarulasolutions.com, marek.belisko@gmail.com, william.wu@rock-chips.com, jianing.ren@rock-chips.com, chenjh@rock-chips.com, wmc@rock-chips.com, Frank Wang Subject: [PATCH v5 08/16] usb: dwc3: add dis_u2_freeclk_exists_quirk Date: Wed, 13 May 2020 15:15:38 +0800 Message-Id: <20200513071546.5560-4-frank.wang@rock-chips.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200513071546.5560-1-frank.wang@rock-chips.com> References: <20200513071344.5430-1-frank.wang@rock-chips.com> <20200513071546.5560-1-frank.wang@rock-chips.com> X-Original-Sender: frank.wang@rock-chips.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of frank.wang@rock-chips.com designates 211.157.147.130 as permitted sender) smtp.mailfrom=frank.wang@rock-chips.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 GUSB2PHYCFG.U2_FREECLK_EXISTS bit, which specifies whether the USB2.0 PHY provides a free-running PHY clock, which is active when the clock control input is active. Refer to commit 27f83eeb6b42("usb: dwc3: add dis_u2_freeclk_exists_quirk") in Linux Rockchip Kernel. Signed-off-by: Frank Wang Reviewed-by: Kever Yang Reviewed-by: Jagan Teki Tested-by: Jagan Teki --- drivers/usb/dwc3/core.c | 6 ++++++ drivers/usb/dwc3/core.h | 2 ++ include/dwc3-uboot.h | 1 + 3 files changed, 9 insertions(+) diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index 20be617fd4..3cb66515a2 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -401,6 +401,9 @@ static void dwc3_phy_setup(struct dwc3 *dwc) if (dwc->dis_enblslpm_quirk) reg &= ~DWC3_GUSB2PHYCFG_ENBLSLPM; + if (dwc->dis_u2_freeclk_exists_quirk) + reg &= ~DWC3_GUSB2PHYCFG_U2_FREECLK_EXISTS; + dwc3_writel(dwc->regs, DWC3_GUSB2PHYCFG(0), reg); mdelay(100); @@ -723,6 +726,7 @@ int dwc3_uboot_init(struct dwc3_device *dwc3_dev) 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->dis_enblslpm_quirk = dwc3_dev->dis_enblslpm_quirk; + dwc->dis_u2_freeclk_exists_quirk = dwc3_dev->dis_u2_freeclk_exists_quirk; dwc->tx_de_emphasis_quirk = dwc3_dev->tx_de_emphasis_quirk; if (dwc3_dev->tx_de_emphasis) @@ -932,6 +936,8 @@ void dwc3_of_parse(struct dwc3 *dwc) "snps,dis-del-phy-power-chg-quirk"); dwc->dis_enblslpm_quirk = dev_read_bool(dev, "snps,dis_enblslpm_quirk"); + dwc->dis_u2_freeclk_exists_quirk = dev_read_bool(dev, + "snps,dis-u2-freeclk-exists-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 e76e357f1e..c5e656885a 100644 --- a/drivers/usb/dwc3/core.h +++ b/drivers/usb/dwc3/core.h @@ -161,6 +161,7 @@ /* Global USB2 PHY Configuration Register */ #define DWC3_GUSB2PHYCFG_PHYSOFTRST (1 << 31) +#define DWC3_GUSB2PHYCFG_U2_FREECLK_EXISTS (1 << 30) #define DWC3_GUSB2PHYCFG_SUSPHY (1 << 6) #define DWC3_GUSB2PHYCFG_ENBLSLPM (1 << 8) #define DWC3_GUSB2PHYCFG_PHYIF(n) ((n) << 3) @@ -824,6 +825,7 @@ struct dwc3 { unsigned dis_u2_susphy_quirk:1; unsigned dis_del_phy_power_chg_quirk:1; unsigned dis_enblslpm_quirk:1; + unsigned dis_u2_freeclk_exists_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 98d51e05e1..193d225d31 100644 --- a/include/dwc3-uboot.h +++ b/include/dwc3-uboot.h @@ -35,6 +35,7 @@ struct dwc3_device { unsigned dis_u2_susphy_quirk; unsigned dis_del_phy_power_chg_quirk; unsigned dis_enblslpm_quirk; + unsigned dis_u2_freeclk_exists_quirk; unsigned tx_de_emphasis_quirk; unsigned tx_de_emphasis; int index;