linux-renesas-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 0/6] media: rcar-vin: Add support for R-Car E3
@ 2018-11-06 10:54 Jacopo Mondi
  2018-11-06 10:54 ` [PATCH v4 1/6] media: dt-bindings: rcar-vin: Add R8A77990 support Jacopo Mondi
                   ` (5 more replies)
  0 siblings, 6 replies; 9+ messages in thread
From: Jacopo Mondi @ 2018-11-06 10:54 UTC (permalink / raw)
  To: niklas.soderlund, laurent.pinchart, kieran.bingham
  Cc: Jacopo Mondi, linux-media, linux-renesas-soc

Hello,
    this series add support for the R-Car E3 R8A77990 SoC to the rcar-vin
and rcar-csi2 driver.

Compared to v3 (which has been sent out without the 'PATCH v3' subject, sorry
about this) I have updated the PHTW tables to match what the datasheet reports
and I have included a comment from Laurent in patch [6/6].

Single patches changelog in commit messages.

Thanks
   j

Jacopo Mondi (6):
  media: dt-bindings: rcar-vin: Add R8A77990 support
  media: rcar-vin: Add support for R-Car R8A77990
  media: dt-bindings: rcar-csi2: Add R8A77990
  media: rcar-csi2: Add R8A77990 support
  media: rcar: rcar-csi2: Update V3M/E3 PHTW tables
  media: rcar-csi2: Handle per-SoC number of channels

 .../devicetree/bindings/media/rcar_vin.txt         |  1 +
 .../bindings/media/renesas,rcar-csi2.txt           |  1 +
 drivers/media/platform/rcar-vin/rcar-core.c        | 20 +++++
 drivers/media/platform/rcar-vin/rcar-csi2.c        | 86 +++++++++++++---------
 4 files changed, 74 insertions(+), 34 deletions(-)

--
2.7.4

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH v4 1/6] media: dt-bindings: rcar-vin: Add R8A77990 support
  2018-11-06 10:54 [PATCH v4 0/6] media: rcar-vin: Add support for R-Car E3 Jacopo Mondi
@ 2018-11-06 10:54 ` Jacopo Mondi
  2018-11-06 10:54 ` [PATCH v4 2/6] media: rcar-vin: Add support for R-Car R8A77990 Jacopo Mondi
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 9+ messages in thread
From: Jacopo Mondi @ 2018-11-06 10:54 UTC (permalink / raw)
  To: niklas.soderlund, laurent.pinchart, kieran.bingham
  Cc: Jacopo Mondi, linux-media, linux-renesas-soc

Add compatible string for R-Car E3 R8A77990 to the list of SoCs supported by
rcar-vin driver.

Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
---
 Documentation/devicetree/bindings/media/rcar_vin.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/media/rcar_vin.txt b/Documentation/devicetree/bindings/media/rcar_vin.txt
index d329a4e..7c878ca 100644
--- a/Documentation/devicetree/bindings/media/rcar_vin.txt
+++ b/Documentation/devicetree/bindings/media/rcar_vin.txt
@@ -24,6 +24,7 @@ on Gen3 platforms to a CSI-2 receiver.
    - "renesas,vin-r8a7796" for the R8A7796 device
    - "renesas,vin-r8a77965" for the R8A77965 device
    - "renesas,vin-r8a77970" for the R8A77970 device
