summaryrefslogtreecommitdiff
path: root/big-little/common/cci.c
blob: 7a5b7a5693844551f10930dd0c32ef0132a222b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*
 * $Copyright:
 * ----------------------------------------------------------------
 * This confidential and proprietary software may be used only as
 * authorised by a licensing agreement from ARM Limited
 *  (C) COPYRIGHT 2008-2011 ARM Limited
 *       ALL RIGHTS RESERVED
 * The entire notice above must be reproduced on all authorised
 * copies and copies may only be made to the extent permitted
 * by a licensing agreement from ARM Limited.
 * ----------------------------------------------------------------
 * File:     cci.c
 * ----------------------------------------------------------------
 * $
 */

#include "misc.h"
#include "virt_helpers.h"
#include "hyp_types.h"

void enable_cci_snoops(unsigned cluster_id)
{
        /* Turn off CCI snoops & DVM Messages */
        if (cluster_id)
                write32(A7_SL_IFACE_BASE + SNOOP_CTLR_REG, 0x3);
        else
                write32(A15_SL_IFACE_BASE + SNOOP_CTLR_REG, 0x3);

        dsb();

        /* Wait for the dust to settle down */
        while (read32(CCI_BASE + STATUS_REG) & 0x1) ;

        return;
}

void disable_cci_snoops(unsigned cluster_id)
{
        /* Turn off CCI snoops & DVM messages */
        if (cluster_id)
                write32(A7_SL_IFACE_BASE + SNOOP_CTLR_REG, 0x0);
        else
                write32(A15_SL_IFACE_BASE + SNOOP_CTLR_REG, 0x0);

        dsb();

        /* Wait for the dust to settle down */
        while (read32(CCI_BASE + STATUS_REG) & 0x1) ;

        return;
}