From patchwork Fri Mar 26 00:04:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Hancock X-Patchwork-Id: 12165209 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 5ABBBC433E9 for ; Fri, 26 Mar 2021 00:06:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3A09161A60 for ; Fri, 26 Mar 2021 00:06:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230173AbhCZAFk (ORCPT ); Thu, 25 Mar 2021 20:05:40 -0400 Received: from mx0c-0054df01.pphosted.com ([67.231.159.91]:5607 "EHLO mx0c-0054df01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229920AbhCZAFY (ORCPT ); Thu, 25 Mar 2021 20:05:24 -0400 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 12Q01FDZ029344; Thu, 25 Mar 2021 20:05:20 -0400 Received: from can01-to1-obe.outbound.protection.outlook.com (mail-to1can01lp2059.outbound.protection.outlook.com [104.47.61.59]) by mx0c-0054df01.pphosted.com with ESMTP id 37h14tg3yg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 25 Mar 2021 20:05:19 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mjrQ34Xz6W49aEOJQUyzBOz/NvsX4b0I8ZLBN3EXtL0jgnBW9UovSg2fryxIiKxs1un3WK+CbrPxabSqS7zSsUHiOuK6/IN+1J+wCoGNllkC/vzh13vkw4HBn3HCHIeujWyFxGW5HGmfsUjTt+8WMzBHZtGfTj8D9cfo6XPTDTVCiqkI7ivAsuD/jh1wEWMIGLlLtZwSDPScFvCE7NsJY0IaodG3svj71J15mZPWK/fRHIm6P53ak0zsmOK01xsYk7B+cov1GGiBVQRLPHVmVDRFU5JBQEzvgHBbQaa6eAnG0r7VNPD00TtyTm++tIlh/GleSrxH4Kher1Q95Go2dg== 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=jsptKJ8mYBkT9ZpU1kMzSs7KCj8h5r4L3aMrgYTDu/w=; b=OBIOiSnki7tdRvQrKFqGj+BAcyyMyzbK7tVQfPHcr9rjpWCYsHRt0gZ5nWimxKoRR+xU4U/XgASl01i2bAZ7ICrdEXaDqWFTcq4orbVdb3KIKvk9orTsrB4Phxdih68tsGH9hgSkUkbtzeDSlR0CjiYlG08rcKvpiM8kEQVp9ly+rkQXcO3KCHAxiGKbPILTEKbphywxOiTX62vRl5BHJ3alW5b56kZNAnPu219u5zX2akXM9ThVpENcKyhUJDI2PMbzO7do8ZF5y9L1qNgNBeG3H3sSlyNUUHSWYkvkQvgX2jsIuIieuP6mVcJE6i9+4cIC32iin0374c4etaFIeQ== 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=jsptKJ8mYBkT9ZpU1kMzSs7KCj8h5r4L3aMrgYTDu/w=; b=V8Z0qKvVf9oxEJjgSHYPVWW596DIk8tziSysXwU7LQjyf0SfrkksP0roQYttN35jfYduP0xBiYWDLcqd42j02sDzfeN+LXale2mWNU6v/wt2/DxBmODkjSK41aadtuwjCZv4z+6YNVMV1cEuEHPatGyx9gYOw/oexgKXjpL5jrs= Authentication-Results: davemloft.net; dkim=none (message not signed) header.d=none;davemloft.net; dmarc=none action=none header.from=calian.com; Received: from YT1PR01MB3546.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:f::20) by YT2PR01MB4302.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:35::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3933.32; Fri, 26 Mar 2021 00:05:18 +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.3955.027; Fri, 26 Mar 2021 00:05:18 +0000 From: Robert Hancock To: davem@davemloft.net, kuba@kernel.org, radhey.shyam.pandey@xilinx.com Cc: robh@kernel.org, devicetree@vger.kernel.org, netdev@vger.kernel.org, Robert Hancock Subject: [PATCH net-next v4 1/2] dt-bindings: net: xilinx_axienet: Document additional clocks Date: Thu, 25 Mar 2021 18:04:37 -0600 Message-Id: <20210326000438.2292548-2-robert.hancock@calian.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210326000438.2292548-1-robert.hancock@calian.com> References: <20210326000438.2292548-1-robert.hancock@calian.com> X-Originating-IP: [204.83.154.189] X-ClientProxiedBy: DS7PR03CA0070.namprd03.prod.outlook.com (2603:10b6:5:3bb::15) 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 DS7PR03CA0070.namprd03.prod.outlook.com (2603:10b6:5:3bb::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.25 via Frontend Transport; Fri, 26 Mar 2021 00:05:18 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 964bf5e8-3986-4815-3cb2-08d8efead741 X-MS-TrafficTypeDiagnostic: YT2PR01MB4302: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3276; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: PbaJO/HVxcvA7hWLAtfMES3497m2CGrzlKDqtu/Ij/teC8k4XsYb2mBu+Crb4CDUkCIl2cQRCk9l4J/VdIVusUiW+1KaLG1yzhfV5CVzSI05VqpgqKgGn0SxqqTTwc+vlAxeqI4QfU9ji6ZeHrOQ07Kct//rcDN74a6zTPMD+pCXrqPDmzf5aR+px78h6PrDmXJn7/zl0TiSVs6LZ+QzIO23mvll9nzC/2bn1o5L5k4lEtYSgQRDP3lC+JI1dtwfFRrhTQZ51d4sX4KTYOL6McfywZ3yx4sv+F+/iHI+QkYc6wRScKVbsPSN8t5VW+uWeIHNrwWyipi5mOtLHAQWKLVzkplit+P89x6FWtnx1j1T2uPYNw2gZG9QTjZpK8ZXZRTB1Cs3wu5XneLYVHGCVi4NYXF6bw7ihZwN4IX3TK5yiJdSKmHUu1nfcw+9ehEN7cbw6v5cJx1oneiEPBv3OadItWUgrXTnEyiP09hZAZ47tGI6E9u+s46V5md1ZM2LYRAh9xg0IQhjIEyaR+bD4mICpYynJn9NmysASK4nxU5tLvQvCv2a638oInaF+6hz0ERGCCNtmjmO5/pD7/CcQGR/Tjp33CU9URlpRdtB2IR+vip2shGuVTywJoua4Ktxm8ttsFk4Lhs4SLxqLMMFF1qC6XVssLpEUcVcCPja95HdMJVBnOBxBMWuCH/eWoQ2 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)(376002)(346002)(39850400004)(396003)(136003)(366004)(6506007)(6666004)(316002)(66946007)(52116002)(107886003)(38100700001)(86362001)(36756003)(1076003)(956004)(6512007)(5660300002)(2906002)(44832011)(186003)(83380400001)(16526019)(69590400012)(2616005)(66556008)(66476007)(8676002)(4326008)(478600001)(26005)(8936002)(6486002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: XhBhacENOoQNqkTaD2gKDnz70PJjTbyBVjYMPgUt5VSQQjSaExwXqlDHDO6BpHPvloc/riiV6k5RdaqsAaLAJzaJ3BGWIepCNMZiN6NK9/Rkf0gZHPGD5gbK3nBIg28VFYWrKTO5T4+H/vUYYx8bkrxJJ58UT9cGTdgamg70v0+HA2jZXKirbsFfORE57cy85Ny7yT6dx1uL0X7aanXuENtqreljfm7HP+r1fsBuAKRu3i1g4jlhF3bniVzK7rHZxbaoVGMmi7Xj02cpEoQ0rQtSnCCfIxHJUq85AAQtsi3/tAabgocm1WrX8qn7o5BHgVtXDkYy7tgjCQheePlLC+a9NDPqbEdYL/7xm8KYi9OBfID6wF4z6YWciaQWv0DEeuX96N4WLdjjavmvA8U9Y02lFKFpf7plEeGQinGRBRPX/Z36ZkyosAdCwvJhtjZdebfT57nCJmnJ4u2zx5hU5oaERJZeMtucV8u/3od7W/OsnfuZ6z3g1+AacSN9wn/QC4ajYEb8QbI1w554suMaQABN47cHzzKQkr0sfcspIa5zYt0sWDszsQYXdJ8I6hzujwJMlQmGBPGaqyPvfd2ngDRnChK3BhIh8xyLj0LRuRvsbh4RyoxeJRpoNv8yLUTl2X5RqiVLXEIrwLYeRByUB0umqOTEjKhQw8Gt5VH8I8jv0SeS7jYt4TVjpwDCrqcGrFxFg1EQ1ZF7RAuxw69mGgSkEhzbnzPrkehtLPvlwhEafQjIAeid7SjQwvRHbKtUAhdrSnH8JoDNmbIgqOYayNFSbGhRNszHkbwPVg9AuO49jF7az5JYXPiDJ38BHOE5Cv6A8fKR5MIMuUk0Y19TNq1zsbXlw4zE6khrCFLXt+W2HYvocDIN6w03zjm6bQdyROmJrjVlE3oEGkHdt+t3peMI9vYiNHFZ2AUgmQY/LY3TG9hpkTu/ekv9Jd773kPIc3gpaPa0RhwssyIjwxnfI3tZze5vubeCl9DWz11ku3ERrvtD8DM+0hIygi7u7cSU48tENoNNz9QdiQuaHOk4gDlZ3bVz1AZHqvAf6f6R+tTx8HcOipe60XZR+3Y4WqBCsKWFAL7AD01DTFY/BIsVat/RbplMJlQ6u0jn7n1AM6OarxqyhRnaFTHu6hGawJWcPWgbedlAOLdy4hhGLOYP0Ub8jC6swKxN1ntCvgL6Ku9iHbQ+Qwer78VANuDwpbvTR6g1iSklNEwQO+vQBsRPmKnjSO+uWuJ4jyV5XmxnERxX1YlF5KZ2JwhFktic7c2dVwZ7oLdz/M9Bo3th6H4SvehmQ16K0gOTeMlSXoriVNE/MIGry9acywl5qdxJi+PQ X-OriginatorOrg: calian.com X-MS-Exchange-CrossTenant-Network-Message-Id: 964bf5e8-3986-4815-3cb2-08d8efead741 X-MS-Exchange-CrossTenant-AuthSource: YT1PR01MB3546.CANPRD01.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Mar 2021 00:05:18.7056 (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: hVLgfdjY4mT7POxCv/zP+3VLzCdgyHmSz9mf1/KWUWWoOey0m37EEx/n+eejFkw8eflvhvcVVRP82xcWOpdI4YpzvJwADGIyRZVTlElJULA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: YT2PR01MB4302 X-Proofpoint-ORIG-GUID: MQ7KtmvEpx5EZhzPgXtPGXXbmU_Tq3hW X-Proofpoint-GUID: MQ7KtmvEpx5EZhzPgXtPGXXbmU_Tq3hW X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.369,18.0.761 definitions=2021-03-25_10:2021-03-25,2021-03-25 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 spamscore=0 priorityscore=1501 bulkscore=0 phishscore=0 impostorscore=0 adultscore=0 malwarescore=0 clxscore=1015 mlxlogscore=999 suspectscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2103250000 definitions=main-2103250179 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. Acked-by: Rob Herring Signed-off-by: Robert Hancock Reviewed-by: Andrew Lunn --- .../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..b8e4894bc634 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: AXI4-Stream clock for TXD RXD TXC and RXS interfaces + 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 26 00:04:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Hancock X-Patchwork-Id: 12165205 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 313D7C433E5 for ; Fri, 26 Mar 2021 00:06:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 13A2A61A13 for ; Fri, 26 Mar 2021 00:06:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230159AbhCZAFj (ORCPT ); Thu, 25 Mar 2021 20:05:39 -0400 Received: from mx0d-0054df01.pphosted.com ([67.231.150.19]:16707 "EHLO mx0d-0054df01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230050AbhCZAFY (ORCPT ); Thu, 25 Mar 2021 20:05:24 -0400 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 12Q03GlF016081; Thu, 25 Mar 2021 20:05:21 -0400 Received: from can01-to1-obe.outbound.protection.outlook.com (mail-to1can01lp2055.outbound.protection.outlook.com [104.47.61.55]) by mx0c-0054df01.pphosted.com with ESMTP id 37h14kg2rt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 25 Mar 2021 20:05:21 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QO3Oj6rTFBM4MXcOAgw4Yrp5coWdmQ8rDfg+btOgu2tF/DJZbbUQtawzD66fIQvzu9pCeU/+bzBgF4Ac8bmR0iwDdVK60AaUSfRsuYu2DOj6Ntm+D2EhGLNYQXHEr90ABFe7lhXSdx0ZXkwbiG0fSleZdDQkSY82YYyEVLGZAnKJ5pU+sfpsV79SHZYP+4zDGWRB+E08WWugUAyh6OwSp+FKeXZ2pwYQU11EgEZrlrwqeV4pwS/ir9YRJ+xllAuCpCaM+hAtslZfTdB1EPrJUpqKQOwRV1P/ZIDnqNrVI40EqBJwk7ldkRGp0okMTsuMjWHbSE5fOmfa14j5XmGL0g== 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=Ey32jgbHhhL5onpua3bSkgf5WrkATPTXfvjTlkXeMNO78K3Q6jp+IgQgWQKBbPE3LZCGtIUbAdh15bB5Mf/g+FI5pRUQE/I0a15nSqCqdEpdubDNHa1WOjZzCIT5bEziaamrkn2wElAoam093hIWJEyhd8ssPXpeD81roYp0rKuiD8rLMwwdI9DFOzjA2vFSqBOCg2ULQw/EiED36nCVawpKQPfXh9ODg2Fh2LGrpHg9Hf1Oz+jXO2mSCzKw0N3gTllyg3FEk+qKqk++XuVIvhiFtrYNVaa3bRvIs78p2zNgLAx/EHjrRlhB8m5SDHEK0r1CNynZvGuvGoOXBvMblg== 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=5syeXu1t5zwVK5YneKkt2Egh0iweP4tbX/Ev5vMlOQAbxy7wIidj51Ui/ZYGZxj8iAmhra2LDEtvdJe4aSp17gQZ5jbcQEb5YqbZuFAjBThEXr2G8rblULauEWnONanpoHphlR+/D4SP2AeDjsefXMiVoPoYTHIB/yFQ2h7xFz8= Authentication-Results: davemloft.net; dkim=none (message not signed) header.d=none;davemloft.net; dmarc=none action=none header.from=calian.com; Received: from YT1PR01MB3546.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:f::20) by YT2PR01MB4302.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:35::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3933.32; Fri, 26 Mar 2021 00:05:20 +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.3955.027; Fri, 26 Mar 2021 00:05:20 +0000 From: Robert Hancock To: davem@davemloft.net, kuba@kernel.org, radhey.shyam.pandey@xilinx.com Cc: robh@kernel.org, devicetree@vger.kernel.org, netdev@vger.kernel.org, Robert Hancock Subject: [PATCH net-next v4 2/2] net: axienet: Enable more clocks Date: Thu, 25 Mar 2021 18:04:38 -0600 Message-Id: <20210326000438.2292548-3-robert.hancock@calian.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210326000438.2292548-1-robert.hancock@calian.com> References: <20210326000438.2292548-1-robert.hancock@calian.com> X-Originating-IP: [204.83.154.189] X-ClientProxiedBy: DS7PR03CA0070.namprd03.prod.outlook.com (2603:10b6:5:3bb::15) 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 DS7PR03CA0070.namprd03.prod.outlook.com (2603:10b6:5:3bb::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.25 via Frontend Transport; Fri, 26 Mar 2021 00:05:19 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: efc11638-9445-43c3-09ae-08d8efead866 X-MS-TrafficTypeDiagnostic: YT2PR01MB4302: 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: VPD7v1/gPU2U2jpkwDt6goRizAdXpGY5O4+FP7isfSQORjKA3pkMXEnNXs98T6sc8ngezmB0FReMEXj8ozie46jT72qtLskr2BY3JbimFOQNSGiSfr0cQOMAPx57BX5kYoUoqde45sD9csUJUbzRef7JoZwmYzR8z+fuQHfx8ODEhD6BEszAq4WpuylmmJg9GuzAxZ+xI+c4NfhKUru50+t7ozsfKeq1v5uHvKB0w94hn0cQaUYNliw3nPOXhI5nu/fcBxiR188qwkY8U15nc7mF+uq5Wk/71d/COL52m8TeJHPL2SESsl4GgmuqNGhQceMfm2PMs6u8R0friPe9d22m1NbCo4YlqdW78pmJoCjT3sMlvBtLC0fl/JV720ptyiG4wX3bxuF/VWMFG2UcClnVyOjSIJwUWHbb4SyC5Ov6+RaHTyJmMUweBBLjcYiWv9YVTCLi3WO2Fghxafl3IH3YZ7886VNreeq+IYlg6Gd+hEN4cU52EP6qel1Rt7L7vxiR+S1Nhw14+/QEJZwr9IRPhCqfIcU6jCl2pLPgZ4R5oTpOCiY96uhwFF59cc1670E+rw97iuqEQhzOPe6oypTMMG8XbkWynTYBdbTRS36m3GJrHVtYNXLGulA3aBXZTB7eTg7bz6zHMvZXGGqJBISxD2yQQbVneMOkMDwc14XC+ZHTW8F2JAgY+TsqPUNt 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)(376002)(346002)(39850400004)(396003)(136003)(366004)(6506007)(6666004)(316002)(66946007)(52116002)(107886003)(38100700001)(86362001)(36756003)(1076003)(956004)(6512007)(5660300002)(2906002)(44832011)(186003)(83380400001)(16526019)(69590400012)(2616005)(66556008)(66476007)(8676002)(4326008)(478600001)(26005)(8936002)(6486002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: D1ifcMZjHGZORXzHb8FGxVJ5vIng0JUDy4n9PawSzHigbVnSpuCg1Zi31hS6ytBgJmtGIoUuIifXSdk2qW2H0DrM/E86NoxkLUqJN1uPB3RUFxOHGTBiFoOyquvJfowf5XNAi5hcR/gfFQdF/+gIyAHtIu3zK/H/HPjx9Q827V4N0pagFdicoyeKuOd21N2d97YsmKI7EPIQ0R5pqpdsqZwO0CvLzfa0PA1r4oAiwRU2Z7LCl+7QxbisXES/CDQ4K7IrFWA8NckeX6yX6xEECfefexq5e08rogBjxV8dt5S5ae3weOlX8kdnQx2tlnWS3FDM2RmJHfBSk3VNtgFDFFkMUBAjgEYfcG7YvuD5Ir5S61YYnYjC/OeGoGTE7jOg0fdTcu0ZawJsK9Z/dWPO7I41StxgkUczmllw8tYhN7r0E0Ncxy4W/Hg42GeH7ak2HtT7o3Tq9U7rkjfsAN0lMwIqCQoYAYjwB1VopU/obajoQgG9TkombA0tL79nmPneUjRd0+PTQqkng1p84C50kEUW+7eb7uV+o8jkhex7SvDp3u2ONZQ5nK7ujUERI5RipgSwLtBG/LmqDp46AxCo3exiKnxCH/0U3Mzr8IwXb9JwbArRCy1qmi8nWlqEZC3Ips+BxLPg8zk/OU/lsp7ips9QPNsmVyrhYiZKOhVDVvNAcgzO/6DSefkPXLIlgY9SC2XLXFKSmDcUtlqLncQeErFEBuIXkBPwJxJw/4k43vk+UVO7ghrOljlyaA5g+ApM1OqL+hEk+S02CQFzUvrEfQ+GaZopfuYuoU87gwXf8C61TnGgI0CIuUcwcBvhBKMoH67AJEQXCituWn50eDqFA9cqZDpE0QFtV3fcVwn1+NDzfOW0cfsIqKt+bYM5lR6kgCgSsE4wQa4LIbeYiTH1ZkPCiHmy862v2RHWo+A/biA+GOz+YNc+wjTkcqGhL+sZUDGrw7kh0L/dJZP7MVaZwYqpeBMFfZkN84m/ZxnW2hXaioT+jPdhz+kiJY5HzBBvdhmEvHCItj4xwQBYwcVhSIYR8yjFGryCySPMYaAp5ipmf9VDGxVRFzI7ii5/Kgz4WICZZ5AO2QRHfcvVhqjCacl+QTpVIphW+IWmlprhFZsm7f9aqsqiYQuKYrH+h8L/aH/xVwS3JGRCaYVmQG4Lc8yzopd5OoBajMzxB+2QDJrYO8jc4JIh8HXyojGrV8GfjoalhhRqm+CYxSvdJTDQNCYZyxQRKDtNzQO1SSQzmeP0pmzcv6gC3Pw9ljibR2Am6CY7P04h4Vxz/lx7RAoUXdAOkwEzBU2R2YAt5Z7S5IvDyc43yU7yh1Y7e2NgleEj X-OriginatorOrg: calian.com X-MS-Exchange-CrossTenant-Network-Message-Id: efc11638-9445-43c3-09ae-08d8efead866 X-MS-Exchange-CrossTenant-AuthSource: YT1PR01MB3546.CANPRD01.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Mar 2021 00:05:20.6285 (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: IgqBVOqZ/8fLxjSh9gbbu0cgWtfUBq+DpdQ0pkWwkFtRts7CXKZ5k4ZrTODcS1+nLGJdpjhxsrHGdLiBBYlLKJs3rZuk5+GfHm7GKbbX1xo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: YT2PR01MB4302 X-Proofpoint-ORIG-GUID: bs7i6n1QXKSSl5jwHGpxz0EtSNRYa1nU X-Proofpoint-GUID: bs7i6n1QXKSSl5jwHGpxz0EtSNRYa1nU X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.369,18.0.761 definitions=2021-03-25_10:2021-03-25,2021-03-25 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=999 impostorscore=0 spamscore=0 mlxscore=0 phishscore=0 adultscore=0 malwarescore=0 lowpriorityscore=0 clxscore=1015 priorityscore=1501 bulkscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2103250000 definitions=main-2103250179 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 Reviewed-by: Andrew Lunn --- 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;