Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp17334292rwd; Tue, 27 Jun 2023 01:15:56 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6klgsJ8fzzdCK8l191W9vYNK7YeBAOQbioHuiL236HjxYQMJyAr8/RtmmaOiE+HOa9QNX+ X-Received: by 2002:aa7:d409:0:b0:51c:6601:a517 with SMTP id z9-20020aa7d409000000b0051c6601a517mr7927723edq.1.1687853756595; Tue, 27 Jun 2023 01:15:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1687853756; cv=pass; d=google.com; s=arc-20160816; b=K/ZWHShfLkRjCKvMqoDUr01itDKsc0WCj4jYAFg5ZtIP/LBPlNSJfnmOOPJ9pLo0JT iP4nx1z0SyQge7HRC3KF6C7Vdx6EdfgIiedln2koBPzXmf7cezPr9Uoee7FiLab0irlK UYpogZ+5ROJujfS6DIearVD4+MBL+6g2rymWobsQAMIXeoyCOzP+iH/v1369cC90V8Xz 4bzIMW16MDmCR4rQUAhQu6rhUfY6gvQr0+SrLrLgHTra8C8XrUjhck+54Y3mzg7jKEyr Qv8QPGuwExk9Um4bgCrlO3Yr+QMaFCPvWuk8UPEVOHwWLPdiB9B4nFLLe4UINtt57nwt uChg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=9TYf3RhJsN4JxynB2bPI2CrQCmJo+10Di484d1szIko=; fh=yYzXGDRrEn6Gd1Cv1J2oBeKw1Qxue1Sx1JyY+Gb4z14=; b=O0FaDIoM/hZ9jv6DsKKiuE86oRQC+fWUNQNt9R+1gmYsX61kV/7beJHa8dde+klFoI dYkoCUE+tNEXMAtGF27GfMZSGm5iC4ri7WDEDROfVwap7UlBMQ/UFjK/moYH+WQOg4ox M4bgpFIdQi7hyubbN0v/ePji/b7SzgoMLFXX0tCbOTorPAM2Ffs5+zj/hIfeAVSdTaUJ z1GKQcUyZoHlFdSXgYCKeL8r41Id1nkP1HhQpXTtR0oTg8L52V0E+rZbGZZbAmDBGejb S23EQ2FjD1YGjPkq3LenDaDp64oqZE6xEvRyD9QTiqW0sM5OLZhGqiV7BBOclYfOd1ZB y2ZA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=Cb87fywy; arc=pass (i=1 spf=pass spfdomain=oss.nxp.com dkim=pass dkdomain=oss.nxp.com dmarc=pass fromdomain=oss.nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b5-20020aa7cd05000000b0051d9f65a896si1680448edw.376.2023.06.27.01.15.30; Tue, 27 Jun 2023 01:15:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=Cb87fywy; arc=pass (i=1 spf=pass spfdomain=oss.nxp.com dkim=pass dkdomain=oss.nxp.com dmarc=pass fromdomain=oss.nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231370AbjF0HXX (ORCPT + 99 others); Tue, 27 Jun 2023 03:23:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56014 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230336AbjF0HWu (ORCPT ); Tue, 27 Jun 2023 03:22:50 -0400 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2056.outbound.protection.outlook.com [40.107.6.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 374252D62; Tue, 27 Jun 2023 00:21:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FvzsLC2TROFVVQK2l+W2hKXnD7J64CON1mDo/9YCbVCYaaIgwzcalZ7Vwf+5vymYDkaiLhmmROGwScFeH8qAKGvHRTSC6Mnf2oKLjbmCT83GHZ01zmcCejM0+wUNU98iTWU5hzQzBSpWe81XQ067+yeV1GGZZWD/d1UqrmvR8IMx9VUG6jzYRCYLdx0hiGfPn+lRJQGKYJCIj2WmeO3wVDmnQprobukWgR16MpISAOqOZmLH4yQbQfsANhmJwcNS28jKGaSH7ASf4mjhaKydMjR/KOuSkvXQ9IwGV09hyz47xueaExErewc+VKHt0tsD6lNOlk52ggOY1eAwVJ1VsA== 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=9TYf3RhJsN4JxynB2bPI2CrQCmJo+10Di484d1szIko=; b=E568vrrHEHzV9Qrazbd/5q1k82svLX4KCN9rImy3YkfUKrdzlPbt68WrwiXVGRsYVpjzNBl5UdiT4wsyVN14eutd2lnV3kYOaD77kJ5fu/A3Mj1rdTBrc+hN65DSExr3HbQRMIsTfqoNhtzIIjJha/MQlrbYhARCpKIw2nHzRljzn4CyFMsTz27oGDM+YIdzbSmUlObERcmoZMG3PTy6dJzWTN2IFyUhjPf7GkhDODxzHxHfT0GxsUDJK8UkxjMMaaDVIhWxW7RFpi/0nxvTul3wle4i//e4siav4h3Aeo6SFhY4oZfwnbFN/TlMZhTn7pOngAkCHSH2CVVH7Ps0Ww== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9TYf3RhJsN4JxynB2bPI2CrQCmJo+10Di484d1szIko=; b=Cb87fywyKoKbHqOAVXAvwXbjHayACK2wRvcxRBpVLgcf6h5+gvSgu75CBtZqQKMTUZheOZdUHZW54xAlbe//e8Gh213iRQ+5FHt/GqqMrl3hOyrp5a/bjScb2JOzgUk/5LScKJCySKsHWxtN4MGR4+CtI5gt5iNcWOT3IRUDBV8= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from AM9PR04MB8954.eurprd04.prod.outlook.com (2603:10a6:20b:409::7) by AM9PR04MB8778.eurprd04.prod.outlook.com (2603:10a6:20b:409::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.26; Tue, 27 Jun 2023 07:20:03 +0000 Received: from AM9PR04MB8954.eurprd04.prod.outlook.com ([fe80::5356:c79f:ef9f:dc29]) by AM9PR04MB8954.eurprd04.prod.outlook.com ([fe80::5356:c79f:ef9f:dc29%4]) with mapi id 15.20.6521.026; Tue, 27 Jun 2023 07:20:03 +0000 From: "Radu Pirea (NXP OSS)" To: andrew@lunn.ch, hkallweit1@gmail.com, linux@armlinux.org.uk, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, richardcochran@gmail.com Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, sebastian.tobuschat@nxp.com, "Radu Pirea (NXP OSS)" Subject: [PATCH net-next v3 10/12] net: phy: nxp-c45-tja11xx: run cable test with the PHY in test mode Date: Tue, 27 Jun 2023 10:18:51 +0300 Message-Id: <20230627071853.106215-11-radu-nicolae.pirea@oss.nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230627071853.106215-1-radu-nicolae.pirea@oss.nxp.com> References: <20230627071853.106215-1-radu-nicolae.pirea@oss.nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: VI1PR10CA0117.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:803:28::46) To AM9PR04MB8954.eurprd04.prod.outlook.com (2603:10a6:20b:409::7) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM9PR04MB8954:EE_|AM9PR04MB8778:EE_ X-MS-Office365-Filtering-Correlation-Id: 7268b0b6-bc1d-456b-3b1b-08db76deecc4 X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: RaTOZs9BFOu4buqIvjQ0Nq15608tt4XiJdQePC2937/Osg7k2ozVpwsrIDW0HqXCF87dt0F5LBE8m6qRw37OC0T014rXj6iEHGy9h+hipGTdo1PwbyK7pz+g3/Jk2X0UaKA1tkUtZeDl1n1sAcvMJ7/6XT9LS1FCt5TOePSps4cBk0XYCcsAvjuyJosyNQicHA7CVNmVwBvfsOh31QMScL54ptr6vggDBMNok8vLQoSDKVzJvn5ZGRvpCVyx4I4r6a3+WTIjgrD6F1Xfvt6dhVdl1wk//byTpJ95uVvN9dCVaet6gEG8Fc5OXb9NJ9DmyfZ+GiTxnzDpaDP7PJl8VovmIx3lskU+wa8On4AVuH0LLzJU7iJ+vUttHoLeeiksVnPJYURxCx7TnyIxk8JkxPjPggbWBcVON1M94TJQEiEfKN5f/ObYBqju9LIiOru9BOWyPxMpvXLytF7ucpVA1Cg8eD63p2OwlzJfnZmCAkvrB/G7AcQS7IcQQZIjSX8tygu7IhEwAB7kYOH5Mxv5jpmQRE7iapE+SRpxScUdkRmTGZ4bI3inTtWYCfsuPzEnSULqTnjAHevdaGo+CnR8K2FNzsxBHgNrM8ys4rWjlP4rfBlHdTYcNCwRC16nI3E2 X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM9PR04MB8954.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(346002)(136003)(39860400002)(396003)(366004)(376002)(451199021)(66556008)(66476007)(6506007)(6666004)(478600001)(2616005)(52116002)(26005)(186003)(1076003)(2906002)(6486002)(5660300002)(7416002)(316002)(66946007)(38100700002)(8676002)(86362001)(8936002)(41300700001)(4326008)(38350700002)(6512007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?U9jfoof6UVaEGWl1D63/1Jv/ET5QgpXKVL+9v/uCWbI6YngsVdw/WdNz71iZ?= =?us-ascii?Q?shkfIKva6xByrfBhnScqOZZ6k/4BYvFVaUKoQuCUOCNMmfzg5QDw+t+OmBX7?= =?us-ascii?Q?uUampQvnbwY/KdYpZPGXCn3FFS3px9stbrCWwWes37o4NmGatPgUAVZ+Elwg?= =?us-ascii?Q?ZCkBVOqbFZ9Jy+7tpVz2GpsABFQ+0xa5j9NVheuJoVpiNUucO9cOeTxD+HR3?= =?us-ascii?Q?fSsiVRhVExNE0mz/uBB0T7I1E+n3gw/I4O9z/Q0GDNPXKWMR2N1P4pFTnDdv?= =?us-ascii?Q?XkkMGeT5YiLGLiW79ii7aGLt5i15Mp4wUeIRc8XZioJ/wBpbxcs3yoBwNVH1?= =?us-ascii?Q?BQ6Rb68/Zz5PnLUJl99PiB5Q8JLo4gtES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q?ver0y6WBGERjCkbMSXNKkjVEoH3g3tU7ood2o4kgi3eJfP8ff4HgP8RKJ8kh?= =?us-ascii?Q?Ggb35wBnGiM1HcPWjZDXVOXvutgkk8ukh8viR9Bv2ch9V3h+kMbkvJleMyTo?= =?us-ascii?Q?QzkMUaHZ3PTKfuFlqR9Ph8//Ri43wt9qASONRVMqw84jnsRJCmucK8WVTuzb?= =?us-ascii?Q?caRkeN+nbNuqX2Z8o4TGPPMOzsLBa0S9UnsFXSbOQebwaKomjdVkjbNkd5y0?= =?us-ascii?Q?bFGxAn2gRwkAgUxlgVebUa1WM7yH3NtZaN0ekx1Ijs3jTdmrL3+RvhvurBhH?= =?us-ascii?Q?stwwpU6Q43epTWO5sVhHFRCymapz6wImMd0JP1FgIiVto96jKq9qJEO63l2V?= =?us-ascii?Q?+Q=3D=3D?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7268b0b6-bc1d-456b-3b1b-08db76deecc4 X-MS-Exchange-CrossTenant-AuthSource: AM9PR04MB8954.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jun 2023 07:20:03.1554 (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: gHlZHM+56nA3N6IJ6HZbHtp8UKbc2GlvEFqYlaO94tu+3SzpZS2YIPWubYn+2xSVpHLQqGUMvyZxOUzR7P2Fb1nIMMZnPOEQKHVE8PVdGF4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8778 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org For TJA1120, the enable bit for cable test is not writable if the PHY is not in test mode. Signed-off-by: Radu Pirea (NXP OSS) Reviewed-by: Andrew Lunn --- drivers/net/phy/nxp-c45-tja11xx.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/phy/nxp-c45-tja11xx.c b/drivers/net/phy/nxp-c45-tja11xx.c index a826c845ee7d..8097ac8d6962 100644 --- a/drivers/net/phy/nxp-c45-tja11xx.c +++ b/drivers/net/phy/nxp-c45-tja11xx.c @@ -145,6 +145,7 @@ #define VEND1_PORT_FUNC_ENABLES 0x8048 #define PTP_ENABLE BIT(3) +#define PHY_TEST_ENABLE BIT(0) #define VEND1_PORT_PTP_CONTROL 0x9000 #define PORT_PTP_CONTROL_BYPASS BIT(11) @@ -1258,6 +1259,8 @@ static int nxp_c45_cable_test_start(struct phy_device *phydev) { const struct nxp_c45_regmap *regmap = nxp_c45_get_regmap(phydev); + phy_set_bits_mmd(phydev, MDIO_MMD_VEND1, + VEND1_PORT_FUNC_ENABLES, PHY_TEST_ENABLE); return phy_set_bits_mmd(phydev, MDIO_MMD_VEND1, regmap->cable_test, CABLE_TEST_ENABLE | CABLE_TEST_START); } @@ -1299,6 +1302,8 @@ static int nxp_c45_cable_test_get_status(struct phy_device *phydev, phy_clear_bits_mmd(phydev, MDIO_MMD_VEND1, regmap->cable_test, CABLE_TEST_ENABLE); + phy_clear_bits_mmd(phydev, MDIO_MMD_VEND1, + VEND1_PORT_FUNC_ENABLES, PHY_TEST_ENABLE); return nxp_c45_start_op(phydev); } -- 2.34.1