The high port count models of the Realtek Otto switches have additional
registers to instrument the MDIO controller. These are:
- High port mask: A bitfield that extends the already existing low port
mask to select ports starting from 32.
- Broadcast: This takes the port number during reads on the RTL931x.
- Extended page: Some additional page info. The SDK does not give much
information about this. Basically some fixed value must be written
into it during access.
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://patch.msgid.link/20260610194145.4153668-5-markus.stockhausen@gmx.de
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
u32 c45_data;
u32 io_data;
u32 port_mask_low;
+ /* additional registers for high port count models RTL839x/RTL931x */
+ u32 port_mask_high;
+ u32 broadcast;
+ u32 ext_page;
};
struct otto_emdio_priv {
return ret;
/* Fill all registers. Hardware will read only the needed bits depending on command */
+ if (info->cmd_regs.port_mask_high) {
+ /* Fill extra registers for high port count models */
+ ret = regmap_write(priv->regmap, info->cmd_regs.broadcast, cmd_data->broadcast);
+ if (ret)
+ return ret;
+
+ ret = regmap_write(priv->regmap, info->cmd_regs.ext_page, cmd_data->ext_page);
+ if (ret)
+ return ret;
+
+ ret = regmap_write(priv->regmap,
+ info->cmd_regs.port_mask_high, cmd_data->port_mask_high);
+ if (ret)
+ return ret;
+ }
+
ret = regmap_write(priv->regmap, info->cmd_regs.port_mask_low, cmd_data->port_mask_low);
if (ret)
return ret;