+   - "renesas,vin-r8a77990" for the R8A77990 device
    - "renesas,vin-r8a77995" for the R8A77995 device
    - "renesas,rcar-gen2-vin" for a generic R-Car Gen2 or RZ/G1 compatible
      device.
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v4 2/6] media: rcar-vin: Add support for R-Car R8A77990
  2018-11-06 10:54 [PATCH v4 0/6] media: rcar-vin: Add support for R-Car E3 Jacopo Mondi
  2018-11-06 10:54 ` [PATCH v4 1/6] media: dt-bindings: rcar-vin: Add R8A77990 support Jacopo Mondi
@ 2018-11-06 10:54 ` Jacopo Mondi
  2018-11-06 10:54 ` [PATCH v4 3/6] media: dt-bindings: rcar-csi2: Add R8A77990 Jacopo Mondi
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 9+ messages in thread
From: Jacopo Mondi @ 2018-11-06 10:54 UTC (permalink / raw)
  To: niklas.soderlund, laurent.pinchart, kieran.bingham
  Cc: Jacopo Mondi, linux-media, linux-renesas-soc

Add R-Car E3 R8A77990 SoC to the rcar-vin supported ones.
Based on the experimental patch from Magnus Damm.

Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
---
 drivers/media/platform/rcar-vin/rcar-core.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/drivers/media/platform/rcar-vin/rcar-core.c b/drivers/media/platform/rcar-vin/rcar-core.c
index f476b2f..cae2166 100644
--- a/drivers/media/platform/rcar-vin/rcar-core.c
+++ b/drivers/media/platform/rcar-vin/rcar-core.c
@@ -1088,6 +1088,22 @@ static const struct rvin_info rcar_info_r8a77970 = {
 	.routes = rcar_info_r8a77970_routes,
 };
 
+static const struct rvin_group_route rcar_info_r8a77990_routes[] = {
+	{ .csi = RVIN_CSI40, .channel = 0, .vin = 4, .mask = BIT(0) | BIT(3) },
+	{ .csi = RVIN_CSI40, .channel = 0, .vin = 5, .mask = BIT(2) },
+	{ .csi = RVIN_CSI40, .channel = 1, .vin = 4, .mask = BIT(2) },
+	{ .csi = RVIN_CSI40, .channel = 1, .vin = 5, .mask = BIT(1) | BIT(3) },
+	{ /* Sentinel */ }
+};
+
+static const struct rvin_info rcar_info_r8a77990 = {
+	.model = RCAR_GEN3,
+	.use_mc = true,
+	.max_width = 4096,
+	.max_height = 4096,
+	.routes = rcar_info_r8a77990_routes,
+};
+
 static const struct rvin_group_route rcar_info_r8a77995_routes[] = {
 	{ /* Sentinel */ }
 };
@@ -1146,6 +1162,10 @@ static const struct of_device_id rvin_of_id_table[] = {
 		.data = &rcar_info_r8a77970,
 	},
 	{
+		.compatible = "renesas,vin-r8a77990",
+		.data = &rcar_info_r8a77990,
+	},
+	{
 		.compatible = "renesas,vin-r8a77995",
 		.data = &rcar_info_r8a77995,
 	},
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v4 3/6] media: dt-bindings: rcar-csi2: Add R8A77990
  2018-11-06 10:54 [PATCH v4 0/6] media: rcar-vin: Add support for R-Car E3 Jacopo Mondi
  2018-11-06 10:54 ` [PATCH v4 1/6] media: dt-bindings: rcar-vin: Add R8A77990 support Jacopo Mondi
  2018-11-06 10:54 ` [PATCH v4 2/6] media: rcar-vin: Add support for R-Car R8A77990 Jacopo Mondi
@ 2018-11-06 10:54 ` Jacopo Mondi
  2018-11-06 10:54 ` [PATCH v4 4/6] media: rcar-csi2: Add R8A77990 support Jacopo Mondi
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 9+ messages in thread
From: Jacopo Mondi @ 2018-11-06 10:54 UTC (permalink / raw)
  To: niklas.soderlund, laurent.pinchart, kieran.bingham
  Cc: Jacopo Mondi, linux-media, linux-renesas-soc

Add compatible string for R-Car E3 R8A77990 to the list of supported SoCs.

Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
---
 Documentation/devicetree/bindings/media/renesas,rcar-csi2.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/media/renesas,rcar-csi2.txt b/Documentation/devicetree/bindings/media/renesas,rcar-csi2.txt
index 2d385b6..2824489 100644
--- a/Documentation/devicetree/bindings/media/renesas,rcar-csi2.txt
+++ b/Documentation/devicetree/bindings/media/renesas,rcar-csi2.txt
@@ -12,6 +12,7 @@ Mandatory properties
    - "renesas,r8a7796-csi2" for the R8A7796 device.
    - "renesas,r8a77965-csi2" for the R8A77965 device.
    - "renesas,r8a77970-csi2" for the R8A77970 device.
+   - "renesas,r8a77990-csi2" for the R8A77990 device.
 
  - reg: the register base and size for the device registers
  - interrupts: the interrupt for the device
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v4 4/6] media: rcar-csi2: Add R8A77990 support
  2018-11-06 10:54 [PATCH v4 0/6] media: rcar-vin: Add support for R-Car E3 Jacopo Mondi
                   ` (2 preceding siblings ...)
  2018-11-06 10:54 ` [PATCH v4 3/6] media: dt-bindings: rcar-csi2: Add R8A77990 Jacopo Mondi
@ 2018-11-06 10:54 ` Jacopo Mondi
  2018-11-06 10:54 ` [PATCH v4 5/6] media: rcar: rcar-csi2: Update V3M/E3 PHTW tables Jacopo Mondi
  2018-11-06 10:54 ` [PATCH v4 6/6] media: rcar-csi2: Handle per-SoC number of channels Jacopo Mondi
  5 siblings, 0 replies; 9+ messages in thread
From: Jacopo Mondi @ 2018-11-06 10:54 UTC (permalink / raw)
  To: niklas.soderlund, laurent.pinchart, kieran.bingham
  Cc: Jacopo Mondi, linux-media, linux-renesas-soc

Add support for R-Car E3 R8A77965 to R-Car CSI-2 driver.
Based on the experimental patch from Magnus Damm.

Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
---
 drivers/media/platform/rcar-vin/rcar-csi2.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/media/platform/rcar-vin/rcar-csi2.c b/drivers/media/platform/rcar-vin/rcar-csi2.c
index b0044a0..695686b 100644
--- a/drivers/media/platform/rcar-vin/rcar-csi2.c
+++ b/drivers/media/platform/rcar-vin/rcar-csi2.c
@@ -963,6 +963,11 @@ static const struct rcar_csi2_info rcar_csi2_info_r8a77970 = {
 	.confirm_start = rcsi2_confirm_start_v3m_e3,
 };
 
+static const struct rcar_csi2_info rcar_csi2_info_r8a77990 = {
+	.init_phtw = rcsi2_init_phtw_v3m_e3,
+	.confirm_start = rcsi2_confirm_start_v3m_e3,
+};
+
 static const struct of_device_id rcar_csi2_of_table[] = {
 	{
 		.compatible = "renesas,r8a7795-csi2",
@@ -980,6 +985,10 @@ static const struct of_device_id rcar_csi2_of_table[] = {
 		.compatible = "renesas,r8a77970-csi2",
 		.data = &rcar_csi2_info_r8a77970,
 	},
+	{
+		.compatible = "renesas,r8a77990-csi2",
+		.data = &rcar_csi2_info_r8a77990,
+	},
 	{ /* sentinel */ },
 };
 MODULE_DEVICE_TABLE(of, rcar_csi2_of_table);
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v4 5/6] media: rcar: rcar-csi2: Update V3M/E3 PHTW tables
  2018-11-06 10:54 [PATCH v4 0/6] media: rcar-vin: Add support for R-Car E3 Jacopo Mondi
                   ` (3 preceding siblings ...)
  2018-11-06 10:54 ` [PATCH v4 4/6] media: rcar-csi2: Add R8A77990 support Jacopo Mondi
