From patchwork Mon Feb 5 14:12:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roger Quadros X-Patchwork-Id: 196835 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:168b:b0:106:860b:bbdd with SMTP id ma11csp900307dyb; Mon, 5 Feb 2024 06:13:15 -0800 (PST) X-Google-Smtp-Source: AGHT+IH2pWt3vFgzC4I+m6aIPksDrjbfqtTpNBNrYQEWhyC9iZx7krAdcVkAEh06dsiVBWw2Okp6 X-Received: by 2002:a17:903:11cd:b0:1d8:fb03:a01e with SMTP id q13-20020a17090311cd00b001d8fb03a01emr19535014plh.32.1707142395778; Mon, 05 Feb 2024 06:13:15 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707142395; cv=pass; d=google.com; s=arc-20160816; b=G751zU+kH8hlpB79ZbjAZJdbrKEE4EHMl7hPb7rnxw2W3nCCMbBIKWEOLA4c80DX4Q n85vQCz8K1GLSf44ekAwGMcHUDx+O+OrlTGIKFz5UtiGPxSrVWshtDL5MVK7sjCctBI9 VGooWVwMPTJIN8DlZJOysQdgsMAhEGY6SswR5ufK1Xfm+svJVYC4iMLYFRsPhB5g6fVw xkYEqAkqP5km7zZwo9dBu+26jJ9o5XUJnCGkm69e1vijtEJgG3kK1yApbwsI9lIldiAi mclwIvjZeSj1F93LR8+XW1MoYv3KW7yU395XRcjiV71NWLIz8qjNddj2s5n44k+tV5EA 6YZw== 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=KbtFkDHSf2BVjrZG71kZ1GtCLc6DKqyxKKP786LBLGg=; fh=vrax7KDr1HeiZoKPOiY6CjBGORmJg4vdBw4MB87D1uY=; b=Apm3Jx4zIRrZxud0wSiTCAx+CVr/8K9Q8qpP6CIhu8eYB0mtjDpOEgfj131rEuAYHM 5zhudz9usVopn1iiZHpnch9FitKYEQAlfiKb455BDA5OaY/qS8KpiU9e8EfH+N7rsJ6u Auax+rGyEiHeuLwasXAVYADBOzJTCkko6UbFvoX3cP7DhhK5BB1EsA8B8fhH3xXC31tJ ACF431BV/0ipf+62RxtHhrM5qoF8KHsGr4cBGD/qK1PM9cA3zlGA1Su0NCCX5xilmgtE XEiGEo2rSq+8ZYS9R+lowIiiVa4alrl6K1X3paIILaXNBqD7GYW9Qs3r1txp58rqHdM9 y3Ew==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uz8UiBt5; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-52790-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-52790-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=1; AJvYcCV+jhClQ6Y1hbhheiZ5j/ws/EAI5I7Q1BlT0FeMx3fLcaLvM24aYmie14mzqlgUCwis/p80r4huT2YVZkZGhkCrwxpepg== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id s11-20020a170902ea0b00b001d95f009fd0si6559098plg.367.2024.02.05.06.13.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 06:13:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-52790-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uz8UiBt5; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-52790-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-52790-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 8AA4D28276C for ; Mon, 5 Feb 2024 14:13:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 654DE2C1A0; Mon, 5 Feb 2024 14:12:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="uz8UiBt5" 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 A40EC2C18E; Mon, 5 Feb 2024 14:12:30 +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=1707142351; cv=none; b=YjSkxp7p/0O9fhI08kHSAzXRCJ/Z9dj7Qo76cg+FHjbgEUKhDjHxxaW/h6YAk5YO20G/d8dCifbnVrz90MEcgUe0/C6w7S+Ec5k8y8cQjwOE8G9GIV08vAiZexJyJv/FJ6YI8+hX1yRSPdC8XXVKS2hQnyQwpIgmWrr7sbBXXxg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707142351; c=relaxed/simple; bh=urtEjxHtQ0tLs7UZipwqHGtE50M7Twxd9Gk6q8wZNtM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=EZ0wWP59UQ7iSk0jJfrB7oh3lpIQDOEuXqhw57ETHUYIQnLMcd994svHVHLj2Qwnf24xNrH6wD9BWK6sBSuOhovUigRNI+d1wxiZCp56VKeA0yM3X20ZhENkmUqo7acIGNhxYVrJz0RtLQDFiIxsvGS9SwSXkiRrqR2GSpkzjYE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=uz8UiBt5; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3DEE2C43394; Mon, 5 Feb 2024 14:12:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707142350; bh=urtEjxHtQ0tLs7UZipwqHGtE50M7Twxd9Gk6q8wZNtM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uz8UiBt5bRPMD4HwD+/olBGwvQbDaf/0O0BIuMXK2lvtCZzRVcfKhBWO7GjvmHfGd 1cTvJ1gBEB7iRlIinS68oLTnagFFXKL54o+vvQcWKKelUpALVxkD1VBLiuKwkwwhbc jzU2wUfGJ+hWjRJJH2EeHH57OuDjfDfLY42ZXQtVM1INpo4oEI4bMTxhm7Pulj1l0t rzXJzF2nDgV4c8CSXooChGuJshXlWAQnRNCuGSVPzwt2/gzDrR99YEqGlAqWrfx+6u wIZPEhAlFgYLStapgZkjWwVfyq20lXpBs0/oiBPKuvs1aIXHA1p5aoNErdtTvLeMoe K4CqkowwSzQzA== 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 1/5] usb: dwc3-am62: call of_platform_depopulate in .remove() Date: Mon, 5 Feb 2024 16:12:17 +0200 Message-Id: <20240205141221.56076-2-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: 1790068544594546980 X-GMAIL-MSGID: 1790068544594546980 We called of_platform_populate() in .probe() so call the cleanup function of_platform_depopulate() in .remove(). Get rid of the now unnnecessary dwc3_ti_remove_core(). Signed-off-by: Roger Quadros --- Notes: Changelog: v2: no change v1: https://lore.kernel.org/all/20240201121220.5523-2-rogerq@kernel.org/ drivers/usb/dwc3/dwc3-am62.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/drivers/usb/dwc3/dwc3-am62.c b/drivers/usb/dwc3/dwc3-am62.c index 90a587bc29b7..1bfc9e67614f 100644 --- a/drivers/usb/dwc3/dwc3-am62.c +++ b/drivers/usb/dwc3/dwc3-am62.c @@ -267,21 +267,13 @@ static int dwc3_ti_probe(struct platform_device *pdev) return ret; } -static int dwc3_ti_remove_core(struct device *dev, void *c) -{ - struct platform_device *pdev = to_platform_device(dev); - - platform_device_unregister(pdev); - return 0; -} - static void dwc3_ti_remove(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct dwc3_am62 *am62 = platform_get_drvdata(pdev); u32 reg; - device_for_each_child(dev, NULL, dwc3_ti_remove_core); + of_platform_depopulate(dev); /* Clear mode valid bit */ reg = dwc3_ti_readl(am62, USBSS_MODE_CONTROL); From patchwork Mon Feb 5 14:12:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roger Quadros X-Patchwork-Id: 196836 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:168b:b0:106:860b:bbdd with SMTP id ma11csp900563dyb; Mon, 5 Feb 2024 06:13:37 -0800 (PST) X-Google-Smtp-Source: AGHT+IHEmPYK7A0bG3gXhp6q93+fzXBJEPPnVPIsPtpXwBsUcRX90iGI0u54S55RGcTQKcqjZrUj X-Received: by 2002:a17:903:22c4:b0:1d7:1a90:65ba with SMTP id y4-20020a17090322c400b001d71a9065bamr10180444plg.25.1707142417060; Mon, 05 Feb 2024 06:13:37 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707142417; cv=pass; d=google.com; s=arc-20160816; b=WJoJemOnVRnW5qqEwhTUqZHjGFphICYukxZ3vDhcuHVvaBlul+os2ybxOaCYBi2rlr /3qS7NLXGLSNJ3n6S0tkDU6+XtleBZlSEe/MozuY/A6gT1k8Bq6m7+xInoL6oqMubRUE dUbU6TCRkJDVjYnQ3buURAK97gO8x2IMtDZ75A5Oml4e4LVjyhLgOC1RCT2oeGkqI8Ps VpeNFCrEqpdUIUdVISEJNyL7Yuua8WKnUi9dA/gML6G5/4FDUdHzfiYiD6osdJpDrrEv Q5VsBYaZz5aoTKQOf+/aAIsXfUyLyjgtVkTcE8BmG9mSwwNyKk87FAruPaR+JH3ofvf0 fwdw== 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=w0d3cQnCiZGXL0aLFPntezulFXwIzGmtHm6EUL9IiQs=; fh=S9xDFMNPfxXKe1hSJ620bXu1FXuxBTurZ/G7UFHXDmE=; b=Xpr3e5udvn3ZTBlEGcJceB566DvGL7Nr6DdOSbVKFAT3zNs56CaLIyDAIM5AU/l1bp ja0PhdTQaE5oLwuwpbrlDjn7HclJenF5xd7lom7C+EfW77S/c3sj7jBfKSgzupYbFkh5 ywf3GgzPPL2UfqOj61sUV9W+g3hIYUJATL6MW7PgSmNuq3OrU0xRWHUJNBgtGcqWYnCh 1KmRHvJ2pS2YX16+x/+U8dy6NNqNNscUDo1feIBifhDmOZ23iCt93kIlW1Qm9Q3FgRri z0BDvn5DoDz7RKePyJDpGSh4cp0Ai3UZ5yJT5mxM3P0My20BbZq0yTeYdc8m4iBxfRpZ uKoQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pwYqA+6Y; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-52791-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-52791-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=1; AJvYcCUW8vpB1lcbAQPQPidBKcg07CTnoiHBYY3Eu1QK5MAH+uZ51S9gKaE3vCgRoDqKV6V4+Jm9gsBxs1vr7mQiJSAGCFAVpQ== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id n10-20020a170902e54a00b001d8e91b8b62si1418304plf.617.2024.02.05.06.13.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 06:13:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-52791-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pwYqA+6Y; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-52791-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-52791-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id C3F46281B54 for ; Mon, 5 Feb 2024 14:13:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E78692CCBA; Mon, 5 Feb 2024 14:12:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="pwYqA+6Y" 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 324092C6A9; Mon, 5 Feb 2024 14:12:33 +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=1707142354; cv=none; b=Jw8mftVnWtYmAxK3NUWB9XTTgPRle0dXUe4c47weEa2LDbdZ9cx4KEosPZcB5Ifc20PTL6ta3vtrfJClxyOLMAc7mefR1KVYkBzzLR0AxRMg0MDSBtyBL9+0vHUUgS2qlbgu9Bjdx+oJpIEBXTxow1haVNvy1MalY4WqT1ALubg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707142354; c=relaxed/simple; bh=/rPhwXHZ3xKXpN/7zhU9DA4Kcd5ElnQq+143lheukRc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=eVAixK6YpGzKcJsoc3RxN487huaKhYTmcRbfHfo+bGkFA56ZXkdaDkPDeMfEamr/iwyw+zfqC/WZg5+4QZr0xIuLDTzxmW0FRIBD1UNQEZrYtCAUqQZOoJ5P5o+Bsz4O0HfdW29J9Nd5CLVAby+olPfkvO8w1Un91cLOjLk7WAw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=pwYqA+6Y; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 30098C43399; Mon, 5 Feb 2024 14:12:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707142353; bh=/rPhwXHZ3xKXpN/7zhU9DA4Kcd5ElnQq+143lheukRc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pwYqA+6YbdtPGlEOzoSOtBbozjKAMKFVpTgUyq2t182CXX4m3L3ku1nwv8rM6f1EC cc2VP9Ba5yV6zBxUVaHDUIJhK1n2GvIkxPA3/xeOXQIt35Us/F5YrLZufzQBduQcGR 3Jk0AXGTzC+uNqPDOiOIcLjgZfnkSQTDKqluuY+NqP11kIz5NpwqqsoQ1KPHnmmnsO +ROL2ckwH+vT1/GZFgNxLvn+4zpSU/bcsxySENz/mA9Dhgwe9TWp9SHPkCm3wb2lfj Z0qBxZTo3E1GXzgLBhOK2eoiFpgb2udzaMQBNNdh0ksEDGEXXpPAumvC2FZYBmUv73 pjH/1msR7nsrw== 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 2/5] usb: dwc3-am62: fix error on module removal Date: Mon, 5 Feb 2024 16:12:18 +0200 Message-Id: <20240205141221.56076-3-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: 1790068567258489938 X-GMAIL-MSGID: 1790068567258489938 As runtime PM is enabled, the module can be runtime suspended when .remove() is called. Do a pm_runtime_get_sync() to make sure module is active before doing any register operations. Doing a pm_runtime_put_sync() should disable the refclk so no need to disable it again. Fixes the below warning at module removel. [ 39.705310] ------------[ cut here ]------------ [ 39.710004] clk:162:3 already disabled [ 39.713941] WARNING: CPU: 0 PID: 921 at drivers/clk/clk.c:1090 clk_core_disable+0xb0/0xb8 Signed-off-by: Roger Quadros --- Notes: Changelog: v2: no change v1: https://lore.kernel.org/all/20240201121220.5523-3-rogerq@kernel.org/ drivers/usb/dwc3/dwc3-am62.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/usb/dwc3/dwc3-am62.c b/drivers/usb/dwc3/dwc3-am62.c index 1bfc9e67614f..600ba9cfefea 100644 --- a/drivers/usb/dwc3/dwc3-am62.c +++ b/drivers/usb/dwc3/dwc3-am62.c @@ -273,6 +273,11 @@ static void dwc3_ti_remove(struct platform_device *pdev) struct dwc3_am62 *am62 = platform_get_drvdata(pdev); u32 reg; + pm_runtime_get_sync(dev); + + device_wakeup_disable(dev); + device_set_wakeup_capable(dev, false); + of_platform_depopulate(dev); /* Clear mode valid bit */ @@ -281,7 +286,6 @@ static void dwc3_ti_remove(struct platform_device *pdev) dwc3_ti_writel(am62, USBSS_MODE_CONTROL, reg); pm_runtime_put_sync(dev); - clk_disable_unprepare(am62->usb2_refclk); pm_runtime_disable(dev); pm_runtime_set_suspended(dev); } 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"); From patchwork Mon Feb 5 14:12:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roger Quadros X-Patchwork-Id: 196837 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:168b:b0:106:860b:bbdd with SMTP id ma11csp901098dyb; Mon, 5 Feb 2024 06:14:22 -0800 (PST) X-Google-Smtp-Source: AGHT+IHImTEOJvpl56A8hE41LK435yxEM/FxGaBr7UyhG3ukQLhwpZzXedjQFlxF0NAAhrlHYj6a X-Received: by 2002:a0c:f511:0:b0:68c:88fd:d926 with SMTP id j17-20020a0cf511000000b0068c88fdd926mr5687951qvm.56.1707142462619; Mon, 05 Feb 2024 06:14:22 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707142462; cv=pass; d=google.com; s=arc-20160816; b=hK91SJWQiMsJ/b/jwGDCuV9VTlzmqbdvItotenlDRk1k3JZ6jDa3p89c2UlkKeEbCW 6Obhc0938RpUINXCE9sbQq7IGx203xOgRuy3ngbA9sZgtr1WwVnc/LC8pEinTSMYu66D x1W9RGqidfdsNCM02gJvlPp8cvfQgZsQ4Ty9KHcOlnImOlC18pkhDXMhbfkmyGeYwixE qESsJ2l7jcoIZFA1+UmwGZG1KSIR0+XDrGr+cvk096G7CG4fR8rTiUu5nFJuc1Pnkq49 Rfd/3tiPPxGrYwHqhNDAMPDqTNalreYnOGkzgFOMNKIyAtONA9atEFJXIt+NIucWqw4l YSLg== 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=nGVXexTAbbNlP0Vow8f7NXBZ4KAVDCh0eAzxMpMnCeA=; fh=ixlFcD1NhLM+ZZyjGeeb3nF8RChSNGf9D+TCvPr04To=; b=RcKz7Gq03GwEm9nQ6knd89U1T5qdvcNu/iAb/8wGAWYlEePBQ59wst/v4pO0+b63QV UlaC/QgssMtxZz7NrkfkpfCY28H1AL3cz4Pp2kM0ZxpXhcO2zNiTSaKXiIQOOgMn4Y5L Qte8i8sxXz9FMDTxXxwmW6DgTNn35pIXjiLqPEixyxboFcVRBadLxPTx+VFj9bevxdAh UDJc0FbdcfuTDdf1mAemy5GH+CKjVye5zBSOwJtG1He2JIP+q/qL6BHzdoK1ROHlgm0o hc64Oq3+8UCeuUz3W9WMEmiA0RNPF7ebTNUL6zOeZuCK+izR8taIuLObgzu/Ixox9I2C LaEA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lu076dhi; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-52793-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-52793-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=1; AJvYcCW+Kyz36dgM7UGHc625LuUCpxyux2+RHWxo+raQ15odMKJXe3LJtQNdP75dhGfRbDyT+jo/BzXYtMoE+tTf2fdMMm/tbQ== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id d5-20020a05621421c500b0068c92c03d2dsi6292775qvh.525.2024.02.05.06.14.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 06:14:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-52793-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lu076dhi; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-52793-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-52793-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 6A2581C22D2A for ; Mon, 5 Feb 2024 14:14:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 672CC24A1A; Mon, 5 Feb 2024 14:12:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="lu076dhi" 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 B94962DF9C; Mon, 5 Feb 2024 14:12:40 +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=1707142360; cv=none; b=QSM6yznwJSvxnwy9E2wuce3ph2AENXXtv1af+iAyZGATESRMkUmneQO00FZVoikoYJdGI76RO2gbwgAZ8donAPZJjPj9LHF+QWI4rCo3cwIh529AbI/7kZyQ342gg/+jh41ptfBrLTfR9Oc2CPZl3taGI1ziMKFGodkWteuQfqw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707142360; c=relaxed/simple; bh=UaF9stSQq/i7PAh9QAvHKjDgSTByGyBL3jN4QH2nFhI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=eT4UcnUCH+7ziaFFpt0V6gFijSIvmat2R5EN78Zl1iuFrIR+CDhq0YCvd+9kpzkgsHSli0/DgZACVIScHoW4meOnXjoBOVz4pExqlxxIqrvunulBEMckbR6HXeXZsT9hk2Na74EhrrQurjlTzXG/SybjDFAJDZbR8zxXOdSZr/o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=lu076dhi; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0F84EC43390; Mon, 5 Feb 2024 14:12:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707142360; bh=UaF9stSQq/i7PAh9QAvHKjDgSTByGyBL3jN4QH2nFhI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lu076dhi2j+OqgTuT2dkoP933tZGc8LJCDmZ0o0gbgiBRnLgaZJESaRRV9QPPFCQM go7dEcV/hV/1YTeOK5EDZqjo5khm7bSO5rVnLAsP59sd+XLp5/JB4KRxJYvkSzT4aR R8xNLFgtzLfgf7HgFotYzuBGEDCIJzDnaZRQlQaGpJmXsdRqnXDeFonnn+vfIVMT9W R9Hu4OFjnNAOMpxQXLawafu5BGcMXZb6EXqVTj4XOVA6FnS2Uc49zxulmuLLgTOZba pNvjf3N0a9BDqrSlGcWL2X1Xdj5OMjETxMvJPifWg3TNADkL64sy1Oc0omdBacLz/F Hzb+yG9LJNZQg== 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 , Rob Herring , Krzysztof Kozlowski , Conor Dooley Subject: [PATCH v2 4/5] dt-bindings: usb/ti,am62-usb.yaml: Add PHY2 register space Date: Mon, 5 Feb 2024 16:12:20 +0200 Message-Id: <20240205141221.56076-5-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: 1790068614933472923 X-GMAIL-MSGID: 1790068614933472923 Add PHY2 register space to DT binding documentation. We use minItems: 1 as DT update will come later and we don't want warnings for existing DTs. So far this register space was not required but due to the newly identified Errata i2409 [1] we need to poke this register space. [1] https://www.ti.com/lit/er/sprz487d/sprz487d.pdf Cc: Rob Herring Cc: Krzysztof Kozlowski Cc: Conor Dooley Signed-off-by: Roger Quadros --- Notes: Changelog: v2: add minItems and update commit log v1: was sent as part of different series https://lore.kernel.org/all/20240201120332.4811-5-rogerq@kernel.org/ Documentation/devicetree/bindings/usb/ti,am62-usb.yaml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/usb/ti,am62-usb.yaml b/Documentation/devicetree/bindings/usb/ti,am62-usb.yaml index fec5651f5602..f6e6d084d1c5 100644 --- a/Documentation/devicetree/bindings/usb/ti,am62-usb.yaml +++ b/Documentation/devicetree/bindings/usb/ti,am62-usb.yaml @@ -14,7 +14,10 @@ properties: const: ti,am62-usb reg: - maxItems: 1 + minItems: 1 + items: + - description: USB CFG register space + - description: USB PHY2 register space ranges: true @@ -82,7 +85,8 @@ examples: usbss1: usb@f910000 { compatible = "ti,am62-usb"; - reg = <0x00 0x0f910000 0x00 0x800>; + reg = <0x00 0x0f910000 0x00 0x800>, + <0x00 0x0f918000 0x00 0x400>; clocks = <&k3_clks 162 3>; clock-names = "ref"; ti,syscon-phy-pll-refclk = <&wkup_conf 0x4018>; From patchwork Mon Feb 5 14:12:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roger Quadros X-Patchwork-Id: 196838 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:168b:b0:106:860b:bbdd with SMTP id ma11csp902892dyb; Mon, 5 Feb 2024 06:16:50 -0800 (PST) X-Google-Smtp-Source: AGHT+IH1rAj1vHEvZ2+fw0HDQ2WS9gtyJAZdu97X9lKp27z1paFzkFkN8GRpKhvOJZ+vLbGqlhGa X-Received: by 2002:a17:902:b701:b0:1d9:1b55:a37 with SMTP id d1-20020a170902b70100b001d91b550a37mr13297225pls.50.1707142610125; Mon, 05 Feb 2024 06:16:50 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707142610; cv=pass; d=google.com; s=arc-20160816; b=uTa+gUd8BxIxxkGIANk1oV1V4Qrzx2KRdh1iu7c7TZ9nMoVuK1loW86n54Nkm7jjM0 bZHgX1C3Zmg5jz9W0JYGaJAYddjtjw0Mb6SxeXvZRPbE0WdW+EOtHPvopu/X4biEGTvW rUfIoVJQ5Bj9GfvsZzYD73gLsQPCzUbW+Q/2VSN5nonYMc0vo2xEm/54GuD6Yw9HC2oW 4ZYl33qaazVHKxmR9fiEm0Uf10eJZZfZEcMIS68UN5/YZ7YgY8Rrls9zj5Cm/3xQnUrw bGwJ5KAlgRqWM/9ehFFZRw/+Hycow2oLZCR94q2zw6a15tVcqVBygsmElZ3GtmYPfq1A aeYg== 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=7hkdaiC54LR0/Nq1OhSEqd/L0AAR5FnvLrvL/hU9RbI=; fh=e5W+/CeMvJTOi+7drHZkzGoUCiqJB0dnFO4YslJ+9Is=; b=gzfCX2mPcm5rWowRIp8oiRT3Yw8lW6HBXlQQv4YllnnRT2G4q803mivrGSRTfb0nk7 rqsm1uApygsVXfjOw/hRbYfy0GaJptrVQ5XZNgCBvEG5X0zw0oC4dMY2pZSGSctCFMux TsuV7MFxq6jgRfLjMhLrQd2UxescnrpyWe6aNOpp0PgomYkM608AYxdHQnTHh0/IYp1Y ssGyYpiKcZon8G5EMjNieehaxMDZr1eXTPRY4KXcgv/K/BAcmgYO+X4aVk0t48T74q88 Yek+HvHlayqCmq3x/6ETwNpcN+sjNXtSKucRsJ5SX+uKF559R4yyxjoWjufrpoS2MH4Q i2Pg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Gd8iKo+q; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-52794-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-52794-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=1; AJvYcCWeGrRWJlRfrPMkZwXse6YJslN/ec08GewkOjsOc/6MUmP7HAZ6lLR/tx8/XuWu7kNMhW3nAhtf8w3T+nd5ULf4ZofTFA== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id t21-20020a170902dcd500b001d9871e4da5si4421012pll.99.2024.02.05.06.16.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 06:16:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-52794-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Gd8iKo+q; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-52794-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-52794-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 4AFEA284BDE for ; Mon, 5 Feb 2024 14:14:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 101CE35EF1; Mon, 5 Feb 2024 14:12:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Gd8iKo+q" 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 5035F32C93; Mon, 5 Feb 2024 14:12:43 +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=1707142364; cv=none; b=VODbLqgIY37TzxNhc+iW5n/gawAz+zgkTeBpO0Y6ykfL9llyC6JDgna1E5VeNdTh55ezyukZiFY0SYvpjTD3pO1ClMuY6jl+Xd1be2PP4AZm6DDW4rvBq9/CvUZn88Yo9pmJScRnTCvumXTWs3VkYyiJwz8mlQ50nloxGlsSOMc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707142364; c=relaxed/simple; bh=h/Wjhl4phEKjtwys+YLS96BL5IrD+pUdM1DisLakQwI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=j5+VoSisPhSP/p1AsV0azcolmmDJ1JqejGpkiBVObtz1kLIq1YcMkZMzy+76gMO7eMe1/xjKIXuBrDta8J0nNycXzetmkPTABtiV1SpgCK+AvMHlewsGJAGQTkndKPQLksGSM2Fh/+75oyggAUzv9/fMV32K0N1A6gHswlNJblo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Gd8iKo+q; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id C1439C433A6; Mon, 5 Feb 2024 14:12:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707142363; bh=h/Wjhl4phEKjtwys+YLS96BL5IrD+pUdM1DisLakQwI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Gd8iKo+qWSY0wR4esH/qgfx2hrvkVTjGhH9Nz/yHmqLI4WTGVETLnqOsTpUmRaMKJ qoHQuQnZ5DGIU+WhQEDoOJWvdnUDz+EDBOcttpoIlIrzLJdfO/hiXJdp/VhkwhyPVH YWb5skYGzrfu56Qx1e52hPecq5mK777xKqViQ/zcrcOgR/N934Cw1R0Ho7diN/RMHc kURZj6+Hlkgcg8sGbDafscm4LoxHvXx4rEvKkdIoSDLOBq1CRO/ZHoPJVcx/bTNbNP PU/EEf+jVoLYUraguGBbgfvs9FXyiLvbVOp7ZGQx85WU5nL5BT9qyuz8af47v73Eq+ Vzphk47VCKxOg== 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 , Rob Herring , Krzysztof Kozlowski , Conor Dooley Subject: [PATCH v2 5/5] usb: dwc3-am62: add workaround for Errata i2409 Date: Mon, 5 Feb 2024 16:12:21 +0200 Message-Id: <20240205141221.56076-6-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: 1790068769443193934 X-GMAIL-MSGID: 1790068769443193934 All AM62 devices have Errata i2409 [1] due to which USB2 PHY may lock up due to short suspend. Workaround involves setting bit 5 and 4 PLL_REG12 in PHY2 register space after USB controller is brought out of LPSC reset but before controller initialization. Handle this workaround. [1] - https://www.ti.com/lit/er/sprz487d/sprz487d.pdf Cc: Rob Herring Cc: Krzysztof Kozlowski Cc: Conor Dooley Signed-off-by: Roger Quadros --- Notes: Changelog: v2: - don't add phy read/write helpers or add phy to private data v1: https://lore.kernel.org/all/20240201121220.5523-5-rogerq@kernel.org/ drivers/usb/dwc3/dwc3-am62.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/drivers/usb/dwc3/dwc3-am62.c b/drivers/usb/dwc3/dwc3-am62.c index af1ce934e7fb..5ae5c3087b0f 100644 --- a/drivers/usb/dwc3/dwc3-am62.c +++ b/drivers/usb/dwc3/dwc3-am62.c @@ -101,6 +101,11 @@ #define PHY_CORE_VOLTAGE_MASK BIT(31) #define PHY_PLL_REFCLK_MASK GENMASK(3, 0) +/* USB PHY2 register offsets */ +#define USB_PHY_PLL_REG12 0x130 +#define USB_PHY_PLL_LDO_REF_EN BIT(5) +#define USB_PHY_PLL_LDO_REF_EN_EN BIT(4) + #define DWC3_AM62_AUTOSUSPEND_DELAY 100 struct dwc3_am62 { @@ -184,8 +189,9 @@ static int dwc3_ti_probe(struct platform_device *pdev) struct device *dev = &pdev->dev; struct device_node *node = pdev->dev.of_node; struct dwc3_am62 *am62; - int i, ret; unsigned long rate; + void __iomem *phy; + int i, ret; u32 reg; am62 = devm_kzalloc(dev, sizeof(*am62), GFP_KERNEL); @@ -201,6 +207,12 @@ static int dwc3_ti_probe(struct platform_device *pdev) return PTR_ERR(am62->usbss); } + phy = devm_platform_ioremap_resource(pdev, 1); + if (IS_ERR(phy)) { + dev_err(dev, "can't map PHY IOMEM resource. Won't apply i2409 fix.\n"); + phy = NULL; + } + am62->usb2_refclk = devm_clk_get(dev, "ref"); if (IS_ERR(am62->usb2_refclk)) { dev_err(dev, "can't get usb2_refclk\n"); @@ -227,6 +239,13 @@ static int dwc3_ti_probe(struct platform_device *pdev) if (ret) return ret; + /* Workaround Errata i2409 */ + if (phy) { + reg = readl(phy + USB_PHY_PLL_REG12); + reg |= USB_PHY_PLL_LDO_REF_EN | USB_PHY_PLL_LDO_REF_EN_EN; + writel(reg, phy + USB_PHY_PLL_REG12); + } + /* VBUS divider select */ am62->vbus_divider = device_property_read_bool(dev, "ti,vbus-divider"); reg = dwc3_ti_readl(am62, USBSS_PHY_CONFIG);