[U-Boot] [PATCH] i2c:zynq: I2C multi-bus support on Zynq

Heiko Schocher hs at denx.de
Sun Sep 22 09:32:40 CEST 2013


Hello Michael,

Am 20.09.2013 22:40, schrieb Michael Burr:
> Changes:
> 'zynq_i2c.c':
> Adapted driver for compliance with "new" I2C driver model
> (CONFIG_SYS_I2C).
> Support for 0-length register address in 'i2c_write', 'i2c_read'.
> 'i2c.h', 'i2c_core.c':
> Support for Texas Instruments PCA9548 bus multiplexer.

Your commit message implements, that your patch contains 3
independent changes ...  it would be better to seperate your
patch in 3 pieces ... so if your patch introduces a problem,
it is better to identify, which part it introduced ...

Can you do this easy? Except of this, I have only one minor
Codingstyle comment

> Tested:
> Xilinx ZC702 eval board (single bus master 'I2C0' with multiplexer
> PCA9548).
> Write and read registers with addresses of length 0 and 1.
>
> Note:
> Mainline code does not work "out of the box" on ZC702 at this time;
> ad hoc adaptations based on 'u-boot-xlnx' repository were needed
> in order to test on this board. (Those adapatations are not included
> with this patch.)

? Where can I find this repository?

> Signed-off-by: Michael Burr<michael.burr at logicpd.com>
> Cc: Heiko Schocher<hs at denx.de>
> Cc: Michal Simek<monstr at monstr.eu>
> ---
>   drivers/i2c/i2c_core.c |    5 ++
>   drivers/i2c/zynq_i2c.c |  148 +++++++++++++++++++++++++++++-------------------
>   include/i2c.h          |    3 +
>   3 files changed, 97 insertions(+), 59 deletions(-)
[...]
> diff --git a/include/i2c.h b/include/i2c.h
> index 8fd17d1..683affe 100644
> --- a/include/i2c.h
> +++ b/include/i2c.h
> @@ -40,6 +40,7 @@
>   #define CONFIG_SYS_I2C_MAX_HOPS		0
>   #define CONFIG_SYS_NUM_I2C_BUSES	ll_entry_count(struct i2c_adapter, i2c)
>   #else
> +

Change not needed!

>   /* we use i2c muxes */
>   #undef CONFIG_SYS_I2C_DIRECT_BUS
>   #endif
> @@ -135,6 +136,8 @@ extern struct i2c_bus_hose	i2c_bus[];
>   #define I2C_MUX_PCA9544		{I2C_MUX_PCA9544_ID, "PCA9544A"}
>   #define I2C_MUX_PCA9547_ID	4
>   #define I2C_MUX_PCA9547		{I2C_MUX_PCA9547_ID, "PCA9547A"}
> +#define I2C_MUX_PCA9548_ID	5
> +#define I2C_MUX_PCA9548		{I2C_MUX_PCA9548_ID, "PCA9548"}
>   #endif
>
>   #ifndef I2C_SOFT_DECLARATIONS

bye,
Heiko
-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany


More information about the U-Boot mailing list