summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Vasut <[email protected]>2025-10-27 17:45:38 +0100
committerMarek Vasut <[email protected]>2025-11-06 20:08:37 +0100
commit7f7cd08370f7a3784b7fcae3a0bef974158c6068 (patch)
tree8b8376d4ec376131fdd132cdd6e0d80939f9b602
parenta9d08197743005c37e7081ea7d797c5188f1654c (diff)
net: rswitch: Parametrize forwarding engine CSD register offset
The forwarding engine CSD register offset changed between the R-Car S4 and R-Car X5H. Parametrize this offset in preparation for R-Car X5H addition into this driver. Clean up the macro parameter names and make them more obvious. No functional change. Signed-off-by: Marek Vasut <[email protected]>
-rw-r--r--drivers/net/rswitch.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/net/rswitch.c b/drivers/net/rswitch.c
index 419293091f6..096e1c99220 100644
--- a/drivers/net/rswitch.c
+++ b/drivers/net/rswitch.c
@@ -111,8 +111,9 @@
FWPC0_IPDSA | FWPC0_IPHLA | FWPC0_MACSDA | \
FWPC0_MACHLA | FWPC0_MACHMA | FWPC0_VLANSA)
-#define FWPBFC(i) (FWPBFCR + (i) * 0x10)
-#define FWPBFCSDC(j, i) (FWPBFCSDCR + (i) * 0x10 + (j) * 0x04)
+#define FWPBFC(i) (FWPBFCR + (i) * 0x10)
+#define FWPBFCSDC(gwcaidx, ethaidx, ethaincr) \
+ (FWPBFCSDCR + (ethaidx) * (ethaincr) + (gwcaidx) * 0x04)
/* ETHA */
#define EATASRIRM_TASRIOG BIT(0)
@@ -282,6 +283,7 @@ struct rswitch_drv_data {
u32 coma_offset;
u32 etha_offset;
u32 gwca_offset;
+ u8 etha_incr;
int ports;
};
@@ -682,7 +684,8 @@ static void rswitch_mfwd_init(struct rswitch_port_priv *priv)
writel(FWPC0_DEFAULT, priv->addr + FWPC0(gwca->index));
writel(RSWITCH_RX_CHAIN_INDEX,
- priv->addr + FWPBFCSDC(gwca_index, etha_index));
+ priv->addr + FWPBFCSDC(gwca_index, etha_index,
+ priv->drv_data->etha_incr));
writel(BIT(gwca->index),
priv->addr + FWPBFC(etha_index));
@@ -1195,6 +1198,7 @@ static const struct rswitch_drv_data r8a779f0_drv_data = {
.coma_offset = 0x9000,
.etha_offset = 0xa000,
.gwca_offset = 0x10000,
+ .etha_incr = 0x10,
};
static const struct udevice_id rswitch_ids[] = {