From patchwork Tue May 16 15:43:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13243293 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 97F4CC7EE2A for ; Tue, 16 May 2023 15:44:03 +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=eqRYyoE+W2XwPI bfz6nPes8pAYps9epqDIkMOeNPvOXDUZ4I9JItKpXUJxFFGSZnPczh9MwPgDxLfVrwHuOVAk0AN2g 4mtk7NV+emdW2afGFoY7yPrwJqNYEbNH9jugePgtL5JxHtCxa0XIs0bOfZF0MFBAXfT+2Xx6ESx7e wU7xoAEaHtxORRwNNihSxUSowpMrWhmnhSozoLIR/8pRVbwfE3ZwW1pZfdbQI14mVYgSEbnc007j3 RkRu1oGGyqjm5wvjz5Ux7XeXcNL0UVP4kpYez17nCz2EfGbeG+qTCMVzzm6fjnwi5fY8z87lqzzks +gBj0Ojw9wJU6SxDR3EQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pywqJ-006Ikx-0o; Tue, 16 May 2023 15:44:03 +0000 Received: from mail-db3eur04on0616.outbound.protection.outlook.com ([2a01:111:f400:fe0c::616] helo=EUR04-DB3-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pywqG-006IjM-29; Tue, 16 May 2023 15:44:01 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YfRWVQjko5PlPGEVDmjMErh6ed3sJRho1cBqwVE4rXWZe85g/dwCD101bnWB3iL2akDnnW4V18YslQP96z4WhbRAZ9pOi5BU6wQV0WEWhRlGzSZvBV5LCygREBZ+/ioiJwJ6UQRI5k0BuRyRde2xQ6cDW0FOwxP23jcw9TUaM5E+BPuk5nQcTfjnayZ6MfAJ6QpSdu9+9+vK7jbBpQGker6fgTUiFtBaG26X4xIggRgEDA6Gxvz3kQ6FQQNzVUSw7yhN18yHQVQcszAYxV5jTXT5Zlh7ApMYijdA8bHU9J5UWvoQ5dZaRv3x53bPEIch3MnNz/PbmzWf1u6PiRz81A== 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=PQhPmgpethAie1odyoEuuaXqZ3gO3OxcJZ0jHPfwfifNq+OLfZFeWtsthovYUaYUy/Sjsr/samedPTVZVwNIAaDa4kv6DxDbeyxvzEsI9nbzoBOvdtfqp8ElKZmNP9x9ctfOHk8EnAff2C0LaU91TQrvaVv/8tkQrhNC20wbxIOn58TOhZznhQ/n80yioVSNPP/BEQmm7EMPodetUbW8titnDU8nclnpU2ieZ4xX8eHpGzqMWebmU1b8Y5lWhSbswkdpWug3k17gf4ngJ8pDUwsghN1f2AMItEmLM2asxC+1aI8HA6YY+IJeA0h6g3fTkMPPyKdTMoAkn9IFrj71iw== 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=hGJFmHALRt7yfnZQEW8T2Uh7pDSOnkxlkXY1d82wgux8WEdSIc6SaCKLBr/wOs2KkpS3E8iq5PpAIzcOEh+KUyNoy7Cr1QT2WCCapkdjc9OpyVVSJ4Ri9jkdU85Qx2ZCyhpwJW+QvDE80lxA6sMkiimC3RjV1JPgayAqdBf4nic= 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 PAXPR04MB9008.eurprd04.prod.outlook.com (2603:10a6:102:20d::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.30; Tue, 16 May 2023 15:43:57 +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; Tue, 16 May 2023 15:43:57 +0000 From: Frank Li To: frank.li@nxp.com, vkoul@kernel.org Cc: 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 v4 1/6] phy: cadence: salvo: add access for USB2PHY Date: Tue, 16 May 2023 11:43:24 -0400 Message-Id: <20230516154329.3155031-2-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230516154329.3155031-1-Frank.Li@nxp.com> References: <20230516154329.3155031-1-Frank.Li@nxp.com> X-ClientProxiedBy: BYAPR08CA0011.namprd08.prod.outlook.com (2603:10b6:a03:100::24) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|PAXPR04MB9008:EE_ X-MS-Office365-Filtering-Correlation-Id: b1805898-f912-48be-91d8-08db56245ca8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: CunfwBvdYxcO0kTQ1Xhx1gUlOhrBK9OPBVQtRKslHojOohHPIvT255zWczkEFWM/q7JAWxO1Kk3mfNz4EzPnH5mKrxVxU1Rb154CkW4TKYfmNdcpCyB5k1krVWqpU/SKIYsle2omIjXhNc04YvY8O/kIsUWyFX2/NuN1jmoyJzv7hzm5tBxVtsdBrEgokscxKSeEN4bfIZZ8kjbkSEKfXGhEZE5CglqU8H10xax7IuDJVAxjEdhGysy6Qjlbw91ZXWazuPBSiPFkm5UZEOjDzQxkemMVjFMeNYp87jQEDZ878Ug1e45EMb5Mu5qOp66VFjJYasXMS7pWtiL0eMhtQFvRhlew1AldF7P6w4q//tNj52qG0sC6pmwpZTrJyRJat6yxXL3gosoIP9ojBlTAtlz7qMIdmNYksOipCjtUO7TK2yyMNSb+mjb6AFR+4g0wCycqAGXxPsaMA9RXszHMq1Wm9zAqs2sEfo269AnPNHVTiTILjxlMFhJq2teKR7AFde9DJhIK+GDa6rYD1V8Sda7r4iIQGFbAwdNYmjSVIrbS3wra7DzpZ/pfrtu/Rh489a+PE4SSJT5vgfrKCwyMw0lAsDVqPre+A0ivEMOB2FWeXcwnBhpb3pEMqjCpN7lS 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)(346002)(376002)(366004)(136003)(451199021)(66476007)(66556008)(4326008)(66946007)(478600001)(6506007)(186003)(6512007)(38100700002)(38350700002)(83380400001)(2616005)(36756003)(8676002)(8936002)(41300700001)(2906002)(52116002)(6666004)(7416002)(6486002)(316002)(86362001)(5660300002)(1076003)(26005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: dV15GRvKBYwQ8/alpAEsXZqQu9i8SrtN4CVj8jE67awW1m/JdabI+Vpn/3fY8mVcqWPF529L7TiSfCfYyTnf+XnjR9AgMpW6KCbCoRhZAj4AAcArOyUh/9xLcGl1uUtsmsMu3NrQMzHe5CaEVKjoNDmbt0+EdtIjwjlKrgz83s17tIxJIGCeo3UsyaLpqj6iOT3sEyuHbLRNq10TtrQL00Opk7uTmP/hC6z8tFqoMnhW4QQtpbkAw971JXiyBfysbT9e35W6qBU5/qdiBKBVdQMqXb7g8PdZ/AHtIg3cEDxDTcQN4i8Tu38g1zKUvsLcKuDMF/6JX6J74a8Wcx7gB9oUStO0SpB+ZPFtOMn57GGLaqn0naLe7h4uqbJdoT1rmF5XU19U9cc5zYIRS6DvchUgE3nPSFc+PXNUd1EoJ4xGzT+4ScD2H0/YLkNmJR4HcGlXZR5ozN/W67/BpFRzIVOhukXkNf95VKnVHb+lGqnBLJNGlLnUzXWYUnAhYJ/0VrLn0uw6MMtJ8vRAV+DuoDLefH1lllUX6DkNZd2iRknxpkXyRVHnQVVNuFg3QlOJM8IE55w8+1+8wFe1abYleEaUnDh7C2YvDChGd1nOW8DInEaPu2YuyjdRcZL90uRXFKZVCBo47WpE9PAsNc3QlVYk4Nd4IJ1k/75iO9UG0YteaQFCmkpeq+Qd+DEacSXz50POPiB4iL9YuW3pbUZQ+bSgD+y8bA1qttNnfaH35xTsbCYe2Bicf+Jk/aZEjTvQR3rZFzaiN6N0p6+lpaZbsSSlnTpkPus0Ynu7BwjPn3f6lgIHxzce4PRd6m4Ahhy3nPgQLOKbPdF5hohApiZ99ZiZ8L9bFKTO/i7JUjemIMmL81RiAe/NVxDzONnPelQG359apj8a7ulffkbwB6xbwnvQRxQoBDwGF0ERjIKH8dHNNiU7vdyK5zVeIbC11D99xDgIzu8wylw3ijA5R9SrJLatvYU0tHQxcjvmxRTcQb0TTyoaA0eWW14sHLrD5RdMkR60p1AWTf8UGvYiR7d1TXN3RekCi3f6JnTUiRLwpAavIXtKAmEQiu37phxgoS1TfkMdA/HQfNmYmMa7MNrJMFPU5+VlX4kj3HtCKKvtB0FvSsG0XrAfyjsYFgAXwy61VsFkJP3qQx5JFlVl6uklPRS4ltbDbOjBLhriHKsxz/hO15gKdn6WYcd1GslAtOlali9ipMb8VSwOnXePVphHKqEDHPKfO0owcdCae0zoWZtCsk/O7CS5Gg3Vj/VGguLwXeR2xDkMOrPAOFD+lGPDRtf7JPU2WNnf+j2/0A32MvuwPgj1O5FRzpJwphJrQnUCuJ8fMegMJgr8PJ3EvuiESax/eEW7GpRERXV1qY0SlNPwNk4Eb111FGGi1d3FKCq2qVq9hbRp9/2osxJEffh3JzU8zi+HI+A4ML95wRp+JkgAYLOoiGtnCEkrtHM3xpCXS/OeXzq4C6j/K9VUCzGYekA8dk8bG3EJ18a/zsbp4x9HqUCeMpUAe6HrHXC66jVxtuDJMspstbQ89vWrYXKnkB1LyqU7BmVvmEUpbuPC0FlnkHiWo97alLROjbJLPSjO X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: b1805898-f912-48be-91d8-08db56245ca8 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4838.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 May 2023 15:43:57.8109 (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: AtvGta3SAaSO76PohDZCjASqfkAv0xSM0H0q+QH6T/rpN51sZyO0szrxs4BARcz68LoBWiQNDYNlxByRnTD6SQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB9008 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230516_084400_713221_257FAEEE X-CRM114-Status: GOOD ( 13.08 ) 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 Tue May 16 15:43:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13243294 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 0450BC7EE25 for ; Tue, 16 May 2023 15:44:10 +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=UOaLHoaAIcmFYa OzUKHcOzO7pX7snhpBv3HM+N3hA6TaHbV0Qybfm5cYZsOQXVrvCH9RO2QAMiHo4Jc/6DDLoIgXvso pt8jjw7+AWDU5c4AEtAuaLsVk6ilu1Ud1k6cLHasnvIbn3ARXwK9G4Zoal21CgQDnWT6LVUmoZ+B0 C+wVj3QE23YJuPGjfWS5mqjQOMXWmTHycXn9BFHw0g5kUJHHmBvhgDuABybIM6OTppbQbTsPtiE/D IWecBD4OAXnx89wieKlXJoEhRbrp+pZj1tMcOVJJjSeo4Z3nzmgBz79rrj6kkGdrb8m4p9vmy2TZV UEbMB8W0sLL2nK3kGkeg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pywqP-006IoY-1f; Tue, 16 May 2023 15:44:09 +0000 Received: from mail-db3eur04on060e.outbound.protection.outlook.com ([2a01:111:f400:fe0c::60e] helo=EUR04-DB3-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pywqK-006Ikd-0o; Tue, 16 May 2023 15:44:05 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=itXCne8ifVvRC2B9qgDgiu5gLrUXM+aK7ENUSzBfvfbcWIfmLQCMjuyuuMQjWAnLznh7UjkWqoQyJGHg5SUUUfSCtFO2YIYufrkXsv+KcNH58gQBGiptsbSEGMC4LTGwAukXvcUHYhFLmp8snpMGv6U8vpm17nQ73M8INpSpQUFm5nEERGbnn0EIsrz+qZvcPpo0rzXKasWHWkbTy+2pDRHiGsqiabcqQEPVx6UhQTPBBwxCk7u/LPXmfWEQDHzbNY8t/u0RjkMMOpthA1v5riqfI8Al4wGv/P6PnWSuEjxupdVVYNuDoA+WXGtTq6xy8J6+MvRltDXkrTIjlzgrEQ== 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=OWzIn5YK0WyorsspmN0sjZ2SaYL/OgcEqUc4xDA1861mbIx0S+ZHVfTnQNG9ry1kzv+SYkqTc/mI6Cg1x0x1xgaCo5FWvVTgWEabd/1m4Xj4OdvdMnMhnjZM/FZhxMV+JtNcpTZsAzC/4m9h4dABieWWcPRuozxRt5s4qtczBf6zfP6v+BZV71FM1dEKmxaGYmXDhITf74NhsLDXA8+iZPwrcLr0N1PADF+8cTSNLSVkPKzXJymYJsUlDb6MG94xuYfbN6AQL3+yOwMBB2q+2BSyPLudkJX4/2JGO03DUlTe40m8fCbo/dsMZtMiQxJqYdPdgMXeCVKEEoVc7UJkGw== 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=ai9G4BWnmgbnGpA66mAbjpKFHncJaGQCf9uYd9cLDBj+L2jGSJH5+OqUbpUYDxiutRmzFrDLeGG2nOiTkoLpGROYXGt9gP0M+xPf/xGj1TKnISNAI9pxMKggBHBZVG4lHDDjKZnVVMWMuX17OBM3/vk2kVkxpP+GYR3sf/RswMw= 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 PAXPR04MB9008.eurprd04.prod.outlook.com (2603:10a6:102:20d::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.30; Tue, 16 May 2023 15:44:01 +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; Tue, 16 May 2023 15:44:01 +0000 From: Frank Li To: frank.li@nxp.com, vkoul@kernel.org Cc: 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 v4 2/6] phy: cadence: salvo: decrease delay value to zero for txvalid Date: Tue, 16 May 2023 11:43:25 -0400 Message-Id: <20230516154329.3155031-3-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230516154329.3155031-1-Frank.Li@nxp.com> References: <20230516154329.3155031-1-Frank.Li@nxp.com> X-ClientProxiedBy: BYAPR08CA0011.namprd08.prod.outlook.com (2603:10b6:a03:100::24) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|PAXPR04MB9008:EE_ X-MS-Office365-Filtering-Correlation-Id: c1386de5-d168-49be-d1b1-08db56245eb9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: k0k18FkE86NtyNASDHnJ8cBkKPyd+nxzA/G2W2RxN9m2t8HCRX1BpN8F/oTRb3TO1OtcZqao3jJ9CRlWUMppBoxIpoRQcfBLCHTLV6CMf9rCHPEm3dzRWKBKTfYtEcSI56TpMroMXlUcAWtJHQ1BQ0R1HA1MQDOooNLiIEBr9TtuAVuLs/MLuXx94LPQyNbhdXkxLWpYjTf6jhdtEQbn9br7sEWZ4Sk5zWHmc5tdEiXY32ARQmSAWf8Sra7fB6CdKVbt8unuQSfmCT31r5LRkwVxPSFpnDX+Q1SUOcduQO4C57r7o5MB45t1S6M6lYjR87mGFUnHtygz/hHzqyoeTnVeSC4uU+/6AMAHa/cCUwKpHuWjSmutX/0vzTqbzku3UFYEobNey7cz9ZIsnl02GzVet4CAfepz0qbtwTSa7KjK8IzPunBjdIRVPoLCZRbFplOTun2yHeSoNPOS0eX4M7RoCwTl1Cf1eoh5o4ztG1muVqhAU2l1PtmzxvOhPJ6qAZ466GPH2KxGaqWjdtgdGxR1pkK27/8nrW0Yvb8GY9gcNNxKwpcIa+CWOxhFnrieE0lXLKOspkb5wh+3CDVta4Tft2jNuZ3d+JMXos20vS0CY3AcYPckvRxv9BJ47Jij 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)(346002)(376002)(366004)(136003)(451199021)(66476007)(66556008)(4326008)(66946007)(478600001)(6506007)(186003)(6512007)(38100700002)(38350700002)(2616005)(36756003)(8676002)(8936002)(41300700001)(2906002)(52116002)(6666004)(7416002)(6486002)(316002)(86362001)(5660300002)(1076003)(26005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Efkoar4OANPP0gMQmGgDengs/pKTCr17FJm73aE5Wra62Ou7+TqHTO8CShO9DFYLxtRr5hk9Y5CD4avOUdNkce+EqSJU03WOXGAdS+GqIrvbJVY9qugONM/TTU8cRGnK9yv/6QPCt3RderRoUVzuI1AbcqXSZmp7qRxrTKdV1LEXq7y34B6oW0LpAH/koGa1oZTd5ziyMWRxmKEJMpaYEoGr/geVpB/BYMz0u6uhpFjLwIDCVdkpWecGmCDQLAUqFnekguCbkVZD+XEXYtbpqiyyFJ1rkg/YlEp36GlimA50VdpMjZVmgz4CcymIyWyYnQCx5YxLTheU4BRjoghGdRltUX58p4gelHceSmYcN9zq8KqT06VQL0LrhfGfpGGVk3rU02vqXtfEoiUhrplw+xBXgTq9rkemrjC4V6JrIKBFyHFDX6qF4oUpbLt5SVz5X1cWwR7Tri0T4ptm8Ha8l0gh8K6Prr0xIMNOjDn8nf85Bc567/RL3SjE9U2OG06QShW1aUzrwMpxx1kWqVh3x5OhfboXjj1LWZWzDvwX7NWZcZuSub+669VIrr0T1Iy8jAYqxdYXPRbec5KhVsbQMsIoAe8hoLqWo24abLyXakQo1Vzicnc+KdHoS3JzWdWL62QBr1ScHAovUPuXdNMs9PnJ79f0ArytFd6sAb4fSDwmN/1FDdbsMHT7a/U3GXdQY8WQOVVv6GBPCXXQPqVowg145eZler9fpR2M4BOnnrXzgCl+FWjP2pVCEUKkokUQv1rfTkAupOWVijW1IxBLp2caT8bY2ugejuVo4f7QxrDbC1SEQchA3kYTxCOf5EBHVK8w0NYvsyae10XFaPluu0qN1mLSg2U2H1mcnz/3oR8hfWs+IL+ctdUZbypFLHUDHZLhj7aMjuTwtVgnwPowixuvs+cKDums/f7mUpsrLWoX3B0j/a3+S/b25+IFN2GyO7iKPbX0mk5HV2FoO1FtOBaicwE0pszsGKEwhdM9J4YNF+pUz82MELe1uaOfCoWns0q53hnjQaeF48p0x6oZGnDd0lYwO6z6BqDQ09TltPbajjqSwYAvu14j7mKqk1nlf/B++FqSD6rBliSsNjj8FW7mLqisNbcfUJITbyBTy0QQHVEJgCsbkgTkAeozHSawyNtQfxIT0gNRmgbIwx2+RoqHRzMPDu+LOxP7P4MTZ2Uet+XWMq42tV7WTY5SSu00lxeknFub+MZaABEpEpQDvsoala4u8hRmaSdyHiQKeG8eFIFN3urduOCLLENTtCdCyC66L7yZaGgb5b1Ddz4UI6duJUPHVIDi+lI49bAlT9M1wR2G7HHZCQomYduC+mzoqsMDXUup34AB9Rq72fjjqknpNiNb0j7BUv0v1G4ujjAyeVhYkt3m8gZpNCkh3SWBssPu+aMRHgCcrJpR7g+q011UvF9UTErkqECoGRpgk4tfjCXT6hE9V2woDOA/DtJN6+FYUQK4yR0X0NCq3a3OcNMMHpJNwlrbdAndX1NdnZImppYj0W4vTEHSr/9sjoVgVzaf8p265qIGI1abWpaXyt11I2ajvIliQZlyEzHsA5Se8b0RkGrztZEDqnKCKcrv X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: c1386de5-d168-49be-d1b1-08db56245eb9 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4838.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 May 2023 15:44:01.3517 (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: deJTWQXou6iqkrOFooPuM1B9N9sGc0PtEsgtLNRa8V1bFldPQoQZmFDU4u1Xlx1hHLzEOINVZ7pnV57ACFY2dA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB9008 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230516_084404_300144_7F749953 X-CRM114-Status: GOOD ( 11.67 ) 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 Tue May 16 15:43:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13243361 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 1855CC77B7A for ; Tue, 16 May 2023 15:58:49 +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=1qLLV22g+b1W5a1V2JNNg0mtIByhHDS5TmGRkakKb34=; b=1TEDlAlKa+yFJt IiMo3RTsoxW5Q84klRCrlMM2CC6bCBHPVGkhq0o1gawhhoWIjXTZa8isHXDkRXxZrkZfVgqKS3nDi 87nEPCltuDCTSM+/cNe34Ln4Iy52htINNRvn7GEnGEbsG4xIpFKqTtzLchbyvulhivwXlvItgcjj2 QF6YMzhlCXEN49WBWUsBs2M3jHdxm9FZVdx5j3HeW8Zd8WPVUFzLsRa863S3hEmwVmGqARxWbrF74 GZouRMDxk4SpSH3roUKckJJPB7NCSRGQjEzKiZ5vt+GOt967JQTpbpc2zd49op9bSQ+EjszGecOJR J48dO6NK//Scq32fduxg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pyx4a-006Mtn-2Q; Tue, 16 May 2023 15:58:48 +0000 Received: from mail-ve1eur01on0605.outbound.protection.outlook.com ([2a01:111:f400:fe1f::605] helo=EUR01-VE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pyx4X-006Mq2-0a; Tue, 16 May 2023 15:58:46 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=I9SuZcek2PDppiIzx+DC2MOSvY9/uuScv9De8cOiwwEh/+6VctASEhHdbKtkQszm6uEYCby7Au2mtlLhs+g4+Z5mixyU3heIXzJL8AS+A7euZ0JLsReeeN5M8FDhmo+sSTcGt2gLq0dAv3brtKW9zAC4cUDya79NaYAh6+FSxs29R1mRE9uiimQ1g7qG4JEOJRx3oI6B9uwa21gNyLiH3iJH0hFTfxnAkMj0shmJGuKeZza3B3OZSuCaD/CzpIYCInPaxWdFamRc8DADcFiLewF3o5HS+YePZNcRlw6bEQ5mETnt0Hd+kb3e4hiVLpZNPimDRx3rheB3psBdyZZARA== 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=Ufwrk3zSCeYlo5Nt1ddQQIbHORNCJO0m+VNlmGgjY4k=; b=HoZk1EFkKK4RuGsqViW3TZQ4wNeBMSGwE5G94DFBWBqO0fcTrl/4G8Q9auza1GrPN6pFvt+POw+mCdBr7aX96VeTG1yOBYu0qnG4G379fz127mmfr3+RuvYApneNOwTicKRoiDG+aXLdG50ddDXvayTspoI3J7UKT5dih4E9oNxxhp0gL6AiQjdxpi/ZcmprqujbkNw9ImiP05pN1HvKGCRwYUuwJMTj0mrrEqsgZkQLGoWGbk1J5ozV7HbhImiGJo37bakMYMAXAymRcZw6oIfPjdFPa+0rx1ZbsHHsmcoGzWfur8Hp35f8SUq1dRRax2k3LsvjO9sE0grNPwGMmw== 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=Ufwrk3zSCeYlo5Nt1ddQQIbHORNCJO0m+VNlmGgjY4k=; b=dG80wmzOmn0TGARNHXD6EjEAQGXmp3aYJPLerAiTDOJu75aoL+jTmmDB3xZFOQ3ZC8mz667UVA8tYKeTfRbCAvGpxeuF1HIV2ivhKzHITtfazR3UnsNktIsRQDD+cFjycLRF4TIxpDL1jgqut58joOxrB8xtdy5v1tSz7/Vu0aU= 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 PAXPR04MB9008.eurprd04.prod.outlook.com (2603:10a6:102:20d::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.30; Tue, 16 May 2023 15:44:05 +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; Tue, 16 May 2023 15:44:04 +0000 From: Frank Li To: frank.li@nxp.com, vkoul@kernel.org Cc: 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 v4 3/6] phy: cadence: salvo: add bist fix Date: Tue, 16 May 2023 11:43:26 -0400 Message-Id: <20230516154329.3155031-4-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230516154329.3155031-1-Frank.Li@nxp.com> References: <20230516154329.3155031-1-Frank.Li@nxp.com> X-ClientProxiedBy: BYAPR08CA0011.namprd08.prod.outlook.com (2603:10b6:a03:100::24) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|PAXPR04MB9008:EE_ X-MS-Office365-Filtering-Correlation-Id: 1d739f33-b62c-43f3-9ad4-08db562460d4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: c8hHJxgl/RbBhxdcKYfLpxLusFmNbppqAH0Ig6oqQKio14lbYUeo5QS6tgIkDGJl4D8Y5ro87OKaaMD2d7Ns+YZDpXc+OGcLvjhVckscC9Mq/OyAxAQDREP1CmyyoYYxbWYtgNgR0R7jLrEG9nS9kJqKTvKf9FaBwqsQqiFFZAtsM3LGbBCfXikB2ceaF48TmYb5DxgfOCLPijx0xuvPia1ROV8VCH+Ovf3PdqdtB6zE3fb7ToORS8Qws6v3I188H6P0MsarY7frh6fFEnh7mLI3V2PTEJsg8I/KyOJStx+3qrUSy7UdfhXWsrGDwlIWysu7KXtO44aJg/ZpSIBzHuTKsVQ444g0iIGRw0vsZu2hexiU46NYGlDIAPaeR6cHZB36MluJd52wsGdemDmNbT98bBCzDEz7WiXOiqlN73Ev726fLE8b3x0JHFR9qTwVbGfuJv6W8z4aNv6LbTIbPEV1ry0K/XXVckiyqYtEo80QxZDG0e15KkDy5fh8eD0rO61jnxvXmeSN2MKzBcEQqGDPriuwflQOfwNaf1PO9k6d7boL4g69MrCMN0/rbZRYFMNsfBA7pjs3orMHYHzfsZGfu2ToqgcBJSD3XnCqWXXa08DjBUWdxbHhjRFwnBgO 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)(346002)(376002)(366004)(136003)(451199021)(66476007)(66556008)(4326008)(66946007)(478600001)(6506007)(186003)(6512007)(38100700002)(38350700002)(83380400001)(2616005)(36756003)(8676002)(8936002)(41300700001)(2906002)(52116002)(6666004)(7416002)(6486002)(316002)(86362001)(5660300002)(1076003)(26005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: lskkYrIwJxgIUezGXaLpJx7kuXE92o6qVqO+Q53WxSmQiQpTrbpSfGSvW9gIBYIwNEXJ69u/rWxG76IN6h4VmherplVY3cs1G2eo/781ftAi4F414BPcvYyftBJfcV3RmlOhyciAPORTki/lMb7jblQrM4cAYSuvsDdk8qdiITqDj2WSQDbn5vN/OYKizSmVmgZFNOOtgkZDUS3XkL22eWSrsMacwolaUKXNWSfikAgiA4XwNLVBxv4o5A//5RKEQZPL7Sb86v3qew9ebca4fm7inv5vwdaGUt9qXizAHrCP09s5lguYdUi4pLtbIVZyK9IhJls6Pce6VGoCW8ONHM555trN1k9ouUQWrn/dfhyuPh4lYY7ysjLYa/45UbzBlDYckSQQmGEooYhxNCgihNIP018kOKu+pUg5iWmFMFGfWy8cQD9/Ufbf41e9ktPBG2LPki4mRAF2oX/la6pokeL+fieU4gej86u5W7Dh64H3kvi5rwLFNdyNIPrMt6jKz5i7Fg/RI4WXRNYdWsitHxlytxGkJXknUM1v5GMJ80BXHWjxqH8+s7fYCQ0t/JqEfkt5XLuIBYPRaQbThtJgjmRFGmNvZIo6VZe+lcnOOHCF2L1M5YYivx2iSabcJkvGjz6iW/f67tWiG3YRhx1iclDyt7MihxWzKhcZvtIIX4MEbvGsXcAq9spR6fjTtevyJUDyqDJUDUzJng6ZDKzuYVmOt3qW/O/N+j+gt1BTDIcZeKeGGoCROoLEGHYuYraWxkv4eAk7PifdAmZB7qUshsaGKtSuotsG6lRrSIRlMVaMbepDNooec15VwfbKaS4fKa1Msf5XxhGfYdSWHq5jWCqq01TeFLggA2iMZi+nCe8lYUZCUrNh67enwwm3T+vZ3nCgtH/8anK2eH3VUzl8OSGdzFHHUpKYgOsA6HCBhnKHrMQ8RLuzf7wfyd3/H4Nw/MTVX1z9caQzv7+H6ngT17i+HBklIOIIYYUNz9BeshplG2WTm/qzBOgFniVmDgVG6ZJe46pYD0Mjm9bMVuLQ5JheVnVYuZzWmqayHXIWy/15IgLHj8Iebn5LzokmBd17s1SawlIC68IfDtbi6AbCDCmjPwfBzoVaaCoBsjubuleWpTp6LnwkRoIUgfctT4AqeOaPzki1PcrmXqZz8vyv+k47BF3BSke/s01UkmjB1HcQFxqLk7GwA9u/CSBur69H/mjRAe3CjlXoM2RdMkMLhECRKdtmKa0tvkg8E/jeMz+sSZjfdzdHWEGGJlAOKWGfKUAd/vVwMn3ysz2pBjbpmiA3oPi7xGT483rhZiu7HKXjx9vC8tdhsD0l2YyQuI4VNm62IoopLWzsO0uKJzuLc6kiltzFNGjW2V8NOVVufd090WhWtffNe9JcirKPI+hqWDV83fbM6xEvmFE+HEbQl+yFQXsPPKaAPnaGEyWUwDH0tzj/tO9SSz8ip8DKx7QlfHiwu2y/sJKiDRTaO00lTPZL6OP9hYd3155O1Wl8Xj2FoXwDnPG0PZhnyFG/UiUAScM7YtEOdDFLhLYKycQ1uY1uzpHNneNE47fWvE80M0OwXg2JTRyV6YkH/u3ZkYK4 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1d739f33-b62c-43f3-9ad4-08db562460d4 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4838.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 May 2023 15:44:04.9567 (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: idUhHDqjP3OWtNQ5dY6SxlbMmIBSsLi1e2S1zRqeV2Q31kCepyhdPmUqZBhbbu/25Np+Lr4Uhw5ySN6raRPgmA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB9008 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230516_085845_224316_2D48859E X-CRM114-Status: GOOD ( 10.36 ) 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 --- drivers/phy/cadence/phy-cadence-salvo.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/phy/cadence/phy-cadence-salvo.c b/drivers/phy/cadence/phy-cadence-salvo.c index 2e3d4d8fb8eb..b9866dc146ce 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,8 @@ 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 Tue May 16 15:43:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13243295 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 7A4EFC7EE25 for ; Tue, 16 May 2023 15:44:15 +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=VsNwCchnl0XDx72rkC0eOz+baAEIXifryasYnp16lJs=; b=zu/ae5Zw5QbLHp OA6vV5/i9CudkijASuPtF3DhlxAht86ry6lJvPPlMaFtPyujfx/LjXLak7mEt6tZIQLizu3UH5urU UPqD1wUfxJ9TKSg/8PR++J8laXevx61rt0tfSRK7wxa6dVYyksm6JH1co/KLQimQ7ci09wyWcf727 pA8yLHYT4sKo1J7gLDr6TuaVRMRaW7d3rJRNrAT5x5BdNdn2keHK2W3jgihzJ8RvqRhF365YzFtDa PO83fibNT2yDQJMM2G3r9VWbFHqakKYkEOE9UvfDKeamGSOmUfr8tOt8XaP2aLJJdLFroNRwxTlBo ejYp+eUdiSa3ItbNDaRg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pywqV-006IsM-0W; Tue, 16 May 2023 15:44:15 +0000 Received: from mail-he1eur04on0610.outbound.protection.outlook.com ([2a01:111:f400:fe0d::610] helo=EUR04-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pywqR-006Ip7-2B; Tue, 16 May 2023 15:44:13 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IW4ap3IEMA+Sf1A3RGAXRrLMK74J6qfW1iFDI4CYQcUEJxvzv83U3eGbHrBBJlkQcElSkoEmKHbKsuWeoEJELfPxJve9Npzz5wFRNkmU9+MsRERDLajYU177tTOMwtoeUV3OlaEPRsnyS0lHNAzQBPJu2YaIyfOGoB1n7AOS0X4S0wJUqnJrxasTHSrFpaTGmJ4weK16hOZc5yaJ+/V6dmUeTdfBEFeM7tbf3Dfyg+29CBEzviuA0HIJifrADs7iS2I/r3dUtCnqpgu7YAs2E32T+LtK6O/OR+66IyMrIgQmGCMJ53VNBYl7ixqRfkiZyHMdSLSf+9v4u43rlzsWUQ== 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=EfyTBntrHhznKwROVl9ztuckaXm7F9o2ME94+C2yLKM=; b=g6KPMk/k4JTJ1OmVyG5kLCj5NdmqkKUdqM6knNa3N2LPxjVqkS57kDfHP4ijoaWAiRS/BAoVjYJtLsrwacffKqP7r51gvhl42dIolzf8dZt2sYkyCvXIKAheNtytpOCtQLv/eqWtkMd3YsZYQUExYh7akggrC8ZKZW20D23m5ywTsdO3Kzd2q78eJJW06lrLs8H+GopiKSnPBZvIItFbrGki3agL1qq97bmU51Cexlu98N4eC9tPLaj1LW34j/g4Fksk6P7lqoE58McXNBbjyu/u7AhCYweeuJoSwNsUcPdgilIlGD8HneF6dhlSkqnF1tDnS1EJwyyOphFQyAmDLQ== 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=EfyTBntrHhznKwROVl9ztuckaXm7F9o2ME94+C2yLKM=; b=pQrk4gMjb9phdi2a7+MAY1GtZV9MtXVVPxNtPFJoD3wM/YblDfaKlQ6Rmf+/IydbkDLi/B4PG4hrPW9JZPU6bK+7HZctovTnIGaLehh59htIsTSA1Dl6gvKPHRTSbzYgImP9k0z6TjHWzp2gxdsc037/ztptxj/+0inx7V9tH6Q= 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 PAXPR04MB9008.eurprd04.prod.outlook.com (2603:10a6:102:20d::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.30; Tue, 16 May 2023 15:44:08 +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; Tue, 16 May 2023 15:44:08 +0000 From: Frank Li To: frank.li@nxp.com, vkoul@kernel.org Cc: 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 v4 4/6] phy: cadence: salvo: add .set_mode API Date: Tue, 16 May 2023 11:43:27 -0400 Message-Id: <20230516154329.3155031-5-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230516154329.3155031-1-Frank.Li@nxp.com> References: <20230516154329.3155031-1-Frank.Li@nxp.com> X-ClientProxiedBy: BYAPR08CA0011.namprd08.prod.outlook.com (2603:10b6:a03:100::24) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|PAXPR04MB9008:EE_ X-MS-Office365-Filtering-Correlation-Id: d3173e04-8ec3-4ea1-8ad9-08db562462f6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ddUo5WTzshj+rejvbS6vcA1xgXXMmjY4VhE66cVUTnQ9h26doizT4/2JVrEHyBJb8QXkRUnjVQB+N17HWJcZFNlawMZo+5kkOFlseGmKOrb1BRdrzwaUS6HdmdQGqbKmuZqy0RPg5f70A1SAKXpew+R43nSjvm+lBkcZDY1PMN+Y94gHbc16d4jvhU9BI+NVxnvVfqPoFjhiQyo5vvQGP9/pFPX7IOUXrCG+wLs/qLR+ZWy7LMzPc8RLG5WNr9XYZPiL4JNJIPWxrAUmqeIl4mFLfoPf6wWIuSQ9idxV0eHP2sVRmyhnr4foaIxFE5ZqDbazKOOGA7vou61CA37REOyz1rLfBNPNPf70tpzyfIMZFT8Eawu7DHZzNrDRFoqy+lvnK1HzsBGBbLRjb8glTQgYuOHocpMQyQfqJOYfjDm/n2nBWBN4aPrDrdLO/iwv01vYgGl9LARURfDYKVLkbFpQD0Kr65RuEsKRuDqNQpIeRIm9BqqOYUGXYUqfgCCNr0yWhEqpAOD5dWJLKavC/vQ55TBiCiZupXLnZxcZ2CIN+K5wkfiPwnlNmECNz0UJUfa7wo3Zf2D7tSpulew+HGxKoQBF9ZjsetGczeChA7hobG3j4mbN711Gv+LRkrlaUBhleDK6upA4Imk3oa6vsA== 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)(346002)(376002)(366004)(136003)(451199021)(66476007)(66556008)(4326008)(66946007)(478600001)(6506007)(186003)(6512007)(38100700002)(38350700002)(2616005)(36756003)(8676002)(8936002)(41300700001)(2906002)(52116002)(6666004)(7416002)(6486002)(316002)(86362001)(5660300002)(1076003)(26005)(142923001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: VGFnlBLvXqbhG8qGxCo6Ari8QEudM7dYm4+0GHXl8+0++1ex5C0XfrRuXgtjpYzzkj0W0fJQK76oQ4UjcfLucSyabLpd5YbJ67i2yHPCsVNunX0OneLGcggozzF3iTxfMneuHObvJWIlQCrNw93AqsmSr1AaiSVu5qJwkPTaopMx2cSGopk5bTT90dJsRZkfVQSrHUz4co8J6lKS4evHim5sLN1mxkaxCV1Udp4jyvrM1O7QXyfrmfDorA4OGT37kgjvjao41ADa3LQ1F6Qbw1FE7lZVRkQlfpWXUT4f8dCQgbnUiPbAGmpFzpNWoc89aByNx8g2iwjDv/J9MhJ8MpLPJOITpedWtbqzjRqt5YiUpIgXqQtUQr4QCTIoISV8Cl0y54jbDsfovtp41nueVFj8+6YasSI8Soryo7SiyEszOKwrIyXAsirTZPmhjULFsgG9sjeh1qwbCXTGf/Hb86qQ7MRzJS3nlW9yMoRS1IJP2CIBFxOe/iqIgbJTI9cRqYoF4Q56gXuG9wrU74X1jR8NzJDNfD3xTwpoaTmZUC0xQUXejtOqTDzKQDrNGvl9wve/1og5povKsChqiI/fjizArzqUQMMZwXGDZxf3uhRdf5BSteaMVIJ3FHop431Zcyc9J+YGWOi3IJI10eKO/N4mrCUacp/E7KE8gzOj5FsAF2KN/7PSm8t9WntQlRWEugquziDSLJ7ze1GzLRpgaYVEvxUfiNSC/Yo0NS3m1u6A2o0SW7vx8j5zsGVH58m07L2yJdpR40hBXGKNQ13LfxXkXHFWvl91ia6DsOrlcs0IMnsdVNRGKu0PghcmYegHy0mxqEJUc0hcPKZTVGw6+vb8JEpmxX6WeZWAf10d+LN4v5K9MogPG0J8Hc03ELAX2vrRfDmf2gjapSSWQCi4Q7IhCsmvEIdXKchPcYX5/fk+Wrud57LcmQ3kAlVIucHZOrulkGTeANNkhmSG0szLbSWoqHBHD8U5rZndxQg83QnLpwFp5IcEdrg9bct9XgFAS4TAI5UezrzlLu3VCb19gsKEO6w5P4+iz7937xa8PMin+8K5ibHzAtpyHfjo0ThInfdnEZaD9Bnaymc8RV+PDKjHWEjkjSAgwDCmD7g6q/58K2bNhUZ5BNQI6IYord2raNYrz1Atv8nboPmiEb09nq8qhfEfQMv1Ww7O+mzD1mLZvX/ulgPCO8oOh9Wepjve2eaVL7yuQrdw3vvBSjVItddI2WhX6q+k25hVxBIfGkWhvd0zxszcga7iqkaeP75cdlwggsnljHtAcMQrwCZ0+iUVvh6xpYyqneqFzX05/V0wE6ybeEEmLZ8jotbX5RBn5j5rWUUww8+6yEskSkopw5L3VmIOgl+a6FfRmwRBx2YLS2DnCWWJqQgEMPozTErdzD2kDBxkv/gAmsxvqDvJhe0+jXLNVpm6NjfhJuPD8Gx9kWlkc7SDrd6fSm5CjLtsN23O8kN1vZG5Evkp00typKiqqeNqkmr5ZmYg8uiQwONaqWlkhw2O6RgEde2hE9I3966mrh5aFrzWTscuBIflaVSXvTHvt0CDwN6hhwlIhd9u/B6ixXZcxYWPbl0THqnG X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: d3173e04-8ec3-4ea1-8ad9-08db562462f6 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4838.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 May 2023 15:44:08.3910 (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: l5Ilp+MrW5i0QkyeJmv7oMbvghcvAMINCkaP4m+24MRXtBqJK3SqVFuy6xKXKQ2qpAOQkQC4wUotb6i8n7Z7Vg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB9008 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230516_084411_714520_33913360 X-CRM114-Status: GOOD ( 14.01 ) 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 b9866dc146ce..41616f786321 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 + @@ -273,11 +284,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_INVALID) + cdns_salvo_write(salvo_phy, USB2_PHY_OFFSET, UTMI_AFE_BC_REG4, + CLR_B_SESSION_VALID); + else if (mode == PHY_MODE_USB_DEVICE) + cdns_salvo_write(salvo_phy, USB2_PHY_OFFSET, UTMI_AFE_BC_REG4, + SET_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 Tue May 16 15:43:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13243360 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 2A045C7EE2A for ; Tue, 16 May 2023 15:58: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=38/Wa8NfdsL4vrs5slzonLJgRUQpP7S8VY362cEbx6c=; b=LmedWUUpVOE6LA 0a972NcYbVD/rrcHNA/5Gx+PkyoCtiPjNm0pZmvGD01YeYq1HJrimnzj1cY0EyL+nwxkLiZjw92db sJgL/FB2hkmRUb3Tctox85yzL11Sa5AFdflmJMv4NcS8/W0BPhkkqY4v3eGwVndxVt8du2asxfsLT V/6sQQAm0Br7hks/A6IcS6+MPONqXsy/Lgd668f0/rtn9XQ6Zw7Z4pW7WzDHQSzeViMBIEEdp2cBz NbfQ5DexaB2aGfl6R8vDvfVxuUGhHKcnEorrnZzY/6gjojMRpUdbtSpW2jKWtuc6v7reYmcI7+kP6 ekWlgtLDD6RhRZhY1B7g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pyx4I-006Mm6-2I; Tue, 16 May 2023 15:58:30 +0000 Received: from mail-ve1eur01on0622.outbound.protection.outlook.com ([2a01:111:f400:fe1f::622] helo=EUR01-VE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pyx4F-006Mjh-2K; Tue, 16 May 2023 15:58:29 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=InHkSrgoAIlxpInZPBtkwjxmXTWYQL0MKh5mQlyLKnVibd0J2+Ne/udIJKy+AF9SLkFfhjELWbj1j+jLXa5gmYjn+VR8YW1Gd/kcVfyWthpwn1/FGWGe7Wt8SEzbeNkr/EdjH5G74uLpwYjVRQYi333W1UrkGADa9cGFfDL7UQmmCyQxmLecYqL9vAkBpLB3SxU4bYJytp6LUi84mSRW1rCX81gxy4XQXut6bFvBr+T7AKF6vy2wXICp3Vkk3j4wyCff4solNPdpkcCNMup356vRxM6kjoLEJ2iJndL62XOhBuDyQeP3o8C01SWlzusg6+drpCLoNeO+pJojHbyQMA== 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=F/lVlNOphIqwV7gd7B24SUtjQSIzYP4wwfRbeZNUMHM=; b=L27rZj6zG1leNJ/Vl077rMVSrGg89WCF3Tvnpk+tdyyOshQhaWEzH04zLZUfbmlL3jMPXSuCg9YAO2yYUdq5sVX/0X0Ez7LSw9XvJMm7J8CI1lZtVG2KIDXskjk3S9XaSsE5xuXn+R5zARslavyZbznyDN6nT+anIzaKvapVqxKKziQ8T+dViaZNOkslUtNEhdQdp36dVgORzMvizi8vyZavkaekKWxVX/P3FRXCsIGUHnZnXjdvKCbPK3sb7p7VnT1Ws1lqAMjmh8CDRiOKKU5hYLaoO+KNqDSTxe7dldjBoB8aooZbpPpw4OGVuyeFrV5/niBCNTsrEizOuVNqTA== 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=F/lVlNOphIqwV7gd7B24SUtjQSIzYP4wwfRbeZNUMHM=; b=s0G2Z+Ur0iBTqtad+n7oVTa+kIURb6qF25rnsNPKcG6mQMA2e88rEWmKLgxTZeZJlGDvswtoe6+heSWef0vCpDds/VJ96NTgjtgQMym+P5mGdoYjhWMxxz9rbpadsa08zxic5h2jZTr+A/MLfMMBVpRVMFjNI2R871hp5kaX/UU= 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 PAXPR04MB9008.eurprd04.prod.outlook.com (2603:10a6:102:20d::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.30; Tue, 16 May 2023 15:44:11 +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; Tue, 16 May 2023 15:44:11 +0000 From: Frank Li To: frank.li@nxp.com, vkoul@kernel.org Cc: 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 v4 5/6] phy: cadence: salvo: Add cdns,usb2-disconnect-threshold-microvolt property Date: Tue, 16 May 2023 11:43:28 -0400 Message-Id: <20230516154329.3155031-6-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230516154329.3155031-1-Frank.Li@nxp.com> References: <20230516154329.3155031-1-Frank.Li@nxp.com> X-ClientProxiedBy: BYAPR08CA0011.namprd08.prod.outlook.com (2603:10b6:a03:100::24) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|PAXPR04MB9008:EE_ X-MS-Office365-Filtering-Correlation-Id: 16c710f7-60e9-492e-686c-08db56246505 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Fs2Eb62SXSnBpiqn3JIxT6ST2wUK6LPexJeHly8AfLejfzn2ykEeQ44je1erpZ6VnR15K4Iu0nDdRoUs7MYubGpjojl99iFBlm6uoTES3QqBYbysXMHFLuQlMJUB607zv3i5AVO/JZPj4tI6sa8p5nCE6n3mGn4snCCwld+bbhNkYZdNnVjjFKUu2LNpAzcrRSvkReYXOrSWfTzDU79efhaak8ZjHhWE5JB/tz9qmq8/Xjh7oGZhBrAbtHqkpdG2VOClb/I1STgCbzy/EHTEFanzJEvHtU672i9/gBxO4DHtbT4Z7eCj6tIpAfDXMHWhRJbnDLNFCawFix5rLKM2j3HtQVh/7ADsADpK3A6R3bFpTa56X3D6uWu9Tr67zg2UHB/DhZ00vkaZXgwW/E/fm3Lx5aYKfYkyPY2cPAv6i3EVM0GzL7lxAsWUzBSjWOpIyogo81tbNPbB/pNxC91pQNOP5yyEcyqUm4PcwfkRy+P5VClXtUeipvonX4dUZklEI0yu/1znANNd64PZhnWbCl+1JsDBNejM3dxnTLIGjMPPDQfTubcEg/1I3xPSUYdKnXM9RN3Hc/Y54GIVdS0sMiy79HNCWCzGVEEmZfOSTOSHLtqdwF8dZHmuPATbe4Kk 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)(346002)(376002)(366004)(136003)(451199021)(66476007)(66556008)(4326008)(66946007)(478600001)(6506007)(186003)(6512007)(38100700002)(38350700002)(83380400001)(2616005)(36756003)(8676002)(8936002)(41300700001)(2906002)(52116002)(6666004)(7416002)(6486002)(316002)(86362001)(5660300002)(1076003)(26005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 1ydWo0A525b5zZA38kos5qbMyTsmwM9O9vhEO6qoalB9IuyNzTJgbL9V9as66xEXVm3oytvIZmdvRVSuExhwq+L4xFpzyaOW4JjgrXk5buUqU8VOibbRHNw84rd4LiF+kNsCWQbDb98Gxd0ff2qBM1fJSqJSuUImvh3TEy0OQp5UC+ipj4Wz5c04r6EOOcQaDnFOFhCK1HLLDZKPOXiHMZ6W1L1+rTpfBpowmBleCiaz3Q1c/OyeEVB5X2MfibMGPR2TIgRgUWZGP21wHHCnemQzow546BbynYxtIe1uZXUW3orqxkOjXK0C6OXsU/8IWPfTkkyn6KXe9DPDl/d0vJ1tNdPOEVabyhYXDQMDp1ATdzECbjh1v9S1xwPBZqQU7Ta5G1giNDwxDSlG8Xcx6JJNiy8DA+JN/vStnWj968UhwJRelDd25IfsPngQ/c5pX4wXRZkF0ukJfwVIppd9l97tU9DOmtwAaLR/cPeykHBwlvhMlCkWr0O0yh2PcK/ctgM17/85tJTIln53mKVDbKcS1ClIVueF3fgVRWvSAfTZRirswKccjtTAWVjFGFiQZWh6f4L0QEApYWVQvDUv259CcvK28odUS2mkUs9c4MpWroBFHmOCp+PgXe/9spGa/dfB4VeeYUmA7OqXfXkuR4DpUuRRGPEo6zHh5kiBfwjS5pn/GMMrqI9wSAseqKtqA+po4683f3BepGBx1Ql+UaOf9SKdEtPAydK6bbaL+HQnPSlBQPMz9tdI707RXAR+mFL28u1lQVls8DChA8jKFWAHR8JYeFpHmuJdzSRvnctccejLsfbbJEG4urNHwX2rWEc0mc9qk3AzuFLw7N0LwPHgdWlLje9wM1vHdgZwvObf0qHBbs5keFb/JmwHDffSrRiyd5YnMOW+4WWm5RrfipAD9GWcDF2yCMdau5u2plsq/xony5e7SoT0xxaptouXfVUidTBOeGlrZFKZHW9VYnvBEwPluiyu0zIeNw4qA4u27rr3cX0+N2KX3OvDL2TwOOClqB7vXcXRY+FNUClbIN6F9miiuml3yrJuk+/PWIg3DtiwaCf26LJ8unF9TBDZmqCbB2c4wV/PoPM3dDbENYXESsa6BLf3mrT267/N2wPlcfKpWIcE8PNhmhRJvp0eJOEocdNPco5jkQUmGq6g7WKkeuCpktREcb/RitIqupBWhBVbsMgB84n30RBvACK/Z4m7OfzdKaFLSl75W8G6REE/RAZAnT56IxBur7MttalBSU0EifgRgXyf3yPT6F9tC2XYq2s/nhihzWfKC3bU/gayqOcKSdvEa6xSMNUJUqzz1MbEkklTB3egmuIE91g3R3gk1hbANi7Aqtfg9QyZeXIsxlJTdH7Q6Sejxh12uzG2fb6TT07KiebRhoa/ontUMONf8uk055F6hXFw7P4SGi5NO6yOgR+c+qIOT6IZF/UDV7GFwFJN6PyHWAXijeWdTk/nUe/hYlnFgnyLRVUJhaAhviW+6pVM89qzXSHjOrAIqxmxumgmvgnAooxa1VWCLKZObbJ3CJjTnaMDocLUG9SdMNyCM3Mp+Jw/3XXZbWpr3swsdnENweEg2DJKMIX2 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 16c710f7-60e9-492e-686c-08db56246505 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4838.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 May 2023 15:44:11.8323 (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: ZpRW5rfuFDvZj982nVhmw8THT/yy05hoo3shv3MwFyfU2CmAjtUCpJzTD8nyeImSG+FiiErB5eEaPsH4wTANcA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB9008 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230516_085827_761627_C4D56BF4 X-CRM114-Status: GOOD ( 13.03 ) 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 41616f786321..881e122f93c2 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[]; @@ -261,6 +273,12 @@ static int cdns_salvo_phy_init(struct phy *phy) 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); @@ -315,6 +333,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); @@ -326,6 +345,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 Tue May 16 15:43:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13243367 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 CF0C9C77B75 for ; Tue, 16 May 2023 15:59:35 +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=UZy8DjgyUjySAL 6aL2ntKZKtx4S7Vcd/wbHJFeDcvii6++KunjuHdE8QFCCmoAbfFqJ6TJ0q3BqSDw+STNZ8lce1YzR 4ivBd0OeIc7zWu+Sp5lIaVL3zhRzYCnDwKMXcIaW+0sqe/LrXsGZoNiqZLgu3K8NNorKz6G7+NMF9 Dr2vpAfQpts0C59xHR0x5WdAlFa4DPyWQoQncdJmjUEno3OBxXfOWj0IiWYdsJTUPIBbHdTIF4xcP IcoOHghKvkBTewUB3k1GX1L21JALYWMowE9+ntb79Xs+H4pzVn+b6Uyjp5+VwK16WUmp4n+Nss4Po 1voCbe9g93ZqNVJaFa3w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pyx5L-006N5T-1b; Tue, 16 May 2023 15:59:35 +0000 Received: from mail-am7eur03on2062e.outbound.protection.outlook.com ([2a01:111:f400:7eaf::62e] helo=EUR03-AM7-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pyx5I-006N3f-05; Tue, 16 May 2023 15:59:33 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EWxB8PpozUkSfWfyvqysBTr7M75oXs75wcpjU/HbFGTe7++t0JOiA6bWPbUD3VDt/AY0JYEX4SkIi/4Umux4pWtgCOAEGbanfzOGmZBgFCmkqafVEAg4OSeRJYNYaQfnoQsVxpz/bDxXtGQrTjhq+3hFYhats8s16hM5Fa3xaeTbuYsuaKUbhgThjDjEy6zhn0NG35NuWY5kaaeYcXmeGnMZtvkE/KPuJCVyCd0Gel+BtxBdLtv6wSOBunJO9/w5wJDA4yx9QgXbLdeoq5vxptvNatE+5lqx+0Tq0u76qd+b7np/CDv5TNmE4roZkfPgFrj7JCbDV1PZJKipzX0Nhg== 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=mA84u4RbTq6rAszhUbMYXjim3bdzSL9iPVZFVz3vHfrNprGPrlEzA9Kf38QjTrDTwh1NVIkzQBmPoZyK+H25INaq/62EBHl5Acshilx1MOdDDWlzZAiMdWvrzGIv5ta6RoTJ5xz8Cz1qqXWI1tSRLPnqtxfsJcarHP768Vm+UIXmAwgw6o2Pvw2rPPuXrZw8GBSecx6lFpUateSSRF4SYYJxmUe1kobip7WnL148vHT8qj9EdKS/7emr0qC3WoUyz0VcMSsUYhKzbZk09cRxA6nygxcyWc6RSTkAqhHSO+fz123taPcDS4Nh2qjGxg/ese91P8cWI/aMMrALlhuY7w== 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=D7o21Oy7NG3/0WUyaVvL2DCOlZFXlY3L+8X3mVbJ5mpZz1eUwyZ96qlHpF41uQRI1rGG8FMTHZlmFuZn7kZOTaneiCejX863e9zj2R7yVlinPQ26Q/j72B1E2s4K457FPLpwyifEJnCdWFIBxcwmMnLU8PY3xbRFWykJOWg8PpY= 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 PAXPR04MB9008.eurprd04.prod.outlook.com (2603:10a6:102:20d::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.30; Tue, 16 May 2023 15:44:15 +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; Tue, 16 May 2023 15:44:15 +0000 From: Frank Li To: frank.li@nxp.com, vkoul@kernel.org Cc: 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 v4 6/6] dt-bindings: phy: cdns,salvo: add property cdns,usb2-disconnect-threshold-microvolt Date: Tue, 16 May 2023 11:43:29 -0400 Message-Id: <20230516154329.3155031-7-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230516154329.3155031-1-Frank.Li@nxp.com> References: <20230516154329.3155031-1-Frank.Li@nxp.com> X-ClientProxiedBy: BYAPR08CA0011.namprd08.prod.outlook.com (2603:10b6:a03:100::24) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|PAXPR04MB9008:EE_ X-MS-Office365-Filtering-Correlation-Id: 98b50ba5-1772-4407-460e-08db56246714 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: JKMFajv4lmzDEB4N5LuEqEO0JW+ZG9erk++ne3si7yBiueAOmHpWEqNv2Br4uk+Jn/df8cqMS72J9IMyhrhnBybLYBK8vd78NOtTz1a5VClpq51zpTLYWdhDJCTZgXAubpEDAFfcC9o1d91R1ue29CH6TXO0Y7Ps6ayeqEaE75Hki2t8V6341v/7fkcZIkSUjQll6QYm3SFl5FwkTRg50e5hfoLFcwtgMNkVY+0EG6oFIqlLUEfH+zQU5GR/uuJeHkK7VvdezQ7dZXv4BP71hi5O2JpbaFf7UAABZ/9bXmFnZ+FzZQGEhU4sd3c7dLXbseeKXeq31+tnUwxs600Z+IHlpXaAsQneIXYVKiaYcU6dLJ6KZ2TRZ3NhG19hGA33+DeLoESNDRqqu7xxdogz+fQU9B3IBBIosLLeTRlZs/bMTgdlH2UWTRFNCJhp/QiAfzmiD6GtyNKAsydD6Z8XCbNHCOF9v7JsPALhbs7FZMWz2MVE5+drlLdWMMV7xlOcEn20kZlsXnWF2yPLYBqPLkIirSPljD0MC7I9Aiy/gLD/HQk5uUQzHioaNCBZtqpAcJF+tOVve52PIdt9GPZnm823Xb1IgL+TIOENjl6kEQ4A5BCW1/7s7KuYnp5mj0rD 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)(346002)(376002)(366004)(136003)(451199021)(66476007)(66556008)(4326008)(66946007)(478600001)(6506007)(186003)(6512007)(38100700002)(38350700002)(83380400001)(2616005)(36756003)(8676002)(8936002)(41300700001)(2906002)(52116002)(6666004)(7416002)(6486002)(316002)(86362001)(5660300002)(4744005)(1076003)(26005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: jFpWTRL0ZpetAW9zwsQPv9QD+Lcjth4yXbLjnpgLq7QTH8Jdr3w+HgHjlUO6UDc7+zAcdeEvj/2guyDZjrZU/1W62zPFn1Gfp35lnq1WYEHU3+9piwY8jcDopXmB85OTFiKl/BPTlazsPUNFmzyiTOjQ7uGXtPwLCklZcF3eKMN6lsMrfmXNWFoB4vHIYf5l8/bIb/PYlOhduxqp+dAaNqnGvkO4J8UAphqzyNrsK+0pzr/pXdRpM121+q6OctuL/0V8hSrSMyelcEtkTmMJ5cSAUkWkg6+YqLYEeENpvrjGNwqheu9+Jd32L/aTq32jdGdoC0dSqHCDuMz2b4K69dNC6yUzaeHzQzlxAUaELXnlv2xXxBrx77p2vDDf/8rx1vXGDBUmedOBPrScFt+uhDdCUNWpSsab51MLLvxtYkN+pNroa8usd8Qf8Bza56CNokpd9LYqfir8feCb9JARb3X9+VvSOMhX+zGkZAq2NDQjQIl7pl4dHfSQRENj+mYdfu6IMw3lVE1uLCLvERRIPUF/o9obWEDpZ10Yug26Q7JV9HC9fyZxOwt8l3M3pkq2jbxGF+UsHQws7GTsf9bg3SbulUOxpUfNYI/3q0QdID41aQHz4OnuTntNdYNyuGvleq8Vxpcs86qnguqywWyeFN5kumN1pynlDTwgEU7oMGJzl05VUOzxm046ByOXxOgXi7Me2Q4c1Tniv9LXIU9Pt502mJloZxGNMiDM7L+i2K8/KvaDUfq7mGTMmUjRoyl3maC/DbKiuHvl44r4lD0uhhKj/rhb+t6ymt1tdd/qhVGTlVBHUROH/7xROdpilzP4Z9nVAqd72KOqtbqd4Iw5xyRjuiWxij++vfLp92F3LdjUa6CIetnJgJ35DR+s8L0cRFZki3TgJJ5OUN2XjSDfHW6z7tHRjM6i62ruNptGcJH9zOQ5TAoar1JuvrzHei/L/0zmpN8nSblQIpBIKrIr/aea+FBcG8/Z47bMoztbSyutKFihogPVlNoaDo+feTg/x0rQL4FzbZbS64VsYDPDmfnsjMdi6EoC7eBq7/utVu57gEIU1fJ+nZVUMrzu71RW+LFPv0kRDEeMdhexc1QBHZBUZmI9Dc+LWOSM+7gdQlwM6FpJ4iiQmkt8MAPzZA2FtoQ35SF5QNdOKCJfQAgVQsE4ekkKMyIHf5Wr+irRQ+KbN9F8A/Dg+05pZOaGFLB6W/mukZTliK4ZrUF3itxjuPTXrOoVfzYlxo/VvkqARjzNfFc2KKUq26Amtfh1B52Al/vMYx9xf7PB3+26DOEc1hFWvMJ7e2L7DRiurvUGYUt/SX33rzyZ5cl7mUxV1xTcdCSlMrOI8+0sgkcPSh2jKaC/5BOtFTxmKFJzrRC0dbbCXzMCUr85D6eYtdRDq0Io24ije0oOMj8+muXCbDV8AVDlu4rEaRJ2ASpRNGJqAGDbyTxIX5TLTtoEezWnxFQkEl5Oz1copotr/BCby8mb2jZR9OPT8/TBdHEt5042cyVLykkUP7OHnYWam1b5IRZCRzaBxf3qIm8SY+Bko1Gg975sN3y2dvZ4PtScZAzHuCxpa/z/XX6TaB5b7+HvG/BO X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 98b50ba5-1772-4407-460e-08db56246714 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4838.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 May 2023 15:44:15.4108 (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: ERDHbxSWMWdbywR7WePd8ahnKt2DbLU9kzyaZ+Ksvfmdkm+PAr/SwVeJvNnHgE51N1bs53wnOXZ+Kk1svVPH6w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB9008 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230516_085932_065681_35218100 X-CRM114-Status: UNSURE ( 7.96 ) 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