[PATCH 1/3] ARM i.MX6: Add mmdc calibration support

Sascha Hauer s.hauer at pengutronix.de
Fri Mar 8 09:00:25 EST 2013


On Fri, Mar 08, 2013 at 04:17:22PM +0400, Alexander Shiyan wrote:
> Hello.
> 
> Only few questions inlined.
> 
> > This adds support for the various DDR calibration functions in the
> > i.MX6 MMDC.
> ...
> > +static inline u32 reg32_read(u32 reg)
> > +{
> > +	return readl(reg);
> > +}
> > +
> > +static inline void reg32_write(u32 reg, u32 val)
> > +{
> > +	writel(val, reg);
> > +}
> > +
> 
> What a reason to separate functions instead of readl/writel?

The reason is that the original code had this and I was too lazy to swap
the argument order, but I can fix this.

> 
> > +static inline void reg32setbit(u32 reg, int bit)
> > +{
> > +	u32 val;
> > +
> > +	val = readl(reg);
> > +	val |= 1 << bit;
> > +	writel(val, reg);
> > +}
> > +
> > +static inline void reg32clrbit(u32 reg, int bit)
> > +{
> > +	u32 val;
> > +
> > +	val = readl(reg);
> > +	val &= ~(1 << bit);
> > +	writel(val, reg);
> > +}
> 
> Maybe move this into asm-generic/io.h? Seems it can be reused by other
> users.

Dropped these. I'm not so convinced of helpers for these, at least not
enough to write them myself.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



More information about the barebox mailing list