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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1FA06C433FE for ; Sun, 26 Dec 2021 21:51:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234630AbhLZVvU (ORCPT ); Sun, 26 Dec 2021 16:51:20 -0500 Received: from vps0.lunn.ch ([185.16.172.187]:42108 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234563AbhLZVvT (ORCPT ); Sun, 26 Dec 2021 16:51:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=KWjqwqswlcdAbUhm0etBm0ynDTKsWAc8HBTk4QxWbYs=; b=BI7SqIkp3zkvi0hI4KU5ODmyQD WGywKCiQGEmNIbfPZYXn5sRy4QU7/IFELfz/ieoz4BBOsEVK6NlgTBIUd2LQDnyAoqp/BXxZ8WUSk f/Y2q0sWTA/Eyug/EzLEQ1Z96l6upaCbWCDIz0HtX3SLSEf+yVWhzq74+3r+AkVgBbKI=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1n1bQ4-00HWwe-62; Sun, 26 Dec 2021 22:51:08 +0100 Date: Sun, 26 Dec 2021 22:51:08 +0100 From: Andrew Lunn To: Daniel Golle Cc: linux-mediatek@lists.infradead.org, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Felix Fietkau , John Crispin , Sean Wang , Mark Lee , "David S. Miller" , Jakub Kicinski , Matthias Brugger , Russell King Subject: Re: [PATCH] net: ethernet: mtk_eth_soc: implement Clause 45 MDIO access Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > + if (phy_register & MII_ADDR_C45) { > + u8 dev_num = (phy_register >> 16) & 0x1f; > + u16 reg = (u16)(phy_register & 0xffff); Hi Daniel You can use the helpers mdio_phy_id_is_c45() mdio_phy_id_prtad() mdio_phy_id_devad() Andrew 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 D23AFC433F5 for ; Sun, 26 Dec 2021 21:51:27 +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=4Gawx4IXSPh3mcOyBvWyWeUIEopIOGLptWR7OxpBXzw=; b=CiT6yob9CcUlor wr8bqR7DyphbqZjDrQFPNxJMTIt640iTCvi89cbUHRluMUfu6Iwcn1U16bGRQ0qPjyasLBezfXjYj qB69MYdOTZ2NxgoHsF6GqEWg0GwXx2g0DUTQyqZ40iYFpYE2YT5y6gRZuu2c7Mmgkn+9l4h+GKYnM gOMPUEPtBIECkmRm4JXqf4khyzd+TKgO6vnx4T6qwQsmWCOpqXJwrX+PYGGuMDBskyF7kz5wLAed1 gixnLIUM1XGungx+ttR5yVMLFwrzsLroGkJQwv/x4q9g1YSno3dSgiy2Xfaw5gHuWigjCtOf9N8/g lgAd2jPHu5UdG5h6TGBA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n1bQE-00FtCO-UJ; Sun, 26 Dec 2021 21:51:18 +0000 Received: from vps0.lunn.ch ([185.16.172.187]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n1bQC-00FtBU-Bx; Sun, 26 Dec 2021 21:51:17 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=KWjqwqswlcdAbUhm0etBm0ynDTKsWAc8HBTk4QxWbYs=; b=BI7SqIkp3zkvi0hI4KU5ODmyQD WGywKCiQGEmNIbfPZYXn5sRy4QU7/IFELfz/ieoz4BBOsEVK6NlgTBIUd2LQDnyAoqp/BXxZ8WUSk f/Y2q0sWTA/Eyug/EzLEQ1Z96l6upaCbWCDIz0HtX3SLSEf+yVWhzq74+3r+AkVgBbKI=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1n1bQ4-00HWwe-62; Sun, 26 Dec 2021 22:51:08 +0100 Date: Sun, 26 Dec 2021 22:51:08 +0100 From: Andrew Lunn To: Daniel Golle Cc: linux-mediatek@lists.infradead.org, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Felix Fietkau , John Crispin , Sean Wang , Mark Lee , "David S. Miller" , Jakub Kicinski , Matthias Brugger , Russell King Subject: Re: [PATCH] net: ethernet: mtk_eth_soc: implement Clause 45 MDIO access 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-20211226_135116_433758_E6F88B04 X-CRM114-Status: UNSURE ( 6.27 ) X-CRM114-Notice: Please train this message. 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 > + if (phy_register & MII_ADDR_C45) { > + u8 dev_num = (phy_register >> 16) & 0x1f; > + u16 reg = (u16)(phy_register & 0xffff); Hi Daniel You can use the helpers mdio_phy_id_is_c45() mdio_phy_id_prtad() mdio_phy_id_devad() Andrew _______________________________________________ Linux-mediatek mailing list Linux-mediatek@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-mediatek 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 912CFC433EF for ; Sun, 26 Dec 2021 21:52:56 +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=74tV8TkekKpjxqaOEx1A1JgucO/+tXa6Gh1uS0BgywE=; b=fWAi6GwMmYUnOf UNjTMV24wEYRfWap0AOyATnXVRTuXOsj+T1Z6sWJysg+g2NmJ3Wtk2w3QrnwWpTPD68/ddJNjC01y 4hC6ppubMcYeg+P8+GZrrh62dRCX3yN3nkHfgahNityBAYHGVwWi5IeogGf9M3tRSVJFjpU3UEYft vw/9tOXHQvKuJOXTXeR1O8P19vfBh0qBIINNFZIR1LyuX25S9CQZosWmtlQe2X1Fvz0W8Uet3NKvS qSCWA9SwgYuJxVBHOjFKgEx/ZdGOSOY3Q8qCRZ0OuKVJaiXM+hj9B3Zz9aK5vx1T5pMdZkSswJ9OH D+0dOoYXXxuKtusUUIeA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n1bQG-00FtCV-HT; Sun, 26 Dec 2021 21:51:20 +0000 Received: from vps0.lunn.ch ([185.16.172.187]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n1bQC-00FtBU-Bx; Sun, 26 Dec 2021 21:51:17 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=KWjqwqswlcdAbUhm0etBm0ynDTKsWAc8HBTk4QxWbYs=; b=BI7SqIkp3zkvi0hI4KU5ODmyQD WGywKCiQGEmNIbfPZYXn5sRy4QU7/IFELfz/ieoz4BBOsEVK6NlgTBIUd2LQDnyAoqp/BXxZ8WUSk f/Y2q0sWTA/Eyug/EzLEQ1Z96l6upaCbWCDIz0HtX3SLSEf+yVWhzq74+3r+AkVgBbKI=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1n1bQ4-00HWwe-62; Sun, 26 Dec 2021 22:51:08 +0100 Date: Sun, 26 Dec 2021 22:51:08 +0100 From: Andrew Lunn To: Daniel Golle Cc: linux-mediatek@lists.infradead.org, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Felix Fietkau , John Crispin , Sean Wang , Mark Lee , "David S. Miller" , Jakub Kicinski , Matthias Brugger , Russell King Subject: Re: [PATCH] net: ethernet: mtk_eth_soc: implement Clause 45 MDIO access 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-20211226_135116_433758_E6F88B04 X-CRM114-Status: UNSURE ( 6.27 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org > + if (phy_register & MII_ADDR_C45) { > + u8 dev_num = (phy_register >> 16) & 0x1f; > + u16 reg = (u16)(phy_register & 0xffff); Hi Daniel You can use the helpers mdio_phy_id_is_c45() mdio_phy_id_prtad() mdio_phy_id_devad() Andrew _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel