*
*/
+#include <linux/bitfield.h>
#include <linux/bitmap.h>
#include <linux/bitops.h>
#include <linux/device.h>
#define CACHE_LINE_SIZE_SHIFT 6
+#define LLCC_COMMON_HW_INFO 0x00030000
+#define LLCC_MAJOR_VERSION_MASK GENMASK(31, 24)
+
#define LLCC_COMMON_STATUS0 0x0003000c
#define LLCC_LB_CNT_MASK GENMASK(31, 28)
#define LLCC_LB_CNT_SHIFT 28
const struct qcom_llcc_config *cfg;
const struct llcc_slice_config *llcc_cfg;
u32 sz;
+ u32 version;
drv_data = devm_kzalloc(dev, sizeof(*drv_data), GFP_KERNEL);
if (!drv_data) {
goto err;
}
+ /* Extract major version of the IP */
+ ret = regmap_read(drv_data->bcast_regmap, LLCC_COMMON_HW_INFO, &version);
+ if (ret)
+ goto err;
+
+ drv_data->major_version = FIELD_GET(LLCC_MAJOR_VERSION_MASK, version);
+
ret = regmap_read(drv_data->regmap, LLCC_COMMON_STATUS0,
&num_banks);
if (ret)
* @bitmap: Bit map to track the active slice ids
* @offsets: Pointer to the bank offsets array
* @ecc_irq: interrupt for llcc cache error detection and reporting
+ * @major_version: Indicates the LLCC major version
*/
struct llcc_drv_data {
struct regmap *regmap;
unsigned long *bitmap;
u32 *offsets;
int ecc_irq;
+ u32 major_version;
};
#if IS_ENABLED(CONFIG_QCOM_LLCC)