summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorOleksij Rempel <o.rempel@pengutronix.de>2022-09-20 14:55:31 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2022-09-22 11:28:47 +0200
commit5a2f0d141912524c6e39349f53519bd7f77f1e5c (patch)
tree73bdf8a28c0da95bc79fce1073fe202592d4075f /include
parent58eb58a9af97dde4923f2f19100f393c892a9a0a (diff)
downloadbarebox-5a2f0d141912524c6e39349f53519bd7f77f1e5c.tar.gz
barebox-5a2f0d141912524c6e39349f53519bd7f77f1e5c.tar.xz
net: port support for microchip SMI0 MDIO bus
SMI0 is a mangled version of MDIO. The main low level difference is the MDIO C22 OP code is always 0, not 0x2 or 0x1 for Read/Write. The read/write information is instead encoded in the PHY address. Extend the bit-bang code to allow the op code to be overridden, but default to normal C22 values. Add an extra compatible to the mdio-gpio driver, and when this compatible is present, set the op codes to 0. A higher level driver, sitting on top of the basic MDIO bus driver can then implement the rest of the microchip SMI0 odderties. This code was ported from the kernel v6.0-rc2. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Link: https://lore.barebox.org/20220920125533.2497108-1-o.rempel@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include')
-rw-r--r--include/linux/mdio-bitbang.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/mdio-bitbang.h b/include/linux/mdio-bitbang.h
index a6e6057886..49fe435429 100644
--- a/include/linux/mdio-bitbang.h
+++ b/include/linux/mdio-bitbang.h
@@ -36,6 +36,9 @@ struct mdiobb_ctrl {
const struct mdiobb_ops *ops;
/* reset callback */
int (*reset)(struct mii_bus *bus);
+ unsigned int override_op_c22;
+ u8 op_c22_read;
+ u8 op_c22_write;
};
/* The returned bus is not yet registered with the phy layer. */