From patchwork Tue Nov 1 01:01:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Chiu X-Patchwork-Id: 13026558 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 D330BFA3744 for ; Tue, 1 Nov 2022 01:03:09 +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=ju5CYzA+utKkl9Dz+yEzLJth9PHJ/ajGH7Way3a59Yc=; b=4UpXSFPYllZ6o9 pooYf9q4CRIWXthlO/f8ehiOgIE3Bt0P23iJ+6ieeIVG00n7b3wmo/KLd1727VAqiypKA2Ei8sK6w DK5z1F2JxOQXtmCNDmp/ecZqzCVfhaZHQBMPgektiokapYqeU88mUOuv0Wf47oQuF9OwVX77AEhVa IFTyb3wUyOphuVKvppaKJ2Kd+jU40bWeSLdUpjXeB4hv4BEoDOP6vjCZVg4TLo6QF0VGzljRkwFYS UzLATL4aAkdC8S2xbdLFA2KJdN1Cc42C5hZef/w57tQ1yAGvX1Kbqj7+1XMkqJXFgx3Ky9TKwlzYD JGyNfQxRt1/eZ68nEl8w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1opffL-00H1Ow-Cc; Tue, 01 Nov 2022 01:02:07 +0000 Received: from mail-pj1-x1035.google.com ([2607:f8b0:4864:20::1035]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1opffH-00H1Mi-BB for linux-arm-kernel@lists.infradead.org; Tue, 01 Nov 2022 01:02:05 +0000 Received: by mail-pj1-x1035.google.com with SMTP id m14-20020a17090a3f8e00b00212dab39bcdso17518790pjc.0 for ; Mon, 31 Oct 2022 18:01:54 -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=YpQKJf0nCYhED+OJ4NgA+kcEUlPiaiAkjycoHn2haSw=; b=jyV40niyXaznH+xF2lsPZ3/7o3Z1xZe++umhAGYRU59whff/rMEr6MXl7gIwvw/Qhi J1gQmTIrdbe3IhUaociyBychF1i0NBZ+4lH5C/z//wTR8qVUzJA7R9gDxGGXjm6R7WEf KNh8SHeoC23dTTWCozLT3rwvUi1GuLvKpQwnmLDxkttdw1Xk4Tthk/umAjZGys/e7HlP d7SPemLpPc75vE/WHKwkSEVzmVTOntGuyrB2aQVZPn7N2K5h9qMA7hXB58ToVSLbg7o0 4bcoPi7ikgXHV5U2lAmnQ3PzFIPiiBHSv0+qcsnH3cABoBtnRcOqi+2Xzm5lgVdoORmr CJMA== 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=YpQKJf0nCYhED+OJ4NgA+kcEUlPiaiAkjycoHn2haSw=; b=7jxKZtvuiC/TrJMwfkSBdOZLl/J7zpu820ht1Tm07JZCKNQjr1/y32al+Fm7fucFdU CQFz2TtUO4Yyl8uV2tlbn2v7IhAEPbAATQkfZvcccmzFgVMiph4KKD5HISJwSNji01vu IV/0lxYgaPXLB9NRVJz1IHI8O7YV/e+EWusvv+CD3HwlamYQIjJolIu+XtOW66SpBrUW DpMS46CbDdYnFYvRnPYBD49hro6O3y/rG0e0kah3lz9EOFMGeUgZaa0SV/zp3h+835lU SFB2t1P4q9P6tQqN7G1NLO+dkaje8pyuY+LIBrmZVVmmEOWlyn71QK613CaskWEnYKbd Lb2A== X-Gm-Message-State: ACrzQf0Sl5elyiNhuv85Seatlp3HZl1LVLn3JxZsiau3pWji3w1jYiSR etbauL4IBq8kf58tZhMsUUCcrtPnRPoZlD9/ X-Google-Smtp-Source: AMsMyM40mGDjn/AE/VqMdr2FOW+ALCggd/wxgijHCfk9xkJ6ZuPgfLd2RVFKNgmsHS9AoMAJsO5AIw== X-Received: by 2002:a17:90b:30c1:b0:213:a155:949c with SMTP id hi1-20020a17090b30c100b00213a155949cmr17879204pjb.76.1667264513481; Mon, 31 Oct 2022 18:01:53 -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 a16-20020aa794b0000000b005627d995a36sm5221920pfl.44.2022.10.31.18.01.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Oct 2022 18:01:52 -0700 (PDT) From: Andy Chiu To: davem@davemloft.net, 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, krzysztof.kozlowski+dt@linaro.org, robh+dt@kernel.org, pabeni@redhat.com, edumazet@google.com, andy.chiu@sifive.com, greentime.hu@sifive.com Subject: [PATCH v2 net-next 0/3] net: axienet: Use a DT property to configure frequency of the MDIO bus Date: Tue, 1 Nov 2022 09:01:44 +0800 Message-Id: <20221101010146.900008-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-20221031_180203_400549_D728B65F X-CRM114-Status: UNSURE ( 9.77 ) 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: --- 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 (2): net: axienet: Unexport 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 | 58 +++++++++++-------- 3 files changed, 35 insertions(+), 27 deletions(-)