[U-Boot] [u-boot] [PATCH][1/2] mx27: Add necessary defines and helper functions to support I2C in i.MX27.

Heiko Schocher hs at denx.de
Mon Nov 2 08:35:32 CET 2009


Hello javier,

javier Martin wrote:
> 2009/11/2 Heiko Schocher <hs at denx.de>:
>> Hello Javier,
>>
>> Javier Martin wrote:
>>> Add proper register definitions, macros and clock functions required
>>> for I2C driver to be developed.
>>>
>>>
>>>
>>> Signed-off-by: Javier Martin <javier.martin at vista-silicon.com>
>>> --
>>> diff --git a/cpu/arm926ejs/mx27/generic.c b/cpu/arm926ejs/mx27/generic.c
>>> index 808371f..540ef0c 100644
>> [...]
>>> diff --git a/include/asm-arm/arch-mx27/imx-regs.h b/include/asm-arm/arch-mx27/imx-regs.h
>>> index d36a6da..2b89b4e 100644
>>> --- a/include/asm-arm/arch-mx27/imx-regs.h
>>> +++ b/include/asm-arm/arch-mx27/imx-regs.h
>>> @@ -206,6 +206,10 @@ struct iim_regs {
>>>  };
>>>  #endif
>>>
>>> +#define __REG(x)     (*((volatile u32 *)(x)))
>>> +#define __REG16(x)   (*((volatile u16 *)(x)))
>>> +#define __REG8(x)    (*((volatile u8 *)(x)))
>>> +
>> Why you need this? Couldn;t you use io accessor from asm/io.h?
> 
> Hi Heiko,
> thank you for the comments. I think that would make the driver dirty
> since there would also be needed the use of an ifdef to separate
> i.MX31 reg accesses, which are accessed through __REG() macros, from
> i.MX27 ones which should be accessed by io accessors from io.h. If you
> do not have any complaint about that I will use functions from
> asm/io.h.

No, that is suboptimal, I thought more in the direction to cleanup
the driver ;-)

I see no reason, why the i.mx31 shouldn;t be able to use also the
io accessors from asm/io.h ... Tom, any suggestions?

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