[U-Boot] [PATCH v2 06/10] powerpc/ppc4xx: Use generic FPGA accessors on all gdsys 405ep/ex boards

Wolfgang Denk wd at denx.de
Mon May 6 16:10:00 CEST 2013


Dear dirk.eibach at gdsys.cc,

In message <1367847325-21463-7-git-send-email-dirk.eibach at gdsys.cc> you wrote:
> From: Dirk Eibach <eibach at gdsys.de>
> 
> Signed-off-by: Dirk Eibach <dirk.eibach at gdsys.cc>
> ---
> Changes in v2: None
> 
>  board/gdsys/405ep/dlvision-10g.c |   20 ++++++++++++++------
>  board/gdsys/405ep/io.c           |   20 ++++++++++++++------
>  board/gdsys/405ep/neo.c          |   17 +++++++++++++----
>  board/gdsys/405ex/405ex.c        |   14 ++++++--------
>  board/gdsys/405ex/io64.c         |   38 ++++++++++++++++++++++----------------
>  5 files changed, 69 insertions(+), 40 deletions(-)
> 
> diff --git a/board/gdsys/405ep/dlvision-10g.c b/board/gdsys/405ep/dlvision-10g.c
> index 644493b..4d1a02e 100644
> --- a/board/gdsys/405ep/dlvision-10g.c
> +++ b/board/gdsys/405ep/dlvision-10g.c
> @@ -71,6 +71,16 @@ enum {
>  	RAM_DDR2_64 = 2,
>  };
>  
> +void fpga_set_reg(unsigned int fpga, u16 reg, u16 data)
> +{
> +	out_le16((u16 *)CONFIG_SYS_FPGA_BASE(fpga) + reg / sizeof(u16), data);
> +}
> +
> +u16 fpga_get_reg(unsigned int fpga, u16 reg)
> +{
> +	return in_le16((u16 *)CONFIG_SYS_FPGA_BASE(fpga) + reg / sizeof(u16));
> +}
> +

We strictly discourage using a notation of base address plus offset,
and require to use proper C structs instead, especially because this
allows type checking by the compiler.

You had the this, and now attempt to throw it away.  This makes no
sense.

NAK.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
A fail-safe circuit will destroy others.                 -- Klipstein


More information about the U-Boot mailing list