2 * Copyright 2012 Actions Semi Inc.
3 * Author: Actions Semi, Inc.
5 * Copyright (c) 2017 Andreas Färber
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
13 #include <linux/linkage.h>
14 #include <linux/init.h>
16 ENTRY(owl_v7_invalidate_l1)
18 mcr p15, 0, r0, c7, c5, 0 @ invalidate I cache
19 mcr p15, 2, r0, c0, c0, 0
20 mrc p15, 1, r0, c0, c0, 0
23 and r2, r1, r0, lsr #13
27 and r3, r1, r0, lsr #3 @ NumWays - 1
28 add r2, r2, #1 @ NumSets
31 add r0, r0, #4 @ SetShift
34 add r4, r3, #1 @ NumWays
35 1: sub r2, r2, #1 @ NumSets--
36 mov r3, r4 @ Temp = NumWays
37 2: subs r3, r3, #1 @ Temp--
40 orr r5, r5, r6 @ Reg = (Temp<<WayShift)|(NumSets<<SetShift)
41 mcr p15, 0, r5, c7, c6, 2
48 ENDPROC(owl_v7_invalidate_l1)
50 ENTRY(owl_secondary_startup)
51 bl owl_v7_invalidate_l1