[U-Boot] [Resend PATCH V2 (forgot generic.c)] mx31: provide readable WEIM CS accessor

Stefano Babic
2011-09-29T13:21:28Z

On 09/29/2011 02:25 PM, Helmut Raiger wrote:
> setup_weimcs() and some macros are added to support the setup
> for i.MX31 WEIM chip selects. As a compromise between verbosity
> and readability an ASCII-art'ish bit comment is used instead of
> bitfields.
> All i.MX31 boards have been patched to use this approach using a
> helper program to verify the changes.
>
> Signed-off-by: Helmut Raiger <helmut.raiger@hale.at>
> ---
> V2:
> added sys_proto.h for mx31
> introduced mxc_setup_weimcs(), which is SOC independent
> not inlined any more (codesize increased by 60-90 bytes)
> ---
> arch/arm/cpu/arm1136/mx31/generic.c | 9 +++

Ah, ok, I now I can find the implementation ;-)

I have only a couple of open points...

> arch/arm/include/asm/arch-mx31/imx-regs.h | 26 +++++++-
> arch/arm/include/asm/arch-mx31/sys_proto.h | 35 +++++++++++
> board/davedenx/qong/qong.c | 87 ++++++++++-----------------
> board/freescale/mx31ads/mx31ads.c | 15 ++++-
> board/freescale/mx31pdk/mx31pdk.c | 14 ++++-
> board/imx31_phycore/imx31_phycore.c | 41 ++++++++++---
> board/logicpd/imx31_litekit/imx31_litekit.c | 28 +++++++--
> 8 files changed, 176 insertions(+), 79 deletions(-)
> create mode 100644 arch/arm/include/asm/arch-mx31/sys_proto.h
>
> diff --git a/arch/arm/cpu/arm1136/mx31/generic.c b/arch/arm/cpu/arm1136/mx31/generic.c
> index e3a4d1b..29af156 100644
> --- a/arch/arm/cpu/arm1136/mx31/generic.c
> +++ b/arch/arm/cpu/arm1136/mx31/generic.c
> @@ -25,6 +25,8 @@
> #include <asm/arch/imx-regs.h>
> #include <asm/arch/clock.h>
> #include <asm/io.h>
> +#include <asm/arch/sys_proto.h>
> +

Drop newline

>
> static u32 mx31_decode_pll(u32 reg, u32 infreq)
> {
> @@ -126,6 +128,13 @@ void mx31_set_pad(enum iomux_pins pin, u32 config)
>
> }
>
> +void mxc_setup_weimcs(int cs, const struct mxc_weimcs *weimcs)
> +{
> + writel(weimcs->upper, WEIM_CSCR_U(cs));
> + writel(weimcs->lower, WEIM_CSCR_L(cs));
> + writel(weimcs->additional, WEIM_CSCR_A(cs));
> +}

Even if more hidden, the access is always made with base + offset,
instead of defining a structure.

Best regards,
Stefano Babic

--
=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de
=====================================================================