From patchwork Thu Aug 15 05:51:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Fang X-Patchwork-Id: 13764421 X-Patchwork-Delegate: kuba@kernel.org Received: from AM0PR83CU005.outbound.protection.outlook.com (mail-westeuropeazon11010006.outbound.protection.outlook.com [52.101.69.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EAB391779AB; Thu, 15 Aug 2024 06:05:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.69.6 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723701941; cv=fail; b=myXpvcAEanQCe3/sObmYJPkj4OO6m/pyLeOLUiVWwcTwI3/ab7EwHL59zXL3vRZ3WTNDWdgvLXKWKnc/zPdQm8loOl+XUo99z46k5XljzYHlWw7u2XBp8+eNPstEmtVg23FUCR9JWjEPv2NSH3B8CSIzfichBeca0ZPCUjg1DUQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723701941; c=relaxed/simple; bh=D7gopM1yF9F7YqWRhoBgykH5SZhVboUguv7ncjEFdnY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=dvUhKxJB5aMy+AdD6IMPAyc1ViD2Z5zcE7K1T8hDZvwY2HMJXeOpfa13Fj0XLsl/yZ/yWd7FnrrJN5b8pzAtMo16aCY3QheQbTK8RfLlend/0fIcOLWxm5Z24huTk1IymbubaQsY26Vus4QAkAOXDRDoxf2vmSiuEG84SXIyXog= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=WLTco1fD; arc=fail smtp.client-ip=52.101.69.6 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="WLTco1fD" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=b+XHe4Y85gTuLpkx2yF4iRjS962mtYDTdzwoAtuni1Q77QfA+agrjxD5dHcM1b68TgzkEVjZEB1xP1v6dXthtj/QhfNhQsZLuFzsL8her3INtcXZK39PJw0Q01iECewT1jFniIQHTjvlBWtjM4BUVBX/4uke9ppCcddcmrmRyF/n/tBKxTcs0cNsLGjZdY8lhJeKrlfewLEINc0Dcoylmh7HBaRVcm26epLU4nFfBr8BNzSRpbqOrwNupav2YNeyY5s6AnyuPbsgeTo0ZbMB7Gr1888Z99t3Y2f2cUX1DKa0WSaYJ2ByAVSOMLEqj6/WX/l60CVj701Tfhlr++tdhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=llHXoX1fPgvuZl2HlqnA5A6pDBw9eADR0Le2+xvQOi4=; b=PP4Au48ppAFpPYjYRuxXzP7rwU6rTUMO0Ur8FpRIgweFBtqmT3iSmnd6HE2YOluwtZZA2+8vyP6GcCOCaJc77AgD3JuSHI0204kJRbYAqOa3VKD07pwvYoPPzba7Ftc2sMm7B+ZICS9EU3gmnACFq67k4JvjT9ktCkRRehJ4cg766jWBmY7u9SEhkYNwPY7a3SIpTazWI7XmgitESjT+HGyZfFBLIgKO8MKCx5jQLtdQi40ywtSSRlvdqsc7AokE+Kmxs5aqZ8zMRDjK3k4lwH6SPz4cOK3ONI1Ad5CVikl6EU44+uwGKiaNcHF5fvvWIffQ1wE/r3xFZ4jHqigJLA== 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=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=llHXoX1fPgvuZl2HlqnA5A6pDBw9eADR0Le2+xvQOi4=; b=WLTco1fDDAqZKmMqFA5JZkdKasHOIOfN2DzSzFsA838yWbQisTx0oqHWlqxYFjNTWeJL3tQjzk4/CdQNK5iT+q3ltqEjIcL0O/jRLdPkbYMLcmnRb75bdQ4L9YoR0s9Dy3uaWiWLYWwNpiDCdpGLn/dMw2QoUFiam2cz955lXDJqReum+LfZBNzVPed6PkVBFASMg396o+owUpP+xHv1S3jzjoKGnIvUqoFsIHPTUXexDaF7IiVWnJypyww8OgfD3aR/cBa7ePr6wMnZ6adU6J1EddPVqGCm0qKwazfj3iZKCgSxsw9SbgBtamf/wHeb36Z9POO2Qs8ELoffSolg4w== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB8510.eurprd04.prod.outlook.com (2603:10a6:102:211::7) by VI0PR04MB10805.eurprd04.prod.outlook.com (2603:10a6:800:25f::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.18; Thu, 15 Aug 2024 06:05:37 +0000 Received: from PAXPR04MB8510.eurprd04.prod.outlook.com ([fe80::a7c2:e2fa:8e04:40db]) by PAXPR04MB8510.eurprd04.prod.outlook.com ([fe80::a7c2:e2fa:8e04:40db%6]) with mapi id 15.20.7875.016; Thu, 15 Aug 2024 06:05:37 +0000 From: Wei Fang To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, andrew@lunn.ch, f.fainelli@gmail.com, hkallweit1@gmail.com, linux@armlinux.org.uk, andrei.botila@oss.nxp.com Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next 1/3] dt-bindings: net: tja11xx: use reverse-mode to instead of rmii-refclk-in Date: Thu, 15 Aug 2024 13:51:24 +0800 Message-Id: <20240815055126.137437-2-wei.fang@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240815055126.137437-1-wei.fang@nxp.com> References: <20240815055126.137437-1-wei.fang@nxp.com> X-ClientProxiedBy: SG2PR02CA0097.apcprd02.prod.outlook.com (2603:1096:4:92::13) To PAXPR04MB8510.eurprd04.prod.outlook.com (2603:10a6:102:211::7) Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8510:EE_|VI0PR04MB10805:EE_ X-MS-Office365-Filtering-Correlation-Id: aca68867-5afa-41fc-524f-08dcbcf04825 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|52116014|376014|7416014|366016|921020|38350700014; X-Microsoft-Antispam-Message-Info: crBUB4VIs84JzOb8Zr6hTsWrtYSybEuNbIc+MXhdu9/V0kL9Rmkp1k3KPtucPgSMKeA4bwgYxpgoKk911ZlyaRDl7XtF5V190Ook0GcOqDVTudnULQugdzL2mfA1sxKbYbdUi9kUC7L4sjsxEqPOqiK8HUeFNwWFnwhNX2p8vv+EEYwMbeXF0gM8bFZeoyUXLwDOYahdqukbhHJCD7b851pzpkIyrxCwPdIV3dVwF5P0Nt9cK7vzl1nTsKjNDR0O522EtW1fNKF6QWSKvpip4MPAXZ5i9VDm3frpqHzpt36j5Ewhd0bD0ndtMZi5KgMCmimbt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OiTs66z9jt9WPA/47WKb/4la0jJnf2nZ9BYXSJQp2GkDL8kk= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB8510.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(52116014)(376014)(7416014)(366016)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ei3DTDdYFLpc3S2zZHMkYuaf8z2MpF10x0+9a3UKAaq0dXnok7JTsL/nNQMeNuw+V2Byb85HUsAunSJUAPgOOUbIR5/amwwOHjnGhJj01gBZVRakOTlgIFDIvydBZlQoytZ8DtwR4FPZ/WZT7yup13NOgbRJzjZ4WT1DbVBP5l5XUYjAKKTotT/FZtu2Nqpnb0ODoHtunNHEnRiW+8wIu5vDcxO4XZibsaGxfQZMGAOa9k6StdakddNdSWwySM02O7O+sDN+DVFId9u55jJhQNzD6gN3RR3rOxxzW7dIqV/l6zS8PwbMnAKCdHIVsIK0fh1ewhhNmHJFnlSmR7oPQW1Zf69HaQkHwaqdwSaDw8RQq1nse9vfKnAMxzrpjoHbfypVfEP8Vgmgsd9JEh8erzdOHpOhzB8s/P5alx3K4KsMECCBRGbHN6cOzitqxbcEcbqSW6NmB5ZId1ZpIMPBZS97Ssd4UWl88vvUCVoCsFAvjGUgtMIrQqFIKpn+zU4Yj0zpG95xLWNpjQabmoy1JVE6S7OJ7HUVkKLk/HJtQQjpoMfL3Pgzp20eK9ffbQDw0NidNOmH/EfzJ+AbYK3n7Ke/RUwOBJtFF2M1fKr33xPI2utFZUUH8vuvb6sj0/pMvXxoC8uJp++53YYFGY4ujRejAii8n2Z0BguiEnY3zbKgfs2O0UrOk6EtP4ONWCia2FUXcYTysC/0bHADIsgKsiJQl5F3qP0v5ox+/JopVDTz5iSo23f79w7wzWG9VQcEWXNK+l4B6foAo1DyNM3CyGxE3ytrmdRZCK3/Y6DkJ9XPDMyERw3jDPVWaRGdnVNodgS6GYyoY47aMYU4lEfF2a2/PGmqn9wY7Gnp5rAr7xK6hwfs40fxlgUbh2PWQCe3oC82pXKNRXJkJJnOf0r5FqfEiHksdOOEhIG4ZsfYvDdP4NPfGgAQjsg1LD0AuFjMxqPGwdo41JS/o2sK2QDACXAsU62dEloIZxwCEjg5rms7N5UbYrdnYgLU4a7h4JpopvveDytDRG7wpUC8mn+5glWJb+Y/OBU/Y+CbA2mmd0ItcT81RJPbpVobzYEe5PUTMvlZr6P3u9hoy5xVSsCl3jJJQVh8l2qu+O21qbro84Jjoh/Sj8DvYffAlxh2iiWD9LdfnkQPSr/py0d6GibtGc5IW+No5acfFqdaeLWeEPcSm4xJu9CEhZgpJvmMB0ahs4LeushErPHdgl4akzUR/bhz9j/GvHAUM73mJ4L9bd0VHhqWAf1sxGXQ5kJ5Kt86hF72DxAAESFbS0gM2ULcoA+ps/ikDxUO6X3APiDxKVuXzovaYvEOzKbWo98wWoqfmYGiKQIA/frYaSBmi8yE4cAXVoBmmwgldSusonMdPgulsZyfz/g5mRCKpEyAa0qXe0MmLm8RlHK/KNQImY714+BFN9VqzNZb4ZB2soIFgoT6lyFsMgjzFVYM/6fpsdO23uznhKZ12zvGet/Y2vZjd+aq1HaQzmGpg31SazIGEe+2cjomNk51KDod1XVyHCdvCRGFNIgPmH0FuNn+Pj6xgT42kxM3KQibEx+oyO9z9SkHD53b/q1iAHUmwDhDaOMa X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: aca68867-5afa-41fc-524f-08dcbcf04825 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8510.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Aug 2024 06:05:37.0536 (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: SagC8W+rLXDze2ZNhYE37+VEctets82Meyx90obdVJY19lb6wtcQkANMfWZVDIBqggr7LI6EPwJZ4hrYNAaLxQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI0PR04MB10805 X-Patchwork-Delegate: kuba@kernel.org Per the MII and RMII specifications, for the standard RMII mode, the REF_CLK is sourced from MAC to PHY or from an external source. For the standard MII mode, the RX_CLK and TX_CLK are both sourced by the PHY. But for TJA11xx PHYs, they support reverse mode, that is, for revRMII mode, the REF_CLK is output, and for revMII mode, the TX_CLK and RX_CLK are inputs to the PHY. Previously the "nxp,rmii-refclk-in" was added to indicate that in RMII mode, if this property present, REF_CLK is input to the PHY, otherwise it is output. This seems inappropriate now. Firstly, for the standard RMII mode, REF_CLK is originally input, and there is no need to add the "nxp,rmii-refclk-in" property to indicate that REF_CLK is input. Secondly, this property is not generic for TJA PHYs, because it cannot cover the settings of TX_CLK and RX_CLK in MII mode. Therefore, add new property "nxp,reverse-mode" to instead of the "nxp,rmii-refclk-in" property. Signed-off-by: Wei Fang --- .../devicetree/bindings/net/nxp,tja11xx.yaml | 21 +++++++------------ 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/Documentation/devicetree/bindings/net/nxp,tja11xx.yaml b/Documentation/devicetree/bindings/net/nxp,tja11xx.yaml index 85bfa45f5122..e8ab2cf8d4d4 100644 --- a/Documentation/devicetree/bindings/net/nxp,tja11xx.yaml +++ b/Documentation/devicetree/bindings/net/nxp,tja11xx.yaml @@ -32,21 +32,14 @@ patternProperties: description: The ID number for the child PHY. Should be +1 of parent PHY. - nxp,rmii-refclk-in: + nxp,reverse-mode: type: boolean description: | - The REF_CLK is provided for both transmitted and received data - in RMII mode. This clock signal is provided by the PHY and is - typically derived from an external 25MHz crystal. Alternatively, - a 50MHz clock signal generated by an external oscillator can be - connected to pin REF_CLK. A third option is to connect a 25MHz - clock to pin CLK_IN_OUT. So, the REF_CLK should be configured - as input or output according to the actual circuit connection. - If present, indicates that the REF_CLK will be configured as - interface reference clock input when RMII mode enabled. - If not present, the REF_CLK will be configured as interface - reference clock output when RMII mode enabled. - Only supported on TJA1100 and TJA1101. + If present, the TJA11xx PHY will operate in "reversed" role mode. + If XMII_MODE is set to MII, the device operates in revMII mode + (TXCLK and RXCLK are input). + If XMII_MODE is set to RMII, the device operates in revRMII mode + (REF_CLK is output). required: - reg @@ -61,7 +54,7 @@ examples: tja1101_phy0: ethernet-phy@4 { reg = <0x4>; - nxp,rmii-refclk-in; + nxp,reverse-mode; }; }; - | From patchwork Thu Aug 15 05:51:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Fang X-Patchwork-Id: 13764422 X-Patchwork-Delegate: kuba@kernel.org Received: from AM0PR83CU005.outbound.protection.outlook.com (mail-westeuropeazon11010063.outbound.protection.outlook.com [52.101.69.63]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 49CFA176ABB; Thu, 15 Aug 2024 06:05:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.69.63 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723701948; cv=fail; b=HG9mmp7vTmnbO4FttBTqYTAkkwPn4XY4+lSDeS1rOlR7UtHN1wVQF/dwkN3W/bZ4l72OwXykGWhBm/qrMeiTV4jGhTPmdIvFR/G3jOs012O6CjDpGabO0Aned+PjZ/5czIMZB6yyc+Q6XxASiO4/dzdZgOR9uzWWLHStARFe2Go= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723701948; c=relaxed/simple; bh=6r2W278wJ9l92J+rk/B7agUB00MNVdyhhOrv6AJ6ad0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=Aic5X7aLDZNnKtJsZzBFQOthwMRDhKf6I1xSsLkJ1HPamgosuPIjVDO5W4ZJCsdXEyggsYrD4I928X8D1malr8UzfjS5kVjNn9M/GQd+3aGiyg4Zh8WVEpWcfnpJniDXGNLhD4ssfeD0crnryo5w3z275shyg2dy+w1XbYlsc4Q= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=h0MAQ5FI; arc=fail smtp.client-ip=52.101.69.63 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="h0MAQ5FI" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=bJ+JXlTHSHPXtmIgGMK6N/+dAj1uY8ypAepjF2UZptay+V+CPp98VB+VGzhAHtKwHz0W1TPrcpsj1HaETf8T6+CDe32BDLV6/Tz3W0h6oGMVTPktvGQi9pHAg22Qa8vCB6wDlKxT3v+DhGyxzvHjxgpRmy0rJetPK1poNoE8IaZxtFjKxHhptjpVOqn8U17sZaaIjOmWCjBILRfSOKSU7395xNXIL7f78CoJt7VrWD1wzNYO82vW6m++/fizJTfLIb7tkQQdKCXhMXANm0mDxipPA8TgAaH+IPv04CyU0pkPKrTVGhJIWuk0jRrSBUq86bprxcJQ6FCb1+XXlVEYPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=xBlYMES8Hqud9QFPNzLbO95lEsOpZl8fQtWDFnRnYXw=; b=yXi0T0nOPMs8Kg0l9B3HMMRm3br/BklR2NtqQMso9WTR077vUJrXQUUDHsXg0E0TuAzaL13v5WMRFCHfV8ivmITXTI5tseRZzEz4uMXHCTNitYXWWxRSGcm85mX3og8nKcWSfT/DYDmvdFTPekRcxJBJjW13xDGow0yGe/C+2R7IIT8sW+hJrzixAyArukunOrWfcU0aovlIUnLpdETOKVAjZAlOO212Sh8mdYxm4svLyyGm1exZlxJ2YKoG1OKppJFbK5+GbiLOOS5Z8LUO7L6HzwJKZVYhJC7nQp/yRLNM2fdmptsaBUuUGZL4UvPiOr76bzOkjeTqG3zN9A5a4A== 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=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xBlYMES8Hqud9QFPNzLbO95lEsOpZl8fQtWDFnRnYXw=; b=h0MAQ5FImYW/tpKLUsW26AGIjDWy6gUagyhKmntquNuhQgN0ETz6PlblRpsk0zh7loGEQoMAVpBIRIn9iMJZU9MwYjURJ998qd3IFkDE+w7z5mx0fV7bRvv1Pb5PlHQLMeAphqpLflrxx0wzjhG3x4jNMPgHcJlaHUQwNNKXZMXQ8wTicdlikDEtXuzkFJiNJNi2Fw6ipzC/LxsM8BWi6DAOtEmNWef5JMUFYWcllpRqNNBRKOvMbEn29gn/DI8XlclOV4C06gC9jCKR+foLYtCMh3l6bso2wTngZ/eF8qG6tSWQMeOQ2mBZdVXFwEAbUuu6Pv0XoKV0WZZux405nA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB8510.eurprd04.prod.outlook.com (2603:10a6:102:211::7) by VI0PR04MB10805.eurprd04.prod.outlook.com (2603:10a6:800:25f::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.18; Thu, 15 Aug 2024 06:05:43 +0000 Received: from PAXPR04MB8510.eurprd04.prod.outlook.com ([fe80::a7c2:e2fa:8e04:40db]) by PAXPR04MB8510.eurprd04.prod.outlook.com ([fe80::a7c2:e2fa:8e04:40db%6]) with mapi id 15.20.7875.016; Thu, 15 Aug 2024 06:05:43 +0000 From: Wei Fang To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, andrew@lunn.ch, f.fainelli@gmail.com, hkallweit1@gmail.com, linux@armlinux.org.uk, andrei.botila@oss.nxp.com Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next 2/3] net: phy: tja11xx: replace "nxp,rmii-refclk-in" with "nxp,reverse-mode" Date: Thu, 15 Aug 2024 13:51:25 +0800 Message-Id: <20240815055126.137437-3-wei.fang@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240815055126.137437-1-wei.fang@nxp.com> References: <20240815055126.137437-1-wei.fang@nxp.com> X-ClientProxiedBy: SG2PR02CA0097.apcprd02.prod.outlook.com (2603:1096:4:92::13) To PAXPR04MB8510.eurprd04.prod.outlook.com (2603:10a6:102:211::7) Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8510:EE_|VI0PR04MB10805:EE_ X-MS-Office365-Filtering-Correlation-Id: c15cda80-85da-4171-d815-08dcbcf04c06 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|52116014|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sI7YqB+ng3p4b4BYYWGr5fQF/6o2dt0wMdaOyWZ+Tyj8wlGDe7VH+felHYm+Nv6egYzqwv4KFMla1qFkWW8ziJ830VHYsB/GrjMCdm+WxF5aQSfd62+tFuEtRclo0glro/sDECo0w7vR6dS4Vd/YT1llXUz2kKURTOvuv7HePX0K5wQfOdpwc7cU8Jr1pH9tSE+sFrZu5eh33p9B8tI0NQ1XBNkCZafC6ZACOB/FoRYZdS3PJxp3rv83zXHEYjQEZuaf09UvR66LxSiQMdejodt4Hw5FU0CmCabCWxE8vrUwePmcXBY1IARABXp8bPjtxWiGsn7nomMOoBMU3TnSn6dHzsge3hr/IRpQj4Af/ScE4tTThBoJgkWzyrH84+XAHSzElBgHNdCzsljamdgxgQ6n977w= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB8510.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(52116014)(376014)(7416014)(366016)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: cljGkYwDilbbs8cbVS8QRHrDzdMpQI9ZYbRF5ZieVkhwwLtcpyKx4XGW/jntxd1jSCiZtixek0Ur4bwWpISS1toX6K7p50l7helzhfWYgwwA7X20SHPmQQYwPd2x80h9zvyqShG5b8JoF6vH814T0Nw9zTzGTnl1hIn8P4CyRBzRjuWaYATDm/IM0W3ujaltDCEu2LQQZYWqVGOHKM5pYuhIRQNRTZeyaulIjFq1zrVDYFExW434MGY4XZ2W+1hCOaKTLWbrAH1J8vSBfcMsq50Oj4UGTeaPsBfUkmOujmCtZKureVMVkHTM4LGr3ADShcs9AvZHJqqGodNr2Y/X7Q+eSM6O8p3wKubyY9FKlQ4Mv2q2rEt97MlbjsLQvZUhqvM9rI+syZt++2yCJKbBCYIA2U+GbMKHqk+3ur/nW6zPNCzRgkSX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t6sQFMd2EjJx9+UD5pThmOUrCILv0qB614v8RpaTUedX6I5gMbqEJAyFXk4yf+se5GlLM2F8 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: c15cda80-85da-4171-d815-08dcbcf04c06 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8510.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Aug 2024 06:05:43.5578 (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: Xl43uktSJnhZGZNAJuL6DcTz5NqYiij+EU6YWV6X8YHuCc85GEOQsm8bz2ep1zOXQAF7Gnf0IjD79SCxaPJxjg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI0PR04MB10805 X-Patchwork-Delegate: kuba@kernel.org As the new property "nxp,reverse-mode" is added to instead of the "nxp,rmii-refclk-in" property, so replace the "nxp,rmii-refclk-in" property used in the driver with the "nxp,reverse-mode" property and make slight modifications. Signed-off-by: Wei Fang --- drivers/net/phy/nxp-tja11xx.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/net/phy/nxp-tja11xx.c b/drivers/net/phy/nxp-tja11xx.c index 2c263ae44b4f..a3721f91689b 100644 --- a/drivers/net/phy/nxp-tja11xx.c +++ b/drivers/net/phy/nxp-tja11xx.c @@ -78,8 +78,7 @@ #define MII_COMMCFG 27 #define MII_COMMCFG_AUTO_OP BIT(15) -/* Configure REF_CLK as input in RMII mode */ -#define TJA110X_RMII_MODE_REFCLK_IN BIT(0) +#define TJA11XX_REVERSE_MODE BIT(0) struct tja11xx_priv { char *hwmon_name; @@ -274,10 +273,10 @@ static int tja11xx_get_interface_mode(struct phy_device *phydev) mii_mode = MII_CFG1_REVMII_MODE; break; case PHY_INTERFACE_MODE_RMII: - if (priv->flags & TJA110X_RMII_MODE_REFCLK_IN) - mii_mode = MII_CFG1_RMII_MODE_REFCLK_IN; - else + if (priv->flags & TJA11XX_REVERSE_MODE) mii_mode = MII_CFG1_RMII_MODE_REFCLK_OUT; + else + mii_mode = MII_CFG1_RMII_MODE_REFCLK_IN; break; default: return -EINVAL; @@ -517,8 +516,8 @@ static int tja11xx_parse_dt(struct phy_device *phydev) if (!IS_ENABLED(CONFIG_OF_MDIO)) return 0; - if (of_property_read_bool(node, "nxp,rmii-refclk-in")) - priv->flags |= TJA110X_RMII_MODE_REFCLK_IN; + if (of_property_read_bool(node, "nxp,reverse-mode")) + priv->flags |= TJA11XX_REVERSE_MODE; return 0; } From patchwork Thu Aug 15 05:51:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Fang X-Patchwork-Id: 13764423 X-Patchwork-Delegate: kuba@kernel.org Received: from DUZPR83CU001.outbound.protection.outlook.com (mail-northeuropeazon11013067.outbound.protection.outlook.com [52.101.67.67]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7439317A58A; Thu, 15 Aug 2024 06:05:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.67.67 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723701953; cv=fail; b=JQQ6IumRgiINL0LETqghWwUyKSbwl47i9GrcQtx6jPfFo1yMoaI7Ju1k1j2oVVsXJcXr9t+yLeY3fnoVYCnldInI268IyPinSOeUzOGODPKvo+6eqFz1/syXNK53RM4n0or8cxRXbwyaD64pZfCDtq550MbEBx7XGiUr2vSBXZQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723701953; c=relaxed/simple; bh=QZgYJN86zmk3hXiZCOc/KTDuTbWRqnQPlSXUV4XSmQc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=jsKCUrF9aJQoy9+f6qVwEAuTQK80mu0T7fcVjTn5kiqP5Y5FN59qas3anFOmdyCPeti1WgwNdqrIiFXy/Y6RDlPiEmDE/JoWdUA1+rAlZWWsVAn7l4Ygxk3/y9XQhWmKvHI9f5XdbWdPNiB0jmXoUmfsoE7qIgSLiPf4izSekKs= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=eQpRpURu; arc=fail smtp.client-ip=52.101.67.67 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="eQpRpURu" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=fpqJ2puJTcfIuu7kno1zBDZwCCaEtMyo/qwFEUWGIZpZU+xmRl7KIaxhONclmh75LWZH4M/crbJPyXgWoemOUZmAluYoWiqFuzAuGYYogdGSR/EJKT7zvnhIxm18zyoGjeejde4gAqIpGY8p3WSjisgHVUIuHW3PQdgIP/4wdauOY5iKc18i2J+z+PB15+eJ5BQzOpWKx81Jj/oK6w+PpBl0X738PUmNQtHKIbYiE9OOWQuUClPBT9kFNtxiMskNJ6tAZyn4pif4aQN+zVXE40YxHpDIkXknWJ7oNksJ1nZ6d+7wyPxI2eAH94XLdNjtfi/l/TsCL6su5dwidhE5UQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=COyCIIfhCurzhPjKt1L8CkqRierS1FI6OtXAVcSRF2A=; b=R2kYkTT3R9xXgTsZaUaX2QX4RQRufEPEbjln5y4oFhMde2okNz4sJtaa9VaGvwckLWT91/t1PrReRIY1MyebFjALRmqBrDfrPzdffCOfAIzVTA2aIcV5GrA/TiqBj5FZqc6DnhPChDaSG6fWliUmZjsFiYcLCFUDp4smo2DSA4063nB8GcPAdJGffuQNP5MUCdmtIf1KVXOeqMSDbqlADLmljSNX436nTUekG9QMbg/FeHsxBjDhbqtuRhV9iWC/u2Kg819tZtX07XDzXP8nlHFc0VJy0JT7+reeJTSU1yaDvjaosIwrqLcHHAIeWLrzP4uVVG4exeTiuC1QR9LnnQ== 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=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=COyCIIfhCurzhPjKt1L8CkqRierS1FI6OtXAVcSRF2A=; b=eQpRpURuwhpJaXtTTz7iOArYyrfrS4bc5FkLWEmGiMsCQWnP8G3EDdHQg+af03KQz/b50gWk1zZZO2knYxFztgtIhLJJos063XsTwhxdNCUaYIbWn2hQTUrR+nVcrG2/zoZhSRN09m74QKB38xMhloFUJLLJZpd+ifHDPKl5ErPIKr+53nO8DyZCG/MZKEqWY9l7GvVLuj0rUCoGGFVL569mp1jw3s7xypZbEyB/SMMqLhFApv5qZnmDTSup4bZCAh5LLn7K9cXQ4beJSFJrGRY7o588Egxx8PcqtiaOjqp86n8cFr4yJfdH7EldAnwmsmOMNQz2UhYa6VXE+pFetA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB8510.eurprd04.prod.outlook.com (2603:10a6:102:211::7) by VI0PR04MB10805.eurprd04.prod.outlook.com (2603:10a6:800:25f::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.18; Thu, 15 Aug 2024 06:05:48 +0000 Received: from PAXPR04MB8510.eurprd04.prod.outlook.com ([fe80::a7c2:e2fa:8e04:40db]) by PAXPR04MB8510.eurprd04.prod.outlook.com ([fe80::a7c2:e2fa:8e04:40db%6]) with mapi id 15.20.7875.016; Thu, 15 Aug 2024 06:05:48 +0000 From: Wei Fang To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, andrew@lunn.ch, f.fainelli@gmail.com, hkallweit1@gmail.com, linux@armlinux.org.uk, andrei.botila@oss.nxp.com Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next 3/3] net: phy: c45-tja11xx: add revRMII mode support Date: Thu, 15 Aug 2024 13:51:26 +0800 Message-Id: <20240815055126.137437-4-wei.fang@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240815055126.137437-1-wei.fang@nxp.com> References: <20240815055126.137437-1-wei.fang@nxp.com> X-ClientProxiedBy: SG2PR02CA0097.apcprd02.prod.outlook.com (2603:1096:4:92::13) To PAXPR04MB8510.eurprd04.prod.outlook.com (2603:10a6:102:211::7) Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8510:EE_|VI0PR04MB10805:EE_ X-MS-Office365-Filtering-Correlation-Id: de0df6fe-fbde-49d4-ddfe-08dcbcf04f2c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|52116014|376014|7416014|366016|921020|38350700014; X-Microsoft-Antispam-Message-Info: Qaw6wnXyR7eB3rQtLyKXxdxu1qyZfUEghE6mAk3tXBUVC+10VCLvdHPffuXmzO38OP5yS+xJ9wMMioT0qdS3UnB4/yRjH7lr7JENZWPuvL/RHzg9M9htN5SSxVBT6ZDIMGr0bijAX1hRbloqbpcq5ye32cBOuE2veBvEcvA1Amb64N92yr0gdSL0/YtY0yL79rLUavjQnq5nPfbJo1K0PT+UE9XoCsANVNQiHNVcX4XUd3T2XBHWvGFP79vfcVZRchoOCt9y8r4PCanZ5PrKP/qsnbRf57AojbxtuAdykhOtjfN6mZXRMOJIlgbuOub85NHlHh7wb9gQ1VnZU+hkQ2rly4NqiY0p/4zdRwB7iAyESU/YDZjTLlsWGd2m/RoQl2WkvCI9XLL4nXGbIW98fmm21B8Rv9mJkUmthMJMqcSJxhaoRT3arOJ6+Qb91XxuOyCFpJAmj2eLeZZ7inAD3gDEaF3YcKhv2z9syb5ki29OStpJL0m7OiKy6T77F/aCLdgQsvdE+SEni428KpWqsG0XOMX4pP8AbainRO3Hf4mO2BkF+ueDriaiKdlZuLptI43sv64BKhoJXO8afUknraaCwRZjmMBAqxHWloU37mBkvpmxyvWQqT7iwdKTxFQAxgteLjQbtBM3WV1YjvnNLWD9NPzIalpZYuhS/17n/WZpui8Afev1YB5XtY4U/LvhJYOAo9Qrqbf6DYG96h7lQYd1HlhErdnHMq/fqy0UFmnRgCOmAI1wL9e5fkxhBp70BnyuofppVOKMbnBr1JVDRIJeYu+TlhKrn5Njr/isEqW+Vp2cnoqSbdXyfVnMct77d8+DgTNMcX880WPjgpqMczjgU/AJJo8uwd9ANQ5sStA8wwxVFqUaOboGNPu9WAhs62MFoZXN9Trrt4ALCjojbha2g3wNNA69EBP3L2uAmIxkGflnlW86naes1R0W0WdUcP0En3h8wiZNt0XKqfLiQJiloHF6hLWDnrnlhXg/VVAnTjnh1sWR95nknufNdD6BXoq/+IoRIlsmdINjXtQ3wUdYn+DVBkWcsRlHwa1mfjBMRgSQZ9HDdAtjskawC5ynOAMxm2Qni/raUb2MMHKH9g785nXO7tm2YUVw7el1gkgFU7yVHG7RUPOxapbKzAQaNS6cuPbZsHxVrBIrFe0C8iSrpsAYhBwoUPg0T1Hj5rLEmp6pyLy4VZBa6bsCdWxxu+RK9zRSc01z2yu6gdaPSu1S/84F+KhACdaOwLFNQQkK1kN2mKijn4Uv4k3tDtOqjkPPew8CNIEPVSZs4qDpoW4nvxHghbsk56cY3ANoZhoDY8LFsUOJYIm2gFMYX7rQxuP576K1+9jbW/IBp2OCUn2FHt1DYj9UyJuKHpDbWYH/JIAuLdS+EvuoBmtxkUZ1oc2LK9SpmbGOjpFAuG1WrDDLL9nPSK8KEDHjfUD+IOE= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB8510.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(52116014)(376014)(7416014)(366016)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 79wjKj6jv1kdvFBWy2Wk4ZpcX5dfQ8+ymRDjkcfdm5LIyS1pHIicv7ok7FI8ESVOaJCsycmMCK7xOVUQPRi0UKbcFgiEWBCrabgeKiqJ58dpPu/L3e8E+HIogOEQw/j9zVLJpaTnvRHCeMDcEfTv18VXDzAxeDSA+En1mjUHxpTh27Nbg4lb3pToYHLJy5jca7gS46cpWHWqfgnfwmfm4KwqANQUzVYRe1QfzA5LxTa9I7eZ2VaIdqeT0C3+R/W5DbcQMyEWZenvshvAPp2Yp5aoA2QmalO9K6HfrtFLEW6ObNM9BOCGYRmoopyqvwfaXjimQOiZ83aLIeJwgpqGcMTviUUY02u/4CcKnx1vt9+sjQr1mfRZxoybnW7HR0QK83EvxpjUUVEB4ADQxRk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lIVif5HdSYgz1xgY46wqB9T40KMDKjvApWqLDJKIH/imnIr90hfYFIGjDpRVCNLyScyA//RebXT7DVKgKBn+FTDCZAjPGwEZyu86qW4xI X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: de0df6fe-fbde-49d4-ddfe-08dcbcf04f2c X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8510.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Aug 2024 06:05:48.8723 (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: 2g7XfP1QzD40kKRFU9WB8Fm28mJfGN+JeV4RQRyup8/QbJxBkn4pVKyuSUuy0+aUb/3NGpdVAK3UMkTYHLdgzA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI0PR04MB10805 X-Patchwork-Delegate: kuba@kernel.org For TJA11xx PHYs, they have the capability to make REF_CLK as output in RMII mode, which is called revRMII mode in the data sheet, so add the revRMII mode support. Signed-off-by: Wei Fang --- drivers/net/phy/nxp-c45-tja11xx.c | 29 +++++++++++++++++++++++++++-- drivers/net/phy/nxp-c45-tja11xx.h | 1 + 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/drivers/net/phy/nxp-c45-tja11xx.c b/drivers/net/phy/nxp-c45-tja11xx.c index 5af5ade4fc64..571ecdbd49d9 100644 --- a/drivers/net/phy/nxp-c45-tja11xx.c +++ b/drivers/net/phy/nxp-c45-tja11xx.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -185,6 +186,8 @@ #define NXP_C45_SKB_CB(skb) ((struct nxp_c45_skb_cb *)(skb)->cb) +#define TJA11XX_REVERSE_MODE BIT(0) + struct nxp_c45_phy; struct nxp_c45_skb_cb { @@ -1510,6 +1513,7 @@ static int nxp_c45_get_delays(struct phy_device *phydev) static int nxp_c45_set_phy_mode(struct phy_device *phydev) { + struct nxp_c45_phy *priv = phydev->priv; int ret; ret = phy_read_mmd(phydev, MDIO_MMD_VEND1, VEND1_ABILITIES); @@ -1561,8 +1565,13 @@ static int nxp_c45_set_phy_mode(struct phy_device *phydev) phydev_err(phydev, "rmii mode not supported\n"); return -EINVAL; } - phy_write_mmd(phydev, MDIO_MMD_VEND1, VEND1_MII_BASIC_CONFIG, - MII_BASIC_CONFIG_RMII); + + if (priv->flags & TJA11XX_REVERSE_MODE) + phy_write_mmd(phydev, MDIO_MMD_VEND1, VEND1_MII_BASIC_CONFIG, + MII_BASIC_CONFIG_RMII | MII_BASIC_CONFIG_REV); + else + phy_write_mmd(phydev, MDIO_MMD_VEND1, VEND1_MII_BASIC_CONFIG, + MII_BASIC_CONFIG_RMII); break; case PHY_INTERFACE_MODE_SGMII: if (!(ret & SGMII_ABILITY)) { @@ -1623,6 +1632,20 @@ static int nxp_c45_get_features(struct phy_device *phydev) return genphy_c45_pma_read_abilities(phydev); } +static int nxp_c45_parse_dt(struct phy_device *phydev) +{ + struct device_node *node = phydev->mdio.dev.of_node; + struct nxp_c45_phy *priv = phydev->priv; + + if (!IS_ENABLED(CONFIG_OF_MDIO)) + return 0; + + if (of_property_read_bool(node, "nxp,reverse-mode")) + priv->flags |= TJA11XX_REVERSE_MODE; + + return 0; +} + static int nxp_c45_probe(struct phy_device *phydev) { struct nxp_c45_phy *priv; @@ -1642,6 +1665,8 @@ static int nxp_c45_probe(struct phy_device *phydev) phydev->priv = priv; + nxp_c45_parse_dt(phydev); + mutex_init(&priv->ptp_lock); phy_abilities = phy_read_mmd(phydev, MDIO_MMD_VEND1, diff --git a/drivers/net/phy/nxp-c45-tja11xx.h b/drivers/net/phy/nxp-c45-tja11xx.h index f364fca68f0b..8b5fc383752b 100644 --- a/drivers/net/phy/nxp-c45-tja11xx.h +++ b/drivers/net/phy/nxp-c45-tja11xx.h @@ -28,6 +28,7 @@ struct nxp_c45_phy { int extts_index; bool extts; struct nxp_c45_macsec *macsec; + u32 flags; }; #if IS_ENABLED(CONFIG_MACSEC)