Yu Chien Peter Lin | 82f0f53 | 2023-02-06 16:10:47 +0800 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
| 2 | /* |
| 3 | * Copyright (C) 2023 Andes Technology Corporation |
| 4 | */ |
| 5 | |
| 6 | #ifndef _ASM_ANDES_CSR_H |
| 7 | #define _ASM_ANDES_CSR_H |
| 8 | |
| 9 | #include <asm/asm.h> |
Tom Rini | b6b9900 | 2023-10-12 19:03:59 -0400 | [diff] [blame] | 10 | #include <linux/bitops.h> |
Yu Chien Peter Lin | 82f0f53 | 2023-02-06 16:10:47 +0800 | [diff] [blame] | 11 | #include <linux/const.h> |
| 12 | |
| 13 | #define CSR_MCACHE_CTL 0x7ca |
| 14 | #define CSR_MMISC_CTL 0x7d0 |
Leo Yu-Chi Liang | eb422ba | 2024-05-28 20:57:50 +0800 | [diff] [blame] | 15 | #define CSR_UCCTLCOMMAND 0x80c |
Yu Chien Peter Lin | 82f0f53 | 2023-02-06 16:10:47 +0800 | [diff] [blame] | 16 | |
Leo Yu-Chi Liang | a5dda2b | 2023-12-26 14:17:32 +0800 | [diff] [blame] | 17 | /* mcache_ctl register */ |
| 18 | |
| 19 | #define MCACHE_CTL_IC_EN BIT(0) |
| 20 | #define MCACHE_CTL_DC_EN BIT(1) |
Leo Yu-Chi Liang | 7862a2a | 2023-12-26 14:17:35 +0800 | [diff] [blame] | 21 | #define MCACHE_CTL_IC_ECCEN BIT(3) |
| 22 | #define MCACHE_CTL_DC_ECCEN BIT(5) |
Leo Yu-Chi Liang | a5dda2b | 2023-12-26 14:17:32 +0800 | [diff] [blame] | 23 | #define MCACHE_CTL_CCTL_SUEN BIT(8) |
Leo Yu-Chi Liang | 96e75a8 | 2023-12-26 14:17:34 +0800 | [diff] [blame] | 24 | #define MCACHE_CTL_IC_PREFETCH_EN BIT(9) |
| 25 | #define MCACHE_CTL_DC_PREFETCH_EN BIT(10) |
| 26 | #define MCACHE_CTL_DC_WAROUND_EN BIT(13) |
| 27 | #define MCACHE_CTL_L2C_WAROUND_EN BIT(15) |
Leo Yu-Chi Liang | 7862a2a | 2023-12-26 14:17:35 +0800 | [diff] [blame] | 28 | #define MCACHE_CTL_TLB_ECCEN BIT(18) |
Leo Yu-Chi Liang | a5dda2b | 2023-12-26 14:17:32 +0800 | [diff] [blame] | 29 | #define MCACHE_CTL_DC_COHEN BIT(19) |
| 30 | #define MCACHE_CTL_DC_COHSTA BIT(20) |
Yu Chien Peter Lin | 82f0f53 | 2023-02-06 16:10:47 +0800 | [diff] [blame] | 31 | |
Leo Yu-Chi Liang | 96e75a8 | 2023-12-26 14:17:34 +0800 | [diff] [blame] | 32 | /* mmisc_ctl register */ |
| 33 | #define MMISC_CTL_NON_BLOCKING_EN BIT(8) |
Yu Chien Peter Lin | 82f0f53 | 2023-02-06 16:10:47 +0800 | [diff] [blame] | 34 | |
| 35 | #define CCTL_L1D_WBINVAL_ALL 6 |
| 36 | |
| 37 | #endif /* _ASM_ANDES_CSR_H */ |