Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

MIPS: Netlogic: Fix CP0_EBASE redefinition warnings

A couple of netlogic assembly files define CP0_EBASE to $15, the same as
CP0_PRID in mipsregs.h, and use it for accessing both CP0_PRId and
CP0_EBase registers. However commit 609cf6f2291a ("MIPS: CPS: Early
debug using an ns16550-compatible UART") added a different definition of
CP0_EBASE to mipsregs.h, which included a register select of 1. This
causes harmless build warnings like the following:

arch/mips/netlogic/common/reset.S:53:0: warning: "CP0_EBASE" redefined
#define CP0_EBASE $15
^
In file included from arch/mips/netlogic/common/reset.S:41:0:
./arch/mips/include/asm/mipsregs.h:63:0: note: this is the location of the previous definition
#define CP0_EBASE $15, 1
^

Update the code to use the definitions from mipsregs.h for accessing
both registers.

Fixes: 609cf6f2291a ("MIPS: CPS: Early debug using an ns16550-compatible UART")
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Acked-by: Jayachandran C <jchandra@broadcom.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/13183/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

authored by

James Hogan and committed by
Ralf Baechle
32eb6e8b 12863939

+6 -9
+5 -6
arch/mips/netlogic/common/reset.S
··· 50 50 #include <asm/netlogic/xlp-hal/sys.h> 51 51 #include <asm/netlogic/xlp-hal/cpucontrol.h> 52 52 53 - #define CP0_EBASE $15 54 53 #define SYS_CPU_COHERENT_BASE CKSEG1ADDR(XLP_DEFAULT_IO_BASE) + \ 55 54 XLP_IO_SYS_OFFSET(0) + XLP_IO_PCI_HDRSZ + \ 56 55 SYS_CPU_NONCOHERENT_MODE * 4 ··· 91 92 * registers. On XLPII CPUs, usual cache instructions work. 92 93 */ 93 94 .macro xlp_flush_l1_dcache 94 - mfc0 t0, CP0_EBASE, 0 95 + mfc0 t0, CP0_PRID 95 96 andi t0, t0, PRID_IMP_MASK 96 97 slt t1, t0, 0x1200 97 98 beqz t1, 15f ··· 170 171 nop 171 172 172 173 1: /* Entry point on core wakeup */ 173 - mfc0 t0, CP0_EBASE, 0 /* processor ID */ 174 + mfc0 t0, CP0_PRID /* processor ID */ 174 175 andi t0, PRID_IMP_MASK 175 176 li t1, 0x1500 /* XLP 9xx */ 176 177 beq t0, t1, 2f /* does not need to set coherent */ ··· 181 182 nop 182 183 183 184 /* set bit in SYS coherent register for the core */ 184 - mfc0 t0, CP0_EBASE, 1 185 - mfc0 t1, CP0_EBASE, 1 185 + mfc0 t0, CP0_EBASE 186 + mfc0 t1, CP0_EBASE 186 187 srl t1, 5 187 188 andi t1, 0x3 /* t1 <- node */ 188 189 li t2, 0x40000 ··· 231 232 232 233 * NOTE: All GPR contents are lost after the mtcr above! 233 234 */ 234 - mfc0 v0, CP0_EBASE, 1 235 + mfc0 v0, CP0_EBASE 235 236 andi v0, 0x3ff /* v0 <- node/core */ 236 237 237 238 /*
+1 -3
arch/mips/netlogic/common/smpboot.S
··· 48 48 #include <asm/netlogic/xlp-hal/sys.h> 49 49 #include <asm/netlogic/xlp-hal/cpucontrol.h> 50 50 51 - #define CP0_EBASE $15 52 - 53 51 .set noreorder 54 52 .set noat 55 53 .set arch=xlr /* for mfcr/mtcr, XLR is sufficient */ ··· 84 86 PTR_L gp, 0(t1) 85 87 86 88 /* a0 has the processor id */ 87 - mfc0 a0, CP0_EBASE, 1 89 + mfc0 a0, CP0_EBASE 88 90 andi a0, 0x3ff /* a0 <- node/core */ 89 91 PTR_LA t0, nlm_early_init_secondary 90 92 jalr t0