From patchwork Mon Nov 14 14:37:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Chiu X-Patchwork-Id: 13042439 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 420C7C4332F for ; Mon, 14 Nov 2022 14:39:58 +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=s3tLVHLn6cA9KjRJIWvpZHrL6OhBPqhn63lX2u+gm94=; b=DnJKdRQYnVsgRO d7TnL/8jb3SHYPARvsyVJtJCteDV5MtsGb4eYRM1qMsf7vQxgJqn6cBNcjJkjHGpgQqLJ8Lpx83We /Nq5GolCiU9aKL07lHL2otWkRBvIzSQNt9ZEuLvse30xOLiEUlkVjNoKNHuj1Hf/IA/K56pM5mXIV vfWHKy4dRIr3SIgokPHg7C1XnVZzN/LAk0nRRDTJwZhBLzhYBWKx/C2cNzWVM5zszCUdzvwh7wbjG Fy1eiPrWDgYdM8DxX87hAdbbt6PJbkgRzY84aTTQG7xyJBnByOZhXJh8kmxpsBlE5E4EJxxONyTn0 Z3wMrXdeafc4oBLUs8sA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ouabe-001nnF-90; Mon, 14 Nov 2022 14:38:38 +0000 Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ouabb-001nl6-5d for linux-arm-kernel@lists.infradead.org; Mon, 14 Nov 2022 14:38:36 +0000 Received: by mail-pl1-x62f.google.com with SMTP id b21so10212537plc.9 for ; Mon, 14 Nov 2022 06:38:33 -0800 (PST) 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=+I2l2dQU/SlRpqjpUUygnad2p+C8/OjAHy4EbbukZok=; b=nK6x6IOyQ4NFKAnoYusaMucbzjZLOu3fj2PbTbcq7OR1JS2J60ezaVjpqMnmfA3y8U Mf7JxIw9V/FWM0v9llOwKK81bvMKoYLFU7Z2k9/5ag9VDAQe4Y1qrsF679b7Hmz0ouai 7VMtMiQIXdTlBoK8GWDcLOa7RCKEo/JjS7g8ciZqtyAzzx8olF/MTN5WB+H9kPIVEdqr 6FIeMbOtNgraBfqxIMBjEVVPBCOiJlj8WU1dy/scu1eY2MgAjN4sGe/TX3X1RMfelsf7 xUvxjknCxzg24qfQl1cunTcVfmOT+pj46csoVojif5J6j5YkJJ6fZdjcbBn7zR9LCqbC kUPg== 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=+I2l2dQU/SlRpqjpUUygnad2p+C8/OjAHy4EbbukZok=; b=JEC6oD95yhFpyh6ecw/3yu7RySG1vkSjCSw703IHD8amSckdsnjIfnJKh5nBSG+YLF N6j9GUGCx61DpVmmiSSPNe9GjE/U/XRCqRvcRyd+hBRkAW551Ng82gMxwAv+jGVe/Ru0 o3VFwiW/H/kHW1uCHMPfgt+vbfcuJj84uBXEdBajcIkEtsmBiW/MYmYQCgI2c/TRJl11 qBkSf3v9UwmF0kryGK5/i9+v3qo480XozFFNdInZW7no4dm+uohTW3uJxuwbYhyVmegk QQrztBuTtCVjgw7zol955z2Y+hU1g5GcSCPCv0THTq9kiMp05kR659AJrKIxbRqApM2y 3+dg== X-Gm-Message-State: ANoB5pkNo9lN+ySZyHrC5f2GRKH5cw3G/OE/GLf9OklmdEdu7/hFR/BR LtBCcwVLAv1ocMWEuE4psD0PEA== X-Google-Smtp-Source: AA0mqf7FAKNVJYgUMSb+z9Jz05Rx32S4RohRMcU+NLPX3jkasl/v7mTbc0RHPptGINr1Cs4ABfISKg== X-Received: by 2002:a17:90b:1bd1:b0:214:1aeb:1ccd with SMTP id oa17-20020a17090b1bd100b002141aeb1ccdmr13808701pjb.127.1668436712986; Mon, 14 Nov 2022 06:38:32 -0800 (PST) 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 h12-20020a056a00000c00b0056bc742d21esm6977381pfk.176.2022.11.14.06.38.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Nov 2022 06:38:32 -0800 (PST) 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 RESEND net-next 0/3] net: axienet: Use a DT property to configure frequency of the MDIO bus Date: Mon, 14 Nov 2022 22:37:52 +0800 Message-Id: <20221114143755.1241466-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-20221114_063835_280473_DABE0E4A X-CRM114-Status: GOOD ( 10.01 ) 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 RESEND --- 1. Repost the exact same patch again --- 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(-)