Konstantin Porotchkin | 402fcf1 | 2018-02-26 16:04:25 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2018 Marvell International Ltd. |
| 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | * https://spdx.org/licenses |
| 6 | */ |
| 7 | |
| 8 | /* LLC driver is the Last Level Cache (L3C) driver |
| 9 | * for Marvell SoCs in AP806, AP807, and AP810 |
| 10 | */ |
| 11 | |
Antonio Nino Diaz | 5eb8837 | 2018-11-08 10:20:19 +0000 | [diff] [blame] | 12 | #ifndef CACHE_LLC_H |
| 13 | #define CACHE_LLC_H |
Konstantin Porotchkin | 402fcf1 | 2018-02-26 16:04:25 +0200 | [diff] [blame] | 14 | |
| 15 | #define LLC_CTRL(ap) (MVEBU_LLC_BASE(ap) + 0x100) |
| 16 | #define LLC_SYNC(ap) (MVEBU_LLC_BASE(ap) + 0x700) |
| 17 | #define L2X0_INV_WAY(ap) (MVEBU_LLC_BASE(ap) + 0x77C) |
| 18 | #define L2X0_CLEAN_WAY(ap) (MVEBU_LLC_BASE(ap) + 0x7BC) |
| 19 | #define L2X0_CLEAN_INV_WAY(ap) (MVEBU_LLC_BASE(ap) + 0x7FC) |
| 20 | #define LLC_TC0_LOCK(ap) (MVEBU_LLC_BASE(ap) + 0x920) |
| 21 | |
| 22 | #define MASTER_LLC_CTRL LLC_CTRL(MVEBU_AP0) |
| 23 | #define MASTER_L2X0_INV_WAY L2X0_INV_WAY(MVEBU_AP0) |
| 24 | #define MASTER_LLC_TC0_LOCK LLC_TC0_LOCK(MVEBU_AP0) |
| 25 | |
| 26 | #define LLC_CTRL_EN 1 |
| 27 | #define LLC_EXCLUSIVE_EN 0x100 |
| 28 | #define LLC_WAY_MASK 0xFFFFFFFF |
| 29 | |
| 30 | #ifndef __ASSEMBLY__ |
| 31 | void llc_cache_sync(int ap_index); |
| 32 | void llc_flush_all(int ap_index); |
| 33 | void llc_clean_all(int ap_index); |
| 34 | void llc_inv_all(int ap_index); |
| 35 | void llc_disable(int ap_index); |
| 36 | void llc_enable(int ap_index, int excl_mode); |
| 37 | int llc_is_exclusive(int ap_index); |
| 38 | void llc_runtime_enable(int ap_index); |
| 39 | #endif |
| 40 | |
Antonio Nino Diaz | 5eb8837 | 2018-11-08 10:20:19 +0000 | [diff] [blame] | 41 | #endif /* CACHE_LLC_H */ |