ARM: 8296/1: cache-l2x0: clean up aurora cache handling
authorArnd Bergmann <arnd@arndb.de>
Wed, 28 Jan 2015 16:54:38 +0000 (17:54 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Fri, 6 Feb 2015 20:16:39 +0000 (20:16 +0000)
commit20e783e39e55c2615fb61d1b3d139ee9edcf6772
tree9d3709364434f46e470b209e0925b1664a432ddf
parent56b60b8bce4ae87470da4ed95435433b0ba8795c
ARM: 8296/1: cache-l2x0: clean up aurora cache handling

The aurora cache controller is the only remaining user of a couple
of functions in this file and are completely unused when that is
disabled, leading to build warnings:

arch/arm/mm/cache-l2x0.c:167:13: warning: 'l2x0_cache_sync' defined but not used [-Wunused-function]
arch/arm/mm/cache-l2x0.c:184:13: warning: 'l2x0_flush_all' defined but not used [-Wunused-function]
arch/arm/mm/cache-l2x0.c:194:13: warning: 'l2x0_disable' defined but not used [-Wunused-function]

With the knowledge that the code is now aurora-specific, we can
simplify it noticeably:

- The pl310 errata workarounds are not needed on aurora and can be removed
- As confirmed by Thomas Petazzoni from the data sheet, the cache_wait()
  macro is never needed.
- No need to hold the lock across atomic cache sync
- We can load the l2x0_base into a local variable across operations

There should be no functional change in this patch, but readability
and the generated object code improves, along with avoiding the
warnings.

 (on Armada 370 RD and Armada XP GP, boot tested, plus a little bit of
 DMA traffic by reading data from a SD card)

Acked-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Tested-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/mm/cache-l2x0.c