Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 20190559 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: cvp: Enable cvp power collapse"

parents 565d6de4 358a02ff
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -227,12 +227,21 @@ enum venus_hfi_state {
	VENUS_STATE_INIT,
};

enum reset_state {
	INIT = 1,
	ASSERT,
	DEASSERT,
};

struct venus_hfi_device;

struct venus_hfi_vpu_ops {
	void (*interrupt_init)(struct venus_hfi_device *ptr);
	void (*setup_dsp_uc_memmap)(struct venus_hfi_device *device);
	void (*clock_config_on_enable)(struct venus_hfi_device *device);
	int (*reset_ahb2axi_bridge)(struct venus_hfi_device *device);
	void (*power_off)(struct venus_hfi_device *device);
	void (*noc_error_info)(struct venus_hfi_device *device);
};

struct venus_hfi_device {
+259 −40
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@
#include <linux/soc/qcom/smem.h>
#include <soc/qcom/subsystem_restart.h>
#include <linux/dma-mapping.h>
#include <linux/reset.h>
#include "hfi_packetization.h"
#include "msm_cvp_debug.h"
#include "cvp_core_hfi.h"
@@ -229,20 +230,16 @@ struct tzbsp_resp {
	int ret;
};

#define TZBSP_VIDEO_SET_STATE 0xa
#define TZBSP_PIL_SET_STATE 0xA
#define TZBSP_CVP_PAS_ID    26

/* Poll interval in uS */
#define POLL_INTERVAL_US 50

enum tzbsp_video_state {
	TZBSP_VIDEO_STATE_SUSPEND = 0,
	TZBSP_VIDEO_STATE_RESUME = 1,
	TZBSP_VIDEO_STATE_RESTORE_THRESHOLD = 2,
};

struct tzbsp_video_set_state_req {
	u32 state; /* should be tzbsp_video_state enum value */
	u32 spare; /* reserved for future, should be zero */
enum tzbsp_subsys_state {
	TZ_SUBSYS_STATE_SUSPEND = 0,
	TZ_SUBSYS_STATE_RESUME = 1,
	TZ_SUBSYS_STATE_RESTORE_THRESHOLD = 2,
};

const struct msm_cvp_gov_data CVP_DEFAULT_BUS_VOTE = {
@@ -271,7 +268,7 @@ static int __iface_cmdq_write(struct venus_hfi_device *device,
					void *pkt);
static int __load_fw(struct venus_hfi_device *device);
static void __unload_fw(struct venus_hfi_device *device);
static int __tzbsp_set_video_state(enum tzbsp_video_state state);
static int __tzbsp_set_cvp_state(enum tzbsp_subsys_state state);
static int __enable_subcaches(struct venus_hfi_device *device);
static int __set_subcaches(struct venus_hfi_device *device);
static int __release_subcaches(struct venus_hfi_device *device);
@@ -282,13 +279,18 @@ static int venus_hfi_noc_error_info(void *dev);
static void interrupt_init_vpu5(struct venus_hfi_device *device);
static void setup_dsp_uc_memmap_vpu5(struct venus_hfi_device *device);
static void clock_config_on_enable_vpu5(struct venus_hfi_device *device);
static int reset_ahb2axi_bridge(struct venus_hfi_device *device);
static void power_off_iris2(struct venus_hfi_device *device);

static int __set_ubwc_config(struct venus_hfi_device *device);

struct venus_hfi_vpu_ops cvp_vpu5_ops = {
static struct venus_hfi_vpu_ops iris2_ops = {
	.interrupt_init = interrupt_init_vpu5,
	.setup_dsp_uc_memmap = setup_dsp_uc_memmap_vpu5,
	.clock_config_on_enable = clock_config_on_enable_vpu5,
	.reset_ahb2axi_bridge = reset_ahb2axi_bridge,
	.power_off = power_off_iris2,
	.noc_error_info = NULL,
};

/**
@@ -920,7 +922,7 @@ static void __set_threshold_registers(struct venus_hfi_device *device)
	if (version != (0x3 << 28 | 0x43 << 16))
		return;

	if (__tzbsp_set_video_state(TZBSP_VIDEO_STATE_RESTORE_THRESHOLD))
	if (__tzbsp_set_cvp_state(TZ_SUBSYS_STATE_RESTORE_THRESHOLD))
		dprintk(CVP_ERR, "Failed to restore threshold values\n");
}

@@ -1044,12 +1046,14 @@ static int __unvote_buses(struct venus_hfi_device *device)
		rc = msm_bus_scale_update_bw(bus->client, 0, 0);
#endif

		if (rc)
		if (rc) {
			dprintk(CVP_ERR,
			"%s: Failed unvoting bus\n", __func__);
			goto err_unknown_device;
		}
	}

err_unknown_device:
	dprintk(CVP_ERR, "%s: Failed unvoting bus\n", __func__);
	return rc;
}

@@ -1184,19 +1188,18 @@ static int __core_release_resource(struct venus_hfi_device *device,
	return rc;
}

static int __tzbsp_set_video_state(enum tzbsp_video_state state)
static int __tzbsp_set_cvp_state(enum tzbsp_subsys_state state)
{
	struct tzbsp_video_set_state_req cmd = {0};
	int tzbsp_rsp = 0;
	int rc = 0;
	struct scm_desc desc = {0};

	desc.args[0] = cmd.state = state;
	desc.args[1] = cmd.spare = 0;
	desc.args[0] = state;
	desc.args[1] = TZBSP_CVP_PAS_ID;
	desc.arginfo = SCM_ARGS(2);

	rc = scm_call2(SCM_SIP_FNID(SCM_SVC_BOOT,
			TZBSP_VIDEO_SET_STATE), &desc);
			TZBSP_PIL_SET_STATE), &desc);
	tzbsp_rsp = desc.ret[0];

	if (rc) {
@@ -1235,11 +1238,17 @@ static inline int __boot_firmware(struct venus_hfi_device *device)
		count++;
	}

	if (ctrl_status != 0x1)
		dprintk(CVP_DBG, "Failed to boot FW status: %x\n",
	if (!(ctrl_status & CVP_CTRL_INIT_STATUS__M)) {
		dprintk(CVP_ERR, "Failed to boot FW status: %x\n",
			ctrl_status);
		rc = -ENODEV;
	}

	return 0;
	/* Enable interrupt before sending commands to venus */
	__write_register(device, CVP_CPU_CS_H2XSOFTINTEN, 0x1);
	__write_register(device, CVP_CPU_CS_X2RPMh, 0x0);

	return rc;
}

static int venus_hfi_suspend(void *dev)
@@ -1979,6 +1988,20 @@ static int __sys_set_debug(struct venus_hfi_device *device, u32 debug)
	return 0;
}

static int __sys_set_idle_indicator(struct venus_hfi_device *device,
	bool enable)
{
	u8 packet[CVP_IFACEQ_VAR_SMALL_PKT_SIZE];
	int rc = 0;
	struct hfi_cmd_sys_set_property_packet *pkt =
		(struct hfi_cmd_sys_set_property_packet *) &packet;

	rc = call_hfi_pkt_op(device, sys_set_idle_indicator, pkt, enable);
	if (__iface_cmdq_write(device, pkt))
		return -ENOTEMPTY;
	return 0;
}

static int __sys_set_coverage(struct venus_hfi_device *device, u32 mode)
{
	u8 packet[CVP_IFACEQ_VAR_SMALL_PKT_SIZE];
@@ -2105,6 +2128,7 @@ static int venus_hfi_core_init(void *device)
	__dsp_send_hfi_queue(device);

	__set_ubwc_config(device);
	__sys_set_idle_indicator(device, true);

	if (dev->res->pm_qos_latency_us) {
#ifdef CONFIG_SMP
@@ -2947,7 +2971,7 @@ static int __power_collapse(struct venus_hfi_device *device, bool force)
skip_power_off:
	dprintk(CVP_WARN, "Skip PC(%#x, %#x, %#x)\n",
		wfi_status, idle_status, pc_ready);

	__flush_debug_queue(device, device->raw_packet);
	return -EAGAIN;
}

@@ -3463,6 +3487,59 @@ static inline int __init_clocks(struct venus_hfi_device *device)
	return rc;
}

static int __handle_reset_clk(struct msm_cvp_platform_resources *res,
			int reset_index, enum reset_state state)
{
	int rc = 0;
	struct reset_control *rst;
	struct reset_set *rst_set = &res->reset_set;

	if (!rst_set->reset_tbl)
		return 0;

	rst = rst_set->reset_tbl[reset_index].rst;
	dprintk(CVP_DBG, "reset_clk: name %s reset_state %d rst %pK\n",
		rst_set->reset_tbl[reset_index].name, state, rst);

	switch (state) {
	case INIT:
		if (rst)
			goto skip_reset_init;

		rst = devm_reset_control_get(&res->pdev->dev,
				rst_set->reset_tbl[reset_index].name);
		if (IS_ERR(rst))
			rc = PTR_ERR(rst);

		rst_set->reset_tbl[reset_index].rst = rst;
		break;
	case ASSERT:
		if (!rst) {
			rc = PTR_ERR(rst);
			goto failed_to_reset;
		}

		rc = reset_control_assert(rst);
		break;
	case DEASSERT:
		if (!rst) {
			rc = PTR_ERR(rst);
			goto failed_to_reset;
		}
		rc = reset_control_deassert(rst);
		break;
	default:
		dprintk(CVP_ERR, "Invalid reset request\n");
		if (rc)
			goto failed_to_reset;
	}

	return 0;

skip_reset_init:
failed_to_reset:
	return rc;
}

static inline void __disable_unprepare_clks(struct venus_hfi_device *device)
{
@@ -3493,6 +3570,41 @@ static inline void __disable_unprepare_clks(struct venus_hfi_device *device)
	}
}

static int reset_ahb2axi_bridge(struct venus_hfi_device *device)
{
	int rc, i;

	if (!device) {
		dprintk(CVP_ERR, "NULL device\n");
		rc = -EINVAL;
		goto failed_to_reset;
	}

	for (i = 0; i < device->res->reset_set.count; i++) {
		rc = __handle_reset_clk(device->res, i, ASSERT);
		if (rc) {
			dprintk(CVP_ERR,
				"failed to assert reset clocks\n");
			goto failed_to_reset;
		}

		/* wait for deassert */
		usleep_range(150, 250);

		rc = __handle_reset_clk(device->res, i, DEASSERT);
		if (rc) {
			dprintk(CVP_ERR,
				"failed to deassert reset clocks\n");
			goto failed_to_reset;
		}
	}

	return 0;

failed_to_reset:
	return rc;
}

static inline int __prepare_enable_clks(struct venus_hfi_device *device)
{
	struct clock_info *cl = NULL, *cl_fail = NULL;
@@ -3751,7 +3863,7 @@ static int __init_subcaches(struct venus_hfi_device *device)
static int __init_resources(struct venus_hfi_device *device,
				struct msm_cvp_platform_resources *res)
{
	int rc = 0;
	int i, rc = 0;

	rc = __init_regulators(device);
	if (rc) {
@@ -3766,6 +3878,15 @@ static int __init_resources(struct venus_hfi_device *device,
		goto err_init_clocks;
	}

	for (i = 0; i < device->res->reset_set.count; i++) {
		rc = __handle_reset_clk(res, i, INIT);
		if (rc) {
			dprintk(CVP_ERR, "Failed to init reset clocks\n");
			rc = -ENODEV;
			goto err_init_reset_clk;
		}
	}

	rc = __init_bus(device);
	if (rc) {
		dprintk(CVP_ERR, "Failed to init bus: %d\n", rc);
@@ -3782,6 +3903,7 @@ static int __init_resources(struct venus_hfi_device *device,

	return rc;

err_init_reset_clk:
err_init_bus:
	__deinit_clocks(device);
err_init_clocks:
@@ -4201,6 +4323,12 @@ static int __venus_power_on(struct venus_hfi_device *device)
		goto fail_enable_gdsc;
	}

	rc = call_venus_op(device, reset_ahb2axi_bridge, device);
	if (rc) {
		dprintk(CVP_ERR, "Failed to reset ahb2axi: %d\n", rc);
		goto fail_enable_clks;
	}

	rc = __prepare_enable_clks(device);
	if (rc) {
		dprintk(CVP_ERR, "Failed to enable clocks: %d\n", rc);
@@ -4247,7 +4375,7 @@ static int __venus_power_on(struct venus_hfi_device *device)
	return rc;
}

static void __venus_power_off(struct venus_hfi_device *device)
void power_off_common(struct venus_hfi_device *device)
{
	if (!device->power_enabled)
		return;
@@ -4283,15 +4411,15 @@ static inline int __suspend(struct venus_hfi_device *device)
		pm_qos_request_active(&device->qos))
		pm_qos_remove_request(&device->qos);

	rc = __tzbsp_set_video_state(TZBSP_VIDEO_STATE_SUSPEND);
	rc = __tzbsp_set_cvp_state(TZ_SUBSYS_STATE_SUSPEND);
	if (rc) {
		dprintk(CVP_WARN, "Failed to suspend video core %d\n", rc);
		dprintk(CVP_WARN, "Failed to suspend cvp core %d\n", rc);
		goto err_tzbsp_suspend;
	}

	__disable_subcaches(device);

	__venus_power_off(device);
	call_venus_op(device, power_off, device);
	dprintk(CVP_PROF, "Venus power off\n");
	return rc;

@@ -4299,6 +4427,97 @@ static inline int __suspend(struct venus_hfi_device *device)
	return rc;
}

static void power_off_iris2(struct venus_hfi_device *device)
{
	u32 lpi_status, reg_status = 0, count = 0, max_count = 10;

	if (!device->power_enabled)
		return;

	if (!(device->intr_status & CVP_WRAPPER_INTR_STATUS_A2HWD_BMSK))
		disable_irq_nosync(device->hal_data->irq);
	device->intr_status = 0;

	/* HPG 6.1.2 Step 1  */
	__write_register(device, CVP_CPU_CS_X2RPMh, 0x3);

	/* HPG 6.1.2 Step 2, noc to low power */
	__write_register(device, CVP_AON_WRAPPER_MVP_NOC_LPI_CONTROL, 0x1);
	while (!reg_status && count < max_count) {
		lpi_status =
			 __read_register(device,
				CVP_AON_WRAPPER_MVP_NOC_LPI_STATUS);
		reg_status = lpi_status & BIT(0);
		dprintk(CVP_DBG,
			"Noc: lpi_status %d noc_status %d (count %d)\n",
			lpi_status, reg_status, count);

		/* Wait for noc lpi status to be set */
		usleep_range(50, 100);
		count++;
	}
	if (count == max_count) {
		dprintk(CVP_WARN,
			"NOC not in qaccept status %d\n", reg_status);
	}

	/* HPG 6.1.2 Step 3, debug bridge to low power */
	__write_register(device,
		CVP_WRAPPER_DEBUG_BRIDGE_LPI_CONTROL, 0x7);
	reg_status = 0;
	count = 0;
	while ((reg_status != 0x7) && count < max_count) {
		lpi_status = __read_register(device,
				 CVP_WRAPPER_DEBUG_BRIDGE_LPI_STATUS);
		reg_status = lpi_status & 0x7;
		dprintk(CVP_DBG,
			"DBLP Set : lpi_status %d reg_status %d (count %d)\n",
			lpi_status, reg_status, count);

		/* Wait for debug bridge lpi status to be set */
		usleep_range(50, 100);
		count++;
	}
	if (count == max_count) {
		dprintk(CVP_WARN,
			"DBLP Set: status %d\n", reg_status);
	}

	/* HPG 6.1.2 Step 4, debug bridge to lpi release */
	__write_register(device,
		CVP_WRAPPER_DEBUG_BRIDGE_LPI_CONTROL, 0x0);
	lpi_status = 0x1;
	count = 0;
	while (lpi_status && count < max_count) {
		lpi_status = __read_register(device,
				 CVP_WRAPPER_DEBUG_BRIDGE_LPI_STATUS);
		dprintk(CVP_DBG,
			"DBLP Release: lpi_status %d(count %d)\n",
			lpi_status, count);
		usleep_range(50, 100);
		count++;
	}
	if (count == max_count) {
		dprintk(CVP_WARN,
			"DBLP Release: lpi_status %d\n", lpi_status);
	}

	/* HPG 6.1.2 Step 6 */
	__disable_unprepare_clks(device);

	/* HPG 6.1.2 Step 7 & 8 */
	if (call_venus_op(device, reset_ahb2axi_bridge, device))
		dprintk(CVP_ERR, "Failed to reset ahb2axi\n");

	/* HPG 6.1.2 Step 5 */
	if (__disable_regulators(device))
		dprintk(CVP_WARN, "Failed to disable regulators\n");

	if (__unvote_buses(device))
		dprintk(CVP_WARN, "Failed to unvote for buses\n");
	device->power_enabled = false;
}

static inline int __resume(struct venus_hfi_device *device)
{
	int rc = 0;
@@ -4317,22 +4536,22 @@ static inline int __resume(struct venus_hfi_device *device)
	dprintk(CVP_PROF, "Resuming from power collapse\n");
	rc = __venus_power_on(device);
	if (rc) {
		dprintk(CVP_ERR, "Failed to power on venus\n");
		dprintk(CVP_ERR, "Failed to power on cvp\n");
		goto err_venus_power_on;
	}

	/* Reboot the firmware */
	rc = __tzbsp_set_video_state(TZBSP_VIDEO_STATE_RESUME);
	rc = __tzbsp_set_cvp_state(TZ_SUBSYS_STATE_RESUME);
	if (rc) {
		dprintk(CVP_ERR, "Failed to resume video core %d\n", rc);
		goto err_set_video_state;
		dprintk(CVP_ERR, "Failed to resume cvp core %d\n", rc);
		goto err_set_cvp_state;
	}

	__setup_ucregion_memory_map(device);
	/* Wait for boot completion */
	rc = __boot_firmware(device);
	if (rc) {
		dprintk(CVP_ERR, "Failed to reset venus core\n");
		dprintk(CVP_ERR, "Failed to reset cvp core\n");
		goto err_reset_core;
	}

@@ -4366,9 +4585,9 @@ static inline int __resume(struct venus_hfi_device *device)
		device->skip_pc_count = 0;
	return rc;
err_reset_core:
	__tzbsp_set_video_state(TZBSP_VIDEO_STATE_SUSPEND);
err_set_video_state:
	__venus_power_off(device);
	__tzbsp_set_cvp_state(TZ_SUBSYS_STATE_SUSPEND);
err_set_cvp_state:
	call_venus_op(device, power_off, device);
err_venus_power_on:
	dprintk(CVP_ERR, "Failed to resume from power collapse\n");
	return rc;
@@ -4427,7 +4646,7 @@ static int __load_fw(struct venus_hfi_device *device)
		subsystem_put(device->resources.fw.cookie);
	device->resources.fw.cookie = NULL;
fail_load_fw:
	__venus_power_off(device);
	call_venus_op(device, power_off, device);
fail_venus_power_on:
fail_init_pkt:
	__deinit_resources(device);
@@ -4448,7 +4667,7 @@ static void __unload_fw(struct venus_hfi_device *device)
	__vote_buses(device, NULL, 0);
	subsystem_put(device->resources.fw.cookie);
	__interface_queues_release(device);
	__venus_power_off(device);
	call_venus_op(device, power_off, device);
	device->resources.fw.cookie = NULL;
	__deinit_resources(device);

@@ -4555,7 +4774,7 @@ static int __initialize_packetization(struct venus_hfi_device *device)

void __init_cvp_ops(struct venus_hfi_device *device)
{
	device->vpu_ops = &cvp_vpu5_ops;
	device->vpu_ops = &iris2_ops;
}

static struct venus_hfi_device *__add_device(u32 device_id,
+23 −2
Original line number Diff line number Diff line
@@ -8,7 +8,8 @@

#include <linux/io.h>

#define CVP_CPU_BASE_OFFS			0x00A0000
#define CVP_CPU_BASE_OFFS			0x000A0000
#define CVP_AON_BASE_OFFS			0x000E0000

#define CVP_CPU_CS_A2HSOFTINTEN		(CVP_CPU_BASE_OFFS + 0x10)
#define CVP_CPU_CS_A2HSOFTINTENCLR	(CVP_CPU_BASE_OFFS + 0x14)
@@ -20,6 +21,7 @@
#define CVP_CPU_CS_VMIMSGAG2		(CVP_CPU_BASE_OFFS + 0x40)
#define CVP_CPU_CS_VMIMSGAG3		(CVP_CPU_BASE_OFFS + 0x44)
#define CVP_CPU_CS_SCIACMD			(CVP_CPU_BASE_OFFS + 0x48)
#define CVP_CPU_CS_H2XSOFTINTEN		(CVP_CPU_BASE_OFFS + 0x148)

/* CVP_CTRL_STATUS */
#define CVP_CPU_CS_SCIACMDARG0		(CVP_CPU_BASE_OFFS + 0x4C)
@@ -59,9 +61,18 @@
#define CVP_CPU_CS_H2ASOFTINT		(CVP_CPU_BASE_OFFS + 0x150)
#define CVP_CPU_CS_H2ASOFTINTCLR	(CVP_CPU_BASE_OFFS + 0x154)

/* FAL10 Feature Control */
#define CVP_CPU_CS_X2RPMh		(CVP_CPU_BASE_OFFS + 0x168)
#define CVP_CPU_CS_X2RPMh_MASK0_BMSK	0x1
#define CVP_CPU_CS_X2RPMh_MASK0_SHFT	0x0
#define CVP_CPU_CS_X2RPMh_MASK1_BMSK	0x2
#define CVP_CPU_CS_X2RPMh_MASK1_SHFT	0x1
#define CVP_CPU_CS_X2RPMh_SWOVERRIDE_BMSK	0x4
#define CVP_CPU_CS_X2RPMh_SWOVERRIDE_SHFT	0x3

/*
 * --------------------------------------------------------------------------
 * MODULE: vidc_wrapper
 * MODULE: cvp_wrapper
 * --------------------------------------------------------------------------
 */
#define CVP_WRAPPER_BASE_OFFS		0x000B0000
@@ -92,6 +103,11 @@
#define CVP_WRAPPER_CPU_CLOCK_CONFIG	(CVP_WRAPPER_TZ_BASE_OFFS + 0x0)
#define CVP_WRAPPER_CPU_CGC_DIS	(CVP_WRAPPER_BASE_OFFS + 0x2010)
#define CVP_VENUS_VBIF_CLK_ON		(CVP_VBIF_BASE_OFFS + 0x4)

#define CVP_WRAPPER_DEBUG_BRIDGE_LPI_CONTROL	(CVP_WRAPPER_BASE_OFFS + 0x54)
#define CVP_WRAPPER_DEBUG_BRIDGE_LPI_STATUS	(CVP_WRAPPER_BASE_OFFS + 0x58)


#define VENUS_VBIF_AXI_HALT_CTRL0   (CVP_VBIF_BASE_OFFS + 0x208)
#define VENUS_VBIF_AXI_HALT_CTRL1   (CVP_VBIF_BASE_OFFS + 0x20C)

@@ -103,6 +119,8 @@
#define CVP_CTRL_INIT		CVP_CPU_CS_SCIACMD

#define CVP_CTRL_STATUS	CVP_CPU_CS_SCIACMDARG0
#define CVP_CTRL_INIT_STATUS__M \
		CVP_CPU_CS_SCIACMDARG0_HFI_CTRL_INIT_STATUS_BMSK
#define CVP_CTRL_ERROR_STATUS__M \
		CVP_CPU_CS_SCIACMDARG0_HFI_CTRL_ERROR_STATUS_BMSK
#define CVP_CTRL_INIT_IDLE_MSG_BMSK \
@@ -166,4 +184,7 @@
#define VCODEC_COREX_VIDEO_NOC_ERR_ERRLOG3_LOW_OFFS	0x0538
#define VCODEC_COREX_VIDEO_NOC_ERR_ERRLOG3_HIGH_OFFS	0x053C

#define CVP_AON_WRAPPER_MVP_NOC_LPI_CONTROL	(CVP_AON_BASE_OFFS)
#define CVP_AON_WRAPPER_MVP_NOC_LPI_STATUS	(CVP_AON_BASE_OFFS + 0x4)

#endif
+21 −0
Original line number Diff line number Diff line
@@ -84,6 +84,26 @@ int cvp_create_pkt_cmd_sys_coverage_config(
	return 0;
}

int cvp_create_pkt_cmd_sys_set_idle_indicator(
	struct hfi_cmd_sys_set_property_packet *pkt,
	u32 mode)
{
	if (!pkt) {
		dprintk(CVP_ERR, "In %s(), No input packet\n", __func__);
		return -EINVAL;
	}

	pkt->size = sizeof(struct hfi_cmd_sys_set_property_packet) +
		sizeof(u32);
	pkt->packet_type = HFI_CMD_SYS_SET_PROPERTY;
	pkt->num_properties = 1;
	pkt->rg_property_data[0] = HFI_PROPERTY_SYS_IDLE_INDICATOR;
	pkt->rg_property_data[1] = mode;
	dprintk(CVP_DBG, "Firmware idle indicator mode %d\n",
			pkt->rg_property_data[1]);
	return 0;
}

int cvp_create_pkt_cmd_sys_set_resource(
		struct hfi_cmd_sys_set_resource_packet *pkt,
		struct cvp_resource_hdr *res_hdr,
@@ -518,6 +538,7 @@ static struct hfi_packetization_ops hfi_default = {
	.sys_set_resource = cvp_create_pkt_cmd_sys_set_resource,
	.sys_debug_config = cvp_create_pkt_cmd_sys_debug_config,
	.sys_coverage_config = cvp_create_pkt_cmd_sys_coverage_config,
	.sys_set_idle_indicator = cvp_create_pkt_cmd_sys_set_idle_indicator,
	.sys_release_resource = cvp_create_pkt_cmd_sys_release_resource,
	.sys_ping = cvp_create_pkt_cmd_sys_ping,
	.sys_image_version = cvp_create_pkt_cmd_sys_image_version,
+3 −0
Original line number Diff line number Diff line
@@ -31,6 +31,9 @@ struct hfi_packetization_ops {
			u32 mode);
	int (*sys_coverage_config)(struct hfi_cmd_sys_set_property_packet *pkt,
			u32 mode);
	int (*sys_set_idle_indicator)(
		struct hfi_cmd_sys_set_property_packet *pkt,
		u32 mode);
	int (*sys_release_resource)(
		struct hfi_cmd_sys_release_resource_packet *pkt,
		struct cvp_resource_hdr *resource_hdr);
Loading