From mboxrd@z Thu Jan 1 00:00:00 1970 From: Prabhakar Kushwaha Date: Tue, 21 Jan 2014 12:21:31 +0530 Subject: [U-Boot] [PATCH][v2] driver/ifc:Change accessor function to take care of endianness In-Reply-To: <20140121063457.622CC3821EA@gemini.denx.de> References: <1390028310-30861-1-git-send-email-prabhakar@freescale.com> <20140118082452.BC291380481@gemini.denx.de> <1390258263.24905.337.camel@snotra.buserror.net> <20140121054228.DE99438201D@gemini.denx.de> <20140121063457.622CC3821EA@gemini.denx.de> Message-ID: <52DE18F3.9000002@freescale.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 1/21/2014 12:04 PM, Wolfgang Denk wrote: > Dear Scott, > > In message <20140121054228.DE99438201D@gemini.denx.de> I wrote: >> 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. > On second thought, I also think we should avoid solutions where the > BE/LE test has to be done for each and every I/O accessor call again > and again. We should rather do this just once, and for example set > function pointers as needed (hoping that this driver will only be > needed after relocation, so we have writable data segment). > > Thanks Wolfgang for this suggestion. As far I understand, you are suggesting to have global structure with function pointer to accessor function depending upon IP's endiannes.. but i afraid, for IFC we do have scenario where these accessor function are used before relocation. Regards, Prabhakar