* [PATCH v2 00/10] drm: Add DSI/DP support for Renesas r8a779h0 V4M and grey-hawk board
@ 2024-12-05 13:44 Tomi Valkeinen
2024-12-05 13:44 ` [PATCH v2 01/10] drm/rcar-du: dsi: Fix PHY lock bit check Tomi Valkeinen
` (9 more replies)
0 siblings, 10 replies; 15+ messages in thread
From: Tomi Valkeinen @ 2024-12-05 13:44 UTC (permalink / raw)
To: Laurent Pinchart, Kieran Bingham, Andrzej Hajda, Neil Armstrong,
Robert Foss, Jonas Karlman, Jernej Skrabec, David Airlie,
Simona Vetter, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Geert Uytterhoeven, Magnus Damm, Michael Turquette, Stephen Boyd,
LUU HOAI, Jagan Teki, Sam Ravnborg, Biju Das
Cc: Laurent Pinchart, dri-devel, linux-renesas-soc, devicetree,
linux-kernel, Laurent Pinchart, linux-clk, Tomi Valkeinen, stable,
Krzysztof Kozlowski
Add everything needed to support the DSI output on Renesas r8a779h0
(V4M) SoC, and the DP output (via sn65dsi86 DSI to DP bridge) on the
Renesas grey-hawk board.
Overall the DSI and the board design is almost identical to Renesas
r8a779g0 and white-hawk board.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
---
Changes in v2:
- Add the DT binding with a new conditional block, so that we can set
only the port@0 as required
- Drop port@1 from r8a779h0.dtsi (there's no port@1)
- Add a new patch to write DPTSR only if num_crtcs > 1
- Drop RCAR_DU_FEATURE_NO_DPTSR (not needed anymore)
- Add Cc: stable to the fix, and move it as first patch
- Added the tags from reviews
- Link to v1: https://lore.kernel.org/r/20241203-rcar-gh-dsi-v1-0-738ae1a95d2a@ideasonboard.com
---
Tomi Valkeinen (10):
drm/rcar-du: dsi: Fix PHY lock bit check
drm/rcar-du: Write DPTSR only if there are more than one crtc
dt-bindings: display: bridge: renesas,dsi-csi2-tx: Add r8a779h0
dt-bindings: display: renesas,du: Add r8a779h0
clk: renesas: r8a779h0: Add display clocks
drm/rcar-du: dsi: Add r8a779h0 support
drm/rcar-du: Add support for r8a779h0
arm64: dts: renesas: gray-hawk-single: Fix indentation
arm64: dts: renesas: r8a779h0: Add display support
arm64: dts: renesas: gray-hawk-single: Add DisplayPort support
.../display/bridge/renesas,dsi-csi2-tx.yaml | 1 +
.../devicetree/bindings/display/renesas,du.yaml | 52 ++++++++-
.../boot/dts/renesas/r8a779h0-gray-hawk-single.dts | 119 ++++++++++++++++++---
arch/arm64/boot/dts/renesas/r8a779h0.dtsi | 73 +++++++++++++
drivers/clk/renesas/r8a779h0-cpg-mssr.c | 4 +
drivers/gpu/drm/renesas/rcar-du/rcar_du_drv.c | 18 ++++
drivers/gpu/drm/renesas/rcar-du/rcar_du_group.c | 16 +--
drivers/gpu/drm/renesas/rcar-du/rcar_mipi_dsi.c | 4 +-
.../gpu/drm/renesas/rcar-du/rcar_mipi_dsi_regs.h | 1 -
9 files changed, 264 insertions(+), 24 deletions(-)
---
base-commit: adc218676eef25575469234709c2d87185ca223a
change-id: 20241008-rcar-gh-dsi-9c01f5deeac8
Best regards,
--
Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH v2 01/10] drm/rcar-du: dsi: Fix PHY lock bit check
2024-12-05 13:44 [PATCH v2 00/10] drm: Add DSI/DP support for Renesas r8a779h0 V4M and grey-hawk board Tomi Valkeinen
@ 2024-12-05 13:44 ` Tomi Valkeinen
2024-12-05 13:44 ` [PATCH v2 02/10] drm/rcar-du: Write DPTSR only if there are more than one crtc Tomi Valkeinen
` (8 subsequent siblings)
9 siblings, 0 replies; 15+ messages in thread
From: Tomi Valkeinen @ 2024-12-05 13:44 UTC (permalink / raw)
To: Laurent Pinchart, Kieran Bingham, Andrzej Hajda, Neil Armstrong,
Robert Foss, Jonas Karlman, Jernej Skrabec, David Airlie,
Simona Vetter, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Geert Uytterhoeven, Magnus Damm, Michael Turquette, Stephen Boyd,
LUU HOAI, Jagan Teki, Sam Ravnborg, Biju Das
Cc: Laurent Pinchart, dri-devel, linux-renesas-soc, devicetree,
linux-kernel, Laurent Pinchart, linux-clk, Tomi Valkeinen, stable
From: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
The driver checks for bit 16 (using CLOCKSET1_LOCK define) in CLOCKSET1
register when waiting for the PPI clock. However, the right bit to check
is bit 17 (CLOCKSET1_LOCK_PHY define). Not only that, but there's
nothing in the documents for bit 16 for V3U nor V4H.
So, fix the check to use bit 17, and drop the define for bit 16.
Fixes: 155358310f01 ("drm: rcar-du: Add R-Car DSI driver")
Fixes: 11696c5e8924 ("drm: Place Renesas drivers in a separate dir")
Cc: stable@vger.kernel.org
Signed-off-by: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
drivers/gpu/drm/renesas/rcar-du/rcar_mipi_dsi.c | 2 +-
drivers/gpu/drm/renesas/rcar-du/rcar_mipi_dsi_regs.h | 1 -
2 files changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_mipi_dsi.c b/drivers/gpu/drm/renesas/rcar-du/rcar_mipi_dsi.c
index 2dba7c5ffd2c..92f4261305bd 100644
--- a/drivers/gpu/drm/renesas/rcar-du/rcar_mipi_dsi.c
+++ b/drivers/gpu/drm/renesas/rcar-du/rcar_mipi_dsi.c
@@ -587,7 +587,7 @@ static int rcar_mipi_dsi_startup(struct rcar_mipi_dsi *dsi,
for (timeout = 10; timeout > 0; --timeout) {
if ((rcar_mipi_dsi_read(dsi, PPICLSR) & PPICLSR_STPST) &&
(rcar_mipi_dsi_read(dsi, PPIDLSR) & PPIDLSR_STPST) &&
- (rcar_mipi_dsi_read(dsi, CLOCKSET1) & CLOCKSET1_LOCK))
+ (rcar_mipi_dsi_read(dsi, CLOCKSET1) & CLOCKSET1_LOCK_PHY))
break;
usleep_range(1000, 2000);
diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_mipi_dsi_regs.h b/drivers/gpu/drm/renesas/rcar-du/rcar_mipi_dsi_regs.h
index f8114d11f2d1..a6b276f1d6ee 100644
--- a/drivers/gpu/drm/renesas/rcar-du/rcar_mipi_dsi_regs.h
+++ b/drivers/gpu/drm/renesas/rcar-du/rcar_mipi_dsi_regs.h
@@ -142,7 +142,6 @@
#define CLOCKSET1 0x101c
#define CLOCKSET1_LOCK_PHY (1 << 17)
-#define CLOCKSET1_LOCK (1 << 16)
#define CLOCKSET1_CLKSEL (1 << 8)
#define CLOCKSET1_CLKINSEL_EXTAL (0 << 2)
#define CLOCKSET1_CLKINSEL_DIG (1 << 2)
--
2.43.0
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH v2 02/10] drm/rcar-du: Write DPTSR only if there are more than one crtc
2024-12-05 13:44 [PATCH v2 00/10] drm: Add DSI/DP support for Renesas r8a779h0 V4M and grey-hawk board Tomi Valkeinen
2024-12-05 13:44 ` [PATCH v2 01/10] drm/rcar-du: dsi: Fix PHY lock bit check Tomi Valkeinen
@ 2024-12-05 13:44 ` Tomi Valkeinen
2024-12-05 14:16 ` Geert Uytterhoeven
2024-12-05 13:44 ` [PATCH v2 03/10] dt-bindings: display: bridge: renesas,dsi-csi2-tx: Add r8a779h0 Tomi Valkeinen
` (7 subsequent siblings)
9 siblings, 1 reply; 15+ messages in thread
From: Tomi Valkeinen @ 2024-12-05 13:44 UTC (permalink / raw)
To: Laurent Pinchart, Kieran Bingham, Andrzej Hajda, Neil Armstrong,
Robert Foss, Jonas Karlman, Jernej Skrabec, David Airlie,
Simona Vetter, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Geert Uytterhoeven, Magnus Damm, Michael Turquette, Stephen Boyd,
LUU HOAI, Jagan Teki, Sam Ravnborg, Biju Das
Cc: Laurent Pinchart, dri-devel, linux-renesas-soc, devicetree,
linux-kernel, Laurent Pinchart, linux-clk, Tomi Valkeinen
From: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
Currently the driver always writes DPTSR when setting up the hardware.
However, the register is only meaningful when there are more than one
crtc, and the only SoC with one crtc, V3M, does not have the register
mentioned in its documentation.
So move the write behind a condition.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
---
drivers/gpu/drm/renesas/rcar-du/rcar_du_group.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_du_group.c b/drivers/gpu/drm/renesas/rcar-du/rcar_du_group.c
index 2ccd2581f544..0fbf6abbde6e 100644
--- a/drivers/gpu/drm/renesas/rcar-du/rcar_du_group.c
+++ b/drivers/gpu/drm/renesas/rcar-du/rcar_du_group.c
@@ -185,11 +185,13 @@ static void rcar_du_group_setup(struct rcar_du_group *rgrp)
dorcr |= DORCR_PG1T | DORCR_DK1S | DORCR_PG1D_DS1;
rcar_du_group_write(rgrp, DORCR, dorcr);
- /* Apply planes to CRTCs association. */
- mutex_lock(&rgrp->lock);
- rcar_du_group_write(rgrp, DPTSR, (rgrp->dptsr_planes << 16) |
- rgrp->dptsr_planes);
- mutex_unlock(&rgrp->lock);
+ if (rgrp->num_crtcs > 1) {
+ /* Apply planes to CRTCs association. */
+ mutex_lock(&rgrp->lock);
+ rcar_du_group_write(rgrp, DPTSR, (rgrp->dptsr_planes << 16) |
+ rgrp->dptsr_planes);
+ mutex_unlock(&rgrp->lock);
+ }
}
/*
--
2.43.0
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH v2 03/10] dt-bindings: display: bridge: renesas,dsi-csi2-tx: Add r8a779h0
2024-12-05 13:44 [PATCH v2 00/10] drm: Add DSI/DP support for Renesas r8a779h0 V4M and grey-hawk board Tomi Valkeinen
2024-12-05 13:44 ` [PATCH v2 01/10] drm/rcar-du: dsi: Fix PHY lock bit check Tomi Valkeinen
2024-12-05 13:44 ` [PATCH v2 02/10] drm/rcar-du: Write DPTSR only if there are more than one crtc Tomi Valkeinen
@ 2024-12-05 13:44 ` Tomi Valkeinen
2024-12-05 13:44 ` [PATCH v2 04/10] dt-bindings: display: renesas,du: " Tomi Valkeinen
` (6 subsequent siblings)
9 siblings, 0 replies; 15+ messages in thread
From: Tomi Valkeinen @ 2024-12-05 13:44 UTC (permalink / raw)
To: Laurent Pinchart, Kieran Bingham, Andrzej Hajda, Neil Armstrong,
Robert Foss, Jonas Karlman, Jernej Skrabec, David Airlie,
Simona Vetter, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Geert Uytterhoeven, Magnus Damm, Michael Turquette, Stephen Boyd,
LUU HOAI, Jagan Teki, Sam Ravnborg, Biju Das
Cc: Laurent Pinchart, dri-devel, linux-renesas-soc, devicetree,
linux-kernel, Laurent Pinchart, linux-clk, Tomi Valkeinen,
Krzysztof Kozlowski
From: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
Extend the Renesas DSI display bindings to support the r8a779h0 V4M.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
.../devicetree/bindings/display/bridge/renesas,dsi-csi2-tx.yaml | 1 +
1 file changed, 1 insertion(+)
diff --git a/Documentation/devicetree/bindings/display/bridge/renesas,dsi-csi2-tx.yaml b/Documentation/devicetree/bindings/display/bridge/renesas,dsi-csi2-tx.yaml
index d33026f85e19..c167795c63f6 100644
--- a/Documentation/devicetree/bindings/display/bridge/renesas,dsi-csi2-tx.yaml
+++ b/Documentation/devicetree/bindings/display/bridge/renesas,dsi-csi2-tx.yaml
@@ -19,6 +19,7 @@ properties:
enum:
- renesas,r8a779a0-dsi-csi2-tx # for V3U
- renesas,r8a779g0-dsi-csi2-tx # for V4H
+ - renesas,r8a779h0-dsi-csi2-tx # for V4M
reg:
maxItems: 1
--
2.43.0
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH v2 04/10] dt-bindings: display: renesas,du: Add r8a779h0
2024-12-05 13:44 [PATCH v2 00/10] drm: Add DSI/DP support for Renesas r8a779h0 V4M and grey-hawk board Tomi Valkeinen
` (2 preceding siblings ...)
2024-12-05 13:44 ` [PATCH v2 03/10] dt-bindings: display: bridge: renesas,dsi-csi2-tx: Add r8a779h0 Tomi Valkeinen
@ 2024-12-05 13:44 ` Tomi Valkeinen
2024-12-05 13:45 ` [PATCH v2 05/10] clk: renesas: r8a779h0: Add display clocks Tomi Valkeinen
` (5 subsequent siblings)
9 siblings, 0 replies; 15+ messages in thread
From: Tomi Valkeinen @ 2024-12-05 13:44 UTC (permalink / raw)
To: Laurent Pinchart, Kieran Bingham, Andrzej Hajda, Neil Armstrong,
Robert Foss, Jonas Karlman, Jernej Skrabec, David Airlie,
Simona Vetter, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Geert Uytterhoeven, Magnus Damm, Michael Turquette, Stephen Boyd,
LUU HOAI, Jagan Teki, Sam Ravnborg, Biju Das
Cc: Laurent Pinchart, dri-devel, linux-renesas-soc, devicetree,
linux-kernel, Laurent Pinchart, linux-clk, Tomi Valkeinen
From: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
Extend the Renesas DU display bindings to support the r8a779h0 V4M.
Note that we remove the requirement for two ports from the global part
of the bindings, as each conditional part defines the number of required
ports already. This came up with r8a779h0 as it's the first one that has
only one port.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
.../devicetree/bindings/display/renesas,du.yaml | 52 ++++++++++++++++++++--
1 file changed, 48 insertions(+), 4 deletions(-)
diff --git a/Documentation/devicetree/bindings/display/renesas,du.yaml b/Documentation/devicetree/bindings/display/renesas,du.yaml
index c5b9e6812bce..7dec47aea052 100644
--- a/Documentation/devicetree/bindings/display/renesas,du.yaml
+++ b/Documentation/devicetree/bindings/display/renesas,du.yaml
@@ -41,6 +41,7 @@ properties:
- renesas,du-r8a77995 # for R-Car D3 compatible DU
- renesas,du-r8a779a0 # for R-Car V3U compatible DU
- renesas,du-r8a779g0 # for R-Car V4H compatible DU
+ - renesas,du-r8a779h0 # for R-Car V4M compatible DU
reg:
maxItems: 1
@@ -69,10 +70,6 @@ properties:
$ref: /schemas/graph.yaml#/properties/port
unevaluatedProperties: false
- required:
- - port@0
- - port@1
-
unevaluatedProperties: false
renesas,cmms:
@@ -807,6 +804,53 @@ allOf:
- reset-names
- renesas,vsps
+ - if:
+ properties:
+ compatible:
+ contains:
+ enum:
+ - renesas,du-r8a779h0
+ then:
+ properties:
+ clocks:
+ items:
+ - description: Functional clock
+
+ clock-names:
+ items:
+ - const: du.0
+
+ interrupts:
+ maxItems: 1
+
+ resets:
+ maxItems: 1
+
+ reset-names:
+ items:
+ - const: du.0
+
+ ports:
+ properties:
+ port@0:
+ description: DSI 0
+ port@1: false
+ port@2: false
+ port@3: false
+
+ required:
+ - port@0
+
+ renesas,vsps:
+ minItems: 1
+
+ required:
+ - clock-names
+ - interrupts
+ - resets
+ - reset-names
+ - renesas,vsps
+
additionalProperties: false
examples:
--
2.43.0
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH v2 05/10] clk: renesas: r8a779h0: Add display clocks
2024-12-05 13:44 [PATCH v2 00/10] drm: Add DSI/DP support for Renesas r8a779h0 V4M and grey-hawk board Tomi Valkeinen
` (3 preceding siblings ...)
2024-12-05 13:44 ` [PATCH v2 04/10] dt-bindings: display: renesas,du: " Tomi Valkeinen
@ 2024-12-05 13:45 ` Tomi Valkeinen
2024-12-05 13:45 ` [PATCH v2 06/10] drm/rcar-du: dsi: Add r8a779h0 support Tomi Valkeinen
` (4 subsequent siblings)
9 siblings, 0 replies; 15+ messages in thread
From: Tomi Valkeinen @ 2024-12-05 13:45 UTC (permalink / raw)
To: Laurent Pinchart, Kieran Bingham, Andrzej Hajda, Neil Armstrong,
Robert Foss, Jonas Karlman, Jernej Skrabec, David Airlie,
Simona Vetter, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Geert Uytterhoeven, Magnus Damm, Michael Turquette, Stephen Boyd,
LUU HOAI, Jagan Teki, Sam Ravnborg, Biju Das
Cc: Laurent Pinchart, dri-devel, linux-renesas-soc, devicetree,
linux-kernel, Laurent Pinchart, linux-clk, Tomi Valkeinen
From: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
Add display related clocks for DU, DSI, FCPVD, and VSPD.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
drivers/clk/renesas/r8a779h0-cpg-mssr.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/clk/renesas/r8a779h0-cpg-mssr.c b/drivers/clk/renesas/r8a779h0-cpg-mssr.c
index e20c048bfa9b..dc37e987c0e6 100644
--- a/drivers/clk/renesas/r8a779h0-cpg-mssr.c
+++ b/drivers/clk/renesas/r8a779h0-cpg-mssr.c
@@ -179,6 +179,9 @@ static const struct mssr_mod_clk r8a779h0_mod_clks[] __initconst = {
DEF_MOD("canfd0", 328, R8A779H0_CLK_SASYNCPERD2),
DEF_MOD("csi40", 331, R8A779H0_CLK_CSI),
DEF_MOD("csi41", 400, R8A779H0_CLK_CSI),
+ DEF_MOD("dis0", 411, R8A779H0_CLK_S0D3),
+ DEF_MOD("dsitxlink0", 415, R8A779H0_CLK_DSIREF),
+ DEF_MOD("fcpvd0", 508, R8A779H0_CLK_S0D3),
DEF_MOD("hscif0", 514, R8A779H0_CLK_SASYNCPERD1),
DEF_MOD("hscif1", 515, R8A779H0_CLK_SASYNCPERD1),
DEF_MOD("hscif2", 516, R8A779H0_CLK_SASYNCPERD1),
@@ -227,6 +230,7 @@ static const struct mssr_mod_clk r8a779h0_mod_clks[] __initconst = {
DEF_MOD("vin15", 811, R8A779H0_CLK_S0D4_VIO),
DEF_MOD("vin16", 812, R8A779H0_CLK_S0D4_VIO),
DEF_MOD("vin17", 813, R8A779H0_CLK_S0D4_VIO),
+ DEF_MOD("vspd0", 830, R8A779H0_CLK_S0D1_VIO),
DEF_MOD("wdt1:wdt0", 907, R8A779H0_CLK_R),
DEF_MOD("cmt0", 910, R8A779H0_CLK_R),
DEF_MOD("cmt1", 911, R8A779H0_CLK_R),
--
2.43.0
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH v2 06/10] drm/rcar-du: dsi: Add r8a779h0 support
2024-12-05 13:44 [PATCH v2 00/10] drm: Add DSI/DP support for Renesas r8a779h0 V4M and grey-hawk board Tomi Valkeinen
` (4 preceding siblings ...)
2024-12-05 13:45 ` [PATCH v2 05/10] clk: renesas: r8a779h0: Add display clocks Tomi Valkeinen
@ 2024-12-05 13:45 ` Tomi Valkeinen
2024-12-05 13:45 ` [PATCH v2 07/10] drm/rcar-du: Add support for r8a779h0 Tomi Valkeinen
` (3 subsequent siblings)
9 siblings, 0 replies; 15+ messages in thread
From: Tomi Valkeinen @ 2024-12-05 13:45 UTC (permalink / raw)
To: Laurent Pinchart, Kieran Bingham, Andrzej Hajda, Neil Armstrong,
Robert Foss, Jonas Karlman, Jernej Skrabec, David Airlie,
Simona Vetter, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Geert Uytterhoeven, Magnus Damm, Michael Turquette, Stephen Boyd,
LUU HOAI, Jagan Teki, Sam Ravnborg, Biju Das
Cc: Laurent Pinchart, dri-devel, linux-renesas-soc, devicetree,
linux-kernel, Laurent Pinchart, linux-clk, Tomi Valkeinen
From: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
Add support for DSI on r8a779h0. As it is identical to DSI on r8a779g0,
all we need is to handle the compatible string.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
drivers/gpu/drm/renesas/rcar-du/rcar_mipi_dsi.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_mipi_dsi.c b/drivers/gpu/drm/renesas/rcar-du/rcar_mipi_dsi.c
index 92f4261305bd..36e902601f84 100644
--- a/drivers/gpu/drm/renesas/rcar-du/rcar_mipi_dsi.c
+++ b/drivers/gpu/drm/renesas/rcar-du/rcar_mipi_dsi.c
@@ -1081,6 +1081,8 @@ static const struct rcar_mipi_dsi_device_info v4h_data = {
static const struct of_device_id rcar_mipi_dsi_of_table[] = {
{ .compatible = "renesas,r8a779a0-dsi-csi2-tx", .data = &v3u_data },
{ .compatible = "renesas,r8a779g0-dsi-csi2-tx", .data = &v4h_data },
+ /* DSI in r8a779h0 is identical to r8a779g0 */
+ { .compatible = "renesas,r8a779h0-dsi-csi2-tx", .data = &v4h_data },
{ }
};
--
2.43.0
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH v2 07/10] drm/rcar-du: Add support for r8a779h0
2024-12-05 13:44 [PATCH v2 00/10] drm: Add DSI/DP support for Renesas r8a779h0 V4M and grey-hawk board Tomi Valkeinen
` (5 preceding siblings ...)
2024-12-05 13:45 ` [PATCH v2 06/10] drm/rcar-du: dsi: Add r8a779h0 support Tomi Valkeinen
@ 2024-12-05 13:45 ` Tomi Valkeinen
2024-12-05 19:08 ` Laurent Pinchart
2024-12-05 13:45 ` [PATCH v2 08/10] arm64: dts: renesas: gray-hawk-single: Fix indentation Tomi Valkeinen
` (2 subsequent siblings)
9 siblings, 1 reply; 15+ messages in thread
From: Tomi Valkeinen @ 2024-12-05 13:45 UTC (permalink / raw)
To: Laurent Pinchart, Kieran Bingham, Andrzej Hajda, Neil Armstrong,
Robert Foss, Jonas Karlman, Jernej Skrabec, David Airlie,
Simona Vetter, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Geert Uytterhoeven, Magnus Damm, Michael Turquette, Stephen Boyd,
LUU HOAI, Jagan Teki, Sam Ravnborg, Biju Das
Cc: Laurent Pinchart, dri-devel, linux-renesas-soc, devicetree,
linux-kernel, Laurent Pinchart, linux-clk, Tomi Valkeinen
From: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
Add support for r8a779h0. It is very similar to r8a779g0, but has only
one output.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
drivers/gpu/drm/renesas/rcar-du/rcar_du_drv.c | 18 ++++++++++++++++++
drivers/gpu/drm/renesas/rcar-du/rcar_du_group.c | 4 +++-
2 files changed, 21 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_du_drv.c b/drivers/gpu/drm/renesas/rcar-du/rcar_du_drv.c
index fb719d9aff10..7858e10839f2 100644
--- a/drivers/gpu/drm/renesas/rcar-du/rcar_du_drv.c
+++ b/drivers/gpu/drm/renesas/rcar-du/rcar_du_drv.c
@@ -545,6 +545,23 @@ static const struct rcar_du_device_info rcar_du_r8a779g0_info = {
.dsi_clk_mask = BIT(1) | BIT(0),
};
+static const struct rcar_du_device_info rcar_du_r8a779h0_info = {
+ .gen = 4,
+ .features = RCAR_DU_FEATURE_CRTC_IRQ
+ | RCAR_DU_FEATURE_VSP1_SOURCE
+ | RCAR_DU_FEATURE_NO_BLENDING,
+ .channels_mask = BIT(0),
+ .routes = {
+ /* R8A779H0 has one MIPI DSI output. */
+ [RCAR_DU_OUTPUT_DSI0] = {
+ .possible_crtcs = BIT(0),
+ .port = 0,
+ },
+ },
+ .num_rpf = 5,
+ .dsi_clk_mask = BIT(0),
+};
+
static const struct of_device_id rcar_du_of_table[] = {
{ .compatible = "renesas,du-r8a7742", .data = &rcar_du_r8a7790_info },
{ .compatible = "renesas,du-r8a7743", .data = &rzg1_du_r8a7743_info },
@@ -571,6 +588,7 @@ static const struct of_device_id rcar_du_of_table[] = {
{ .compatible = "renesas,du-r8a77995", .data = &rcar_du_r8a7799x_info },
{ .compatible = "renesas,du-r8a779a0", .data = &rcar_du_r8a779a0_info },
{ .compatible = "renesas,du-r8a779g0", .data = &rcar_du_r8a779g0_info },
+ { .compatible = "renesas,du-r8a779h0", .data = &rcar_du_r8a779h0_info },
{ }
};
diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_du_group.c b/drivers/gpu/drm/renesas/rcar-du/rcar_du_group.c
index 0fbf6abbde6e..b9ae6cc43702 100644
--- a/drivers/gpu/drm/renesas/rcar-du/rcar_du_group.c
+++ b/drivers/gpu/drm/renesas/rcar-du/rcar_du_group.c
@@ -107,10 +107,12 @@ static void rcar_du_group_setup_didsr(struct rcar_du_group *rgrp)
*/
rcrtc = rcdu->crtcs;
num_crtcs = rcdu->num_crtcs;
- } else if (rcdu->info->gen >= 3 && rgrp->num_crtcs > 1) {
+ } else if ((rcdu->info->gen == 3 && rgrp->num_crtcs > 1) ||
+ rcdu->info->gen == 4) {
/*
* On Gen3 dot clocks are setup through per-group registers,
* only available when the group has two channels.
+ * On Gen4 the registers are there for single channel too.
*/
rcrtc = &rcdu->crtcs[rgrp->index * 2];
num_crtcs = rgrp->num_crtcs;
--
2.43.0
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH v2 08/10] arm64: dts: renesas: gray-hawk-single: Fix indentation
2024-12-05 13:44 [PATCH v2 00/10] drm: Add DSI/DP support for Renesas r8a779h0 V4M and grey-hawk board Tomi Valkeinen
` (6 preceding siblings ...)
2024-12-05 13:45 ` [PATCH v2 07/10] drm/rcar-du: Add support for r8a779h0 Tomi Valkeinen
@ 2024-12-05 13:45 ` Tomi Valkeinen
2024-12-05 13:45 ` [PATCH v2 09/10] arm64: dts: renesas: r8a779h0: Add display support Tomi Valkeinen
2024-12-05 13:45 ` [PATCH v2 10/10] arm64: dts: renesas: gray-hawk-single: Add DisplayPort support Tomi Valkeinen
9 siblings, 0 replies; 15+ messages in thread
From: Tomi Valkeinen @ 2024-12-05 13:45 UTC (permalink / raw)
To: Laurent Pinchart, Kieran Bingham, Andrzej Hajda, Neil Armstrong,
Robert Foss, Jonas Karlman, Jernej Skrabec, David Airlie,
Simona Vetter, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Geert Uytterhoeven, Magnus Damm, Michael Turquette, Stephen Boyd,
LUU HOAI, Jagan Teki, Sam Ravnborg, Biju Das
Cc: Laurent Pinchart, dri-devel, linux-renesas-soc, devicetree,
linux-kernel, Laurent Pinchart, linux-clk, Tomi Valkeinen
From: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
Fix the indent on the two regulators.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
.../boot/dts/renesas/r8a779h0-gray-hawk-single.dts | 24 +++++++++++-----------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/arch/arm64/boot/dts/renesas/r8a779h0-gray-hawk-single.dts b/arch/arm64/boot/dts/renesas/r8a779h0-gray-hawk-single.dts
index 9a1917b87f61..057f959d67b3 100644
--- a/arch/arm64/boot/dts/renesas/r8a779h0-gray-hawk-single.dts
+++ b/arch/arm64/boot/dts/renesas/r8a779h0-gray-hawk-single.dts
@@ -127,21 +127,21 @@ memory@480000000 {
};
reg_1p8v: regulator-1p8v {
- compatible = "regulator-fixed";
- regulator-name = "fixed-1.8V";
- regulator-min-microvolt = <1800000>;
- regulator-max-microvolt = <1800000>;
- regulator-boot-on;
- regulator-always-on;
+ compatible = "regulator-fixed";
+ regulator-name = "fixed-1.8V";
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ regulator-boot-on;
+ regulator-always-on;
};
reg_3p3v: regulator-3p3v {
- compatible = "regulator-fixed";
- regulator-name = "fixed-3.3V";
- regulator-min-microvolt = <3300000>;
- regulator-max-microvolt = <3300000>;
- regulator-boot-on;
- regulator-always-on;
+ compatible = "regulator-fixed";
+ regulator-name = "fixed-3.3V";
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-boot-on;
+ regulator-always-on;
};
sound_mux: sound-mux {
--
2.43.0
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH v2 09/10] arm64: dts: renesas: r8a779h0: Add display support
2024-12-05 13:44 [PATCH v2 00/10] drm: Add DSI/DP support for Renesas r8a779h0 V4M and grey-hawk board Tomi Valkeinen
` (7 preceding siblings ...)
2024-12-05 13:45 ` [PATCH v2 08/10] arm64: dts: renesas: gray-hawk-single: Fix indentation Tomi Valkeinen
@ 2024-12-05 13:45 ` Tomi Valkeinen
2024-12-05 13:45 ` [PATCH v2 10/10] arm64: dts: renesas: gray-hawk-single: Add DisplayPort support Tomi Valkeinen
9 siblings, 0 replies; 15+ messages in thread
From: Tomi Valkeinen @ 2024-12-05 13:45 UTC (permalink / raw)
To: Laurent Pinchart, Kieran Bingham, Andrzej Hajda, Neil Armstrong,
Robert Foss, Jonas Karlman, Jernej Skrabec, David Airlie,
Simona Vetter, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Geert Uytterhoeven, Magnus Damm, Michael Turquette, Stephen Boyd,
LUU HOAI, Jagan Teki, Sam Ravnborg, Biju Das
Cc: Laurent Pinchart, dri-devel, linux-renesas-soc, devicetree,
linux-kernel, Laurent Pinchart, linux-clk, Tomi Valkeinen
From: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
Add the device nodes for supporting DU and DSI.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
arch/arm64/boot/dts/renesas/r8a779h0.dtsi | 73 +++++++++++++++++++++++++++++++
1 file changed, 73 insertions(+)
diff --git a/arch/arm64/boot/dts/renesas/r8a779h0.dtsi b/arch/arm64/boot/dts/renesas/r8a779h0.dtsi
index 12d8be3fd579..4f97c483fd4b 100644
--- a/arch/arm64/boot/dts/renesas/r8a779h0.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a779h0.dtsi
@@ -1828,6 +1828,50 @@ csi41isp1: endpoint {
};
};
+ fcpvd0: fcp@fea10000 {
+ compatible = "renesas,fcpv";
+ reg = <0 0xfea10000 0 0x200>;
+ clocks = <&cpg CPG_MOD 508>;
+ power-domains = <&sysc R8A779H0_PD_C4>;
+ resets = <&cpg 508>;
+ };
+
+ vspd0: vsp@fea20000 {
+ compatible = "renesas,vsp2";
+ reg = <0 0xfea20000 0 0x8000>;
+ interrupts = <GIC_SPI 546 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&cpg CPG_MOD 830>;
+ power-domains = <&sysc R8A779H0_PD_C4>;
+ resets = <&cpg 830>;
+ renesas,fcp = <&fcpvd0>;
+ };
+
+ du: display@feb00000 {
+ compatible = "renesas,du-r8a779h0";
+ reg = <0 0xfeb00000 0 0x40000>;
+ interrupts = <GIC_SPI 523 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&cpg CPG_MOD 411>;
+ clock-names = "du.0";
+ power-domains = <&sysc R8A779H0_PD_C4>;
+ resets = <&cpg 411>;
+ reset-names = "du.0";
+ renesas,vsps = <&vspd0 0>;
+
+ status = "disabled";
+
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port@0 {
+ reg = <0>;
+ du_out_dsi0: endpoint {
+ remote-endpoint = <&dsi0_in>;
+ };
+ };
+ };
+ };
+
isp0: isp@fed00000 {
compatible = "renesas,r8a779h0-isp",
"renesas,rcar-gen4-isp";
@@ -1996,6 +2040,35 @@ isp1vin15: endpoint {
};
};
+ dsi0: dsi-encoder@fed80000 {
+ compatible = "renesas,r8a779h0-dsi-csi2-tx";
+ reg = <0 0xfed80000 0 0x10000>;
+ clocks = <&cpg CPG_MOD 415>,
+ <&cpg CPG_CORE R8A779H0_CLK_DSIEXT>,
+ <&cpg CPG_CORE R8A779H0_CLK_DSIREF>;
+ clock-names = "fck", "dsi", "pll";
+ power-domains = <&sysc R8A779H0_PD_C4>;
+ resets = <&cpg 415>;
+
+ status = "disabled";
+
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port@0 {
+ reg = <0>;
+ dsi0_in: endpoint {
+ remote-endpoint = <&du_out_dsi0>;
+ };
+ };
+
+ port@1 {
+ reg = <1>;
+ };
+ };
+ };
+
prr: chipid@fff00044 {
compatible = "renesas,prr";
reg = <0 0xfff00044 0 4>;
--
2.43.0
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH v2 10/10] arm64: dts: renesas: gray-hawk-single: Add DisplayPort support
2024-12-05 13:44 [PATCH v2 00/10] drm: Add DSI/DP support for Renesas r8a779h0 V4M and grey-hawk board Tomi Valkeinen
` (8 preceding siblings ...)
2024-12-05 13:45 ` [PATCH v2 09/10] arm64: dts: renesas: r8a779h0: Add display support Tomi Valkeinen
@ 2024-12-05 13:45 ` Tomi Valkeinen
9 siblings, 0 replies; 15+ messages in thread
From: Tomi Valkeinen @ 2024-12-05 13:45 UTC (permalink / raw)
To: Laurent Pinchart, Kieran Bingham, Andrzej Hajda, Neil Armstrong,
Robert Foss, Jonas Karlman, Jernej Skrabec, David Airlie,
Simona Vetter, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Geert Uytterhoeven, Magnus Damm, Michael Turquette, Stephen Boyd,
LUU HOAI, Jagan Teki, Sam Ravnborg, Biju Das
Cc: Laurent Pinchart, dri-devel, linux-renesas-soc, devicetree,
linux-kernel, Laurent Pinchart, linux-clk, Tomi Valkeinen
From: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
Add support for the mini DP output on the Gray Hawk board.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
.../boot/dts/renesas/r8a779h0-gray-hawk-single.dts | 95 ++++++++++++++++++++++
1 file changed, 95 insertions(+)
diff --git a/arch/arm64/boot/dts/renesas/r8a779h0-gray-hawk-single.dts b/arch/arm64/boot/dts/renesas/r8a779h0-gray-hawk-single.dts
index 057f959d67b3..7cdf07b6dde6 100644
--- a/arch/arm64/boot/dts/renesas/r8a779h0-gray-hawk-single.dts
+++ b/arch/arm64/boot/dts/renesas/r8a779h0-gray-hawk-single.dts
@@ -59,6 +59,12 @@ chosen {
stdout-path = "serial0:921600n8";
};
+ sn65dsi86_refclk: clk-x6 {
+ compatible = "fixed-clock";
+ #clock-cells = <0>;
+ clock-frequency = <38400000>;
+ };
+
keys {
compatible = "gpio-keys";
@@ -126,6 +132,27 @@ memory@480000000 {
reg = <0x4 0x80000000 0x1 0x80000000>;
};
+ mini-dp-con {
+ compatible = "dp-connector";
+ label = "CN5";
+ type = "mini";
+
+ port {
+ mini_dp_con_in: endpoint {
+ remote-endpoint = <&sn65dsi86_out0>;
+ };
+ };
+ };
+
+ reg_1p2v: regulator-1p2v {
+ compatible = "regulator-fixed";
+ regulator-name = "fixed-1.2V";
+ regulator-min-microvolt = <1200000>;
+ regulator-max-microvolt = <1200000>;
+ regulator-boot-on;
+ regulator-always-on;
+ };
+
reg_1p8v: regulator-1p8v {
compatible = "regulator-fixed";
regulator-name = "fixed-1.8V";
@@ -200,6 +227,24 @@ channel1 {
};
};
+&dsi0 {
+ status = "okay";
+
+ ports {
+ port@1 {
+ reg = <1>;
+ dsi0_out: endpoint {
+ remote-endpoint = <&sn65dsi86_in0>;
+ data-lanes = <1 2 3 4>;
+ };
+ };
+ };
+};
+
+&du {
+ status = "okay";
+};
+
&extal_clk {
clock-frequency = <16666666>;
};
@@ -269,6 +314,51 @@ eeprom@53 {
};
};
+&i2c1 {
+ pinctrl-0 = <&i2c1_pins>;
+ pinctrl-names = "default";
+
+ status = "okay";
+ clock-frequency = <400000>;
+
+ bridge@2c {
+ compatible = "ti,sn65dsi86";
+ reg = <0x2c>;
+
+ clocks = <&sn65dsi86_refclk>;
+ clock-names = "refclk";
+
+ interrupt-parent = <&intc_ex>;
+ interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
+
+ enable-gpios = <&gpio1 26 GPIO_ACTIVE_HIGH>;
+
+ vccio-supply = <®_1p8v>;
+ vpll-supply = <®_1p8v>;
+ vcca-supply = <®_1p2v>;
+ vcc-supply = <®_1p2v>;
+
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port@0 {
+ reg = <0>;
+ sn65dsi86_in0: endpoint {
+ remote-endpoint = <&dsi0_out>;
+ };
+ };
+
+ port@1 {
+ reg = <1>;
+ sn65dsi86_out0: endpoint {
+ remote-endpoint = <&mini_dp_con_in>;
+ };
+ };
+ };
+ };
+};
+
&i2c3 {
pinctrl-0 = <&i2c3_pins>;
pinctrl-names = "default";
@@ -361,6 +451,11 @@ i2c0_pins: i2c0 {
function = "i2c0";
};
+ i2c1_pins: i2c1 {
+ groups = "i2c1";
+ function = "i2c1";
+ };
+
i2c3_pins: i2c3 {
groups = "i2c3";
function = "i2c3";
--
2.43.0
^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [PATCH v2 02/10] drm/rcar-du: Write DPTSR only if there are more than one crtc
2024-12-05 13:44 ` [PATCH v2 02/10] drm/rcar-du: Write DPTSR only if there are more than one crtc Tomi Valkeinen
@ 2024-12-05 14:16 ` Geert Uytterhoeven
2024-12-05 16:08 ` Tomi Valkeinen
0 siblings, 1 reply; 15+ messages in thread
From: Geert Uytterhoeven @ 2024-12-05 14:16 UTC (permalink / raw)
To: Tomi Valkeinen
Cc: Laurent Pinchart, Kieran Bingham, Andrzej Hajda, Neil Armstrong,
Robert Foss, Jonas Karlman, Jernej Skrabec, David Airlie,
Simona Vetter, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Geert Uytterhoeven, Magnus Damm, Michael Turquette, Stephen Boyd,
LUU HOAI, Jagan Teki, Sam Ravnborg, Biju Das, dri-devel,
linux-renesas-soc, devicetree, linux-kernel, Laurent Pinchart,
linux-clk, Tomi Valkeinen, Jacopo Mondi
Hi Tomi,
CC Jacopo
On Thu, Dec 5, 2024 at 2:45 PM Tomi Valkeinen
<tomi.valkeinen@ideasonboard.com> wrote:
> From: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
>
> Currently the driver always writes DPTSR when setting up the hardware.
> However, the register is only meaningful when there are more than one
> crtc, and the only SoC with one crtc, V3M, does not have the register
> mentioned in its documentation.
R-Car V3H/V3H_2, too.
>
> So move the write behind a condition.
>
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
> ---
> drivers/gpu/drm/renesas/rcar-du/rcar_du_group.c | 12 +++++++-----
> 1 file changed, 7 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_du_group.c b/drivers/gpu/drm/renesas/rcar-du/rcar_du_group.c
> index 2ccd2581f544..0fbf6abbde6e 100644
> --- a/drivers/gpu/drm/renesas/rcar-du/rcar_du_group.c
> +++ b/drivers/gpu/drm/renesas/rcar-du/rcar_du_group.c
> @@ -185,11 +185,13 @@ static void rcar_du_group_setup(struct rcar_du_group *rgrp)
> dorcr |= DORCR_PG1T | DORCR_DK1S | DORCR_PG1D_DS1;
> rcar_du_group_write(rgrp, DORCR, dorcr);
>
> - /* Apply planes to CRTCs association. */
> - mutex_lock(&rgrp->lock);
> - rcar_du_group_write(rgrp, DPTSR, (rgrp->dptsr_planes << 16) |
> - rgrp->dptsr_planes);
> - mutex_unlock(&rgrp->lock);
> + if (rgrp->num_crtcs > 1) {
> + /* Apply planes to CRTCs association. */
> + mutex_lock(&rgrp->lock);
> + rcar_du_group_write(rgrp, DPTSR, (rgrp->dptsr_planes << 16) |
> + rgrp->dptsr_planes);
> + mutex_unlock(&rgrp->lock);
> + }
This is per group, not per DU, right?
The second group on R-Car M3-W/M3-W+ has a single channel, hence no
DPTSR2 register.
The second group on R-Car M3-N has a single channel, but it's actually
the second physical channel in the group, and thus does have DPTSR2.
And apparently we had this discussion before...
https://lore.kernel.org/all/CAMuHMdXxf4oePnyLvp84OhSa+wdehCNJBXnhjYO7-1VxpBJ7eQ@mail.gmail.com
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2 02/10] drm/rcar-du: Write DPTSR only if there are more than one crtc
2024-12-05 14:16 ` Geert Uytterhoeven
@ 2024-12-05 16:08 ` Tomi Valkeinen
2024-12-05 17:34 ` Laurent Pinchart
0 siblings, 1 reply; 15+ messages in thread
From: Tomi Valkeinen @ 2024-12-05 16:08 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Laurent Pinchart, Kieran Bingham, Andrzej Hajda, Neil Armstrong,
Robert Foss, Jonas Karlman, Jernej Skrabec, David Airlie,
Simona Vetter, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Geert Uytterhoeven, Magnus Damm, Michael Turquette, Stephen Boyd,
LUU HOAI, Jagan Teki, Sam Ravnborg, Biju Das, dri-devel,
linux-renesas-soc, devicetree, linux-kernel, Laurent Pinchart,
linux-clk, Tomi Valkeinen, Jacopo Mondi
Hi,
On 05/12/2024 16:16, Geert Uytterhoeven wrote:
> Hi Tomi,
>
> CC Jacopo
>
> On Thu, Dec 5, 2024 at 2:45 PM Tomi Valkeinen
> <tomi.valkeinen@ideasonboard.com> wrote:
>> From: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
>>
>> Currently the driver always writes DPTSR when setting up the hardware.
>> However, the register is only meaningful when there are more than one
>> crtc, and the only SoC with one crtc, V3M, does not have the register
>> mentioned in its documentation.
>
> R-Car V3H/V3H_2, too.
Right... I was looking at the number of outputs, not the number of crtcs
when going through the SoCs.
>
>>
>> So move the write behind a condition.
>>
>> Signed-off-by: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
>> ---
>> drivers/gpu/drm/renesas/rcar-du/rcar_du_group.c | 12 +++++++-----
>> 1 file changed, 7 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_du_group.c b/drivers/gpu/drm/renesas/rcar-du/rcar_du_group.c
>> index 2ccd2581f544..0fbf6abbde6e 100644
>> --- a/drivers/gpu/drm/renesas/rcar-du/rcar_du_group.c
>> +++ b/drivers/gpu/drm/renesas/rcar-du/rcar_du_group.c
>> @@ -185,11 +185,13 @@ static void rcar_du_group_setup(struct rcar_du_group *rgrp)
>> dorcr |= DORCR_PG1T | DORCR_DK1S | DORCR_PG1D_DS1;
>> rcar_du_group_write(rgrp, DORCR, dorcr);
>>
>> - /* Apply planes to CRTCs association. */
>> - mutex_lock(&rgrp->lock);
>> - rcar_du_group_write(rgrp, DPTSR, (rgrp->dptsr_planes << 16) |
>> - rgrp->dptsr_planes);
>> - mutex_unlock(&rgrp->lock);
>> + if (rgrp->num_crtcs > 1) {
>> + /* Apply planes to CRTCs association. */
>> + mutex_lock(&rgrp->lock);
>> + rcar_du_group_write(rgrp, DPTSR, (rgrp->dptsr_planes << 16) |
>> + rgrp->dptsr_planes);
>> + mutex_unlock(&rgrp->lock);
>> + }
>
> This is per group, not per DU, right?
> The second group on R-Car M3-W/M3-W+ has a single channel, hence no
> DPTSR2 register.
> The second group on R-Car M3-N has a single channel, but it's actually
> the second physical channel in the group, and thus does have DPTSR2.
That logic does make sense. So that would be if (rgrp->channels_mask &
BIT(1)) then write DPTSR? And probably add a comment in the code about this.
> And apparently we had this discussion before...
> https://lore.kernel.org/all/CAMuHMdXxf4oePnyLvp84OhSa+wdehCNJBXnhjYO7-1VxpBJ7eQ@mail.gmail.com
Somehow I hadn't even realized Jacopo had sent these before...
Tomi
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2 02/10] drm/rcar-du: Write DPTSR only if there are more than one crtc
2024-12-05 16:08 ` Tomi Valkeinen
@ 2024-12-05 17:34 ` Laurent Pinchart
0 siblings, 0 replies; 15+ messages in thread
From: Laurent Pinchart @ 2024-12-05 17:34 UTC (permalink / raw)
To: Tomi Valkeinen
Cc: Geert Uytterhoeven, Kieran Bingham, Andrzej Hajda, Neil Armstrong,
Robert Foss, Jonas Karlman, Jernej Skrabec, David Airlie,
Simona Vetter, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Geert Uytterhoeven, Magnus Damm, Michael Turquette, Stephen Boyd,
LUU HOAI, Jagan Teki, Sam Ravnborg, Biju Das, dri-devel,
linux-renesas-soc, devicetree, linux-kernel, linux-clk,
Tomi Valkeinen, Jacopo Mondi
On Thu, Dec 05, 2024 at 06:08:24PM +0200, Tomi Valkeinen wrote:
> On 05/12/2024 16:16, Geert Uytterhoeven wrote:
> > Hi Tomi,
> >
> > CC Jacopo
> >
> > On Thu, Dec 5, 2024 at 2:45 PM Tomi Valkeinen wrote:
> >> From: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
> >>
> >> Currently the driver always writes DPTSR when setting up the hardware.
> >> However, the register is only meaningful when there are more than one
> >> crtc, and the only SoC with one crtc, V3M, does not have the register
> >> mentioned in its documentation.
> >
> > R-Car V3H/V3H_2, too.
>
> Right... I was looking at the number of outputs, not the number of crtcs
> when going through the SoCs.
>
> >> So move the write behind a condition.
> >>
> >> Signed-off-by: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
> >> ---
> >> drivers/gpu/drm/renesas/rcar-du/rcar_du_group.c | 12 +++++++-----
> >> 1 file changed, 7 insertions(+), 5 deletions(-)
> >>
> >> diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_du_group.c b/drivers/gpu/drm/renesas/rcar-du/rcar_du_group.c
> >> index 2ccd2581f544..0fbf6abbde6e 100644
> >> --- a/drivers/gpu/drm/renesas/rcar-du/rcar_du_group.c
> >> +++ b/drivers/gpu/drm/renesas/rcar-du/rcar_du_group.c
> >> @@ -185,11 +185,13 @@ static void rcar_du_group_setup(struct rcar_du_group *rgrp)
> >> dorcr |= DORCR_PG1T | DORCR_DK1S | DORCR_PG1D_DS1;
> >> rcar_du_group_write(rgrp, DORCR, dorcr);
> >>
> >> - /* Apply planes to CRTCs association. */
> >> - mutex_lock(&rgrp->lock);
> >> - rcar_du_group_write(rgrp, DPTSR, (rgrp->dptsr_planes << 16) |
> >> - rgrp->dptsr_planes);
> >> - mutex_unlock(&rgrp->lock);
> >> + if (rgrp->num_crtcs > 1) {
> >> + /* Apply planes to CRTCs association. */
> >> + mutex_lock(&rgrp->lock);
> >> + rcar_du_group_write(rgrp, DPTSR, (rgrp->dptsr_planes << 16) |
> >> + rgrp->dptsr_planes);
> >> + mutex_unlock(&rgrp->lock);
> >> + }
> >
> > This is per group, not per DU, right?
> > The second group on R-Car M3-W/M3-W+ has a single channel, hence no
> > DPTSR2 register.
> > The second group on R-Car M3-N has a single channel, but it's actually
> > the second physical channel in the group, and thus does have DPTSR2.
>
> That logic does make sense. So that would be if (rgrp->channels_mask &
> BIT(1)) then write DPTSR? And probably add a comment in the code about this.
>
> > And apparently we had this discussion before...
> > https://lore.kernel.org/all/CAMuHMdXxf4oePnyLvp84OhSa+wdehCNJBXnhjYO7-1VxpBJ7eQ@mail.gmail.com
>
> Somehow I hadn't even realized Jacopo had sent these before...
Oops...
I'll let Jacopo and you decide who will send an updated patch.
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2 07/10] drm/rcar-du: Add support for r8a779h0
2024-12-05 13:45 ` [PATCH v2 07/10] drm/rcar-du: Add support for r8a779h0 Tomi Valkeinen
@ 2024-12-05 19:08 ` Laurent Pinchart
0 siblings, 0 replies; 15+ messages in thread
From: Laurent Pinchart @ 2024-12-05 19:08 UTC (permalink / raw)
To: Tomi Valkeinen
Cc: Kieran Bingham, Andrzej Hajda, Neil Armstrong, Robert Foss,
Jonas Karlman, Jernej Skrabec, David Airlie, Simona Vetter,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Geert Uytterhoeven,
Magnus Damm, Michael Turquette, Stephen Boyd, LUU HOAI,
Jagan Teki, Sam Ravnborg, Biju Das, dri-devel, linux-renesas-soc,
devicetree, linux-kernel, linux-clk, Tomi Valkeinen
Hi Tomi,
Thank you for the patch.
On Thu, Dec 05, 2024 at 03:45:02PM +0200, Tomi Valkeinen wrote:
> From: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
>
> Add support for r8a779h0. It is very similar to r8a779g0, but has only
> one output.
>
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
> Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> ---
> drivers/gpu/drm/renesas/rcar-du/rcar_du_drv.c | 18 ++++++++++++++++++
> drivers/gpu/drm/renesas/rcar-du/rcar_du_group.c | 4 +++-
> 2 files changed, 21 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_du_drv.c b/drivers/gpu/drm/renesas/rcar-du/rcar_du_drv.c
> index fb719d9aff10..7858e10839f2 100644
> --- a/drivers/gpu/drm/renesas/rcar-du/rcar_du_drv.c
> +++ b/drivers/gpu/drm/renesas/rcar-du/rcar_du_drv.c
> @@ -545,6 +545,23 @@ static const struct rcar_du_device_info rcar_du_r8a779g0_info = {
> .dsi_clk_mask = BIT(1) | BIT(0),
> };
>
> +static const struct rcar_du_device_info rcar_du_r8a779h0_info = {
> + .gen = 4,
> + .features = RCAR_DU_FEATURE_CRTC_IRQ
> + | RCAR_DU_FEATURE_VSP1_SOURCE
> + | RCAR_DU_FEATURE_NO_BLENDING,
> + .channels_mask = BIT(0),
> + .routes = {
> + /* R8A779H0 has one MIPI DSI output. */
> + [RCAR_DU_OUTPUT_DSI0] = {
> + .possible_crtcs = BIT(0),
> + .port = 0,
> + },
> + },
> + .num_rpf = 5,
> + .dsi_clk_mask = BIT(0),
> +};
> +
> static const struct of_device_id rcar_du_of_table[] = {
> { .compatible = "renesas,du-r8a7742", .data = &rcar_du_r8a7790_info },
> { .compatible = "renesas,du-r8a7743", .data = &rzg1_du_r8a7743_info },
> @@ -571,6 +588,7 @@ static const struct of_device_id rcar_du_of_table[] = {
> { .compatible = "renesas,du-r8a77995", .data = &rcar_du_r8a7799x_info },
> { .compatible = "renesas,du-r8a779a0", .data = &rcar_du_r8a779a0_info },
> { .compatible = "renesas,du-r8a779g0", .data = &rcar_du_r8a779g0_info },
> + { .compatible = "renesas,du-r8a779h0", .data = &rcar_du_r8a779h0_info },
> { }
> };
>
> diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_du_group.c b/drivers/gpu/drm/renesas/rcar-du/rcar_du_group.c
> index 0fbf6abbde6e..b9ae6cc43702 100644
> --- a/drivers/gpu/drm/renesas/rcar-du/rcar_du_group.c
> +++ b/drivers/gpu/drm/renesas/rcar-du/rcar_du_group.c
> @@ -107,10 +107,12 @@ static void rcar_du_group_setup_didsr(struct rcar_du_group *rgrp)
> */
> rcrtc = rcdu->crtcs;
> num_crtcs = rcdu->num_crtcs;
> - } else if (rcdu->info->gen >= 3 && rgrp->num_crtcs > 1) {
> + } else if ((rcdu->info->gen == 3 && rgrp->num_crtcs > 1) ||
> + rcdu->info->gen == 4) {
> /*
> * On Gen3 dot clocks are setup through per-group registers,
> * only available when the group has two channels.
> + * On Gen4 the registers are there for single channel too.
> */
> rcrtc = &rcdu->crtcs[rgrp->index * 2];
> num_crtcs = rgrp->num_crtcs;
>
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2024-12-05 19:09 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-05 13:44 [PATCH v2 00/10] drm: Add DSI/DP support for Renesas r8a779h0 V4M and grey-hawk board Tomi Valkeinen
2024-12-05 13:44 ` [PATCH v2 01/10] drm/rcar-du: dsi: Fix PHY lock bit check Tomi Valkeinen
2024-12-05 13:44 ` [PATCH v2 02/10] drm/rcar-du: Write DPTSR only if there are more than one crtc Tomi Valkeinen
2024-12-05 14:16 ` Geert Uytterhoeven
2024-12-05 16:08 ` Tomi Valkeinen
2024-12-05 17:34 ` Laurent Pinchart
2024-12-05 13:44 ` [PATCH v2 03/10] dt-bindings: display: bridge: renesas,dsi-csi2-tx: Add r8a779h0 Tomi Valkeinen
2024-12-05 13:44 ` [PATCH v2 04/10] dt-bindings: display: renesas,du: " Tomi Valkeinen
2024-12-05 13:45 ` [PATCH v2 05/10] clk: renesas: r8a779h0: Add display clocks Tomi Valkeinen
2024-12-05 13:45 ` [PATCH v2 06/10] drm/rcar-du: dsi: Add r8a779h0 support Tomi Valkeinen
2024-12-05 13:45 ` [PATCH v2 07/10] drm/rcar-du: Add support for r8a779h0 Tomi Valkeinen
2024-12-05 19:08 ` Laurent Pinchart
2024-12-05 13:45 ` [PATCH v2 08/10] arm64: dts: renesas: gray-hawk-single: Fix indentation Tomi Valkeinen
2024-12-05 13:45 ` [PATCH v2 09/10] arm64: dts: renesas: r8a779h0: Add display support Tomi Valkeinen
2024-12-05 13:45 ` [PATCH v2 10/10] arm64: dts: renesas: gray-hawk-single: Add DisplayPort support Tomi Valkeinen
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).