From: "Russell King (Oracle)" <rmk+kernel@armlinux.org.uk>
To: "David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>
Cc: "Marek Behún" <kabel@kernel.org>, "Felix Fietkau" <nbd@nbd.name>,
"John Crispin" <john@phrozen.org>,
linux-arm-kernel@lists.infradead.org,
linux-mediatek@lists.infradead.org,
"Mark Lee" <Mark-MC.Lee@mediatek.com>,
"Matthias Brugger" <matthias.bgg@gmail.com>,
netdev@vger.kernel.org, "Paolo Abeni" <pabeni@redhat.com>,
"Sean Wang" <sean.wang@mediatek.com>,
"Eric Dumazet" <edumazet@google.com>
Subject: [PATCH net-next 03/12] net: mtk_eth_soc: add mask and update PCS speed definitions
Date: Wed, 18 May 2022 15:54:42 +0100 [thread overview]
Message-ID: <E1nrL4U-00AM4q-2X@rmk-PC.armlinux.org.uk> (raw)
In-Reply-To: <YoUIX+BN/ZbyXzTT@shell.armlinux.org.uk>
The PCS speed setting is a two bit field, but it is defined as two
separate bits. Add a bitfield mask for the speed definitions, an
use the FIELD_PREP() macro to define each PCS speed.
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
---
drivers/net/ethernet/mediatek/mtk_eth_soc.h | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.h b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
index 085f53d23f25..4f97195159f3 100644
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
@@ -17,6 +17,7 @@
#include <linux/phylink.h>
#include <linux/rhashtable.h>
#include <linux/dim.h>
+#include <linux/bitfield.h>
#include "mtk_ppe.h"
#define MTK_QDMA_PAGE_SIZE 2048
@@ -493,9 +494,10 @@
#define SGMSYS_SGMII_MODE 0x20
#define SGMII_IF_MODE_BIT0 BIT(0)
#define SGMII_SPEED_DUPLEX_AN BIT(1)
-#define SGMII_SPEED_10 0x0
-#define SGMII_SPEED_100 BIT(2)
-#define SGMII_SPEED_1000 BIT(3)
+#define SGMII_SPEED_MASK GENMASK(3, 2)
+#define SGMII_SPEED_10 FIELD_PREP(SGMII_SPEED_MASK, 0)
+#define SGMII_SPEED_100 FIELD_PREP(SGMII_SPEED_MASK, 1)
+#define SGMII_SPEED_1000 FIELD_PREP(SGMII_SPEED_MASK, 2)
#define SGMII_DUPLEX_FULL BIT(4)
#define SGMII_IF_MODE_BIT5 BIT(5)
#define SGMII_REMOTE_FAULT_DIS BIT(8)
--
2.30.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2022-05-18 14:56 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-18 14:53 [PATCH net-next 00/12] mtk_eth_soc phylink updates Russell King (Oracle)
2022-05-18 14:54 ` [PATCH net-next 01/12] net: mtk_eth_soc: remove unused mac->mode Russell King (Oracle)
2022-05-18 14:54 ` [PATCH net-next 02/12] net: mtk_eth_soc: remove unused sgmii flags Russell King (Oracle)
2022-05-18 14:54 ` Russell King (Oracle) [this message]
2022-05-18 14:54 ` [PATCH net-next 04/12] net: mtk_eth_soc: correct 802.3z speed setting Russell King (Oracle)
2022-05-18 14:54 ` [PATCH net-next 05/12] net: mtk_eth_soc: correct 802.3z duplex setting Russell King
2022-05-18 14:54 ` [PATCH net-next 06/12] net: mtk_eth_soc: stop passing phylink state to sgmii setup Russell King (Oracle)
2022-05-18 14:55 ` [PATCH net-next 07/12] net: mtk_eth_soc: provide mtk_sgmii_config() Russell King (Oracle)
2022-05-18 14:55 ` [PATCH net-next 08/12] net: mtk_eth_soc: add fixme comment for state->speed use Russell King (Oracle)
2022-05-18 14:55 ` [PATCH net-next 09/12] net: mtk_eth_soc: move MAC_MCR setting to mac_finish() Russell King (Oracle)
2022-05-18 14:55 ` [PATCH net-next 10/12] net: mtk_eth_soc: move restoration of SYSCFG0 " Russell King (Oracle)
2022-05-18 14:55 ` [PATCH net-next 11/12] net: mtk_eth_soc: convert code structure to suit split PCS support Russell King (Oracle)
2022-05-18 14:55 ` [PATCH net-next 12/12] net: mtk_eth_soc: partially convert to phylink_pcs Russell King (Oracle)
2022-05-18 15:40 ` [PATCH net-next 00/12] mtk_eth_soc phylink updates Marek Behún
2022-05-20 1:20 ` patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=E1nrL4U-00AM4q-2X@rmk-PC.armlinux.org.uk \
--to=rmk+kernel@armlinux.org.uk \
--cc=Mark-MC.Lee@mediatek.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=john@phrozen.org \
--cc=kabel@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=matthias.bgg@gmail.com \
--cc=nbd@nbd.name \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sean.wang@mediatek.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).