All of lore.kernel.org
 help / color / mirror / Atom feed
From: Biju Das <biju.das.jz@bp.renesas.com>
To: cip-dev@lists.cip-project.org,
	Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>,
	Pavel Machek <pavel@denx.de>
Cc: Biju Das <biju.das.jz@bp.renesas.com>,
	Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Subject: [PATCH 5.10.y-cip 14/18] media: renesas: vsp1: Add support for RZ/G2L VSPD
Date: Thu,  7 Dec 2023 13:46:53 +0000	[thread overview]
Message-ID: <20231207134657.371420-15-biju.das.jz@bp.renesas.com> (raw)
In-Reply-To: <20231207134657.371420-1-biju.das.jz@bp.renesas.com>

commit 882bda188f691320a001c6adc738c4a7ec102a8d upstream.

The RZ/G2L VSPD provides a single VSPD instance. It has the following
sub modules MAU, CTU, RPF, DPR, LUT, BRS, WPF and LIF.

The VSPD block on RZ/G2L SoCs does not have a version register, so
added a new compatible string "renesas,r9a07g044-vsp2" with a data
pointer containing the info structure. Also the reset line is shared
with the DU module.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
 drivers/media/platform/vsp1/vsp1_drv.c  | 13 +++++++++++++
 drivers/media/platform/vsp1/vsp1_lif.c  |  9 +++++----
 drivers/media/platform/vsp1/vsp1_regs.h |  5 +++++
 3 files changed, 23 insertions(+), 4 deletions(-)

diff --git a/drivers/media/platform/vsp1/vsp1_drv.c b/drivers/media/platform/vsp1/vsp1_drv.c
index b30f2a0ef285..805b868e8c55 100644
--- a/drivers/media/platform/vsp1/vsp1_drv.c
+++ b/drivers/media/platform/vsp1/vsp1_drv.c
@@ -811,6 +811,18 @@ static const struct vsp1_device_info vsp1_device_infos[] = {
 	},
 };
 
