0001
0002
0003
0004
0005
0006
0007 #include <linux/platform_device.h>
0008 #ifndef __LLCC_QCOM__
0009 #define __LLCC_QCOM__
0010
0011 #define LLCC_CPUSS 1
0012 #define LLCC_VIDSC0 2
0013 #define LLCC_VIDSC1 3
0014 #define LLCC_ROTATOR 4
0015 #define LLCC_VOICE 5
0016 #define LLCC_AUDIO 6
0017 #define LLCC_MDMHPGRW 7
0018 #define LLCC_MDM 8
0019 #define LLCC_MODHW 9
0020 #define LLCC_CMPT 10
0021 #define LLCC_GPUHTW 11
0022 #define LLCC_GPU 12
0023 #define LLCC_MMUHWT 13
0024 #define LLCC_CMPTDMA 15
0025 #define LLCC_DISP 16
0026 #define LLCC_VIDFW 17
0027 #define LLCC_MDMHPFX 20
0028 #define LLCC_MDMPNG 21
0029 #define LLCC_AUDHW 22
0030 #define LLCC_NPU 23
0031 #define LLCC_WLHW 24
0032 #define LLCC_PIMEM 25
0033 #define LLCC_DRE 26
0034 #define LLCC_CVP 28
0035 #define LLCC_MODPE 29
0036 #define LLCC_APTCM 30
0037 #define LLCC_WRCACHE 31
0038 #define LLCC_CVPFW 32
0039 #define LLCC_CPUSS1 33
0040 #define LLCC_CAMEXP0 34
0041 #define LLCC_CPUMTE 35
0042 #define LLCC_CPUHWT 36
0043 #define LLCC_MDMCLAD2 37
0044 #define LLCC_CAMEXP1 38
0045 #define LLCC_AENPU 45
0046
0047
0048
0049
0050
0051
0052 struct llcc_slice_desc {
0053 u32 slice_id;
0054 size_t slice_size;
0055 };
0056
0057
0058
0059
0060
0061
0062
0063
0064
0065
0066
0067
0068
0069 struct llcc_edac_reg_data {
0070 char *name;
0071 u64 synd_reg;
0072 u64 count_status_reg;
0073 u64 ways_status_reg;
0074 u32 reg_cnt;
0075 u32 count_mask;
0076 u32 ways_mask;
0077 u8 count_shift;
0078 u8 ways_shift;
0079 };
0080
0081
0082
0083
0084
0085
0086
0087
0088
0089
0090
0091
0092
0093
0094
0095 struct llcc_drv_data {
0096 struct regmap *regmap;
0097 struct regmap *bcast_regmap;
0098 const struct llcc_slice_config *cfg;
0099 struct mutex lock;
0100 u32 cfg_size;
0101 u32 max_slices;
0102 u32 num_banks;
0103 unsigned long *bitmap;
0104 u32 *offsets;
0105 int ecc_irq;
0106 u32 version;
0107 };
0108
0109 #if IS_ENABLED(CONFIG_QCOM_LLCC)
0110
0111
0112
0113
0114 struct llcc_slice_desc *llcc_slice_getd(u32 uid);
0115
0116
0117
0118
0119
0120 void llcc_slice_putd(struct llcc_slice_desc *desc);
0121
0122
0123
0124
0125
0126 int llcc_get_slice_id(struct llcc_slice_desc *desc);
0127
0128
0129
0130
0131
0132 size_t llcc_get_slice_size(struct llcc_slice_desc *desc);
0133
0134
0135
0136
0137
0138 int llcc_slice_activate(struct llcc_slice_desc *desc);
0139
0140
0141
0142
0143
0144 int llcc_slice_deactivate(struct llcc_slice_desc *desc);
0145
0146 #else
0147 static inline struct llcc_slice_desc *llcc_slice_getd(u32 uid)
0148 {
0149 return NULL;
0150 }
0151
0152 static inline void llcc_slice_putd(struct llcc_slice_desc *desc)
0153 {
0154
0155 };
0156
0157 static inline int llcc_get_slice_id(struct llcc_slice_desc *desc)
0158 {
0159 return -EINVAL;
0160 }
0161
0162 static inline size_t llcc_get_slice_size(struct llcc_slice_desc *desc)
0163 {
0164 return 0;
0165 }
0166 static inline int llcc_slice_activate(struct llcc_slice_desc *desc)
0167 {
0168 return -EINVAL;
0169 }
0170
0171 static inline int llcc_slice_deactivate(struct llcc_slice_desc *desc)
0172 {
0173 return -EINVAL;
0174 }
0175 #endif
0176
0177 #endif