@ 2018-11-06 10:54 ` Jacopo Mondi
  2018-11-06 13:22   ` Laurent Pinchart
  2018-11-06 10:54 ` [PATCH v4 6/6] media: rcar-csi2: Handle per-SoC number of channels Jacopo Mondi
  5 siblings, 1 reply; 9+ messages in thread
From: Jacopo Mondi @ 2018-11-06 10:54 UTC (permalink / raw)
  To: niklas.soderlund, laurent.pinchart, kieran.bingham
  Cc: Jacopo Mondi, linux-media, linux-renesas-soc

Update PHTW tables for V3M and E3 SoCs to the latest datasheet release
(R-Car Series, 3rd Generation manual rev1.00 20181017).

Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>

---
v1 -> v2:
- Limit the PHTW table to 1125 MBps, according to Laurent's comment
---
 drivers/media/platform/rcar-vin/rcar-csi2.c | 62 ++++++++++++++---------------
 1 file changed, 31 insertions(+), 31 deletions(-)

diff --git a/drivers/media/platform/rcar-vin/rcar-csi2.c b/drivers/media/platform/rcar-vin/rcar-csi2.c
index 695686b..99f5b76 100644
--- a/drivers/media/platform/rcar-vin/rcar-csi2.c
+++ b/drivers/media/platform/rcar-vin/rcar-csi2.c
@@ -152,37 +152,37 @@ static const struct rcsi2_mbps_reg phtw_mbps_h3_v3h_m3n[] = {
 };
 
 static const struct rcsi2_mbps_reg phtw_mbps_v3m_e3[] = {
-	{ .mbps =   80, .reg = 0x00 },
-	{ .mbps =   90, .reg = 0x20 },
-	{ .mbps =  100, .reg = 0x40 },
-	{ .mbps =  110, .reg = 0x02 },
-	{ .mbps =  130, .reg = 0x22 },
-	{ .mbps =  140, .reg = 0x42 },
-	{ .mbps =  150, .reg = 0x04 },
-	{ .mbps =  170, .reg = 0x24 },
-	{ .mbps =  180, .reg = 0x44 },
-	{ .mbps =  200, .reg = 0x06 },
-	{ .mbps =  220, .reg = 0x26 },
-	{ .mbps =  240, .reg = 0x46 },
-	{ .mbps =  250, .reg = 0x08 },
-	{ .mbps =  270, .reg = 0x28 },
-	{ .mbps =  300, .reg = 0x0a },
-	{ .mbps =  330, .reg = 0x2a },
-	{ .mbps =  360, .reg = 0x4a },
-	{ .mbps =  400, .reg = 0x0c },
-	{ .mbps =  450, .reg = 0x2c },
-	{ .mbps =  500, .reg = 0x0e },
-	{ .mbps =  550, .reg = 0x2e },
-	{ .mbps =  600, .reg = 0x10 },
-	{ .mbps =  650, .reg = 0x30 },
-	{ .mbps =  700, .reg = 0x12 },
-	{ .mbps =  750, .reg = 0x32 },
-	{ .mbps =  800, .reg = 0x52 },
-	{ .mbps =  850, .reg = 0x72 },
-	{ .mbps =  900, .reg = 0x14 },
-	{ .mbps =  950, .reg = 0x34 },
-	{ .mbps = 1000, .reg = 0x54 },
-	{ .mbps = 1050, .reg = 0x74 },
+	{ .mbps =   89, .reg = 0x00 },
+	{ .mbps =   99, .reg = 0x20 },
+	{ .mbps =  109, .reg = 0x40 },
+	{ .mbps =  129, .reg = 0x02 },
+	{ .mbps =  139, .reg = 0x22 },
+	{ .mbps =  149, .reg = 0x42 },
+	{ .mbps =  169, .reg = 0x04 },
+	{ .mbps =  179, .reg = 0x24 },
+	{ .mbps =  199, .reg = 0x44 },
+	{ .mbps =  219, .reg = 0x06 },
+	{ .mbps =  239, .reg = 0x26 },
+	{ .mbps =  249, .reg = 0x46 },
+	{ .mbps =  269, .reg = 0x08 },
+	{ .mbps =  299, .reg = 0x28 },
+	{ .mbps =  329, .reg = 0x0a },
+	{ .mbps =  359, .reg = 0x2a },
+	{ .mbps =  399, .reg = 0x4a },
+	{ .mbps =  449, .reg = 0x0c },
+	{ .mbps =  499, .reg = 0x2c },
+	{ .mbps =  549, .reg = 0x0e },
+	{ .mbps =  599, .reg = 0x2e },
+	{ .mbps =  649, .reg = 0x10 },
+	{ .mbps =  699, .reg = 0x30 },
+	{ .mbps =  749, .reg = 0x12 },
+	{ .mbps =  799, .reg = 0x32 },
+	{ .mbps =  849, .reg = 0x52 },
+	{ .mbps =  899, .reg = 0x72 },
+	{ .mbps =  949, .reg = 0x14 },
+	{ .mbps =  999, .reg = 0x34 },
+	{ .mbps = 1049, .reg = 0x54 },
+	{ .mbps = 1099, .reg = 0x74 },
 	{ .mbps = 1125, .reg = 0x16 },
 	{ /* sentinel */ },
 };
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v4 6/6] media: rcar-csi2: Handle per-SoC number of channels
  2018-11-06 10:54 [PATCH v4 0/6] media: rcar-vin: Add support for R-Car E3 Jacopo Mondi
                   ` (4 preceding siblings ...)
  2018-11-06 10:54 ` [PATCH v4 5/6] media: rcar: rcar-csi2: Update V3M/E3 PHTW tables Jacopo Mondi
@ 2018-11-06 10:54 ` Jacopo Mondi
  2018-11-14 19:56   ` Niklas Söderlund
  5 siblings, 1 reply; 9+ messages in thread
From: Jacopo Mondi @ 2018-11-06 10:54 UTC (permalink / raw)
  To: niklas.soderlund, laurent.pinchart, kieran.bingham
  Cc: Jacopo Mondi, linux-media, linux-renesas-soc

The R-Car CSI-2 interface has a number of selectable 'channels' that
provides pixel data to the VINs during image acquisition.

Each channel can be used to match a CSI-2 data type and a CSI-2 virtual
channel to be routed to output path.

Different SoCs have different number of channels, with R-Car E3 being the
notable exception supporting only 2 of them.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>

---
v1 -> v2:
- Use the num_channels variable to decide if VCDT2 has to be written
  as suggested by Laurent.
---
 drivers/media/platform/rcar-vin/rcar-csi2.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/drivers/media/platform/rcar-vin/rcar-csi2.c b/drivers/media/platform/rcar-vin/rcar-csi2.c
index 99f5b76..80ad906 100644
--- a/drivers/media/platform/rcar-vin/rcar-csi2.c
+++ b/drivers/media/platform/rcar-vin/rcar-csi2.c
@@ -342,6 +342,7 @@ struct rcar_csi2_info {
 	int (*confirm_start)(struct rcar_csi2 *priv);
 	const struct rcsi2_mbps_reg *hsfreqrange;
 	unsigned int csi0clkfreqrange;
+	unsigned int num_channels;
 	bool clear_ulps;
 };
 
@@ -476,13 +477,14 @@ static int rcsi2_start(struct rcar_csi2 *priv)
 	format = rcsi2_code_to_fmt(priv->mf.code);
 
 	/*
-	 * Enable all Virtual Channels.
+	 * Enable all supported CSI-2 channels with virtual channel and
+	 * data type matching.
 	 *
 	 * NOTE: It's not possible to get individual datatype for each
 	 *       source virtual channel. Once this is possible in V4L2
 	 *       it should be used here.
 	 */
-	for (i = 0; i < 4; i++) {
+	for (i = 0; i < priv->info->num_channels; i++) {
 		u32 vcdt_part;
 
 		vcdt_part = VCDT_SEL_VC(i) | VCDT_VCDTN_EN | VCDT_SEL_DTN_ON |
@@ -511,7 +513,8 @@ static int rcsi2_start(struct rcar_csi2 *priv)
 	rcsi2_write(priv, FLD_REG, FLD_FLD_NUM(2) | FLD_FLD_EN4 |
 		    FLD_FLD_EN3 | FLD_FLD_EN2 | FLD_FLD_EN);
 	rcsi2_write(priv, VCDT_REG, vcdt);
-	rcsi2_write(priv, VCDT2_REG, vcdt2);
+	if (vcdt2)
+		rcsi2_write(priv, VCDT2_REG, vcdt2);
 	/* Lanes are zero indexed. */
 	rcsi2_write(priv, LSWAP_REG,
 		    LSWAP_L0SEL(priv->lane_swap[0] - 1) |
@@ -940,32 +943,38 @@ static const struct rcar_csi2_info rcar_csi2_info_r8a7795 = {
 	.init_phtw = rcsi2_init_phtw_h3_v3h_m3n,
 	.hsfreqrange = hsfreqrange_h3_v3h_m3n,
 	.csi0clkfreqrange = 0x20,
+	.num_channels = 4,
 	.clear_ulps = true,
 };
 
 static const struct rcar_csi2_info rcar_csi2_info_r8a7795es1 = {
 	.hsfreqrange = hsfreqrange_m3w_h3es1,
+	.num_channels = 4,
 };
 
 static const struct rcar_csi2_info rcar_csi2_info_r8a7796 = {
 	.hsfreqrange = hsfreqrange_m3w_h3es1,
+	.num_channels = 4,
 };
 
 static const struct rcar_csi2_info rcar_csi2_info_r8a77965 = {
 	.init_phtw = rcsi2_init_phtw_h3_v3h_m3n,
 	.hsfreqrange = hsfreqrange_h3_v3h_m3n,
 	.csi0clkfreqrange = 0x20,
+	.num_channels = 4,
 	.clear_ulps = true,
 };
 
 static const struct rcar_csi2_info rcar_csi2_info_r8a77970 = {
 	.init_phtw = rcsi2_init_phtw_v3m_e3,
 	.confirm_start = rcsi2_confirm_start_v3m_e3,
+	.num_channels = 4,
 };
 
 static const struct rcar_csi2_info rcar_csi2_info_r8a77990 = {
 	.init_phtw = rcsi2_init_phtw_v3m_e3,
 	.confirm_start = rcsi2_confirm_start_v3m_e3,
+	.num_channels = 2,
 };
 
 static const struct of_device_id rcar_csi2_of_table[] = {
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH v4 5/6] media: rcar: rcar-csi2: Update V3M/E3 PHTW tables
  2018-11-06 10:54 ` [PATCH v4 5/6] media: rcar: rcar-csi2: Update V3M/E3 PHTW tables Jacopo Mondi
