xref: /rk3399_ARM-atf/include/drivers/marvell/cache_llc.h (revision 152b0e4717553bbfa30ba2e978b596499e946bc9)
1*152b0e47SKonstantin Porotchkin /*
2*152b0e47SKonstantin Porotchkin  * Copyright (C) 2018 Marvell International Ltd.
3*152b0e47SKonstantin Porotchkin  *
4*152b0e47SKonstantin Porotchkin  * SPDX-License-Identifier:     BSD-3-Clause
5*152b0e47SKonstantin Porotchkin  * https://spdx.org/licenses
6*152b0e47SKonstantin Porotchkin  */
7*152b0e47SKonstantin Porotchkin 
8*152b0e47SKonstantin Porotchkin /* LLC driver is the Last Level Cache (L3C) driver
9*152b0e47SKonstantin Porotchkin  * for Marvell SoCs in AP806, AP807, and AP810
10*152b0e47SKonstantin Porotchkin  */
11*152b0e47SKonstantin Porotchkin 
12*152b0e47SKonstantin Porotchkin #ifndef _CACHE_LLC_H_
13*152b0e47SKonstantin Porotchkin #define _CACHE_LLC_H_
14*152b0e47SKonstantin Porotchkin 
15*152b0e47SKonstantin Porotchkin #define LLC_CTRL(ap)			(MVEBU_LLC_BASE(ap) + 0x100)
16*152b0e47SKonstantin Porotchkin #define LLC_SYNC(ap)			(MVEBU_LLC_BASE(ap) + 0x700)
17*152b0e47SKonstantin Porotchkin #define L2X0_INV_WAY(ap)		(MVEBU_LLC_BASE(ap) + 0x77C)
18*152b0e47SKonstantin Porotchkin #define L2X0_CLEAN_WAY(ap)		(MVEBU_LLC_BASE(ap) + 0x7BC)
19*152b0e47SKonstantin Porotchkin #define L2X0_CLEAN_INV_WAY(ap)		(MVEBU_LLC_BASE(ap) + 0x7FC)
20*152b0e47SKonstantin Porotchkin #define LLC_TC0_LOCK(ap)		(MVEBU_LLC_BASE(ap) + 0x920)
21*152b0e47SKonstantin Porotchkin 
22*152b0e47SKonstantin Porotchkin #define MASTER_LLC_CTRL			LLC_CTRL(MVEBU_AP0)
23*152b0e47SKonstantin Porotchkin #define MASTER_L2X0_INV_WAY		L2X0_INV_WAY(MVEBU_AP0)
24*152b0e47SKonstantin Porotchkin #define MASTER_LLC_TC0_LOCK		LLC_TC0_LOCK(MVEBU_AP0)
25*152b0e47SKonstantin Porotchkin 
26*152b0e47SKonstantin Porotchkin #define LLC_CTRL_EN			1
27*152b0e47SKonstantin Porotchkin #define LLC_EXCLUSIVE_EN		0x100
28*152b0e47SKonstantin Porotchkin #define LLC_WAY_MASK			0xFFFFFFFF
29*152b0e47SKonstantin Porotchkin 
30*152b0e47SKonstantin Porotchkin #ifndef __ASSEMBLY__
31*152b0e47SKonstantin Porotchkin void llc_cache_sync(int ap_index);
32*152b0e47SKonstantin Porotchkin void llc_flush_all(int ap_index);
33*152b0e47SKonstantin Porotchkin void llc_clean_all(int ap_index);
34*152b0e47SKonstantin Porotchkin void llc_inv_all(int ap_index);
35*152b0e47SKonstantin Porotchkin void llc_disable(int ap_index);
36*152b0e47SKonstantin Porotchkin void llc_enable(int ap_index, int excl_mode);
37*152b0e47SKonstantin Porotchkin int llc_is_exclusive(int ap_index);
38*152b0e47SKonstantin Porotchkin void llc_runtime_enable(int ap_index);
39*152b0e47SKonstantin Porotchkin #endif
40*152b0e47SKonstantin Porotchkin 
41*152b0e47SKonstantin Porotchkin #endif /* _CACHE_LLC_H_ */
42*152b0e47SKonstantin Porotchkin 
43