1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
7 #include <linux/platform_device.h>
14 #define LLCC_ROTATOR 4
17 #define LLCC_MDMHPGRW 7
21 #define LLCC_GPUHTW 11
23 #define LLCC_MMUHWT 13
24 #define LLCC_CMPTDMA 15
27 #define LLCC_MDMHPFX 20
28 #define LLCC_MDMPNG 21
34 #define LLCC_WRCACHE 31
37 * llcc_slice_desc - Cache slice descriptor
38 * @slice_id: llcc slice id
39 * @slice_size: Size allocated for the llcc slice
41 struct llcc_slice_desc {
47 * llcc_edac_reg_data - llcc edac registers data for each error type
48 * @name: Name of the error
49 * @synd_reg: Syndrome register address
50 * @count_status_reg: Status register address to read the error count
51 * @ways_status_reg: Status register address to read the error ways
52 * @reg_cnt: Number of registers
53 * @count_mask: Mask value to get the error count
54 * @ways_mask: Mask value to get the error ways
55 * @count_shift: Shift value to get the error count
56 * @ways_shift: Shift value to get the error ways
58 struct llcc_edac_reg_data {
71 * llcc_drv_data - Data associated with the llcc driver
72 * @regmap: regmap associated with the llcc device
73 * @bcast_regmap: regmap associated with llcc broadcast offset
74 * @cfg: pointer to the data structure for slice configuration
75 * @lock: mutex associated with each slice
76 * @cfg_size: size of the config data table
77 * @max_slices: max slices as read from device tree
78 * @num_banks: Number of llcc banks
79 * @bitmap: Bit map to track the active slice ids
80 * @offsets: Pointer to the bank offsets array
81 * @ecc_irq: interrupt for llcc cache error detection and reporting
83 struct llcc_drv_data {
84 struct regmap *regmap;
85 struct regmap *bcast_regmap;
86 const struct llcc_slice_config *cfg;
91 unsigned long *bitmap;
96 #if IS_ENABLED(CONFIG_QCOM_LLCC)
98 * llcc_slice_getd - get llcc slice descriptor
99 * @uid: usecase_id of the client
101 struct llcc_slice_desc *llcc_slice_getd(u32 uid);
104 * llcc_slice_putd - llcc slice descritpor
105 * @desc: Pointer to llcc slice descriptor
107 void llcc_slice_putd(struct llcc_slice_desc *desc);
110 * llcc_get_slice_id - get slice id
111 * @desc: Pointer to llcc slice descriptor
113 int llcc_get_slice_id(struct llcc_slice_desc *desc);
116 * llcc_get_slice_size - llcc slice size
117 * @desc: Pointer to llcc slice descriptor
119 size_t llcc_get_slice_size(struct llcc_slice_desc *desc);
122 * llcc_slice_activate - Activate the llcc slice
123 * @desc: Pointer to llcc slice descriptor
125 int llcc_slice_activate(struct llcc_slice_desc *desc);
128 * llcc_slice_deactivate - Deactivate the llcc slice
129 * @desc: Pointer to llcc slice descriptor
131 int llcc_slice_deactivate(struct llcc_slice_desc *desc);
134 static inline struct llcc_slice_desc *llcc_slice_getd(u32 uid)
139 static inline void llcc_slice_putd(struct llcc_slice_desc *desc)
144 static inline int llcc_get_slice_id(struct llcc_slice_desc *desc)
149 static inline size_t llcc_get_slice_size(struct llcc_slice_desc *desc)
153 static inline int llcc_slice_activate(struct llcc_slice_desc *desc)
158 static inline int llcc_slice_deactivate(struct llcc_slice_desc *desc)