[PATCH] Net: add mdio_i2c driver.
cleger at kalray.eu
Fri Nov 17 02:05:47 PST 2017
I will do that, thanks for the review !
----- Mail original -----
De: "Sascha Hauer" <s.hauer at pengutronix.de>
À: "Clément Leger" <cleger at kalray.eu>
Cc: "Barebox List" <barebox at lists.infradead.org>
Envoyé: Vendredi 17 Novembre 2017 10:39:10
Objet: Re: [PATCH] Net: add mdio_i2c driver.
On Fri, Nov 17, 2017 at 10:34:07AM +0100, Clément Leger wrote:
> ----- Mail original -----
> > De: "Sascha Hauer" <s.hauer at pengutronix.de>
> > À: "Clément Leger" <cleger at kalray.eu>
> > Cc: "Barebox List" <barebox at lists.infradead.org>
> > Envoyé: Vendredi 17 Novembre 2017 10:06:58
> > Objet: Re: [PATCH] Net: add mdio_i2c driver.
> > On Fri, Nov 17, 2017 at 09:52:14AM +0100, Clément Leger wrote:
> >> Hi Sascha,
> >> Indeed, I though about that and I was facing another problem.
> >> The mdio to i2c driver does not have a specific address.
> >> ie, it is not a device but rather a bus.
> >> If I put the mdio_i2c node under the i2c bus, then I should assign
> >> it an i2c address. This address should represent the phy address.
> >> However, this would means I would have one mdio-i2c driver per phy.
> > Some AT24 EEPROMs have the same problem, they also use multiple
> > addresses. AFAIK for them only the first address is provided in the
> > "reg" property. See drivers/eeprom/at24c.c how the driver handles this
> > situation.
> From what I see, they just create a bunch of i2c device according to
> the number of address to take.
> In the case of mdio-i2c, we do not know in advance how many phy will
> be hidden behind the bus. I think I will have to go with the double
> address description.
> This will also avoid spurious i2c write by bus scanning done by phy
> detection layer.
> > Normally I think multi address devices should simply provide their
> > reg space as reg = <start size>; like other devices do aswell. I don't
> > know what the I2C core maked from this though.
> It will not work and will not even compile (with dtc errors activated)
> since the i2c controllers are almost always describe as:
> #address-cells = <1>;
> #size-cells = <0>;
> So no size cell.
> If you agree, I will go with the double device address (both in mdio-i2c and phy)
Ok, fine. BTW you do not have to instantiate all phy devices during
i2c device probe. Instead, you can instantiate it on demand when a phy
device is first accessed. This is common for other mdio devices aswell
(i.e. only the device used by the network controller will be
instantiated. Once you call the miitool command the others will show up)
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