u-boot-brain/arch/arm/cpu
Vignesh Raghavendra add4967124 arch: armv8: Provide a way to disable cache maintenance ops
On AM654 SoC(arm64) which is IO coherent and has L3 Cache, cache
maintenance operations being done to support non-coherent platforms
causes issues.

For example, here is how U-Boot prepares/handles a buffer to receive
data from a device (DMA Write). This may vary slightly depending on the
driver framework:

	Start DMA to write to destination buffer
	Wait for DMA to be done (dma_receive()/dma_memcpy())
	Invalidate destination buffer (invalidate_dcache_range())
	Read from destination buffer

The invalidate after the DMA is needed in order to read latest data from
memory that’s updated by DMA write. Also, in case random prefetch has
pulled in buffer data during the “wait for DMA” before the DMA has
written to it. This works well for non-coherent architectures.

In case of coherent architecture with L3 cache, DMA write would directly
update L3 cache contents (assuming cacheline is present in L3) without
updating the DDR memory. So invalidate after “wait for DMA” in above
sequence would discard latest data and read will cause stale data to be
fetched from DDR. Therefore invalidate after “wait for DMA” is not
always correct on coherent architecture.

Therefore, provide a Kconfig option to disable cache maintenance ops on
coherent architectures. This has added benefit of improving the
performance of DMA transfers as we no longer need to invalidate/flush
individual cache lines(especially for buffer thats several KBs in size).

In order to facilitate use of same Kconfig across different
architecture, I have added the symbol to top level arch/Kconfig file.
Patch currently disables cache maintenance ops for arm64 only.
flush_dcache_all() and invalidate_dcache_all() are exclusively used
during enabling/disabling dcache and hence are not disabled.

Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
2019-05-05 08:48:50 -04:00
..
arm11 SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
arm720t SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
arm920t arm: remove prototype for get_timer_masked 2018-10-10 13:35:09 -04:00
arm926ejs arm: lpc32xx: Fix timer initialization 2019-04-26 18:58:20 -04:00
arm946es SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
arm1136 linker: Modify linker scripts to be more generic 2019-01-26 22:55:53 -05:00
arm1176 SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
armv7 pcm052: bk4: sdcard: Add support for SD card booting/recovery 2019-04-13 20:30:08 +02:00
armv7m arm: armv7m: Clean up some thumb / compiler flag options 2018-05-23 13:03:42 -04:00
armv8 arch: armv8: Provide a way to disable cache maintenance ops 2019-05-05 08:48:50 -04:00
pxa SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
sa1100 arm: remove prototype for get_timer_masked 2018-10-10 13:35:09 -04:00
Makefile SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
u-boot-spl.lds linker: Modify linker scripts to be more generic 2019-01-26 22:55:53 -05:00
u-boot.lds ARM: Specify aligned address for secure section instead of using attributes 2018-09-07 09:11:42 -04:00