* [PATCH v5 1/3] media: verisilicon: Remove deprecated nxp,imx8mp-vpu variant
@ 2026-09-28 8:08 ` Benjamin Gaignard
0 siblings, 0 replies; 17+ messages in thread
From: Benjamin Gaignard @ 2026-09-28 8:08 UTC (permalink / raw)
To: nicolas.dufresne, benjamin.gaignard, p.zabel, mchehab, robh,
krzk+dt, conor+dt, Frank.Li, s.hauer, kernel, festevam, conor
Cc: linux-media, linux-rockchip, devicetree, imx, linux-arm-kernel,
linux-kernel, kernel
"nxp,imx8mq-vpu" is tagged as deprecated since:
commit f3116f2e52e6 ("media: dt-bindings: media: nxp, imx8mq-vpu: Split G1 and G2 nodes")
merged since v5.17-rc1. There is more reference to it since that.
Remove for driver to clean up the code.
Signed-off-by: Benjamin Gaignard <benjamin.gaignard@collabora.com>
---
.../media/platform/verisilicon/hantro_drv.c | 10 --
.../media/platform/verisilicon/hantro_hw.h | 1 -
.../media/platform/verisilicon/imx8m_vpu_hw.c | 117 ------------------
3 files changed, 128 deletions(-)
diff --git a/drivers/media/platform/verisilicon/hantro_drv.c b/drivers/media/platform/verisilicon/hantro_drv.c
index ad71c0402ef3..12c804dcc669 100644
--- a/drivers/media/platform/verisilicon/hantro_drv.c
+++ b/drivers/media/platform/verisilicon/hantro_drv.c
@@ -725,7 +725,6 @@ static const struct of_device_id of_hantro_match[] = {
#endif
#ifdef CONFIG_VIDEO_HANTRO_IMX8M
{ .compatible = "nxp,imx8mm-vpu-g1", .data = &imx8mm_vpu_g1_variant, },
- { .compatible = "nxp,imx8mq-vpu", .data = &imx8mq_vpu_variant, },
{ .compatible = "nxp,imx8mq-vpu-g1", .data = &imx8mq_vpu_g1_variant },
{ .compatible = "nxp,imx8mq-vpu-g2", .data = &imx8mq_vpu_g2_variant },
#endif
@@ -1100,15 +1099,6 @@ static int hantro_probe(struct platform_device *pdev)
if (ret)
return ret;
- /*
- * Support for nxp,imx8mq-vpu is kept for backwards compatibility
- * but it's deprecated. Please update your DTS file to use
- * nxp,imx8mq-vpu-g1 or nxp,imx8mq-vpu-g2 instead.
- */
- if (of_device_is_compatible(pdev->dev.of_node, "nxp,imx8mq-vpu"))
- dev_warn(&pdev->dev, "%s compatible is deprecated\n",
- match->compatible);
-
INIT_DELAYED_WORK(&vpu->watchdog_work, hantro_watchdog);
vpu->clocks = devm_kcalloc(&pdev->dev, vpu->variant->num_clocks,
diff --git a/drivers/media/platform/verisilicon/hantro_hw.h b/drivers/media/platform/verisilicon/hantro_hw.h
index 13e573f1f19d..865de26ffbce 100644
--- a/drivers/media/platform/verisilicon/hantro_hw.h
+++ b/drivers/media/platform/verisilicon/hantro_hw.h
@@ -405,7 +405,6 @@ enum hantro_enc_fmt {
extern const struct hantro_variant imx8mm_vpu_g1_variant;
extern const struct hantro_variant imx8mq_vpu_g1_variant;
extern const struct hantro_variant imx8mq_vpu_g2_variant;
-extern const struct hantro_variant imx8mq_vpu_variant;
extern const struct hantro_variant px30_vpu_variant;
extern const struct hantro_variant rk3036_vpu_variant;
extern const struct hantro_variant rk3066_vpu_variant;
diff --git a/drivers/media/platform/verisilicon/imx8m_vpu_hw.c b/drivers/media/platform/verisilicon/imx8m_vpu_hw.c
index fa4224de4b99..0d6a71ae5f45 100644
--- a/drivers/media/platform/verisilicon/imx8m_vpu_hw.c
+++ b/drivers/media/platform/verisilicon/imx8m_vpu_hw.c
@@ -13,67 +13,6 @@
#include "hantro_g1_regs.h"
#include "hantro_g2_regs.h"
-#define CTRL_SOFT_RESET 0x00
-#define RESET_G1 BIT(1)
-#define RESET_G2 BIT(0)
-
-#define CTRL_CLOCK_ENABLE 0x04
-#define CLOCK_G1 BIT(1)
-#define CLOCK_G2 BIT(0)
-
-#define CTRL_G1_DEC_FUSE 0x08
-#define CTRL_G1_PP_FUSE 0x0c
-#define CTRL_G2_DEC_FUSE 0x10
-
-static void imx8m_soft_reset(struct hantro_dev *vpu, u32 reset_bits)
-{
- u32 val;
-
- /* Assert */
- val = readl(vpu->ctrl_base + CTRL_SOFT_RESET);
- val &= ~reset_bits;
- writel(val, vpu->ctrl_base + CTRL_SOFT_RESET);
-
- udelay(2);
-
- /* Release */
- val = readl(vpu->ctrl_base + CTRL_SOFT_RESET);
- val |= reset_bits;
- writel(val, vpu->ctrl_base + CTRL_SOFT_RESET);
-}
-
-static void imx8m_clk_enable(struct hantro_dev *vpu, u32 clock_bits)
-{
- u32 val;
-
- val = readl(vpu->ctrl_base + CTRL_CLOCK_ENABLE);
- val |= clock_bits;
- writel(val, vpu->ctrl_base + CTRL_CLOCK_ENABLE);
-}
-
-static int imx8mq_runtime_resume(struct hantro_dev *vpu)
-{
- int ret;
-
- ret = clk_bulk_prepare_enable(vpu->variant->num_clocks, vpu->clocks);
- if (ret) {
- dev_err(vpu->dev, "Failed to enable clocks\n");
- return ret;
- }
-
- imx8m_soft_reset(vpu, RESET_G1 | RESET_G2);
- imx8m_clk_enable(vpu, CLOCK_G1 | CLOCK_G2);
-
- /* Set values of the fuse registers */
- writel(0xffffffff, vpu->ctrl_base + CTRL_G1_DEC_FUSE);
- writel(0xffffffff, vpu->ctrl_base + CTRL_G1_PP_FUSE);
- writel(0xffffffff, vpu->ctrl_base + CTRL_G2_DEC_FUSE);
-
- clk_bulk_disable_unprepare(vpu->variant->num_clocks, vpu->clocks);
-
- return 0;
-}
-
/*
* Supported formats.
*/
@@ -234,45 +173,10 @@ static const struct hantro_fmt imx8m_vpu_g2_dec_fmts[] = {
},
};
-static int imx8mq_vpu_hw_init(struct hantro_dev *vpu)
-{
- vpu->ctrl_base = vpu->reg_bases[vpu->variant->num_regs - 1];
-
- return 0;
-}
-
-static void imx8m_vpu_g1_reset(struct hantro_ctx *ctx)
-{
- struct hantro_dev *vpu = ctx->dev;
-
- imx8m_soft_reset(vpu, RESET_G1);
-}
-
/*
* Supported codec ops.
*/
-static const struct hantro_codec_ops imx8mq_vpu_codec_ops[] = {
- [HANTRO_MODE_MPEG2_DEC] = {
- .run = hantro_g1_mpeg2_dec_run,
- .reset = imx8m_vpu_g1_reset,
- .init = hantro_mpeg2_dec_init,
- .exit = hantro_mpeg2_dec_exit,
- },
- [HANTRO_MODE_VP8_DEC] = {
- .run = hantro_g1_vp8_dec_run,
- .reset = imx8m_vpu_g1_reset,
- .init = hantro_vp8_dec_init,
- .exit = hantro_vp8_dec_exit,
- },
- [HANTRO_MODE_H264_DEC] = {
- .run = hantro_g1_h264_dec_run,
- .reset = imx8m_vpu_g1_reset,
- .init = hantro_h264_dec_init,
- .exit = hantro_h264_dec_exit,
- },
-};
-
static const struct hantro_codec_ops imx8mq_vpu_g1_codec_ops[] = {
[HANTRO_MODE_MPEG2_DEC] = {
.run = hantro_g1_mpeg2_dec_run,
@@ -319,30 +223,9 @@ static const struct hantro_irq imx8mq_g2_irqs[] = {
{ "g2", hantro_g2_irq },
};
-static const char * const imx8mq_clk_names[] = { "g1", "g2", "bus" };
-static const char * const imx8mq_reg_names[] = { "g1", "g2", "ctrl" };
static const char * const imx8mq_g1_clk_names[] = { "g1" };
static const char * const imx8mq_g2_clk_names[] = { "g2" };
-const struct hantro_variant imx8mq_vpu_variant = {
- .dec_fmts = imx8m_vpu_dec_fmts,
- .num_dec_fmts = ARRAY_SIZE(imx8m_vpu_dec_fmts),
- .postproc_fmts = imx8m_vpu_postproc_fmts,
- .num_postproc_fmts = ARRAY_SIZE(imx8m_vpu_postproc_fmts),
- .postproc_ops = &hantro_g1_postproc_ops,
- .codec = HANTRO_MPEG2_DECODER | HANTRO_VP8_DECODER |
- HANTRO_H264_DECODER,
- .codec_ops = imx8mq_vpu_codec_ops,
- .init = imx8mq_vpu_hw_init,
- .runtime_resume = imx8mq_runtime_resume,
- .irqs = imx8mq_irqs,
- .num_irqs = ARRAY_SIZE(imx8mq_irqs),
- .clk_names = imx8mq_clk_names,
- .num_clocks = ARRAY_SIZE(imx8mq_clk_names),
- .reg_names = imx8mq_reg_names,
- .num_regs = ARRAY_SIZE(imx8mq_reg_names)
-};
-
static const struct of_device_id imx8mq_vpu_shared_resources[] = {
{ .compatible = "nxp,imx8mq-vpu-g1", },
{ .compatible = "nxp,imx8mq-vpu-g2", },
--
2.53.0
^ permalink raw reply related [flat|nested] 17+ messages in thread* Re: [PATCH v5 1/3] media: verisilicon: Remove deprecated nxp,imx8mp-vpu variant
2026-09-28 8:08 ` Benjamin Gaignard
(?)
@ 2026-09-28 8:19 ` sashiko-bot
-1 siblings, 0 replies; 17+ messages in thread
From: sashiko-bot @ 2026-09-28 8:19 UTC (permalink / raw)
To: Benjamin Gaignard; +Cc: conor+dt, devicetree, media-ci, robh, Frank.Li, imx
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] media: verisilicon: ABI breakage via removal of nxp,imx8mq-vpu
- [Low] media: verisilicon: incomplete cleanup of runtime_resume
--
commit d5f8aa7d83409c6f9ac3f091a5c490dd769c46dc
Author: Benjamin Gaignard <benjamin.gaignard@collabora.com>
media: verisilicon: Remove deprecated nxp,imx8mp-vpu variant
This commit removes the deprecated monolithic nxp,imx8mq-vpu compatible
string and its associated variant data from the hantro driver. This cleans
up the code since the split G1 and G2 nodes have been preferred since
v5.17-rc1.
> diff --git a/drivers/media/platform/verisilicon/hantro_drv.c b/drivers/media/platform/verisilicon/hantro_drv.c
> index ad71c0402ef3b..12c804dcc6694 100644
> --- a/drivers/media/platform/verisilicon/hantro_drv.c
> +++ b/drivers/media/platform/verisilicon/hantro_drv.c
> @@ -725,7 +725,6 @@ static const struct of_device_id of_hantro_match[] = {
> #endif
> #ifdef CONFIG_VIDEO_HANTRO_IMX8M
> { .compatible = "nxp,imx8mm-vpu-g1", .data = &imx8mm_vpu_g1_variant, },
> - { .compatible = "nxp,imx8mq-vpu", .data = &imx8mq_vpu_variant, },
[Severity: Medium]
Since Device Tree bindings are considered a stable ABI, could removing this
compatible string cause a regression?
Old DTBs with the monolithic node might fail to probe hardware video decoding
on new kernels, which breaks backward compatibility.
> { .compatible = "nxp,imx8mq-vpu-g1", .data = &imx8mq_vpu_g1_variant },
> { .compatible = "nxp,imx8mq-vpu-g2", .data = &imx8mq_vpu_g2_variant },
> #endif
[ ... ]
> diff --git a/drivers/media/platform/verisilicon/imx8m_vpu_hw.c b/drivers/media/platform/verisilicon/imx8m_vpu_hw.c
> index fa4224de4b996..0d6a71ae5f454 100644
> --- a/drivers/media/platform/verisilicon/imx8m_vpu_hw.c
> +++ b/drivers/media/platform/verisilicon/imx8m_vpu_hw.c
[ ... ]
> @@ -319,30 +223,9 @@ static const struct hantro_irq imx8mq_g2_irqs[] = {
> { "g2", hantro_g2_irq },
> };
>
> -static const char * const imx8mq_clk_names[] = { "g1", "g2", "bus" };
> -static const char * const imx8mq_reg_names[] = { "g1", "g2", "ctrl" };
> static const char * const imx8mq_g1_clk_names[] = { "g1" };
> static const char * const imx8mq_g2_clk_names[] = { "g2" };
>
> -const struct hantro_variant imx8mq_vpu_variant = {
> - .dec_fmts = imx8m_vpu_dec_fmts,
> - .num_dec_fmts = ARRAY_SIZE(imx8m_vpu_dec_fmts),
> - .postproc_fmts = imx8m_vpu_postproc_fmts,
> - .num_postproc_fmts = ARRAY_SIZE(imx8m_vpu_postproc_fmts),
> - .postproc_ops = &hantro_g1_postproc_ops,
> - .codec = HANTRO_MPEG2_DECODER | HANTRO_VP8_DECODER |
> - HANTRO_H264_DECODER,
> - .codec_ops = imx8mq_vpu_codec_ops,
> - .init = imx8mq_vpu_hw_init,
> - .runtime_resume = imx8mq_runtime_resume,
[Severity: Low]
With the removal of imx8mq_runtime_resume() and imx8mq_vpu_variant, there
are no remaining users of the runtime_resume callback in struct hantro_variant.
Should the runtime_resume function pointer in struct hantro_variant and its
wrapper hantro_runtime_resume() in hantro_drv.c also be removed to clean up
the resulting dead code?
> - .irqs = imx8mq_irqs,
> - .num_irqs = ARRAY_SIZE(imx8mq_irqs),
> - .clk_names = imx8mq_clk_names,
> - .num_clocks = ARRAY_SIZE(imx8mq_clk_names),
> - .reg_names = imx8mq_reg_names,
> - .num_regs = ARRAY_SIZE(imx8mq_reg_names)
> -};
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260928080822.19553-1-benjamin.gaignard@collabora.com?part=1
^ permalink raw reply [flat|nested] 17+ messages in thread* Re: [PATCH v5 1/3] media: verisilicon: Remove deprecated nxp,imx8mp-vpu variant
2026-09-28 8:08 ` Benjamin Gaignard
@ 2026-09-28 16:41 ` Frank Li
-1 siblings, 0 replies; 17+ messages in thread
From: Frank Li @ 2026-09-28 16:41 UTC (permalink / raw)
To: Benjamin Gaignard
Cc: nicolas.dufresne, p.zabel, mchehab, robh, krzk+dt, conor+dt,
Frank.Li, s.hauer, kernel, festevam, conor, linux-media,
linux-rockchip, devicetree, imx, linux-arm-kernel, linux-kernel,
kernel
On Mon, Sep 28, 2026 at 10:08:20AM +0200, Benjamin Gaignard wrote:
> "nxp,imx8mq-vpu" is tagged as deprecated since:
> commit f3116f2e52e6 ("media: dt-bindings: media: nxp, imx8mq-vpu: Split G1 and G2 nodes")
> merged since v5.17-rc1. There is more reference to it since that.
> Remove for driver to clean up the code.
>
> Signed-off-by: Benjamin Gaignard <benjamin.gaignard@collabora.com>
> ---
Reviewed-by: Frank Li <Frank.Li@nxp.com>
> .../media/platform/verisilicon/hantro_drv.c | 10 --
> .../media/platform/verisilicon/hantro_hw.h | 1 -
> .../media/platform/verisilicon/imx8m_vpu_hw.c | 117 ------------------
> 3 files changed, 128 deletions(-)
>
> diff --git a/drivers/media/platform/verisilicon/hantro_drv.c b/drivers/media/platform/verisilicon/hantro_drv.c
> index ad71c0402ef3..12c804dcc669 100644
> --- a/drivers/media/platform/verisilicon/hantro_drv.c
> +++ b/drivers/media/platform/verisilicon/hantro_drv.c
> @@ -725,7 +725,6 @@ static const struct of_device_id of_hantro_match[] = {
> #endif
> #ifdef CONFIG_VIDEO_HANTRO_IMX8M
> { .compatible = "nxp,imx8mm-vpu-g1", .data = &imx8mm_vpu_g1_variant, },
> - { .compatible = "nxp,imx8mq-vpu", .data = &imx8mq_vpu_variant, },
> { .compatible = "nxp,imx8mq-vpu-g1", .data = &imx8mq_vpu_g1_variant },
> { .compatible = "nxp,imx8mq-vpu-g2", .data = &imx8mq_vpu_g2_variant },
> #endif
> @@ -1100,15 +1099,6 @@ static int hantro_probe(struct platform_device *pdev)
> if (ret)
> return ret;
>
> - /*
> - * Support for nxp,imx8mq-vpu is kept for backwards compatibility
> - * but it's deprecated. Please update your DTS file to use
> - * nxp,imx8mq-vpu-g1 or nxp,imx8mq-vpu-g2 instead.
> - */
> - if (of_device_is_compatible(pdev->dev.of_node, "nxp,imx8mq-vpu"))
> - dev_warn(&pdev->dev, "%s compatible is deprecated\n",
> - match->compatible);
> -
> INIT_DELAYED_WORK(&vpu->watchdog_work, hantro_watchdog);
>
> vpu->clocks = devm_kcalloc(&pdev->dev, vpu->variant->num_clocks,
> diff --git a/drivers/media/platform/verisilicon/hantro_hw.h b/drivers/media/platform/verisilicon/hantro_hw.h
> index 13e573f1f19d..865de26ffbce 100644
> --- a/drivers/media/platform/verisilicon/hantro_hw.h
> +++ b/drivers/media/platform/verisilicon/hantro_hw.h
> @@ -405,7 +405,6 @@ enum hantro_enc_fmt {
> extern const struct hantro_variant imx8mm_vpu_g1_variant;
> extern const struct hantro_variant imx8mq_vpu_g1_variant;
> extern const struct hantro_variant imx8mq_vpu_g2_variant;
> -extern const struct hantro_variant imx8mq_vpu_variant;
> extern const struct hantro_variant px30_vpu_variant;
> extern const struct hantro_variant rk3036_vpu_variant;
> extern const struct hantro_variant rk3066_vpu_variant;
> diff --git a/drivers/media/platform/verisilicon/imx8m_vpu_hw.c b/drivers/media/platform/verisilicon/imx8m_vpu_hw.c
> index fa4224de4b99..0d6a71ae5f45 100644
> --- a/drivers/media/platform/verisilicon/imx8m_vpu_hw.c
> +++ b/drivers/media/platform/verisilicon/imx8m_vpu_hw.c
> @@ -13,67 +13,6 @@
> #include "hantro_g1_regs.h"
> #include "hantro_g2_regs.h"
>
> -#define CTRL_SOFT_RESET 0x00
> -#define RESET_G1 BIT(1)
> -#define RESET_G2 BIT(0)
> -
> -#define CTRL_CLOCK_ENABLE 0x04
> -#define CLOCK_G1 BIT(1)
> -#define CLOCK_G2 BIT(0)
> -
> -#define CTRL_G1_DEC_FUSE 0x08
> -#define CTRL_G1_PP_FUSE 0x0c
> -#define CTRL_G2_DEC_FUSE 0x10
> -
> -static void imx8m_soft_reset(struct hantro_dev *vpu, u32 reset_bits)
> -{
> - u32 val;
> -
> - /* Assert */
> - val = readl(vpu->ctrl_base + CTRL_SOFT_RESET);
> - val &= ~reset_bits;
> - writel(val, vpu->ctrl_base + CTRL_SOFT_RESET);
> -
> - udelay(2);
> -
> - /* Release */
> - val = readl(vpu->ctrl_base + CTRL_SOFT_RESET);
> - val |= reset_bits;
> - writel(val, vpu->ctrl_base + CTRL_SOFT_RESET);
> -}
> -
> -static void imx8m_clk_enable(struct hantro_dev *vpu, u32 clock_bits)
> -{
> - u32 val;
> -
> - val = readl(vpu->ctrl_base + CTRL_CLOCK_ENABLE);
> - val |= clock_bits;
> - writel(val, vpu->ctrl_base + CTRL_CLOCK_ENABLE);
> -}
> -
> -static int imx8mq_runtime_resume(struct hantro_dev *vpu)
> -{
> - int ret;
> -
> - ret = clk_bulk_prepare_enable(vpu->variant->num_clocks, vpu->clocks);
> - if (ret) {
> - dev_err(vpu->dev, "Failed to enable clocks\n");
> - return ret;
> - }
> -
> - imx8m_soft_reset(vpu, RESET_G1 | RESET_G2);
> - imx8m_clk_enable(vpu, CLOCK_G1 | CLOCK_G2);
> -
> - /* Set values of the fuse registers */
> - writel(0xffffffff, vpu->ctrl_base + CTRL_G1_DEC_FUSE);
> - writel(0xffffffff, vpu->ctrl_base + CTRL_G1_PP_FUSE);
> - writel(0xffffffff, vpu->ctrl_base + CTRL_G2_DEC_FUSE);
> -
> - clk_bulk_disable_unprepare(vpu->variant->num_clocks, vpu->clocks);
> -
> - return 0;
> -}
> -
> /*
> * Supported formats.
> */
> @@ -234,45 +173,10 @@ static const struct hantro_fmt imx8m_vpu_g2_dec_fmts[] = {
> },
> };
>
> -static int imx8mq_vpu_hw_init(struct hantro_dev *vpu)
> -{
> - vpu->ctrl_base = vpu->reg_bases[vpu->variant->num_regs - 1];
> -
> - return 0;
> -}
> -
> -static void imx8m_vpu_g1_reset(struct hantro_ctx *ctx)
> -{
> - struct hantro_dev *vpu = ctx->dev;
> -
> - imx8m_soft_reset(vpu, RESET_G1);
> -}
> -
> /*
> * Supported codec ops.
> */
>
> -static const struct hantro_codec_ops imx8mq_vpu_codec_ops[] = {
> - [HANTRO_MODE_MPEG2_DEC] = {
> - .run = hantro_g1_mpeg2_dec_run,
> - .reset = imx8m_vpu_g1_reset,
> - .init = hantro_mpeg2_dec_init,
> - .exit = hantro_mpeg2_dec_exit,
> - },
> - [HANTRO_MODE_VP8_DEC] = {
> - .run = hantro_g1_vp8_dec_run,
> - .reset = imx8m_vpu_g1_reset,
> - .init = hantro_vp8_dec_init,
> - .exit = hantro_vp8_dec_exit,
> - },
> - [HANTRO_MODE_H264_DEC] = {
> - .run = hantro_g1_h264_dec_run,
> - .reset = imx8m_vpu_g1_reset,
> - .init = hantro_h264_dec_init,
> - .exit = hantro_h264_dec_exit,
> - },
> -};
> -
> static const struct hantro_codec_ops imx8mq_vpu_g1_codec_ops[] = {
> [HANTRO_MODE_MPEG2_DEC] = {
> .run = hantro_g1_mpeg2_dec_run,
> @@ -319,30 +223,9 @@ static const struct hantro_irq imx8mq_g2_irqs[] = {
> { "g2", hantro_g2_irq },
> };
>
> -static const char * const imx8mq_clk_names[] = { "g1", "g2", "bus" };
> -static const char * const imx8mq_reg_names[] = { "g1", "g2", "ctrl" };
> static const char * const imx8mq_g1_clk_names[] = { "g1" };
> static const char * const imx8mq_g2_clk_names[] = { "g2" };
>
> -const struct hantro_variant imx8mq_vpu_variant = {
> - .dec_fmts = imx8m_vpu_dec_fmts,
> - .num_dec_fmts = ARRAY_SIZE(imx8m_vpu_dec_fmts),
> - .postproc_fmts = imx8m_vpu_postproc_fmts,
> - .num_postproc_fmts = ARRAY_SIZE(imx8m_vpu_postproc_fmts),
> - .postproc_ops = &hantro_g1_postproc_ops,
> - .codec = HANTRO_MPEG2_DECODER | HANTRO_VP8_DECODER |
> - HANTRO_H264_DECODER,
> - .codec_ops = imx8mq_vpu_codec_ops,
> - .init = imx8mq_vpu_hw_init,
> - .runtime_resume = imx8mq_runtime_resume,
> - .irqs = imx8mq_irqs,
> - .num_irqs = ARRAY_SIZE(imx8mq_irqs),
> - .clk_names = imx8mq_clk_names,
> - .num_clocks = ARRAY_SIZE(imx8mq_clk_names),
> - .reg_names = imx8mq_reg_names,
> - .num_regs = ARRAY_SIZE(imx8mq_reg_names)
> -};
> -
> static const struct of_device_id imx8mq_vpu_shared_resources[] = {
> { .compatible = "nxp,imx8mq-vpu-g1", },
> { .compatible = "nxp,imx8mq-vpu-g2", },
> --
> 2.53.0
>
>
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
^ permalink raw reply [flat|nested] 17+ messages in thread* Re: [PATCH v5 1/3] media: verisilicon: Remove deprecated nxp,imx8mp-vpu variant
@ 2026-09-28 16:41 ` Frank Li
0 siblings, 0 replies; 17+ messages in thread
From: Frank Li @ 2026-09-28 16:41 UTC (permalink / raw)
To: Benjamin Gaignard
Cc: nicolas.dufresne, p.zabel, mchehab, robh, krzk+dt, conor+dt,
Frank.Li, s.hauer, kernel, festevam, conor, linux-media,
linux-rockchip, devicetree, imx, linux-arm-kernel, linux-kernel,
kernel
On Mon, Sep 28, 2026 at 10:08:20AM +0200, Benjamin Gaignard wrote:
> "nxp,imx8mq-vpu" is tagged as deprecated since:
> commit f3116f2e52e6 ("media: dt-bindings: media: nxp, imx8mq-vpu: Split G1 and G2 nodes")
> merged since v5.17-rc1. There is more reference to it since that.
> Remove for driver to clean up the code.
>
> Signed-off-by: Benjamin Gaignard <benjamin.gaignard@collabora.com>
> ---
Reviewed-by: Frank Li <Frank.Li@nxp.com>
> .../media/platform/verisilicon/hantro_drv.c | 10 --
> .../media/platform/verisilicon/hantro_hw.h | 1 -
> .../media/platform/verisilicon/imx8m_vpu_hw.c | 117 ------------------
> 3 files changed, 128 deletions(-)
>
> diff --git a/drivers/media/platform/verisilicon/hantro_drv.c b/drivers/media/platform/verisilicon/hantro_drv.c
> index ad71c0402ef3..12c804dcc669 100644
> --- a/drivers/media/platform/verisilicon/hantro_drv.c
> +++ b/drivers/media/platform/verisilicon/hantro_drv.c
> @@ -725,7 +725,6 @@ static const struct of_device_id of_hantro_match[] = {
> #endif
> #ifdef CONFIG_VIDEO_HANTRO_IMX8M
> { .compatible = "nxp,imx8mm-vpu-g1", .data = &imx8mm_vpu_g1_variant, },
> - { .compatible = "nxp,imx8mq-vpu", .data = &imx8mq_vpu_variant, },
> { .compatible = "nxp,imx8mq-vpu-g1", .data = &imx8mq_vpu_g1_variant },
> { .compatible = "nxp,imx8mq-vpu-g2", .data = &imx8mq_vpu_g2_variant },
> #endif
> @@ -1100,15 +1099,6 @@ static int hantro_probe(struct platform_device *pdev)
> if (ret)
> return ret;
>
> - /*
> - * Support for nxp,imx8mq-vpu is kept for backwards compatibility
> - * but it's deprecated. Please update your DTS file to use
> - * nxp,imx8mq-vpu-g1 or nxp,imx8mq-vpu-g2 instead.
> - */
> - if (of_device_is_compatible(pdev->dev.of_node, "nxp,imx8mq-vpu"))
> - dev_warn(&pdev->dev, "%s compatible is deprecated\n",
> - match->compatible);
> -
> INIT_DELAYED_WORK(&vpu->watchdog_work, hantro_watchdog);
>
> vpu->clocks = devm_kcalloc(&pdev->dev, vpu->variant->num_clocks,
> diff --git a/drivers/media/platform/verisilicon/hantro_hw.h b/drivers/media/platform/verisilicon/hantro_hw.h
> index 13e573f1f19d..865de26ffbce 100644
> --- a/drivers/media/platform/verisilicon/hantro_hw.h
> +++ b/drivers/media/platform/verisilicon/hantro_hw.h
> @@ -405,7 +405,6 @@ enum hantro_enc_fmt {
> extern const struct hantro_variant imx8mm_vpu_g1_variant;
> extern const struct hantro_variant imx8mq_vpu_g1_variant;
> extern const struct hantro_variant imx8mq_vpu_g2_variant;
> -extern const struct hantro_variant imx8mq_vpu_variant;
> extern const struct hantro_variant px30_vpu_variant;
> extern const struct hantro_variant rk3036_vpu_variant;
> extern const struct hantro_variant rk3066_vpu_variant;
> diff --git a/drivers/media/platform/verisilicon/imx8m_vpu_hw.c b/drivers/media/platform/verisilicon/imx8m_vpu_hw.c
> index fa4224de4b99..0d6a71ae5f45 100644
> --- a/drivers/media/platform/verisilicon/imx8m_vpu_hw.c
> +++ b/drivers/media/platform/verisilicon/imx8m_vpu_hw.c
> @@ -13,67 +13,6 @@
> #include "hantro_g1_regs.h"
> #include "hantro_g2_regs.h"
>
> -#define CTRL_SOFT_RESET 0x00
> -#define RESET_G1 BIT(1)
> -#define RESET_G2 BIT(0)
> -
> -#define CTRL_CLOCK_ENABLE 0x04
> -#define CLOCK_G1 BIT(1)
> -#define CLOCK_G2 BIT(0)
> -
> -#define CTRL_G1_DEC_FUSE 0x08
> -#define CTRL_G1_PP_FUSE 0x0c
> -#define CTRL_G2_DEC_FUSE 0x10
> -
> -static void imx8m_soft_reset(struct hantro_dev *vpu, u32 reset_bits)
> -{
> - u32 val;
> -
> - /* Assert */
> - val = readl(vpu->ctrl_base + CTRL_SOFT_RESET);
> - val &= ~reset_bits;
> - writel(val, vpu->ctrl_base + CTRL_SOFT_RESET);
> -
> - udelay(2);
> -
> - /* Release */
> - val = readl(vpu->ctrl_base + CTRL_SOFT_RESET);
> - val |= reset_bits;
> - writel(val, vpu->ctrl_base + CTRL_SOFT_RESET);
> -}
> -
> -static void imx8m_clk_enable(struct hantro_dev *vpu, u32 clock_bits)
> -{
> - u32 val;
> -
> - val = readl(vpu->ctrl_base + CTRL_CLOCK_ENABLE);
> - val |= clock_bits;
> - writel(val, vpu->ctrl_base + CTRL_CLOCK_ENABLE);
> -}
> -
> -static int imx8mq_runtime_resume(struct hantro_dev *vpu)
> -{
> - int ret;
> -
> - ret = clk_bulk_prepare_enable(vpu->variant->num_clocks, vpu->clocks);
> - if (ret) {
> - dev_err(vpu->dev, "Failed to enable clocks\n");
> - return ret;
> - }
> -
> - imx8m_soft_reset(vpu, RESET_G1 | RESET_G2);
> - imx8m_clk_enable(vpu, CLOCK_G1 | CLOCK_G2);
> -
> - /* Set values of the fuse registers */
> - writel(0xffffffff, vpu->ctrl_base + CTRL_G1_DEC_FUSE);
> - writel(0xffffffff, vpu->ctrl_base + CTRL_G1_PP_FUSE);
> - writel(0xffffffff, vpu->ctrl_base + CTRL_G2_DEC_FUSE);
> -
> - clk_bulk_disable_unprepare(vpu->variant->num_clocks, vpu->clocks);
> -
> - return 0;
> -}
> -
> /*
> * Supported formats.
> */
> @@ -234,45 +173,10 @@ static const struct hantro_fmt imx8m_vpu_g2_dec_fmts[] = {
> },
> };
>
> -static int imx8mq_vpu_hw_init(struct hantro_dev *vpu)
> -{
> - vpu->ctrl_base = vpu->reg_bases[vpu->variant->num_regs - 1];
> -
> - return 0;
> -}
> -
> -static void imx8m_vpu_g1_reset(struct hantro_ctx *ctx)
> -{
> - struct hantro_dev *vpu = ctx->dev;
> -
> - imx8m_soft_reset(vpu, RESET_G1);
> -}
> -
> /*
> * Supported codec ops.
> */
>
> -static const struct hantro_codec_ops imx8mq_vpu_codec_ops[] = {
> - [HANTRO_MODE_MPEG2_DEC] = {
> - .run = hantro_g1_mpeg2_dec_run,
> - .reset = imx8m_vpu_g1_reset,
> - .init = hantro_mpeg2_dec_init,
> - .exit = hantro_mpeg2_dec_exit,
> - },
> - [HANTRO_MODE_VP8_DEC] = {
> - .run = hantro_g1_vp8_dec_run,
> - .reset = imx8m_vpu_g1_reset,
> - .init = hantro_vp8_dec_init,
> - .exit = hantro_vp8_dec_exit,
> - },
> - [HANTRO_MODE_H264_DEC] = {
> - .run = hantro_g1_h264_dec_run,
> - .reset = imx8m_vpu_g1_reset,
> - .init = hantro_h264_dec_init,
> - .exit = hantro_h264_dec_exit,
> - },
> -};
> -
> static const struct hantro_codec_ops imx8mq_vpu_g1_codec_ops[] = {
> [HANTRO_MODE_MPEG2_DEC] = {
> .run = hantro_g1_mpeg2_dec_run,
> @@ -319,30 +223,9 @@ static const struct hantro_irq imx8mq_g2_irqs[] = {
> { "g2", hantro_g2_irq },
> };
>
> -static const char * const imx8mq_clk_names[] = { "g1", "g2", "bus" };
> -static const char * const imx8mq_reg_names[] = { "g1", "g2", "ctrl" };
> static const char * const imx8mq_g1_clk_names[] = { "g1" };
> static const char * const imx8mq_g2_clk_names[] = { "g2" };
>
> -const struct hantro_variant imx8mq_vpu_variant = {
> - .dec_fmts = imx8m_vpu_dec_fmts,
> - .num_dec_fmts = ARRAY_SIZE(imx8m_vpu_dec_fmts),
> - .postproc_fmts = imx8m_vpu_postproc_fmts,
> - .num_postproc_fmts = ARRAY_SIZE(imx8m_vpu_postproc_fmts),
> - .postproc_ops = &hantro_g1_postproc_ops,
> - .codec = HANTRO_MPEG2_DECODER | HANTRO_VP8_DECODER |
> - HANTRO_H264_DECODER,
> - .codec_ops = imx8mq_vpu_codec_ops,
> - .init = imx8mq_vpu_hw_init,
> - .runtime_resume = imx8mq_runtime_resume,
> - .irqs = imx8mq_irqs,
> - .num_irqs = ARRAY_SIZE(imx8mq_irqs),
> - .clk_names = imx8mq_clk_names,
> - .num_clocks = ARRAY_SIZE(imx8mq_clk_names),
> - .reg_names = imx8mq_reg_names,
> - .num_regs = ARRAY_SIZE(imx8mq_reg_names)
> -};
> -
> static const struct of_device_id imx8mq_vpu_shared_resources[] = {
> { .compatible = "nxp,imx8mq-vpu-g1", },
> { .compatible = "nxp,imx8mq-vpu-g2", },
> --
> 2.53.0
>
>
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v5 1/3] media: verisilicon: Remove deprecated nxp,imx8mp-vpu variant
2026-09-28 8:08 ` Benjamin Gaignard
@ 2026-09-28 17:38 ` Nicolas Dufresne
-1 siblings, 0 replies; 17+ messages in thread
From: Nicolas Dufresne @ 2026-09-28 17:38 UTC (permalink / raw)
To: Benjamin Gaignard, p.zabel, mchehab, robh, krzk+dt, conor+dt,
Frank.Li, s.hauer, kernel, festevam, conor
Cc: linux-media, linux-rockchip, devicetree, imx, linux-arm-kernel,
linux-kernel, kernel
[-- Attachment #1.1: Type: text/plain, Size: 7570 bytes --]
Hi,
Le lundi 28 septembre 2026 à 10:08 +0200, Benjamin Gaignard a écrit :
> "nxp,imx8mq-vpu" is tagged as deprecated since:
> commit f3116f2e52e6 ("media: dt-bindings: media: nxp, imx8mq-vpu: Split G1 and G2 nodes")
> merged since v5.17-rc1. There is more reference to it since that.
> Remove for driver to clean up the code.
There is not much sense to the above line, would you like to propose something.
>
> Signed-off-by: Benjamin Gaignard <benjamin.gaignard@collabora.com>
> ---
> .../media/platform/verisilicon/hantro_drv.c | 10 --
> .../media/platform/verisilicon/hantro_hw.h | 1 -
> .../media/platform/verisilicon/imx8m_vpu_hw.c | 117 ------------------
> 3 files changed, 128 deletions(-)
>
> diff --git a/drivers/media/platform/verisilicon/hantro_drv.c b/drivers/media/platform/verisilicon/hantro_drv.c
> index ad71c0402ef3..12c804dcc669 100644
> --- a/drivers/media/platform/verisilicon/hantro_drv.c
> +++ b/drivers/media/platform/verisilicon/hantro_drv.c
> @@ -725,7 +725,6 @@ static const struct of_device_id of_hantro_match[] = {
> #endif
> #ifdef CONFIG_VIDEO_HANTRO_IMX8M
> { .compatible = "nxp,imx8mm-vpu-g1", .data = &imx8mm_vpu_g1_variant, },
> - { .compatible = "nxp,imx8mq-vpu", .data = &imx8mq_vpu_variant, },
> { .compatible = "nxp,imx8mq-vpu-g1", .data = &imx8mq_vpu_g1_variant },
> { .compatible = "nxp,imx8mq-vpu-g2", .data = &imx8mq_vpu_g2_variant },
> #endif
> @@ -1100,15 +1099,6 @@ static int hantro_probe(struct platform_device *pdev)
> if (ret)
> return ret;
>
> - /*
> - * Support for nxp,imx8mq-vpu is kept for backwards compatibility
> - * but it's deprecated. Please update your DTS file to use
> - * nxp,imx8mq-vpu-g1 or nxp,imx8mq-vpu-g2 instead.
> - */
> - if (of_device_is_compatible(pdev->dev.of_node, "nxp,imx8mq-vpu"))
> - dev_warn(&pdev->dev, "%s compatible is deprecated\n",
> - match->compatible);
> -
> INIT_DELAYED_WORK(&vpu->watchdog_work, hantro_watchdog);
>
> vpu->clocks = devm_kcalloc(&pdev->dev, vpu->variant->num_clocks,
> diff --git a/drivers/media/platform/verisilicon/hantro_hw.h b/drivers/media/platform/verisilicon/hantro_hw.h
> index 13e573f1f19d..865de26ffbce 100644
> --- a/drivers/media/platform/verisilicon/hantro_hw.h
> +++ b/drivers/media/platform/verisilicon/hantro_hw.h
> @@ -405,7 +405,6 @@ enum hantro_enc_fmt {
> extern const struct hantro_variant imx8mm_vpu_g1_variant;
> extern const struct hantro_variant imx8mq_vpu_g1_variant;
> extern const struct hantro_variant imx8mq_vpu_g2_variant;
> -extern const struct hantro_variant imx8mq_vpu_variant;
> extern const struct hantro_variant px30_vpu_variant;
> extern const struct hantro_variant rk3036_vpu_variant;
> extern const struct hantro_variant rk3066_vpu_variant;
> diff --git a/drivers/media/platform/verisilicon/imx8m_vpu_hw.c b/drivers/media/platform/verisilicon/imx8m_vpu_hw.c
> index fa4224de4b99..0d6a71ae5f45 100644
> --- a/drivers/media/platform/verisilicon/imx8m_vpu_hw.c
> +++ b/drivers/media/platform/verisilicon/imx8m_vpu_hw.c
> @@ -13,67 +13,6 @@
> #include "hantro_g1_regs.h"
> #include "hantro_g2_regs.h"
>
> -#define CTRL_SOFT_RESET 0x00
> -#define RESET_G1 BIT(1)
> -#define RESET_G2 BIT(0)
> -
> -#define CTRL_CLOCK_ENABLE 0x04
> -#define CLOCK_G1 BIT(1)
> -#define CLOCK_G2 BIT(0)
> -
> -#define CTRL_G1_DEC_FUSE 0x08
> -#define CTRL_G1_PP_FUSE 0x0c
> -#define CTRL_G2_DEC_FUSE 0x10
> -
> -static void imx8m_soft_reset(struct hantro_dev *vpu, u32 reset_bits)
> -{
> - u32 val;
> -
> - /* Assert */
> - val = readl(vpu->ctrl_base + CTRL_SOFT_RESET);
> - val &= ~reset_bits;
> - writel(val, vpu->ctrl_base + CTRL_SOFT_RESET);
> -
> - udelay(2);
> -
> - /* Release */
> - val = readl(vpu->ctrl_base + CTRL_SOFT_RESET);
> - val |= reset_bits;
> - writel(val, vpu->ctrl_base + CTRL_SOFT_RESET);
> -}
> -
> -static void imx8m_clk_enable(struct hantro_dev *vpu, u32 clock_bits)
> -{
> - u32 val;
> -
> - val = readl(vpu->ctrl_base + CTRL_CLOCK_ENABLE);
> - val |= clock_bits;
> - writel(val, vpu->ctrl_base + CTRL_CLOCK_ENABLE);
> -}
> -
> -static int imx8mq_runtime_resume(struct hantro_dev *vpu)
> -{
> - int ret;
> -
> - ret = clk_bulk_prepare_enable(vpu->variant->num_clocks, vpu->clocks);
> - if (ret) {
> - dev_err(vpu->dev, "Failed to enable clocks\n");
> - return ret;
> - }
> -
> - imx8m_soft_reset(vpu, RESET_G1 | RESET_G2);
> - imx8m_clk_enable(vpu, CLOCK_G1 | CLOCK_G2);
> -
> - /* Set values of the fuse registers */
> - writel(0xffffffff, vpu->ctrl_base + CTRL_G1_DEC_FUSE);
> - writel(0xffffffff, vpu->ctrl_base + CTRL_G1_PP_FUSE);
> - writel(0xffffffff, vpu->ctrl_base + CTRL_G2_DEC_FUSE);
> -
> - clk_bulk_disable_unprepare(vpu->variant->num_clocks, vpu->clocks);
> -
> - return 0;
> -}
> -
> /*
> * Supported formats.
> */
> @@ -234,45 +173,10 @@ static const struct hantro_fmt imx8m_vpu_g2_dec_fmts[] = {
> },
> };
>
> -static int imx8mq_vpu_hw_init(struct hantro_dev *vpu)
> -{
> - vpu->ctrl_base = vpu->reg_bases[vpu->variant->num_regs - 1];
> -
> - return 0;
> -}
> -
> -static void imx8m_vpu_g1_reset(struct hantro_ctx *ctx)
> -{
> - struct hantro_dev *vpu = ctx->dev;
> -
> - imx8m_soft_reset(vpu, RESET_G1);
> -}
> -
> /*
> * Supported codec ops.
> */
>
> -static const struct hantro_codec_ops imx8mq_vpu_codec_ops[] = {
> - [HANTRO_MODE_MPEG2_DEC] = {
> - .run = hantro_g1_mpeg2_dec_run,
> - .reset = imx8m_vpu_g1_reset,
> - .init = hantro_mpeg2_dec_init,
> - .exit = hantro_mpeg2_dec_exit,
> - },
> - [HANTRO_MODE_VP8_DEC] = {
> - .run = hantro_g1_vp8_dec_run,
> - .reset = imx8m_vpu_g1_reset,
> - .init = hantro_vp8_dec_init,
> - .exit = hantro_vp8_dec_exit,
> - },
> - [HANTRO_MODE_H264_DEC] = {
> - .run = hantro_g1_h264_dec_run,
> - .reset = imx8m_vpu_g1_reset,
> - .init = hantro_h264_dec_init,
> - .exit = hantro_h264_dec_exit,
> - },
> -};
> -
> static const struct hantro_codec_ops imx8mq_vpu_g1_codec_ops[] = {
> [HANTRO_MODE_MPEG2_DEC] = {
> .run = hantro_g1_mpeg2_dec_run,
> @@ -319,30 +223,9 @@ static const struct hantro_irq imx8mq_g2_irqs[] = {
> { "g2", hantro_g2_irq },
> };
>
> -static const char * const imx8mq_clk_names[] = { "g1", "g2", "bus" };
> -static const char * const imx8mq_reg_names[] = { "g1", "g2", "ctrl" };
> static const char * const imx8mq_g1_clk_names[] = { "g1" };
> static const char * const imx8mq_g2_clk_names[] = { "g2" };
>
> -const struct hantro_variant imx8mq_vpu_variant = {
> - .dec_fmts = imx8m_vpu_dec_fmts,
> - .num_dec_fmts = ARRAY_SIZE(imx8m_vpu_dec_fmts),
> - .postproc_fmts = imx8m_vpu_postproc_fmts,
> - .num_postproc_fmts = ARRAY_SIZE(imx8m_vpu_postproc_fmts),
> - .postproc_ops = &hantro_g1_postproc_ops,
> - .codec = HANTRO_MPEG2_DECODER | HANTRO_VP8_DECODER |
> - HANTRO_H264_DECODER,
> - .codec_ops = imx8mq_vpu_codec_ops,
> - .init = imx8mq_vpu_hw_init,
> - .runtime_resume = imx8mq_runtime_resume,
Spotted by Sashiko, the function pointer is no longer used, and
hantro_runtime_resume() in PM OPS is now a no-op.
Nicolas
> - .irqs = imx8mq_irqs,
> - .num_irqs = ARRAY_SIZE(imx8mq_irqs),
> - .clk_names = imx8mq_clk_names,
> - .num_clocks = ARRAY_SIZE(imx8mq_clk_names),
> - .reg_names = imx8mq_reg_names,
> - .num_regs = ARRAY_SIZE(imx8mq_reg_names)
> -};
> -
> static const struct of_device_id imx8mq_vpu_shared_resources[] = {
> { .compatible = "nxp,imx8mq-vpu-g1", },
> { .compatible = "nxp,imx8mq-vpu-g2", },
[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
[-- Attachment #2: Type: text/plain, Size: 170 bytes --]
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
^ permalink raw reply [flat|nested] 17+ messages in thread* Re: [PATCH v5 1/3] media: verisilicon: Remove deprecated nxp,imx8mp-vpu variant
@ 2026-09-28 17:38 ` Nicolas Dufresne
0 siblings, 0 replies; 17+ messages in thread
From: Nicolas Dufresne @ 2026-09-28 17:38 UTC (permalink / raw)
To: Benjamin Gaignard, p.zabel, mchehab, robh, krzk+dt, conor+dt,
Frank.Li, s.hauer, kernel, festevam, conor
Cc: linux-media, linux-rockchip, devicetree, imx, linux-arm-kernel,
linux-kernel, kernel
[-- Attachment #1: Type: text/plain, Size: 7570 bytes --]
Hi,
Le lundi 28 septembre 2026 à 10:08 +0200, Benjamin Gaignard a écrit :
> "nxp,imx8mq-vpu" is tagged as deprecated since:
> commit f3116f2e52e6 ("media: dt-bindings: media: nxp, imx8mq-vpu: Split G1 and G2 nodes")
> merged since v5.17-rc1. There is more reference to it since that.
> Remove for driver to clean up the code.
There is not much sense to the above line, would you like to propose something.
>
> Signed-off-by: Benjamin Gaignard <benjamin.gaignard@collabora.com>
> ---
> .../media/platform/verisilicon/hantro_drv.c | 10 --
> .../media/platform/verisilicon/hantro_hw.h | 1 -
> .../media/platform/verisilicon/imx8m_vpu_hw.c | 117 ------------------
> 3 files changed, 128 deletions(-)
>
> diff --git a/drivers/media/platform/verisilicon/hantro_drv.c b/drivers/media/platform/verisilicon/hantro_drv.c
> index ad71c0402ef3..12c804dcc669 100644
> --- a/drivers/media/platform/verisilicon/hantro_drv.c
> +++ b/drivers/media/platform/verisilicon/hantro_drv.c
> @@ -725,7 +725,6 @@ static const struct of_device_id of_hantro_match[] = {
> #endif
> #ifdef CONFIG_VIDEO_HANTRO_IMX8M
> { .compatible = "nxp,imx8mm-vpu-g1", .data = &imx8mm_vpu_g1_variant, },
> - { .compatible = "nxp,imx8mq-vpu", .data = &imx8mq_vpu_variant, },
> { .compatible = "nxp,imx8mq-vpu-g1", .data = &imx8mq_vpu_g1_variant },
> { .compatible = "nxp,imx8mq-vpu-g2", .data = &imx8mq_vpu_g2_variant },
> #endif
> @@ -1100,15 +1099,6 @@ static int hantro_probe(struct platform_device *pdev)
> if (ret)
> return ret;
>
> - /*
> - * Support for nxp,imx8mq-vpu is kept for backwards compatibility
> - * but it's deprecated. Please update your DTS file to use
> - * nxp,imx8mq-vpu-g1 or nxp,imx8mq-vpu-g2 instead.
> - */
> - if (of_device_is_compatible(pdev->dev.of_node, "nxp,imx8mq-vpu"))
> - dev_warn(&pdev->dev, "%s compatible is deprecated\n",
> - match->compatible);
> -
> INIT_DELAYED_WORK(&vpu->watchdog_work, hantro_watchdog);
>
> vpu->clocks = devm_kcalloc(&pdev->dev, vpu->variant->num_clocks,
> diff --git a/drivers/media/platform/verisilicon/hantro_hw.h b/drivers/media/platform/verisilicon/hantro_hw.h
> index 13e573f1f19d..865de26ffbce 100644
> --- a/drivers/media/platform/verisilicon/hantro_hw.h
> +++ b/drivers/media/platform/verisilicon/hantro_hw.h
> @@ -405,7 +405,6 @@ enum hantro_enc_fmt {
> extern const struct hantro_variant imx8mm_vpu_g1_variant;
> extern const struct hantro_variant imx8mq_vpu_g1_variant;
> extern const struct hantro_variant imx8mq_vpu_g2_variant;
> -extern const struct hantro_variant imx8mq_vpu_variant;
> extern const struct hantro_variant px30_vpu_variant;
> extern const struct hantro_variant rk3036_vpu_variant;
> extern const struct hantro_variant rk3066_vpu_variant;
> diff --git a/drivers/media/platform/verisilicon/imx8m_vpu_hw.c b/drivers/media/platform/verisilicon/imx8m_vpu_hw.c
> index fa4224de4b99..0d6a71ae5f45 100644
> --- a/drivers/media/platform/verisilicon/imx8m_vpu_hw.c
> +++ b/drivers/media/platform/verisilicon/imx8m_vpu_hw.c
> @@ -13,67 +13,6 @@
> #include "hantro_g1_regs.h"
> #include "hantro_g2_regs.h"
>
> -#define CTRL_SOFT_RESET 0x00
> -#define RESET_G1 BIT(1)
> -#define RESET_G2 BIT(0)
> -
> -#define CTRL_CLOCK_ENABLE 0x04
> -#define CLOCK_G1 BIT(1)
> -#define CLOCK_G2 BIT(0)
> -
> -#define CTRL_G1_DEC_FUSE 0x08
> -#define CTRL_G1_PP_FUSE 0x0c
> -#define CTRL_G2_DEC_FUSE 0x10
> -
> -static void imx8m_soft_reset(struct hantro_dev *vpu, u32 reset_bits)
> -{
> - u32 val;
> -
> - /* Assert */
> - val = readl(vpu->ctrl_base + CTRL_SOFT_RESET);
> - val &= ~reset_bits;
> - writel(val, vpu->ctrl_base + CTRL_SOFT_RESET);
> -
> - udelay(2);
> -
> - /* Release */
> - val = readl(vpu->ctrl_base + CTRL_SOFT_RESET);
> - val |= reset_bits;
> - writel(val, vpu->ctrl_base + CTRL_SOFT_RESET);
> -}
> -
> -static void imx8m_clk_enable(struct hantro_dev *vpu, u32 clock_bits)
> -{
> - u32 val;
> -
> - val = readl(vpu->ctrl_base + CTRL_CLOCK_ENABLE);
> - val |= clock_bits;
> - writel(val, vpu->ctrl_base + CTRL_CLOCK_ENABLE);
> -}
> -
> -static int imx8mq_runtime_resume(struct hantro_dev *vpu)
> -{
> - int ret;
> -
> - ret = clk_bulk_prepare_enable(vpu->variant->num_clocks, vpu->clocks);
> - if (ret) {
> - dev_err(vpu->dev, "Failed to enable clocks\n");
> - return ret;
> - }
> -
> - imx8m_soft_reset(vpu, RESET_G1 | RESET_G2);
> - imx8m_clk_enable(vpu, CLOCK_G1 | CLOCK_G2);
> -
> - /* Set values of the fuse registers */
> - writel(0xffffffff, vpu->ctrl_base + CTRL_G1_DEC_FUSE);
> - writel(0xffffffff, vpu->ctrl_base + CTRL_G1_PP_FUSE);
> - writel(0xffffffff, vpu->ctrl_base + CTRL_G2_DEC_FUSE);
> -
> - clk_bulk_disable_unprepare(vpu->variant->num_clocks, vpu->clocks);
> -
> - return 0;
> -}
> -
> /*
> * Supported formats.
> */
> @@ -234,45 +173,10 @@ static const struct hantro_fmt imx8m_vpu_g2_dec_fmts[] = {
> },
> };
>
> -static int imx8mq_vpu_hw_init(struct hantro_dev *vpu)
> -{
> - vpu->ctrl_base = vpu->reg_bases[vpu->variant->num_regs - 1];
> -
> - return 0;
> -}
> -
> -static void imx8m_vpu_g1_reset(struct hantro_ctx *ctx)
> -{
> - struct hantro_dev *vpu = ctx->dev;
> -
> - imx8m_soft_reset(vpu, RESET_G1);
> -}
> -
> /*
> * Supported codec ops.
> */
>
> -static const struct hantro_codec_ops imx8mq_vpu_codec_ops[] = {
> - [HANTRO_MODE_MPEG2_DEC] = {
> - .run = hantro_g1_mpeg2_dec_run,
> - .reset = imx8m_vpu_g1_reset,
> - .init = hantro_mpeg2_dec_init,
> - .exit = hantro_mpeg2_dec_exit,
> - },
> - [HANTRO_MODE_VP8_DEC] = {
> - .run = hantro_g1_vp8_dec_run,
> - .reset = imx8m_vpu_g1_reset,
> - .init = hantro_vp8_dec_init,
> - .exit = hantro_vp8_dec_exit,
> - },
> - [HANTRO_MODE_H264_DEC] = {
> - .run = hantro_g1_h264_dec_run,
> - .reset = imx8m_vpu_g1_reset,
> - .init = hantro_h264_dec_init,
> - .exit = hantro_h264_dec_exit,
> - },
> -};
> -
> static const struct hantro_codec_ops imx8mq_vpu_g1_codec_ops[] = {
> [HANTRO_MODE_MPEG2_DEC] = {
> .run = hantro_g1_mpeg2_dec_run,
> @@ -319,30 +223,9 @@ static const struct hantro_irq imx8mq_g2_irqs[] = {
> { "g2", hantro_g2_irq },
> };
>
> -static const char * const imx8mq_clk_names[] = { "g1", "g2", "bus" };
> -static const char * const imx8mq_reg_names[] = { "g1", "g2", "ctrl" };
> static const char * const imx8mq_g1_clk_names[] = { "g1" };
> static const char * const imx8mq_g2_clk_names[] = { "g2" };
>
> -const struct hantro_variant imx8mq_vpu_variant = {
> - .dec_fmts = imx8m_vpu_dec_fmts,
> - .num_dec_fmts = ARRAY_SIZE(imx8m_vpu_dec_fmts),
> - .postproc_fmts = imx8m_vpu_postproc_fmts,
> - .num_postproc_fmts = ARRAY_SIZE(imx8m_vpu_postproc_fmts),
> - .postproc_ops = &hantro_g1_postproc_ops,
> - .codec = HANTRO_MPEG2_DECODER | HANTRO_VP8_DECODER |
> - HANTRO_H264_DECODER,
> - .codec_ops = imx8mq_vpu_codec_ops,
> - .init = imx8mq_vpu_hw_init,
> - .runtime_resume = imx8mq_runtime_resume,
Spotted by Sashiko, the function pointer is no longer used, and
hantro_runtime_resume() in PM OPS is now a no-op.
Nicolas
> - .irqs = imx8mq_irqs,
> - .num_irqs = ARRAY_SIZE(imx8mq_irqs),
> - .clk_names = imx8mq_clk_names,
> - .num_clocks = ARRAY_SIZE(imx8mq_clk_names),
> - .reg_names = imx8mq_reg_names,
> - .num_regs = ARRAY_SIZE(imx8mq_reg_names)
> -};
> -
> static const struct of_device_id imx8mq_vpu_shared_resources[] = {
> { .compatible = "nxp,imx8mq-vpu-g1", },
> { .compatible = "nxp,imx8mq-vpu-g2", },
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 17+ messages in thread