summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLucas Stach <l.stach@pengutronix.de>2021-07-16 12:43:53 +0200
committerLucas Stach <l.stach@pengutronix.de>2021-07-21 22:27:10 +0200
commita8c1b365a9ff2c23089e778c2ec9bdf7c1194f90 (patch)
tree1b369fa7edaf806535073c2ff96d095fd55cc862
parent90574a8c50dc59b899c70320e5cf3054c8280c2a (diff)
downloadlinux-a8c1b365a9ff2c23089e778c2ec9bdf7c1194f90.tar.gz
linux-a8c1b365a9ff2c23089e778c2ec9bdf7c1194f90.tar.xz
WIP: media: hantro: add i.MX8MM VPU support
Just a mockup to get the VPU support going and test power-domain interactions. Needs further work. Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
-rw-r--r--drivers/staging/media/hantro/hantro_drv.c1
-rw-r--r--drivers/staging/media/hantro/hantro_hw.h1
-rw-r--r--drivers/staging/media/hantro/imx8m_vpu_hw.c47
3 files changed, 49 insertions, 0 deletions
diff --git a/drivers/staging/media/hantro/hantro_drv.c b/drivers/staging/media/hantro/hantro_drv.c
index 595e82a82728..6caeda22e3e0 100644
--- a/drivers/staging/media/hantro/hantro_drv.c
+++ b/drivers/staging/media/hantro/hantro_drv.c
@@ -478,6 +478,7 @@ static const struct of_device_id of_hantro_match[] = {
#endif
#ifdef CONFIG_VIDEO_HANTRO_IMX8M
{ .compatible = "nxp,imx8mq-vpu", .data = &imx8mq_vpu_variant, },
+ { .compatible = "nxp,imx8mm-vpu-g1", .data = &imx8mm_vpu_g1_variant, },
#endif
{ /* sentinel */ }
};
diff --git a/drivers/staging/media/hantro/hantro_hw.h b/drivers/staging/media/hantro/hantro_hw.h
index 83b3e42b63a3..a6adf18702c5 100644
--- a/drivers/staging/media/hantro/hantro_hw.h
+++ b/drivers/staging/media/hantro/hantro_hw.h
@@ -164,6 +164,7 @@ extern const struct hantro_variant rk3399_vpu_variant;
extern const struct hantro_variant rk3328_vpu_variant;
extern const struct hantro_variant rk3288_vpu_variant;
extern const struct hantro_variant imx8mq_vpu_variant;
+extern const struct hantro_variant imx8mm_vpu_g1_variant;
extern const struct hantro_postproc_regs hantro_g1_postproc_regs;
diff --git a/drivers/staging/media/hantro/imx8m_vpu_hw.c b/drivers/staging/media/hantro/imx8m_vpu_hw.c
index c222de075ef4..badc20fa0894 100644
--- a/drivers/staging/media/hantro/imx8m_vpu_hw.c
+++ b/drivers/staging/media/hantro/imx8m_vpu_hw.c
@@ -218,3 +218,50 @@ const struct hantro_variant imx8mq_vpu_variant = {
.reg_names = imx8mq_reg_names,
.num_regs = ARRAY_SIZE(imx8mq_reg_names)
};
+
+static void imx8mm_vpu_g1_reset(struct hantro_ctx *ctx)
+{
+ /* stub */
+}
+
+static const struct hantro_codec_ops imx8mm_g1_vpu_codec_ops[] = {
+ [HANTRO_MODE_MPEG2_DEC] = {
+ .run = hantro_g1_mpeg2_dec_run,
+ .reset = imx8mm_vpu_g1_reset,
+ .init = hantro_mpeg2_dec_init,
+ .exit = hantro_mpeg2_dec_exit,
+ },
+ [HANTRO_MODE_VP8_DEC] = {
+ .run = hantro_g1_vp8_dec_run,
+ .reset = imx8mm_vpu_g1_reset,
+ .init = hantro_vp8_dec_init,
+ .exit = hantro_vp8_dec_exit,
+ },
+ [HANTRO_MODE_H264_DEC] = {
+ .run = hantro_g1_h264_dec_run,
+ .reset = imx8mm_vpu_g1_reset,
+ .init = hantro_h264_dec_init,
+ .exit = hantro_h264_dec_exit,
+ },
+};
+
+static const struct hantro_irq imx8mm_g1_irqs[] = {
+ { "g1", imx8m_vpu_g1_irq },
+};
+static const char * const imx8mm_g1_clk_names[] = { "g1" };
+
+const struct hantro_variant imx8mm_vpu_g1_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_regs = &hantro_g1_postproc_regs,
+ .codec = HANTRO_MPEG2_DECODER | HANTRO_VP8_DECODER |
+ HANTRO_H264_DECODER,
+ .codec_ops = imx8mm_g1_vpu_codec_ops,
+ .init = imx8mq_vpu_hw_init,
+ .irqs = imx8mm_g1_irqs,
+ .num_irqs = ARRAY_SIZE(imx8mm_g1_irqs),
+ .clk_names = imx8mm_g1_clk_names,
+ .num_clocks = ARRAY_SIZE(imx8mm_g1_clk_names),
+};