diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2019-10-07 12:28:59 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2019-10-14 15:26:46 +0200 |
commit | f7dd361dc20d72978be8cc65dd06e1286b4dc7e2 (patch) | |
tree | d6760efd1998e0223cd86afc23b1fdde6db81008 /arch/arm/cpu | |
parent | d52102de412ce53a426d9dd43cf61569fe3b5683 (diff) | |
download | barebox-f7dd361dc20d72978be8cc65dd06e1286b4dc7e2.tar.gz barebox-f7dd361dc20d72978be8cc65dd06e1286b4dc7e2.tar.xz |
ARM: use system.h's get_cr() for cpuinfo
Instead of open-coding the get_cr(), use the already available helper
in <asm/system.h> same as we do for 64-bit ARMv8.
The only difference is that the "memory" clobber is replaced by "cc".
This is ok as we don't expect get_cr() to affect memory and because
we do it elsewhere in barebox without a "memory" clobber already.
While at it, move it out the #if/#else clause as the helper changes
behavior depending on the same CONFIG option anyway.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/cpu')
-rw-r--r-- | arch/arm/cpu/cpuinfo.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/arch/arm/cpu/cpuinfo.c b/arch/arm/cpu/cpuinfo.c index 1ba3b4379c..ff6e1eb87b 100644 --- a/arch/arm/cpu/cpuinfo.c +++ b/arch/arm/cpu/cpuinfo.c @@ -76,8 +76,6 @@ static int do_cpuinfo(int argc, char *argv[]) : "=r" (cache) : : "memory"); - - cr = get_cr(); #else __asm__ __volatile__( "mrc p15, 0, %0, c0, c0, 0 @ read control reg\n" @@ -90,13 +88,8 @@ static int do_cpuinfo(int argc, char *argv[]) : "=r" (cache) : : "memory"); - - __asm__ __volatile__( - "mrc p15, 0, %0, c1, c0, 0 @ read control reg\n" - : "=r" (cr) - : - : "memory"); #endif + cr = get_cr(); switch (mainid >> 24) { case 0x41: |