blob: 393d51c6dde11e4270433a44b0522e3f11595ceb [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
15#define CSR_MARCHID 0xf12
16#define CSR_MCCTLCOMMAND 0x7cc
17
18#define MCACHE_CTL_IC_EN_OFFSET 0
19#define MCACHE_CTL_DC_EN_OFFSET 1
20#define MCACHE_CTL_CCTL_SUEN_OFFSET 8
21#define MCACHE_CTL_DC_COHEN_OFFSET 19
22#define MCACHE_CTL_DC_COHSTA_OFFSET 20
23
24#define MCACHE_CTL_IC_EN BIT(MCACHE_CTL_IC_EN_OFFSET)
25#define MCACHE_CTL_DC_EN BIT(MCACHE_CTL_DC_EN_OFFSET)
26#define MCACHE_CTL_CCTL_SUEN BIT(MCACHE_CTL_CCTL_SUEN_OFFSET)
27#define MCACHE_CTL_DC_COHEN BIT(MCACHE_CTL_DC_COHEN_OFFSET)
28#define MCACHE_CTL_DC_COHSTA BIT(MCACHE_CTL_DC_COHSTA_OFFSET)
29
30#define CCTL_L1D_WBINVAL_ALL 6
31
32#endif /* _ASM_ANDES_CSR_H */