From patchwork Fri Nov 4 06:03:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Chiu X-Patchwork-Id: 13031378 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 95679C433FE for ; Fri, 4 Nov 2022 06:04:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=FelPAgm9+hX4ZiuztKtln/jFZ9C3/9bzbOYqD69bXMM=; b=2rN54MeBSq0cmq KFpEgJkGlnHG/RtiiEr9AvUQ1OLz6gb0gU3gfZt+4WDKcoyEODRcCbSb8nLNDvIdHojjTfNSg8Dz0 t/t8yqpNzUEnbX8+eCCt+Ib7mBCXemNujruvfqJ5EVvN1lJDSj9QrGtLkJGhdcYj2rnexYxkpFXh3 Do6GfAthSLsI2Sthf/MZCz2yGOVVYd/lHCHaLqj+KSK2oYMoutdjmNVcnhoL3kR/0k6HzruTsLuxO 1pjVbiuuEaHmj2QcIBxkdY8xGwe72VLTx+o1lZNFPAAF2rojV/q2KnXRBwz3hMNch4HExuZn/N/xB gDqlE4BSipmeswvRvMkA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oqpnT-002TU1-5M; Fri, 04 Nov 2022 06:03:19 +0000 Received: from mail-pl1-x62e.google.com ([2607:f8b0:4864:20::62e]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oqpnP-002TT1-Dw for linux-arm-kernel@lists.infradead.org; Fri, 04 Nov 2022 06:03:17 +0000 Received: by mail-pl1-x62e.google.com with SMTP id k7so3990314pll.6 for ; Thu, 03 Nov 2022 23:03:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=ny14B6KlAe56RF9kWIk6DLDgrchIrYGi8bnqimW6jNE=; b=WKD+m9Ui3aSvrITuTnmo9GmAmWwgR2N9XBdnz8qho3kqZsKmtHhiNoK60wzHy0Foln Q6e3woyi1S/zE2zh4ubE+AfWgTjqSljZXvoMi9tW7fvfjDjVtJGgnqSnP3XY0gVJhgYY ZRWYjUcK5cPJXSIsFqlXWx5X4M4w43diEkoPtZ37Xjb+OLXIbOP8Wewe3tmqlz4G+xpV wnyXfU3e1l53VZxPLP46UfTwfzmPiM14vk0wmRYPYnvmXlSaogpTdJn5U0cZmGPmTkPL gBJoCRE1yW1eImbBivPRfVcwkKWlGHegybRiOpPOdGQK+PtX4iiC1XWPQ2F8b/xVGjMN zHAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ny14B6KlAe56RF9kWIk6DLDgrchIrYGi8bnqimW6jNE=; b=4Ckj01fYaQp8+TzvUh3em51bIKh7y17URWCjh2hzXioSNNrnEgYIs2qEK5iUR1e7tq 7Mly0F6ggy5mKgvhyablXL+8l/T6x8CCzX2xZD9ydOS8bykh323u2wgpvRN9ZGoU1y/a 5fplRiwP4R1y4LHcRk3f4bzGkwmGqZ2mWqA+RDqA8aCXj+c148PciBn/aJMO7r+ord53 ZxZiInKf9xILbI3s0LNvbS+XCXYpoORLulIkTKQozyxUZlvKZYJ/JUp5XIycq0tIb7U7 OiPdZP/LyTidcFQqnAZuieLdkRZz2uJpvqWDF62LJ5gmcPMApnaQbxrXI00MfZ3eNv23 mZlg== X-Gm-Message-State: ACrzQf3GiCIi5Vi7MVPPao8awr+elBdgQqys2duSPLnRv896tUprEQYH xPURmClluiIZBi+AFgVMPl9CXA== X-Google-Smtp-Source: AMsMyM4gxgvR0YXa+wNLREj3kBlJSR2N3mfUaU1dcmn+RNqQBB8qbDaOae0cq300NfOmTfUyaYk98w== X-Received: by 2002:a17:902:ce0f:b0:187:640:42f with SMTP id k15-20020a170902ce0f00b001870640042fmr32613868plg.115.1667541791209; Thu, 03 Nov 2022 23:03:11 -0700 (PDT) Received: from archlinux.internal.sifive.com (59-124-168-89.hinet-ip.hinet.net. [59.124.168.89]) by smtp.gmail.com with ESMTPSA id f15-20020a170902684f00b00186bc66d2cbsm1727180pln.73.2022.11.03.23.03.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Nov 2022 23:03:10 -0700 (PDT) From: Andy Chiu To: davem@davemloft.net, andrew@lunn.ch, kuba@kernel.org, michal.simek@xilinx.com, radhey.shyam.pandey@xilinx.com Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, robh+dt@kernel.org, pabeni@redhat.com, edumazet@google.com, andy.chiu@sifive.com, greentime.hu@sifive.com Subject: [PATCH v3 net-next 0/3] net: axienet: Use a DT property to configure frequency of the MDIO bus Date: Fri, 4 Nov 2022 14:03:02 +0800 Message-Id: <20221104060305.1025215-1-andy.chiu@sifive.com> X-Mailer: git-send-email 2.36.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221103_230315_885707_A1C565A8 X-CRM114-Status: UNSURE ( 9.59 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Some FPGA platforms have to set frequency of the MDIO bus lower than 2.5 MHz. Thus, we use a DT property, which is "clock-frequency", to work with it at boot time. The default 2.5 MHz would be set if the property is not pressent. Also, factor out mdio enable/disable functions due to the api change since 253761a0e61b7. Changelog: --- v3 --- 1. Fix coding style, and make probing of the driver fail if MDC overflow --- v2 --- 1. Use clock-frequency, as defined in mdio.yaml, to configure MDIO clock. 2. Only print out frequency if it is set to a non-standard value. 3. Reduce the scope of axienet_mdio_enable and remove axienet_mdio_disable because no one really uses it anymore. Andy Chiu (3): net: axienet: Unexport and remove unused mdio functions net: axienet: set mdio clock according to bus-frequency dt-bindings: describe the support of "clock-frequency" in mdio .../bindings/net/xilinx_axienet.txt | 2 + drivers/net/ethernet/xilinx/xilinx_axienet.h | 2 - .../net/ethernet/xilinx/xilinx_axienet_mdio.c | 57 +++++++++++-------- 3 files changed, 34 insertions(+), 27 deletions(-)