blob: 028fd01c2f385ae52cc199f33ca426d0ef16f6e5 [file] [log] [blame]
Yu Chien Peter Lin82f0f532023-02-06 16:10:47 +08001// 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 Rinib6b99002023-10-12 19:03:59 -040010#include <linux/bitops.h>
Yu Chien Peter Lin82f0f532023-02-06 16:10:47 +080011#include <linux/const.h>
12
13#define CSR_MCACHE_CTL 0x7ca
14#define CSR_MMISC_CTL 0x7d0
Yu Chien Peter Lin82f0f532023-02-06 16:10:47 +080015#define CSR_MCCTLCOMMAND 0x7cc
16
Leo Yu-Chi Lianga5dda2b2023-12-26 14:17:32 +080017/* mcache_ctl register */
18
19#define MCACHE_CTL_IC_EN BIT(0)
20#define MCACHE_CTL_DC_EN BIT(1)
Leo Yu-Chi Liang7862a2a2023-12-26 14:17:35 +080021#define MCACHE_CTL_IC_ECCEN BIT(3)
22#define MCACHE_CTL_DC_ECCEN BIT(5)
Leo Yu-Chi Lianga5dda2b2023-12-26 14:17:32 +080023#define MCACHE_CTL_CCTL_SUEN BIT(8)
Leo Yu-Chi Liang96e75a82023-12-26 14:17:34 +080024#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 Liang7862a2a2023-12-26 14:17:35 +080028#define MCACHE_CTL_TLB_ECCEN BIT(18)
Leo Yu-Chi Lianga5dda2b2023-12-26 14:17:32 +080029#define MCACHE_CTL_DC_COHEN BIT(19)
30#define MCACHE_CTL_DC_COHSTA BIT(20)
Yu Chien Peter Lin82f0f532023-02-06 16:10:47 +080031
Leo Yu-Chi Liang96e75a82023-12-26 14:17:34 +080032/* mmisc_ctl register */
33#define MMISC_CTL_NON_BLOCKING_EN BIT(8)
Yu Chien Peter Lin82f0f532023-02-06 16:10:47 +080034
35#define CCTL_L1D_WBINVAL_ALL 6
36
37#endif /* _ASM_ANDES_CSR_H */