From: "Russell King (Oracle)" <rmk+kernel@armlinux.org.uk>
To: Serge Semin <fancer.lancer@gmail.com>
Cc: Alexandre Torgue <alexandre.torgue@foss.st.com>,
Alexei Starovoitov <ast@kernel.org>,
Andrew Halaney <ahalaney@redhat.com>,
bpf@vger.kernel.org, Daniel Borkmann <daniel@iogearbox.net>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>,
Jesper Dangaard Brouer <hawk@kernel.org>,
John Fastabend <john.fastabend@gmail.com>,
Jose Abreu <joabreu@synopsys.com>,
linux-arm-kernel@lists.infradead.org,
linux-arm-msm@vger.kernel.org,
linux-stm32@st-md-mailman.stormreply.com,
Maxime Coquelin <mcoquelin.stm32@gmail.com>,
netdev@vger.kernel.org, Paolo Abeni <pabeni@redhat.com>,
Vinod Koul <vkoul@kernel.org>
Subject: [PATCH net-next 12/14] net: stmmac: rename PCS registers
Date: Fri, 02 Aug 2024 11:47:27 +0100 [thread overview]
Message-ID: <E1sZpol-000eHs-Cn@rmk-PC.armlinux.org.uk> (raw)
In-Reply-To: <Zqy4wY0Of8noDqxt@shell.armlinux.org.uk>
Rename the PCS registers from GMAC_xxx to STMMAC_PCS_xxx to make it
clear that they are for the PCS. Avoid using PCS_ as this is too
generic and may (eventually) clash with definitions elsewhere in the
kernel.
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
---
.../net/ethernet/stmicro/stmmac/stmmac_pcs.c | 16 +++---
.../net/ethernet/stmicro/stmmac/stmmac_pcs.h | 52 +++++++++----------
2 files changed, 34 insertions(+), 34 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_pcs.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_pcs.c
index e435facc9849..7960bfd83b74 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_pcs.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_pcs.c
@@ -8,26 +8,26 @@ static void __dwmac_ctrl_ane(struct stmmac_pcs *spcs, bool ane, bool srgmi_ral,
{
u32 val;
- val = readl(spcs->pcs_base + GMAC_AN_CTRL(0));
+ val = readl(spcs->pcs_base + STMMAC_PCS_AN_CTRL);
/* Enable and restart the Auto-Negotiation */
if (ane)
- val |= GMAC_AN_CTRL_ANE | GMAC_AN_CTRL_RAN;
+ val |= STMMAC_PCS_AN_CTRL_ANE | STMMAC_PCS_AN_CTRL_RAN;
else
- val &= ~GMAC_AN_CTRL_ANE;
+ val &= ~STMMAC_PCS_AN_CTRL_ANE;
/* In case of MAC-2-MAC connection, block is configured to operate
* according to MAC conf register.
*/
if (srgmi_ral)
- val |= GMAC_AN_CTRL_SGMRAL;
+ val |= STMMAC_PCS_AN_CTRL_SGMRAL;
if (loopback)
- val |= GMAC_AN_CTRL_ELE;
+ val |= STMMAC_PCS_AN_CTRL_ELE;
else
- val &= ~GMAC_AN_CTRL_ELE;
+ val &= ~STMMAC_PCS_AN_CTRL_ELE;
- writel(val, spcs->pcs_base + GMAC_AN_CTRL(0));
+ writel(val, spcs->pcs_base + STMMAC_PCS_AN_CTRL);
}
/**
@@ -53,7 +53,7 @@ int dwmac_pcs_config(struct phylink_pcs *pcs, unsigned int neg_mode,
{
struct stmmac_pcs *spcs = phylink_pcs_to_stmmac_pcs(pcs);
- /* The RGMII interface does not have the GMAC_AN_CTRL register */
+ /* The RGMII interface does not have the STMMAC_PCS_AN_CTRL register */
if (phy_interface_mode_is_rgmii(spcs->priv->plat->mac_interface))
return 0;
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_pcs.h b/drivers/net/ethernet/stmicro/stmmac/stmmac_pcs.h
index c73a08dab7b2..1827c7e64dba 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_pcs.h
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_pcs.h
@@ -14,37 +14,37 @@
#include "common.h"
/* PCS registers (AN/TBI/SGMII/RGMII) offsets */
-#define GMAC_AN_CTRL(x) (x) /* AN control */
-#define GMAC_AN_STATUS(x) (x + 0x4) /* AN status */
+#define STMMAC_PCS_AN_CTRL 0x00 /* AN control */
+#define STMMAC_PCS_AN_STATUS 0x04 /* AN status */
/* ADV, LPA and EXP are only available for the TBI and RTBI interfaces */
-#define GMAC_ANE_ADV(x) (x + 0x8) /* ANE Advertisement */
-#define GMAC_ANE_LPA(x) (x + 0xc) /* ANE link partener ability */
-#define GMAC_ANE_EXP(x) (x + 0x10) /* ANE expansion */
-#define GMAC_TBI(x) (x + 0x14) /* TBI extend status */
+#define STMMAC_PCS_ANE_ADV 0x08 /* ANE Advertisement */
+#define STMMAC_PCS_ANE_LPA 0x0c /* ANE link partener ability */
+#define STMMAC_PCS_ANE_EXP 0x10 /* ANE expansion */
+#define STMMAC_PCS_TBI 0x14 /* TBI extend status */
/* AN Configuration defines */
-#define GMAC_AN_CTRL_RAN BIT(9) /* Restart Auto-Negotiation */
-#define GMAC_AN_CTRL_ANE BIT(12) /* Auto-Negotiation Enable */
-#define GMAC_AN_CTRL_ELE BIT(14) /* External Loopback Enable */
-#define GMAC_AN_CTRL_ECD BIT(16) /* Enable Comma Detect */
-#define GMAC_AN_CTRL_LR BIT(17) /* Lock to Reference */
-#define GMAC_AN_CTRL_SGMRAL BIT(18) /* SGMII RAL Control */
+#define STMMAC_PCS_AN_CTRL_RAN BIT(9) /* Restart Auto-Negotiation */
+#define STMMAC_PCS_AN_CTRL_ANE BIT(12) /* Auto-Negotiation Enable */
+#define STMMAC_PCS_AN_CTRL_ELE BIT(14) /* External Loopback Enable */
+#define STMMAC_PCS_AN_CTRL_ECD BIT(16) /* Enable Comma Detect */
+#define STMMAC_PCS_AN_CTRL_LR BIT(17) /* Lock to Reference */
+#define STMMAC_PCS_AN_CTRL_SGMRAL BIT(18) /* SGMII RAL Control */
/* AN Status defines */
-#define GMAC_AN_STATUS_LS BIT(2) /* Link Status 0:down 1:up */
-#define GMAC_AN_STATUS_ANA BIT(3) /* Auto-Negotiation Ability */
-#define GMAC_AN_STATUS_ANC BIT(5) /* Auto-Negotiation Complete */
-#define GMAC_AN_STATUS_ES BIT(8) /* Extended Status */
+#define STMMAC_PCS_AN_STATUS_LS BIT(2) /* Link Status 0:down 1:up */
+#define STMMAC_PCS_AN_STATUS_ANA BIT(3) /* Auto-Negotiation Ability */
+#define STMMAC_PCS_AN_STATUS_ANC BIT(5) /* Auto-Negotiation Complete */
+#define STMMAC_PCS_AN_STATUS_ES BIT(8) /* Extended Status */
/* ADV and LPA defines */
-#define GMAC_ANE_FD BIT(5)
-#define GMAC_ANE_HD BIT(6)
-#define GMAC_ANE_PSE GENMASK(8, 7)
-#define GMAC_ANE_PSE_SHIFT 7
-#define GMAC_ANE_RFE GENMASK(13, 12)
-#define GMAC_ANE_RFE_SHIFT 12
-#define GMAC_ANE_ACK BIT(14)
+#define STMMAC_PCS_ANE_FD BIT(5)
+#define STMMAC_PCS_ANE_HD BIT(6)
+#define STMMAC_PCS_ANE_PSE GENMASK(8, 7)
+#define STMMAC_PCS_ANE_PSE_SHIFT 7
+#define STMMAC_PCS_ANE_RFE GENMASK(13, 12)
+#define STMMAC_PCS_ANE_RFE_SHIFT 12
+#define STMMAC_PCS_ANE_ACK BIT(14)
/* MAC specific status - for RGMII and SGMII. These appear as
* GMAC_RGSMIIIS[15:0] and GMAC_PHYIF_CONTROL_STATUS[31:16]
@@ -72,17 +72,17 @@ static inline void dwmac_pcs_isr(struct stmmac_pcs *spcs,
unsigned int intr_status,
struct stmmac_extra_stats *x)
{
- u32 val = readl(spcs->pcs_base + GMAC_AN_STATUS(0));
+ u32 val = readl(spcs->pcs_base + STMMAC_PCS_AN_STATUS);
if (intr_status & PCS_ANE_IRQ) {
x->irq_pcs_ane_n++;
- if (val & GMAC_AN_STATUS_ANC)
+ if (val & STMMAC_PCS_AN_STATUS_ANC)
pr_info("stmmac_pcs: ANE process completed\n");
}
if (intr_status & PCS_LINK_IRQ) {
x->irq_pcs_link_n++;
- if (val & GMAC_AN_STATUS_LS)
+ if (val & STMMAC_PCS_AN_STATUS_LS)
pr_info("stmmac_pcs: Link Up\n");
else
pr_info("stmmac_pcs: Link Down\n");
--
2.30.2
next prev parent reply other threads:[~2024-08-02 10:57 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-02 10:45 [PATCH RFC v3 0/14] net: stmmac: convert stmmac "pcs" to phylink Russell King (Oracle)
2024-08-02 10:46 ` [PATCH net-next 01/14] net: stmmac: qcom-ethqos: add ethqos_pcs_set_inband() Russell King (Oracle)
2024-08-02 17:55 ` Andrew Halaney
2024-08-02 10:46 ` [PATCH net-next 02/14] net: stmmac: replace ioaddr with stmmac_priv for pcs_set_ane() method Russell King (Oracle)
2024-08-02 18:01 ` Andrew Halaney
2024-08-02 10:46 ` [PATCH net-next 03/14] net: stmmac: remove pcs_get_adv_lp() support Russell King (Oracle)
2024-08-02 18:08 ` Andrew Halaney
2024-08-02 10:46 ` [PATCH net-next 04/14] net: stmmac: add infrastructure for hwifs to provide PCS Russell King (Oracle)
2024-08-02 18:27 ` Andrew Halaney
2024-08-02 10:46 ` [PATCH net-next 05/14] net: stmmac: provide core phylink PCS infrastructure Russell King (Oracle)
2024-08-02 10:46 ` [PATCH net-next 06/14] net: stmmac: dwmac1000: convert sgmii/rgmii "pcs" to phylink Russell King (Oracle)
2024-08-02 10:47 ` [PATCH net-next 07/14] net: stmmac: dwmac1000: move PCS interrupt control Russell King (Oracle)
2024-08-02 10:47 ` [PATCH net-next 08/14] net: stmmac: dwmac4: convert sgmii/rgmii "pcs" to phylink Russell King (Oracle)
2024-08-02 10:47 ` [PATCH net-next 09/14] net: stmmac: dwmac4: move PCS interrupt control Russell King (Oracle)
2024-08-02 10:47 ` [PATCH net-next 10/14] net: stmmac: move dwmac_ctrl_ane() into stmmac_pcs.c Russell King (Oracle)
2024-08-02 18:45 ` Andrew Halaney
2024-08-02 10:47 ` [PATCH net-next 11/14] net: stmmac: pass stmmac_pcs into dwmac_pcs_isr() Russell King (Oracle)
2024-08-02 18:52 ` Andrew Halaney
2024-08-02 10:47 ` Russell King (Oracle) [this message]
2024-08-02 10:47 ` [PATCH net-next 13/14] net: stmmac: remove obsolete pcs methods and associated code Russell King (Oracle)
2024-08-02 19:02 ` Andrew Halaney
2024-08-02 19:22 ` Russell King (Oracle)
2024-08-05 15:07 ` Andrew Halaney
2024-08-02 10:47 ` [PATCH net-next 14/14] net: stmmac: Activate Inband/PCS flag based on the selected iface Russell King
2024-08-02 19:12 ` Andrew Halaney
2024-08-02 19:31 ` Russell King (Oracle)
2024-08-02 19:52 ` [PATCH RFC v3 0/14] net: stmmac: convert stmmac "pcs" to phylink Andrew Halaney
2024-08-02 22:48 ` Jakub Kicinski
2024-08-05 10:11 ` Bartosz Golaszewski
2024-08-05 10:14 ` Bartosz Golaszewski
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=E1sZpol-000eHs-Cn@rmk-PC.armlinux.org.uk \
--to=rmk+kernel@armlinux.org.uk \
--cc=ahalaney@redhat.com \
--cc=alexandre.torgue@foss.st.com \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=fancer.lancer@gmail.com \
--cc=hawk@kernel.org \
--cc=joabreu@synopsys.com \
--cc=john.fastabend@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=mcoquelin.stm32@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=vkoul@kernel.org \
/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).