@ 2018-11-06 13:22   ` Laurent Pinchart
  0 siblings, 0 replies; 9+ messages in thread
From: Laurent Pinchart @ 2018-11-06 13:22 UTC (permalink / raw)
  To: Jacopo Mondi
  Cc: niklas.soderlund, kieran.bingham, linux-media, linux-renesas-soc

Hi Jacopo,

Thank you for the patch.

On Tuesday, 6 November 2018 12:54:26 EET Jacopo Mondi wrote:
> Update PHTW tables for V3M and E3 SoCs to the latest datasheet release
> (R-Car Series, 3rd Generation manual rev1.00 20181017).
> 
> Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
> 
> ---
> v1 -> v2:
> - Limit the PHTW table to 1125 MBps, according to Laurent's comment

Based on the assumption that the values haven't changed between v1 and v2,

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  drivers/media/platform/rcar-vin/rcar-csi2.c | 62 ++++++++++++--------------
>  1 file changed, 31 insertions(+), 31 deletions(-)
> 
> diff --git a/drivers/media/platform/rcar-vin/rcar-csi2.c
> b/drivers/media/platform/rcar-vin/rcar-csi2.c index 695686b..99f5b76 100644
> --- a/drivers/media/platform/rcar-vin/rcar-csi2.c
> +++ b/drivers/media/platform/rcar-vin/rcar-csi2.c
> @@ -152,37 +152,37 @@ static const struct rcsi2_mbps_reg
> phtw_mbps_h3_v3h_m3n[] = { };
> 
>  static const struct rcsi2_mbps_reg phtw_mbps_v3m_e3[] = {
> -	{ .mbps =   80, .reg = 0x00 },
> -	{ .mbps =   90, .reg = 0x20 },
> -	{ .mbps =  100, .reg = 0x40 },
> -	{ .mbps =  110, .reg = 0x02 },
> -	{ .mbps =  130, .reg = 0x22 },
> -	{ .mbps =  140, .reg = 0x42 },
> -	{ .mbps =  150, .reg = 0x04 },
> -	{ .mbps =  170, .reg = 0x24 },
> -	{ .mbps =  180, .reg = 0x44 },
> -	{ .mbps =  200, .reg = 0x06 },
> -	{ .mbps =  220, .reg = 0x26 },
> -	{ .mbps =  240, .reg = 0x46 },
> -	{ .mbps =  250, .reg = 0x08 },
> -	{ .mbps =  270, .reg = 0x28 },
> -	{ .mbps =  300, .reg = 0x0a },
> -	{ .mbps =  330, .reg = 0x2a },
> -	{ .mbps =  360, .reg = 0x4a },
> -	{ .mbps =  400, .reg = 0x0c },
> -	{ .mbps =  450, .reg = 0x2c },
> -	{ .mbps =  500, .reg = 0x0e },
> -	{ .mbps =  550, .reg = 0x2e },
> -	{ .mbps =  600, .reg = 0x10 },
> -	{ .mbps =  650, .reg = 0x30 },
> -	{ .mbps =  700, .reg = 0x12 },
> -	{ .mbps =  750, .reg = 0x32 },
> -	{ .mbps =  800, .reg = 0x52 },
> -	{ .mbps =  850, .reg = 0x72 },
> -	{ .mbps =  900, .reg = 0x14 },
> -	{ .mbps =  950, .reg = 0x34 },
> -	{ .mbps = 1000, .reg = 0x54 },
> -	{ .mbps = 1050, .reg = 0x74 },
> +	{ .mbps =   89, .reg = 0x00 },
> +	{ .mbps =   99, .reg = 0x20 },
> +	{ .mbps =  109, .reg = 0x40 },
> +	{ .mbps =  129, .reg = 0x02 },
> +	{ .mbps =  139, .reg = 0x22 },
> +	{ .mbps =  149, .reg = 0x42 },
> +	{ .mbps =  169, .reg = 0x04 },
> +	{ .mbps =  179, .reg = 0x24 },
> +	{ .mbps =  199, .reg = 0x44 },
> +	{ .mbps =  219, .reg = 0x06 },
> +	{ .mbps =  239, .reg = 0x26 },
> +	{ .mbps =  249, .reg = 0x46 },
> +	{ .mbps =  269, .reg = 0x08 },
> +	{ .mbps =  299, .reg = 0x28 },
> +	{ .mbps =  329, .reg = 0x0a },
> +	{ .mbps =  359, .reg = 0x2a },
> +	{ .mbps =  399, .reg = 0x4a },
> +	{ .mbps =  449, .reg = 0x0c },
> +	{ .mbps =  499, .reg = 0x2c },
> +	{ .mbps =  549, .reg = 0x0e },
> +	{ .mbps =  599, .reg = 0x2e },
> +	{ .mbps =  649, .reg = 0x10 },
> +	{ .mbps =  699, .reg = 0x30 },
> +	{ .mbps =  749, .reg = 0x12 },
> +	{ .mbps =  799, .reg = 0x32 },
> +	{ .mbps =  849, .reg = 0x52 },
> +	{ .mbps =  899, .reg = 0x72 },
> +	{ .mbps =  949, .reg = 0x14 },
> +	{ .mbps =  999, .reg = 0x34 },
> +	{ .mbps = 1049, .reg = 0x54 },
> +	{ .mbps = 1099, .reg = 0x74 },
>  	{ .mbps = 1125, .reg = 0x16 },
>  	{ /* sentinel */ },
>  };


-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v4 6/6] media: rcar-csi2: Handle per-SoC number of channels
  2018-11-06 10:54 ` [PATCH v4 6/6] media: rcar-csi2: Handle per-SoC number of channels Jacopo Mondi
