1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * MIPS Coherence Manager (CM) Initialisation
5 * Copyright (c) 2016 Imagination Technologies Ltd.
8 #include <asm/addrspace.h>
11 #include <asm/mipsregs.h>
12 #include <asm/regdef.h>
15 /* Config3 must exist for a CM to be present */
16 mfc0 t0, CP0_CONFIG, 1
18 mfc0 t0, CP0_CONFIG, 2
21 /* Check Config3.CMGCR to determine CM presence */
22 mfc0 t0, CP0_CONFIG, 3
23 and t0, t0, MIPS_CONF3_CMGCR
26 /* Find the current physical GCR base address */
27 1: MFC0 t0, CP0_CMGCRBASE
30 /* If the GCRs are where we want, we're done */
31 PTR_LI t1, CONFIG_MIPS_CM_BASE
34 /* Move the GCRs to our configured base address */
37 sw zero, GCR_BASE_UPPER(t0)
40 /* Re-check the GCR base */