From patchwork Mon Feb 5 14:12:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roger Quadros X-Patchwork-Id: 196845 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:168b:b0:106:860b:bbdd with SMTP id ma11csp922537dyb; Mon, 5 Feb 2024 06:49:04 -0800 (PST) X-Google-Smtp-Source: AGHT+IFLrz4LPEqUWiK2sJ6QbCY0L9MpiGBAqCqbIIMh2ow1llFQxELlevb3n9QNen9lHc3WlKB4 X-Received: by 2002:a17:90a:bc81:b0:296:44c9:2616 with SMTP id x1-20020a17090abc8100b0029644c92616mr9090257pjr.45.1707144544374; Mon, 05 Feb 2024 06:49:04 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707144544; cv=pass; d=google.com; s=arc-20160816; b=jtbAIvRgHIEVQb5+aorlqXn8fLLwHZA5MXd8hiDJJtUvGe3LodjCbYpUoELOOMLUop TaYSA3SPy32LedPeTCLUpEEQ4YptZ45uG+gqGchIpJnjZxjxJCThmja6gKwxuIBpXI7u hibv2g+oM6U4iSGiTUJYpw/N8Kn7ovEZIXK3mMyzO8j4uNISrY/gl0tPw4Dg/e/rT0y+ vkWFvOQUPGVsZqS/RyuWQsqrO0igBmAqA34kmm/7BIQk9y+iUVgTKRkLBQ43slyytKiH rfttBcA4nojqH8N++5d+bGdmO3CpWfBtZL6f7VaBG5A0ZQHdN/N6G9yJpkPmpTBSW9pJ gs7Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=av8oD6PhPQH42UIDERh1OcZa8d36hfuF0AuvR/6ysaU=; fh=EzVri95JCWbV3aIegLsgeK+r6d4D32a1+L80PC5p1ew=; b=nSEux4rCzU4DplLaAOM01SUUlxEpx9eusH6r6EkfkOmFkIDspdhOZV9IQPIIRPfLKD BY3sNcRuTtcEEn57M8CtkHIx86pw320aijcAFGzekhJjhmyEqfxOln2CrQ0pZqxISLwM RtOAxTr8J2+9m+tNdjQvN0KEvU4yXMMWSpSKL4kWwZ7GjSHq13VJIEs6YqMxTlvUJfUo xG2JlZa2M5Qm4kp2Flair1orTthGZt3XJdAiWl3yK+kiFhztqyNjx4+Lc/tsiTNfbyUL 6VDo1zZL40p454wqtbrDxtuMgJ8+EkTX7Qs66BmNHk26p3X4WvmGI1sEHTBRq8Wucx48 EVWA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DbStuYSg; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-52792-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-52792-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=1; AJvYcCVG5WktIqtHCmOPEf7dRSglh5eJI5njjA6B9JhtoHdTBYKdBjXYtem40kQm3wcFLsK4xssNrAV99XdsDGVMQWMiHFhFPA== Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id g9-20020a17090a708900b00295d82879dfsi37526pjk.17.2024.02.05.06.49.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 06:49:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-52792-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DbStuYSg; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-52792-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-52792-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 8D575B29D50 for ; Mon, 5 Feb 2024 14:14:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B03232D608; Mon, 5 Feb 2024 14:12:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="DbStuYSg" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 0B2F82CCD6; Mon, 5 Feb 2024 14:12:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707142357; cv=none; b=dwlVGXVSUPlk6I3tpjOJR1KomVevWuCo+6H4ZfcDtvgrYjCawDSrzDLM3ni8wQFOddoOnEodpYJ9Y09VMzH5VWZotbrGQRmLrdZGmCkssaNPc+nsq/YuTon74RvK03kHAofd190cNRuzr/g2geYFV0J0b42hOU2ASIq2r5/pHX0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707142357; c=relaxed/simple; bh=S9XKJn2RHODf26m6srBV7+w5C4ie6RweVa74MFrSSxA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=HyvXUJwGfwkTC0AZsFDKGbT6B9yz1Q0JdbePq5l+TCA1ZYCIHo+cx1fWQ5po/1TqlM98Toa2xjUSu5RZWOg3K4sg8ouvekd5mq56Pl53Qgn8xW6LZ/P5Wc1OVQ0/M64DCAj/EJJTsGYkYeTHay6CFwv70JlmnuzHeyzFmJCAm3k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=DbStuYSg; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1FC35C433F1; Mon, 5 Feb 2024 14:12:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707142356; bh=S9XKJn2RHODf26m6srBV7+w5C4ie6RweVa74MFrSSxA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DbStuYSg62t/WWT1G6IEM5F0zJt80/z/9bkfIwQ4SvcYrR6MsoLnrgBJdGKd4aT8o xuwJEpRpIKyuQs9T+D+kfZuv2zq4Gnd50nQZuBkTgj29F807nCrTYaa7htVmmC+7GO 1pmw0MdwtIYaxOEWjoMV7fliIdfhrz4MwdySohwq5dFHPku5kpSuwbFkloCQpyiSZV ibOZ7BQ2CbDKY2kFGElNXZ9cfu6br+l686Pb/Ons7Xyt+F0MyzsbIpb+XPRFXn6C9N t+qFKwSF1sGlmSPZe1yxNJtQs+Q2uxBfdIp91HMdHB7yim2W102QJJpCGgTvJEIjbl 9cclPjZ8ojutA== From: Roger Quadros To: Thinh.Nguyen@synopsys.com Cc: gregkh@linuxfoundation.org, r-gunasekaran@ti.com, b-liu@ti.com, afd@ti.com, nm@ti.com, srk@ti.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Roger Quadros Subject: [PATCH v2 3/5] usb: dwc3-am62: Fix PHY core voltage selection Date: Mon, 5 Feb 2024 16:12:19 +0200 Message-Id: <20240205141221.56076-4-rogerq@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240205141221.56076-1-rogerq@kernel.org> References: <20240205141221.56076-1-rogerq@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790070797665453498 X-GMAIL-MSGID: 1790070797665453498 TRM information is outdated and design team has confirmed that PHY_CORE_VOLTAGE should be 0 irrespective of VDD_CORE voltage. Signed-off-by: Roger Quadros --- Notes: Changelog: v2: no change v1: https://lore.kernel.org/all/20240201121220.5523-4-rogerq@kernel.org/ drivers/usb/dwc3/dwc3-am62.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/usb/dwc3/dwc3-am62.c b/drivers/usb/dwc3/dwc3-am62.c index 600ba9cfefea..af1ce934e7fb 100644 --- a/drivers/usb/dwc3/dwc3-am62.c +++ b/drivers/usb/dwc3/dwc3-am62.c @@ -97,7 +97,8 @@ #define USBSS_VBUS_STAT_SESSVALID BIT(2) #define USBSS_VBUS_STAT_VBUSVALID BIT(0) -/* Mask for PHY PLL REFCLK */ +/* USB_PHY_CTRL register bits in CTRL_MMR */ +#define PHY_CORE_VOLTAGE_MASK BIT(31) #define PHY_PLL_REFCLK_MASK GENMASK(3, 0) #define DWC3_AM62_AUTOSUSPEND_DELAY 100 @@ -162,6 +163,13 @@ static int phy_syscon_pll_refclk(struct dwc3_am62 *am62) am62->offset = args.args[0]; + /* Core voltage. PHY_CORE_VOLTAGE bit Recommended to be 0 always */ + ret = regmap_update_bits(am62->syscon, am62->offset, PHY_CORE_VOLTAGE_MASK, 0); + if (ret) { + dev_err(dev, "failed to set phy core voltage\n"); + return ret; + } + ret = regmap_update_bits(am62->syscon, am62->offset, PHY_PLL_REFCLK_MASK, am62->rate_code); if (ret) { dev_err(dev, "failed to set phy pll reference clock rate\n");