@ 2018-11-14 19:56   ` Niklas Söderlund
  0 siblings, 0 replies; 9+ messages in thread
From: Niklas Söderlund @ 2018-11-14 19:56 UTC (permalink / raw)
  To: Jacopo Mondi
  Cc: laurent.pinchart, kieran.bingham, linux-media, linux-renesas-soc

Hi Jacopo,

Thanks for your patch.

On 2018-11-06 11:54:27 +0100, Jacopo Mondi wrote:
> The R-Car CSI-2 interface has a number of selectable 'channels' that
> provides pixel data to the VINs during image acquisition.
> 
> Each channel can be used to match a CSI-2 data type and a CSI-2 virtual
> channel to be routed to output path.
> 
> Different SoCs have different number of channels, with R-Car E3 being the
> notable exception supporting only 2 of them.
> 
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>

Acked-by: Niklas S�derlund <niklas.soderlund+renesas@ragnatech.se>

> 
> ---
> v1 -> v2:
> - Use the num_channels variable to decide if VCDT2 has to be written
>   as suggested by Laurent.
> ---
>  drivers/media/platform/rcar-vin/rcar-csi2.c | 15 ++++++++++++---
>  1 file changed, 12 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/media/platform/rcar-vin/rcar-csi2.c b/drivers/media/platform/rcar-vin/rcar-csi2.c
> index 99f5b76..80ad906 100644
> --- a/drivers/media/platform/rcar-vin/rcar-csi2.c
> +++ b/drivers/media/platform/rcar-vin/rcar-csi2.c
> @@ -342,6 +342,7 @@ struct rcar_csi2_info {
>  	int (*confirm_start)(struct rcar_csi2 *priv);
>  	const struct rcsi2_mbps_reg *hsfreqrange;
>  	unsigned int csi0clkfreqrange;
> +	unsigned int num_channels;
>  	bool clear_ulps;
>  };
>  
> @@ -476,13 +477,14 @@ static int rcsi2_start(struct rcar_csi2 *priv)
>  	format = rcsi2_code_to_fmt(priv->mf.code);
>  
>  	/*
> -	 * Enable all Virtual Channels.
> +	 * Enable all supported CSI-2 channels with virtual channel and
> +	 * data type matching.
>  	 *
>  	 * NOTE: It's not possible to get individual datatype for each
>  	 *       source virtual channel. Once this is possible in V4L2
>  	 *       it should be used here.
>  	 */
> -	for (i = 0; i < 4; i++) {
> +	for (i = 0; i < priv->info->num_channels; i++) {
>  		u32 vcdt_part;
>  
>  		vcdt_part = VCDT_SEL_VC(i) | VCDT_VCDTN_EN | VCDT_SEL_DTN_ON |
> @@ -511,7 +513,8 @@ static int rcsi2_start(struct rcar_csi2 *priv)
>  	rcsi2_write(priv, FLD_REG, FLD_FLD_NUM(2) | FLD_FLD_EN4 |
>  		    FLD_FLD_EN3 | FLD_FLD_EN2 | FLD_FLD_EN);
>  	rcsi2_write(priv, VCDT_REG, vcdt);
> -	rcsi2_write(priv, VCDT2_REG, vcdt2);
> +	if (vcdt2)
> +		rcsi2_write(priv, VCDT2_REG, vcdt2);
>  	/* Lanes are zero indexed. */
>  	rcsi2_write(priv, LSWAP_REG,
>  		    LSWAP_L0SEL(priv->lane_swap[0] - 1) |
> @@ -940,32 +943,38 @@ static const struct rcar_csi2_info rcar_csi2_info_r8a7795 = {
>  	.init_phtw = rcsi2_init_phtw_h3_v3h_m3n,
>  	.hsfreqrange = hsfreqrange_h3_v3h_m3n,
>  	.csi0clkfreqrange = 0x20,
> +	.num_channels = 4,
>  	.clear_ulps = true,
>  };
>  
>  static const struct rcar_csi2_info rcar_csi2_info_r8a7795es1 = {
>  	.hsfreqrange = hsfreqrange_m3w_h3es1,
> +	.num_channels = 4,
>  };
>  
>  static const struct rcar_csi2_info rcar_csi2_info_r8a7796 = {
>  	.hsfreqrange = hsfreqrange_m3w_h3es1,
> +	.num_channels = 4,
>  };
>  
>  static const struct rcar_csi2_info rcar_csi2_info_r8a77965 = {
>  	.init_phtw = rcsi2_init_phtw_h3_v3h_m3n,
>  	.hsfreqrange = hsfreqrange_h3_v3h_m3n,
>  	.csi0clkfreqrange = 0x20,
> +	.num_channels = 4,
>  	.clear_ulps = true,
>  };
>  
>  static const struct rcar_csi2_info rcar_csi2_info_r8a77970 = {
>  	.init_phtw = rcsi2_init_phtw_v3m_e3,
>  	.confirm_start = rcsi2_confirm_start_v3m_e3,
> +	.num_channels = 4,
>  };
>  
>  static const struct rcar_csi2_info rcar_csi2_info_r8a77990 = {
>  	.init_phtw = rcsi2_init_phtw_v3m_e3,
>  	.confirm_start = rcsi2_confirm_start_v3m_e3,
> +	.num_channels = 2,
>  };
>  
>  static const struct of_device_id rcar_csi2_of_table[] = {
> -- 
> 2.7.4
> 

-- 
Regards,
Niklas S�derlund

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2018-11-14 19:56 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-06 10:54 [PATCH v4 0/6] media: rcar-vin: Add support for R-Car E3 Jacopo Mondi
2018-11-06 10:54 ` [PATCH v4 1/6] media: dt-bindings: rcar-vin: Add R8A77990 support Jacopo Mondi
2018-11-06 10:54 ` [PATCH v4 2/6] media: rcar-vin: Add support for R-Car R8A77990 Jacopo Mondi
2018-11-06 10:54 ` [PATCH v4 3/6] media: dt-bindings: rcar-csi2: Add R8A77990 Jacopo Mondi
2018-11-06 10:54 ` [PATCH v4 4/6] media: rcar-csi2: Add R8A77990 support Jacopo Mondi
2018-11-06 10:54 ` [PATCH v4 5/6] media: rcar: rcar-csi2: Update V3M/E3 PHTW tables Jacopo Mondi
2018-11-06 13:22   ` Laurent Pinchart
2018-11-06 10:54 ` [PATCH v4 6/6] media: rcar-csi2: Handle per-SoC number of channels Jacopo Mondi
2018-11-14 19:56   ` Niklas Söderlund

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).