Skip to content

Commit 961d234

Browse files
lumagRussell King (Oracle)
authored andcommitted
ARM: 9432/2: add CLIDR accessor functions
Add functions to read the CLIDR, Cache Level ID Register. Reviewed-by: Linus Walleij <[email protected]> Signed-off-by: Dmitry Baryshkov <[email protected]> Signed-off-by: Russell King (Oracle) <[email protected]>
1 parent 50867db commit 961d234

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

arch/arm/include/asm/cachetype.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,14 @@ static inline unsigned int read_ccsidr(void)
8383
asm volatile("mrc p15, 1, %0, c0, c0, 0" : "=r" (val));
8484
return val;
8585
}
86+
87+
static inline unsigned int read_clidr(void)
88+
{
89+
unsigned int val;
90+
91+
asm volatile("mrc p15, 1, %0, c0, c0, 1" : "=r" (val));
92+
return val;
93+
}
8694
#else /* CONFIG_CPU_V7M */
8795
#include <linux/io.h>
8896
#include "asm/v7m.h"
@@ -96,6 +104,11 @@ static inline unsigned int read_ccsidr(void)
96104
{
97105
return readl(BASEADDR_V7M_SCB + V7M_SCB_CCSIDR);
98106
}
107+
108+
static inline unsigned int read_clidr(void)
109+
{
110+
return readl(BASEADDR_V7M_SCB + V7M_SCB_CLIDR);
111+
}
99112
#endif
100113

101114
#endif

0 commit comments

Comments
 (0)