From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefan Roese Date: Sat, 8 Nov 2008 06:36:40 +0100 Subject: [U-Boot] [PATCH] OneNAND: Fix compiler warnings and add weak attribute to memcpy_16() In-Reply-To: <4914C053.5030905@freescale.com> References: <1226070552-30144-1-git-send-email-sr@denx.de> <4914C053.5030905@freescale.com> Message-ID: <200811080636.41027.sr@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 On Friday 07 November 2008, Scott Wood wrote: > Stefan Roese wrote: > > This patch adds memcpy_16_from_onenand() and memcpy_16_to_onenand() > > functions and defaults them to the already available memcpy_16() > > function. They are defined weak so that they can be overwritten by > > a board/platform specific version. > > > > This is needed for the vcth board support (still to come) which needs > > custom access routines here. > > Can it just override write_bufferram and read_bufferram? There are multiple functions here using this memcpy_16(): onenand_read_bufferram() onenand_sync_read_bufferram() onenand_write_bufferram() So it seemed "easier" for me to just override the memcpy_16() function itself. > What does it > need to do specially? On our board the bufferram can't be accessed memory-mapped via pointer access. We need special accessor functions. Something like this: /* * Accessor functions replacing the "weak" functions in * drivers/mtd/onenand/onenand_base.c */ void *memcpy_16_from_onenand(void *dst, const void *src, unsigned int len) { void *ret = dst; u16 *d = dst; u16 *s = (u16 *)src; len >>= 1; while (len-- > 0) *d++ = ebi_nand_read_word(s++); return ret; } Best regards, Stefan ===================================================================== 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 =====================================================================