From patchwork Wed May 13 07:15:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Wang X-Patchwork-Id: 1188 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pl1-f200.google.com (mail-pl1-f200.google.com [209.85.214.200]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id CFABE3F066 for ; Wed, 13 May 2020 09:15:55 +0200 (CEST) Received: by mail-pl1-f200.google.com with SMTP id f3sf12053345plo.14 for ; Wed, 13 May 2020 00:15:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1589354154; cv=pass; d=google.com; s=arc-20160816; b=ov0OKsiipyS0bxXzlbUFYqDkN6+07gw3JcCoJT4R8wi8ovbGaM4Zs0WNeZYosqBI7K WLIF0sw/+IE4yXkt9ZqyCgJ4PO+j4sBul7N3u9m5qNWVPom3BH5dq0vFnyvSYWajG6cS hSPLXShlx63xVjb4bnvWDBSj8Fv5ePD3noR0aSFGH1MbRbScEKPZGeEtR+gzTCCDytzp h2xbYdKk9zQfgMEj/AyChxiWvFHcEMpwa2dKATSn9OO/hAS1C/XXSi191XTd46TfPy/W H4YImjJ5myX2q01v2LHxp+L5NDNRas/UfsuL66mGmPuGt22gDhioc4hqzjjYAbVfjGb+ WnIA== 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=zQ7jV0vB5KgTwwOQY7c1thExU7kqIESeQ3qHlzGqRVg=; b=dU7KLr4gDgBgM/Qpk/KOK5exzT7+sL10Xp8s05iUlHAGHCfoe+3LYNls47fNIcI9JR wDdabpC4CaQ3EgdenAyU/hrDUFOsole1swViyN5Ma9l1yI3BMysqtuLev4iRnp0ByWtO kKzvzvi5Qe+J5/D4QX4/Yoqj1TNY3g0A3ZxJQESYLyhEI4rqUUqJsvqSuuaBfwO4COvC qLIcHVnEOIv2uk9bJ69VOGQ1VHP2VqxLGBOBkRFaGwz+NMu0rAwFG0DUJpZsncBF4aaM qK/nQCoryexnL7VntOcQcuX8ay/ftFS45AmX2vHawALJcb3qapmmTUqyGivuVrPR5wqz 8b2g== ARC-Authentication-Results: i=2; mx.google.com; spf=pass (google.com: domain of frank.wang@rock-chips.com designates 211.157.147.133 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=zQ7jV0vB5KgTwwOQY7c1thExU7kqIESeQ3qHlzGqRVg=; b=rD+9gMYb6sX6CuMvAqKtFNWuFS0LipJ6uu8HQDaBOTjjiBVlWJcwSKTCWc+uNZsboE Jy6RACDl7n3C7qD36T2vGyIss9T29S8wC9vtk14iWQn/KGEdtQmHrJJ4qMF+uSGUEooc TanyXLuw+6p3Qi4qQRTjrXdKOdDO+TCA1geTU= 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=zQ7jV0vB5KgTwwOQY7c1thExU7kqIESeQ3qHlzGqRVg=; b=k7GilDA0dcE+U+3PG5HPtGNifl2sG78FC1JHf2ORQwrCsJVnpFtfrrVi+/9XWYH0H+ NLMdiwhzciXXO33mHY02G2ve/MwUNj7/QHnQN+iIlgn3CH98+o7B/cHgpT0AxWAulXwn plH9IKzgSpdIU0L2w7jLfqC/kUl0TWyXEcPeZRcJjTCA10X4GdyH9ok74Vg1UBXHH8S8 5zbyOVnI0OB3qj7c/S9mTvw4Dr/jEsLUpSdyfv4o6TDy7Gqf/58s6ROhpzoT6d4ey3aD E4pY/JbcZv2tiGwQSxzhRJRd/hAUyRL6Qbu+Bi8oT9t1L9qJEw3xOKg769WmSmZ6XceN A4oA== Sender: linux-amarula@amarulasolutions.com X-Gm-Message-State: AGi0PuYlLp4CYy2Af6O4Edj6StwOBNohgCw8wuF6g7hFKj5RP0wq6ASL qFr1jvC5hcQZLpBNNl+a+4Bn/xo3 X-Google-Smtp-Source: APiQypI/K+IyVpbcXoXVJF3FX2J1GhTAWjudNAgyfv2/OUCzfeAXsDR95A10GdTD2kXNPODwQUk4zw== X-Received: by 2002:a17:90a:3545:: with SMTP id q63mr33701455pjb.109.1589354154616; Wed, 13 May 2020 00:15:54 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a62:920e:: with SMTP id o14ls414956pfd.4.gmail; Wed, 13 May 2020 00:15:54 -0700 (PDT) X-Received: by 2002:a62:7d8c:: with SMTP id y134mr26029979pfc.231.1589354154112; Wed, 13 May 2020 00:15:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589354154; cv=none; d=google.com; s=arc-20160816; b=QwRQ208JRqmkBBG0vQbly2dpnPxj+Bz/f3rBWNHztlFUgI9BRdRG1fpb1YG9T5IuHO CmBQLQH3sYjpN/29van7KUBrVuE6RzMQ0ROktf7MxTbCiVIRYoESfyB/1DgZDKpwWQi4 flID3JKpaULMGJMMTQJPOWe4aeQzjTm9glN9S7ezeVCx16nUokF0VE9buJy1mUDYjDbb ykwx3K0weTLqPYOlrZQl3AksdvaGXGCA2yqQb3Gu0YsXQ2D6tslyM7N9EVrSkI/er+OD tjoDB5/K53BAbOA+aSwcjJi9KHXs/lgOttKGcqqe9rDQGFaKNIQTimAUrnh/1UbE+6D4 vH3g== 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=2Fzx52TZfLBERSuL4keI2pH1V2y3+3NjowmcHy9G9BE=; b=keNzA+dsUjypkHfptPB3M/dhbYH63ecx05+lipfq3d1tPHLJK6n8/5wldzTQ/ZiwWi Dvi82uuZ9wc1fhsNDACqXe+KrTPGXIwy6TmRT7MVzXoaW7UA0CTs4H28mLRkUwL2ba2B xXsaUoHLDfXv6CCrIWO8nHUPfToZCUCkqqsO7TDG1Us0hB+28nklLWKmtLmqwZJ6uQq3 ZxiO90vD7vJPdtU3ew/72iQb3mqqc8CvtlqEt4CzvCWpoJcYrENXWAaWqXHAFWXX1O57 oebO+U7f8ygVOV6TODgRjMMC2iuhhXngsP+/Z+lhor/wHwmALHTsBbu92rVwxhreqELO friA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of frank.wang@rock-chips.com designates 211.157.147.133 as permitted sender) smtp.mailfrom=frank.wang@rock-chips.com Received: from lucky1.263xmail.com (lucky1.263xmail.com. [211.157.147.133]) by mx.google.com with ESMTPS id ep22si12498672pjb.115.2020.05.13.00.15.53 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 May 2020 00:15:54 -0700 (PDT) Received-SPF: pass (google.com: domain of frank.wang@rock-chips.com designates 211.157.147.133 as permitted sender) client-ip=211.157.147.133; Received: from localhost (unknown [192.168.167.16]) by lucky1.263xmail.com (Postfix) with ESMTP id A6A9DB3321; Wed, 13 May 2020 15:15:52 +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:53 +0800 (CST) X-IP-DOMAINF: 1 X-UNIQUE-TAG: <988c85494086fbfbf59b4e90dcdfebe1> 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 07/16] usb: dwc3: add dis_enblslpm_quirk Date: Wed, 13 May 2020 15:15:37 +0800 Message-Id: <20200513071546.5560-3-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.133 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.ENBLSLPM bit, which controls whether the PHY receives the suspend signal from the controller. Refer to commit ec791d149bca("usb: dwc3: Add dis_enblslpm_quirk") in Linux 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 0972e458eb..20be617fd4 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -398,6 +398,9 @@ static void dwc3_phy_setup(struct dwc3 *dwc) if (dwc->dis_u2_susphy_quirk) reg &= ~DWC3_GUSB2PHYCFG_SUSPHY; + if (dwc->dis_enblslpm_quirk) + reg &= ~DWC3_GUSB2PHYCFG_ENBLSLPM; + dwc3_writel(dwc->regs, DWC3_GUSB2PHYCFG(0), reg); mdelay(100); @@ -719,6 +722,7 @@ int dwc3_uboot_init(struct dwc3_device *dwc3_dev) 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->dis_enblslpm_quirk = dwc3_dev->dis_enblslpm_quirk; dwc->tx_de_emphasis_quirk = dwc3_dev->tx_de_emphasis_quirk; if (dwc3_dev->tx_de_emphasis) @@ -926,6 +930,8 @@ void dwc3_of_parse(struct dwc3 *dwc) "snps,dis_u2_susphy_quirk"); dwc->dis_del_phy_power_chg_quirk = dev_read_bool(dev, "snps,dis-del-phy-power-chg-quirk"); + dwc->dis_enblslpm_quirk = dev_read_bool(dev, + "snps,dis_enblslpm_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 7f45a9c459..e76e357f1e 100644 --- a/drivers/usb/dwc3/core.h +++ b/drivers/usb/dwc3/core.h @@ -162,6 +162,7 @@ /* Global USB2 PHY Configuration Register */ #define DWC3_GUSB2PHYCFG_PHYSOFTRST (1 << 31) #define DWC3_GUSB2PHYCFG_SUSPHY (1 << 6) +#define DWC3_GUSB2PHYCFG_ENBLSLPM (1 << 8) #define DWC3_GUSB2PHYCFG_PHYIF(n) ((n) << 3) #define DWC3_GUSB2PHYCFG_PHYIF_MASK DWC3_GUSB2PHYCFG_PHYIF(1) #define DWC3_GUSB2PHYCFG_USBTRDTIM(n) ((n) << 10) @@ -822,6 +823,7 @@ struct dwc3 { unsigned dis_u3_susphy_quirk:1; unsigned dis_u2_susphy_quirk:1; unsigned dis_del_phy_power_chg_quirk:1; + unsigned dis_enblslpm_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 ecae34bf06..98d51e05e1 100644 --- a/include/dwc3-uboot.h +++ b/include/dwc3-uboot.h @@ -34,6 +34,7 @@ struct dwc3_device { unsigned dis_u3_susphy_quirk; unsigned dis_u2_susphy_quirk; unsigned dis_del_phy_power_chg_quirk; + unsigned dis_enblslpm_quirk; unsigned tx_de_emphasis_quirk; unsigned tx_de_emphasis; int index;