[U-Boot] [PATCH][v2] driver/ifc:Change accessor function to take care of endianness

Wolfgang Denk wd at denx.de
Tue Jan 21 06:42:28 CET 2014


Dear Scott,

In message <1390258263.24905.337.camel at snotra.buserror.net> you wrote:
>
> > As is, you are only adding dead code, as there is no place anywhere in
> > the mainline code that defines CONFIG_SYS_FSL_IFC_LE
> 
> Yes, consider it RFC until we have patches for a target that needs LE.

This shouldbe noted in the Subject: then!

> > I seriously dislike the idea of introducing special I/O accessors for
> > a single device driver.  If more drivers would follow that example, we
> > will soon have a serious mess.
> 
> As the changelog says, we have chips coming out on which these registers
> are little-endian, and thus we can't hardcode big-endian in the
> driver.  

I'm not discussing the need for a way to switch endianess, only the
current implementation.

> What sort of mess are you envisioning?  This isn't implementing
> accessors from scratch; it's just a wrapper.  It's local to IFC code.

I fear that more IP blocks will follow that have similar requirements,
and if we implemnt similar wrappers for each of them separately, we
will have a mess of hard to maintain code.  For example, it will then
be impossible to share common parts of code because driver A uses
A_out32() and driver B uses B_out32().

We should rather try and find a generic solution where the same
functions can be used by mulltiple drivers which have the same needs.

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
An age is called Dark not because  the  light  fails  to  shine,  but
because people refuse to see it.           -- James Michener, "Space"


More information about the U-Boot mailing list