From patchwork Thu Aug 22 01:37:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Fang X-Patchwork-Id: 13772489 X-Patchwork-Delegate: kuba@kernel.org Received: from AS8PR04CU009.outbound.protection.outlook.com (mail-westeuropeazon11011045.outbound.protection.outlook.com [52.101.70.45]) (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 9805FD299; Thu, 22 Aug 2024 01:51:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.70.45 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724291501; cv=fail; b=UhmLBi/F3+1vm8e2pVQ/DHbu6oRD+VU7N9iejYz1KibN/enx+UusVTAA1bCLSy4CRf5Sbdz5MwDG3COEQWaMGKMTYFjjJlItrvGDpKmitqHtznU9Z+QYlWug8/y6UMl4aE0HRJ7ci/93ah297mxB0a6wq0nh79IBPEWJeYOXc40= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724291501; c=relaxed/simple; bh=otf0TWa3NZwI4KhBw6pyDxOK6Ubi4Zw4Gs3KGgSDiTk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=hRvJBUFNsoE9evUgqUevVGubGY1NuFsR0QKwMOnoXLEqJvGHyNkyet3uLqcOJDRSaGOlbtjLwjMA45OA6fYgq0xKOXUvhtaViti1LVdmYLErqKbSFttASskgVxofe57BBp7Xk6Lq7VQ2RiWvHUp93gNxqset4qoIQ3MUtwF0q8Y= 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=foYzCD76; arc=fail smtp.client-ip=52.101.70.45 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="foYzCD76" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=tY5a7FgZTZDhvylWTDdesLRxJBHqKM88552RGUGLBk4AcvX0oKUzRW5hrwk8IXs/RH1kTXFOEKRIwOFMI7y7dOIgY81Df+331BFn0R2M7yU1mmnk0IhRUiYA9B2/o6TtFgnBY0AH10p4JaA/gWk3/o3heTjgdOs6iSZY5hxbgIrLxIY/SHmGeHwQFMiqcBjN6tdUkoyaK/zMeZeChXoOjN3oRwhgr5Bjd4YXOTLvv/GP18aksi8u1f3ox7juW+RJQGWq4fGfaYtVsZF6KZdL8KIzfnvKrD2LpPTmzBgjvZsCOkj5aqwyx/54DM8a0hG6tTFYktZ04YDJopubUn8OqQ== 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=W3vWu3MZ9mvDKYjdLwYsGRRWkBm0DjH+Mn+EQqnvKuM=; b=vTSGWrIMqLqMN9lKW233N+o4QvM545/nI7C9FBvVPcSFo49NKjOL/nbuLqsTesj0Sm3Ss54iBvNQ00ITOSoUcSmwYsFoo55RxJaMwaiyIexHdQ918aU6/jfuac1dsB13n2aRJsYMdwZE/CgO92rmHcZ/v+edl6s6BaBcXS6eeoIytZ0Po5yu2SztcVknaqbCK0hUp7qBko2cqvjBvoa67gMmcoFJJD8jPmZw1/03ljJMXC1joBmzG0RJahDBaPZR/+ZKEIcZ4oGQgXFGBnnZGDTDpwMnYzhfgn+Y4cinZJPlfCw8J4E2lFtnAgX8wX5hW8EGc6iJ+rQOH1UWpIyxNQ== 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=W3vWu3MZ9mvDKYjdLwYsGRRWkBm0DjH+Mn+EQqnvKuM=; b=foYzCD76OS8KkaqGYiP/iUG6qQO1EOb+a/aX56UMzRnmu36sw+9tijbGjsJ3zGHJrqHF1LQMoz+Xd9fnwWW8HPaDbAicuvWqIhJ/OMHUQAPNE383JoIsFuiGG7sc5lfs1vEvNC8qfPP2S4FNMUNjphG8JyjsczU2uEbA3bHhkwq2FMuek2Se3cZuk21RurRv+mfop5DJi/pZgKdTPRZTmlpjYPuif7pIyBb1YGdd3cz3Pb7jxzn4BRWUqEtvpX2gRWtKVdDhnhl6lw9neBSR2qurT1s0K3ZpqMQy92ZdlTIN4Gs0bhQoEdqHo+/bOD9TBedG6y01iOimvWeRo0+BjA== 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 AS8PR04MB8755.eurprd04.prod.outlook.com (2603:10a6:20b:42e::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.16; Thu, 22 Aug 2024 01:51: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.7897.014; Thu, 22 Aug 2024 01:51:36 +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 v2 net-next 1/3] dt-bindings: net: tja11xx: use phy-output-refclk to instead of rmii-refclk-in Date: Thu, 22 Aug 2024 09:37:19 +0800 Message-Id: <20240822013721.203161-2-wei.fang@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240822013721.203161-1-wei.fang@nxp.com> References: <20240822013721.203161-1-wei.fang@nxp.com> X-ClientProxiedBy: SG2PR01CA0113.apcprd01.prod.exchangelabs.com (2603:1096:4:40::17) 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_|AS8PR04MB8755:EE_ X-MS-Office365-Filtering-Correlation-Id: 88d09339-418f-46d5-fc5e-08dcc24cf4ea X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|376014|7416014|366016|1800799024|38350700014|921020; X-Microsoft-Antispam-Message-Info: zftwlakyJ3Q0PL8G6g/EgljGmHJJDD6TRa5ObEx/9f3NZQjcW0Dt8/94a2oxtlP8miUlNB1FL809ubREqa/NFWFH7DJAFDhmWms7mySqfiXw8RfLXxjsZtb+d13gD3tlaXDyAo/0oQCloNlM1mZWPrssg9SKmOvfUokMPqv7mnG5txU+MfVcDE6OgDqrqGU1EckJjczH9C6uSfCibutfwcqhJL8g1MztWUQ6nV/MEvI1Aw0T65G9UEsK5XpYDTmwOhKFwT0XfwbmeU4PIan5EIVDa7pSxlAMNQklTM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34uBC9Mvydrq10pDwujuk4EIspc06Zvf/KsXWYsGKCQKpAsVCPwLDEbKjAsN1mfVvCXJvxpU= 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)(52116014)(376014)(7416014)(366016)(1800799024)(38350700014)(921020);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: cDcAja8GdO1jPRR1vx8TizmalPOnxM3UzaHU85peT6Sb+SIIY55r2dNqoePNn1mkWMYDxPH5tXfYgsdJMh4br29zodtAhDnrgrcX1nNU5T2bZdmiLVJ5Lg1wMzSefbl1jeHvKCWsi5D9xx5fswWFxIXsiQSdLgihFGMEQoBRcm8cOPIj/41akXeqPq8SUlXdHn3j1S59ffs+RhCrCW+wGmwokWgLpe9YZ/PKTIGc0MMx0lLsJvAb85ezojbE1zj8iO7AecP0LA0RgS8CwByiWjQPXlhQQalU2aZi0YjRF0Fs+UtEg5YsatzhYlEQ45uKxpuNGVbjPJLxecMmj2Qd9gsLnijDAwNFrXYJ0qMzStBXD/UyU7QrUC4+jtDcEvL3y8fQqXupO8shtTEuSA4MgkZfPArzn8Vfbd88Ni9JTdC4FVh5Sc4l+/cAxBTIG/r1oCc+bAphUjcAtrQqB+sauPEOdKCQLS4KMXLUzjgoL3U2Zfh8zGTt09ucaU12IcT9TW7TZ+ghl5KFTLjZOjS3Ajid0t2HtpO+9a7G6XhA9wvGtGD2k8uFKwtIHE0BZkh42LycYNr2Qc66u6SQ1BFzPiCl85bW/7BkohKYefmjvyZaNBltKkJBahqxuwlbFUlo2zxXYm7DIoxOmzsme3kkqWqxgE2QPNfgYl7xvlzrxODqSREjZ9ZLop8On4TQ1aG2nlgxAegLFzU3UUwGYGbLTdWI8rXb6DtJdl5KQuV0vJr4zcox4PZMsDUY38pXRc+/+5/YqKj+9ySqlB01DQEz7OQvDDM9N44dbhdJz4WJUocsAaw57kYuEYa/+ffPTQvF4IOSYvzXyE0wu59NpPMvqYFhkh9yJ5G4VWoP6gvYkgULvbk50GkgUfuVWOZ7invJJ+2mQSsFfnQ3TnCtysr9lrIo+Ft2v44ZjTByNSGHjt/z28gcKCTVhvVtdHXD+fZ4ACeGJV/vn7Vo96+6RXgjt3VA3F5IQkNgDQYKlx6+1EHS/ZSMfZ9GbgVhtxqMDEFiUyeYZ4a5SZ8Py2iim+y+M4Dc/3j1vRKlPPyPX78wKlg2zqfJesJ7033vk7k3ujaOugW6xs9i+eSqzMJ7LHgSuxlc/klMLh2dwPbvNiDWhwPljMgv2xAmLkbRe1VByOfoWsgBaYMh2PSl+PI4eYxQlSdZLjyT3swQP5ew+rKx1wY2OmPDfy4RgNc+dsqN59XOPairkQZseWk7a6D1L4TjOWZlILYK4W3+UVX/pS1jiBPrGt/9mLvbfkXEHETllm21NDHkQDpGISgYWZnRDKBy8LEwqwPgtrPo1rPJLzOUe86oWQQ02wxGgpqPTrr/idVxajOdlMxcxHwBURSgJ6mUWJggxc8ijTTReTmpRkCnhSQoYisFnKY/r6373kERZv6kqWpouoE58D9W0bUaqDZQys18hwKQe6Bn3BN6OoBwSsJEIAEDXlrg1RRgVSDL3IIbvhHi0YGlepG7JmAXA1JUy7DusQqiHRycyyUXJPkJQ2945EtYuix30zo0rILPLaHOpzcIcX5q43efwmTpbfjNm/uySqVb15yTcQS4sVOxF2Egn6T7J59oQ8VXbfF60zly X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 88d09339-418f-46d5-fc5e-08dcc24cf4ea X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8510.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Aug 2024 01:51:36.8751 (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: R0ggclTriahhOCXUs5WSQ9nqxvefNjM26RlVuyz18HeqWEGaRxA2CqAKx7WA/UbgUKkUkrWpuaQEN6ZgTfNezg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8755 X-Patchwork-Delegate: kuba@kernel.org Per the RMII specification, the REF_CLK is sourced from MAC to PHY or from an external source. But for TJA11xx PHYs, they support to output a 50MHz RMII reference clock on REF_CLK pin. 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. Because according to the RMII specification, the REF_CLK is originally input, so there is no need to add an additional "nxp,rmii-refclk-in" property to declare that REF_CLK is input. On the contrary, a vendor-defined property needs to be added if we want the TJA11xx PHYs to provide the 50MHz RMII reference clock. Therefore, it is more reasonable to add "nxp,phy-output-refclk" instead of "nxp,rmii-refclk-in". Signed-off-by: Wei Fang --- V2 changes: 1. Changed the property name from "nxp,reverse-mode" to "nxp,phy-output-refclk". 2. Simplified the description of the property. 3. Modified the subject and commit message. --- .../devicetree/bindings/net/nxp,tja11xx.yaml | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/Documentation/devicetree/bindings/net/nxp,tja11xx.yaml b/Documentation/devicetree/bindings/net/nxp,tja11xx.yaml index 85bfa45f5122..eb813f7bf274 100644 --- a/Documentation/devicetree/bindings/net/nxp,tja11xx.yaml +++ b/Documentation/devicetree/bindings/net/nxp,tja11xx.yaml @@ -32,21 +32,9 @@ patternProperties: description: The ID number for the child PHY. Should be +1 of parent PHY. - nxp,rmii-refclk-in: + nxp,phy-output-refclk: 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. + description: Enable 50MHz RMII reference clock output on REF_CLK pin. required: - reg @@ -61,7 +49,7 @@ examples: tja1101_phy0: ethernet-phy@4 { reg = <0x4>; - nxp,rmii-refclk-in; + nxp,phy-output-refclk; }; }; - | From patchwork Thu Aug 22 01:37:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Fang X-Patchwork-Id: 13772490 X-Patchwork-Delegate: kuba@kernel.org Received: from AM0PR83CU005.outbound.protection.outlook.com (mail-westeuropeazon11010007.outbound.protection.outlook.com [52.101.69.7]) (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 9D9B61CABA; Thu, 22 Aug 2024 01:51:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.69.7 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724291506; cv=fail; b=fiHEmvUuokfzRhZuJWokc4Dd9vGeQl6O5E9BJ6UPClNFx9RdysMb4H0yAvLcCnzv+fbfakrnB5Zy0YP2//RQGlJIVmOPQrkeXvQyPxA92AbFj1B8I7JfYN9Ud64YdXztdnUL49PXrO/YYNUw8T+VevC1UPFa+4tHlkTB64GMR5g= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724291506; c=relaxed/simple; bh=krjabZrItxZuSpnJEHnNjYI4p46yvFnh8nRzoRuWKD0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=XxZcSeR92BFwD5NxrjcJ7BWtoU24yUb/rqwejGoHbMdhdUwiBHdt856RXrbpVbHv8u2Z0XzgUqJMnRSqe4nXXYJWMI5BfLz9ePMpRRxY6zwX0tDE0LqN2FoFQIpQR5fiWQdE4WCblhEA+3JJx1+5Up2WimFUcJEKruJjwedTTFg= 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=Qo8GeQ/j; arc=fail smtp.client-ip=52.101.69.7 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="Qo8GeQ/j" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=MjKBCZ8cQUvn69BhqhDbifh1cUqY+p6RorNVs95VlzF4Q71/uLx2tCuwTCMrPHwdNupco1fkexlDoE0Tk2U/DupgEm/ZzSvQDxKTChrvhdtWmJ3gg1KXrvwiF3BlmT5Eb7f1gWU+ppkvX7R/T3hts9pA7bYHgadRJUXIFJUNTX79/Ux7TEiqD3AiyfuwVjcrWMUcGA9gYnOK/JgoJRrzfJWZRWAv/RxIjYHSgXgkD/sfOJZdtUBdYDHWQdKJ2vAbX+BDYobxugQaz4HBV20tpoLSuev8kW/fHeY6VgP/gZkM4MOwiOkRKLeSwgP1bQAmsFXTpOP5eEEtGCb22HxrWQ== 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=gdla1s9zd+RqA6yqyRqxusvDJtK53eIoswKw73+45oY=; b=qtSrSf84Y1XsWLnYvFUTlOw4ZZkYQ6wZ75IMUo22owopbQzA6jSp7t7NNsDr2cDyacK4uLt7JUjNj5shKxb3+E8RkxgC2XfnegttqaY9i3nNeSh7XVjMyd0gkUjjVhaR5kfCesygS6NdDHHyVcsnDEG6C00hwheFIcr2GLFhfOTsAy8GUODiCGRAY9GPUVz45qFqmffF8wcf8M4BTG+IPH4H9ZciMMroctLwWp8HrskhGtb8oaErHm+JQ35mpd/uPVSU2UMFZEZQ1hMhLPPanmk2u1b28rfKXhQLsFfWeCGm7KS/Zw+q95l6OfWT3Zyn/2URPaEKuf5d54fJcd/rWw== 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=gdla1s9zd+RqA6yqyRqxusvDJtK53eIoswKw73+45oY=; b=Qo8GeQ/jKaEB3LPQWel0JcziwThGeh3TNlpmtCauOVXXefn8TjA3FatEp9ThRvYcqn3RJ7vbhGOfF3jkwOvN0GkuGsrvcen4JvD8DfZFeTbM4BXLH2P+80cryH58h63frOgGFT9G7pM2m2S1sSEvAjlbV1rzuLs+H6LMEq4LjFNKjXsftVVMYMp5owHNnXm9rArE3dqobHiLpb5mNumLxPGrpJMGCExUYcw67gaLHZIOkxyL3yzVeciHzQOuWMpGMeQdLueari0oBbW7AawfqpArOySn5bQS/FBxDCCKPUe27Cs/UiVR8FbtDrR51bwLwlu3f4NNZHFvZEPN2W1QiA== 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 AS8PR04MB8755.eurprd04.prod.outlook.com (2603:10a6:20b:42e::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.16; Thu, 22 Aug 2024 01:51:42 +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.7897.014; Thu, 22 Aug 2024 01:51:42 +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 v2 net-next 2/3] net: phy: tja11xx: replace "nxp,rmii-refclk-in" with "nxp,phy-output-refclk" Date: Thu, 22 Aug 2024 09:37:20 +0800 Message-Id: <20240822013721.203161-3-wei.fang@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240822013721.203161-1-wei.fang@nxp.com> References: <20240822013721.203161-1-wei.fang@nxp.com> X-ClientProxiedBy: SG2PR01CA0113.apcprd01.prod.exchangelabs.com (2603:1096:4:40::17) 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_|AS8PR04MB8755:EE_ X-MS-Office365-Filtering-Correlation-Id: 232a03c7-000f-436e-ee89-08dcc24cf831 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|376014|7416014|366016|1800799024|38350700014|921020; X-Microsoft-Antispam-Message-Info: zVgFGb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z7++h7T0UYi9e8pqiHXS++dDGduWCc4j4Qm/ScT25cntDRQAmKOVym+Dd2jsyevjmhhWKd3/GMU0AJVyd4rVnAly3jexr9ydKR8FhHFlTOBSnNMy6F4WOFcXnRQ3z9/RUUqHfNhVHlTocsGsJ0MsoV4BrqWsVCslVXyIcmirzlJALPSqBlz2vdNU5yUU4bIyAGPkWvrhhIDty895OgzHFlVz+Y98mKrYId0VDrR10V9nMaT7LmjGatPsHQ5SMptrvIEureyyTxnD4sCwJdMFfqUV9b6/mW5CygKzfiF/DKD9usHlSJx+s6jcbDvnjUXl0thoZzV49npl/PfaPpSED+xwkdclw5lx1ICFxmGU= 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)(52116014)(376014)(7416014)(366016)(1800799024)(38350700014)(921020);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: f3aNtTexaDFH3e6x9nP2+EZqTht0WM0t3CcvKjMUBD+kScrazjldbWhyUgrOGMrM3VFVC1T73mV8sQxUD9BHhNsFakzUxqFHRUGSbHNFt+HZ04Wlx0tcPe61mBh8c9OB4T/LJzuz69K4WwVS2WtB9HuHDKhLniaUdS7j4FyB+cE1Cf/40lHG8coXVG0xV5yvqyTchhnSbGZ5svAi1Nm0gsaqp0P7M10gSHjhg9e7JA4E/kezCgz9jr/N6Ug6ggubtbwdW50p84pRWjVpvBQy3YcADys2EeM6DfdYMGXQ1D0PSBw8Fp1sUgrXqVR1bvgrILi/NUgvUOk2tIq8Jvp6tHX0DeNIdp1XPRTJg138boSGQa48ljAHvz1QyST50k10SWS6xYSzXlC4bQX2ogooMF1kMjmi7BvOcwb6Xa1vP3z40XSGxKs/CTgt6WufQeZalOPj22yd0hLu//wSAfQ2leMiWZRaVXLkku60ONCdieJW/B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gixG6CDym6fF64E5G28DQbaDq1GLR7OAsHG3M X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 232a03c7-000f-436e-ee89-08dcc24cf831 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8510.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Aug 2024 01:51:41.9388 (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: pRMRSefrNkX0nB9VSgtq+zo1q4mgtAFVVKlZD+Nk2zTX3LwCIqnvVRRqId0h41vUa8w0N+T8OusfzIjEP6sang== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8755 X-Patchwork-Delegate: kuba@kernel.org As the new property "nxp,phy-output-refclk" 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 --- V2 changes: 1. Changed the property name. --- 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..7aa0599c38c3 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,phy-output-refclk")) + priv->flags |= TJA11XX_REVERSE_MODE; return 0; } From patchwork Thu Aug 22 01:37:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Fang X-Patchwork-Id: 13772491 X-Patchwork-Delegate: kuba@kernel.org Received: from AS8PR04CU009.outbound.protection.outlook.com (mail-westeuropeazon11011008.outbound.protection.outlook.com [52.101.70.8]) (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 592D52032D; Thu, 22 Aug 2024 01:51:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.70.8 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724291511; cv=fail; b=NDzLOQU90fxmZWb8oxJAm9bT13IohfyiE+aNApMOP15wNv5r3eCgaS/507V3sEtrKGl+oBkbw+hpowL1NLuIIBHCTXt7Wyr2otFW7pNORCCcEUS2zge6Cxf2UTlbSK+SIGjDLm7PICPM8WnAEa/Fe8qYP3UooxjVKq4S6dIPB4s= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724291511; c=relaxed/simple; bh=c/yjDXb8Xs5wwmu6YO018HRORlCIXvpkVq1sZCfkUME=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=S3eFqAYRCGJ8WsLhnktaOxZ0b4BECZ2XokfQLRh+dQQmW41DkJTs9cD/9UbgrqIPffoiCyBEfO1bFaGICfVUALK+8NoHu8JYZvBQKnxcNWZiOv2IizCpIb0jfKydA925GCVbwvCmlwM3ijbscV9wcTY876ECRum0znOJkbf9OEE= 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=RLpXEDI8; arc=fail smtp.client-ip=52.101.70.8 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="RLpXEDI8" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=mrtrfbLpTwPOLM++Vis0UOuZXrW2HZN5z2AsE7UBgpOqNJyTQKZn82dBsA+JCw9SPm4tmwmfO0qIeal//nrHc0rgKKkzTpW5CLKAD8rbxFieFAbnXId4yfyhnB/GtjyL7qH1jJvbgqOk325xwHYK9e/GSTkPXZ0jQHtPU7FqoxLNyD1Rp1LOsYJIYUe2QxpxGRQ/dlVZELM6x05hKfsPxCmHShMdFST0wkvVtggGKWikzII1J31+DW6udGYMt04AjTB4PJjelZo8/S7VyuNFYvWlwp4w2jQsPM2Xvwaes99ap17xxps4zYyLK0EqTMjKAjRCDSA4f6oYaWTgF0ArZQ== 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=LfoWWE2Q/v5PSDDXpC+oC6ejzjIYMhpMPaZGDNs6NhA=; b=M9H6xxsJzgV8KHvJN1p/M+L8viDlIcMMiBNHYtohbYjr2Zfr5DiK+lFZavR0mJkddmIz9e2quyxhC5tA0/Urfl0QFghSXwEXXY9bt4zNYd3Cdreb1gGleiwTsPLuCZIN5p8XY/sxBb0obo+3niUAdnBUbM0/IzuZkijz0yaHA56D+qu5JwLLj5AG3sf5ptyG9BmEDTDda93vecDhnz5yCnvNEVpSb0d4KgWr/ynHCZh0RjLK42dITDJ3qU6owAg3SXvoVAOwPYXVMWZdlYLG4XR3iPDennYGa7/ha/9bNj35VSl3qbsop85k6/AaYWcmgZtYT94ax5h4CVkevJeirQ== 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=LfoWWE2Q/v5PSDDXpC+oC6ejzjIYMhpMPaZGDNs6NhA=; b=RLpXEDI8gYiz+VNmdN2/GzA63MeHK+DfCyrS2a11+qjc8eum89U1uLtvozdgZmaPqgEasepo264sydsf8yYd4ajDL85heqjbQWGPaoZh2x3M4tFUFqtKGaAjz/pF9cW+T78iacofaXsEWvrPp21z51dkpGKc4B3qfgj5HBe6Al9l1wFuQtibuHJ/5AiZSe+v+d8e3XQSd3kl3FOJZ3CDfOP6LODdhsQYsIsZQ5724imKyCZXn/BMA/o3TwHOwDPNx8Sy5V/I25PyvRTQse9MA7PFerW1XFrYotDHpxsxv7C0fdQ5u6Pv5IQUvuDeBO2QJ8AGEwbw9tIrfTd6C8uh2g== 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 AS8PR04MB8755.eurprd04.prod.outlook.com (2603:10a6:20b:42e::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.16; Thu, 22 Aug 2024 01:51:46 +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.7897.014; Thu, 22 Aug 2024 01:51:46 +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 v2 net-next 3/3] net: phy: c45-tja11xx: add support for outputing RMII reference clock Date: Thu, 22 Aug 2024 09:37:21 +0800 Message-Id: <20240822013721.203161-4-wei.fang@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240822013721.203161-1-wei.fang@nxp.com> References: <20240822013721.203161-1-wei.fang@nxp.com> X-ClientProxiedBy: SG2PR01CA0113.apcprd01.prod.exchangelabs.com (2603:1096:4:40::17) 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_|AS8PR04MB8755:EE_ X-MS-Office365-Filtering-Correlation-Id: a96e6682-c8a2-402c-b294-08dcc24cfb0c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|376014|7416014|366016|1800799024|38350700014|921020; X-Microsoft-Antispam-Message-Info: rGCyhcjU5m0S8ioaMChgtUDDSsZD5DBl7mFjwhjsSr1zUdQUpB36+NNhasK0YVqFEmVxAAe8qGym6ObE34PzOcszL4CfLZTwJdAYm0/VChgKFVfQ2KJJluKNb5toLmLAf9w/8uPJM/hNnUzRX4ism8fOT/fKZ7+adCSoKBsjjKIIP3SSxykpz+49xIbeSeyyDzEUMZi5gMINyhkhxoT1LMlnnVc1uMOs91jdaoWlw0HLrPG65MIINqOeOhKzkI7AZBibVxLeMkq9twZwXmb0lGfi2KG9hWvlXz+BVzaERpkSdWPVv1jYcrhyk2adVVyh+p+BU4BPRgYcD2Tg0Tn7ljqHaqSDjFaVWHntOQ71KQHlpwNFNKOUhtAn5A3GX9myEzgcOK4PEHLWk69EK3Golu1pEFzI4bp06ZL+XBJ5Yhps/O/mcJbVu6OfCFabz/0ZVMZCpL80wOECpqfgtBjpOO1fjAG1pw997IIJo7JyLqQWm4EweKcn0+6Kg6YAcpGY19wxhKaU5Jtia1QJpYmePAVtt8sx6QOqj2yul1jbkK01oMLniQ1d4cXmHuA1NXTNlNP27JxzzExpFx+4/Ax8PSTabRiljpE7e9azhr6xA2QHVX/3uYpWtSBflntKSln0+K7fZnfK48aXqkKV/fEeHo4nvAwWfXbkmVx82o9IG53JtS+Ki3VR25BuqfMzMAOmwI1UxfTdivBDYBtFWLAQlbw4+UVL8TWmWWM7AfpOFjwbl1nYl9tlO/cCTlQhW5RabrbDMRzFeBsAn4ufKD+juCMWsnl04hPMFPrwgNuWPXGoxJfPwpkjSwOz5XrxehAwkaKwntqI4HyLwqZldVD81vzca90O/ujKbh29DGPRza3JKcsdwVuGXWXQKIWuQZ3ba8jR1mN5mTnQ+Mmm4l2TUpkfHmDT11ekfUX+zW8bZ4IDfGQSFq+hqfHpH42U8FYDVQ6b/D+q+i1g8TJ4DVW5JVg5Cg6DSr9qto87ni/JBSbw8i3UuhTIosZlteFeSpDqf5LPVsmcreCj+vEkSM7S7A0USN9eiTQ4XJwPwD/gfO0/2njJsZ+4YbYSkZpFUzaRz4cLGXVi/1Cf9nDkZnS36jbaD2zhYXV5VNzGDPyaidjNxrS8pdP9qMY8xu9paAZUEThzeaVbkKpWK1KSRDLRV18TP6dSXd1bovYYX9mHhqZRQMwkOGzFL7C+TE9w1WMb+70sbqcOi72nV3XoaEPos+mnOfrMeD7JW9XvdMrF0ptGEPV2e2vV4l4tq14BndCQCk44HTVRjsTC4E2cuGEyNy4ksgTCzSd+G67/EFijQSN4nS5/NNonjcT86MQrwBNdUh+Cuf8MikS8K7dJ8qidVCBBucIO3ZxBmnX4oC7Ir3ZH8KayLndFHbR4vNbuD1APapUDSBjjeo0GJtrI5tQAjGeMkC5ePjWxtFLwWM7Veto= 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)(52116014)(376014)(7416014)(366016)(1800799024)(38350700014)(921020);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: vpUuN6CM98HwkSS64MbLF99zQKJoQcBFS20Hdkd3cTVlPDKcjnddPvvxgWXf+BBvDPlMY6B+JHL9tGMrf3AJq6fgjQgppOm6pbM2pvMOHP7W6nI7z/ZrsvzxgC81cXgbyo8L6BhdBp++oTur4W0nnKKGTNGYlzRwM5bdzuCzDiy/OEsSeVcN0EHt0/Xmy81V09Izf2L+PQafooNRjkViSYYMK+icTRCs/M8rSEVnqLxLwYahiqvReH1o/FYN45s+SH6NuyUT/R+94EQo7jA1jlLGmcY8Q2KYBhq5snKTyjjb/OUrzd3Yb3/MYVr/DrLxWpVtqsOvZHI50laz8FQqwPWuOrlQkjb0a8K5yRRSB52gI+d8YFavmZaBpCFKAeqQ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3ohuklsZfv5b4jC0yS0lp1kGp2ICYj/s1oOsvddKYisSGAnmwiDydabftAFwVw2+P/lmlOxG+EShTsGt0i+4ugcOfI2bNxRn3Oy7tiVoEmAapd3BIlByyCSN1pe5EysvxMgugrQ+bkgxPHUU X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: a96e6682-c8a2-402c-b294-08dcc24cfb0c X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8510.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Aug 2024 01:51:46.8631 (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: b/+ZurlV2RpXel2Txc8+vlIn0uHVQP4CmcjC5uYfS9dtv317Fe9iZM5+K/f1sznsAWPuLF2r4Cj/526T18W70A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8755 X-Patchwork-Delegate: kuba@kernel.org For TJA11xx PHYs, they have the capability to output 50MHz reference clock on REF_CLK pin in RMII mode, which is called "revRMII" mode in the PHY data sheet. Signed-off-by: Wei Fang --- V2 changes: 1. Changed the property name. 2. Modified the subject and commit message. --- 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..880d4ca883a8 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,phy-output-refclk")) + 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)