msm: eva: enabling support for data path bringup.
Add checksum support per packet type, configurable. Add debug hook to print SID setting registers at SMMU fault. Enable Auto-PIL. Enable DSP interface. Change-Id: Ie1fd2c584681b751836854667981a3c10beb56d4 Signed-off-by: George Shen <quic_sqiao@quicinc.com>
This commit is contained in:
@@ -2298,6 +2298,43 @@ static int iris_hfi_session_clean(void *session)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int iris_debug_hook(void *device)
|
||||||
|
{
|
||||||
|
struct iris_hfi_device *dev = device;
|
||||||
|
u32 val;
|
||||||
|
|
||||||
|
if (!device) {
|
||||||
|
dprintk(CVP_ERR, "%s Invalid device\n", __func__);
|
||||||
|
return -ENODEV;
|
||||||
|
}
|
||||||
|
#define CVP0_CVP_SS_FDU_SECURE_ENABLE 0x90
|
||||||
|
#define CVP0_CVP_SS_MPU_SECURE_ENABLE 0x94
|
||||||
|
#define CVP0_CVP_SS_ARP_THREAD_0_SECURE_ENABLE 0xA0
|
||||||
|
#define CVP0_CVP_SS_ARP_THREAD_1_SECURE_ENABLE 0xA4
|
||||||
|
#define CVP0_CVP_SS_ARP_THREAD_2_SECURE_ENABLE 0xA8
|
||||||
|
#define CVP0_CVP_SS_ARP_THREAD_3_SECURE_ENABLE 0xAC
|
||||||
|
|
||||||
|
val = __read_register(dev, CVP0_CVP_SS_FDU_SECURE_ENABLE);
|
||||||
|
dprintk(CVP_ERR, "FDU_SECURE_ENABLE %#x\n", val);
|
||||||
|
|
||||||
|
val = __read_register(dev, CVP0_CVP_SS_MPU_SECURE_ENABLE);
|
||||||
|
dprintk(CVP_ERR, "MPU_SECURE_ENABLE %#x\n", val);
|
||||||
|
|
||||||
|
val = __read_register(dev, CVP0_CVP_SS_ARP_THREAD_0_SECURE_ENABLE);
|
||||||
|
dprintk(CVP_ERR, "ARP_THREAD_0_SECURE_ENABLE %#x\n", val);
|
||||||
|
|
||||||
|
val = __read_register(dev, CVP0_CVP_SS_ARP_THREAD_1_SECURE_ENABLE);
|
||||||
|
dprintk(CVP_ERR, "ARP_THREAD_1_SECURE_ENABLE %#x\n", val);
|
||||||
|
|
||||||
|
val = __read_register(dev, CVP0_CVP_SS_ARP_THREAD_2_SECURE_ENABLE);
|
||||||
|
dprintk(CVP_ERR, "ARP_THREAD_2_SECURE_ENABLE %#x\n", val);
|
||||||
|
|
||||||
|
val = __read_register(dev, CVP0_CVP_SS_ARP_THREAD_3_SECURE_ENABLE);
|
||||||
|
dprintk(CVP_ERR, "ARP_THREAD_3_SECURE_ENABLE %#x\n", val);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static int iris_hfi_session_init(void *device, void *session_id,
|
static int iris_hfi_session_init(void *device, void *session_id,
|
||||||
void **new_session)
|
void **new_session)
|
||||||
{
|
{
|
||||||
@@ -4870,6 +4907,7 @@ static void iris_init_hfi_callbacks(struct cvp_hfi_device *hdev)
|
|||||||
hdev->noc_error_info = iris_hfi_noc_error_info;
|
hdev->noc_error_info = iris_hfi_noc_error_info;
|
||||||
hdev->validate_session = iris_hfi_validate_session;
|
hdev->validate_session = iris_hfi_validate_session;
|
||||||
hdev->pm_qos_update = iris_pm_qos_update;
|
hdev->pm_qos_update = iris_pm_qos_update;
|
||||||
|
hdev->debug_hook = iris_debug_hook;
|
||||||
}
|
}
|
||||||
|
|
||||||
int cvp_iris_hfi_initialize(struct cvp_hfi_device *hdev, u32 device_id,
|
int cvp_iris_hfi_initialize(struct cvp_hfi_device *hdev, u32 device_id,
|
||||||
|
@@ -241,6 +241,7 @@ struct msm_cvp_hfi_defs {
|
|||||||
unsigned int size;
|
unsigned int size;
|
||||||
unsigned int type;
|
unsigned int type;
|
||||||
bool is_config_pkt;
|
bool is_config_pkt;
|
||||||
|
bool checksum_enabled;
|
||||||
enum hal_command_response resp;
|
enum hal_command_response resp;
|
||||||
char name[PKT_NAME_LEN];
|
char name[PKT_NAME_LEN];
|
||||||
};
|
};
|
||||||
@@ -270,6 +271,7 @@ struct cvp_hfi_device {
|
|||||||
int (*noc_error_info)(void *dev);
|
int (*noc_error_info)(void *dev);
|
||||||
int (*validate_session)(void *sess, const char *func);
|
int (*validate_session)(void *sess, const char *func);
|
||||||
int (*pm_qos_update)(void *device);
|
int (*pm_qos_update)(void *device);
|
||||||
|
int (*debug_hook)(void *device);
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef void (*hfi_cmd_response_callback) (enum hal_command_response cmd,
|
typedef void (*hfi_cmd_response_callback) (enum hal_command_response cmd,
|
||||||
|
@@ -211,7 +211,7 @@ int msm_cvp_map_smem(struct msm_cvp_inst *inst,
|
|||||||
int i, rc = 0;
|
int i, rc = 0;
|
||||||
|
|
||||||
dma_addr_t iova = 0;
|
dma_addr_t iova = 0;
|
||||||
u32 temp = 0;
|
u32 temp = 0, checksum = 0;
|
||||||
u32 align = SZ_4K;
|
u32 align = SZ_4K;
|
||||||
struct dma_buf *dma_buf;
|
struct dma_buf *dma_buf;
|
||||||
bool is_config_pkt = false;
|
bool is_config_pkt = false;
|
||||||
@@ -262,6 +262,20 @@ int msm_cvp_map_smem(struct msm_cvp_inst *inst,
|
|||||||
/* User persist buffer has no feature config info */
|
/* User persist buffer has no feature config info */
|
||||||
is_config_pkt = cvp_hfi_defs[i].is_config_pkt;
|
is_config_pkt = cvp_hfi_defs[i].is_config_pkt;
|
||||||
|
|
||||||
|
if (i > 0 && cvp_hfi_defs[i].checksum_enabled) {
|
||||||
|
dma_buf_begin_cpu_access(dma_buf, DMA_BIDIRECTIONAL);
|
||||||
|
smem->kvaddr = __cvp_dma_buf_vmap(dma_buf);
|
||||||
|
if (!smem->kvaddr) {
|
||||||
|
dprintk(CVP_WARN, "%s Fail map into kernel\n",
|
||||||
|
__func__);
|
||||||
|
dma_buf_end_cpu_access(dma_buf, DMA_BIDIRECTIONAL);
|
||||||
|
} else {
|
||||||
|
for (i = 0; i < 256; i++)
|
||||||
|
checksum += *(u32 *)(smem->kvaddr + i*sizeof(u32));
|
||||||
|
dprintk(CVP_MEM, "Map checksum %#x fd=%d\n",
|
||||||
|
checksum, smem->fd);
|
||||||
|
}
|
||||||
|
}
|
||||||
print_smem(CVP_MEM, str, inst, smem);
|
print_smem(CVP_MEM, str, inst, smem);
|
||||||
atomic_inc(&inst->smem_count);
|
atomic_inc(&inst->smem_count);
|
||||||
goto success;
|
goto success;
|
||||||
@@ -277,7 +291,9 @@ int msm_cvp_unmap_smem(struct msm_cvp_inst *inst,
|
|||||||
struct msm_cvp_smem *smem,
|
struct msm_cvp_smem *smem,
|
||||||
const char *str)
|
const char *str)
|
||||||
{
|
{
|
||||||
int rc = 0;
|
int i, rc = 0;
|
||||||
|
u32 checksum = 0;
|
||||||
|
struct dma_buf *dma_buf;
|
||||||
|
|
||||||
if (!smem) {
|
if (!smem) {
|
||||||
dprintk(CVP_ERR, "%s: Invalid params: %pK\n", __func__, smem);
|
dprintk(CVP_ERR, "%s: Invalid params: %pK\n", __func__, smem);
|
||||||
@@ -286,6 +302,23 @@ int msm_cvp_unmap_smem(struct msm_cvp_inst *inst,
|
|||||||
}
|
}
|
||||||
|
|
||||||
print_smem(CVP_MEM, str, inst, smem);
|
print_smem(CVP_MEM, str, inst, smem);
|
||||||
|
dma_buf = smem->dma_buf;
|
||||||
|
i = get_pkt_index_from_type(smem->pkt_type);
|
||||||
|
if (i > 0 && cvp_hfi_defs[i].checksum_enabled) {
|
||||||
|
if (!smem->kvaddr) {
|
||||||
|
dprintk(CVP_WARN, "%s DS buf Fail map into kernel\n",
|
||||||
|
__func__);
|
||||||
|
dma_buf_end_cpu_access(dma_buf, DMA_BIDIRECTIONAL);
|
||||||
|
} else {
|
||||||
|
for (i = 0; i < 256; i++)
|
||||||
|
checksum += *(u32 *)(smem->kvaddr + i*sizeof(u32));
|
||||||
|
dprintk(CVP_MEM, "Unmap checksum %#x fd=%d\n",
|
||||||
|
checksum, smem->fd);
|
||||||
|
__cvp_dma_buf_vunmap(dma_buf, smem->kvaddr);
|
||||||
|
smem->kvaddr = 0;
|
||||||
|
dma_buf_end_cpu_access(dma_buf, DMA_BIDIRECTIONAL);
|
||||||
|
}
|
||||||
|
}
|
||||||
rc = msm_dma_put_device_address(smem->flags, &smem->mapping_info);
|
rc = msm_dma_put_device_address(smem->flags, &smem->mapping_info);
|
||||||
if (rc) {
|
if (rc) {
|
||||||
dprintk(CVP_ERR, "Failed to put device address: %d\n", rc);
|
dprintk(CVP_ERR, "Failed to put device address: %d\n", rc);
|
||||||
|
@@ -1794,7 +1794,7 @@ struct cvp_internal_buf *cvp_allocate_arp_bufs(struct msm_cvp_inst *inst,
|
|||||||
/* PERSIST buffer requires secure mapping
|
/* PERSIST buffer requires secure mapping
|
||||||
* Disable and wait for hyp_assign available
|
* Disable and wait for hyp_assign available
|
||||||
*/
|
*/
|
||||||
smem_flags |= SMEM_SECURE | SMEM_NON_PIXEL;
|
smem_flags |= SMEM_SECURE | SMEM_NON_PIXEL;
|
||||||
|
|
||||||
buf = cvp_kmem_cache_zalloc(&cvp_driver->buf_cache, GFP_KERNEL);
|
buf = cvp_kmem_cache_zalloc(&cvp_driver->buf_cache, GFP_KERNEL);
|
||||||
if (!buf) {
|
if (!buf) {
|
||||||
|
@@ -22,7 +22,7 @@ int msm_cvp_fw_debug = 0x18;
|
|||||||
int msm_cvp_fw_debug_mode = 1;
|
int msm_cvp_fw_debug_mode = 1;
|
||||||
int msm_cvp_fw_low_power_mode = 0; /*disable during initial stage*/
|
int msm_cvp_fw_low_power_mode = 0; /*disable during initial stage*/
|
||||||
bool msm_cvp_fw_coverage = !true;
|
bool msm_cvp_fw_coverage = !true;
|
||||||
bool msm_cvp_auto_pil = !true; /*disable during initial stage*/
|
bool msm_cvp_auto_pil = true;
|
||||||
bool msm_cvp_cacheop_enabled = true;
|
bool msm_cvp_cacheop_enabled = true;
|
||||||
bool msm_cvp_thermal_mitigation_disabled = !true;
|
bool msm_cvp_thermal_mitigation_disabled = !true;
|
||||||
bool msm_cvp_cacheop_disabled = !true;
|
bool msm_cvp_cacheop_disabled = !true;
|
||||||
|
@@ -247,7 +247,7 @@ static struct msm_cvp_common_data sm8650_common_data[] = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
.key = "qcom,dsp-enabled",
|
.key = "qcom,dsp-enabled",
|
||||||
.value = 0, /* Disable during initial stage for Rumi 48 bringup */
|
.value = 1,
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -1019,8 +1019,10 @@ int msm_cvp_smmu_fault_handler(struct iommu_domain *domain,
|
|||||||
msm_cvp_print_inst_bufs(inst, log);
|
msm_cvp_print_inst_bufs(inst, log);
|
||||||
}
|
}
|
||||||
hdev = core->device->hfi_device_data;
|
hdev = core->device->hfi_device_data;
|
||||||
if (hdev)
|
if (hdev) {
|
||||||
hdev->error = CVP_ERR_NOC_ERROR;
|
hdev->error = CVP_ERR_NOC_ERROR;
|
||||||
|
call_hfi_op(core->device, debug_hook, hdev);
|
||||||
|
}
|
||||||
mutex_unlock(&core->lock);
|
mutex_unlock(&core->lock);
|
||||||
/*
|
/*
|
||||||
* Return -EINVAL to elicit the default behaviour of smmu driver.
|
* Return -EINVAL to elicit the default behaviour of smmu driver.
|
||||||
|
Reference in New Issue
Block a user