[U-Boot] [PATCH] mmc:dcache: Cache line size aligned internal MMC buffers

Wolfgang Denk wd at denx.de
Wed Aug 24 15:25:53 CEST 2011


Dear Lukasz Majewski,

In message <20110824120744.097ba2c5 at lmajewski.digital.local> you wrote:
> 
> After reading dcache related threads I'd like to sum them up:
> 
> 1. alloca() -> not acceptable to u-boot mainline by Wolfgang. I agree
> that alloca is NOT the way to go.
> 
> 2. malloc/memalign -> avoidable to use
> 
> 3. Mike's DMA_DECLARE_BUFFER(<buffer type>, <variable name>,
> <size in bytes>) 
> solution looks OK for me, at least for the stack allocated data (e.g.
> ext_csd).
> However this proposed implementation has been NAK'ed by Wolfgang. 
> 
> I'm curious how this macro should look like? Is it only matter of code
> reordering or other approach shall be found?

I think I'd like to see a macro that can be used like this:

	void *dma_buffer_pointer = DMA_BUFFER(size_in_bytes);


> 4. get_dcache_line_size() can be simply defined as 
> #define get_dcache_line_size() CONFIG_SYS_CACHE_LINE_SIZE if we
> _really_ want to save a few bytes. 

Actually I fail to understand why we would ever need
get_dcache_line_size() in a boot loader.

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
"You know, after a woman's raised a family and so on,  she  wants  to
start living her own life."   "Whose life she's _been_ living, then?"
                                  - Terry Pratchett, _Witches Abroad_


More information about the U-Boot mailing list