From patchwork Fri Jul 9 08:18:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joakim Zhang X-Patchwork-Id: 472653 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 080C0C07E9E for ; Fri, 9 Jul 2021 08:17:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E191F613F2 for ; Fri, 9 Jul 2021 08:17:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231569AbhGIIUc (ORCPT ); Fri, 9 Jul 2021 04:20:32 -0400 Received: from mail-eopbgr80084.outbound.protection.outlook.com ([40.107.8.84]:46499 "EHLO EUR04-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231278AbhGIIUc (ORCPT ); Fri, 9 Jul 2021 04:20:32 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Hz5TVEx72H5RCzXdy+8zx8XP7faRTMRtotqTkmk+9phyeLPo0wvMygzsczWp11gwA1ox7FNpgbMMFvxQLxENPSY1cXJ9qJfobCMzi9OC2qtF5tTb3tOhBl9t+YMOpoh1/GUav8yOzwOLDCWoZlz9xDj31MAdv9JORveXmb/8DIIr3ABR7N9IAHp3BoDw4FT9zdpVVIFC30XBEH5lykOqp1bdeKWYCWR1cSzkf+C7jStq0s/qu/FOo/bkhRsP9LRcIJwEoBmJwH5vlaWccvnNgm2yEkgVVWKMN9CIdVaPjVTW2n13wg4N12lutWJfj/px8YZG1FeprsaOue7A4F6E3A== 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-SenderADCheck; bh=8lO0bExdu8zoU/hgPi2gIotbXHcsLGPC1XQ+LkxG4bM=; b=dn6BbygKOK6WRdUU0AJtk9CGy1CR+uDH7WBjs3MvIPVNySpAF8BHLx0LKZ0FrpQdNEjqOsI613s1k8Wg5vBmDrjMa07cXjTZ7KKJFCKJzh0h2Bfeek1G3QtFrfnTOwlSZRT2DvIpn5Q6LullUnb76obSgCUXYGPROUXyO37cF5UvtT5WROkeZOTcf95a/hcqNLok411Qh/6Vhj8sfXL5nzKjjSJvdEBX+IXTdCkbTigVlUTVAwyLfu4xgyK/gycC1VmhodV+ZJK9UIJO+nvdvrJm+EyZqVIkg4fDqDQJH1DXQaOLgH+qfh8l0oRoadsKHqLk+SoVjFdasyxyBJbjKw== 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=8lO0bExdu8zoU/hgPi2gIotbXHcsLGPC1XQ+LkxG4bM=; b=d9Rzs68nKjPH1AJOLc8s3xP9PreD3spOn2I9UrYVCqqoWM7i0U3Z0iXqcGI2e+6wiYf3Kecisu66LPA8RgmBTU2qWvlCffabfeTfEzyz/CXZJ5CqRU+8O3NwrXHqRxeosjGBXP5eVREVE9UNujI4xoJrXmjGoZKO5sWixYLc6HM= Authentication-Results: davemloft.net; dkim=none (message not signed) header.d=none; davemloft.net; dmarc=none action=none header.from=nxp.com; Received: from DB8PR04MB6795.eurprd04.prod.outlook.com (2603:10a6:10:fa::15) by DBBPR04MB6140.eurprd04.prod.outlook.com (2603:10a6:10:c7::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4287.31; Fri, 9 Jul 2021 08:17:46 +0000 Received: from DB8PR04MB6795.eurprd04.prod.outlook.com ([fe80::9c70:fd2f:f676:4802]) by DB8PR04MB6795.eurprd04.prod.outlook.com ([fe80::9c70:fd2f:f676:4802%7]) with mapi id 15.20.4308.023; Fri, 9 Jul 2021 08:17:46 +0000 From: Joakim Zhang To: davem@davemloft.net, kuba@kernel.org, robh+dt@kernel.org, andrew@lunn.ch Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-imx@nxp.com Subject: [PATCH V1 net-next 1/5] dt-bindings: fec: add the missing clocks properties Date: Fri, 9 Jul 2021 16:18:19 +0800 Message-Id: <20210709081823.18696-2-qiangqing.zhang@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210709081823.18696-1-qiangqing.zhang@nxp.com> References: <20210709081823.18696-1-qiangqing.zhang@nxp.com> X-ClientProxiedBy: SG2PR02CA0021.apcprd02.prod.outlook.com (2603:1096:3:17::33) To DB8PR04MB6795.eurprd04.prod.outlook.com (2603:10a6:10:fa::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (119.31.174.71) by SG2PR02CA0021.apcprd02.prod.outlook.com (2603:1096:3:17::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4308.20 via Frontend Transport; Fri, 9 Jul 2021 08:17:43 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 35f48127-8bc3-4da5-8acd-08d942b20822 X-MS-TrafficTypeDiagnostic: DBBPR04MB6140: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1148; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: lxco26P/on/4cT8xXqROAqyum2ORMLwAro+k+GnDMXtj8uelodWT2a9kOsNiS9B/EL2GvNdG5zYyHswY6YmWQ89ws99Rfx27BOkLmDuZeh+RlhlIyqOnXFw/DGIa2SKCtIO+iugrvYYWLUABq31tzciUc9pPoERBqDpubpdF6+sMgFOfjvA/yzWkIXVueKIwlCbXrvl2pLtxDTfpFPD+sYLoCoMqlcqUWlVKKAyU+FWUghbf4nC9VXVR9c/r/qdWjg/0xj3rJSllhN1EfRrfMA3UkRWmax6hfy1p3p71nEFTfl+dwiAQIu17/2MPV+BSg+BenEW7DjydavHqS1smCxcqOtxa3QGS4s2Exah1MviI26CtKAvWmMG+S8wpYUwuln5kbcTvaXd9szhAbvZ+NStr6MyFs47PpOEsUJ++vMCJ7NTJkG+fNAzLyCBdh6FbJcLaTIKWwVlKGS7eb82NM1f8OUofiSeh6lYdONRWVrV//Hr19OLyv/dbGz+4Ei7cmv+xaJGZUusjz1Vu8JFAGpawUwJEe6SmR3C/hTpkpa0AkOf2EGtTKjErIx1257iyvbkdS0Yg0Sih8lmrQ+zOA3/pvHB3KnLwwublwM5vGSYQkGwCwQiAnzhuyKUTaoHx6oF0C22DPMirN8xW88yJitLOD3YCZLCfpXYq52O6eX6o9CNsZDnv6o39HpxAU3FCjwlQU/SdgS/8NL2yVeGO2A== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB8PR04MB6795.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(376002)(136003)(39860400002)(346002)(396003)(478600001)(6506007)(38350700002)(316002)(956004)(8676002)(6666004)(6512007)(66946007)(6486002)(186003)(2616005)(26005)(66556008)(36756003)(8936002)(52116002)(2906002)(38100700002)(1076003)(5660300002)(83380400001)(4326008)(66476007)(86362001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: gJkojbdBHcNYdKVwgqqP1OcK5r/0Jhgo4Mybr/90yk7PZzjVIT3ax8/7FXTayBlK5W+4+AUPBn9oRzmd3OWUfl8dgCGpIyilVOunwYHgbjbZyFpscX1LBu5jxyWbtC9z0tLZZHDP35AzvYxJOsN4ctdnJwCR9jEQiedzkYiiJpKdOloS22upfYQ64xae02pyDeea9QULr5pinCwr++sYyyyDofZ9diPdJLEK6ig7nVPERqu8rtPMHib3zPinbZMMlQ6RBoHET7uj3qiiX0BKJ2Xs5kEawrYIb8TZaQTcMIWU2xYC/VOtsl4hn71PJfvWNVQPBIY6w7o9ryprz+ExwY+Ucg0jzmt/49CFy8XTtBX/hA7a5IBp07SPLQ2pBUFMT3G5MIJYPRquuu+eupt9Pb3lqCT2qy0nGNbn3aT81DOXF0UrwIXxO3Fl1FC7TOSUn/Y0WyO5xtswMtnQCdhEqvbtmIpBFiSfmYDwy1xWpWLgszYkz6cWWIVknpFSO5uiInHD18KTvqqWp0/T9VFUbu8lDH+r4CNS4TjrNWgf32sT6QFE4f8JGBN23fT35sJ/Lz1CqkiWjuYHLRp9zWbuuoMkqhyscOPCtl0CkEIQG0/OPJQ1O/te04rEnk7IstDPmKI1gbXbZ8ck733MbqyOVeZRNK7bkFK5ANntTPF+Kk+7arzIYpjqMvAyJt8C/Z5QCxGvTHHnMt6bI3q0WPGMn3V4NZd+KYUsH5aaz4xcIyyUMwdEvL+smS044eHX9FwDFPaYz1AmVrcmLoHh0ayuurFa6PiwEA2FiJ+2EV8OFn74WFylmk8jK0t0r5rtY8lDQeTWINpbupjTJTHHqzMs9U16bZ9ZQRgUZiRM1Kj0blqyYu5fu6lAvyv84eIs/RgWstjOk3M6eVBsmbwOTeZ7xtTEM/pDhfUx27GIN12GY71WEe1sDImWgavJ6P1Z1eeBUh6XJ6dbZnFN/TZPsVymoxLSj9wuvjHfbpyTzMk5WKLdoCKBTapDvM6bfih6ehPT7QOqtpnWWqK+dXg7ub7gK4vAtdCXZicGOBQjNgmukAQImvJjattqaRrzcWh8l/3+GbsEdaY+G2a3aNTMPcEeuizy2h9CQoIcO4USkxy51k558iQl1RdPuTicCKTuyeALKjQ1uomaQH+8+FwB3bIDnrw4YwxcXrJSDq3NT7bICB5yq5+xdeeJ1Buc53j3BNBkKw194gqXMaNGSn4ispAe8Zfu2g965BocM9za5wi62H7C+ykDWQqnnubq8NAITJ0tIWMP9xaYYF5kl5bWm8LaS4eB33VD9WplAMe8K/7OUXbmRqirbdsOdT7diaGZpeHt X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 35f48127-8bc3-4da5-8acd-08d942b20822 X-MS-Exchange-CrossTenant-AuthSource: DB8PR04MB6795.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jul 2021 08:17:45.9451 (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: RDJtPAQSkpZIB6YyyIOjsktk2R9zlQzptqZtBmOju7ZtwWZUOzL3219O1ibMjXyUNTPLR6FSeMNqbQgf/hKm7g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB6140 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Fugang Duan Both driver and dts have already used these clocks properties, so add the missing clocks info. Signed-off-by: Fugang Duan Signed-off-by: Joakim Zhang --- Documentation/devicetree/bindings/net/fsl-fec.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Documentation/devicetree/bindings/net/fsl-fec.txt b/Documentation/devicetree/bindings/net/fsl-fec.txt index 9b543789cd52..6754be1b91c4 100644 --- a/Documentation/devicetree/bindings/net/fsl-fec.txt +++ b/Documentation/devicetree/bindings/net/fsl-fec.txt @@ -39,6 +39,17 @@ Optional properties: tx/rx queues 1 and 2. "int0" will be used for queue 0 and ENET_MII interrupts. For imx6sx, "int0" handles all 3 queues and ENET_MII. "pps" is for the pulse per second interrupt associated with 1588 precision time protocol(PTP). +- clocks: Phandles to input clocks. +- clock-name: Should be the names of the clocks + - "ipg", for MAC ipg_clk_s, ipg_clk_mac_s that are for register accessing. + - "ahb", for MAC ipg_clk, ipg_clk_mac that are bus clock. + - "ptp"(option), for IEEE1588 timer clock that requires the clock. + - "enet_clk_ref"(option), for MAC transmit/receiver reference clock like + RGMII TXC clock or RMII reference clock. It depends on board design, + the clock is required if RGMII TXC and RMII reference clock source from + SOC internal PLL. + - "enet_out"(option), output clock for external device, like supply clock + for PHY. The clock is required if PHY clock source from SOC. Optional subnodes: - mdio : specifies the mdio bus in the FEC, used as a container for phy nodes From patchwork Fri Jul 9 08:18:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joakim Zhang X-Patchwork-Id: 472226 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DAA98C07E9E for ; Fri, 9 Jul 2021 08:17:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C2B23613C2 for ; Fri, 9 Jul 2021 08:17:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231642AbhGIIUg (ORCPT ); Fri, 9 Jul 2021 04:20:36 -0400 Received: from mail-eopbgr80084.outbound.protection.outlook.com ([40.107.8.84]:6131 "EHLO EUR04-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231605AbhGIIUe (ORCPT ); Fri, 9 Jul 2021 04:20:34 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CYUl89xucj/D+0KkgRMN5Q9j7IhGYXroaMy2qzXrkACatwQb09LWNSGLijbwPbRHHTSdZ5iOPXgc79YliSIKtDiH/XtUF7vfpAC517V2cQ9cuQeiaGs1gyBzWlv3IYdBh/u0wj/P64ZhvCrY2hqGKWrFAERQ9v6JwaMxmKN5VNtKTg3R1hkQu8BsJifxGcP242BNHL8OGxmvYM0NmuLAe3ctoMzCS7srwBfu5NSyixUe3n8jJTo+ynX7vjjjcRi3KUWsYYQ0QuDoqUrboZA6FVF8KetdOETSDfhg9KaNeCoAmMFRj4PK+Qdqd2l/2Y6M3dJaXOjR42BNyYF34ok39Q== 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-SenderADCheck; bh=ke5/7c7ZfiREk8dq3+OmByrM4xqkPJ3/1VXAQItaDTY=; b=GMZtTJN3gzaVhZIHHPPeNERjvt8XKahQSdmQvAQ5mMg+s0LD7hq/qSxeBUvH6g2p8RCo4iUQz2Z9VYQaLMlyOuowsty9U8pvy0GrI89KwCNYKOhjGNOScxVXXSc7GfXWCIMvPVt3U/Y6HJlvMiHHuv4stkpVPTN5ptP5djK7JnWUbtec8T+/EWfq4aD3Qm8KzMT6FKxbTgb/OBXnUradQZYxxCpbpbZGja8zk0BPtPZVtaJhvO1ywiqNNs6IQuxML/VNo5dg51V6GRjgjESus6oLfn84cmWK0hKQi/GObp16k2ZPviZ0xlnpkUSXcIq8KaZAB0RpUx7mZAIwCGk5Yw== 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=ke5/7c7ZfiREk8dq3+OmByrM4xqkPJ3/1VXAQItaDTY=; b=C5cJ9OcTI2+HAs8eJM4kLzruuJ+LqYHrj84/pjHk0YmxSGPrFdVmpkdXCKDrkqIkDMhfDIAXB5DwPWDTHNhXtZ+S+jGRL3utr3Ty8se2nxS5m60dhyY6+COWV9oFcRzpVQ/iw3tOSD4Mdsw+/0scUnb/hqmaRqHuYPCCbQ3LIHE= Authentication-Results: davemloft.net; dkim=none (message not signed) header.d=none; davemloft.net; dmarc=none action=none header.from=nxp.com; Received: from DB8PR04MB6795.eurprd04.prod.outlook.com (2603:10a6:10:fa::15) by DBBPR04MB6140.eurprd04.prod.outlook.com (2603:10a6:10:c7::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4287.31; Fri, 9 Jul 2021 08:17:49 +0000 Received: from DB8PR04MB6795.eurprd04.prod.outlook.com ([fe80::9c70:fd2f:f676:4802]) by DB8PR04MB6795.eurprd04.prod.outlook.com ([fe80::9c70:fd2f:f676:4802%7]) with mapi id 15.20.4308.023; Fri, 9 Jul 2021 08:17:49 +0000 From: Joakim Zhang To: davem@davemloft.net, kuba@kernel.org, robh+dt@kernel.org, andrew@lunn.ch Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-imx@nxp.com Subject: [PATCH V1 net-next 2/5] dt-bindings: fec: add RGMII delayed clock property Date: Fri, 9 Jul 2021 16:18:20 +0800 Message-Id: <20210709081823.18696-3-qiangqing.zhang@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210709081823.18696-1-qiangqing.zhang@nxp.com> References: <20210709081823.18696-1-qiangqing.zhang@nxp.com> X-ClientProxiedBy: SG2PR02CA0021.apcprd02.prod.outlook.com (2603:1096:3:17::33) To DB8PR04MB6795.eurprd04.prod.outlook.com (2603:10a6:10:fa::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (119.31.174.71) by SG2PR02CA0021.apcprd02.prod.outlook.com (2603:1096:3:17::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4308.20 via Frontend Transport; Fri, 9 Jul 2021 08:17:46 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2ebce0d5-bfa8-4d8f-fc44-08d942b209e4 X-MS-TrafficTypeDiagnostic: DBBPR04MB6140: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6430; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hJkQlK+yl1jnVKNva/nH93VJNQ2J7LnNX2X0ZjOuorxdEq0eQ5XC2wcKHEWNfLAHHmjpDQWyeCQRIB6TFLv/Hm1dprKvOLJsoL5ngcJNs52b6vGIBXsYXkIhAHfUVdcP7l7E3f6OMFy38XAC1wOgUxSRzofjY7LJ82WzOXF8KLk6n3xCUqD5F1pSgqHWkvl8OrvzM/WI5TD1oB4WJZ+l6AGxKfBRM7iHbWw1Uz7lhLKvL5L0y+1ga2ezm/WtJoNkWLm3gTt75z+ajsREmZH6AhDyXPf5ciHsAHhdR+4AlMmfc+yGUEqygg6ntzOI369NzevA7hPTC0nxDmOieJi92UfvahnPsoTgT008LiM3lrFQsnCsQsZDnKrVbHoB/JnIRQaJwqTMow6RKSoL6lp7kGUCbvvh68mkTBnqpfYROG8AKrQTEHfTpmtnbXJFlgx3OYgMtScH+iAjmtNfePt2/ooMzJMcCccNnz46zSBBrEdGD8DdH/KDDTN5fTuNadGeIwkax2SaHQ5RkbZE8m7/yZ/wWCzJqMOSsIkPt1nZkbAvvC2Cmx7kBQwnBB2ETuc/PUq8XRLxZj/M8ayh6jgegP5rjCUedR9s0yd6wxpR4Gb05F3AKcG8Kgz0JtDKJrp1alEW4nLsOXFHLZkUqrJiIbJNNVy5FYWWdhBxAizdVk3fvRvk5rrwIsxLbx9vRAjMH8hEtzlB3yonRN+dPKMFMw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB8PR04MB6795.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(376002)(136003)(39860400002)(346002)(396003)(478600001)(6506007)(38350700002)(316002)(956004)(8676002)(6666004)(6512007)(66946007)(6486002)(186003)(2616005)(26005)(66556008)(36756003)(8936002)(52116002)(2906002)(38100700002)(1076003)(5660300002)(83380400001)(4326008)(66476007)(86362001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Tc54sg869qkl129eUNPmIiE5mkA3MqBDJDXqAaxyZIkvcoCifHvTFOKa0MbypsxHLpyO6s19mw/aP4W8hCzBacCdIZw8YS9iSrjE9dicN8aqHcM2ycUbS+yYUN8VqzeMBQ1JrhYbjABZqmfdq335BnLL4hCYrCRer1VQWShuFRirwzQjVEPB+XcJ/2So4FDwmg92+IfLzmqFNAlReQblB3R7AB5wxiYC3ok7gQKYEmFT2ohEJw8B0tBkRDC9HcfuFVj2qowRdzB6FBmPreVQn/Hv1dS690ATFBeHJ3jUFMl21yw+Es6ma2sDVqE3JJ7NVtq7/DJK3uxBDt4rKu/PaKMfHNm2fNx9yITBTI3R+Sz0yKapKW55+dwq63ViRiJwQCNcDQO/gbQXwxGpTy0C+q5J7BTX1tBpBnhvHKY1aPHXx4SdxkfchTjTbzgIPD1k4c9w9B2G8axZ7B6WAKGNgRcUfF2ntDT275bYicFsJ8Hez5AgDTUg8qWQg7KTmj+aXPGbKdLgwltqRV/xt0m02JqzuOweDCjOVJ053QM+zYanSBbHKZv7xHCIn3w7LXJXd+E5FAYRE4H5PGrV5QpNNjV+8Uz0wp3VJNgV9h6pHBi7OZ5AxUJFmoL68UVBsTJ21yCvOZP37C34DJ6adUKW98gT+zHrbrbEuwR2pYqPfP3jks09G/RgA4miwuNS0WXcvCWLvt+iCCz3bgVOoBPxt7lOXcg1J+kHCicjtoVZ3Lpp2LLuDRbeCRx4coWY3a0fmf0Dt5mBLzCWovoEbdaL59q0Me6TKnBAcdKeXx9H/UGfAyr6jYG46b9IT33TI/jx3x9VYvIjVJt1B/++EX/CB3Byc7h3YL8Ti0ZJd0UdT5Ux3lHc7pIYNTVSEEV5ZDoPWIidjqLgtjF080wGGAtdfUzKbQ35O9cua6rl/6mFp28o1ndcjWdLOGGd71KKe+qp/gPbCO86AuchmHgCVurn+yzgQ7Zi81BhzgfiN/BEQCaxTCbLo4zXCz3d5GI4H7NtJwE5YczN2o0LBSLeTFFpJDtTOnIVisRgLAJV5ir25uH7J3umz29UAiJrN9ScXQ/AG9LdjHbNrCdCyt+ZjAuHg1ibb3P2pMew4klFblOORExDyyNHd2o5h9HZypD4jmujeB7bE0J/Rk0ToCy5lVZLhfRebdHJ9mMGIAqbmTsicl1pwDDGbqjKA+0LboZB8/Vv9iXHyG0QlK8hl/C60J/R9FF2zx9WwAH4Y2Yj4ga82A03km5N7OgocESqS2YfKexxGTwjr0NythZ3gZB9SdJubvZ59rILZ6CdwqeJ3yvJggNtck954tw+vahNjXgHt9Hp X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2ebce0d5-bfa8-4d8f-fc44-08d942b209e4 X-MS-Exchange-CrossTenant-AuthSource: DB8PR04MB6795.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jul 2021 08:17:49.0296 (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: i565T3KPvEgzkpNhxPW2pk4oT0M4cvJH5PIKD37CIaiFaDTDjpaUU0ze1ZSOf/8SxQLVkg0SjRxF76wR7Uc+vg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB6140 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Fugang Duan Add property for RGMII delayed clock. Signed-off-by: Fugang Duan Signed-off-by: Joakim Zhang --- Documentation/devicetree/bindings/net/fsl-fec.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Documentation/devicetree/bindings/net/fsl-fec.txt b/Documentation/devicetree/bindings/net/fsl-fec.txt index 6754be1b91c4..f93b9552cfc5 100644 --- a/Documentation/devicetree/bindings/net/fsl-fec.txt +++ b/Documentation/devicetree/bindings/net/fsl-fec.txt @@ -50,6 +50,10 @@ Optional properties: SOC internal PLL. - "enet_out"(option), output clock for external device, like supply clock for PHY. The clock is required if PHY clock source from SOC. + - "enet_2x_txclk"(option), for RGMII sampleing clock which fixed at 250Mhz. + The clock is required if SOC RGMII enable clock delay. +- fsl,rgmii_txc_dly: add RGMII TXC delayed clock from MAC. +- fsl,rgmii_rxc_dly: add RGMII RXC delayed clock from MAC. Optional subnodes: - mdio : specifies the mdio bus in the FEC, used as a container for phy nodes From patchwork Fri Jul 9 08:18:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joakim Zhang X-Patchwork-Id: 472652 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0DF2AC07E9E for ; Fri, 9 Jul 2021 08:17:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E7C9E613CC for ; Fri, 9 Jul 2021 08:17:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231681AbhGIIUj (ORCPT ); Fri, 9 Jul 2021 04:20:39 -0400 Received: from mail-db8eur05on2077.outbound.protection.outlook.com ([40.107.20.77]:51552 "EHLO EUR05-DB8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231624AbhGIIUh (ORCPT ); Fri, 9 Jul 2021 04:20:37 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PM+WysTdq8QWzG4QWuWPFQ84RlkAix6KV76eYqx+YyOPR/tpY0sUMxNbotIK7PzD7iwRp/Kog1k5ktnfVfW0pDvX1Ea5LRNLNQFTlPYE+/PdgGCxTIsdAitm4eR77eSJ5N9Ckp+TB9sDtpIVMS0+txK5dVChpGZzFJddJ3bkLdEXZeuip7USngtuYUiuWXN5TigzQ9IIaHGOUE5ThBrKXF/i5Vj+jRGvzWi9/frThCBJDFbDSLzJXVQz92pnnqKN4v3iLrmDplG5+1B2xgyiYKdt6TY7ZdvxDF+x9XJKRl3MsA1CRhoUcH1Eguq6p1Wa0BeCDqreJ153ABwgtzpSrw== 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-SenderADCheck; bh=dowxi3H2d10pnq22gLlhAyBp00VrgFO4i1zUQZkvSr0=; b=mJPSRWxv+3Ukkx8Gx/dMHGh3qHTOvx6vd5inJbcNHKpg4ZWS6u4NKLVnHSmaaLnf6K5Vc8CNe5aLHmwqzpqSmX8TGZES3Lut5CRJlVndkIA+IvcmmQ5oCDp7KckVt5+Td7Wh5SjXYgZbuGLWqaGnKIeTAJ35c0XEI/ObCpQngsnFTWigrO4zJ8bG/or6GNPG72mLaOLWvr6W6hXDzGNneNhT8n81Q1Rspq6/49//sLXPk0RQd6Zipp/vQewCmSL6nwUtj15pvPgs0FOY7rRkJW3pyH336l0N4kQfAaf8cOom+DAOVwbhDnQPo37LgbCjqm7dkp65dfB/AuellhEH8w== 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=dowxi3H2d10pnq22gLlhAyBp00VrgFO4i1zUQZkvSr0=; b=TXdhVWhJvknWidrhFDPjkpDb7iKsLIZwE7hc66AflnSL1ozwKMdqu4g/gKEubfXpMj56f41jiNJRv6peRGiivp8ey03WbqZfitxjVSK3lHryIQUgb/rQzm3UcZfoVwH1k+8nFee5AhQNWCsnYIY8zg4EsZd9UQx2kYcQ6fqOf3Y= Authentication-Results: davemloft.net; dkim=none (message not signed) header.d=none; davemloft.net; dmarc=none action=none header.from=nxp.com; Received: from DB8PR04MB6795.eurprd04.prod.outlook.com (2603:10a6:10:fa::15) by DB9PR04MB8201.eurprd04.prod.outlook.com (2603:10a6:10:25e::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4308.20; Fri, 9 Jul 2021 08:17:52 +0000 Received: from DB8PR04MB6795.eurprd04.prod.outlook.com ([fe80::9c70:fd2f:f676:4802]) by DB8PR04MB6795.eurprd04.prod.outlook.com ([fe80::9c70:fd2f:f676:4802%7]) with mapi id 15.20.4308.023; Fri, 9 Jul 2021 08:17:52 +0000 From: Joakim Zhang To: davem@davemloft.net, kuba@kernel.org, robh+dt@kernel.org, andrew@lunn.ch Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-imx@nxp.com Subject: [PATCH V1 net-next 3/5] net: fec: add imx8mq and imx8qm new versions support Date: Fri, 9 Jul 2021 16:18:21 +0800 Message-Id: <20210709081823.18696-4-qiangqing.zhang@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210709081823.18696-1-qiangqing.zhang@nxp.com> References: <20210709081823.18696-1-qiangqing.zhang@nxp.com> X-ClientProxiedBy: SG2PR02CA0021.apcprd02.prod.outlook.com (2603:1096:3:17::33) To DB8PR04MB6795.eurprd04.prod.outlook.com (2603:10a6:10:fa::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (119.31.174.71) by SG2PR02CA0021.apcprd02.prod.outlook.com (2603:1096:3:17::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4308.20 via Frontend Transport; Fri, 9 Jul 2021 08:17:49 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7d11209d-8032-4c65-7ee1-08d942b20bc0 X-MS-TrafficTypeDiagnostic: DB9PR04MB8201: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6790; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: esl8pHydNufDkhUK76QWFVATjLiYgaBJe17ffqIFjeP1ulMrF//0MZmdioJwsudSXCRFMnkvnwg61av5FhaMu6t33NsdouhQp0GyGmDwIcgkvqhXEJoazoteGSYFcClTsgB8+4MfDQ2mFVgWFDBDBeuUtXKZQ8rhBdvDlt/SZWPFVVXJfDMJYDXh06BigTfsv7++gWqNIHJbpp54oXv3aw0+z6zwde83y1Q8DWC54N3YLlUqH9KmuoYHKlOua5jhAfHXwlemKxaX55kQg/fOBphEEGXAQkxYRTGzl5S4229VY+HFuzEvou+b2o3FQTbyTIBfN0wvgYvxHVOS7fLy1HGb4JOdkoGxQmoTx3C6g18MPZRIimMO4sKQBL2DhLLKmeGQm8yd/41zoC2iMb35NewKp7WAGLMtfXAVDfYoMOKEvEDzvPHgiVzjjQVR36q8L/qcxk/3MVkQkVXU7U6GocN7QvsagGV3hbR8t1B2quuRRnli2kUPy31Kmgq8bueOfGNNlj1RBkJEh7ytZXeKaSZLUFHGoxHPHCKHGdLz8G78hF5uRgTB4QiJK449EkAi0N39uOvux2yWOSKBNWTVBQEgSPC3VgSn4scf2XPxyqldGvTrBybmnWmSy8e0zAmfaMvn7a0hH3aQkeYnF/U5riHt9ASkEUNUGljIZCbhoMRbDbIsKtu2xtiLRnAXja9E/YEc8blPCqDTdpcmMT5O4WcndEGe6kUvQ5q/0Z7DtFM= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB8PR04MB6795.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(39860400002)(396003)(346002)(376002)(366004)(26005)(86362001)(6666004)(186003)(2616005)(956004)(4326008)(52116002)(5660300002)(83380400001)(38350700002)(38100700002)(316002)(36756003)(8676002)(66476007)(8936002)(6486002)(6506007)(2906002)(66556008)(6512007)(66946007)(1076003)(478600001)(32563001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: cQaGU3GRmLp4coiJikJYMPfHDhOj1eI1K5YuKwZuS1DFfwos19P0SGuil+qYvaAkATIEOO/3dzWhX87scIT+WEr6x93999mXgxxZHJ6fkpbJaHYQtc7eLw08HbNBCfLMUyUWe/Xgf19iI1w5YKjiMpmqdabp7i5UBziV6cidbPwD1hFwFvVs672rNJ+Yl/euSp70abYxNQAiCsh2gOFWwJWB4N3Hlcu63NtayGviNyJZxL5FH7WTO7REaLmSzHBca/dpM2plwXO1Cub3BdLiq8lwZ28MFKnmVryiONnYiuQsjmjunSj6VlOQ/sj+oVWWk9gvmHqfygwd++uL8LNf4DeOTw5JVKjH2UAozN5GwWY8S5H/5BkiVmcpxDTh1BUT6JDtHByf8xFn1NrOPZNeSnWY5DQpoCOYV8Rm6MJtU755n13M/qZmrNh4MWF9SpPmTxqwqW1I3PVEyYY2ZvusxLfMsi5jf2/g+PwLRp2jIFMXEuRbw75oLgQlmRgLGW6hgafRFNijc6ihOi0o9oiK4GHSqTdZ1O8Z2O2cmn+Iqw0op2IH17Q+u/px82bs85Av8rNDwpYcTrNCyIYRur2wg+vsAZTxTADNGc7dRGj/atK/igcc8PW8UcYgqNGXYOKGwIGXf0Mt6KYCwrfhjbBNWOcGNL8uPiUDQnJLOSQxQ2mlkpRXGnMqUzbPxhqxve7o5n81Vfw8pJ11un+k2+yGOipGbG79Hl7DIFruOI7h+yVVz9Wo+QnUR/cFvxsXeHF2y46heE+yottulEnEDi4XpJlkyhFJtDWPCHe/P7GC57I7NlgYDwJnJ6TqQUNauF4i9Kvl4QjynF2r0qz469Rr/7rnGUjf4HLM28WoSdWLVyWpl1KUWP8SWf30/0BuV7nY15H6XdBb3yJp1RkyMM4yljUZF5SvVbl5a91NYUC0EVc0+z5Ts4zKMyx305s+w+mygA5YBDJIoZ9HZsWUO+1yobXpSEghC3SE5d+eO8IiBjHHHB7VtlZspDcDZQyvo2Ul1fYMyavMPhX5Ksc3idjmaqFo0MjVQbssYJxufTi7Lvs2IR16aO2fhvfOZ2lop1NQAuozBb1F2GTTN4E6zk4tmyQ7ksTw9vSaxOt6+lttnNX1ixoP4njizb2uYQPyTlhdlT39cFZALONmjxy/4Xul2Sbh71knD4XZ5nM9a2Hw6KkSfoq3fGgJPqTK5LcnqothZR/SsrrsEymV5WSVCkJDh7D/fGiKUmrup4SkuiPVK4H5jEkTk7jPc5iS6k8fYkRtTtZh8niXYBOgBJMq5coBbELytTMoF5oOY6pUyLy3bmScVGunXnAXaUArLcbBWqJp X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7d11209d-8032-4c65-7ee1-08d942b20bc0 X-MS-Exchange-CrossTenant-AuthSource: DB8PR04MB6795.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jul 2021 08:17:52.0174 (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: 4q6I9Q7VHrRrk/dFARRWRJpzmRdh2JtayFHEaxGpWde5jiylaCAdWZ0xHlynG5iTkSf6rNZt6cSAytZA4GvYRQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB8201 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Fugang Duan The ENET of imx8mq and imx8qm are basically the same as imx6sx, but they have new features support based on imx6sx, like: - imx8mq: supports IEEE 802.3az EEE standard. - imx8qm: supports RGMII mode delayed clock. Signed-off-by: Fugang Duan Signed-off-by: Joakim Zhang --- drivers/net/ethernet/freescale/fec.h | 13 ++++++++++ drivers/net/ethernet/freescale/fec_main.c | 30 +++++++++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/drivers/net/ethernet/freescale/fec.h b/drivers/net/ethernet/freescale/fec.h index 2e002e4b4b4a..c1f93aa79d63 100644 --- a/drivers/net/ethernet/freescale/fec.h +++ b/drivers/net/ethernet/freescale/fec.h @@ -472,6 +472,19 @@ struct bufdesc_ex { */ #define FEC_QUIRK_HAS_MULTI_QUEUES (1 << 19) +/* i.MX8MQ ENET IP version add new feature to support IEEE 802.3az EEE + * standard. For the transmission, MAC supply two user registers to set + * Sleep (TS) and Wake (TW) time. + */ +#define FEC_QUIRK_HAS_EEE (1 << 20) + +/* i.MX8QM ENET IP version add new feture to generate delayed TXC/RXC + * as an alternative option to make sure it works well with various PHYs. + * For the implementation of delayed clock, ENET takes synchronized 250MHz + * clocks to generate 2ns delay. + */ +#define FEC_QUIRK_DELAYED_CLKS_SUPPORT (1 << 21) + struct bufdesc_prop { int qid; /* Address of Rx and Tx buffers */ diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index 8aea707a65a7..dd0b8715e84e 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c @@ -135,6 +135,26 @@ static const struct fec_devinfo fec_imx6ul_info = { FEC_QUIRK_HAS_COALESCE | FEC_QUIRK_CLEAR_SETUP_MII, }; +static const struct fec_devinfo fec_imx8mq_info = { + .quirks = FEC_QUIRK_ENET_MAC | FEC_QUIRK_HAS_GBIT | + FEC_QUIRK_HAS_BUFDESC_EX | FEC_QUIRK_HAS_CSUM | + FEC_QUIRK_HAS_VLAN | FEC_QUIRK_HAS_AVB | + FEC_QUIRK_ERR007885 | FEC_QUIRK_BUG_CAPTURE | + FEC_QUIRK_HAS_RACC | FEC_QUIRK_HAS_COALESCE | + FEC_QUIRK_CLEAR_SETUP_MII | FEC_QUIRK_HAS_MULTI_QUEUES | + FEC_QUIRK_HAS_EEE, +}; + +static const struct fec_devinfo fec_imx8qm_info = { + .quirks = FEC_QUIRK_ENET_MAC | FEC_QUIRK_HAS_GBIT | + FEC_QUIRK_HAS_BUFDESC_EX | FEC_QUIRK_HAS_CSUM | + FEC_QUIRK_HAS_VLAN | FEC_QUIRK_HAS_AVB | + FEC_QUIRK_ERR007885 | FEC_QUIRK_BUG_CAPTURE | + FEC_QUIRK_HAS_RACC | FEC_QUIRK_HAS_COALESCE | + FEC_QUIRK_CLEAR_SETUP_MII | FEC_QUIRK_HAS_MULTI_QUEUES | + FEC_QUIRK_DELAYED_CLKS_SUPPORT, +}; + static struct platform_device_id fec_devtype[] = { { /* keep it for coldfire */ @@ -161,6 +181,12 @@ static struct platform_device_id fec_devtype[] = { }, { .name = "imx6ul-fec", .driver_data = (kernel_ulong_t)&fec_imx6ul_info, + }, { + .name = "imx8mq-fec", + .driver_data = (kernel_ulong_t)&fec_imx8mq_info, + }, { + .name = "imx8qm-fec", + .driver_data = (kernel_ulong_t)&fec_imx8qm_info, }, { /* sentinel */ } @@ -175,6 +201,8 @@ enum imx_fec_type { MVF600_FEC, IMX6SX_FEC, IMX6UL_FEC, + IMX8MQ_FEC, + IMX8QM_FEC, }; static const struct of_device_id fec_dt_ids[] = { @@ -185,6 +213,8 @@ static const struct of_device_id fec_dt_ids[] = { { .compatible = "fsl,mvf600-fec", .data = &fec_devtype[MVF600_FEC], }, { .compatible = "fsl,imx6sx-fec", .data = &fec_devtype[IMX6SX_FEC], }, { .compatible = "fsl,imx6ul-fec", .data = &fec_devtype[IMX6UL_FEC], }, + { .compatible = "fsl,imx8mq-fec", .data = &fec_devtype[IMX8MQ_FEC], }, + { .compatible = "fsl,imx8qm-fec", .data = &fec_devtype[IMX8QM_FEC], }, { /* sentinel */ } }; MODULE_DEVICE_TABLE(of, fec_dt_ids); From patchwork Fri Jul 9 08:18:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joakim Zhang X-Patchwork-Id: 472225 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5AB8EC07E99 for ; Fri, 9 Jul 2021 08:18:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3C23B613C2 for ; Fri, 9 Jul 2021 08:18:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231720AbhGIIUm (ORCPT ); Fri, 9 Jul 2021 04:20:42 -0400 Received: from mail-db8eur05on2087.outbound.protection.outlook.com ([40.107.20.87]:56129 "EHLO EUR05-DB8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231684AbhGIIUk (ORCPT ); Fri, 9 Jul 2021 04:20:40 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cib67fFCnDdxa3EbJOw+jShiPuIJasNDvs/JHlsh2vmaj+8UKm2hubuaJcr5UpN6xaVFKVpDAslZ5wuO8jjmE2KTJY+Dze/fGcx2U6wSqWCXNMdJYKYNsdoOqRHQW9e6QzuYImjJ/joxDP8KV1Fdr6MxAKy9GNsGxDwNe0Wpcy6jjhV1dVIDrBb/0OmgK0EmXoZYEKSh36SbUXfBViAHKsQ5g9tnT0vEZwSNXkStSLzhIO9gQlMOsZbN7IlgFEJ26KNeBnfMGTX1hFfxg5XFeJTYl9ccER6E45jtOhmMIY9nE4gBs7/D2rSZ2pcPxv45+8JzzjHQ9udhi3oZuIOfew== 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-SenderADCheck; bh=N/lfHjh69y4ElIGDzDssEW85yMAGE7V4j6ojsyR+3I0=; b=IaMaS5rB69e+sfZQU+0jFOmYBukG9cxUAoTKiJA731i3+kPqyTLQ6TLP6IUYFaJtG0OZI8JfAzegxfn//o+BaJGU1+WU952B4BTURmwQuvxfjt088PFGmfILm3hDVVqJic2L8rWu1bYpmZ6JDQW7XfpofpP9unOmtC9hSsMW+RLaXGCIHNyGiAt5b/e0ltdJ5yHfs5P+2G+dxuWadCUT482M2zKjJMDA3E7pv1eNdsyZl1S8dFkmD8H9dGGDBKI9r4oRUZvTvKcYAO3IRCiSQkq1xx4h+HU+hr1ZXTnDdxiM5qtBsYfcXFSirhtfrAb02P/r7PKmOqNiuZ2i1N4pNg== 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=N/lfHjh69y4ElIGDzDssEW85yMAGE7V4j6ojsyR+3I0=; b=eyd34yOyYKvUFRqOsrqU6aixVqrntIbpu5vezwuMWn9XN9CPVkA3FaLAd7i5KjAQ9KGRZ6Ni11c+xkBhwuxhkf8RwpbU6Z6Vz+zJ2zRaGWfwrNRHo4MaUzdlQgq0E3F9h5CwmJAf61WWCZetADCsgAsKx1vcJgyga9VgghYPjI0= Authentication-Results: davemloft.net; dkim=none (message not signed) header.d=none; davemloft.net; dmarc=none action=none header.from=nxp.com; Received: from DB8PR04MB6795.eurprd04.prod.outlook.com (2603:10a6:10:fa::15) by DBAPR04MB7240.eurprd04.prod.outlook.com (2603:10a6:10:1af::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4308.21; Fri, 9 Jul 2021 08:17:55 +0000 Received: from DB8PR04MB6795.eurprd04.prod.outlook.com ([fe80::9c70:fd2f:f676:4802]) by DB8PR04MB6795.eurprd04.prod.outlook.com ([fe80::9c70:fd2f:f676:4802%7]) with mapi id 15.20.4308.023; Fri, 9 Jul 2021 08:17:55 +0000 From: Joakim Zhang To: davem@davemloft.net, kuba@kernel.org, robh+dt@kernel.org, andrew@lunn.ch Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-imx@nxp.com Subject: [PATCH V1 net-next 4/5] net: fec: add eee mode tx lpi support Date: Fri, 9 Jul 2021 16:18:22 +0800 Message-Id: <20210709081823.18696-5-qiangqing.zhang@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210709081823.18696-1-qiangqing.zhang@nxp.com> References: <20210709081823.18696-1-qiangqing.zhang@nxp.com> X-ClientProxiedBy: SG2PR02CA0021.apcprd02.prod.outlook.com (2603:1096:3:17::33) To DB8PR04MB6795.eurprd04.prod.outlook.com (2603:10a6:10:fa::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (119.31.174.71) by SG2PR02CA0021.apcprd02.prod.outlook.com (2603:1096:3:17::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4308.20 via Frontend Transport; Fri, 9 Jul 2021 08:17:52 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2e36afef-77f9-46dc-4e74-08d942b20d84 X-MS-TrafficTypeDiagnostic: DBAPR04MB7240: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2657; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: S8JuY7D5p6LjwKSJhX8+CO4Uzueob6NXovwdBAYgk4bu6OYzVeZAviWsMY8P8JU7nMqKp8LDssITIIQ/k74HQnz4Ro/b1BmKSiDXGIarorxBSJl4yJorjdfueJMHpHw7A9HOSabQUeMAUI/HLTvYchi8gFSg1QJgydcphcD98xMUIiB91Ml05Rc+1LDCBm2TsziOjzg7C/PSZxNVT0EUMVyVyolsQ9F+sKedsu3rvzGd3VFBD2z++/Q/Dkk8J5tfx/8+jZ6N4LLOfpED1KErXmuZZ4uahdzkHmjaHsxCQyaslso9h/8vcz4kdDQd1JWQMK1YXpNRnZLMm8MatH3XVNYkpepcqGU7EAC7P00WVe7/4ZQB+zk58ohlIQYv5tZnDve91NWnRQs3suig+mcndRoz2ei6gPPGmlohk8i8uEl/ZmXwPWsxOX1bwsIZOGNvPurfjZnMuvRMPifD38QSaNpoGnjs3LKfQGZtQKoRmcCpBT7LxjJdzJQuZV0pvt9MfOD0eTdyyScXUt81nsPkIvvMAeG0ikXkeawTciRMfA2nwgeSoeyESoA/5kRvivLMT8s4lMN59c7xU5JeoGlOg98Xgeaa4AX3kDbwc1NBsFWBlTOUmfmvC9raGqgu3QbZvdfaurVgWBm7dXvsAhbToHs96u64AzBEVUXzxVUY36UgHcurugEOy2++RkoVvEt8fG7/vLc85q+26FoyQ/oB+w== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB8PR04MB6795.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(346002)(39860400002)(136003)(376002)(396003)(366004)(38100700002)(38350700002)(52116002)(6506007)(26005)(86362001)(186003)(83380400001)(36756003)(5660300002)(2616005)(8676002)(6512007)(6666004)(8936002)(66476007)(478600001)(66556008)(316002)(4326008)(956004)(66946007)(6486002)(1076003)(2906002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 4d+Yzh2xvyUhaA9MbFMYptsH0z1OSUa80s5ARyEz2Hb+XbTBVj1/isxZojORwDH4Io2TYARN4gCY/NMnoSHcbSz1o3ivcUb7eJkPU7OAAYl/0tbytVp9mIIyrBJvzIUzCl0mESuGVAXChyT7u/NsCD30cVvN/88Dafy+rXde4xe/1mxJEULVoPcfNPD6gyQ548jE3Wk53pKlmoEAMpUxJIRvMVtSCAV9x/Qr69R4eXEHJlwNhYuIcOoo0lxvn439ugK3MMEaBFEXEmMPlqDO2REjemG7yOSy+XMm0wU9xUS210bXqyDe91gsg8sbhWrKqe255QhcbDGFgagjJ9n0RZbyinowuLDjTqMiQ6VNR3vMUiuarpOeXM5BZpEb5s369W6s/+swDD0yqWKtZs+YRoqePYf66nsIXs7dEKiFwemP+leGOnu9WuG50g5HhE4P3Kk4DfuiFrmbBTGzDd4vbfzNNzBrKCPgyrytRWtV616nDU+TQJzG7t5u5LK+T2YzC6nO56YSpwuVtNW4lNytUO1miwOPWxFjszq61wsCRC06dIKuvNKmmaz7eo4vA+r4eCAfnc0LYu4i/PnVItxySwpN53vlMdcRu7QrHTwt/tjijWOcpiDPkj/AEsHATC8m6/k/CYm3bQTl6SA2rYmPUyxlqjIC62H7RAmgQ1gzZWcsyiq8cWHORcMp9IhASdWU812+M6hFjJRaQsL3RI3JNWjdtFgZhJIH7U531apn3iluQYpNkVqM6W4i0KCAk+M9Rr0nd4ksfP8CU9c2PFfaXCEkN22pqF+VKxjJTMVDN/QPC/XtrwPLJSRC1zFGpJAPsO+tDeLUI+3M8UnLVgxZpOE7ea1fcGAJ/iy3Uj2TPjEr3x54tT+UVkUJnWxmWggFlZP/r0teTyIk+dcIh/C4aigQWhmDvPUWUGonF3a2bEbfvwRGoNTF2XIXdZdmA9MG5AQUwAZ3+PPjBLwDoVyXCVsYM0EPl2u0+Q9ulfVLX++olb1iBWBXrWDdcXwd9+oS/QJrscWmDBPXTkY2lfZT6DxhhDvRGei031WZ6RbFVlyk13N09VaYKjROkClBUc91PeSbdwgGwh6gD+CeY56bwcjgtI3HrxkYj+DzfiMSyZHYns1ZolnpBcP4ys+6Zj7jKcC+vwQLMlEDKxSv+GnoZSfUTiBUvlGJ18coJt0d5bNqVJ4AKsqoHE1tuKy1Ipume96f72GRIdPFh3revvukdP9WFtuM6o8RQBnSZPnjVdWu0zL6oLCWLFtkgg/+VqTrAzbzoPHszPNBGHnHkconI68cG5ULZeAbuiXFQ3AMdUkH3ReSGyx3mYyJVrx7pBAh X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2e36afef-77f9-46dc-4e74-08d942b20d84 X-MS-Exchange-CrossTenant-AuthSource: DB8PR04MB6795.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jul 2021 08:17:55.0153 (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: Gyj5dR5MJKuooP0omiIMatZxOB5nBvPmV+UphS6l1ZbLMOfImbx80ite5q5uAG/+jZIKO8CTLHbNLcHJ2j1CIw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR04MB7240 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Fugang Duan The i.MX8MQ ENET version support IEEE802.3az eee mode, add eee mode tx lpi enable to support ethtool interface. usage: 1. set sleep and wake timer to 5ms: ethtool --set-eee eth0 eee on tx-lpi on tx-timer 5000 2. check the eee mode: ~# ethtool --show-eee eth0 EEE Settings for eth0: EEE status: enabled - active Tx LPI: 5000 (us) Supported EEE link modes: 100baseT/Full 1000baseT/Full Advertised EEE link modes: 100baseT/Full 1000baseT/Full Link partner advertised EEE link modes: 100baseT/Full Note: For realtime case and IEEE1588 ptp case, it should disable EEE mode. Signed-off-by: Fugang Duan Signed-off-by: Joakim Zhang --- drivers/net/ethernet/freescale/fec.h | 6 ++ drivers/net/ethernet/freescale/fec_main.c | 89 +++++++++++++++++++++++ 2 files changed, 95 insertions(+) diff --git a/drivers/net/ethernet/freescale/fec.h b/drivers/net/ethernet/freescale/fec.h index c1f93aa79d63..0a741bc440e4 100644 --- a/drivers/net/ethernet/freescale/fec.h +++ b/drivers/net/ethernet/freescale/fec.h @@ -77,6 +77,8 @@ #define FEC_R_DES_ACTIVE_2 0x1e8 /* Rx descriptor active for ring 2 */ #define FEC_X_DES_ACTIVE_2 0x1ec /* Tx descriptor active for ring 2 */ #define FEC_QOS_SCHEME 0x1f0 /* Set multi queues Qos scheme */ +#define FEC_LPI_SLEEP 0x1f4 /* Set IEEE802.3az LPI Sleep Ts time */ +#define FEC_LPI_WAKE 0x1f8 /* Set IEEE802.3az LPI Wake Tw time */ #define FEC_MIIGSK_CFGR 0x300 /* MIIGSK Configuration reg */ #define FEC_MIIGSK_ENR 0x308 /* MIIGSK Enable reg */ @@ -602,6 +604,10 @@ struct fec_enet_private { unsigned int tx_time_itr; unsigned int itr_clk_rate; + /* tx lpi eee mode */ + struct ethtool_eee eee; + unsigned int clk_ref_rate; + u32 rx_copybreak; /* ptp clock period in ns*/ diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index dd0b8715e84e..24082b3f2118 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c @@ -2722,6 +2722,92 @@ static int fec_enet_set_tunable(struct net_device *netdev, return ret; } +/* LPI Sleep Ts count base on tx clk (clk_ref). + * The lpi sleep cnt value = X us / (cycle_ns). + */ +static int fec_enet_us_to_tx_cycle(struct net_device *ndev, int us) +{ + struct fec_enet_private *fep = netdev_priv(ndev); + + return us * (fep->clk_ref_rate / 1000) / 1000; +} + +static int fec_enet_eee_mode_set(struct net_device *ndev, bool enable) +{ + struct fec_enet_private *fep = netdev_priv(ndev); + struct ethtool_eee *p = &fep->eee; + unsigned int sleep_cycle, wake_cycle; + int ret = 0; + + if (enable) { + ret = phy_init_eee(ndev->phydev, 0); + if (ret) + return ret; + + sleep_cycle = fec_enet_us_to_tx_cycle(ndev, p->tx_lpi_timer); + wake_cycle = sleep_cycle; + } else { + sleep_cycle = 0; + wake_cycle = 0; + } + + p->tx_lpi_enabled = enable; + p->eee_enabled = enable; + p->eee_active = enable; + + writel(sleep_cycle, fep->hwp + FEC_LPI_SLEEP); + writel(wake_cycle, fep->hwp + FEC_LPI_WAKE); + + return 0; +} + +static int +fec_enet_get_eee(struct net_device *ndev, struct ethtool_eee *edata) +{ + struct fec_enet_private *fep = netdev_priv(ndev); + struct ethtool_eee *p = &fep->eee; + + if (!(fep->quirks & FEC_QUIRK_HAS_EEE)) + return -EOPNOTSUPP; + + if (!netif_running(ndev)) + return -ENETDOWN; + + edata->eee_enabled = p->eee_enabled; + edata->eee_active = p->eee_active; + edata->tx_lpi_timer = p->tx_lpi_timer; + edata->tx_lpi_enabled = p->tx_lpi_enabled; + + return phy_ethtool_get_eee(ndev->phydev, edata); +} + +static int +fec_enet_set_eee(struct net_device *ndev, struct ethtool_eee *edata) +{ + struct fec_enet_private *fep = netdev_priv(ndev); + struct ethtool_eee *p = &fep->eee; + int ret = 0; + + if (!(fep->quirks & FEC_QUIRK_HAS_EEE)) + return -EOPNOTSUPP; + + if (!netif_running(ndev)) + return -ENETDOWN; + + p->tx_lpi_timer = edata->tx_lpi_timer; + + if (!edata->eee_enabled || !edata->tx_lpi_enabled || + !edata->tx_lpi_timer) + ret = fec_enet_eee_mode_set(ndev, false); + else + ret = fec_enet_eee_mode_set(ndev, true); + + if (ret) + return ret; + + return phy_ethtool_set_eee(ndev->phydev, edata); +} + static void fec_enet_get_wol(struct net_device *ndev, struct ethtool_wolinfo *wol) { @@ -2782,6 +2868,8 @@ static const struct ethtool_ops fec_enet_ethtool_ops = { .set_tunable = fec_enet_set_tunable, .get_wol = fec_enet_get_wol, .set_wol = fec_enet_set_wol, + .get_eee = fec_enet_get_eee, + .set_eee = fec_enet_set_eee, .get_link_ksettings = phy_ethtool_get_link_ksettings, .set_link_ksettings = phy_ethtool_set_link_ksettings, .self_test = net_selftest, @@ -3722,6 +3810,7 @@ fec_probe(struct platform_device *pdev) fep->clk_ref = devm_clk_get(&pdev->dev, "enet_clk_ref"); if (IS_ERR(fep->clk_ref)) fep->clk_ref = NULL; + fep->clk_ref_rate = clk_get_rate(fep->clk_ref); fep->bufdesc_ex = fep->quirks & FEC_QUIRK_HAS_BUFDESC_EX; fep->clk_ptp = devm_clk_get(&pdev->dev, "ptp"); From patchwork Fri Jul 9 08:18:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joakim Zhang X-Patchwork-Id: 472651 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0457DC07E9E for ; Fri, 9 Jul 2021 08:18:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E370A613CF for ; Fri, 9 Jul 2021 08:18:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231747AbhGIIUo (ORCPT ); Fri, 9 Jul 2021 04:20:44 -0400 Received: from mail-db8eur05on2066.outbound.protection.outlook.com ([40.107.20.66]:29408 "EHLO EUR05-DB8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231701AbhGIIUm (ORCPT ); Fri, 9 Jul 2021 04:20:42 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eDROowuCTnrci5mQWnQ4DomMvpkl1aVmZfpjglYf8CfUVXwUmwWkNA43LRl/szNvvaVzLHfFKsu2hyWNsfiR7uuNd0MgQNL7mll/edrA9AHwy6rOn++UP8C25ubnlCgmRmShnXzrwcJsXHDUy0iU7lbrTOlyX1L9z2FtC/YjsbSYbE0qNLWQz9/mfm+wcgeTqxIbpGmksGyAsRfIeb56yunMfy4y6vUVU1hUjiDq8ERaapyUizIU3jxtGuz8TPUtHQuL8clMqDtmIpbAy/jDmAa3RoQbpi6M1YlhG9iy86Y8Y32C5te/KJThdXOK4QUUFyC03CK4u8SRRHRXcyE1UQ== 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-SenderADCheck; bh=kweURP6Gz/VziteuUY8Ennqc9aDvjbgDQe6WbvrroNY=; b=K/zXi0woZBWWKlos7OcVdnTP7iaC+NM0gZVHDfpZJtzCM3lcmMV007vYcv7j6o1aQIYjiRB41Q/bEggF8Yvuj9qL5xa6+QFyznxICLyrWk7ZOJlpqVVSxP2JV3h2xXq0G4qk4C4aohGaWQ18eQQL9aAqaIjmfwlxK/SE8AgvF8GEqWlDnxHw3+9Dq4D2lsuTIdutgxjku+y+LeQXiHn4bzFtf1v6YnBos8rYj0P47QtNv5/w+5tPlI47d76ICPhGpXFi4+RtBAL9iGHqk7L1Ur3uZ0idR0OLNgiAw4YpOzY7HbHUPw3SdbfsidmWmJXol3ISKr2usw0R8KjuJxIL7Q== 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=kweURP6Gz/VziteuUY8Ennqc9aDvjbgDQe6WbvrroNY=; b=FxcjbE9caY5rd91E8EXgLmnvrb2/FpbquSIpeDy8Q1SUm3gM8WCanZpXTGjHKmHOFcj3ZGCwVDfzGJUOV9LPgj0hkpmZpaqd22j+3WOSFBr06fg+D+BAiXN1GVpvVJYjxHthkweD9WqWCRkVEDQG+089YSMDt6yS5Hvbe7Cyz3s= Authentication-Results: davemloft.net; dkim=none (message not signed) header.d=none; davemloft.net; dmarc=none action=none header.from=nxp.com; Received: from DB8PR04MB6795.eurprd04.prod.outlook.com (2603:10a6:10:fa::15) by DB9PR04MB8201.eurprd04.prod.outlook.com (2603:10a6:10:25e::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4308.20; Fri, 9 Jul 2021 08:17:58 +0000 Received: from DB8PR04MB6795.eurprd04.prod.outlook.com ([fe80::9c70:fd2f:f676:4802]) by DB8PR04MB6795.eurprd04.prod.outlook.com ([fe80::9c70:fd2f:f676:4802%7]) with mapi id 15.20.4308.023; Fri, 9 Jul 2021 08:17:58 +0000 From: Joakim Zhang To: davem@davemloft.net, kuba@kernel.org, robh+dt@kernel.org, andrew@lunn.ch Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-imx@nxp.com Subject: [PATCH V1 net-next 5/5] net: fec: add MAC internal delayed clock feature support Date: Fri, 9 Jul 2021 16:18:23 +0800 Message-Id: <20210709081823.18696-6-qiangqing.zhang@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210709081823.18696-1-qiangqing.zhang@nxp.com> References: <20210709081823.18696-1-qiangqing.zhang@nxp.com> X-ClientProxiedBy: SG2PR02CA0021.apcprd02.prod.outlook.com (2603:1096:3:17::33) To DB8PR04MB6795.eurprd04.prod.outlook.com (2603:10a6:10:fa::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (119.31.174.71) by SG2PR02CA0021.apcprd02.prod.outlook.com (2603:1096:3:17::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4308.20 via Frontend Transport; Fri, 9 Jul 2021 08:17:55 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a3cabebf-161d-4aa2-27c9-08d942b20f4b X-MS-TrafficTypeDiagnostic: DB9PR04MB8201: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2399; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: F//q+vycfqBsak8hqZJC2lYj8Z3BwBTV/wZ4EYiT8k1r+q5edIrROhqBWppEaqlZweR86a5f8J/bBShXYAg6HrRENWoF54qCnd0sNN1h8K1JoWwftuAnuWPkpRU4IU+nDVVbLKcUiHrGNFbaxEppY/AaDuSLw3hP/phlQsw2+fXgjsi4qoOE/nasTxxy3qBcKL4xhqzNy8cIUyQHv9d1llB6nGDkuc5Am8cbe6ohXnx3OsMHTxn++8IgF7X1kcJ0neA9v/2QGjF5pzFzFvjoxmCFxPnjPON5kuoI/lv0foYhIlad7i77yXuEbih8OJJ+NpmaHqiqP+v+L4VGMxloIkE4jW2zODi6grL9lQQZBszM9p+UX92hmbz5ZLESbVS+IaIQNELW7xxAFfhOQzVDKvyDZ28uMozXcwWydLS51FrLhpt0/DUbCUN6MPKVA+2bFWIquNv/nAHiD3rLhKxFFQvwDcqieQGYetJAGz9O+SZvwuxuVf0aRF1pLEksdX+bFPoC7D9YX1Kjl9rwGgOVhaobHS05VRP/WHlkm77za30L/VIWl7Qq5Z2iETb0EfP/fqNAUI68jyPIKbVrNL12YY34tnMamp+uiSjiRZd3KE+QBRuFKz2YWgdzDg/VVoe0yVPDe3XhdGISuHwhEJ/NGksCs8yO13ijmW1b5+PQGDhfiSN5eYoAWRunvTSpIGTRuWuPMTK1sXUTYnTqPxYnJw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB8PR04MB6795.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(39860400002)(396003)(346002)(376002)(366004)(26005)(86362001)(6666004)(186003)(2616005)(956004)(4326008)(52116002)(5660300002)(83380400001)(38350700002)(38100700002)(316002)(36756003)(8676002)(66476007)(8936002)(6486002)(6506007)(2906002)(66556008)(6512007)(66946007)(1076003)(478600001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: TISweeSNp9cBQwlRQIeregS4fyTIBPVp3ule5zMjI6RN/C/jQppUy9g3R6+H7hTk/Egc/LfSKaoO9+9NDMNm4CiXb0ob2niLVxNnFBA3AvoNFumX6jx6LQm9sxTaSFXjsTwKVvBGpDuLqzl5xukoTLcHHDAberdH4P+CNBdeqRP16CgkmiKieJ5nacXrsuZeeVQRusARDGskV3jRX4MXvtDzizS5oS+AbPmZigvKq1sUmKLyAdT08xzV/VWdaJNV2LNgpqJbg7+flIgixAtyJrxjiWgeY8JS8cY+UoUmn0iNAxvRxPmp38TqPwajYQ2hBvHeeunyJbNs7n9P0ZR4AeHSvOWWFNknBqsmXqPiL+yCa21OaOswgDv9mP/ypMMmdSAV3f1cv/alKxDi724QG9jyzmeXDw6h3m92BE/CFhCH6LPz6kbfyhPpHc5AzVSbrehQYqVhKvp01i/TGgpIBtaWv+xe5su04C+hfs1eYzOUdGASaV4kVGylx0VInBE6Zv1O1ICtJqIOgdH86Nh/rwpvVQfSIxHJqWozfzR/NJP4v6yecl01Gw3Dfn0wVyVg/aHsbD3HSm40KRQoJsHzO414USUbwVBFPRcOJTBCi91eCzY1SsAoo3tybI6QB3MoW9yE58g4t1YjY4+uD/gKG8HY3KJo7xHDrAKva0KSFe9KwhGbHk/fqNMIuPJPD7oXoPK+gRY0rkIklt8S605P7AeqhT3+lCoaXnNzE5IlRSq4VPdpABDjxy3Da9ZuRzJR6yPL/TXP8GUjONqmBx12no53t4ynChZSX8K3QPZm9aD/rct+6Ic01hoesTj1rLzjUNp6lFO0Fr17eR0YrD2r/f438dcCDxSYJKBMqtjL/a3KkRzJuoTxiR62YsyqmXJ45lQLYkr1l+aqYstzdr/NRg8Nbjqa9C7GSgrL/TCgIPuvNYVelgzmoJuhzRhfeUBrD5a3B67KRjTKvNKityQYjpPZ24bK5Cr5be4YJ5GtPX23KSFHr9m8FratQA4Ok0h0/nLjPVuyzaoaqalUvGCMKcLb6J7ZGDNVXOxMLt9zhI7jVOXb2n7Pge8Zyo3s281daA/QbzboEwMPcHj/snaNKliQveP6Yhf7MejeQ/gcdQRMCaKAe6Y1aWeksxpNpth7Zf69uuRBWH4vfPy1Lzs7hxzaJHXVzQPqlaKJBVMPkM1E4d3tepbS3EvdW8eTaGGli6U7f3mMEOKIeiIu46ilYLe7FNk7GHLql1w/PQeygSIar/jXoYFUkf53NvGWTOu2SP5bg+BmUHhyViQ0RQoZKQ0LIgkn/ZHZsBXdaxonKXXe5WJwp+dpa2Ucwr609Y78 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: a3cabebf-161d-4aa2-27c9-08d942b20f4b X-MS-Exchange-CrossTenant-AuthSource: DB8PR04MB6795.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jul 2021 08:17:58.0081 (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: 8GBuPllJ9wjyIIZGuDwwivneUatZRLrb/SL+d85TBhYSYeYJX9nFsEq8t2B4WYBJu5oW6NN22KkajJ9BDhu7Qg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB8201 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Fugang Duan i.MX8QM ENET IP version support timing specification that MAC integrate clock delay in RGMII mode, the delayed TXC/RXC as an alternative option to work well with various PHYs. Signed-off-by: Fugang Duan Signed-off-by: Joakim Zhang --- drivers/net/ethernet/freescale/fec.h | 6 ++++++ drivers/net/ethernet/freescale/fec_main.c | 26 +++++++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/drivers/net/ethernet/freescale/fec.h b/drivers/net/ethernet/freescale/fec.h index 0a741bc440e4..ae3259164395 100644 --- a/drivers/net/ethernet/freescale/fec.h +++ b/drivers/net/ethernet/freescale/fec.h @@ -381,6 +381,9 @@ struct bufdesc_ex { #define FEC_DEFAULT_IMASK (FEC_ENET_TXF | FEC_ENET_RXF) #define FEC_RX_DISABLED_IMASK (FEC_DEFAULT_IMASK & (~FEC_ENET_RXF)) +#define FEC_ENET_TXC_DLY ((uint)0x00010000) +#define FEC_ENET_RXC_DLY ((uint)0x00020000) + /* ENET interrupt coalescing macro define */ #define FEC_ITR_CLK_SEL (0x1 << 30) #define FEC_ITR_EN (0x1 << 31) @@ -543,6 +546,7 @@ struct fec_enet_private { struct clk *clk_ref; struct clk *clk_enet_out; struct clk *clk_ptp; + struct clk *clk_2x_txclk; bool ptp_clk_on; struct mutex ptp_clk_mutex; @@ -565,6 +569,8 @@ struct fec_enet_private { uint phy_speed; phy_interface_t phy_interface; struct device_node *phy_node; + bool rgmii_txc_dly; + bool rgmii_rxc_dly; int link; int full_duplex; int speed; diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index 24082b3f2118..18ab60322688 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c @@ -1137,6 +1137,13 @@ fec_restart(struct net_device *ndev) if (fep->bufdesc_ex) ecntl |= (1 << 4); + if (fep->quirks & FEC_QUIRK_DELAYED_CLKS_SUPPORT && + fep->rgmii_txc_dly) + ecntl |= FEC_ENET_TXC_DLY; + if (fep->quirks & FEC_QUIRK_DELAYED_CLKS_SUPPORT && + fep->rgmii_rxc_dly) + ecntl |= FEC_ENET_RXC_DLY; + #ifndef CONFIG_M5272 /* Enable the MIB statistic event counters */ writel(0 << 31, fep->hwp + FEC_MIB_CTRLSTAT); @@ -2000,6 +2007,10 @@ static int fec_enet_clk_enable(struct net_device *ndev, bool enable) if (ret) goto failed_clk_ref; + ret = clk_prepare_enable(fep->clk_2x_txclk); + if (ret) + goto failed_clk_2x_txclk; + fec_enet_phy_reset_after_clk_enable(ndev); } else { clk_disable_unprepare(fep->clk_enet_out); @@ -2010,10 +2021,14 @@ static int fec_enet_clk_enable(struct net_device *ndev, bool enable) mutex_unlock(&fep->ptp_clk_mutex); } clk_disable_unprepare(fep->clk_ref); + clk_disable_unprepare(fep->clk_2x_txclk); } return 0; +failed_clk_2x_txclk: + if (fep->clk_ref) + clk_disable_unprepare(fep->clk_ref); failed_clk_ref: if (fep->clk_ptp) { mutex_lock(&fep->ptp_clk_mutex); @@ -3761,6 +3776,12 @@ fec_probe(struct platform_device *pdev) if (ret) goto failed_stop_mode; + if (of_get_property(np, "fsl,rgmii_txc_dly", NULL)) + fep->rgmii_txc_dly = true; + + if (of_get_property(np, "fsl,rgmii_rxc_dly", NULL)) + fep->rgmii_rxc_dly = true; + phy_node = of_parse_phandle(np, "phy-handle", 0); if (!phy_node && of_phy_is_fixed_link(np)) { ret = of_phy_register_fixed_link(np); @@ -3812,6 +3833,11 @@ fec_probe(struct platform_device *pdev) fep->clk_ref = NULL; fep->clk_ref_rate = clk_get_rate(fep->clk_ref); + /* clk_2x_txclk is optional, depends on board */ + fep->clk_2x_txclk = devm_clk_get(&pdev->dev, "enet_2x_txclk"); + if (IS_ERR(fep->clk_2x_txclk)) + fep->clk_2x_txclk = NULL; + fep->bufdesc_ex = fep->quirks & FEC_QUIRK_HAS_BUFDESC_EX; fep->clk_ptp = devm_clk_get(&pdev->dev, "ptp"); if (IS_ERR(fep->clk_ptp)) {