From patchwork Fri Mar 12 17:43:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Hancock X-Patchwork-Id: 12135595 X-Patchwork-Delegate: kuba@kernel.org 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=-18.7 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,URIBL_BLOCKED,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 B41E4C4332B for ; Fri, 12 Mar 2021 17:44:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9324564F0D for ; Fri, 12 Mar 2021 17:44:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232613AbhCLRo3 (ORCPT ); Fri, 12 Mar 2021 12:44:29 -0500 Received: from mx0c-0054df01.pphosted.com ([67.231.159.91]:7152 "EHLO mx0c-0054df01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229959AbhCLRny (ORCPT ); Fri, 12 Mar 2021 12:43:54 -0500 Received: from pps.filterd (m0208999.ppops.net [127.0.0.1]) by mx0c-0054df01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 12CHbor4013654; Fri, 12 Mar 2021 12:43:51 -0500 Received: from can01-qb1-obe.outbound.protection.outlook.com (mail-qb1can01lp2059.outbound.protection.outlook.com [104.47.60.59]) by mx0c-0054df01.pphosted.com with ESMTP id 376besa2yf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 12 Mar 2021 12:43:50 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=e+ZUET0qRVTMM97cqKVRYFqPzzZ/4RH73ijAH5bWshtvC4vK7ZcfMDWuD3Y6FU3mOZAuEY4kULkfjdlTw6TTy4MU3eswURdervsIFu2h4jYhER4p6uyO9ry4A++qzGRymq7fCUE1fBOqRbfHw44vS5jt2Vcuk7CGYiKhrdxBntbWKgaRWUipoaX/IrYw3mjwbKsUlM4w6GjOlmzz53rrZ/f5vuoyg7AgfANCIIo25lVNNqmHyQZhBIToHcLnXXmLCiCBRCh2f2fVcqUlwj9oexqAmWVKZMNoFGWlUs2cKknhGtU55Rk0xPIVcj+GmmNowpTqHCEc876aTbCcv8Gj0A== 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=usUls+V4fHAmc7YTudsBYGYv7kOuw0WZIc7l6O/Kyb4=; b=Rk6o4q02GJygYRTs/zkS03K7UStVRFQDzNQi+8SNJvGVy+ryvfjmvggcMGFrr8xwF3oDFSkyCs2gayNMfA1CQz6sR1HAtkkODz8ymOd+eSH0JpEQbEH/QvkUWHxwDxl92Ysa+X8nEBFIBMJ3zJ7GfiOKWwTXw/WYWxbaraq8xw8BWQO3ssGPqjAL6BpJ24NICDgXKZWVVg6hmA1nsFFpGaxPWLfxCcnwZqeB47zdogtBod8bgdH3bkjqAKH25A5S4Rxd0RbwJN9ZMyu2QcyQPA8/sO2LSIyY8AIkr7Ri3Mk6hQm9YFu0g8eh6mwkcGugspI441XRviaKJS+mJtItAg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=calian.com; dmarc=pass action=none header.from=calian.com; dkim=pass header.d=calian.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=calian.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=usUls+V4fHAmc7YTudsBYGYv7kOuw0WZIc7l6O/Kyb4=; b=fpecTSlgtQjO87PgHUCHOCcV2wsjiwrR2O7YcvtsshddwapundURYYF/R/62MGoc5ejV2OCyx+ROBG2m5j/KXKo8T1erysyROdIJKn7EeMDiPne4sQliOvFuyGXFIFdGG+rHzjEbkow0OmMXAdl9aLQPSVZqPPypBA83gzYR0zk= Authentication-Results: xilinx.com; dkim=none (message not signed) header.d=none;xilinx.com; dmarc=none action=none header.from=calian.com; Received: from YT1PR01MB3546.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:f::20) by YT1PR01MB4440.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:43::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3912.2; Fri, 12 Mar 2021 17:43:49 +0000 Received: from YT1PR01MB3546.CANPRD01.PROD.OUTLOOK.COM ([fe80::90d4:4d5b:b4c2:fdeb]) by YT1PR01MB3546.CANPRD01.PROD.OUTLOOK.COM ([fe80::90d4:4d5b:b4c2:fdeb%7]) with mapi id 15.20.3912.031; Fri, 12 Mar 2021 17:43:49 +0000 From: Robert Hancock To: radhey.shyam.pandey@xilinx.com, davem@davemloft.net, kuba@kernel.org Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org, Robert Hancock Subject: [PATCH net-next v2 1/2] dt-bindings: net: xilinx_axienet: Document additional clocks Date: Fri, 12 Mar 2021 11:43:25 -0600 Message-Id: <20210312174326.3885532-2-robert.hancock@calian.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210312174326.3885532-1-robert.hancock@calian.com> References: <20210312174326.3885532-1-robert.hancock@calian.com> X-Originating-IP: [204.83.154.189] X-ClientProxiedBy: DM5PR21CA0003.namprd21.prod.outlook.com (2603:10b6:3:ac::13) To YT1PR01MB3546.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:f::20) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (204.83.154.189) by DM5PR21CA0003.namprd21.prod.outlook.com (2603:10b6:3:ac::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3955.3 via Frontend Transport; Fri, 12 Mar 2021 17:43:48 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 77aabece-b980-43bb-126e-08d8e57e64f5 X-MS-TrafficTypeDiagnostic: YT1PR01MB4440: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3513; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 7nAZ1PVOQ2u7LZzAks9JlMTFU1qoNJmCdSDq2bn2JVaOFpzRVDJ0zzpyUG+iD2SNORatHwwrcEN7sM/2atMCV8+K/cL4/akyMdZjOI59nqIPirt7JiVHfW6euPFkZ0aYdJoj8dCXCFnThzcQV8s/1RzwnR+XAjUcDT+0DkTvxVZqU1e3HlwLhcUIC6n+5glw7m/SXr8ONUoLXloQ/bmElPEZr3s7dj5rTRfC+rZUojb2o8biuItQMbzm+HTorkjZdQjAYZ5u3NNzh5DsmOUpSlnac9dimvSvDOVE+BH3Wo6fEXo3SK/gKdqkiqqEHOILbJ7d/9XBaO2SWSPO4y4vnUm+W9gpj0xPwsrbiz3DIgxjhbQKic/djmZ4cPHoE6HDvoTlAnjTqQM7eB4jj6s0gzpVKOSkvSrd/zuU2iZoSa0sf3DEuv7X8HYsHTiit1318AX54jMebwmYpjMIrABlnE5IS0zLNv9h5VOg72sp0Pnkmz2VADMyXbBvuxllBTJb+e1wlQjkUxyPwkYLU1E021T4n6rTpn7aqd0tULBgnHGqAzxB1oes6y1GnwoDmVVObabTCNbDKQmY4EZBjtgFpw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:YT1PR01MB3546.CANPRD01.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(4636009)(136003)(39850400004)(346002)(376002)(366004)(396003)(8936002)(26005)(2616005)(8676002)(16526019)(107886003)(44832011)(4326008)(36756003)(956004)(186003)(83380400001)(2906002)(6486002)(69590400012)(5660300002)(6666004)(316002)(478600001)(6512007)(66946007)(86362001)(66476007)(66556008)(52116002)(1076003)(6506007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: r3Fe6tPAdv8PJZxOIAUAJY2iqtMYEvzbkifFE/ef/PQPZy4KiK2of6RGTTZ8EdI7hV6Ix92nNMdg/qfh5ZQAc9OrKGj0XJf8C2wO0ckJ+c6rdtW2uYEda+ROlmmqKZHaypwQHufKsCxupOY9cImJ6dc5ju4XN6FOy9veOkZCN2sizhZfDaBmGdWWEs15JxOYrlB3ttHql8OQLiANE6CEw0M4U4R45VybZakBch7gLxiMxIQxfzWhqnJGN+SBDXcTlh7xy4bmzCiG5bdBkt2CEuxO961DrWLEiiYgXA5Ruq2zcpVOWSsUCA9A3yDGN+unOaEdP6PWFLSZF/fnCaVPRkuvMUwPQ1vF+tZwWLGy4pa/uH9jHRywOgRI2oekG2c9k8cxgypOdBAX+Ju5GDK2EUUyVnsEjruu9QTe3DI0+zDXT2WCDKmwLT1fn4JO5gmkN3PaWPUZe3QyyIWwG6yo9z2FPa7cgwRKlcNCsPxljMRuB/YP5Lw288WM30mUOFJZ6lgoa3vQfgzxZao3FyYQwVhU30L0WU7WjHFpjzN3+H/mLsyQYT+x3ly5AavyLm0tW89ldBaXPVbAdwE2n2/uhvkrHzyH/RexTEB+J6uE0QFrYMx6ytu4QK5eD3LKMJd+LFsPomPJFmE14HxtSNsj8WMH2fjepfJKBGT+h5N21QB/UV5NBGRjRdyIH853cCnQ+8Wf19wKVp1bz7vnbSAh5e9CCkiYtvMY8f2QpeVJSVat9u8l4xXhSzUb8Su2DpT+MctELt/dSRdA+pPaMI1rDyg89rnjXRLoWt5v69xN0y3ajSrqKMqAkBRW8237nh4OQa/99dlgw9clDSF25VuNfBbf5iWEEXUlH7UIO3W9p2IHNlJiFuXT32A4t1Sq3wB/RN1Kd4tRA/QRXrhDpBPoAtOteyUTUHu/YkgGp9E1jpkB56HAymjZkFTR3F8haCez4+ZKdB++UNAl18D1XKBjqfacwLnl73GwiEcAH3e+cR7JmVufouqMkQbp1/4+TjHNHu2Pj2WhoKYC7uJBVWh6UEBrdkuT2cmVzxrE/Z3/WMInLDcHUy90i/8IzzDYRmQ3kfIg40gxKg5dvmA6UsOvCLSorqsT/nWYZg5lvTaBfxADWTloicJCADlHrpC5mph/351tX76d/wCC0NtKBkIrvUOEPf74ECgg9dfe/10fhbPJvO5UnB8lm4O3T9CYKNwHzw7Rom8bUxDq2yL/UonRuCVqJ2PBWBUeqw1e4bxekA70HcYlY2N+0fZ6Bnp1SctKzNoWOPVGmgHf8mUCdEGRLbPFS9P/YVwpQBLFHn/ke8VUsPHKtasqHkmR93ajpgrA X-OriginatorOrg: calian.com X-MS-Exchange-CrossTenant-Network-Message-Id: 77aabece-b980-43bb-126e-08d8e57e64f5 X-MS-Exchange-CrossTenant-AuthSource: YT1PR01MB3546.CANPRD01.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Mar 2021 17:43:49.7016 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 23b57807-562f-49ad-92c4-3bb0f07a1fdf X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: SP+KzNU2VEiGpjre3iJ8hh/w63m0AzGlRIPpRFPXFLjZG9O9moInHZh9jXrdm/+nMAskcq6zv6/VzjI8yEWjqyLR+tUO02jiDZQ4fseTQ5M= X-MS-Exchange-Transport-CrossTenantHeadersStamped: YT1PR01MB4440 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.369,18.0.761 definitions=2021-03-12_06:2021-03-12,2021-03-12 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=999 phishscore=0 priorityscore=1501 adultscore=0 spamscore=0 lowpriorityscore=0 bulkscore=0 malwarescore=0 mlxscore=0 suspectscore=0 clxscore=1015 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2103120129 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Update DT bindings to describe all of the clocks that the axienet driver will now be able to make use of. Signed-off-by: Robert Hancock --- .../bindings/net/xilinx_axienet.txt | 25 ++++++++++++++----- 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/Documentation/devicetree/bindings/net/xilinx_axienet.txt b/Documentation/devicetree/bindings/net/xilinx_axienet.txt index 2cd452419ed0..5df5ba449b8f 100644 --- a/Documentation/devicetree/bindings/net/xilinx_axienet.txt +++ b/Documentation/devicetree/bindings/net/xilinx_axienet.txt @@ -42,11 +42,23 @@ Optional properties: support both 1000BaseX and SGMII modes. If set, the phy-mode should be set to match the mode selected on core reset (i.e. by the basex_or_sgmii core input line). -- clocks : AXI bus clock for the device. Refer to common clock bindings. - Used to calculate MDIO clock divisor. If not specified, it is - auto-detected from the CPU clock (but only on platforms where - this is possible). New device trees should specify this - the - auto detection is only for backward compatibility. +- clock-names: Tuple listing input clock names. Possible clocks: + s_axi_lite_clk: Clock for AXI register slave interface + axis_clk: AXI stream clock for DMA block + ref_clk: Ethernet reference clock, used by signal delay + primitives and transceivers + mgt_clk: MGT reference clock (used by optional internal + PCS/PMA PHY) + + Note that if s_axi_lite_clk is not specified by name, the + first clock of any name is used for this. If that is also not + specified, the clock rate is auto-detected from the CPU clock + (but only on platforms where this is possible). New device + trees should specify all applicable clocks by name - the + fallbacks to an unnamed clock or to CPU clock are only for + backward compatibility. +- clocks: Phandles to input clocks matching clock-names. Refer to common + clock bindings. - axistream-connected: Reference to another node which contains the resources for the AXI DMA controller used by this device. If this is specified, the DMA-related resources from that @@ -62,7 +74,8 @@ Example: device_type = "network"; interrupt-parent = <µblaze_0_axi_intc>; interrupts = <2 0 1>; - clocks = <&axi_clk>; + clock-names = "s_axi_lite_clk", "axis_clk", "ref_clk", "mgt_clk"; + clocks = <&axi_clk>, <&axi_clk>, <&pl_enet_ref_clk>, <&mgt_clk>; phy-mode = "mii"; reg = <0x40c00000 0x40000 0x50c00000 0x40000>; xlnx,rxcsum = <0x2>; From patchwork Fri Mar 12 17:43:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Hancock X-Patchwork-Id: 12135597 X-Patchwork-Delegate: kuba@kernel.org 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=-18.7 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,URIBL_BLOCKED,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 9714BC433E6 for ; Fri, 12 Mar 2021 17:44:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 71A3B64F0E for ; Fri, 12 Mar 2021 17:44:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232529AbhCLRo2 (ORCPT ); Fri, 12 Mar 2021 12:44:28 -0500 Received: from mx0d-0054df01.pphosted.com ([67.231.150.19]:26667 "EHLO mx0d-0054df01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232363AbhCLRny (ORCPT ); Fri, 12 Mar 2021 12:43:54 -0500 Received: from pps.filterd (m0209000.ppops.net [127.0.0.1]) by mx0c-0054df01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 12CHbAuo017903; Fri, 12 Mar 2021 12:43:51 -0500 Received: from can01-qb1-obe.outbound.protection.outlook.com (mail-qb1can01lp2052.outbound.protection.outlook.com [104.47.60.52]) by mx0c-0054df01.pphosted.com with ESMTP id 375yymhjj4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 12 Mar 2021 12:43:51 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ez29FIE4qYUtqLg2B7VB2b7LZSq7Ski+oTth8fVzzJE03MUMMoItxiZGvDH9jm2owEmJSU+FhLlglaWZmVGsFaIyLQBg6usf9HddkedIcn5ZVrIG+PCh7mK5LLQHhA5ENMI++J4YzcZhgNC1h44o+ZoS4qWpvwY+gCbq8mWa1CUWKy1JnySf6l9OJEVQ61uPdz4PAGJBxMgoTsD4AGoATAcDGj1PfTbpIhzHpeFUJe6BkHjekiOXZkMQ/7chRNRT996tAeVPRsfO1wsPCkXjCm/FrXiuGDZVf7Ra4XdGVFp/MXHr/0gTa0NQHQkZqnofj2Gss3KihKJLu8PHl6T39w== 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=7ayl5I131zrAVlvCSXK9ArD24wZUP7tRUHbCScetDGA=; b=mkTuMqBmeXw0iq4VB0rJWibD/p/M4z3XabS+DEX1UZVbM8ScM7eHzbbnm60pdVPNWSnR0Vwukc2u1IQDmxWdBrK8y+2kRTNg0piD/Xom5cfn/vB1pSbYlXM4yApQjGRxBus2XKWE6nNEtyN8rpQLhdE/+fpwuCPkV8yYWMt6tKuzjWsNT1FB3EQ1hZeXINEbaTh4F5xhoXCgbEwxyJydPoFTuhX3fywQIrasqXzXusu0ry5WnaZLJCB/1McfhsKSAsX5ktIOxzPgpfsJyZm/Ui47NX2rsXKssTx5R4ixbx7nxcdiME+TBrRGNC0ze9WL8/AN3inFERxUQbWC0jJ83Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=calian.com; dmarc=pass action=none header.from=calian.com; dkim=pass header.d=calian.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=calian.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7ayl5I131zrAVlvCSXK9ArD24wZUP7tRUHbCScetDGA=; b=rmMik5luJItrWaBd9aKeJzZ5K5N0W9aRkpCO1RNx5U5Ew6zbpn/YD/3tpAfULg19h69Ys2hVX19OqiLv3ini08gjT8g+MvZtKJfqAx7fI/2z1JeeMVoKxNQucWFomNsrpPD+3EOpV9ts90Erx/1Uuy1sJbI1dARovjfx5VjWsFs= Authentication-Results: xilinx.com; dkim=none (message not signed) header.d=none;xilinx.com; dmarc=none action=none header.from=calian.com; Received: from YT1PR01MB3546.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:f::20) by YT1PR01MB4440.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:43::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3912.2; Fri, 12 Mar 2021 17:43:50 +0000 Received: from YT1PR01MB3546.CANPRD01.PROD.OUTLOOK.COM ([fe80::90d4:4d5b:b4c2:fdeb]) by YT1PR01MB3546.CANPRD01.PROD.OUTLOOK.COM ([fe80::90d4:4d5b:b4c2:fdeb%7]) with mapi id 15.20.3912.031; Fri, 12 Mar 2021 17:43:50 +0000 From: Robert Hancock To: radhey.shyam.pandey@xilinx.com, davem@davemloft.net, kuba@kernel.org Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org, Robert Hancock Subject: [PATCH net-next v2 2/2] net: axienet: Enable more clocks Date: Fri, 12 Mar 2021 11:43:26 -0600 Message-Id: <20210312174326.3885532-3-robert.hancock@calian.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210312174326.3885532-1-robert.hancock@calian.com> References: <20210312174326.3885532-1-robert.hancock@calian.com> X-Originating-IP: [204.83.154.189] X-ClientProxiedBy: DM5PR21CA0003.namprd21.prod.outlook.com (2603:10b6:3:ac::13) To YT1PR01MB3546.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:f::20) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (204.83.154.189) by DM5PR21CA0003.namprd21.prod.outlook.com (2603:10b6:3:ac::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3955.3 via Frontend Transport; Fri, 12 Mar 2021 17:43:49 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6ac43d6b-3fd4-49fc-366c-08d8e57e659c X-MS-TrafficTypeDiagnostic: YT1PR01MB4440: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: w/CpJxLCnV/wks7FRs/j3bRqn6kzvRPiudKhOWKbGOLn7EaWWRE8+2VqMDIgWq6nXzrYFuqVoahPv46BVTyDVG/un0j0+qs1FUdFjLuvIQw4QMLY7Xd1XAADdQ48JZDXyWnDa2EbS3CTeZqIUQ0JVRizC1fkOum9bxdSKOnlI9S+q3RU4hlLkdAAZy3E8FEDT8iDFT1x5EjL8ywmZX55qbKsMd8WYTwvbCsz7yTtwpCT2hLeiQnCEiyg5Fq9nXmqqV9SV+B0iMH6Mm4BtJp8qdYFXTHM6aOgmG5rJn5rTf2TlNGccEHkTtPz+8nac7FTqJ+hM2lWbkQfGfdnvkZyqZXN1S4lxxl9QHsVS5V8AYXcnLd+v7QXNTQIYh455BtSQCTCWWzd6ekZc2ShZA9X5EG7UM9joHqBxI/eG5LqcO3F5KWuclGVlhB2IyFjBIqAOTUOob7W6E/pKvf4VyR5utrQY86APpiy90Wpql3XZiJyOu1i1xoC0r2CsA4uy3jnWVoNbTAw0OTcE7K2zmOehtaJIRzoVmOzR9I2Qtk9GOleUY+NX+Cve9pS3wQAJoCe5R7rhwB+s6vTehNtdKJ05w== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:YT1PR01MB3546.CANPRD01.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(4636009)(136003)(39850400004)(346002)(376002)(366004)(396003)(8936002)(26005)(2616005)(8676002)(16526019)(107886003)(44832011)(4326008)(36756003)(956004)(186003)(83380400001)(2906002)(6486002)(69590400012)(5660300002)(6666004)(316002)(478600001)(6512007)(66946007)(86362001)(66476007)(66556008)(52116002)(1076003)(6506007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: xnMbL03zz55QW4UvMck2FQAnCuJjg27hBmdetn9bri+0xzODgL1srpn1xoGmrDEawYl8CycrwziWC/49TnkSRLYkY3a5WQSHkEGBStf5hdPQ3ZLpUeuXuivTiz7hIOUELvViTVRMo7wJ29bhyLNT51jVreP1Wvk86+YWutWzHaAB+SPV2uEzHYwd9FhoElUy1IOCAXVxWye6d+QKcKDO/ocCKw5bSRXRU8gJ3KgbPmRd5kdTZeQ6DiwG3ooz38cP+DW2//45bXPdH3+PbYt2T50RKwZb0MXkNpS3zlFOteziiPHTb+wWVPxtgaFRjPkwfesHGGsMrz6tkkeXQ5e6L51jR+ICXfVbqUdEN2Gi2OYpJQLjFl6hMc7aGSyCF6i3UnOe4MZA3DRvOfp+PRh2Uu837BcrqelIlVxEbDyNOM4tBMxLQjlrggD0uU19GmpKNQXUKJ++eOidcvdlmPaKDTNN4QA8hsfek/K2CmtXYC8diHV2IZNu/xkVbFOBhQnIDRSNiINoLc04C/dbi9pxL1kkKhHMGwoeF+cQwQL3xKqkwf1l2jmTm5vlGKx9cbhFSUTdzK4mmSpQn+ZdmLMqUWJc4H++tXI56TwqwfMynG5AEz7rfA+VYHmD7yUaBSpTTn9ArSdvgJdkI0Gt3zaZmN9sQCEQAcl5IzrieoUAU9+cnfp0k8d3tdgvZVvVjXKVhJLi5EHgXfUCKWPEu+cMb9R2DsY9ff2QBHH/l72EcDPxP4JjLUZBEatKowO8uLUk3F/t90939koMTgcP+Os2ROSvtXBj999npyD4m1fGLuTObxpVFatwk4MwYwatsT/E7XZQ6WqJCz8GaFwAIQ6Tvzo2okn/xoh6t1uIgxD75kluVDM1gt88PxDxWd+BLMB1fj0g7XgDdh7D8OocKPqYYPX3c7+xFrRWdNC2vG2naPiYxNdjNRGxlv/3RKvYlyg4sDoKTE8pubmaBoa3g6yd3GKCVQPsbXDvfq+qWmJLkmvI1q0rG88F7ImJc33UmUOs50jcQ6qws95vN74UdgJSJuxbTN7tsgGuXjwfUZMWKpRlWWeBi1tiDTMTHLHtznedFyBcyNT1VMb9A7+hdK2gkpLzbYCvuF1tkRSScjMrsBcrcqEOxmEmuMZuDdp0mXIuwjfAqBFbE/rHuFrLifGhrLPrSGMUdtudAXZHVevIMSK9+pWWJiWCQmmzU87+5UGcL1GVZchtfYdzZYwDGrW2Inh5osUI/QUd/HlLgioyrrCUuuxlJ6RWrdW70dQ4fzp+PYXvdXDZeyJgp9NBfCTaQQHLYKcRqATqZkmB09L8CoRUp1iuTAmbk2KTEXjrJsj3 X-OriginatorOrg: calian.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6ac43d6b-3fd4-49fc-366c-08d8e57e659c X-MS-Exchange-CrossTenant-AuthSource: YT1PR01MB3546.CANPRD01.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Mar 2021 17:43:50.7940 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 23b57807-562f-49ad-92c4-3bb0f07a1fdf X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: NHH6KCdpezBGchYv8EZz564B/IPQBpT+wsc4yT10a7kUIub/9usy/f6lFUMfXPBuM5IboX07D4bFRtAeIetiCXxkgQdEt9BOyHrWN46MS6U= X-MS-Exchange-Transport-CrossTenantHeadersStamped: YT1PR01MB4440 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.369,18.0.761 definitions=2021-03-12_06:2021-03-12,2021-03-12 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 clxscore=1015 spamscore=0 suspectscore=0 phishscore=0 adultscore=0 lowpriorityscore=0 bulkscore=0 mlxlogscore=999 impostorscore=0 malwarescore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2103120129 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org This driver was only enabling the first clock on the device, regardless of its name. However, this controller logic can have multiple clocks which should all be enabled. Add support for enabling additional clocks. The clock names used are matching those used in the Xilinx version of this driver as well as the Xilinx device tree generator, except for mgt_clk which is not present there. For backward compatibility, if no named clocks are present, the first clock present is used for determining the MDIO bus clock divider. Reviewed-by: Radhey Shyam Pandey Signed-off-by: Robert Hancock --- drivers/net/ethernet/xilinx/xilinx_axienet.h | 8 +++-- .../net/ethernet/xilinx/xilinx_axienet_main.c | 34 +++++++++++++++---- .../net/ethernet/xilinx/xilinx_axienet_mdio.c | 4 +-- 3 files changed, 35 insertions(+), 11 deletions(-) diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet.h b/drivers/net/ethernet/xilinx/xilinx_axienet.h index 1e966a39967e..708769349f76 100644 --- a/drivers/net/ethernet/xilinx/xilinx_axienet.h +++ b/drivers/net/ethernet/xilinx/xilinx_axienet.h @@ -376,6 +376,8 @@ struct axidma_bd { struct sk_buff *skb; } __aligned(XAXIDMA_BD_MINIMUM_ALIGNMENT); +#define XAE_NUM_MISC_CLOCKS 3 + /** * struct axienet_local - axienet private per device data * @ndev: Pointer for net_device to which it will be attached. @@ -385,7 +387,8 @@ struct axidma_bd { * @phylink_config: phylink configuration settings * @pcs_phy: Reference to PCS/PMA PHY if used * @switch_x_sgmii: Whether switchable 1000BaseX/SGMII mode is enabled in the core - * @clk: Clock for AXI bus + * @axi_clk: AXI4-Lite bus clock + * @misc_clks: Misc ethernet clocks (AXI4-Stream, Ref, MGT clocks) * @mii_bus: Pointer to MII bus structure * @mii_clk_div: MII bus clock divider value * @regs_start: Resource start for axienet device addresses @@ -434,7 +437,8 @@ struct axienet_local { bool switch_x_sgmii; - struct clk *clk; + struct clk *axi_clk; + struct clk_bulk_data misc_clks[XAE_NUM_MISC_CLOCKS]; struct mii_bus *mii_bus; u8 mii_clk_div; diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c index 5d677db0aee5..9635101fbb88 100644 --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c @@ -1863,17 +1863,35 @@ static int axienet_probe(struct platform_device *pdev) lp->rx_bd_num = RX_BD_NUM_DEFAULT; lp->tx_bd_num = TX_BD_NUM_DEFAULT; - lp->clk = devm_clk_get_optional(&pdev->dev, NULL); - if (IS_ERR(lp->clk)) { - ret = PTR_ERR(lp->clk); + lp->axi_clk = devm_clk_get_optional(&pdev->dev, "s_axi_lite_clk"); + if (!lp->axi_clk) { + /* For backward compatibility, if named AXI clock is not present, + * treat the first clock specified as the AXI clock. + */ + lp->axi_clk = devm_clk_get_optional(&pdev->dev, NULL); + } + if (IS_ERR(lp->axi_clk)) { + ret = PTR_ERR(lp->axi_clk); goto free_netdev; } - ret = clk_prepare_enable(lp->clk); + ret = clk_prepare_enable(lp->axi_clk); if (ret) { - dev_err(&pdev->dev, "Unable to enable clock: %d\n", ret); + dev_err(&pdev->dev, "Unable to enable AXI clock: %d\n", ret); goto free_netdev; } + lp->misc_clks[0].id = "axis_clk"; + lp->misc_clks[1].id = "ref_clk"; + lp->misc_clks[2].id = "mgt_clk"; + + ret = devm_clk_bulk_get_optional(&pdev->dev, XAE_NUM_MISC_CLOCKS, lp->misc_clks); + if (ret) + goto cleanup_clk; + + ret = clk_bulk_prepare_enable(XAE_NUM_MISC_CLOCKS, lp->misc_clks); + if (ret) + goto cleanup_clk; + /* Map device registers */ ethres = platform_get_resource(pdev, IORESOURCE_MEM, 0); lp->regs = devm_ioremap_resource(&pdev->dev, ethres); @@ -2109,7 +2127,8 @@ static int axienet_probe(struct platform_device *pdev) of_node_put(lp->phy_node); cleanup_clk: - clk_disable_unprepare(lp->clk); + clk_bulk_disable_unprepare(XAE_NUM_MISC_CLOCKS, lp->misc_clks); + clk_disable_unprepare(lp->axi_clk); free_netdev: free_netdev(ndev); @@ -2132,7 +2151,8 @@ static int axienet_remove(struct platform_device *pdev) axienet_mdio_teardown(lp); - clk_disable_unprepare(lp->clk); + clk_bulk_disable_unprepare(XAE_NUM_MISC_CLOCKS, lp->misc_clks); + clk_disable_unprepare(lp->axi_clk); of_node_put(lp->phy_node); lp->phy_node = NULL; diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_mdio.c b/drivers/net/ethernet/xilinx/xilinx_axienet_mdio.c index 9c014cee34b2..48f544f6c999 100644 --- a/drivers/net/ethernet/xilinx/xilinx_axienet_mdio.c +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_mdio.c @@ -159,8 +159,8 @@ int axienet_mdio_enable(struct axienet_local *lp) lp->mii_clk_div = 0; - if (lp->clk) { - host_clock = clk_get_rate(lp->clk); + if (lp->axi_clk) { + host_clock = clk_get_rate(lp->axi_clk); } else { struct device_node *np1;