[U-Boot] [RFC PATCH 2/2] dm: i2c: support 10bit addressing in I2C uclass layer

Simon Glass sjg at chromium.org
Fri Dec 19 22:34:46 CET 2014


Hi Masahiro,

On 19 December 2014 at 11:34, Masahiro Yamada <yamada.m at jp.panasonic.com> wrote:
> Master send to / receive from 10-bit addressed slave devices
> can be supported by software layer without any hardware change
> because the LSB 8bit of the slave address is treated as data part.
>
> Master Send to a 10bit-addressed slave chip is performed like this:
>
>  DIR    Format
>  M->S   11110 + address[9:8] + R/W(0)
>  M->S   address[7:0]
>  M->S   data0
>  M->S   data1
>       ...
>
> Master Receive from a 10bit-addressed slave chip is like this:
>
>  DIR    Format
>  M->S   11110 + address[9:8] + R/W(0)
>  M->S   address[7:0]
>         (Restart)
>  M->S   111110 + address[9:8] + R/W(1)
>  S->M   data0
>  S->M   data1
>       ...
>
> Signed-off-by: Masahiro Yamada <yamada.m at jp.panasonic.com>
> Cc: Heiko Schocher <hs at denx.de>
> Cc: Simon Glass <sjg at chromium.org>
> ---
>
>  drivers/i2c/i2c-uclass.c | 80 +++++++++++++++++++++++++++++++-----------------
>  include/i2c.h            |  4 +++
>  2 files changed, 56 insertions(+), 28 deletions(-)

Seems like a good idea if we can make it work...

But this is driver-specific. Some drivers have hardware to send the
address and it isn't part of the message. For example see the tegra
driver.

So what you have here feels a bit like a hack to me. Can't the driver
implement it? If you are trying to avoid driver work to support 10-bit
addresses, maybe it should be an option that we can enable for each
driver, so we don't break the other drivers?

Regards,
Simon


More information about the U-Boot mailing list