]> git.ipfire.org Git - people/ms/u-boot.git/commit
ARC: ARCv2: Cache: Fixed operation without IOC
authorEugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Tue, 16 Jan 2018 16:20:26 +0000 (19:20 +0300)
committerAlexey Brodkin <abrodkin@synopsys.com>
Fri, 19 Jan 2018 14:59:34 +0000 (17:59 +0300)
commit41cada4d2499705b321ab650891e76088d330a37
tree5921811ab41dbbe81132fb352f7add3b9992d8b4
parent086ebcd40e9bf8efc520f1b177fd8e3cc0e506fa
ARC: ARCv2: Cache: Fixed operation without IOC

Previous SLC management implementation is broken. Seems like it was
never sufficiently tested probably because most of the time IOC was used
instead (i.e. no manual cache operations were done).

Now if we disable IOC in U-boot we'll get a lot of errors while using
DMA-enabled peripherals.

This time we fix it by substitution of broken per-line SLC operations
region operations as it is done in the Linux kernel (we took it from
v4.14 which is the latest stable as of today).

Among other things this implementation might be a bit faster because
instead of iteration over each and every cache line we're taking care
about entire region in one go.

Main changes:
 * Replaced __slc_line_op (per line operations) by __slc_rgn_op
   (region operations).

 * Reworked __slc_entire_op to get rid of __after_slc_op and
   __before_slc_op functions.
   Note flush fix (flush only instead of flush-n-inv when OP_FLUSH is
   used, see [1] for more details) is already incorporated here.

 * Added SLC invalidation to invalidate_icache_all().

 * Added (start >= end) check to invalidate_dcache_range() and
   flush_dcache_range() as some buggy drivers pass region start == end.

 * Added read-out of MMU BCR so we may know if PAE40 exists in HW and then
   act on a particular AUX regs accordingly.

[1] http://lists.infradead.org/pipermail/linux-snps-arc/2018-January/003357.html

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
arch/arc/include/asm/arcregs.h
arch/arc/lib/cache.c