mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: "Clément Leger" <cleger@kalray.eu>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Barebox List <barebox@lists.infradead.org>
Subject: Re: [PATCH] Net: add mdio_i2c driver.
Date: Fri, 17 Nov 2017 10:34:07 +0100 (CET)	[thread overview]
Message-ID: <1996437973.55908008.1510911247927.JavaMail.zimbra@kalray.eu> (raw)
In-Reply-To: <20171117090657.mux43ro5gkrtfeor@pengutronix.de>


----- Mail original -----
> De: "Sascha Hauer" <s.hauer@pengutronix.de>
> À: "Clément Leger" <cleger@kalray.eu>
> Cc: "Barebox List" <barebox@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)

Clément

> 
> 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 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2017-11-17  9:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-14 13:34 Clément Leger
2017-11-17  8:33 ` Sascha Hauer
2017-11-17  8:52   ` Clément Leger
2017-11-17  9:06     ` Sascha Hauer
2017-11-17  9:34       ` Clément Leger [this message]
2017-11-17  9:39         ` Sascha Hauer
2017-11-17 10:05           ` Clément Leger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1996437973.55908008.1510911247927.JavaMail.zimbra@kalray.eu \
    --to=cleger@kalray.eu \
    --cc=barebox@lists.infradead.org \
    --cc=s.hauer@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox