|
@@ -9,6 +9,13 @@
|
|
#include "hw_fence_drv_ipc.h"
|
|
#include "hw_fence_drv_ipc.h"
|
|
#include "hw_fence_drv_debug.h"
|
|
#include "hw_fence_drv_debug.h"
|
|
|
|
|
|
|
|
+/*
|
|
|
|
+ * Max size of base table with ipc mappings, with one mapping per client type with configurable
|
|
|
|
+ * number of subclients
|
|
|
|
+ */
|
|
|
|
+#define HW_FENCE_IPC_MAP_MAX (HW_FENCE_MAX_STATIC_CLIENTS_INDEX + \
|
|
|
|
+ HW_FENCE_MAX_CLIENT_TYPE_CONFIGURABLE)
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* struct hw_fence_client_ipc_map - map client id with ipc signal for trigger.
|
|
* struct hw_fence_client_ipc_map - map client id with ipc signal for trigger.
|
|
* @ipc_client_id_virt: virtual ipc client id for the hw-fence client.
|
|
* @ipc_client_id_virt: virtual ipc client id for the hw-fence client.
|
|
@@ -36,7 +43,7 @@ struct hw_fence_client_ipc_map {
|
|
* To change to a loopback signal instead of GMU, change ctx0 row to use:
|
|
* To change to a loopback signal instead of GMU, change ctx0 row to use:
|
|
* {HW_FENCE_IPC_CLIENT_ID_APPS, 20}.
|
|
* {HW_FENCE_IPC_CLIENT_ID_APPS, 20}.
|
|
*/
|
|
*/
|
|
-struct hw_fence_client_ipc_map hw_fence_clients_ipc_map_no_dpu[HW_FENCE_CLIENT_MAX] = {
|
|
|
|
|
|
+struct hw_fence_client_ipc_map hw_fence_clients_ipc_map_no_dpu[HW_FENCE_IPC_MAP_MAX] = {
|
|
{HW_FENCE_IPC_CLIENT_ID_APPS_VID, HW_FENCE_IPC_CLIENT_ID_APPS_VID, 1, true, true},/* ctrlq*/
|
|
{HW_FENCE_IPC_CLIENT_ID_APPS_VID, HW_FENCE_IPC_CLIENT_ID_APPS_VID, 1, true, true},/* ctrlq*/
|
|
{HW_FENCE_IPC_CLIENT_ID_GPU_VID, HW_FENCE_IPC_CLIENT_ID_GPU_VID, 0, false, false},/* ctx0 */
|
|
{HW_FENCE_IPC_CLIENT_ID_GPU_VID, HW_FENCE_IPC_CLIENT_ID_GPU_VID, 0, false, false},/* ctx0 */
|
|
{HW_FENCE_IPC_CLIENT_ID_APPS_VID, HW_FENCE_IPC_CLIENT_ID_APPS_VID, 14, false, true},/*ctl0*/
|
|
{HW_FENCE_IPC_CLIENT_ID_APPS_VID, HW_FENCE_IPC_CLIENT_ID_APPS_VID, 14, false, true},/*ctl0*/
|
|
@@ -64,7 +71,7 @@ struct hw_fence_client_ipc_map hw_fence_clients_ipc_map_no_dpu[HW_FENCE_CLIENT_M
|
|
*
|
|
*
|
|
* Note that the index of this struct must match the enum hw_fence_client_id
|
|
* Note that the index of this struct must match the enum hw_fence_client_id
|
|
*/
|
|
*/
|
|
-struct hw_fence_client_ipc_map hw_fence_clients_ipc_map[HW_FENCE_CLIENT_MAX] = {
|
|
|
|
|
|
+struct hw_fence_client_ipc_map hw_fence_clients_ipc_map[HW_FENCE_IPC_MAP_MAX] = {
|
|
{HW_FENCE_IPC_CLIENT_ID_APPS_VID, HW_FENCE_IPC_CLIENT_ID_APPS_VID, 1, true, true},/*ctrl q*/
|
|
{HW_FENCE_IPC_CLIENT_ID_APPS_VID, HW_FENCE_IPC_CLIENT_ID_APPS_VID, 1, true, true},/*ctrl q*/
|
|
{HW_FENCE_IPC_CLIENT_ID_GPU_VID, HW_FENCE_IPC_CLIENT_ID_GPU_VID, 0, false, false},/*ctx0 */
|
|
{HW_FENCE_IPC_CLIENT_ID_GPU_VID, HW_FENCE_IPC_CLIENT_ID_GPU_VID, 0, false, false},/*ctx0 */
|
|
{HW_FENCE_IPC_CLIENT_ID_DPU_VID, HW_FENCE_IPC_CLIENT_ID_DPU_VID, 0, false, true},/* ctl0 */
|
|
{HW_FENCE_IPC_CLIENT_ID_DPU_VID, HW_FENCE_IPC_CLIENT_ID_DPU_VID, 0, false, true},/* ctl0 */
|
|
@@ -81,7 +88,17 @@ struct hw_fence_client_ipc_map hw_fence_clients_ipc_map[HW_FENCE_CLIENT_MAX] = {
|
|
{HW_FENCE_IPC_CLIENT_ID_APPS_VID, HW_FENCE_IPC_CLIENT_ID_APPS_VID, 25, true, true},/* val4*/
|
|
{HW_FENCE_IPC_CLIENT_ID_APPS_VID, HW_FENCE_IPC_CLIENT_ID_APPS_VID, 25, true, true},/* val4*/
|
|
{HW_FENCE_IPC_CLIENT_ID_APPS_VID, HW_FENCE_IPC_CLIENT_ID_APPS_VID, 26, true, true},/* val5*/
|
|
{HW_FENCE_IPC_CLIENT_ID_APPS_VID, HW_FENCE_IPC_CLIENT_ID_APPS_VID, 26, true, true},/* val5*/
|
|
{HW_FENCE_IPC_CLIENT_ID_APPS_VID, HW_FENCE_IPC_CLIENT_ID_APPS_VID, 27, true, true},/* val6*/
|
|
{HW_FENCE_IPC_CLIENT_ID_APPS_VID, HW_FENCE_IPC_CLIENT_ID_APPS_VID, 27, true, true},/* val6*/
|
|
|
|
+#else
|
|
|
|
+ {0, 0, 0, false, false}, /* val0 */
|
|
|
|
+ {0, 0, 0, false, false}, /* val1 */
|
|
|
|
+ {0, 0, 0, false, false}, /* val2 */
|
|
|
|
+ {0, 0, 0, false, false}, /* val3 */
|
|
|
|
+ {0, 0, 0, false, false}, /* val4 */
|
|
|
|
+ {0, 0, 0, false, false}, /* val5 */
|
|
|
|
+ {0, 0, 0, false, false}, /* val6 */
|
|
#endif /* CONFIG_DEBUG_FS */
|
|
#endif /* CONFIG_DEBUG_FS */
|
|
|
|
+ {HW_FENCE_IPC_CLIENT_ID_IPE_VID, HW_FENCE_IPC_CLIENT_ID_IPE_VID, 0, true, true}, /* ipe */
|
|
|
|
+ {HW_FENCE_IPC_CLIENT_ID_VPU_VID, HW_FENCE_IPC_CLIENT_ID_VPU_VID, 0, true, true}, /* vpu */
|
|
};
|
|
};
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -90,9 +107,12 @@ struct hw_fence_client_ipc_map hw_fence_clients_ipc_map[HW_FENCE_CLIENT_MAX] = {
|
|
* signaled.
|
|
* signaled.
|
|
* This version is for targets that support dpu client id and IPC v2.
|
|
* This version is for targets that support dpu client id and IPC v2.
|
|
*
|
|
*
|
|
- * Note that the index of this struct must match the enum hw_fence_client_id
|
|
|
|
|
|
+ * Note that the index of this struct must match the enum hw_fence_client_id for clients ids less
|
|
|
|
+ * than HW_FENCE_MAX_STATIC_CLIENTS_INDEX.
|
|
|
|
+ * For clients with configurable sub-clients, the index of this struct matches
|
|
|
|
+ * HW_FENCE_MAX_STATIC_CLIENTS_INDEX + (client type index - HW_FENCE_MAX_CLIENT_TYPE_STATIC).
|
|
*/
|
|
*/
|
|
-struct hw_fence_client_ipc_map hw_fence_clients_ipc_map_v2[HW_FENCE_CLIENT_MAX] = {
|
|
|
|
|
|
+struct hw_fence_client_ipc_map hw_fence_clients_ipc_map_v2[HW_FENCE_IPC_MAP_MAX] = {
|
|
{HW_FENCE_IPC_CLIENT_ID_APPS_VID, HW_FENCE_IPC_CLIENT_ID_APPS_PID, 1, true, true},/*ctrlq */
|
|
{HW_FENCE_IPC_CLIENT_ID_APPS_VID, HW_FENCE_IPC_CLIENT_ID_APPS_PID, 1, true, true},/*ctrlq */
|
|
{HW_FENCE_IPC_CLIENT_ID_GPU_VID, HW_FENCE_IPC_CLIENT_ID_GPU_PID, 0, false, false},/* ctx0*/
|
|
{HW_FENCE_IPC_CLIENT_ID_GPU_VID, HW_FENCE_IPC_CLIENT_ID_GPU_PID, 0, false, false},/* ctx0*/
|
|
{HW_FENCE_IPC_CLIENT_ID_DPU_VID, HW_FENCE_IPC_CLIENT_ID_DPU_PID, 0, false, true},/* ctl0 */
|
|
{HW_FENCE_IPC_CLIENT_ID_DPU_VID, HW_FENCE_IPC_CLIENT_ID_DPU_PID, 0, false, true},/* ctl0 */
|
|
@@ -109,12 +129,30 @@ struct hw_fence_client_ipc_map hw_fence_clients_ipc_map_v2[HW_FENCE_CLIENT_MAX]
|
|
{HW_FENCE_IPC_CLIENT_ID_APPS_VID, HW_FENCE_IPC_CLIENT_ID_APPS_PID, 25, true, true},/* val4*/
|
|
{HW_FENCE_IPC_CLIENT_ID_APPS_VID, HW_FENCE_IPC_CLIENT_ID_APPS_PID, 25, true, true},/* val4*/
|
|
{HW_FENCE_IPC_CLIENT_ID_APPS_VID, HW_FENCE_IPC_CLIENT_ID_APPS_PID, 26, true, true},/* val5*/
|
|
{HW_FENCE_IPC_CLIENT_ID_APPS_VID, HW_FENCE_IPC_CLIENT_ID_APPS_PID, 26, true, true},/* val5*/
|
|
{HW_FENCE_IPC_CLIENT_ID_APPS_VID, HW_FENCE_IPC_CLIENT_ID_APPS_PID, 27, true, true},/* val6*/
|
|
{HW_FENCE_IPC_CLIENT_ID_APPS_VID, HW_FENCE_IPC_CLIENT_ID_APPS_PID, 27, true, true},/* val6*/
|
|
|
|
+#else
|
|
|
|
+ {0, 0, 0, false, false}, /* val0 */
|
|
|
|
+ {0, 0, 0, false, false}, /* val1 */
|
|
|
|
+ {0, 0, 0, false, false}, /* val2 */
|
|
|
|
+ {0, 0, 0, false, false}, /* val3 */
|
|
|
|
+ {0, 0, 0, false, false}, /* val4 */
|
|
|
|
+ {0, 0, 0, false, false}, /* val5 */
|
|
|
|
+ {0, 0, 0, false, false}, /* val6 */
|
|
#endif /* CONFIG_DEBUG_FS */
|
|
#endif /* CONFIG_DEBUG_FS */
|
|
|
|
+ {HW_FENCE_IPC_CLIENT_ID_IPE_VID, HW_FENCE_IPC_CLIENT_ID_IPE_PID, 0, true, true}, /* ipe */
|
|
|
|
+ {HW_FENCE_IPC_CLIENT_ID_VPU_VID, HW_FENCE_IPC_CLIENT_ID_VPU_PID, 0, true, true}, /* vpu */
|
|
|
|
+ {HW_FENCE_IPC_CLIENT_ID_IFE0_VID, HW_FENCE_IPC_CLIENT_ID_IFE0_PID, 0, false, true},/* ife0*/
|
|
|
|
+ {HW_FENCE_IPC_CLIENT_ID_IFE1_VID, HW_FENCE_IPC_CLIENT_ID_IFE1_PID, 0, false, true},/* ife1*/
|
|
|
|
+ {HW_FENCE_IPC_CLIENT_ID_IFE2_VID, HW_FENCE_IPC_CLIENT_ID_IFE2_PID, 0, false, true},/* ife2*/
|
|
|
|
+ {HW_FENCE_IPC_CLIENT_ID_IFE3_VID, HW_FENCE_IPC_CLIENT_ID_IFE3_PID, 0, false, true},/* ife3*/
|
|
|
|
+ {HW_FENCE_IPC_CLIENT_ID_IFE4_VID, HW_FENCE_IPC_CLIENT_ID_IFE4_PID, 0, false, true},/* ife4*/
|
|
|
|
+ {HW_FENCE_IPC_CLIENT_ID_IFE5_VID, HW_FENCE_IPC_CLIENT_ID_IFE5_PID, 0, false, true},/* ife5*/
|
|
|
|
+ {HW_FENCE_IPC_CLIENT_ID_IFE6_VID, HW_FENCE_IPC_CLIENT_ID_IFE6_PID, 0, false, true},/* ife6*/
|
|
|
|
+ {HW_FENCE_IPC_CLIENT_ID_IFE7_VID, HW_FENCE_IPC_CLIENT_ID_IFE7_PID, 0, false, true},/* ife7*/
|
|
};
|
|
};
|
|
|
|
|
|
int hw_fence_ipcc_get_client_virt_id(struct hw_fence_driver_data *drv_data, u32 client_id)
|
|
int hw_fence_ipcc_get_client_virt_id(struct hw_fence_driver_data *drv_data, u32 client_id)
|
|
{
|
|
{
|
|
- if (!drv_data || client_id >= HW_FENCE_CLIENT_MAX)
|
|
|
|
|
|
+ if (!drv_data || client_id >= drv_data->clients_num)
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
|
|
|
|
return drv_data->ipc_clients_table[client_id].ipc_client_id_virt;
|
|
return drv_data->ipc_clients_table[client_id].ipc_client_id_virt;
|
|
@@ -122,7 +160,7 @@ int hw_fence_ipcc_get_client_virt_id(struct hw_fence_driver_data *drv_data, u32
|
|
|
|
|
|
int hw_fence_ipcc_get_client_phys_id(struct hw_fence_driver_data *drv_data, u32 client_id)
|
|
int hw_fence_ipcc_get_client_phys_id(struct hw_fence_driver_data *drv_data, u32 client_id)
|
|
{
|
|
{
|
|
- if (!drv_data || client_id >= HW_FENCE_CLIENT_MAX)
|
|
|
|
|
|
+ if (!drv_data || client_id >= drv_data->clients_num)
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
|
|
|
|
return drv_data->ipc_clients_table[client_id].ipc_client_id_phys;
|
|
return drv_data->ipc_clients_table[client_id].ipc_client_id_phys;
|
|
@@ -130,7 +168,7 @@ int hw_fence_ipcc_get_client_phys_id(struct hw_fence_driver_data *drv_data, u32
|
|
|
|
|
|
int hw_fence_ipcc_get_signal_id(struct hw_fence_driver_data *drv_data, u32 client_id)
|
|
int hw_fence_ipcc_get_signal_id(struct hw_fence_driver_data *drv_data, u32 client_id)
|
|
{
|
|
{
|
|
- if (!drv_data || client_id >= HW_FENCE_CLIENT_MAX)
|
|
|
|
|
|
+ if (!drv_data || client_id >= drv_data->clients_num)
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
|
|
|
|
return drv_data->ipc_clients_table[client_id].ipc_signal_id;
|
|
return drv_data->ipc_clients_table[client_id].ipc_signal_id;
|
|
@@ -138,8 +176,8 @@ int hw_fence_ipcc_get_signal_id(struct hw_fence_driver_data *drv_data, u32 clien
|
|
|
|
|
|
bool hw_fence_ipcc_needs_rxq_update(struct hw_fence_driver_data *drv_data, int client_id)
|
|
bool hw_fence_ipcc_needs_rxq_update(struct hw_fence_driver_data *drv_data, int client_id)
|
|
{
|
|
{
|
|
- if (!drv_data || client_id >= HW_FENCE_CLIENT_MAX)
|
|
|
|
- return -EINVAL;
|
|
|
|
|
|
+ if (!drv_data || client_id >= drv_data->clients_num)
|
|
|
|
+ return false;
|
|
|
|
|
|
return drv_data->ipc_clients_table[client_id].update_rxq;
|
|
return drv_data->ipc_clients_table[client_id].update_rxq;
|
|
}
|
|
}
|
|
@@ -147,7 +185,7 @@ bool hw_fence_ipcc_needs_rxq_update(struct hw_fence_driver_data *drv_data, int c
|
|
bool hw_fence_ipcc_needs_ipc_irq(struct hw_fence_driver_data *drv_data, int client_id)
|
|
bool hw_fence_ipcc_needs_ipc_irq(struct hw_fence_driver_data *drv_data, int client_id)
|
|
{
|
|
{
|
|
if (!drv_data || client_id >= HW_FENCE_CLIENT_MAX)
|
|
if (!drv_data || client_id >= HW_FENCE_CLIENT_MAX)
|
|
- return -EINVAL;
|
|
|
|
|
|
+ return false;
|
|
|
|
|
|
return drv_data->ipc_clients_table[client_id].send_ipc;
|
|
return drv_data->ipc_clients_table[client_id].send_ipc;
|
|
}
|
|
}
|
|
@@ -164,6 +202,26 @@ static inline char *_get_ipc_phys_client_name(u32 client_id)
|
|
return "GPU_PID";
|
|
return "GPU_PID";
|
|
case HW_FENCE_IPC_CLIENT_ID_DPU_PID:
|
|
case HW_FENCE_IPC_CLIENT_ID_DPU_PID:
|
|
return "DPU_PID";
|
|
return "DPU_PID";
|
|
|
|
+ case HW_FENCE_IPC_CLIENT_ID_IPE_PID:
|
|
|
|
+ return "IPE_PID";
|
|
|
|
+ case HW_FENCE_IPC_CLIENT_ID_VPU_PID:
|
|
|
|
+ return "VPU_PID";
|
|
|
|
+ case HW_FENCE_IPC_CLIENT_ID_IFE0_PID:
|
|
|
|
+ return "IFE0_PID";
|
|
|
|
+ case HW_FENCE_IPC_CLIENT_ID_IFE1_PID:
|
|
|
|
+ return "IFE1_PID";
|
|
|
|
+ case HW_FENCE_IPC_CLIENT_ID_IFE2_PID:
|
|
|
|
+ return "IFE2_PID";
|
|
|
|
+ case HW_FENCE_IPC_CLIENT_ID_IFE3_PID:
|
|
|
|
+ return "IFE3_PID";
|
|
|
|
+ case HW_FENCE_IPC_CLIENT_ID_IFE4_PID:
|
|
|
|
+ return "IFE4_PID";
|
|
|
|
+ case HW_FENCE_IPC_CLIENT_ID_IFE5_PID:
|
|
|
|
+ return "IFE5_PID";
|
|
|
|
+ case HW_FENCE_IPC_CLIENT_ID_IFE6_PID:
|
|
|
|
+ return "IFE6_PID";
|
|
|
|
+ case HW_FENCE_IPC_CLIENT_ID_IFE7_PID:
|
|
|
|
+ return "IFE7_PID";
|
|
}
|
|
}
|
|
|
|
|
|
return "UNKNOWN_PID";
|
|
return "UNKNOWN_PID";
|
|
@@ -181,6 +239,26 @@ static inline char *_get_ipc_virt_client_name(u32 client_id)
|
|
return "GPU_VID";
|
|
return "GPU_VID";
|
|
case HW_FENCE_IPC_CLIENT_ID_DPU_VID:
|
|
case HW_FENCE_IPC_CLIENT_ID_DPU_VID:
|
|
return "DPU_VID";
|
|
return "DPU_VID";
|
|
|
|
+ case HW_FENCE_IPC_CLIENT_ID_IPE_VID:
|
|
|
|
+ return "IPE_VID";
|
|
|
|
+ case HW_FENCE_IPC_CLIENT_ID_VPU_VID:
|
|
|
|
+ return "VPU_VID";
|
|
|
|
+ case HW_FENCE_IPC_CLIENT_ID_IFE0_VID:
|
|
|
|
+ return "IFE0_VID";
|
|
|
|
+ case HW_FENCE_IPC_CLIENT_ID_IFE1_VID:
|
|
|
|
+ return "IFE1_VID";
|
|
|
|
+ case HW_FENCE_IPC_CLIENT_ID_IFE2_VID:
|
|
|
|
+ return "IFE2_VID";
|
|
|
|
+ case HW_FENCE_IPC_CLIENT_ID_IFE3_VID:
|
|
|
|
+ return "IFE3_VID";
|
|
|
|
+ case HW_FENCE_IPC_CLIENT_ID_IFE4_VID:
|
|
|
|
+ return "IFE4_VID";
|
|
|
|
+ case HW_FENCE_IPC_CLIENT_ID_IFE5_VID:
|
|
|
|
+ return "IFE5_VID";
|
|
|
|
+ case HW_FENCE_IPC_CLIENT_ID_IFE6_VID:
|
|
|
|
+ return "IFE6_VID";
|
|
|
|
+ case HW_FENCE_IPC_CLIENT_ID_IFE7_VID:
|
|
|
|
+ return "IFE7_VID";
|
|
}
|
|
}
|
|
|
|
|
|
return "UNKNOWN_VID";
|
|
return "UNKNOWN_VID";
|
|
@@ -208,6 +286,46 @@ void hw_fence_ipcc_trigger_signal(struct hw_fence_driver_data *drv_data,
|
|
wmb();
|
|
wmb();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+static int _hw_fence_ipcc_init_map_with_configurable_clients(struct hw_fence_driver_data *drv_data,
|
|
|
|
+ struct hw_fence_client_ipc_map *base_table)
|
|
|
|
+{
|
|
|
|
+ int i, j, map_idx;
|
|
|
|
+ size_t size;
|
|
|
|
+
|
|
|
|
+ size = drv_data->clients_num * sizeof(struct hw_fence_client_ipc_map);
|
|
|
|
+ drv_data->ipc_clients_table = kzalloc(size, GFP_KERNEL);
|
|
|
|
+
|
|
|
|
+ if (!drv_data->ipc_clients_table)
|
|
|
|
+ return -ENOMEM;
|
|
|
|
+
|
|
|
|
+ /* copy mappings for static hw fence clients */
|
|
|
|
+ size = HW_FENCE_MAX_STATIC_CLIENTS_INDEX * sizeof(struct hw_fence_client_ipc_map);
|
|
|
|
+ memcpy(drv_data->ipc_clients_table, base_table, size);
|
|
|
|
+
|
|
|
|
+ /* initialize mappings for ipc clients with configurable number of hw fence clients */
|
|
|
|
+ map_idx = HW_FENCE_MAX_STATIC_CLIENTS_INDEX;
|
|
|
|
+ for (i = 0; i < HW_FENCE_MAX_CLIENT_TYPE_CONFIGURABLE; i++) {
|
|
|
|
+ int client_type = HW_FENCE_MAX_CLIENT_TYPE_STATIC + i;
|
|
|
|
+ int clients_num = drv_data->hw_fence_client_types[client_type].clients_num;
|
|
|
|
+
|
|
|
|
+ for (j = 0; j < clients_num; j++) {
|
|
|
|
+ /* this should never happen if drv_data->clients_num is correct */
|
|
|
|
+ if (map_idx >= drv_data->clients_num) {
|
|
|
|
+ HWFNC_ERR("%s clients_num:%lu exceeds drv_data->clients_num:%lu\n",
|
|
|
|
+ drv_data->hw_fence_client_types[client_type].name,
|
|
|
|
+ clients_num, drv_data->clients_num);
|
|
|
|
+ return -EINVAL;
|
|
|
|
+ }
|
|
|
|
+ drv_data->ipc_clients_table[map_idx] =
|
|
|
|
+ base_table[HW_FENCE_MAX_STATIC_CLIENTS_INDEX + i];
|
|
|
|
+ drv_data->ipc_clients_table[map_idx].ipc_signal_id = j;
|
|
|
|
+ map_idx++;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return 0;
|
|
|
|
+}
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* _hw_fence_ipcc_hwrev_init() - Initializes internal driver struct with corresponding ipcc data,
|
|
* _hw_fence_ipcc_hwrev_init() - Initializes internal driver struct with corresponding ipcc data,
|
|
* according to the ipcc hw revision.
|
|
* according to the ipcc hw revision.
|
|
@@ -216,6 +334,8 @@ void hw_fence_ipcc_trigger_signal(struct hw_fence_driver_data *drv_data,
|
|
*/
|
|
*/
|
|
static int _hw_fence_ipcc_hwrev_init(struct hw_fence_driver_data *drv_data, u32 hwrev)
|
|
static int _hw_fence_ipcc_hwrev_init(struct hw_fence_driver_data *drv_data, u32 hwrev)
|
|
{
|
|
{
|
|
|
|
+ int ret = 0;
|
|
|
|
+
|
|
switch (hwrev) {
|
|
switch (hwrev) {
|
|
case HW_FENCE_IPCC_HW_REV_100:
|
|
case HW_FENCE_IPCC_HW_REV_100:
|
|
drv_data->ipcc_client_vid = HW_FENCE_IPC_CLIENT_ID_APPS_VID;
|
|
drv_data->ipcc_client_vid = HW_FENCE_IPC_CLIENT_ID_APPS_VID;
|
|
@@ -241,15 +361,16 @@ static int _hw_fence_ipcc_hwrev_init(struct hw_fence_driver_data *drv_data, u32
|
|
case HW_FENCE_IPCC_HW_REV_203:
|
|
case HW_FENCE_IPCC_HW_REV_203:
|
|
drv_data->ipcc_client_vid = HW_FENCE_IPC_CLIENT_ID_APPS_VID;
|
|
drv_data->ipcc_client_vid = HW_FENCE_IPC_CLIENT_ID_APPS_VID;
|
|
drv_data->ipcc_client_pid = HW_FENCE_IPC_CLIENT_ID_APPS_PID;
|
|
drv_data->ipcc_client_pid = HW_FENCE_IPC_CLIENT_ID_APPS_PID;
|
|
- drv_data->protocol_id = HW_FENCE_IPC_COMPUTE_L1_PROTOCOL_ID_PINEAPPLE; /* Fence */
|
|
|
|
- drv_data->ipc_clients_table = hw_fence_clients_ipc_map_v2;
|
|
|
|
|
|
+ drv_data->protocol_id = HW_FENCE_IPC_FENCE_PROTOCOL_ID_PINEAPPLE; /* Fence */
|
|
|
|
+ ret = _hw_fence_ipcc_init_map_with_configurable_clients(drv_data,
|
|
|
|
+ hw_fence_clients_ipc_map_v2);
|
|
HWFNC_DBG_INIT("ipcc protocol_id: Pineapple\n");
|
|
HWFNC_DBG_INIT("ipcc protocol_id: Pineapple\n");
|
|
break;
|
|
break;
|
|
default:
|
|
default:
|
|
return -1;
|
|
return -1;
|
|
}
|
|
}
|
|
|
|
|
|
- return 0;
|
|
|
|
|
|
+ return ret;
|
|
}
|
|
}
|
|
|
|
|
|
int hw_fence_ipcc_enable_signaling(struct hw_fence_driver_data *drv_data)
|
|
int hw_fence_ipcc_enable_signaling(struct hw_fence_driver_data *drv_data)
|
|
@@ -320,7 +441,7 @@ int hw_fence_ipcc_enable_dpu_signaling(struct hw_fence_driver_data *drv_data)
|
|
|
|
|
|
HWFNC_DBG_H("Initialize dpu signals\n");
|
|
HWFNC_DBG_H("Initialize dpu signals\n");
|
|
/* Enable Client-Signal pairs from DPU (25) to APPS(NS) (8) */
|
|
/* Enable Client-Signal pairs from DPU (25) to APPS(NS) (8) */
|
|
- for (i = 0; i < HW_FENCE_CLIENT_MAX; i++) {
|
|
|
|
|
|
+ for (i = 0; i < drv_data->clients_num; i++) {
|
|
hw_fence_client = &drv_data->ipc_clients_table[i];
|
|
hw_fence_client = &drv_data->ipc_clients_table[i];
|
|
|
|
|
|
/* skip any client that is not a dpu client */
|
|
/* skip any client that is not a dpu client */
|