From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mike Frysinger Date: Tue, 23 Aug 2011 17:32:37 -0400 Subject: [U-Boot] [PATCH] mmc:dcache: Cache line size aligned internal MMC buffers In-Reply-To: <20110823210938.074B411F9E62@gemini.denx.de> References: <1313745913-28672-1-git-send-email-l.majewski@samsung.com> <201108231637.05845.vapier@gentoo.org> <20110823210938.074B411F9E62@gemini.denx.de> Message-ID: <201108231732.39791.vapier@gentoo.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Tuesday, August 23, 2011 17:09:37 Wolfgang Denk wrote: > Mike Frysinger wrote: > > On Tuesday, August 23, 2011 16:27:26 Anton Staaf wrote: > > > So then, to guide our efforts, what is a more suitable solution? > > > Would you prefer we stick with the existing path of calling memalign > > > and passing it the cache size by directly calling > > > get_dcache_line_size? Or would you prefer something more like a > > > dma_buffer_malloc function that allocates on the heap a cache line > > > size aligned buffer and returns it? > > > > memalign() is simply a malloc() with offset fudging, so > > dma_buffer_malloc() is the way to go imo. anything that involves end > > code having to figure out how to align things itself is asking for pain. > > I would like to avoid using any malloc code here. We have to keep in > mind that such code changes will spread, and will be copied into > driver code, file systems, etc. which might be used (and even > required, for example for NAND or SDCard booting systems) before > relocation - but malloc becomes available only after relocation. > > Why cannot we define a macro that declares a (sufficiently sized) > buffer on the stack and provides and a pointer to a (correctly > aligned) address in this buffer? isnt that what i already posted and you NAK-ed ? :) DMA_DECLARE_BUFFER(...) -mike -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: This is a digitally signed message part. Url : http://lists.denx.de/pipermail/u-boot/attachments/20110823/600a6891/attachment.pgp