2 * MIPS Coherence Manager (CM) Initialisation
4 * Copyright (c) 2016 Imagination Technologies Ltd.
6 * SPDX-License-Identifier: GPL-2.0+
9 #include <asm/addrspace.h>
12 #include <asm/mipsregs.h>
13 #include <asm/regdef.h>
16 /* Config3 must exist for a CM to be present */
17 mfc0 t0, CP0_CONFIG, 1
19 mfc0 t0, CP0_CONFIG, 2
22 /* Check Config3.CMGCR to determine CM presence */
23 mfc0 t0, CP0_CONFIG, 3
24 and t0, t0, MIPS_CONF3_CMGCR
27 /* Find the current physical GCR base address */
28 1: MFC0 t0, CP0_CMGCRBASE
31 /* If the GCRs are where we want, we're done */
32 PTR_LI t1, CONFIG_MIPS_CM_BASE
35 /* Move the GCRs to our configured base address */
38 sw zero, GCR_BASE_UPPER(t0)
41 /* Re-check the GCR base */