diff options
| author | Dikshita Agarwal <[email protected]> | 2025-02-07 07:54:47 +0000 |
|---|---|---|
| committer | Hans Verkuil <[email protected]> | 2025-02-07 10:51:12 +0000 |
| commit | fb583a214337a5600c121c9e1eecbb57fa9db688 (patch) | |
| tree | 4b70b08b6e82f345389b5714f9124ca3b0a005ae /drivers/media/platform/qcom/iris/iris_hfi_common.c | |
| parent | media: iris: implement the boot sequence of the firmware (diff) | |
| download | kernel-fb583a214337a5600c121c9e1eecbb57fa9db688.tar.gz kernel-fb583a214337a5600c121c9e1eecbb57fa9db688.zip | |
media: iris: introduce host firmware interface with necessary hooks
The Host firmware interface (HFI) is a well defined set of interfaces
for the communication between the host driver and the firmware. The
commands and responses are exchanged in form of packets. One or multiple
packets are grouped under the packet header. Each packet has a packet
type which describes the specific HFI and the payload, which holds the
corresponding value for that HFI.
Tested-by: Stefan Schmidt <[email protected]> # x1e80100 (Dell XPS 13 9345)
Reviewed-by: Stefan Schmidt <[email protected]>
Tested-by: Neil Armstrong <[email protected]> # on SM8550-QRD
Tested-by: Neil Armstrong <[email protected]> # on SM8550-HDK
Signed-off-by: Dikshita Agarwal <[email protected]>
Signed-off-by: Hans Verkuil <[email protected]>
Diffstat (limited to 'drivers/media/platform/qcom/iris/iris_hfi_common.c')
| -rw-r--r-- | drivers/media/platform/qcom/iris/iris_hfi_common.c | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/drivers/media/platform/qcom/iris/iris_hfi_common.c b/drivers/media/platform/qcom/iris/iris_hfi_common.c new file mode 100644 index 000000000000..a19b988c9a88 --- /dev/null +++ b/drivers/media/platform/qcom/iris/iris_hfi_common.c @@ -0,0 +1,50 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Copyright (c) 2022-2024 Qualcomm Innovation Center, Inc. All rights reserved. + */ + +#include "iris_core.h" +#include "iris_hfi_common.h" +#include "iris_vpu_common.h" + +int iris_hfi_core_init(struct iris_core *core) +{ + const struct iris_hfi_command_ops *hfi_ops = core->hfi_ops; + int ret; + + ret = hfi_ops->sys_init(core); + if (ret) + return ret; + + ret = hfi_ops->sys_image_version(core); + if (ret) + return ret; + + return hfi_ops->sys_interframe_powercollapse(core); +} + +irqreturn_t iris_hfi_isr(int irq, void *data) +{ + disable_irq_nosync(irq); + + return IRQ_WAKE_THREAD; +} + +irqreturn_t iris_hfi_isr_handler(int irq, void *data) +{ + struct iris_core *core = data; + + if (!core) + return IRQ_NONE; + + mutex_lock(&core->lock); + iris_vpu_clear_interrupt(core); + mutex_unlock(&core->lock); + + core->hfi_response_ops->hfi_response_handler(core); + + if (!iris_vpu_watchdog(core, core->intr_status)) + enable_irq(irq); + + return IRQ_HANDLED; +} |
