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

Alexander Shiyan shc_work at mail.ru
Fri Mar 8 07:17:22 EST 2013


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?

> +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.

Thanks.

---


More information about the barebox mailing list