[U-Boot] [PATCH v4 1/2] i2c:soft:multi: Support for multiple soft I2C buses at Samsung boards

Lukasz Majewski l.majewski at samsung.com
Thu Sep 6 10:12:34 CEST 2012


Hi Heiko,

Thanks for comments.

> Hello Lukasz,
> 
> On 05.09.2012 11:15, Lukasz Majewski wrote:
> > Support for multiple soft I2C buses.
> >
> > Multibus I2C support is achieved by defining get_multi_{sda|scl}_pin
> > functions to switch between multiple "soft" I2C buses.
> >
> > Common definition of I2C_X I2C buses is provided at<i2c.h>.
> >
> > TEST HW:
> >       Samsung's Exynos4210 evt.0.1 - Trats development board
> >
> > Signed-off-by: Lukasz Majewski<l.majewski at samsung.com>
> > Signed-off-by: Kyungmin Park<kyungmin.park at samsung.com>
> > Cc: Heiko Schocher<hs at denx.de>
> > Cc: Minkyu Kang<mk7.kang at samsung.com>
> >
> > ---
> > Changes for v2:
> > - Common Samsung code has been put to
> > board/samsung/common/multi_i2c.c file
> > - I2C_{4|5} have been renamed to I2C_{0|1}
> > - *soft_i2c_name[] table has been removed
> > Changes for v3:
> > - None
> > Changes for v4:
> > - Common definitions of available I2C buses are now defined
> > at<i2c.h>
> > - Compatibility layer (I2C_0) has been added temporarily to not
> > break the Trats I2C communication with PMIC. It will be removed
> > when redesigned PMIC will be posted
> > ---
> >   board/samsung/common/Makefile    |   43 +++++++++++++++++++++++++
> >   board/samsung/common/multi_i2c.c |   65
> > ++++++++++++++++++++++++++++++++++++++
> > include/i2c.h                    |   12 +++++++ 3 files changed,
> > 120 insertions(+), 0 deletions(-) create mode 100644
> > board/samsung/common/Makefile create mode 100644
> > board/samsung/common/multi_i2c.c
> >
> [...]
> > +#########################################################################
> > diff --git a/board/samsung/common/multi_i2c.c
> > b/board/samsung/common/multi_i2c.c new file mode 100644
> > index 0000000..d6c3d37
> > --- /dev/null
> > +++ b/board/samsung/common/multi_i2c.c
> > @@ -0,0 +1,65 @@
> [...]
> > +/* Handle multiple I2C buses instances */
> > +int get_multi_scl_pin(void)
> > +{
> > +	unsigned int bus = I2C_GET_BUS();
> > +
> > +	switch (bus) {
> > +	case I2C_0: /* I2C_0 definition - compatibility layer */
> > +	case I2C_5:
> 
> Is this correct, that you want to use 2 i2c busses on the same pin?

Yes, this is correct.

Let me share with you the "master" plan for this.
The I2C_0 is needed to keep the TRATS working with current PMIC
implementation. 

I'm working on redesign of current PMIC implementation to support other
devices responsible for power management (e.g. fuel gauge, charger,
PMIC), which in case of TRATS are connected via multiple I2C buses
(I2C_5 and I2C_9).

The I2C_0 case is for preserving correct operation of TRATS board until
PMIC 2.0 wont be introduced to u-boot mailing list. 

It will be removed just after PMIC 2.0 acceptance.

I hope, that I've expressed my intentions clearly.

> 
> Beside of that, you get my:
> 
> Acked-by: Heiko Schocher <hs at denx.de>
> 
> bye,
> Heiko

-- 
Best regards,

Lukasz Majewski

Samsung Poland R&D Center | Linux Platform Group


More information about the U-Boot mailing list