From patchwork Wed May 17 16:16:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13245284 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 52B6EC77B75 for ; Wed, 17 May 2023 16:17:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=kKppTzeWGcB/8B/F26EerBwwQokvjeM4h0vyujFxn0A=; b=jxnRKvVrim0v7s F10ooGKtAS0TGL9X+FbtL0tC0t0epoftM+htCKFeFXhJFarzxT5ING/o37dNCbX8cwruj7ZcehALm IdVGHhj58ukfcWeaNlpDEueSeZiYY6YX0ZCmpRPIxPy+XZVRfBJtw1S4ux4BjaVbV2BkZgS32KapP rGD1OC4O/GXgXh8T40OtugpWI0ck/y4afMImmN5vj0ETkYir/g/b2DCbkYSVFAy+ckaH0vLnmYYWT Zxgsm0s1gruCFh3gS9g/6/XWCZHDCkG+a3PgUuN6Y2xjK1tfWUyntjUySlMAI0aBbtsNyzGIvkivU YYAFe15IpU2+FdTLPmLw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pzJq6-00ARZe-2N; Wed, 17 May 2023 16:17:22 +0000 Received: from mail-db3eur04on060a.outbound.protection.outlook.com ([2a01:111:f400:fe0c::60a] helo=EUR04-DB3-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pzJpz-00ARTW-1M; Wed, 17 May 2023 16:17:16 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aiTBamQwjkD+VKljY396FyYKTwG3rhMlwRFZ5GwETtIhh4AhPdWyffd4oWlnnHKS5xMnsMszjL1nFOfTVzLlSlsdltHRhBAs4/fyIJt5ukG3IKEwUCek8KZniI49ePdmgZn6/5U0zYLb/xfJEPQIAYeZYmx0TXA/EjFrrcrKPRonWLB0fZlaaSNrEV7ZD6ANB5cQAHUSZWjKEX4yOu6BBrhJHhx8KBKGGj+aTYhHkWX1nA+s5Yh1gfYJPFwciBJIzErYW1mfTjsHdXAo87JOFPtolna+lXNcXyUSyMmP1amFsGdXuxlBYZVJuX9R/K+RDuTtX1qw9KfPB3eghWSHkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=IEKcMWrG4j00kLtWuBqK7mtLn0v5TER+fvwsd9rWV+M=; b=hV3K0a+5ggV8mb/quxiRj5pIt5ChlddAVsWwf5MIbKoExJGvV1ICutYBHiu9OZfwAQRTsEzWLu2W3xA+Qjq+BQLG9mMNhenhUMlfJ0MDo56sgs5XwGwheV7A6oFGNf7ldqumRAd+6bGQL701icfyOge7F8zifGf/AYeRZmS+Be3u+tjPqGzuPWDpP7C28qtnoFaHt8WTM8deRlLYzLKy8ef6u7NSIjtx+Hx+oz3NHOvAlump7Vk5W64jtlF4iYaYmTN1aocBCCz3NrJ+qJvMHOt4Qk5woCSbHHsjaV6NC8WvdEGHBbvVIZirWJxymXud9f+j7hcpvHRUkaablPCSsQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=IEKcMWrG4j00kLtWuBqK7mtLn0v5TER+fvwsd9rWV+M=; b=YGXIMRGEKMvChBru5TndwUqlvfCKop3a7+YosdQkbV6jI3QPjLSOZl98oz9Ih55vjx9GQD7wYxDMWjNOd3pysWcrgBNRDvtKHTsPzhmTWIP7lFwwJg/+ZrVvYHo59UXUoSSkUi5EF1stlD07vpfsbygZmMFUxq70B2jK3MPNzC4= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) by DB9PR04MB9962.eurprd04.prod.outlook.com (2603:10a6:10:4c4::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.34; Wed, 17 May 2023 16:17:10 +0000 Received: from AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::25d3:de2:ef1:3884]) by AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::25d3:de2:ef1:3884%4]) with mapi id 15.20.6387.033; Wed, 17 May 2023 16:17:10 +0000 From: Frank Li To: vkoul@kernel.org Cc: Frank.Li@nxp.com, devicetree@vger.kernel.org, fushi.peng@nxp.com, imx@lists.linux.dev, kernel@pengutronix.de, kishon@kernel.org, krzysztof.kozlowski+dt@linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, robh+dt@kernel.org, s.hauer@pengutronix.de, shawnguo@kernel.org Subject: [PATCH v5 1/6] phy: cadence: salvo: add access for USB2PHY Date: Wed, 17 May 2023 12:16:41 -0400 Message-Id: <20230517161646.3418250-2-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230517161646.3418250-1-Frank.Li@nxp.com> References: <20230517161646.3418250-1-Frank.Li@nxp.com> X-ClientProxiedBy: SJ0PR03CA0041.namprd03.prod.outlook.com (2603:10b6:a03:33e::16) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|DB9PR04MB9962:EE_ X-MS-Office365-Filtering-Correlation-Id: eb388684-c823-4156-035d-08db56f22ae5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Vq4Je3dphvY1ewZiVSwcNLOkjGe2Hd2rfXaYXav75m2gV3IFsSMiuw4w1gLIVJEcEDU5v1AJfsrr4afpXcpbx/B1jFwHs1RkDnyRbEToJkJvzxzsb+z6hKpmrxBrvyliw4reGL4pQIlA5wVlzoB9MJfZW5iqPi9PxIznPIJQT7JxOMKf6AExZ8PkmY3bgEXgZ7qZz4ztpxNcT6yZ6ZnagAKRWOs1T9qBbPC+AnrCw4h+Qv/vkC9YmAFFSul4RWxTRDiJs+qm4vGgSzbZzUWEHeFLBW4/Cw1BXCdEA7wSxUm/eE59i198UAhlrn+C/JY+Yhd8/HtBgvhlGuZRsbofY8RceruZJ3Z4fe//daD9AnOb2SKRc7py9gpZQlVIkUQt270SpFfYkYjDfJWcoNoCF0hHImdJsSjTl+IgEDQ3PbeqlYykhyt72fbjjWXMJtp1BdUdWm4gQ9l3rHIHdDuJfTg+MuZVagN1omIYCUfLFtH59zSJ18lc0z/6nu//IlkuA71s/udPp9uy7i3/TE5DNXnr2wBxIFyURfGtBosgY34Fg0ufZDTiEQhmlM89HQ2k3p/GEhvnriYr1rC+JUwfA94/eY2BmFccmohPLF1ALQ6JH9g/nwbYpHRyceABV8Fw X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR04MB4838.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(39860400002)(136003)(366004)(346002)(376002)(451199021)(6916009)(316002)(66946007)(66476007)(8936002)(66556008)(4326008)(8676002)(2906002)(478600001)(6486002)(41300700001)(5660300002)(6666004)(7416002)(52116002)(26005)(1076003)(6512007)(6506007)(186003)(2616005)(83380400001)(36756003)(38350700002)(38100700002)(86362001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Nvvw9yEHxR0MNgvExHvx9dJAcpozWCcmm8zNOh52KWqhvtYg7ugH/cVgSsxKuuCsONRfUUwlH4q7WaoUSHqD6jMTzf8PtX0hndVOHJGXMHAiR4aWBXxxfFJFS/DdmZP2bgy9rDHV2HKT3LEqyUGTnYyKpB5kDLKruY9pTUcZ1F/2OvRMdsObqdl0LjVyEQzsEZVn14T+dq5HDb0g9WAccj9ChdLBI9rLhXeUTexppiRZj7uola1IMp9B5UCnXKBD2aaCzEf3EOk0WDSWnbknrip4x8rXwrOktCIRYlGWw/oQCaZbAoRuKm1CBzkrZ1uXF/N0ThDIfxwf6hLZQhgzDuBn9wnMq3hrad5AynPZ1vMmk83XLjk8R778j+w980NiecIK2BI3kqWNP9mHdnd3vDlkh7QTt3WVE/JQtvN0RGFbQM5EVu0IiUnFDHbut60ImGQgMQo7LOfD3AL8XIHF6buDMB3JuCDAXvh+ggFOYe+l8A+nGpxhkZDLciwHFFaTQKXKPjHmfjdjTTrz9DgabR3CVcrw60I73HKKQu1RPORw2cX9RuvYlFQjCPW0rdY4/PQ5wqnvPQDDxGlyO5j3dAh7qbb9kujZJHLiuUW4Tz+XHW8qwHBhJkq0diJal1exqQsrSKnBscvmYB9nDd6SIY0O2GFYvv5ftZ1QsSYKO4upjyynbWO96Pf/Dz3grjE1MX2yo9/bS7W0qY3dJ+V7j0CHigQI2BDt0c9ATTP2E/fy0neP/9asLuoSN6UwojuwLF6fnOZA90c1kfEAwH6UODzHphMuhiFUyQlZ04C+8I/PXlIdZFmhFah/uNmLDwMLg9/8EaZZB5HilNLTeU63smfanReF2dCGvRUskrJDNin6bwrFOTlZHgA+GaV2VQxGcsxghGwI+riccHy+O5CpcT+XrNh2jvun0LUfQc0q3PID3xx4LxY/9poKhq7lOsgciKdtVLDeuQEdM3yKvZyM6WLdRtxWIU7B4EM0NUAN1akVlmwktCwVkRIHb7SGI1GHC7xPgKN9iMHJ/CLU0QYI4bmONslzBi8j4tBPaj3zfaFboR35Z+Yr4X9yHJwmWHpqFZnsUdVGr0XgdgN3saqO0almhMZRdQ1zh2kTpE3++FbkU1/BFjHSESNG/hc5PHgId7Y0tZE5AzV9ukapjreVHyX7ZaD2aq1fc3s42q6u+sEyQuwEn9ivzehEFkn+VH4LmANHv4T8kKtbqw5ennJ7POIrUvrbRQUpO9MXWKMH/G/cVU7rgp6XKneB+7Twu+AfFlTFRy45JsQwLpLWvmg8px+z+jpE4FK15QQtAUsLlv/SmFY9CyIbbmbYVuAEo5qX5snAXhKky9RduzeouJ2hpl1fSloUCgrivcJYnlIGHOJPWNmx4EBNwv5YyhT7VDETiJh86TksOEHj86tE0B4jo4qVTHcjJLvbQB49d2Vee2W0eH+P1TiNenbhNOyygaL0AtkMNcRWAEG21h4LyFl7vpSXPR9pQLn+W4BqpJohj8jmdZ3axjKb8jEryeyq2Gb/1c9oojsgBPBd1m6FIW3hZ6/h4K2a4EDAHSJDaAnA6fk= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: eb388684-c823-4156-035d-08db56f22ae5 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4838.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 May 2023 16:17:10.6093 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: a9B0QlGHfZfzhuUGAF5ViSm+mONkLg1jZeFj6FvcXEFJQaaZ2BT9Yj3ZSWuuPMkEkkKwbK4DQyqRAX8E9opuOw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB9962 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230517_091715_471083_607E3582 X-CRM114-Status: GOOD ( 12.66 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org From: Peter Chen There is an offset for USB2PHY in SALVO phy, add offset parameter for read and write API to cover both USB2 and USB3 PHY control. Signed-off-by: Peter Chen Signed-off-by: Frank Li --- drivers/phy/cadence/phy-cadence-salvo.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/drivers/phy/cadence/phy-cadence-salvo.c b/drivers/phy/cadence/phy-cadence-salvo.c index e569f5f67578..06c5dbdb700e 100644 --- a/drivers/phy/cadence/phy-cadence-salvo.c +++ b/drivers/phy/cadence/phy-cadence-salvo.c @@ -15,7 +15,9 @@ #include #include -/* PHY register definition */ +#define USB3_PHY_OFFSET 0x0 +#define USB2_PHY_OFFSET 0x38000 +/* USB3 PHY register definition */ #define PHY_PMA_CMN_CTRL1 0xC800 #define TB_ADDR_CMN_DIAG_HSCLK_SEL 0x01e0 #define TB_ADDR_CMN_PLL0_VCOCAL_INIT_TMR 0x0084 @@ -109,16 +111,16 @@ struct cdns_salvo_phy { }; static const struct of_device_id cdns_salvo_phy_of_match[]; -static u16 cdns_salvo_read(struct cdns_salvo_phy *salvo_phy, u32 reg) +static u16 cdns_salvo_read(struct cdns_salvo_phy *salvo_phy, u32 offset, u32 reg) { - return (u16)readl(salvo_phy->base + + return (u16)readl(salvo_phy->base + offset + reg * (1 << salvo_phy->data->reg_offset_shift)); } -static void cdns_salvo_write(struct cdns_salvo_phy *salvo_phy, +static void cdns_salvo_write(struct cdns_salvo_phy *salvo_phy, u32 offset, u32 reg, u16 val) { - writel(val, salvo_phy->base + + writel(val, salvo_phy->base + offset + reg * (1 << salvo_phy->data->reg_offset_shift)); } @@ -219,13 +221,13 @@ static int cdns_salvo_phy_init(struct phy *phy) for (i = 0; i < data->init_sequence_length; i++) { const struct cdns_reg_pairs *reg_pair = data->init_sequence_val + i; - cdns_salvo_write(salvo_phy, reg_pair->off, reg_pair->val); + cdns_salvo_write(salvo_phy, USB3_PHY_OFFSET, reg_pair->off, reg_pair->val); } /* RXDET_IN_P3_32KHZ, Receiver detect slow clock enable */ - value = cdns_salvo_read(salvo_phy, TB_ADDR_TX_RCVDETSC_CTRL); + value = cdns_salvo_read(salvo_phy, USB3_PHY_OFFSET, TB_ADDR_TX_RCVDETSC_CTRL); value |= RXDET_IN_P3_32KHZ; - cdns_salvo_write(salvo_phy, TB_ADDR_TX_RCVDETSC_CTRL, + cdns_salvo_write(salvo_phy, USB3_PHY_OFFSET, TB_ADDR_TX_RCVDETSC_CTRL, RXDET_IN_P3_32KHZ); udelay(10); From patchwork Wed May 17 16:16:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13245285 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DCAA0C77B7D for ; Wed, 17 May 2023 16:17:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=/pGbiGJo+hlSfLSqeXlMcSYH253DDXDBXwhuNsUfRa4=; b=wYws56VLWMIA+d lx21V1pdXDXZq2iVtIqxuXb2fEFmAeuG9/5eiLrWBFvUK8ENE6a55NPunFhQlre/IX0klc78wYYez Lyn3BN/vXQaMPHvlbm+G5N6ZY6rA0pHYiP6OCFu8vOc5SzjIMLyLqPw4HOniEzWOPUOl48RTkNzpA lWsvboLWAbii2dUCCx3YZTwE9vtUAr5l2HWSqohFQNYznptowCMyVkPcgM+t62zr6RdZYD6r6P6nv MuAjxGJmBJHEY4zEAntxvdvRWNi8P5AiCqfVi87uthF/iL0cXjQlPL/t6014D68meA+CvJqR0RGg+ siBzmhK5r4NlIfdgc2Cw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pzJqD-00ARdw-1n; Wed, 17 May 2023 16:17:29 +0000 Received: from mail-db3eur04on060a.outbound.protection.outlook.com ([2a01:111:f400:fe0c::60a] helo=EUR04-DB3-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pzJq1-00ARTW-00; Wed, 17 May 2023 16:17:18 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=f+Gd8gxS1WJVIRh0ViPpcsd+g7AkgC9aWR78quKCZuH8YKrgsDwihHDG5PPR+4BZ0PYnFsp5rZc21rU20DQBcRsXv9LQMf7BGilzRUfCZS1D280QZWAoa0xlmGUmdaS/uoSs3huHaje2GCvlGD7TF4206w/rEZGMFD8uvBRb1qt7gL6nGxDNd4CCTBEKkQ8De78OxXCF2nnvrLHvgwHsehPLVg2hFD3x7v2/kr7WP2cBt/UlajlKwTe3Fe01ATOVhQA4doNdyx2bF5N3LYSh4MzVXvPgRUaw69rjo2VKzHEVTX0cL8Al5uSYlaus/3jIk+6Wjcw7p/bPwxMAnrMjoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=8f+b6cXeWjgCVkuK08UozeofpLH0pNg35r0cKFO4gSw=; b=Fdyrts62xNqWd5NrThZVOtckM7O4SYTta1dHNlUc6Nk4wS1VKDH7+OBxGYobN44wHZTjxpsxUsef5g8cclwGduxzMkinQcgWPvi4jgCkiYUN0pgVE6KZUdj7SN0BgP6/p5RB7l8r9KS+ODWCz6op5IKdKrPkTBtGgzyWG22fqxwcxmxHWMpH/g83UtXbXTd38JVcD2XVJIqxfXX619OTJiAfnsO+AnIOnp4XLvAa8dtff2SNonoImXB2856Ip4chFtRHXrFUYjWGanu+SohiJCXom+sGSNTrYY0g9I17B8Y8QeIP8XRImMzLPqDmlI4slavDFe6Z2FSs/9AzrLcz0w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8f+b6cXeWjgCVkuK08UozeofpLH0pNg35r0cKFO4gSw=; b=YiQoJnhI2/J98wFY8z5uQVuHjwbIjI4us0QKflETNx8t2YycDP3NIEq9mzWDlMqqX7Yj7aNw8xiEprR+H0nQukMm2OQeVfmjKB5ObHd+ivtxSsBYrWCAky+HczAVVs2M/IWvcT45xJiBJScSS+EIKIbuVmjeukqhN2Ryd8hlISQ= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) by DB9PR04MB9962.eurprd04.prod.outlook.com (2603:10a6:10:4c4::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.34; Wed, 17 May 2023 16:17:14 +0000 Received: from AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::25d3:de2:ef1:3884]) by AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::25d3:de2:ef1:3884%4]) with mapi id 15.20.6387.033; Wed, 17 May 2023 16:17:14 +0000 From: Frank Li To: vkoul@kernel.org Cc: Frank.Li@nxp.com, devicetree@vger.kernel.org, fushi.peng@nxp.com, imx@lists.linux.dev, kernel@pengutronix.de, kishon@kernel.org, krzysztof.kozlowski+dt@linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, robh+dt@kernel.org, s.hauer@pengutronix.de, shawnguo@kernel.org Subject: [PATCH v5 2/6] phy: cadence: salvo: decrease delay value to zero for txvalid Date: Wed, 17 May 2023 12:16:42 -0400 Message-Id: <20230517161646.3418250-3-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230517161646.3418250-1-Frank.Li@nxp.com> References: <20230517161646.3418250-1-Frank.Li@nxp.com> X-ClientProxiedBy: SJ0PR03CA0041.namprd03.prod.outlook.com (2603:10b6:a03:33e::16) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|DB9PR04MB9962:EE_ X-MS-Office365-Filtering-Correlation-Id: bc523e6e-c651-4331-6a7d-08db56f22cfd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: TYaH0m4tckogfYSuvIa2a02Rkmk36KdsQLbbzYBeJNqSUrcA5sEi2HC+MA85kRN9wJ3+sSKUaU8cC059M6ikkWaDpPphpG99sdVPoooAZEHjuYb0pAidU+SFYs8aq7s6uY/d1CrGYzTDu7BkOJSYjD5LsPjxxxX0UCIzJsWiKUKiIVtoCGossg14h8veTmsRizR2+Xma9q2x5fwGlPyUe84Ag3I9YoWHjNnPli6O0zAsOQiFT6et8Fa7SPs5I1QZgfcnZZ6c4oXOe3oZ8st0paXXsEKKGlpqTyi8OKY4HYmNke2CeJdJo7SfWy/Oa+Xs3i+pQuf7DRAg1WYPILIpcQF8PujDQyQsL9AyLz/PGwg95P3i4vUFeZgIF8XxhY81W7sAHMmtR16DVToQEiQc8JpkQTo1qiGJBs8VSPTlHuxA3Qt0Lz/g2ymBNSpqERGznFZs5sWi9uhJGtOhSku0sDW2VFc/WKq8QsbOkcehb6aCvzG8/rsyAn7cnYufUkxJe0eG+koUSytuF6gKqLA9vVPGBWwof7oZTQBUn6WCf1KXfIAIBgwk2XfeiBz4ilMPXRvjf6myvGk/JnLfd7eSfGOjFXaDDPgcXRDLktVCq+/W4qRoT0Kk/cO/jb7pmLQc X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR04MB4838.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(39860400002)(136003)(366004)(346002)(376002)(451199021)(6916009)(316002)(66946007)(66476007)(8936002)(66556008)(4326008)(8676002)(2906002)(478600001)(6486002)(41300700001)(5660300002)(6666004)(7416002)(52116002)(26005)(1076003)(6512007)(6506007)(186003)(2616005)(36756003)(38350700002)(38100700002)(86362001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Y/a267PRgOjtBC9XOnJFAzXXTBjTQeHMrUf4lwNCTYY+cVjN4nCdrl85bnYPcYRn80n8CjTkoHkkb+ARlFEvWz2Stm5TjetvsHy9YgrOVHQkcaipJMFN6qGswK/X3fMQg42xj+NEAUASZojjwgNBd0TvD3d+w6fonXJjwOl9j/d/5yJGGy4otb93YFZEssS+cCVHZk/QIOLN+LRRBjwm/sair/oQ9zc6ShhJ4tyEE37R8xn/yGKpg+NZ4sluK6Wz+fGIA6yGvFOxkcpB2cHxMBvkD1l6WHfH7tLurDTn/Ab6ugc+fZvBSlSOM31lSy9PuoWktAC9QZ/CEdAMEIKvgZ5ppZvcGUocLdon8trjG51zrarHzvQMRmSNmtWS3kQBLAiwWIXSjDbM0aTK71zP56pEsKU8CVTkss+1Oz/XAqX0agEjCKYmJ+ZxnUNUHkH96OMrZX45j0AaqByOr6z2WH6WOTfSk/q00m1oWcaXktXQZjWBSvnveo60Ra5NDKi0xj0aEDSOZg/XqWXBJSliWeaWpoK1yFSpi06GvNFLYsQ4A2peCN+rUGdxC3L5AWHpTJAO6balMXz2eihTcTaW6WuwetQUEPtW6YZf8iT6ylr5hvMPs3xuXpbPyipzqHxGaMl40dmvGn8peEpuffh6AL6Hm+hEDE0JGgJJSVXqrmvtJ8rVTYO0FklkW3U5Do69DHdh4CG7c8UbXth0zEz1AFKe62WD55Q8B7TCtTKigvvBP4//eNM4v0pR0nN+VNQe5Yhby+InI293N9ZmDO8WZclwRGPN+4oZYaORhyKcZQOf5DlhNL4F0wbUXB7SQwbLKcYDQJ9O/YrIFv9GFAqqTTL1mmuHn0FLF1wLe7AuCFhO9NfNHfeTKs9AIHdG1N4LhERvdndsBCN6XF1D0pkKE+BxNJqeFe+iSFZt6gXrB07LiPFUt0rqQq6UrI6LXBSuI9yfy1oaCtTsiQ3KVYXPM+Is4S4GoumDcoQwqVFofPAxCiYlJugIh1bVFmIPZsYUOvUVNlko/FV+dR+JubKTSzFPBi9ipcN6vxC1XN5UdPoUlLTT6SYeTZqotr8ZlNatsQFBk8v9RdBhwnbD9TbAiIPAoOA/bbte1Lb9C1optd/5p1QlBmzsJlLGFhqRiOezmpCoFcqZuHePEwf/Pp+1++jD34ESngBBlz49W7aefdBWxXqTD8T6TWM8k0HZFBYJRtwiNIObnmnUdoHXNdOSn/nQdc/TitjcEm2RzOf8EKI8HrHEpPWHaJPvRl+WD02J+fonFrVVjLe5i3k4IJ/+LwabX/SLOxYxKQfvdBU5S8MgZrLXSMsFzXfoOKvTSYNAGenMnkzuCs923dz7icX4yhz/pfpARsH/eyJskOXp7GJOmQ9YUgSaJuf0gVqzoBrnSoeHjjJlGk/uuXvhygD2P7Tl0QuQNxSqi6a1vIA/fObFEhL6zWERdG7rq4xq3JtCCi6wga6zLIeg//aEhp7M1U3hcAnnF5f/f/Y6JhFXdLvMFNPSVT9/BDenIk3lTT/3fiQPkRz8sRx+Mug4s7eXBk9fTa64WmP10r0S2LsgLuo= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: bc523e6e-c651-4331-6a7d-08db56f22cfd X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4838.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 May 2023 16:17:14.1323 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: VrA+YBdfx5oiUquRVuUZdJr60DZlZiWI2DYCLfucPiUzDnilmWi1TeJiZya5VWkSWRZEG/T8XRSFJzdo20zbgg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB9962 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230517_091717_054664_DBDB5F0E X-CRM114-Status: GOOD ( 11.20 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org From: Peter Chen For USB2 L1 use cases, some hosts may start transferring less than 20us after End of Resume, it causes the host seeing corrupt packet from the device side. The reason is the delay time between PHY powers up and txvalid is 20us. To fix it, we change the delay value as 0us. Signed-off-by: Peter Chen Signed-off-by: Frank Li --- drivers/phy/cadence/phy-cadence-salvo.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/phy/cadence/phy-cadence-salvo.c b/drivers/phy/cadence/phy-cadence-salvo.c index 06c5dbdb700e..2e3d4d8fb8eb 100644 --- a/drivers/phy/cadence/phy-cadence-salvo.c +++ b/drivers/phy/cadence/phy-cadence-salvo.c @@ -89,8 +89,20 @@ #define TB_ADDR_XCVR_DIAG_LANE_FCM_EN_MGN_TMR 0x40f2 #define TB_ADDR_TX_RCVDETSC_CTRL 0x4124 +/* USB2 PHY register definition */ +#define UTMI_REG15 0xaf + /* TB_ADDR_TX_RCVDETSC_CTRL */ #define RXDET_IN_P3_32KHZ BIT(0) +/* + * UTMI_REG15 + * + * Gate how many us for the txvalid signal until analog + * HS/FS transmitters have powered up + */ +#define TXVALID_GATE_THRESHOLD_HS_MASK (BIT(4) | BIT(5)) +/* 0us, txvalid is ready just after HS/FS transmitters have powered up */ +#define TXVALID_GATE_THRESHOLD_HS_0US (BIT(4) | BIT(5)) struct cdns_reg_pairs { u16 val; @@ -230,6 +242,11 @@ static int cdns_salvo_phy_init(struct phy *phy) cdns_salvo_write(salvo_phy, USB3_PHY_OFFSET, TB_ADDR_TX_RCVDETSC_CTRL, RXDET_IN_P3_32KHZ); + value = cdns_salvo_read(salvo_phy, USB2_PHY_OFFSET, UTMI_REG15); + value &= ~TXVALID_GATE_THRESHOLD_HS_MASK; + cdns_salvo_write(salvo_phy, USB2_PHY_OFFSET, UTMI_REG15, + value | TXVALID_GATE_THRESHOLD_HS_0US); + udelay(10); clk_disable_unprepare(salvo_phy->clk); From patchwork Wed May 17 16:16:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13245287 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B1C2FC77B7F for ; Wed, 17 May 2023 16:17:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=WZ8e7YtiA0c2qz1YQnA1igGXOrj5NFIHzGSAP/BOswY=; b=U0zQDJq/0AgKHB 0XUoEG+WaGEblwLDefhBKCrG2BU7mktrL3XSrW+wwmNHc+fLMTmNzmt2Z6Iqfb4o5WNXoQi1sYdyK +eGB545By+zVEiXHoW6iFtEaEXOYcalaaBPClJQ9ywx9KTuaNhOE8yebQUN0qijEVUEfFnPYpr2KO bqufgw/Y9bRiTe0IW9OTyWgO/54kKbVvH3AndpmOJtsYHb3b8RJR8k6gI4bcx0qQYg5VEQ8ZxPwBj LDT/hJSM0JMdANqpqAaXRo1JafepX40CilzP2EBvkB9YeTBRZ9l42Sgm691+L8RAdonP+/ErZt5Do HRWRRBYxaE4tStcQ8psA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pzJqE-00ARec-1A; Wed, 17 May 2023 16:17:30 +0000 Received: from mail-db3eur04on0611.outbound.protection.outlook.com ([2a01:111:f400:fe0c::611] helo=EUR04-DB3-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pzJq5-00ARXo-0Z; Wed, 17 May 2023 16:17:22 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=a+qF9u2ZqVtQVjE5mE17iboSu0Q8jz34v/94F1ke7hIxpPG+jb7jMxhC3IzHV86NzTbQ7f95EE8iDgPvveyU70ncZBPeLU5kYt0UHl6eTB+p74deklRE7QAjRnLB9wqdY5VqzxNVkBi6i68fWYLrDoy53OwwW8obfrBHXl55ybMu0I+5i12n/turQ9WevsGs80jRmo5pg8ca2MJEaJ7cjIAkFTSkEY1ci8IdBbpqilk4baQTfYn/CwwmP2pmeGuiOMrM+Vb51aFwI5ZWA9DdM9icR2tI9kCNDZr0wS8bx0D/gOcD+mjI4wAL5XqNVaV16Ie1t3HOWWQPIu8dlWptAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=KxcKOSTNVVlzK0XZiBKmlLM/0WQRmY1RJtAKhcdVlos=; b=XFMkzdnDQgzXrHzUzpXlgEvZ++mvD0A+lvbHc0yKbUqldS8iWpUCsoyjkM8FEPe/NAYUk/t3sdxkjd2d8rdYL/GhlWwgsCiJUbZnuP7H15GXW0aakCZ8BOX9aioUp9kOsS3mol9fhk1+DYVcvYc6xXm9aGDkEANPTKqScJfHUlTIPU2tWf4nMaCi+DCwttBIRiJPWgqev1Jzj0daCOiWV99lZejK+bb9X+30Z8Z7QrfwRzfBFQ+uWnH0ymkyvUJUy8nUF37iHrHv+uTdMoLRtzOTjd4C1PL5D93ThCjavGdjfF+WmB7TXxaKJvq5BU18Cvsrgfrr8y84BIyeA7ImuA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=KxcKOSTNVVlzK0XZiBKmlLM/0WQRmY1RJtAKhcdVlos=; b=sX9LDQZsjaWq+QaGffUQnDfbQazHOdouemSi2uqSdDi6oGTEXK/flFFVrOFcBnkF1fKU+W0Y3BKzmjkxMFXekjFmEnyqghnqPYfNr5+adCFYjN7NOm6tISLPVXNdXU5P8rDgHbl+lAaLZRfq4PWZivEpr0FnIgJEfPhpZPaPfq0= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) by DB9PR04MB9962.eurprd04.prod.outlook.com (2603:10a6:10:4c4::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.34; Wed, 17 May 2023 16:17:17 +0000 Received: from AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::25d3:de2:ef1:3884]) by AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::25d3:de2:ef1:3884%4]) with mapi id 15.20.6387.033; Wed, 17 May 2023 16:17:17 +0000 From: Frank Li To: vkoul@kernel.org Cc: Frank.Li@nxp.com, devicetree@vger.kernel.org, fushi.peng@nxp.com, imx@lists.linux.dev, kernel@pengutronix.de, kishon@kernel.org, krzysztof.kozlowski+dt@linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, robh+dt@kernel.org, s.hauer@pengutronix.de, shawnguo@kernel.org Subject: [PATCH v5 3/6] phy: cadence: salvo: add bist fix Date: Wed, 17 May 2023 12:16:43 -0400 Message-Id: <20230517161646.3418250-4-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230517161646.3418250-1-Frank.Li@nxp.com> References: <20230517161646.3418250-1-Frank.Li@nxp.com> X-ClientProxiedBy: SJ0PR03CA0041.namprd03.prod.outlook.com (2603:10b6:a03:33e::16) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|DB9PR04MB9962:EE_ X-MS-Office365-Filtering-Correlation-Id: c08effe1-ab94-4974-f87d-08db56f22f1c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VZD7MUR6D8QDXD0ysz3PDKsIsYlpSCbJ4KHx09cziwM5C0RPz8pGm5Ed2JjR2kVLODgs9WyEJ9xQTB8FL3RvZbe+k6DA6axLSfbSZKqXxjvS+zp+lW3b7voDoEWGwtZo4/sxbGVUgxmsUGHxwJXbhgAyP4uDR1aeNNdABi8n/+BmhixFg1FhCO66UH+414oBqrXHZHgTd09gonugU3FwmBl1jfrFDtGiPSZWlTDxYSPzgT6UJoDRby1t1SscTLJi5iFXBKQS4ef/I8X0x1ffmGIRUGMidGetYFzGDpltoPvzbHjywkBuMY0bnDb21uw/ApZkTgaAizNL0vrvr3hkJ36Nh3EUS01+HxlAdjqEPOpZJZRt/cwLMjy1GAqht3quxf6pz3RKaMp2tbeJaWOnJZncSnv5bCtdmk+4aCTmRwXc4rPpIRTMk0w0DbyRC4yBnE0Y7aPenyvRIEoMFM8LJH1vz4sgodwY4TZq5IHbHecwhs6LEWjqo/SGddz49UJI6KKwgGrUzT25D+1FiMpHWTRcZWtXpeCNhYomuvxmf7bPMmIlZcuemH8Dkp2I9nY5hdIctx5Z5n+l9iwIAo8gq7PF3TveS3HiJOFKkGZcJs2cnkK8vPGv1/o99mTkyZIN X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR04MB4838.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(39860400002)(136003)(366004)(346002)(376002)(451199021)(6916009)(316002)(66946007)(66476007)(8936002)(66556008)(4326008)(8676002)(2906002)(478600001)(6486002)(41300700001)(5660300002)(6666004)(7416002)(52116002)(26005)(1076003)(6512007)(6506007)(186003)(2616005)(83380400001)(36756003)(38350700002)(38100700002)(86362001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: GrQQHXj2KccMcVl3gBzDhafC/XjTNWG7jlUt7DC8ZN9z8KUghD7qjZjTN7IpkVZB7r4cKwnP0ZEDLDQSVCv0YPcMn3+tMPIOMj0NyHSugX7nnezYlToczh37opo9F1vtvdONA0EacrtbgpkqDekOO81NZnyf1HDHFo9eiw1l2f0EZKfbXbIoFGshdB5jZ4icB5BHmgLInm80ry5TGURGLN7bJBdYzHVQmeu8WaW/1tEi+Dlz5VBL55JoWo4nSYbK+DTgJ938w2wJaWFierKJEVkQHMDjd+k2lrfyGgPWYMUzW+J/Dmt2ewx43KEPEPrjH47WjJeYbB/F/G8yg7pi2UEshckiJPDmZII1NfCJpg4euOBMebEovq6TRCWqSEtRL+RNhbYTDJIgkpTSp8WPDlsJPU65vu6Jm0OtGzCM81h5x8MxTNH1B83roAbC4xmyGvMorENXiaRnT+QFmre+TUAWdjlpFyGLpM7WmT34wlZP4/+M8aFGeclUN6LLk9AodeG4QsD2qj/NRrbOz0IbsX8IRy0jU9YJUKdCwrUJZmHUe0gdFRJcoR6PSTwdoeZ/p5R+aWAOdch9q/UuXLYq8QPHouc9Nysv8s24A+THyWi2e4MxwkzlQOyxyHWGDD/maujIDLG4k8Es17y2lpvdAM34kdLhWs5q+oLASNc7z7Bq++WANPq0HoCFKjpTayY3crA/l60vBNAYNPYAn6TR3geoKmM+Q62Qy30OOCjfDetD/nvx2sKCLh5TR5gX/nEfrLdyzUEDeHRVbRLhwtfjgiLJkVDkQ72GqkDlmIid4JCfEy/S+sTdOkDK2CEfFtQ0NoZ5MI91uOrsbDjwmrhKKqYcg/Mc1YjE4HtuxVUQJCS0591vmeeeD6phxTbOWSAv6U/P5a82/MV8rFSaFAIIWA4Fpunm/NSS2vbqdXfmq+XkMSI9CM22n40jKgndU6TYdipmIbACNlIt/jskgVTTzgByflFuyfuPZjCilzz4hbVNT7y2fZbF899QfFU5Qzc8tz5XmnOpJOQ0HfOCRZEez8EPW7Lu4TzM4ajB+5qifL5/kuGDtKEi5nr3/nnl6manJncN+jt1WafAidoZCxkJEs7rT8jqiMFPKgfvjMRE3gQgiEnCy9qM2/y/G+DLgXK0mw4zbif5mM94QXcpxgiczBo805WIoc/h0z8p83CAv+wqDXKq/G3cO88qYAm4jTWEH+xEsa33VVhmR9Qrnt3K/4iuUcdIcc5+AZz3Eha7RvNKNvHLVQqt7aduZOFkTIOJ+Jlr5NyPI6I2E8c6j2Wp3MSJzlsm0X/mgNojNRTYRQZWysjUMlIX8Pa7U5kCo+SdszewzFeFL5LHVxZUoU40+afO+63CGcb3IalXq1bJ2jcKcIbEzJEkynzpraqmx7XcpWaPC9jG5HhIqVTfcgMSSdvJX+v+FhmLLcGz4DposmqKMGrYeiDtwhlf0YRNmettrjQCsGD1tLM5lfn7LGcwa8WliBKYhANN1Tpw6TRwqquuja4HJthB96sUO0KBjhBzBnZbCVphb5GRADv1wHJ1QwHayCvQBuF1Z8/SHMt2xDw= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: c08effe1-ab94-4974-f87d-08db56f22f1c X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4838.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 May 2023 16:17:17.6788 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: smIuhAIKjND13W7SrfW3aKjl4OkCA5/gDKLThe4TZYApAV54E/8p//L3wKu8G9FxyeCf7PvVaExo7TWVnZNrKA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB9962 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230517_091721_214696_4E2D1E60 X-CRM114-Status: GOOD ( 10.18 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org From: Peter Chen Very limited parts may fail to work on full speed mode (both host and device modes) for USB3 port due to higher threshold in full speed receiver of USB2.0 PHY. One example failure symptom is, the enumeration is failed when connecting full speed USB mouse to USB3 port, especially under high temperature. The workaround is to configure threshold voltage value of single ended receiver by setting USB2.0 PHY register AFE_RX_REG5[2:0] to 3'b101. Signed-off-by: Peter Chen Signed-off-by: Frank Li --- drivers/phy/cadence/phy-cadence-salvo.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/phy/cadence/phy-cadence-salvo.c b/drivers/phy/cadence/phy-cadence-salvo.c index 2e3d4d8fb8eb..5633fd21ae7d 100644 --- a/drivers/phy/cadence/phy-cadence-salvo.c +++ b/drivers/phy/cadence/phy-cadence-salvo.c @@ -91,6 +91,7 @@ /* USB2 PHY register definition */ #define UTMI_REG15 0xaf +#define UTMI_AFE_RX_REG5 0x12 /* TB_ADDR_TX_RCVDETSC_CTRL */ #define RXDET_IN_P3_32KHZ BIT(0) @@ -247,6 +248,7 @@ static int cdns_salvo_phy_init(struct phy *phy) cdns_salvo_write(salvo_phy, USB2_PHY_OFFSET, UTMI_REG15, value | TXVALID_GATE_THRESHOLD_HS_0US); + cdns_salvo_write(salvo_phy, USB2_PHY_OFFSET, UTMI_AFE_RX_REG5, 0x5); udelay(10); clk_disable_unprepare(salvo_phy->clk); From patchwork Wed May 17 16:16:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13245286 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A1735C7EE2D for ; Wed, 17 May 2023 16:17:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=jXmFmJqtzdU/kanMaacpYcYYMTmW1n9E4rhNIWTFQDs=; b=J9CMo4rGznsRwR Ik0RlJS3ANHm8/TZaBph4rYEvg2T2f/QRK3e1dVCWtzEONwckPttEPmpbdfTT6dai0mTyIpJU3N+H VL59TsHidRpYJslRN3RX6shjizqKnYev7jS3E3jHIChAc9QE/BMadQfjBpWsDFNtotKKyiu5ZAcGp 53eB1uAkQS/95HX95/h4bEoZhRaAyOz2bMnus1XsrKfMgYxLCKkbUoJWqyJPBnMBpTJzL8SFeTRaH ep6XZjE2HHadihMKZZOdR59WaBTy2s2hC61KLgFMamRRwjTR97UXm0ZGbloYTV96O3jrhVx8snrVJ AiNJdUQHGKCFMnGu48Sw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pzJqF-00ARfb-0x; Wed, 17 May 2023 16:17:31 +0000 Received: from mail-db3eur04on0604.outbound.protection.outlook.com ([2a01:111:f400:fe0c::604] helo=EUR04-DB3-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pzJq9-00ARaP-2F; Wed, 17 May 2023 16:17:27 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GxesHcjRr+cXf+8zvao5RwiZLexP4R6ZaC5b4Jjf00OMhApYHXxLDR1byU1IJ1qT/28YQ/8iodumG2tVqZ4yqv7/D/Criq/tZ7nfatEwUT4vP/RroS+X0h18rfH4adIP4te8QtOosXj5O1hHgUA3yKDvSdABP5oD4xlIEbTa7MLKBydJG/Pzhth8dGgt+yDXrL2aRVpiYXOsgXA55/+SqcZAzPTwINYjKfEOBh0j1UEWN7cUsuBfc6ABUWXw6NS50ITtF/E2UzCrTgCfiyf2o64j7j2aeVzlsnlWOo11hEZjTpwFmN1auXLRaiPxnYYMmEQbOT/91qrAyT1fWZ8iqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=DVm17g7uRevK5sYQoI5+K/wE4ULpyAFhfUnYx0zKro4=; b=SdFOJerBc2/L86LAH0lZbVJnqQ/i7GCW8vPfGqAierlSDdCkuHjuKwPNM/gxKGTLPqMvJdYexoCdWKmwE5AfP9V8K8qmywsWCpD7ZRfemSdDh5fdzN8GZa0VXMatSW0Vbz7TlhyRm6NLtUIHlkyZ2CRhDDjaTQmiuUjuYm0SMXTDLa07CCXfLyJTJ8EcmhDwSK0r/ds5xyJIpBztnicqGNwrOi9G2r6iQdgAd/TRCJ1QT8/tnkxhuKAKnjEb4PcgphE0jBzHi9DurmTTSOBM0FPhPsrNCZuVs7/FS8TCwSVbkQoJX6xz1ihaNALP5sTSC3EDmGIjxfkXCseWUiv9Xw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=DVm17g7uRevK5sYQoI5+K/wE4ULpyAFhfUnYx0zKro4=; b=pddG+D9E3cJDmKT+XQv7FQ7siC/sxns3VHPMZii60s0BGAmZX+P7A3a8Ec0MxncXeu4fBzdomZJynGQU534C5QqMHNvC3LlAbhwiBzK6G2RYQYUYRSmOR5GlIi2360m42PZa1FuG0hn+Cf6NrcKE4IXP8d6brh8Muitm+aLZ6io= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) by DB9PR04MB9962.eurprd04.prod.outlook.com (2603:10a6:10:4c4::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.34; Wed, 17 May 2023 16:17:22 +0000 Received: from AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::25d3:de2:ef1:3884]) by AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::25d3:de2:ef1:3884%4]) with mapi id 15.20.6387.033; Wed, 17 May 2023 16:17:22 +0000 From: Frank Li To: vkoul@kernel.org Cc: Frank.Li@nxp.com, devicetree@vger.kernel.org, fushi.peng@nxp.com, imx@lists.linux.dev, kernel@pengutronix.de, kishon@kernel.org, krzysztof.kozlowski+dt@linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, robh+dt@kernel.org, s.hauer@pengutronix.de, shawnguo@kernel.org Subject: [PATCH v5 4/6] phy: cadence: salvo: add .set_mode API Date: Wed, 17 May 2023 12:16:44 -0400 Message-Id: <20230517161646.3418250-5-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230517161646.3418250-1-Frank.Li@nxp.com> References: <20230517161646.3418250-1-Frank.Li@nxp.com> X-ClientProxiedBy: SJ0PR03CA0041.namprd03.prod.outlook.com (2603:10b6:a03:33e::16) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|DB9PR04MB9962:EE_ X-MS-Office365-Filtering-Correlation-Id: 5d3c4282-611e-446f-1e31-08db56f23197 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +nXpxxbrCPSb8jYD+3QJQa+6KkyJJOk6dMdvj1bP4K2o0J5Codbo9MjUBAx274Tt6zGs+/jjyIzgmJ/i6M7K0bLTnXj86Gq/A6C03Ql8XkpT0kZBvJIR7GVTHhKnEFg6R8MeK35hLEiU831hrwH3ZLWb/AkjxIWyodUTmNBLIJuVAKjrdJFxTjXR3MIl+fIpuKOjgaQAFycpZUiTwlXD2sbt7pHda4h9JUvwnyun+Gd+O7jXN/w3JN69Qjk9fNDxtdYc8Oh6mQKGFdXPZiVBdWM6akc12zlzgTjsg7jKPI5KfG9RpnwJ9tlLYRambP2meaFDadNKwArd98TGXoIFtCGUR8O8Jz21ITaXTP//whrWI8FpBImBdxqYYGdW9K6fNzOwmCStstWdznoqDLpBTdX+iGSaG71vEEyH6zljELpgEcrpjffXPIxM7dNwOFltDuH1DQM7GzM9OHR4/w4YFRmSyngSFMjl7rFjk7I8P97/GL7EcZocAJeWMZJn9lDqkctGgM02xxn99VBEgbjYTXKKUmbzApudwiY3HCzSJMUJEfBOlcxTrrUoO3WCeVhQFtZhGkcmoSKJhx9PChv+5E8a9xNQVB7fPwxDjBgnH6qICtvN0c4p+S83G5EkKbSV62QRH3BYX7U5MyUqu4xquw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR04MB4838.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(39860400002)(136003)(366004)(346002)(376002)(451199021)(6916009)(316002)(66946007)(66476007)(8936002)(66556008)(4326008)(8676002)(2906002)(478600001)(6486002)(41300700001)(5660300002)(6666004)(7416002)(52116002)(26005)(1076003)(6512007)(6506007)(186003)(2616005)(36756003)(38350700002)(38100700002)(86362001)(142923001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Z0voyrvW7DhPOtKJ4SmCzN4/nqWu+TPVtBVFnSmy4c3lVyME/z+UVyPoNGXfzBiVDr1D8aSNr6dzY5YL0WWM/COFf7NwX2SIg8LO8SO9FERvQMQj7iTsj8A/SP28gaJ6BPhsr0cZ5WigX1YAcCA6APGweyOQlhMqo3/gS9ZbAHykN1iI5INDGgA0f+E6N2m37+U7Sk8l6Aqmt+yxqf2vfsZ8g/Ctkp9Tpd+YcW8KbZehuU9NDe5DLH9qfFQMMlaFs2n9iwFtymYmo7o/BMRgaa+jDbzYL+vY5fgGg8BLzRx1lfTIb1YOHolvcNrmalFeLN37BxZTCz/5bKJL8hYzttlT+DNsr6BMpJ58SMY6rMoDGtIn7ebV0heLjIWWRBtyRnNkG9sy7u3aBZGFc9Q9sZhZXappiRiesnx0dKneWE15nBifRhTiHGDKiboEvMcT14jMfM3A54Wuq4mQJMJnYE4SXhOmjZUSNFAVIqJorLs0+RBepBNUqcZoKRkaRKzeaqHeWoafhVS55imVh0oOJm4vKdBzcOhOStRBJV4jl6pQRav16w9OWuAAKul38kzLa1aEX72IfudCePWslYeUwCrc/ymNR6GslKAJscI8JLhrA87nPNiSmWtGmax3FWPRUfTdwETHcfY3XuzwEfUFJSeWHOiBG2GtK0mpZXFHDHZXpUc0BV9ybrZ4d+2hDAn5TsUiknNi7KLEBsygUtjrRbGVzyUL4X/g0xlSDhZeRzw1SjYSXIU/CFAAfvrWyaHGbmPfTdPJt17h/yvJWMZfqLJ2OsQ8JSbWt11ACw4V3o9dYNhdlVep6qfk641lwNPjSDyCoaeCjnzzA17G6Sb1W0N1q3izFyRJ3jP5ybc7PkhUaEwjxSih+pZi6+DAqaU+g9ZU8Pdt6zszgqocw5Mt+iW2bj8Xl5woIg9nY8GojDeqJyp4y2y454+GEWIJ4nekSaSkWfp2jymaiI9Zcc7xyccP1E4n8ZyNu0vcCxq8BidF/66KPaXSKTzYp6jfFuzUwImMCAM8X3KzucRENgBsFqguUMu/K+pQv+mLK0Hc6LBu6qfw0OzLn/bYeQ0QnkEA7Q4r0E0i8wVW73STq0PWVhzCCG8enARmWfhvjNUxc86pHYMn6eMcEe7zLxcZQNPQjwyfUY1ip17HW/zrj7uOFPm5cJNzUy85v6Y5VpfhlIwlQS6nXCGozxKB0JAbumK/CvqyXh+Z/5LMdKOqNzEbrvljML5g1YpjR0FzzOcKI2ARpSd9smvj29G0E85T8rG3OQ3Sq3D+S4G2ic2350CeA4t1G2+ewfAICHF+x7plaQxgpKBXddaIshRc1jc8nQV31j82jE4E7WWvzDJOPrQgTCDiweC1nafP3LIpIU0ofY/f3FUqN8NWGA7s9MXWf+1DVMUrqkbYyNnTczP18+ECM8PsokRR83z939R/1m4ft+l87FnIjsfITZAh1i+Ld+JkQKF7LVRAEmj180AeKXFHRpT7KRpLCj3qQidfhrPJZ8mJ05badMFZ7edpyz0WxrK0ebV5uiykGjwSFKfxvEgP/d1VV6pvOSBI8OPC82DktPI= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5d3c4282-611e-446f-1e31-08db56f23197 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4838.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 May 2023 16:17:21.9625 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: oCAMZtbsDM0nFNgHls9PU8FiIaHxq64t+J7ZqrDkhAodZZBbob/xPO1GKjh1je9TefMXp4NZ/M2zkaaYUWr5Kg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB9962 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230517_091725_736348_9804F1B7 X-CRM114-Status: GOOD ( 13.70 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org From: Peter Chen For NXP platform design, the PHY can't know VBUS well, it causes the FSM in controller seeing the disconnection at L1 use case. With .set_mode API introduced, the controller driver could force PHY seeing B Session VALID when it is at the device mode (VBUS is there), and keep FSM working well. Signed-off-by: Peter Chen Signed-off-by: Frank Li --- drivers/phy/cadence/phy-cadence-salvo.c | 29 +++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/drivers/phy/cadence/phy-cadence-salvo.c b/drivers/phy/cadence/phy-cadence-salvo.c index 5633fd21ae7d..083de7190819 100644 --- a/drivers/phy/cadence/phy-cadence-salvo.c +++ b/drivers/phy/cadence/phy-cadence-salvo.c @@ -92,6 +92,7 @@ /* USB2 PHY register definition */ #define UTMI_REG15 0xaf #define UTMI_AFE_RX_REG5 0x12 +#define UTMI_AFE_BC_REG4 0x29 /* TB_ADDR_TX_RCVDETSC_CTRL */ #define RXDET_IN_P3_32KHZ BIT(0) @@ -105,6 +106,9 @@ /* 0us, txvalid is ready just after HS/FS transmitters have powered up */ #define TXVALID_GATE_THRESHOLD_HS_0US (BIT(4) | BIT(5)) +#define SET_B_SESSION_VALID (BIT(6) | BIT(5)) +#define CLR_B_SESSION_VALID (BIT(6)) + struct cdns_reg_pairs { u16 val; u32 off; @@ -124,6 +128,13 @@ struct cdns_salvo_phy { }; static const struct of_device_id cdns_salvo_phy_of_match[]; +static const struct cdns_salvo_data cdns_nxp_salvo_data; + +static bool cdns_is_nxp_phy(struct cdns_salvo_phy *salvo_phy) +{ + return salvo_phy->data == &cdns_nxp_salvo_data; +} + static u16 cdns_salvo_read(struct cdns_salvo_phy *salvo_phy, u32 offset, u32 reg) { return (u16)readl(salvo_phy->base + offset + @@ -272,11 +283,29 @@ static int cdns_salvo_phy_power_off(struct phy *phy) return 0; } +static int cdns_salvo_set_mode(struct phy *phy, enum phy_mode mode, int submode) +{ + struct cdns_salvo_phy *salvo_phy = phy_get_drvdata(phy); + + if (!cdns_is_nxp_phy(salvo_phy)) + return 0; + + if (mode == PHY_MODE_USB_DEVICE) + cdns_salvo_write(salvo_phy, USB2_PHY_OFFSET, UTMI_AFE_BC_REG4, + SET_B_SESSION_VALID); + else + cdns_salvo_write(salvo_phy, USB2_PHY_OFFSET, UTMI_AFE_BC_REG4, + CLR_B_SESSION_VALID); + + return 0; +} + static const struct phy_ops cdns_salvo_phy_ops = { .init = cdns_salvo_phy_init, .power_on = cdns_salvo_phy_power_on, .power_off = cdns_salvo_phy_power_off, .owner = THIS_MODULE, + .set_mode = cdns_salvo_set_mode, }; static int cdns_salvo_phy_probe(struct platform_device *pdev) From patchwork Wed May 17 16:16:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13245288 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6966AC77B7D for ; Wed, 17 May 2023 16:17:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=v9p0RBMuTMufEh7ABZSYZ1En01rcTXRqYMwwQSVdxcE=; b=wxk48cEuLVaQGX Wrj0aSIXaKxc1yUWzXIARSjIPlLkOtvlb2slOXCcT/FoS7vdp3pUUy/2qO0QlAePcfdqkyectCmB+ pQWTPiv4pTgLn5YiWYLZ4nz780SoqaJZiV0IQkPZppnmcMhkS4mnUaObzGmfiimDCb6U7RCqfvgkp N3hzHCqgvkxTyd9Y0iItwLI8vjjVzyk/KIASaTFUOZqOCcP0Z7bU8UfysArEAJyo57DVvc72pMea0 /gGHc4hkoL3YkviIs5O8IInpJnu5r8jH2mO0IK/Pjy/7lPRW2X1Qmz/ZwkAS3dBqrOejMmcaTe6bS z0wfoAzsjku3ZL/RSyyQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pzJqP-00ARlL-0F; Wed, 17 May 2023 16:17:41 +0000 Received: from mail-db3eur04on0604.outbound.protection.outlook.com ([2a01:111:f400:fe0c::604] helo=EUR04-DB3-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pzJqB-00ARaP-15; Wed, 17 May 2023 16:17:28 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NrFEF3GtTS0q6qk5HK2W0VTVOLxv6tPsz0TfyV2Uij68yM/bES2YkAqxnAoBdaFiOkOmXp1zsLT8nodye10CArNDxg0P1WhFYb7whUJ4OVDmxUFcCuUR/G5AB5rNGJOujuF6EHGJgSe+wu9Hcivwr0/NZcc8T3jjK8GpL0Q13iQ+G744cIOJpbNKGxq1THlH2ArYEpcpMkinVHO83lLRPlH/tbINB4+GEkg0YdC4uQO9vzpHILGzlZK0bJ+d3gyWDQ2EQtoe7Zs3SvUXHtIjhWoc04nYep0xdJAflqhW0qCCkzJDSYqKGrKtsFnksGtA7jifkO3POzsI8P8e5MsFqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=nX0CZJ3GGOrXF/ob/7N3uvCKNqXVGbt/JOtIlC5YRno=; b=UWFOveDHZvVNZP+B0R/BorZwEyibDnVvwTFqSwlAAscfJQw2X010iWXcP6SLOCQGJP2pqCWuwpnEa8/yY2zVQ1M2XKbYWMX7aZAd3QdWO+VcANb9cJTxaV3RPiaz0SIiIdbJxFzzhv0LAZj1RdKKA3gt32XjR9mx7hqnzJzsoiGhDm16oL2q+/o9CMhtfpadjLxY2lfOc2pcekm+MvBDJ5M9Dql2NmZxYPaIlG841NxFuB6z5vQ+6oaAYDkBWAY1WpRysP29aWtnEonw8FPET7W4ivVHG7rFAQOeAlv/qG+jacgbv7GIvu8UJmdWZtvgROB12MRH2MJVSdt5xXkurg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nX0CZJ3GGOrXF/ob/7N3uvCKNqXVGbt/JOtIlC5YRno=; b=jSI5VtJnyV1Y+T14neE1u/P8Fjkl4ogCQ+QUdXv9f50Q6sf+nZV8ojhXb3ZF1+x6QJpzIqAFLnm8KYECZq5jfhfYCxdnIfM1pAO7+Fc0TE7fDaFCzWm3XWF8X0och0o+a6u6mk6GExuY+6sp+2Qqdsi0U4UfHuqWD0yNTMgwCBQ= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) by DB9PR04MB9962.eurprd04.prod.outlook.com (2603:10a6:10:4c4::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.34; Wed, 17 May 2023 16:17:25 +0000 Received: from AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::25d3:de2:ef1:3884]) by AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::25d3:de2:ef1:3884%4]) with mapi id 15.20.6387.033; Wed, 17 May 2023 16:17:25 +0000 From: Frank Li To: vkoul@kernel.org Cc: Frank.Li@nxp.com, devicetree@vger.kernel.org, fushi.peng@nxp.com, imx@lists.linux.dev, kernel@pengutronix.de, kishon@kernel.org, krzysztof.kozlowski+dt@linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, robh+dt@kernel.org, s.hauer@pengutronix.de, shawnguo@kernel.org Subject: [PATCH v5 5/6] phy: cadence: salvo: Add cdns,usb2-disconnect-threshold-microvolt property Date: Wed, 17 May 2023 12:16:45 -0400 Message-Id: <20230517161646.3418250-6-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230517161646.3418250-1-Frank.Li@nxp.com> References: <20230517161646.3418250-1-Frank.Li@nxp.com> X-ClientProxiedBy: SJ0PR03CA0041.namprd03.prod.outlook.com (2603:10b6:a03:33e::16) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|DB9PR04MB9962:EE_ X-MS-Office365-Filtering-Correlation-Id: fc15543a-61cf-438d-fa14-08db56f233c4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wt1hYMW/6EM6+GIL4MTQlM6ruJmvM2I0vRRe5jpYBmqtpBUm3khsVhFEVoddIxi9dYPkiKTP8Ee60aqMt20aLtR5x0dWe4Z7IOhb79hWLkmHIy6fykoAUnYsuMUwukoU6XcK0SOYCnLfIMi4UpHJxlZA0APG19+amsj4QxSSqv7JZxid/hCgsk2uvNWM/AMeAIMpWw0HlxMwv7MU4Usa4CfJmuYMjuGOtQbweTgcabPY6fG9Jcs89aJy0NVzDl2GFhGh++uJIxjZFSk6rFf5TBzRH1vlyvB+uomXPhIAWA83gRzGek0LiT1+Cs6lQAHSmWqHJUu81kupZZvMOFhbeMeSydVpAr6zAVXH+wjV0fqfqyKXKlfobbcWzQa7EwY+tgEYm2CF+cQlRX30JNu2vASJIvEy8B9e4XM6mFIXnoKhKaVLNr6J72mOkMoCugL0Q5+mzXdi4U0xjnP1Ztnz4CNzJfi1Muw/X9fOmt8k1McVtujasUzXtHn0328RpM5d0JaSu1UeEPisHK+Tajt8Ytxk7CayJ/VfHbw1mLXVD/N3XJI+vVdpfVZ6nT67gN17cQjFALkqM6KoHPK3plD0xe1LMiv6hKlCKfoZh5gaZaGeF9HHfPGfu80FYnjPy1pb X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR04MB4838.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(39860400002)(136003)(366004)(346002)(376002)(451199021)(6916009)(316002)(66946007)(66476007)(8936002)(66556008)(4326008)(8676002)(2906002)(478600001)(6486002)(41300700001)(5660300002)(6666004)(7416002)(52116002)(26005)(1076003)(6512007)(6506007)(186003)(2616005)(83380400001)(36756003)(38350700002)(38100700002)(86362001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 3WAfWwb7hhIch+a08N+XpZpjtUQC/AxSOzbXAo+jy79ttLheGeV+DZb6V05ltRTI/N6rjKSXjHUrIDjUuQtXGsGWnc9y5Ze3ckcCW6XyZ9tFhswZ96/CSnm0i0xtLzJJ24CBvoSbD07kyCEK/OzE4P2bC2kwjaWo7+cRTN254immYhhpzcV+qWlhv3KwlJn8WSeS3KoR+k1aZdQ8O+Yy8eJ6zaZm+lh4IjxpZkFPbkXZVP7COB/MfRe+4Cp1E/TvvbJztXAP96AJ6i1hSZUMJocxIVSF3tByNc0a87ygDqY0MYkxfRK0jCWYdEzggZIWV3Nahae5xNfqiW4Sn+lK5wPqZNb2m3Qt4uotmlhJgR1SHlhjGSle5MjwiUSV8hhfq8ajzn4StJ91kZzNiUiAMNccn6ykBcJ1yHCC0u6xIa9V/SdVjAc1OQjXFS7n/tluinZYCReyemgVMmPGO3yvqf+aeOzU6ig33/b7Dg+w0t6mnmjQm0pbs0wrbbvHbqM9qJzWOo3ClGlC1SM7SUNa+aVYNzmQlUfZew6rSdGXcDBZ3ZQAbOSdlze2d5vWoA7UJt/iYeDkV5zfb0VMf4VnAxBAcSN2Tp4kZ9K2M/DAlCohfYf+pbz/8c+rVJe745j6gDorx85fa8b5nyCcEJa6DPEmiKMhoFSrg/yAC4HZ9trUkcmZdSoJDmxC+GGfr1tiRFUK50Vd23i9x9CYvRTvhu8KAzKnIj+cRAPDWqEnMwPiXINXK9j46gd4GYmQs5+9G9cszD2m6pQvKGsrIIpihB1GZx0Zc+dGqfsMmIL5YdoL/BT1a2sNJH7KdFhDvPNrGwU1+PxCNxzmNoB/8/HoyW7B4feUsOGHbXKLqU/NPJ4stWV8IkTeK3BjzQ0R7914XDZIQjaQu1BtLxZpg69QrqNBGg0R/qKvxm/JJYptnJ2i89rOqhYnjuEuroy7c/HWWMuj4vGUEOW4M/s4k7dYPIdw99BchC9p8d6nsZ4BVmv0bvGECk0mfqyDYMBLy86THlSxNCN40D/s5qLPEU1m5QW9wxQIbwSk1u0rdR+dh5MWmRSrr3bkpidjCjb1IrAblNguP7ld7FHz8ZykEiR3jkXFYXZJku0utPPip+Vd6ERJJFbXMzmWsU5ntXyWdQzIdgqCooSAUTMpJjaaUu3vBVRe/29nh0wwGvZnFiZMVg/ykIYAyH/WQkL+j5Rxw4fxRi0L5ScmO7jIhupuB3daJW9lKh/BKqdC0XrR17kWn076C+z0r1pGAsWyAb42Rp1UFFs6voydH4J0ph2ZL7aF2ewj9I11LFtBmtmqeQme+4eI8wlebzuiqin+mXeLQUu63+ATcgCGUogjbgpFRkmTA/j91+LUHv0tIbhZ/333uKe5zx3MGfo96AO1u7kBncsOyoKun53jxo5O2h0GJgjpRe0av7o8dLyd5h5KUSddTfhw10cugAkQ49RAQK05VEWsEJzG5j+Kfh2+q2UrG7Z44GndFucNfRlCCFpRt7GMw9QlmapUcFE95STXJwjnXDrgyhxA9t89QGI4OJe/H3fFw98xyLgbz/UqVsqHKIBQz94= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: fc15543a-61cf-438d-fa14-08db56f233c4 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4838.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 May 2023 16:17:25.5202 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: QBfD697m1lJLTK8G4gq5OTj/wrgIsUNXdM9ah05AI24RSo1bdhPcsgTdmb371F/EAxvE3UOk0/a3+V/hXQhP5g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB9962 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230517_091727_376382_324D2A17 X-CRM114-Status: GOOD ( 12.82 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org Add cdns,usb2-disconnect-threshold-microvolt property to address fake USB disconnection issue during enumeration or suspend state for difference platform. Signed-off-by: Frank Li --- drivers/phy/cadence/phy-cadence-salvo.c | 29 +++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/drivers/phy/cadence/phy-cadence-salvo.c b/drivers/phy/cadence/phy-cadence-salvo.c index 083de7190819..f461585c84c6 100644 --- a/drivers/phy/cadence/phy-cadence-salvo.c +++ b/drivers/phy/cadence/phy-cadence-salvo.c @@ -6,6 +6,7 @@ * Copyright (c) 2019-2020 NXP */ +#include #include #include #include @@ -91,9 +92,19 @@ /* USB2 PHY register definition */ #define UTMI_REG15 0xaf +#define UTMI_AFE_RX_REG0 0x0d #define UTMI_AFE_RX_REG5 0x12 #define UTMI_AFE_BC_REG4 0x29 +/* Align UTMI_AFE_RX_REG0 bit[7:6] define */ +enum usb2_disconn_threshold { + USB2_DISCONN_THRESHOLD_575 = 0x0, + USB2_DISCONN_THRESHOLD_610 = 0x1, + USB2_DISCONN_THRESHOLD_645 = 0x3, +}; + +#define RX_USB2_DISCONN_MASK GENMASK(7, 6) + /* TB_ADDR_TX_RCVDETSC_CTRL */ #define RXDET_IN_P3_32KHZ BIT(0) /* @@ -125,6 +136,7 @@ struct cdns_salvo_phy { struct clk *clk; void __iomem *base; struct cdns_salvo_data *data; + enum usb2_disconn_threshold usb2_disconn; }; static const struct of_device_id cdns_salvo_phy_of_match[]; @@ -260,6 +272,12 @@ static int cdns_salvo_phy_init(struct phy *phy) value | TXVALID_GATE_THRESHOLD_HS_0US); cdns_salvo_write(salvo_phy, USB2_PHY_OFFSET, UTMI_AFE_RX_REG5, 0x5); + + value = cdns_salvo_read(salvo_phy, USB2_PHY_OFFSET, UTMI_AFE_RX_REG0); + value &= ~RX_USB2_DISCONN_MASK; + value = FIELD_PREP(RX_USB2_DISCONN_MASK, salvo_phy->usb2_disconn); + cdns_salvo_write(salvo_phy, USB2_PHY_OFFSET, UTMI_AFE_RX_REG0, value); + udelay(10); clk_disable_unprepare(salvo_phy->clk); @@ -314,6 +332,7 @@ static int cdns_salvo_phy_probe(struct platform_device *pdev) struct device *dev = &pdev->dev; struct cdns_salvo_phy *salvo_phy; struct cdns_salvo_data *data; + u32 val; data = (struct cdns_salvo_data *)of_device_get_match_data(dev); salvo_phy = devm_kzalloc(dev, sizeof(*salvo_phy), GFP_KERNEL); @@ -325,6 +344,16 @@ static int cdns_salvo_phy_probe(struct platform_device *pdev) if (IS_ERR(salvo_phy->clk)) return PTR_ERR(salvo_phy->clk); + if (of_property_read_u32(dev->of_node, "cdns,usb2-disconnect-threshold-microvolt", &val)) + val = 575; + + if (val < 610) + salvo_phy->usb2_disconn = USB2_DISCONN_THRESHOLD_575; + else if (val < 645) + salvo_phy->usb2_disconn = USB2_DISCONN_THRESHOLD_610; + else + salvo_phy->usb2_disconn = USB2_DISCONN_THRESHOLD_645; + salvo_phy->base = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(salvo_phy->base)) return PTR_ERR(salvo_phy->base); From patchwork Wed May 17 16:16:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13245289 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BBABAC7EE2A for ; Wed, 17 May 2023 16:17:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=UzpNBCR0c/xh8CXIcjQP8wTRt/piNae9sKH3m8k4LGM=; b=Q3VMA5RQJYD1C3 1tng5sZ1cklaago4GJlZ9+sqakua4TvhFORa1OugqpVeNHO6vzbfwnj8LSmwVh1FHn+UbWa0bPMhz zlvetGA5FbrTG0108pmauWN92RXRBM8uSwRx81EnMsviGpJEZIgsqGd/GBug+4Nd5Lrqyc6IpyXOc QN2nJCoDdRTcA4UI58GGOnNNomvddmS2XU3MltDHbsdMYUh0LbG16IEdbDGyv4aXT417zGaFoy+sJ PcSHPfar83Bi2UnxQHKKbRgdOmeu2IWMcl3wd6CUbs5uoFJsduvGZ2+GxvtHf0Dn21SJpNG+vnf7u 0rvDGAq9qCY/jS/EIxTQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pzJqZ-00ARrm-1L; Wed, 17 May 2023 16:17:51 +0000 Received: from mail-db3eur04on0614.outbound.protection.outlook.com ([2a01:111:f400:fe0c::614] helo=EUR04-DB3-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pzJqH-00ARf8-34; Wed, 17 May 2023 16:17:35 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gcyKvMF0PryWZIxJJ8qufcw5qvuCUHPJ8g3jMdaf67DRRIFRwpXwiWaxTeMxyeOYRcOcWFPunZLGiqBo6B21urgI/QkkXCqoizkIiTZYfc5qQDLqT+B/LvSnGJ4ZLF9+IbKpKkBnLDKn+O9fslKz9lBJ5QTVQvCdfqVbfSurK/iHTdE6cUMP8VUUw3VNadGxuMsFkxe23pRcbxlYHv2RjCE5qkULhcbsmvSpi29J81RWMFUnH4PQkw5vPao5LVfYH9kVIEvJGtVcLLy40o9QBOMhvzVIgRlN3XmRgITGnTNQha2qvweUgUkr3lL5KDt79uxVvHd30OtPdGEN3C/3wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=qRD3I70Nhgh5KFb8QvDbjFiZdXp5lgtUoKw+8YSgtAs=; b=lEgoMX5EeK3kiN80CSLJKSX/Mn3OeLzKyLR7T6hiBghzDVmUOKhQNDdcbJD/UIcatIdE4xKGPqqk7npmXIoXIDjb1c0/Er8e7FfND7VK/4Kxo714R0w/4ZYkHx0UdT7RcELE9r1/bhIYNZTMkADmBiQH/X8u9wUjHrWUY3MpCXh9UErdMI3VWKGbgf1aCVnhCFIBlNr3mFDS0LjRiv7So6Jh7cugZ88/QOTp6X7kIDjtxvZ0Uwhsk0nxWmidtjlvrgymubJNSGD+6AstV/fzifIlg2FQUGCmGj8B0Gt3Pbd1aU/llGzp3ucvket2PKgW9x66JGq5wDOOZKJourveQQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qRD3I70Nhgh5KFb8QvDbjFiZdXp5lgtUoKw+8YSgtAs=; b=lQnDDlGmZm9ZPjDsDs9nResl4gavPxzkntPuvI8THQlgf/wuZIk6zSjjqhs2e4qXSVDhkLqOQxbZgHsCAdQBZRr+julg28tyE3zp6iPpr918+IhcTNSs/z7UyAzQ26J/Gw8Ya0LdcYUoG6OEUFQh62a0Wa5KyJNLRbJ2nUdnn+4= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) by DB9PR04MB9962.eurprd04.prod.outlook.com (2603:10a6:10:4c4::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.34; Wed, 17 May 2023 16:17:29 +0000 Received: from AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::25d3:de2:ef1:3884]) by AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::25d3:de2:ef1:3884%4]) with mapi id 15.20.6387.033; Wed, 17 May 2023 16:17:29 +0000 From: Frank Li To: vkoul@kernel.org Cc: Frank.Li@nxp.com, devicetree@vger.kernel.org, fushi.peng@nxp.com, imx@lists.linux.dev, kernel@pengutronix.de, kishon@kernel.org, krzysztof.kozlowski+dt@linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, robh+dt@kernel.org, s.hauer@pengutronix.de, shawnguo@kernel.org Subject: [PATCH v5 6/6] dt-bindings: phy: cdns,salvo: add property cdns,usb2-disconnect-threshold-microvolt Date: Wed, 17 May 2023 12:16:46 -0400 Message-Id: <20230517161646.3418250-7-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230517161646.3418250-1-Frank.Li@nxp.com> References: <20230517161646.3418250-1-Frank.Li@nxp.com> X-ClientProxiedBy: SJ0PR03CA0041.namprd03.prod.outlook.com (2603:10b6:a03:33e::16) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|DB9PR04MB9962:EE_ X-MS-Office365-Filtering-Correlation-Id: c62beac5-4d9e-4c03-87ff-08db56f235e4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: H7aEbNDrMs2+D6zsdaAtQM/X+D/sO0Dz293ihy96qhVYpk0SNFZkvxmiTGYPQkynMHmESiAsaMiMsR4wp1J6nNvuSLHCIqEy9wZOK0RY0RMNkYbNmx269HXIBitE4MyClIIPVSptExNyjm0VNieouJRRrHhSj1xtXiUs/vG4X4168pwfMJVxzwKVJLMQyRJOjY0aWCud5YHdKVPSwnk/B+OMnHv9yrP7FWTs6hR5ujK/AxSzYxuQqfK6pKS4JczZlAD/pfpzuenTvq5kxYF3JQcba+X/1z0C5eqgastg81ADt4QhJTndSGZBYLecu9PvdZDXPY95vynPxO0GjnaxCZ2IqZJNysj7MQssjgw01dxqr51+xgw/2UEhTahi1qnpItG6LKnwNDVMEElJBdOGEx2oXcm96DllKsGu2TeoqboUNOS7riufD3wPilPpeTOVrDYGfQytMRaMTXIA5vKc1R2DgQKtsVN73u2PsgwEhXQZGwXaqBIXQ+SQua9xOJZxHbHu+YbFoPn7CAuhcaVBQcpoQsAdx7+jiu1x1QeXKoSbQGimA9LrzCTNpJQqd7/92HWbAd62vNWD+eEgEEKUeiLompRaYQufiCt0pFnG+0enPovDJjpG3ddjGHeVO1/o X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR04MB4838.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(39860400002)(136003)(366004)(346002)(376002)(451199021)(6916009)(316002)(66946007)(66476007)(8936002)(66556008)(4326008)(8676002)(2906002)(478600001)(4744005)(6486002)(41300700001)(5660300002)(6666004)(7416002)(52116002)(26005)(1076003)(6512007)(6506007)(186003)(2616005)(83380400001)(36756003)(38350700002)(38100700002)(86362001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: QwWyqBR7kmsUtMD1IWQnR/oUaADza0Nl18OKY0IvOOW+1Kdl1hkwIa+Z/yHPNt8ZVgvyDytysS8b3wIUDGhATMgDe4M9rBt0jUQuTCUgvmwCMyO82XG2POTUtA7TtYyy+D3SC7rxHd37PAzslWvx1AbmPRPBOML/BjzRoXo/T/kwTROpi7yTqgaY3ujPqtTguE5365PtGsX7KPy1R+LaMTSmTTRwhQBmierM5COjs+9R5Kkof5cLpUZRqB+XZBE0QUc3hPBtLvlOvst5YqAi+dBCWv8vjJszzus+IH2OLSqBMlXxEr9ssD6TwSmADzQ8zBNv5GIB+xv3rUdJoYpFw504JyAOJpp7OFL34l9U/k3CWcBf7pr5+nskk3wz9tm5UWDkSqH/pGP6BM1czPOOUjhs3LCGk/L6BTbfNepIxXnJfXrMfXrDa8KbRf/8RqJzY0r0XcuLiXV+SCvcWFoabV/nNV/DgD4Yf7CS7C7hBTFYdJBcez8mSGGtOY5i8pufYm24RCg15lSpdrrN+29AlCv/+K70OJ/TsLjwBr0nwNlH6Txrx8Vpp+6D1u/lM1XEK25gcau8kKoZ428aBmGl36Y4pN0ZGedjv9cUbsn5+kg4tRtOt6bSFGzYylyGAnQXwwvPo4K19vcv/F+BGJHFAPchvcjux2aeVRPwEoi/oHcbxNx2i8axuJSiYPWy7viNrxPNHD7zi0IWSb7UpivuxhTcXEYpIwhVbtaHlrGrX6EiXdYuEybjnfyX+3YjDTmBI/3Elr8+I+NBd4Ifc9XLNYBc3CU4Q/7khRQxPBYfsc0gJg0RyN7JFx/jw88G4opovfhFRA+e1dJknoN09+kHQ/SjntaOKhijG7UimsRAUltYgXKLlp2JJkGvi4n1cavLvE5/FR6u2a2yOe+Y1amOOACfkGFTnvcC7XqtFFxXihWiGTXis2Fxoui6HGWTy2bqG8ccNUzxb73/e8wWESKT5g+cSgf8de+7vGhuhX7gZT3E0N3Trb9wHni7ECVGJ0QKOGinwGUjEBfoZq3fsvsvn8qmT4rVEBF5Y4ZXw0cqa4SO3Hksgb/ft4un5g35t9ickPtT1rwr0gOm80nSSdZt+O9a6VfWlOi2/W0/NwtETJ2g7rlkXL75WbZ3mC3o9TWrN02fHcAnt6IPCMJ2pmIUVTfgqQo6CfdHQossSB2OH6VqH36ZB5BTjb5rs26Lw6qwmpWfJAtRkSL0mRdoIiCTJONm0G04X0uQNy4/nffsGlQJI9nq1zYTtLRYUbe6hZJE9FkY+54SJ689i7NymGfooIA/RjvomRk3Wo1rTAP2R+RzvlaljfkIfH0nn1r3CjytSrqDLx42+TVU/mAAhuQFpdSvQhsH7WkgDmclGfbzZ574bcLwED7p/ZTArzxpIyM7g9l7lrZCWXayDhQp/sI1h5VvtYPMX06lwHbxhq2n+ebxcg1LEmaywXgPFeVdXazBvvfEl3a0uRo9qAAT3rnA77e0CSRj3Wz6sxiEg6Mb/LrMVufDVIw+okKmbssRJFRV/kwC9eobzedjguYES6Um2VRB+ssThiTMGFXOmikFruk= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: c62beac5-4d9e-4c03-87ff-08db56f235e4 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4838.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 May 2023 16:17:29.2577 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: BMjuGoQ7+3Z3IKPkrubocHUGPLlUG3jxQXw1WxiIbbBZ+oqgityiDrEl27JyFQm7+GwXKfyb+bbQcEoc19558w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB9962 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230517_091733_990779_3EFA8533 X-CRM114-Status: UNSURE ( 7.65 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org Add cdns,usb2-disconnect-threshold-microvolt property to address fake USB disconnection issue during enumeration or suspend state for difference platform. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Frank Li --- Documentation/devicetree/bindings/phy/cdns,salvo-phy.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Documentation/devicetree/bindings/phy/cdns,salvo-phy.yaml b/Documentation/devicetree/bindings/phy/cdns,salvo-phy.yaml index c9e65a2facd5..c7281a7c8244 100644 --- a/Documentation/devicetree/bindings/phy/cdns,salvo-phy.yaml +++ b/Documentation/devicetree/bindings/phy/cdns,salvo-phy.yaml @@ -31,6 +31,12 @@ properties: "#phy-cells": const: 0 + cdns,usb2-disconnect-threshold-microvolt: + description: The microvolt threshold value utilized for detecting + USB disconnection event. + enum: [575, 610, 645] + default: 575 + required: - compatible - reg