[U-Boot] [PATCH v2 5/5] I2C: add i2c support for Armada100 platform

Heiko Schocher hs at denx.de
Thu Mar 17 08:15:57 CET 2011


Hello Lei,

Lei Wen wrote:
> On Tue, Mar 15, 2011 at 3:08 PM, Heiko Schocher
> <heiko.schocher at invitel.hu> wrote:
>> Hello Lei,
>>
>> Lei Wen wrote:
>>> Signed-off-by: Lei Wen <leiwen at marvell.com>
>>> ---
>>>  arch/arm/cpu/arm926ejs/armada100/cpu.c    |   14 ++++++++++++++
>>>  arch/arm/include/asm/arch-armada100/mfp.h |    4 ++++
>>>  board/Marvell/aspenite/aspenite.c         |    5 +++++
>>>  include/configs/aspenite.h                |   12 ++++++++++++
>>>  4 files changed, 35 insertions(+), 0 deletions(-)
>>>
>>> diff --git a/arch/arm/cpu/arm926ejs/armada100/cpu.c b/arch/arm/cpu/arm926ejs/armada100/cpu.c
>>> index 62aa175..8039ad2 100644
>>> --- a/arch/arm/cpu/arm926ejs/armada100/cpu.c
>>> +++ b/arch/arm/cpu/arm926ejs/armada100/cpu.c
>>> @@ -62,6 +62,14 @@ int arch_cpu_init(void)
>>>       /* Enable GPIO clock */
>>>       writel(APBC_APBCLK, &apb1clkres->gpio);
>>>
>>> +     /* Enable general I2C clock */
>>> +     writel(APBC_RST | APBC_FNCLK | APBC_APBCLK, &apb1clkres->twsi0);
>>> +     writel(APBC_FNCLK | APBC_APBCLK, &apb1clkres->twsi0);
>>> +
>>> +     /* Enable power I2C clock */
>>> +     writel(APBC_RST | APBC_FNCLK | APBC_APBCLK, &apb1clkres->twsi1);
>>> +     writel(APBC_FNCLK | APBC_APBCLK, &apb1clkres->twsi1);
>>> +
>> If boards based on this cpu type don;t use i2c, i2c clock and
>> power would be enabled ... wouldn;t it be better, if we enable
>> this only if CONFIG_I2C_MV is defined?
> 
> Good point, I would modify to follow this.
> 
>> Hmm.. are the comments OK? In the first "block" you only
>> use twsi0 register, in the second "block" only twsi1 ...?
> 
> The comments is following what the spec says...
> In spec, the twsi0 named as general, and twsi1 named as power one.

Ah, ok. So the names in the struct are misleading.

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