[PATCH 06/10] microblaze: cache: migrate XILINX_DCACHE_BYTE_SIZE to Kconfig

Michal Simek michal.simek at xilinx.com
Fri Apr 22 15:00:23 CEST 2022



On 4/11/22 18:26, Ovidiu Panait wrote:
> Migrate XILINX_DCACHE_BYTE_SIZE to Kconfig and rename it to
> XILINX_MICROBLAZE0_DEFAULT_CACHE_SIZE. Use it as the default size
> for both instruction/data caches and get rid of the hardcoded value
> in icache_disable().

Microblaze can have different icache and dcache sizes that's why there is a need 
to use two symbols to cover it.
cache ranges are from 64B to 64KB.

I think the best way how to handle this is save icache/dcache sizes to one 
static variable/structure because actually these Kconfig symbols should be 
really only use as default value.
What Xilinx tools is doing  that it generates XILINX_DCACHE_BYTE_SIZE based on 
current design and overwrites that macro. That's why there are ifndef around it.

#ifndef XILINX_DCACHE_BYTE_SIZE
#define XILINX_DCACHE_BYTE_SIZE        32768
#endif

icache handling is not that sensitive because it is not working with data and 
self modifying code is not used.

It means default value for dcache and icache setup to 32kB should be fine.

And saving it to static variable can open good way to overwrite this structure 
based on information from DT or based on values from PVRs.

Thanks,
Michal


More information about the U-Boot mailing list