linux/include/linux/soc/qcom/llcc-qcom.h

/* SPDX-License-Identifier: GPL-2.0 */
/*
 * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
 *
 */

#include <linux/platform_device.h>
#ifndef __LLCC_QCOM__
#define __LLCC_QCOM__

#define LLCC_CPUSS
#define LLCC_VIDSC0
#define LLCC_VIDSC1
#define LLCC_ROTATOR
#define LLCC_VOICE
#define LLCC_AUDIO
#define LLCC_MDMHPGRW
#define LLCC_MDM
#define LLCC_MODHW
#define LLCC_CMPT
#define LLCC_GPUHTW
#define LLCC_GPU
#define LLCC_MMUHWT
#define LLCC_CMPTDMA
#define LLCC_DISP
#define LLCC_VIDFW
#define LLCC_MDMHPFX
#define LLCC_MDMPNG
#define LLCC_AUDHW
#define LLCC_NPU
#define LLCC_WLHW
#define LLCC_PIMEM
#define LLCC_ECC
#define LLCC_CVP
#define LLCC_MODPE
#define LLCC_APTCM
#define LLCC_WRCACHE
#define LLCC_CVPFW
#define LLCC_CPUSS1
#define LLCC_CAMEXP0
#define LLCC_CPUMTE
#define LLCC_CPUHWT
#define LLCC_MDMCLAD2
#define LLCC_CAMEXP1
#define LLCC_CMPTHCP
#define LLCC_LCPDARE
#define LLCC_AENPU
#define LLCC_ISLAND1
#define LLCC_ISLAND2
#define LLCC_ISLAND3
#define LLCC_ISLAND4
#define LLCC_CAMEXP2
#define LLCC_CAMEXP3
#define LLCC_CAMEXP4
#define LLCC_DISP_WB
#define LLCC_DISP_1
#define LLCC_VIDVSP

/**
 * struct llcc_slice_desc - Cache slice descriptor
 * @slice_id: llcc slice id
 * @slice_size: Size allocated for the llcc slice
 */
struct llcc_slice_desc {};

/**
 * struct llcc_edac_reg_data - llcc edac registers data for each error type
 * @name: Name of the error
 * @reg_cnt: Number of registers
 * @count_mask: Mask value to get the error count
 * @ways_mask: Mask value to get the error ways
 * @count_shift: Shift value to get the error count
 * @ways_shift: Shift value to get the error ways
 */
struct llcc_edac_reg_data {};

struct llcc_edac_reg_offset {};

/**
 * struct llcc_drv_data - Data associated with the llcc driver
 * @regmaps: regmaps associated with the llcc device
 * @bcast_regmap: regmap associated with llcc broadcast OR offset
 * @bcast_and_regmap: regmap associated with llcc broadcast AND offset
 * @cfg: pointer to the data structure for slice configuration
 * @edac_reg_offset: Offset of the LLCC EDAC registers
 * @lock: mutex associated with each slice
 * @cfg_size: size of the config data table
 * @max_slices: max slices as read from device tree
 * @num_banks: Number of llcc banks
 * @bitmap: Bit map to track the active slice ids
 * @ecc_irq: interrupt for llcc cache error detection and reporting
 * @version: Indicates the LLCC version
 */
struct llcc_drv_data {};

#if IS_ENABLED(CONFIG_QCOM_LLCC)
/**
 * llcc_slice_getd - get llcc slice descriptor
 * @uid: usecase_id of the client
 */
struct llcc_slice_desc *llcc_slice_getd(u32 uid);

/**
 * llcc_slice_putd - llcc slice descritpor
 * @desc: Pointer to llcc slice descriptor
 */
void llcc_slice_putd(struct llcc_slice_desc *desc);

/**
 * llcc_get_slice_id - get slice id
 * @desc: Pointer to llcc slice descriptor
 */
int llcc_get_slice_id(struct llcc_slice_desc *desc);

/**
 * llcc_get_slice_size - llcc slice size
 * @desc: Pointer to llcc slice descriptor
 */
size_t llcc_get_slice_size(struct llcc_slice_desc *desc);

/**
 * llcc_slice_activate - Activate the llcc slice
 * @desc: Pointer to llcc slice descriptor
 */
int llcc_slice_activate(struct llcc_slice_desc *desc);

/**
 * llcc_slice_deactivate - Deactivate the llcc slice
 * @desc: Pointer to llcc slice descriptor
 */
int llcc_slice_deactivate(struct llcc_slice_desc *desc);

#else
static inline struct llcc_slice_desc *llcc_slice_getd(u32 uid)
{
	return NULL;
}

static inline void llcc_slice_putd(struct llcc_slice_desc *desc)
{

};

static inline int llcc_get_slice_id(struct llcc_slice_desc *desc)
{
	return -EINVAL;
}

static inline size_t llcc_get_slice_size(struct llcc_slice_desc *desc)
{
	return 0;
}
static inline int llcc_slice_activate(struct llcc_slice_desc *desc)
{
	return -EINVAL;
}

static inline int llcc_slice_deactivate(struct llcc_slice_desc *desc)
{
	return -EINVAL;
}
#endif

#endif