* [net PATCH] net: airoha: Fix wrong GDM4 register definition
@ 2025-01-17 15:52 Christian Marangi
2025-01-17 17:03 ` Lorenzo Bianconi
2025-01-19 1:36 ` Jakub Kicinski
0 siblings, 2 replies; 3+ messages in thread
From: Christian Marangi @ 2025-01-17 15:52 UTC (permalink / raw)
To: Felix Fietkau, Sean Wang, Lorenzo Bianconi, Andrew Lunn,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Matthias Brugger, AngeloGioacchino Del Regno, netdev,
linux-kernel, linux-arm-kernel, linux-mediatek, upstream
Cc: Christian Marangi
Fix wrong GDM4 register definition, in Airoha SDK GDM4 is defined at
offset 0x2400 but this doesn't make sense as it does conflict with the
CDM4 that is in the same location.
Following the pattern where each GDM base is at the FWD_CFG, currently
GDM4 base offset is set to 0x2500. This is correct but REG_GDM4_FWD_CFG
and REG_GDM4_SRC_PORT_SET are still using the SDK reference with the
0x2400 offset. Fix these 2 define by subtracting 0x100 to each register
to reflect the real address location.
Fixes: 23020f049327 ("net: airoha: Introduce ethernet support for EN7581 SoC")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
---
drivers/net/ethernet/mediatek/airoha_regs.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/mediatek/airoha_regs.h b/drivers/net/ethernet/mediatek/airoha_regs.h
index e448b66b5334..30c96f679735 100644
--- a/drivers/net/ethernet/mediatek/airoha_regs.h
+++ b/drivers/net/ethernet/mediatek/airoha_regs.h
@@ -249,11 +249,11 @@
#define REG_GDM3_FWD_CFG GDM3_BASE
#define GDM3_PAD_EN_MASK BIT(28)
-#define REG_GDM4_FWD_CFG (GDM4_BASE + 0x100)
+#define REG_GDM4_FWD_CFG GDM4_BASE
#define GDM4_PAD_EN_MASK BIT(28)
#define GDM4_SPORT_OFFSET0_MASK GENMASK(11, 8)
-#define REG_GDM4_SRC_PORT_SET (GDM4_BASE + 0x33c)
+#define REG_GDM4_SRC_PORT_SET (GDM4_BASE + 0x23c)
#define GDM4_SPORT_OFF2_MASK GENMASK(19, 16)
#define GDM4_SPORT_OFF1_MASK GENMASK(15, 12)
#define GDM4_SPORT_OFF0_MASK GENMASK(11, 8)
--
2.47.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [net PATCH] net: airoha: Fix wrong GDM4 register definition
2025-01-17 15:52 [net PATCH] net: airoha: Fix wrong GDM4 register definition Christian Marangi
@ 2025-01-17 17:03 ` Lorenzo Bianconi
2025-01-19 1:36 ` Jakub Kicinski
1 sibling, 0 replies; 3+ messages in thread
From: Lorenzo Bianconi @ 2025-01-17 17:03 UTC (permalink / raw)
To: Christian Marangi
Cc: Felix Fietkau, Sean Wang, Andrew Lunn, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Matthias Brugger,
AngeloGioacchino Del Regno, netdev, linux-kernel,
linux-arm-kernel, linux-mediatek, upstream
[-- Attachment #1: Type: text/plain, Size: 1708 bytes --]
On Jan 17, Christian Marangi wrote:
> Fix wrong GDM4 register definition, in Airoha SDK GDM4 is defined at
> offset 0x2400 but this doesn't make sense as it does conflict with the
> CDM4 that is in the same location.
>
> Following the pattern where each GDM base is at the FWD_CFG, currently
> GDM4 base offset is set to 0x2500. This is correct but REG_GDM4_FWD_CFG
> and REG_GDM4_SRC_PORT_SET are still using the SDK reference with the
> 0x2400 offset. Fix these 2 define by subtracting 0x100 to each register
> to reflect the real address location.
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>
>
> Fixes: 23020f049327 ("net: airoha: Introduce ethernet support for EN7581 SoC")
> Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
> ---
> drivers/net/ethernet/mediatek/airoha_regs.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/mediatek/airoha_regs.h b/drivers/net/ethernet/mediatek/airoha_regs.h
> index e448b66b5334..30c96f679735 100644
> --- a/drivers/net/ethernet/mediatek/airoha_regs.h
> +++ b/drivers/net/ethernet/mediatek/airoha_regs.h
> @@ -249,11 +249,11 @@
> #define REG_GDM3_FWD_CFG GDM3_BASE
> #define GDM3_PAD_EN_MASK BIT(28)
>
> -#define REG_GDM4_FWD_CFG (GDM4_BASE + 0x100)
> +#define REG_GDM4_FWD_CFG GDM4_BASE
> #define GDM4_PAD_EN_MASK BIT(28)
> #define GDM4_SPORT_OFFSET0_MASK GENMASK(11, 8)
>
> -#define REG_GDM4_SRC_PORT_SET (GDM4_BASE + 0x33c)
> +#define REG_GDM4_SRC_PORT_SET (GDM4_BASE + 0x23c)
> #define GDM4_SPORT_OFF2_MASK GENMASK(19, 16)
> #define GDM4_SPORT_OFF1_MASK GENMASK(15, 12)
> #define GDM4_SPORT_OFF0_MASK GENMASK(11, 8)
> --
> 2.47.1
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [net PATCH] net: airoha: Fix wrong GDM4 register definition
2025-01-17 15:52 [net PATCH] net: airoha: Fix wrong GDM4 register definition Christian Marangi
2025-01-17 17:03 ` Lorenzo Bianconi
@ 2025-01-19 1:36 ` Jakub Kicinski
1 sibling, 0 replies; 3+ messages in thread
From: Jakub Kicinski @ 2025-01-19 1:36 UTC (permalink / raw)
To: Christian Marangi
Cc: Felix Fietkau, Sean Wang, Lorenzo Bianconi, Andrew Lunn,
David S. Miller, Eric Dumazet, Paolo Abeni, Matthias Brugger,
AngeloGioacchino Del Regno, netdev, linux-kernel,
linux-arm-kernel, linux-mediatek, upstream
On Fri, 17 Jan 2025 16:52:39 +0100 Christian Marangi wrote:
> diff --git a/drivers/net/ethernet/mediatek/airoha_regs.h b/drivers/net/ethernet/mediatek/airoha_regs.h
> index e448b66b5334..30c96f679735 100644
> --- a/drivers/net/ethernet/mediatek/airoha_regs.h
> +++ b/drivers/net/ethernet/mediatek/airoha_regs.h
> @@ -249,11 +249,11 @@
> #define REG_GDM3_FWD_CFG GDM3_BASE
> #define GDM3_PAD_EN_MASK BIT(28)
>
> -#define REG_GDM4_FWD_CFG (GDM4_BASE + 0x100)
> +#define REG_GDM4_FWD_CFG GDM4_BASE
> #define GDM4_PAD_EN_MASK BIT(28)
> #define GDM4_SPORT_OFFSET0_MASK GENMASK(11, 8)
>
> -#define REG_GDM4_SRC_PORT_SET (GDM4_BASE + 0x33c)
> +#define REG_GDM4_SRC_PORT_SET (GDM4_BASE + 0x23c)
> #define GDM4_SPORT_OFF2_MASK GENMASK(19, 16)
> #define GDM4_SPORT_OFF1_MASK GENMASK(15, 12)
> #define GDM4_SPORT_OFF0_MASK GENMASK(11, 8)
These are defined in drivers/net/ethernet/mediatek/airoha_eth.c
in the networking trees.
--
pw-bot: cr
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-01-19 1:36 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-17 15:52 [net PATCH] net: airoha: Fix wrong GDM4 register definition Christian Marangi
2025-01-17 17:03 ` Lorenzo Bianconi
2025-01-19 1:36 ` Jakub Kicinski
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).