Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp12106856rwd; Fri, 23 Jun 2023 01:12:09 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4vU9G2QcBB3wmBXDRuGXk4OZtWErMzI5BHEQkmKHJ17nYCz7L42hewkCYZLCyUhVQvzHdG X-Received: by 2002:a05:620a:2a12:b0:765:4855:26db with SMTP id o18-20020a05620a2a1200b00765485526dbmr1557057qkp.10.1687507929505; Fri, 23 Jun 2023 01:12:09 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1687507929; cv=pass; d=google.com; s=arc-20160816; b=RfJFCG3dyKkuVd8Ng0iIps/JX6rYLxBJiBPYWUNDQOsTG/6u7rGLIKD1KrjCPz9K9X ZfqilPt5fLj/b7fzS/Zekval/8sCFdHfmmfi1ofYGl5d7aj+nUXSrmuHK7T3rJu4vAnF +zqg6eL2cpzOKdOaJwksNvw4zHyehbY33itiFP766lxY0Ragr+DCInKX3tlUGCmSxXt9 dY/rvBKHdUGpPE5uTtIAbYmYgiy3jVYO0+nv4zpI9ar37c/5Mq1vJVy0GhWiAL+zKb3k EogI1pIZ1/LOyPQckCpWUE/4GG+YrLRo+q0EYDnLy5UHNFJBb84xz1LzAsiIDKd2dpEd ZzAw== 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=yqGb7Os0cK3DP25aGYikW/TRg6PcoqTgi10qkKDZ2Lo=; b=zHrho+jpuFH7RUQPCBCR4Jvh1nbk4tsE+XQ2pShd7IJ+MDQgdzXk61InQeTWaw5u9k gdIacl1yKu43+4eCnzzdTeDwB+Mh+ekiSx6KYA7Bt5HTv3Iqmk7D053xIZoRbz/d1k2n oONNi54RMfLjZaa89ICQnakRHo6iLOvA/SfFFVHHXHPk0zf/AGe51o6Y7B8QeSCO0a+x aXWFwOaYOTi28e7fZBxEl+ZXGlguipipVgU0UxtMZh5TkwnQHe9bc5QgaZ34dzn2bBNZ 3kNyup45xSfJs5eL+pt4FSZO2uh5PRndIKpBIre3ct2z3Zp0cTdgMI2cQfKlsMWsYnc3 h6oA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=Ayu5vDxV; 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 x5-20020a654145000000b0053efd7561e1si1468768pgp.287.2023.06.23.01.11.57; Fri, 23 Jun 2023 01:12:09 -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=Ayu5vDxV; 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 S231585AbjFWHm0 (ORCPT + 99 others); Fri, 23 Jun 2023 03:42:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231151AbjFWHmF (ORCPT ); Fri, 23 Jun 2023 03:42:05 -0400 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2085.outbound.protection.outlook.com [40.107.6.85]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4B25F26B7; Fri, 23 Jun 2023 00:41:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aVXemwO1Sht3p5ZB9TAYjy2I4/NhICrs7EqLbZWvJHuadxup7vG0blCuUfp2H8D0QOKDKZLyLkgA3wF2PAHK9drxpYRDisYdeI0eMOo+8zGVEUs2Gz3dOJUlTbA1OcQJQkCJ83m8BpfJkRiw0FlFQNPlCGLg746rNV28TpF4iIBxSCisYJr5sxHjyNzNB5N5EUTFbp4nuUBXjxDujLAsB3cfnS2ccIDfnqJY6eJ4uAhk53fx51phaoO66SAyIUhfEKbmzJrno8JKqyXXTHvuuPAaJuylt4AOLpAMAauVhTXzpxkXtlF+aeZXegY2p1+qXNeRTV2Wrkeg2OzDHQDiIA== 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=yqGb7Os0cK3DP25aGYikW/TRg6PcoqTgi10qkKDZ2Lo=; b=Zyyy5SB+X5TUiZPGcsdIaBeGSyjPpmNPyNJwNpbZ0VUXKWpBk95pw7TSV7Vh6cLpTvUGOQRPbFweT57K01UgfkhlG3Tl1k8fLj4E8NJbezClMFH3ErxJCcuV4Eu5gxHuKT52yokitGXyE7AEbHUlLiXMkEp9R5pT2OJWPcAGuofP7wms8cIacWFYiW2mx4StpxkciHttxdcu/GXJc++MJY3ErwgtCM5DYrVY1TZVqy88BJ9L7Aqk8mDjtppgbZgwG7AqApEc5He2mN7baPo9OQUZnG0YOf2f9WHiqzZe9X6qSTGWxpF/z+e1PTbWizgFeDIg8tHUauTJ2U8id1I2Xg== 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=yqGb7Os0cK3DP25aGYikW/TRg6PcoqTgi10qkKDZ2Lo=; b=Ayu5vDxV7gTP5bGCwVs2GCW1V4I8ou2z6D/rBmOfyGW6Wy4MgN+9rG4Y7I4upVc5MJ+9cE5HJAScPv3C//w1mCILGJdSaJtndOPvWBk5vTXdqJ5iljs7uz03fm1LEMoNACphxxhIRTWEVqf9YI46pkvvBVenyXYGdA5rwCeohBA= 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 VI1PR04MB9905.eurprd04.prod.outlook.com (2603:10a6:800:1df::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.24; Fri, 23 Jun 2023 07:41:43 +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; Fri, 23 Jun 2023 07:41:43 +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 v2 06/13] net: phy: nxp-c45-tja11xx: use get_features Date: Fri, 23 Jun 2023 10:41:16 +0300 Message-Id: <20230623074123.152931-7-radu-nicolae.pirea@oss.nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230623074123.152931-1-radu-nicolae.pirea@oss.nxp.com> References: <20230623074123.152931-1-radu-nicolae.pirea@oss.nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: VI1PR0502CA0011.eurprd05.prod.outlook.com (2603:10a6:803:1::24) 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_|VI1PR04MB9905:EE_ X-MS-Office365-Filtering-Correlation-Id: 5a3c63a2-d8b6-4119-1795-08db73bd4a55 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: encOKfdWBRRIg9Esp1V1PdG/H6fs9scB6ATYJ+DrbOaoQPWnxnHAFIKQZcP+VCGVM9KvBVNWwnEr26LXTJQUhkWR90pQ1HIhln89sGQQ3h61z8KQQewYfh7g3O2ghFL72iTEPZav8h5saRlDbi+1ojiE4vn2mE4TJaWaDfsBTsJEFNdkjKeYix6MU4VoLDO7x+FDm5L3d/HHcgQW0T3vIWbhTEZNC27McQvlqKrWI7TjnLB8ImGMmpYIeM+AWb9eTA5FOxDjBZxAonLwIGEgzELNiM0uVWV48RHEBWPXyEBPQwo673c8XPE+ewxok43jZH9Sx+pTRhjqi6yT3xKp6iT8HIg76MLULntGi3yQ6lvuouYjwuYz52p4jGc5j4/WVpcoRoj/mVlNs1787gFkYmG5gXUET72kpcChDTMt4wYs5dxZogt3omrJG/d0Pegre0oZ71K5Gl2JDsthn+Mhvm64XE0D1qh1hnGhBs/E9J2hwZnN4AMKRNNkXbzXeCQIapmayFfrefn+oabdrHX4epMLan/DwJDHrs9ZSlB6bfUn1qNtAdGOoX5rIrppbAc3YtVajf9FwM//5Dh7V+QOJ3tOVnw/Y/d56fveSZhcMWoqbdREPo1mdwWD9gAC7bZl 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)(376002)(39860400002)(366004)(396003)(136003)(346002)(451199021)(8936002)(8676002)(5660300002)(7416002)(38350700002)(38100700002)(2906002)(478600001)(6486002)(186003)(6666004)(2616005)(86362001)(52116002)(66476007)(6512007)(1076003)(66556008)(66946007)(83380400001)(26005)(6506007)(316002)(41300700001)(4326008);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?E6jCuUWboiddJbB6XLzQefxJmlUGV8T/Cp8hUptk2XvALpu/3I6/r8cKTn7+?= =?us-ascii?Q?DsRMA+ZfIUzrQWV9snCFQ+jLpupF/QT1I8VBC2GxoKClIybeLfO3MAUzypUw?= =?us-ascii?Q?HMZGtiobfiKECXBtB/jjyBRJrRWApt4PVX8xaELX/sQaq+gbY3NeZ85wKKx3?= =?us-ascii?Q?URjsQq3e/OTJGMFZNhyQsWkkX9ivRbYjXpV1vTdolqjTKFdNix3zm7VPajyf?= =?us-ascii?Q?Bq5ofp5w4cAG4iayi/bBW+Ki4v7Ce5DC9Aq8QCHGu5wJZi+RlVyWLXZ8SvZL?= =?us-ascii?Q?ueN13FcIBV/BI7AGzobKU8y99fQ93suBPZNZ0GDdmj5EKRHYsb29pdvNx/xE?= =?us-ascii?Q?pF58mgxgxLgui/6hSoZQFXWW/WFVKXXvH0ZcCH8yHpGdBT1ojrvCI6fcSmSK?= =?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g6BJGm9kNuPoW?= =?us-ascii?Q?smgRSvT44mh1jjEeSct3uK/H6OL1vLAXd61rnGf/tRMeD0QAFWd9DoOsdSHT?= =?us-ascii?Q?uBR/XGC3gwnRXuoeI9kNv6LMoYyqsupEQTPtdvP7mzv0ikwuyJ0mpoqSmDAI?= =?us-ascii?Q?84KgJ3s4XQLHn9Hm6LNYGTp0Zfx6JYnfB7ztn7ENmnfJyVj9HcXAhntyv/p4?= =?us-ascii?Q?jlg4pZE3k/jZG4PJoxIy3zIW8AT/ApkL1iWcF+vOL9FkuIUljSEbqzAnstf9?= =?us-ascii?Q?hR2hQBxsUCx5U9kXe3fQsa2kM27OIW9SvJuRA5+l2bnSbpLlAbUA2/NwM285?= =?us-ascii?Q?mg=3D=3D?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5a3c63a2-d8b6-4119-1795-08db73bd4a55 X-MS-Exchange-CrossTenant-AuthSource: AM9PR04MB8954.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jun 2023 07:41:43.7709 (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: FAs1eNsgnKbBR7A9Jl2sXVwxxbQgCzBa+SD7wkBVUwB4vHedPASVAZOe5OZ24zhA0QCKL+cRSvosctjBVWFEUG9b1xgQak02C6ylJsQSohw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB9905 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 PHY_BASIC_T1_FEATURES are not the right features supported by TJA1103 anymore. For example ethtool reports: [root@alarm ~]# ethtool end0 Settings for end0: Supported ports: [ TP ] Supported link modes: 100baseT1/Full 10baseT1L/Full 10baseT1L/Full is not supported by TJA1103 and supported ports list is not completed. The PHY also have a MII port. genphy_c45_pma_read_abilities implementation can detect the PHY features and they look like this. [root@alarm ~]# ethtool end0 Settings for end0: Supported ports: [ TP MII ] Supported link modes: 100baseT1/Full Supported pause frame use: Symmetric Supports auto-negotiation: No Supported FEC modes: Not reported Advertised link modes: 100baseT1/Full Advertised pause frame use: Symmetric Advertised auto-negotiation: No Advertised FEC modes: Not reported Speed: 100Mb/s Duplex: Full Auto-negotiation: off master-slave cfg: forced master master-slave status: master Port: Twisted Pair PHYAD: 1 Transceiver: external MDI-X: Unknown Supports Wake-on: g Wake-on: d Link detected: yes SQI: 7/7 Signed-off-by: Radu Pirea (NXP OSS) --- drivers/net/phy/nxp-c45-tja11xx.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/net/phy/nxp-c45-tja11xx.c b/drivers/net/phy/nxp-c45-tja11xx.c index 162886cce08b..11fb5a4f47fb 100644 --- a/drivers/net/phy/nxp-c45-tja11xx.c +++ b/drivers/net/phy/nxp-c45-tja11xx.c @@ -1353,6 +1353,14 @@ static int nxp_c45_config_init(struct phy_device *phydev) return nxp_c45_start_op(phydev); } +static int nxp_c45_get_features(struct phy_device *phydev) +{ + linkmode_set_bit(ETHTOOL_LINK_MODE_TP_BIT, phydev->supported); + linkmode_set_bit(ETHTOOL_LINK_MODE_MII_BIT, phydev->supported); + + return genphy_c45_pma_read_abilities(phydev); +} + static int nxp_c45_probe(struct phy_device *phydev) { struct nxp_c45_phy *priv; @@ -1507,7 +1515,7 @@ static struct phy_driver nxp_c45_driver[] = { { PHY_ID_MATCH_MODEL(PHY_ID_TJA_1103), .name = "NXP C45 TJA1103", - .features = PHY_BASIC_T1_FEATURES, + .get_features = nxp_c45_get_features, .driver_data = &tja1103_phy_data, .probe = nxp_c45_probe, .soft_reset = nxp_c45_soft_reset, -- 2.34.1