[PATCH] Net: add mdio_i2c driver.
Sascha Hauer
s.hauer at pengutronix.de
Fri Nov 17 00:33:40 PST 2017
Hi Clément,
On Tue, Nov 14, 2017 at 02:34:51PM +0100, Clément Leger wrote:
> From 1238b5c70d29762074bc71ac25623b958af9010a Mon Sep 17 00:00:00 2001
> From: Clement Leger <clement.leger at kalray.eu>
> Date: Wed, 8 Nov 2017 09:13:10 +0100
> Subject: [PATCH] Net: add mdio_i2c driver (i2c to mdio bridge).
>
> +++ b/dts/Bindings/net/mdio-i2c.txt
> @@ -0,0 +1,19 @@
> +MDIO on I2C Bus
> +This compatible allows to use phy devices connected to an i2c bus
> +and expecting to be use with mdio protocol.
> +
> +Currently defined compatibles:
> +- virtual,mdio-i2c
> +
> +Required properties:
> +- i2c-bus: A phandle on the I2C bus acting as a MDIO bridge where phys
> + are connected to.
> +
> +Example:
> +
> +mdio0 at i2c {
> + compatible = "virtual,mdio-i2c";
> + #address-cells = <1>;
> + #size-cells = <0>;
> + i2c-bus = <&i2c_bus>;
> +};
The binding looks the wrong way round. Ethernet phys should be child
nodes of the bus providing the control port to them. So, the mdio-i2c
device should be a child node of the i2c bus on which it is attached.
Instead of providing a phandle from the mdio phy to the i2c bus you
then provide a "phy-handle" phandle from the network controller to the
mdio-i2c. The "phy-handle" phandle is evaluated from the barebox phy
code already, so once you register a mdio-bus the connection between the
ethernet device and the mdio bus should just work.
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
More information about the barebox
mailing list