From: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
To: linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org,
devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Cc: Jacob Chen <jacob-chen@iotwrt.com>,
Ezequiel Garcia <ezequiel@collabora.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Rob Herring <robh+dt@kernel.org>,
Heiko Stuebner <heiko@sntech.de>,
Philipp Zabel <p.zabel@pengutronix.de>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Subject: [PATCH 5/5] media: hantro: Add support for the Rockchip PX30
Date: Thu, 7 Jan 2021 14:41:01 +0100 [thread overview]
Message-ID: <20210107134101.195426-6-paul.kocialkowski@bootlin.com> (raw)
In-Reply-To: <20210107134101.195426-1-paul.kocialkowski@bootlin.com>
The PX30 SoC includes both the VDPU2 and VEPU2 blocks which are similar
to the RK3399 (Hantro G1/H1 with shuffled registers).
Besides taking an extra clock, it also shares an interrupt with the IOMMU
so it's necessary to request the interrupt shared.
Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
---
drivers/staging/media/hantro/hantro_drv.c | 5 +++--
drivers/staging/media/hantro/hantro_hw.h | 1 +
drivers/staging/media/hantro/rk3399_vpu_hw.c | 21 ++++++++++++++++++++
3 files changed, 25 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/media/hantro/hantro_drv.c b/drivers/staging/media/hantro/hantro_drv.c
index e5f200e64993..076a7782b476 100644
--- a/drivers/staging/media/hantro/hantro_drv.c
+++ b/drivers/staging/media/hantro/hantro_drv.c
@@ -472,6 +472,7 @@ static const struct v4l2_file_operations hantro_fops = {
static const struct of_device_id of_hantro_match[] = {
#ifdef CONFIG_VIDEO_HANTRO_ROCKCHIP
+ { .compatible = "rockchip,px30-vpu", .data = &px30_vpu_variant, },
{ .compatible = "rockchip,rk3399-vpu", .data = &rk3399_vpu_variant, },
{ .compatible = "rockchip,rk3328-vpu", .data = &rk3328_vpu_variant, },
{ .compatible = "rockchip,rk3288-vpu", .data = &rk3288_vpu_variant, },
@@ -796,8 +797,8 @@ static int hantro_probe(struct platform_device *pdev)
return -ENXIO;
ret = devm_request_irq(vpu->dev, irq,
- vpu->variant->irqs[i].handler, 0,
- dev_name(vpu->dev), vpu);
+ vpu->variant->irqs[i].handler,
+ IRQF_SHARED, dev_name(vpu->dev), vpu);
if (ret) {
dev_err(vpu->dev, "Could not request %s IRQ.\n",
irq_name);
diff --git a/drivers/staging/media/hantro/hantro_hw.h b/drivers/staging/media/hantro/hantro_hw.h
index 34c9e4649a25..07f516fd7a2e 100644
--- a/drivers/staging/media/hantro/hantro_hw.h
+++ b/drivers/staging/media/hantro/hantro_hw.h
@@ -148,6 +148,7 @@ enum hantro_enc_fmt {
RK3288_VPU_ENC_FMT_UYVY422 = 3,
};
+extern const struct hantro_variant px30_vpu_variant;
extern const struct hantro_variant rk3399_vpu_variant;
extern const struct hantro_variant rk3328_vpu_variant;
extern const struct hantro_variant rk3288_vpu_variant;
diff --git a/drivers/staging/media/hantro/rk3399_vpu_hw.c b/drivers/staging/media/hantro/rk3399_vpu_hw.c
index 7a7962cf771e..4112f98baa60 100644
--- a/drivers/staging/media/hantro/rk3399_vpu_hw.c
+++ b/drivers/staging/media/hantro/rk3399_vpu_hw.c
@@ -220,3 +220,24 @@ const struct hantro_variant rk3328_vpu_variant = {
.clk_names = rk3399_clk_names,
.num_clocks = ARRAY_SIZE(rk3399_clk_names),
};
+
+static const char * const px30_clk_names[] = {
+ "aclk", "hclk", "sclk"
+};
+
+const struct hantro_variant px30_vpu_variant = {
+ .enc_offset = 0x0,
+ .enc_fmts = rk3399_vpu_enc_fmts,
+ .num_enc_fmts = ARRAY_SIZE(rk3399_vpu_enc_fmts),
+ .dec_offset = 0x400,
+ .dec_fmts = rk3399_vpu_dec_fmts,
+ .num_dec_fmts = ARRAY_SIZE(rk3399_vpu_dec_fmts),
+ .codec = HANTRO_JPEG_ENCODER | HANTRO_MPEG2_DECODER |
+ HANTRO_VP8_DECODER,
+ .codec_ops = rk3399_vpu_codec_ops,
+ .irqs = rk3399_irqs,
+ .num_irqs = ARRAY_SIZE(rk3399_irqs),
+ .init = rk3399_vpu_hw_init,
+ .clk_names = px30_clk_names,
+ .num_clocks = ARRAY_SIZE(px30_clk_names)
+};
--
2.30.0
next prev parent reply other threads:[~2021-01-07 13:42 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-07 13:40 [PATCH 0/5] Rockchip PX30 RGA and VPU support Paul Kocialkowski
2021-01-07 13:40 ` [PATCH 1/5] dt-bindings: media: rockchip-rga: Add PX30 compatible Paul Kocialkowski
2021-01-07 15:47 ` Rob Herring
2021-01-07 13:40 ` [PATCH 2/5] arm64: dts: rockchip: Add RGA support to the PX30 Paul Kocialkowski
2021-01-07 14:24 ` Paul Kocialkowski
2021-01-07 13:40 ` [PATCH 3/5] dt-bindings: media: rockchip-vpu: Add PX30 compatible Paul Kocialkowski
2021-01-07 14:55 ` Philipp Zabel
2021-01-11 17:20 ` Paul Kocialkowski
2021-01-07 15:47 ` Rob Herring
2021-01-07 13:41 ` [PATCH 4/5] arm64: dts: rockchip: Add VPU support for the PX30 Paul Kocialkowski
2021-01-07 13:41 ` Paul Kocialkowski [this message]
2021-01-07 19:08 ` [PATCH 5/5] media: hantro: Add support for the Rockchip PX30 Ezequiel Garcia
2021-01-08 9:05 ` Paul Kocialkowski
2021-01-08 10:48 ` Heiko Stübner
2021-01-08 10:49 ` Heiko Stübner
2021-01-08 13:13 ` Ezequiel Garcia
2021-01-11 17:23 ` Paul Kocialkowski
2021-06-21 2:57 ` [PATCH 0/5] Rockchip PX30 RGA and VPU support Ezequiel Garcia
2021-10-16 15:15 ` Michael Nazzareno Trimarchi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210107134101.195426-6-paul.kocialkowski@bootlin.com \
--to=paul.kocialkowski@bootlin.com \
--cc=devicetree@vger.kernel.org \
--cc=ezequiel@collabora.com \
--cc=gregkh@linuxfoundation.org \
--cc=heiko@sntech.de \
--cc=jacob-chen@iotwrt.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=mchehab@kernel.org \
--cc=p.zabel@pengutronix.de \
--cc=robh+dt@kernel.org \
--cc=thomas.petazzoni@bootlin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).