1152b0e47SKonstantin Porotchkin /* 2152b0e47SKonstantin Porotchkin * Copyright (C) 2018 Marvell International Ltd. 3152b0e47SKonstantin Porotchkin * 4152b0e47SKonstantin Porotchkin * SPDX-License-Identifier: BSD-3-Clause 5152b0e47SKonstantin Porotchkin * https://spdx.org/licenses 6152b0e47SKonstantin Porotchkin */ 7152b0e47SKonstantin Porotchkin 8152b0e47SKonstantin Porotchkin /* LLC driver is the Last Level Cache (L3C) driver 9152b0e47SKonstantin Porotchkin * for Marvell SoCs in AP806, AP807, and AP810 10152b0e47SKonstantin Porotchkin */ 11152b0e47SKonstantin Porotchkin 12*c3cf06f1SAntonio Nino Diaz #ifndef CACHE_LLC_H 13*c3cf06f1SAntonio Nino Diaz #define CACHE_LLC_H 14152b0e47SKonstantin Porotchkin 15152b0e47SKonstantin Porotchkin #define LLC_CTRL(ap) (MVEBU_LLC_BASE(ap) + 0x100) 16152b0e47SKonstantin Porotchkin #define LLC_SYNC(ap) (MVEBU_LLC_BASE(ap) + 0x700) 17152b0e47SKonstantin Porotchkin #define L2X0_INV_WAY(ap) (MVEBU_LLC_BASE(ap) + 0x77C) 18152b0e47SKonstantin Porotchkin #define L2X0_CLEAN_WAY(ap) (MVEBU_LLC_BASE(ap) + 0x7BC) 19152b0e47SKonstantin Porotchkin #define L2X0_CLEAN_INV_WAY(ap) (MVEBU_LLC_BASE(ap) + 0x7FC) 20152b0e47SKonstantin Porotchkin #define LLC_TC0_LOCK(ap) (MVEBU_LLC_BASE(ap) + 0x920) 21152b0e47SKonstantin Porotchkin 22152b0e47SKonstantin Porotchkin #define MASTER_LLC_CTRL LLC_CTRL(MVEBU_AP0) 23152b0e47SKonstantin Porotchkin #define MASTER_L2X0_INV_WAY L2X0_INV_WAY(MVEBU_AP0) 24152b0e47SKonstantin Porotchkin #define MASTER_LLC_TC0_LOCK LLC_TC0_LOCK(MVEBU_AP0) 25152b0e47SKonstantin Porotchkin 26152b0e47SKonstantin Porotchkin #define LLC_CTRL_EN 1 27152b0e47SKonstantin Porotchkin #define LLC_EXCLUSIVE_EN 0x100 28152b0e47SKonstantin Porotchkin #define LLC_WAY_MASK 0xFFFFFFFF 29152b0e47SKonstantin Porotchkin 30152b0e47SKonstantin Porotchkin #ifndef __ASSEMBLY__ 31152b0e47SKonstantin Porotchkin void llc_cache_sync(int ap_index); 32152b0e47SKonstantin Porotchkin void llc_flush_all(int ap_index); 33152b0e47SKonstantin Porotchkin void llc_clean_all(int ap_index); 34152b0e47SKonstantin Porotchkin void llc_inv_all(int ap_index); 35152b0e47SKonstantin Porotchkin void llc_disable(int ap_index); 36152b0e47SKonstantin Porotchkin void llc_enable(int ap_index, int excl_mode); 37152b0e47SKonstantin Porotchkin int llc_is_exclusive(int ap_index); 38152b0e47SKonstantin Porotchkin void llc_runtime_enable(int ap_index); 39152b0e47SKonstantin Porotchkin #endif 40152b0e47SKonstantin Porotchkin 41*c3cf06f1SAntonio Nino Diaz #endif /* CACHE_LLC_H */ 42