+static const struct vsp1_device_info rzg2l_vsp2_device_info = {
+	.version = VI6_IP_VERSION_MODEL_VSPD_RZG2L,
+	.model = "VSP2-D",
+	.soc = VI6_IP_VERSION_SOC_RZG2L,
+	.gen = 3,
+	.features = VSP1_HAS_BRS | VSP1_HAS_WPF_VFLIP | VSP1_HAS_EXT_DL
+		  | VSP1_HAS_NON_ZERO_LBA,
+	.lif_count = 1,
+	.rpf_count = 2,
+	.wpf_count = 1,
+};
+
 static const struct vsp1_device_info *vsp1_lookup_info(struct vsp1_device *vsp1)
 {
 	const struct vsp1_device_info *info;
@@ -961,6 +973,7 @@ static int vsp1_remove(struct platform_device *pdev)
 static const struct of_device_id vsp1_of_match[] = {
 	{ .compatible = "renesas,vsp1" },
 	{ .compatible = "renesas,vsp2" },
+	{ .compatible = "renesas,r9a07g044-vsp2", .data = &rzg2l_vsp2_device_info },
 	{ },
 };
 MODULE_DEVICE_TABLE(of, vsp1_of_match);
diff --git a/drivers/media/platform/vsp1/vsp1_lif.c b/drivers/media/platform/vsp1/vsp1_lif.c
index 5205f34699a1..6a5c03d64c6e 100644
--- a/drivers/media/platform/vsp1/vsp1_lif.c
+++ b/drivers/media/platform/vsp1/vsp1_lif.c
@@ -106,6 +106,7 @@ static void lif_configure_stream(struct vsp1_entity *entity,
 
 	case VI6_IP_VERSION_MODEL_VSPDL_GEN3:
 	case VI6_IP_VERSION_MODEL_VSPD_V3:
+	case VI6_IP_VERSION_MODEL_VSPD_RZG2L:
 		hbth = 0;
 		obth = 1500;
 		lbth = 0;
@@ -129,10 +130,10 @@ static void lif_configure_stream(struct vsp1_entity *entity,
 			VI6_LIF_CTRL_REQSEL | VI6_LIF_CTRL_LIF_EN);
 
 	/*
-	 * On R-Car V3M the LIF0 buffer attribute register has to be set to a
-	 * non-default value to guarantee proper operation (otherwise artifacts
-	 * may appear on the output). The value required by the manual is not
-	 * explained but is likely a buffer size or threshold.
+	 * On R-Car V3M and RZ/G2L the LIF0 buffer attribute register has to be
+	 * set to a non-default value to guarantee proper operation (otherwise
+	 * artifacts may appear on the output). The value required by the
+	 * manual is not explained but is likely a buffer size or threshold.
 	 */
 	if (vsp1_feature(entity->vsp1, VSP1_HAS_NON_ZERO_LBA))
 		vsp1_lif_write(lif, dlb, VI6_LIF_LBA,
diff --git a/drivers/media/platform/vsp1/vsp1_regs.h b/drivers/media/platform/vsp1/vsp1_regs.h
index ce8707ff1f13..0569869f332f 100644
--- a/drivers/media/platform/vsp1/vsp1_regs.h
+++ b/drivers/media/platform/vsp1/vsp1_regs.h
@@ -766,6 +766,9 @@
 #define VI6_IP_VERSION_MODEL_VSPD_V3	(0x18 << 8)
 #define VI6_IP_VERSION_MODEL_VSPDL_GEN3	(0x19 << 8)
 #define VI6_IP_VERSION_MODEL_VSPBS_GEN3	(0x1a << 8)
+/* RZ/G2L SoCs have no version register, So use 0x80 as the model version */
+#define VI6_IP_VERSION_MODEL_VSPD_RZG2L	(0x80 << 8)
+
 #define VI6_IP_VERSION_SOC_MASK		(0xff << 0)
 #define VI6_IP_VERSION_SOC_H2		(0x01 << 0)
 #define VI6_IP_VERSION_SOC_V2H		(0x01 << 0)
@@ -777,6 +780,8 @@
 #define VI6_IP_VERSION_SOC_D3		(0x04 << 0)
 #define VI6_IP_VERSION_SOC_M3N		(0x04 << 0)
 #define VI6_IP_VERSION_SOC_E3		(0x04 << 0)
+/* RZ/G2L SoCs have no version register, So use 0x80 for SoC Identification */
+#define VI6_IP_VERSION_SOC_RZG2L	(0x80 << 0)
 
 #define VI6_IP_VERSION_VSP_SW		(0xfffe << 16) /* SW VSP version */
 
-- 
2.25.1



  parent reply	other threads:[~2023-12-07 13:47 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-07 13:46 [PATCH 5.10.y-cip 00/18] Add VSPD/FCPVD support Biju Das
2023-12-07 13:46 ` [PATCH 5.10.y-cip 01/18] device property: Add const qualifier to device_get_match_data() parameter Biju Das
2023-12-07 13:46 ` [PATCH 5.10.y-cip 02/18] media: vsp1: use pm_runtime_resume_and_get() Biju Das
2023-12-07 13:46 ` [PATCH 5.10.y-cip 03/18] media: vsp1: Make use of the helper function devm_platform_ioremap_resource() Biju Das
2023-12-07 13:46 ` [PATCH 5.10.y-cip 04/18] media: vsp1: Fix WPF macro names Biju Das
2023-12-07 13:46 ` [PATCH 5.10.y-cip 05/18] media: vsp1: Simplify DRM UIF handling Biju Das
2023-12-07 13:46 ` [PATCH 5.10.y-cip 06/18] media: vsp1: Use platform_get_irq() to get the interrupt Biju Das
2023-12-07 13:46 ` [PATCH 5.10.y-cip 07/18] media: vsp1: mask interrupts before enabling Biju Das
2023-12-07 13:46 ` [PATCH 5.10.y-cip 08/18] media: renesas: vsp1: Add support to deassert/assert reset line Biju Das
2023-12-07 13:46 ` [PATCH 5.10.y-cip 09/18] media: renesas: vsp1: Add support for VSP software version Biju Das
2023-12-07 13:46 ` [PATCH 5.10.y-cip 10/18] media: vsp1: Use BIT macro for feature identification Biju Das
2023-12-07 13:46 ` [PATCH 5.10.y-cip 11/18] media: renesas: vsp1: Add VSP1_HAS_NON_ZERO_LBA feature bit Biju Das
2023-12-07 13:46 ` [PATCH 5.10.y-cip 12/18] media: dt-bindings: media: renesas,vsp1: Document RZ/G2L VSPD bindings Biju Das
2023-12-07 13:46 ` [PATCH 5.10.y-cip 13/18] media: dt-bindings: media: renesas,vsp1: Document RZ/V2L " Biju Das
2023-12-07 13:46 ` Biju Das [this message]
2023-12-07 13:46 ` [PATCH 5.10.y-cip 15/18] arm64: dts: renesas: r9a07g044: Add fcpvd node Biju Das
2023-12-07 13:46 ` [PATCH 5.10.y-cip 16/18] arm64: dts: renesas: r9a07g044: Add vspd node Biju Das
2023-12-07 13:46 ` [PATCH 5.10.y-cip 17/18] arm64: dts: renesas: r9a07g054: Add fcpvd node Biju Das
2023-12-07 13:46 ` [PATCH 5.10.y-cip 18/18] arm64: dts: renesas: r9a07g054: Add vspd node Biju Das
2023-12-07 19:10 ` [PATCH 5.10.y-cip 00/18] Add VSPD/FCPVD support Pavel Machek
2023-12-07 19:18   ` Biju Das
2023-12-08 13:14 ` Pavel Machek

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=20231207134657.371420-15-biju.das.jz@bp.renesas.com \
    --to=biju.das.jz@bp.renesas.com \
    --cc=cip-dev@lists.cip-project.org \
    --cc=nobuhiro1.iwamatsu@toshiba.co.jp \
    --cc=pavel@denx.de \
    --cc=prabhakar.mahadev-lad.rj@bp.renesas.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.