18c2ecf20Sopenharmony_ci/*
28c2ecf20Sopenharmony_ci * AURORA shared L2 cache controller support
38c2ecf20Sopenharmony_ci *
48c2ecf20Sopenharmony_ci * Copyright (C) 2012 Marvell
58c2ecf20Sopenharmony_ci *
68c2ecf20Sopenharmony_ci * Yehuda Yitschak <yehuday@marvell.com>
78c2ecf20Sopenharmony_ci * Gregory CLEMENT <gregory.clement@free-electrons.com>
88c2ecf20Sopenharmony_ci *
98c2ecf20Sopenharmony_ci * This file is licensed under the terms of the GNU General Public
108c2ecf20Sopenharmony_ci * License version 2.  This program is licensed "as is" without any
118c2ecf20Sopenharmony_ci * warranty of any kind, whether express or implied.
128c2ecf20Sopenharmony_ci */
138c2ecf20Sopenharmony_ci
148c2ecf20Sopenharmony_ci#ifndef __ASM_ARM_HARDWARE_AURORA_L2_H
158c2ecf20Sopenharmony_ci#define __ASM_ARM_HARDWARE_AURORA_L2_H
168c2ecf20Sopenharmony_ci
178c2ecf20Sopenharmony_ci#define AURORA_SYNC_REG		    0x700
188c2ecf20Sopenharmony_ci#define AURORA_RANGE_BASE_ADDR_REG  0x720
198c2ecf20Sopenharmony_ci#define AURORA_FLUSH_PHY_ADDR_REG   0x7f0
208c2ecf20Sopenharmony_ci#define AURORA_INVAL_RANGE_REG	    0x774
218c2ecf20Sopenharmony_ci#define AURORA_CLEAN_RANGE_REG	    0x7b4
228c2ecf20Sopenharmony_ci#define AURORA_FLUSH_RANGE_REG	    0x7f4
238c2ecf20Sopenharmony_ci
248c2ecf20Sopenharmony_ci#define AURORA_ACR_REPLACEMENT_OFFSET	    27
258c2ecf20Sopenharmony_ci#define AURORA_ACR_REPLACEMENT_MASK	     \
268c2ecf20Sopenharmony_ci	(0x3 << AURORA_ACR_REPLACEMENT_OFFSET)
278c2ecf20Sopenharmony_ci#define AURORA_ACR_REPLACEMENT_TYPE_WAYRR    \
288c2ecf20Sopenharmony_ci	(0 << AURORA_ACR_REPLACEMENT_OFFSET)
298c2ecf20Sopenharmony_ci#define AURORA_ACR_REPLACEMENT_TYPE_LFSR     \
308c2ecf20Sopenharmony_ci	(1 << AURORA_ACR_REPLACEMENT_OFFSET)
318c2ecf20Sopenharmony_ci#define AURORA_ACR_REPLACEMENT_TYPE_SEMIPLRU \
328c2ecf20Sopenharmony_ci	(3 << AURORA_ACR_REPLACEMENT_OFFSET)
338c2ecf20Sopenharmony_ci
348c2ecf20Sopenharmony_ci#define AURORA_ACR_PARITY_EN	(1 << 21)
358c2ecf20Sopenharmony_ci#define AURORA_ACR_ECC_EN	(1 << 20)
368c2ecf20Sopenharmony_ci
378c2ecf20Sopenharmony_ci#define AURORA_ACR_FORCE_WRITE_POLICY_OFFSET	0
388c2ecf20Sopenharmony_ci#define AURORA_ACR_FORCE_WRITE_POLICY_MASK	\
398c2ecf20Sopenharmony_ci	(0x3 << AURORA_ACR_FORCE_WRITE_POLICY_OFFSET)
408c2ecf20Sopenharmony_ci#define AURORA_ACR_FORCE_WRITE_POLICY_DIS	\
418c2ecf20Sopenharmony_ci	(0 << AURORA_ACR_FORCE_WRITE_POLICY_OFFSET)
428c2ecf20Sopenharmony_ci#define AURORA_ACR_FORCE_WRITE_BACK_POLICY	\
438c2ecf20Sopenharmony_ci	(1 << AURORA_ACR_FORCE_WRITE_POLICY_OFFSET)
448c2ecf20Sopenharmony_ci#define AURORA_ACR_FORCE_WRITE_THRO_POLICY	\
458c2ecf20Sopenharmony_ci	(2 << AURORA_ACR_FORCE_WRITE_POLICY_OFFSET)
468c2ecf20Sopenharmony_ci
478c2ecf20Sopenharmony_ci#define AURORA_ERR_CNT_REG          0x600
488c2ecf20Sopenharmony_ci#define AURORA_ERR_ATTR_CAP_REG     0x608
498c2ecf20Sopenharmony_ci#define AURORA_ERR_ADDR_CAP_REG     0x60c
508c2ecf20Sopenharmony_ci#define AURORA_ERR_WAY_CAP_REG      0x610
518c2ecf20Sopenharmony_ci#define AURORA_ERR_INJECT_CTL_REG   0x614
528c2ecf20Sopenharmony_ci#define AURORA_ERR_INJECT_MASK_REG  0x618
538c2ecf20Sopenharmony_ci
548c2ecf20Sopenharmony_ci#define AURORA_ERR_CNT_CLR_OFFSET         31
558c2ecf20Sopenharmony_ci#define AURORA_ERR_CNT_CLR		   \
568c2ecf20Sopenharmony_ci	(0x1 << AURORA_ERR_CNT_CLR_OFFSET)
578c2ecf20Sopenharmony_ci#define AURORA_ERR_CNT_UE_OFFSET          16
588c2ecf20Sopenharmony_ci#define AURORA_ERR_CNT_UE_MASK             \
598c2ecf20Sopenharmony_ci	(0x7fff << AURORA_ERR_CNT_UE_OFFSET)
608c2ecf20Sopenharmony_ci#define AURORA_ERR_CNT_CE_OFFSET           0
618c2ecf20Sopenharmony_ci#define AURORA_ERR_CNT_CE_MASK             \
628c2ecf20Sopenharmony_ci	(0xffff << AURORA_ERR_CNT_CE_OFFSET)
638c2ecf20Sopenharmony_ci
648c2ecf20Sopenharmony_ci#define AURORA_ERR_ATTR_SRC_OFF           16
658c2ecf20Sopenharmony_ci#define AURORA_ERR_ATTR_SRC_MSK            \
668c2ecf20Sopenharmony_ci	(0x7 << AURORA_ERR_ATTR_SRC_OFF)
678c2ecf20Sopenharmony_ci#define AURORA_ERR_ATTR_TXN_OFF           12
688c2ecf20Sopenharmony_ci#define AURORA_ERR_ATTR_TXN_MSK            \
698c2ecf20Sopenharmony_ci	(0xf << AURORA_ERR_ATTR_TXN_OFF)
708c2ecf20Sopenharmony_ci#define AURORA_ERR_ATTR_ERR_OFF            8
718c2ecf20Sopenharmony_ci#define AURORA_ERR_ATTR_ERR_MSK            \
728c2ecf20Sopenharmony_ci	(0x3 << AURORA_ERR_ATTR_ERR_OFF)
738c2ecf20Sopenharmony_ci#define AURORA_ERR_ATTR_CAP_VALID_OFF      0
748c2ecf20Sopenharmony_ci#define AURORA_ERR_ATTR_CAP_VALID          \
758c2ecf20Sopenharmony_ci	(0x1 << AURORA_ERR_ATTR_CAP_VALID_OFF)
768c2ecf20Sopenharmony_ci
778c2ecf20Sopenharmony_ci#define AURORA_ERR_ADDR_CAP_ADDR_MASK 0xffffffe0
788c2ecf20Sopenharmony_ci
798c2ecf20Sopenharmony_ci#define AURORA_ERR_WAY_IDX_OFF             8
808c2ecf20Sopenharmony_ci#define AURORA_ERR_WAY_IDX_MSK             \
818c2ecf20Sopenharmony_ci	(0xfff << AURORA_ERR_WAY_IDX_OFF)
828c2ecf20Sopenharmony_ci#define AURORA_ERR_WAY_CAP_WAY_OFFSET      1
838c2ecf20Sopenharmony_ci#define AURORA_ERR_WAY_CAP_WAY_MASK        \
848c2ecf20Sopenharmony_ci	(0xf << AURORA_ERR_WAY_CAP_WAY_OFFSET)
858c2ecf20Sopenharmony_ci
868c2ecf20Sopenharmony_ci#define AURORA_ERR_INJECT_CTL_ADDR_MASK 0xfffffff0
878c2ecf20Sopenharmony_ci#define AURORA_ERR_ATTR_TXN_OFF   12
888c2ecf20Sopenharmony_ci#define AURORA_ERR_INJECT_CTL_EN_MASK          0x3
898c2ecf20Sopenharmony_ci#define AURORA_ERR_INJECT_CTL_EN_PARITY        0x2
908c2ecf20Sopenharmony_ci#define AURORA_ERR_INJECT_CTL_EN_ECC           0x1
918c2ecf20Sopenharmony_ci
928c2ecf20Sopenharmony_ci#define AURORA_MAX_RANGE_SIZE	1024
938c2ecf20Sopenharmony_ci
948c2ecf20Sopenharmony_ci#define AURORA_WAY_SIZE_SHIFT	2
958c2ecf20Sopenharmony_ci
968c2ecf20Sopenharmony_ci#define AURORA_CTRL_FW		0x100
978c2ecf20Sopenharmony_ci
988c2ecf20Sopenharmony_ci/* chose a number outside L2X0_CACHE_ID_PART_MASK to be sure to make
998c2ecf20Sopenharmony_ci * the distinction between a number coming from hardware and a number
1008c2ecf20Sopenharmony_ci * coming from the device tree */
1018c2ecf20Sopenharmony_ci#define AURORA_CACHE_ID	       0x100
1028c2ecf20Sopenharmony_ci
1038c2ecf20Sopenharmony_ci#endif /* __ASM_ARM_HARDWARE_AURORA_L2_H */
104