From: Wolfgang Denk Date: Tue, 21 Jan 2014 06:42:28 +0100 Subject: [U-Boot] [PATCH][v2] driver/ifc:Change accessor function to take care of endianness In-Reply-To: <1390258263.24905.337.camel@snotra.buserror.net> References: <1390028310-30861-1-git-send-email-prabhakar@freescale.com> <20140118082452.BC291380481@gemini.denx.de> <1390258263.24905.337.camel@snotra.buserror.net> Message-ID: <20140121054228.DE99438201D@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Scott, In message <1390258263.24905.337.camel@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"