From mboxrd@z Thu Jan 1 00:00:00 1970 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 A4A3AC433EF for ; Sun, 2 Jan 2022 15:48:24 +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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=CmW0U0xwnbcPqr2MQjzbuTHjU5UzNHcQLB/L7HHeJJU=; b=i9SrnnB9L6yFoe fDRd8ZdIQ6nx50O2T0WlzAYiAP/OGlU+OulEwD86w6lwA8GgLbX8aKV/NbVjGw6HeXgevr3JvJpS9 R6FvSBjeg8iMVecCHhOnzzDwy2J0Y5zYIfNGGPdN4RVwmeW6TBD0qVG2JEGGVVHt96eDd7lT1JBgB UPmLGP0wBKj066EZ/AWa5X2TzxZKR1TdANj8jvbwC7VXiPubpErBs6dgbNPVHsoBJgmyPsrb6Z0s3 z6M5duOvn4yZ2C3uw4UbzPfnbukdLr60/WbAffLyrS/lrSRGt9UqlEMY6qvDXhTHDTsPthg/OF5sD aK/XOhG74EWLFb9lW3jQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n435g-007tCH-V4; Sun, 02 Jan 2022 15:48:12 +0000 Received: from fudo.makrotopia.org ([2a07:2ec0:3002::71]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n435d-007tA8-F6; Sun, 02 Jan 2022 15:48:11 +0000 Received: from local by fudo.makrotopia.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.94.2) (envelope-from ) id 1n435U-00017V-HF; Sun, 02 Jan 2022 16:48:00 +0100 Date: Sun, 2 Jan 2022 15:47:52 +0000 From: Daniel Golle To: linux-mediatek@lists.infradead.org, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Felix Fietkau , John Crispin , Sean Wang , Mark Lee , "David S. Miller" , Jakub Kicinski , Matthias Brugger , Russell King , Andrew Lunn , Michael Lee , Heiner Kallweit Subject: [PATCH v10 0/3] net: ethernet: mtk_eth_soc: refactoring and Clause 45 Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220102_074809_561822_D209BBCE X-CRM114-Status: GOOD ( 11.30 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org Rework value and type of mdio read and write functions in mtk_eth_soc and generally clean up and unify both functions. Then add support to access Clause 45 phy registers, using newly introduced helper macros added by a patch Russell King has suggested in a reply to an earlier version of this series [1]. All three commits are tested on the Bananapi BPi-R64 board having MediaTek MT7531BE DSA gigE switch using clause 22 MDIO and Ubiquiti UniFi 6 LR access point having Aquantia AQR112C PHY using clause 45 MDIO. [1]: https://lore.kernel.org/netdev/Ycr5Cna76eg2B0An@shell.armlinux.org.uk/ v10: correct order of SoB lines in 2/3, change patch order in series v9: improved formatting and Cc missing maintainer v8: add patch from Russel King, switch to bitfield helper macros v7: remove unneeded variables and order OR-ed call parameters v6: further clean up functions and more cleanly separate patches v5: fix wrong variable name in first patch covered by follow-up patch v4: clean-up return values and types, split into two commits v3: return -1 instead of 0xffff on error in _mtk_mdio_write v2: use MII_DEVADDR_C45_SHIFT and MII_REGADDR_C45_MASK to extract device id and register address. Unify read and write functions to have identical types and parameter names where possible as we are anyway already replacing both function bodies. Daniel Golle (2): net: ethernet: mtk_eth_soc: fix return value and refactor MDIO ops net: ethernet: mtk_eth_soc: implement Clause 45 MDIO access Russell King (Oracle) (1): net: mdio: add helpers to extract clause 45 regad and devad fields drivers/net/ethernet/mediatek/mtk_eth_soc.c | 85 +++++++++++++++------ drivers/net/ethernet/mediatek/mtk_eth_soc.h | 19 +++-- include/linux/mdio.h | 12 +++ 3 files changed, 89 insertions(+), 27 deletions(-) -- 2.34.1 _______________________________________________ Linux-mediatek mailing list Linux-mediatek@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-mediatek