linux-clk.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/15] drm/rockchip: add display support for rk3368
@ 2018-12-17 12:36 Heiko Stuebner
  2018-12-17 12:36 ` [PATCH 01/15] clk: rockchip: add clock ids for dphy rx and tx channels on rk3368 Heiko Stuebner
                   ` (14 more replies)
  0 siblings, 15 replies; 21+ messages in thread
From: Heiko Stuebner @ 2018-12-17 12:36 UTC (permalink / raw)
  To: linux-rockchip, hjc
  Cc: linux-arm-kernel, linux-kernel, devicetree, dri-devel, robh+dt,
	mark.rutland, architt, a.hajda, Laurent.pinchart, linux-clk,
	Heiko Stuebner

This ties together the last lose ends to make display support
work on rk3368 and includes some missing clock exports,
compatible values+settings for the specific encoder drivers
and quite a number of dt-changes enabling power-domains first
and then adding the display stuff.

The core rk3368 support for powerdomains and the vop is in the
kernel for quite a while already but hasn't been used so far.


Heiko Stuebner (15):
  clk: rockchip: add clock ids for dphy rx and tx channels on rk3368
  clk: rockchip: add clock id 24m dsi clock on rk3368
  clk: rockchip: use clock ids for dphy rx and tx on rk3368
  clk: rockchip: use clock id for 24m dsi on rk3368
  drm/rockchip: dw_hdmi: add support for rk3368
  drm/rockchip: analogix_dp: add support for the rk3368 variant
  drm/rockchip: dw-mipi-dsi: add support for rk3368-variant
  arm64: dts: rockchip: default values for core clocks on rk3368
  arm64: dts: rockchip: add power-domain nodes on rk3368
  arm64: dts: rockchip: add dw-hdmi controller on rk3368
  arm64: dts: rockchip: add analogix-dp controller on rk3368
  arm64: dts: rockchip: add dw-mipi-dsi controller on rk3368
  arm64: dts: rockchip: add core display support for rk3368
  arm64: dts: rockchip: enable display on rk3368-r88
  arm64: defconfig: enable hym8563 rtc driver

 .../display/rockchip/analogix_dp-rockchip.txt |   1 +
 .../display/rockchip/dw_hdmi-rockchip.txt     |   1 +
 .../display/rockchip/dw_mipi_dsi_rockchip.txt |   1 +
 arch/arm64/boot/dts/rockchip/rk3368-r88.dts   |  17 +
 arch/arm64/boot/dts/rockchip/rk3368.dtsi      | 309 ++++++++++++++++++
 arch/arm64/configs/defconfig                  |   1 +
 drivers/clk/rockchip/clk-rk3368.c             |   6 +-
 .../gpu/drm/rockchip/analogix_dp-rockchip.c   |  17 +-
 .../gpu/drm/rockchip/dw-mipi-dsi-rockchip.c   |  25 +-
 drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c   |  15 +
 include/dt-bindings/clock/rk3368-cru.h        |   3 +
 11 files changed, 387 insertions(+), 9 deletions(-)

-- 
2.19.2


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

* [PATCH 01/15] clk: rockchip: add clock ids for dphy rx and tx channels on rk3368
  2018-12-17 12:36 [PATCH 00/15] drm/rockchip: add display support for rk3368 Heiko Stuebner
@ 2018-12-17 12:36 ` Heiko Stuebner
  2018-12-20 21:37   ` Rob Herring
  2018-12-17 12:36 ` [PATCH 02/15] clk: rockchip: add clock id 24m dsi clock " Heiko Stuebner
                   ` (13 subsequent siblings)
  14 siblings, 1 reply; 21+ messages in thread
From: Heiko Stuebner @ 2018-12-17 12:36 UTC (permalink / raw)
  To: linux-rockchip, hjc
  Cc: linux-arm-kernel, linux-kernel, devicetree, dri-devel, robh+dt,
	mark.rutland, architt, a.hajda, Laurent.pinchart, linux-clk,
	Heiko Stuebner

Add the clock ids so that they can be exported from the clock driver
and referenced in the rk3368 devicetree.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
---
 include/dt-bindings/clock/rk3368-cru.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/dt-bindings/clock/rk3368-cru.h b/include/dt-bindings/clock/rk3368-cru.h
index a0063ed7284a..a4ed1f094da8 100644
--- a/include/dt-bindings/clock/rk3368-cru.h
+++ b/include/dt-bindings/clock/rk3368-cru.h
@@ -157,6 +157,8 @@
 #define PCLK_VIP		367
 #define PCLK_WDT		368
 #define PCLK_EFUSE256		369
+#define PCLK_DPHYRX		370
+#define PCLK_DPHYTX		371
 
 /* hclk gates */
 #define HCLK_SFC		448
-- 
2.19.2


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

* [PATCH 02/15] clk: rockchip: add clock id 24m dsi clock on rk3368
  2018-12-17 12:36 [PATCH 00/15] drm/rockchip: add display support for rk3368 Heiko Stuebner
  2018-12-17 12:36 ` [PATCH 01/15] clk: rockchip: add clock ids for dphy rx and tx channels on rk3368 Heiko Stuebner
@ 2018-12-17 12:36 ` Heiko Stuebner
  2018-12-20 21:37   ` Rob Herring
  2018-12-17 12:36 ` [PATCH 03/15] clk: rockchip: use clock ids for dphy rx and tx " Heiko Stuebner
                   ` (12 subsequent siblings)
  14 siblings, 1 reply; 21+ messages in thread
From: Heiko Stuebner @ 2018-12-17 12:36 UTC (permalink / raw)
  To: linux-rockchip, hjc
  Cc: linux-arm-kernel, linux-kernel, devicetree, dri-devel, robh+dt,
	mark.rutland, architt, a.hajda, Laurent.pinchart, linux-clk,
	Heiko Stuebner

Needed as input for the dsi controller.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
---
 include/dt-bindings/clock/rk3368-cru.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/dt-bindings/clock/rk3368-cru.h b/include/dt-bindings/clock/rk3368-cru.h
index a4ed1f094da8..04fbcd92adc0 100644
--- a/include/dt-bindings/clock/rk3368-cru.h
+++ b/include/dt-bindings/clock/rk3368-cru.h
@@ -87,6 +87,7 @@
 #define SCLK_TIMER13		136
 #define SCLK_TIMER14		137
 #define SCLK_TIMER15		138
+#define SCLK_MIPIDSI_24M	139
 
 #define DCLK_VOP		190
 #define MCLK_CRYPTO		191
-- 
2.19.2


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

* [PATCH 03/15] clk: rockchip: use clock ids for dphy rx and tx on rk3368
  2018-12-17 12:36 [PATCH 00/15] drm/rockchip: add display support for rk3368 Heiko Stuebner
  2018-12-17 12:36 ` [PATCH 01/15] clk: rockchip: add clock ids for dphy rx and tx channels on rk3368 Heiko Stuebner
  2018-12-17 12:36 ` [PATCH 02/15] clk: rockchip: add clock id 24m dsi clock " Heiko Stuebner
@ 2018-12-17 12:36 ` Heiko Stuebner
  2018-12-17 12:36 ` [PATCH 04/15] clk: rockchip: use clock id for 24m dsi " Heiko Stuebner
                   ` (11 subsequent siblings)
  14 siblings, 0 replies; 21+ messages in thread
From: Heiko Stuebner @ 2018-12-17 12:36 UTC (permalink / raw)
  To: linux-rockchip, hjc
  Cc: linux-arm-kernel, linux-kernel, devicetree, dri-devel, robh+dt,
	mark.rutland, architt, a.hajda, Laurent.pinchart, linux-clk,
	Heiko Stuebner

Export the clocks using the newly added clock ids.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
---
 drivers/clk/rockchip/clk-rk3368.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/clk/rockchip/clk-rk3368.c b/drivers/clk/rockchip/clk-rk3368.c
index 7c4d242f19c1..58debf7daf85 100644
--- a/drivers/clk/rockchip/clk-rk3368.c
+++ b/drivers/clk/rockchip/clk-rk3368.c
@@ -823,8 +823,8 @@ static struct rockchip_clk_branch rk3368_clk_branches[] __initdata = {
 	 * pclk_vio gates
 	 * pclk_vio comes from the exactly same source as hclk_vio
 	 */
-	GATE(0, "pclk_dphyrx", "hclk_vio", CLK_IGNORE_UNUSED, RK3368_CLKGATE_CON(14), 8, GFLAGS),
-	GATE(0, "pclk_dphytx", "hclk_vio", CLK_IGNORE_UNUSED, RK3368_CLKGATE_CON(14), 8, GFLAGS),
+	GATE(PCLK_DPHYRX, "pclk_dphyrx", "hclk_vio", CLK_IGNORE_UNUSED, RK3368_CLKGATE_CON(14), 8, GFLAGS),
+	GATE(PCLK_DPHYTX, "pclk_dphytx", "hclk_vio", CLK_IGNORE_UNUSED, RK3368_CLKGATE_CON(14), 8, GFLAGS),
 
 	/* pclk_pd_pmu gates */
 	GATE(PCLK_PMUGRF, "pclk_pmugrf", "pclk_pd_pmu", CLK_IGNORE_UNUSED, RK3368_CLKGATE_CON(23), 5, GFLAGS),
-- 
2.19.2


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

* [PATCH 04/15] clk: rockchip: use clock id for 24m dsi on rk3368
  2018-12-17 12:36 [PATCH 00/15] drm/rockchip: add display support for rk3368 Heiko Stuebner
                   ` (2 preceding siblings ...)
  2018-12-17 12:36 ` [PATCH 03/15] clk: rockchip: use clock ids for dphy rx and tx " Heiko Stuebner
@ 2018-12-17 12:36 ` Heiko Stuebner
  2018-12-17 12:36 ` [PATCH 05/15] drm/rockchip: dw_hdmi: add support for rk3368 Heiko Stuebner
                   ` (10 subsequent siblings)
  14 siblings, 0 replies; 21+ messages in thread
From: Heiko Stuebner @ 2018-12-17 12:36 UTC (permalink / raw)
  To: linux-rockchip, hjc
  Cc: linux-arm-kernel, linux-kernel, devicetree, dri-devel, robh+dt,
	mark.rutland, architt, a.hajda, Laurent.pinchart, linux-clk,
	Heiko Stuebner

Export the clock using the newly added clock id.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
---
 drivers/clk/rockchip/clk-rk3368.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/rockchip/clk-rk3368.c b/drivers/clk/rockchip/clk-rk3368.c
index 58debf7daf85..56ca10fe3e96 100644
--- a/drivers/clk/rockchip/clk-rk3368.c
+++ b/drivers/clk/rockchip/clk-rk3368.c
@@ -532,7 +532,7 @@ static struct rockchip_clk_branch rk3368_clk_branches[] __initdata = {
 	GATE(ACLK_PERI, "aclk_peri", "aclk_peri_src", CLK_IGNORE_UNUSED,
 			RK3368_CLKGATE_CON(3), 1, GFLAGS),
 
-	GATE(0, "sclk_mipidsi_24m", "xin24m", 0, RK3368_CLKGATE_CON(4), 14, GFLAGS),
+	GATE(SCLK_MIPIDSI_24M, "sclk_mipidsi_24m", "xin24m", 0, RK3368_CLKGATE_CON(4), 14, GFLAGS),
 
 	/*
 	 * Clock-Architecture Diagram 4
-- 
2.19.2


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

* [PATCH 05/15] drm/rockchip: dw_hdmi: add support for rk3368
  2018-12-17 12:36 [PATCH 00/15] drm/rockchip: add display support for rk3368 Heiko Stuebner
                   ` (3 preceding siblings ...)
  2018-12-17 12:36 ` [PATCH 04/15] clk: rockchip: use clock id for 24m dsi " Heiko Stuebner
@ 2018-12-17 12:36 ` Heiko Stuebner
  2018-12-20 21:39   ` Rob Herring
  2018-12-17 12:36 ` [PATCH 06/15] drm/rockchip: analogix_dp: add support for the rk3368 variant Heiko Stuebner
                   ` (9 subsequent siblings)
  14 siblings, 1 reply; 21+ messages in thread
From: Heiko Stuebner @ 2018-12-17 12:36 UTC (permalink / raw)
  To: linux-rockchip, hjc
  Cc: linux-arm-kernel, linux-kernel, devicetree, dri-devel, robh+dt,
	mark.rutland, architt, a.hajda, Laurent.pinchart, linux-clk,
	Heiko Stuebner

The rk3368 only has one vop block and thus the dw_hdmi does not need to
do the source selection.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
---
 .../display/rockchip/dw_hdmi-rockchip.txt         |  1 +
 drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c       | 15 +++++++++++++++
 2 files changed, 16 insertions(+)

diff --git a/Documentation/devicetree/bindings/display/rockchip/dw_hdmi-rockchip.txt b/Documentation/devicetree/bindings/display/rockchip/dw_hdmi-rockchip.txt
index 39143424a474..6b8159a8bc57 100644
--- a/Documentation/devicetree/bindings/display/rockchip/dw_hdmi-rockchip.txt
+++ b/Documentation/devicetree/bindings/display/rockchip/dw_hdmi-rockchip.txt
@@ -14,6 +14,7 @@ Required properties:
 - compatible: should be one of the following:
 		"rockchip,rk3288-dw-hdmi"
 		"rockchip,rk3328-dw-hdmi"
+		"rockchip,rk3368-dw-hdmi"
 		"rockchip,rk3399-dw-hdmi"
 - reg: See dw_hdmi.txt.
 - reg-io-width: See dw_hdmi.txt. Shall be 4.
diff --git a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
index 89c63cfde5c8..eca9a7d213ea 100644
--- a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
+++ b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
@@ -407,6 +407,18 @@ static const struct dw_hdmi_plat_data rk3328_hdmi_drv_data = {
 	.phy_force_vendor = true,
 };
 
+static struct rockchip_hdmi_chip_data rk3368_chip_data = {
+	.lcdsel_grf_reg = -1,
+};
+
+static const struct dw_hdmi_plat_data rk3368_hdmi_drv_data = {
+	.mode_valid = dw_hdmi_rockchip_mode_valid,
+	.mpll_cfg   = rockchip_mpll_cfg,
+	.cur_ctr    = rockchip_cur_ctr,
+	.phy_config = rockchip_phy_config,
+	.phy_data = &rk3368_chip_data,
+};
+
 static struct rockchip_hdmi_chip_data rk3399_chip_data = {
 	.lcdsel_grf_reg = RK3399_GRF_SOC_CON20,
 	.lcdsel_big = HIWORD_UPDATE(0, RK3399_HDMI_LCDC_SEL),
@@ -428,6 +440,9 @@ static const struct of_device_id dw_hdmi_rockchip_dt_ids[] = {
 	{ .compatible = "rockchip,rk3328-dw-hdmi",
 	  .data = &rk3328_hdmi_drv_data
 	},
+	{ .compatible = "rockchip,rk3368-dw-hdmi",
+	  .data = &rk3368_hdmi_drv_data
+	},
 	{ .compatible = "rockchip,rk3399-dw-hdmi",
 	  .data = &rk3399_hdmi_drv_data
 	},
-- 
2.19.2


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

* [PATCH 06/15] drm/rockchip: analogix_dp: add support for the rk3368 variant
  2018-12-17 12:36 [PATCH 00/15] drm/rockchip: add display support for rk3368 Heiko Stuebner
                   ` (4 preceding siblings ...)
  2018-12-17 12:36 ` [PATCH 05/15] drm/rockchip: dw_hdmi: add support for rk3368 Heiko Stuebner
@ 2018-12-17 12:36 ` Heiko Stuebner
  2018-12-20 21:40   ` Rob Herring
  2018-12-17 12:36 ` [PATCH 07/15] drm/rockchip: dw-mipi-dsi: add support for rk3368-variant Heiko Stuebner
                   ` (8 subsequent siblings)
  14 siblings, 1 reply; 21+ messages in thread
From: Heiko Stuebner @ 2018-12-17 12:36 UTC (permalink / raw)
  To: linux-rockchip, hjc
  Cc: linux-arm-kernel, linux-kernel, devicetree, dri-devel, robh+dt,
	mark.rutland, architt, a.hajda, Laurent.pinchart, linux-clk,
	Heiko Stuebner

Add the compatible and allow the driver to also not set any crtc input
on socs that only have one vop. While that was already possible
because the driver checked against the grf-reg being 0, make that
var an int as "0x0" is a valid grf address itself. So standardize
on -1 for "no setting needed".

The dp controller behaves similar to the one found on rk3288, so we
don't add a new chip_type to not overly pollute the bridge driver.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
---
 .../display/rockchip/analogix_dp-rockchip.txt   |  1 +
 drivers/gpu/drm/rockchip/analogix_dp-rockchip.c | 17 +++++++++++++----
 2 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/Documentation/devicetree/bindings/display/rockchip/analogix_dp-rockchip.txt b/Documentation/devicetree/bindings/display/rockchip/analogix_dp-rockchip.txt
index 43561584c13a..d0f7a1292355 100644
--- a/Documentation/devicetree/bindings/display/rockchip/analogix_dp-rockchip.txt
+++ b/Documentation/devicetree/bindings/display/rockchip/analogix_dp-rockchip.txt
@@ -3,6 +3,7 @@ Rockchip RK3288 specific extensions to the Analogix Display Port
 
 Required properties:
 - compatible: "rockchip,rk3288-dp",
+	      "rockchip,rk3368-dp",
 	      "rockchip,rk3399-edp";
 
 - reg: physical base address of the controller and length
diff --git a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
index 080f05352195..acfcffc279ea 100644
--- a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
+++ b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
@@ -54,7 +54,7 @@
  * @chip_type: specific chip type
  */
 struct rockchip_dp_chip_data {
-	u32	lcdsel_grf_reg;
+	int	lcdsel_grf_reg;
 	u32	lcdsel_big;
 	u32	lcdsel_lit;
 	u32	chip_type;
@@ -207,9 +207,12 @@ static void rockchip_dp_drm_encoder_enable(struct drm_encoder *encoder)
 		return;
 	}
 
-	ret = regmap_write(dp->grf, dp->data->lcdsel_grf_reg, val);
-	if (ret != 0)
-		DRM_DEV_ERROR(dp->dev, "Could not write to GRF: %d\n", ret);
+	if (dp->data->lcdsel_grf_reg >= 0) {
+		ret = regmap_write(dp->grf, dp->data->lcdsel_grf_reg, val);
+		if (ret != 0)
+			DRM_DEV_ERROR(dp->dev, "Could not write to GRF: %d\n",
+				      ret);
+	}
 
 	clk_disable_unprepare(dp->grfclk);
 }
@@ -455,8 +458,14 @@ static const struct rockchip_dp_chip_data rk3288_dp = {
 	.chip_type = RK3288_DP,
 };
 
+static const struct rockchip_dp_chip_data rk3368_dp = {
+	.lcdsel_grf_reg = -1,
+	.chip_type = RK3288_DP,
+};
+
 static const struct of_device_id rockchip_dp_dt_ids[] = {
 	{.compatible = "rockchip,rk3288-dp", .data = &rk3288_dp },
+	{.compatible = "rockchip,rk3368-dp", .data = &rk3368_dp },
 	{.compatible = "rockchip,rk3399-edp", .data = &rk3399_edp },
 	{}
 };
-- 
2.19.2


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

* [PATCH 07/15] drm/rockchip: dw-mipi-dsi: add support for rk3368-variant
  2018-12-17 12:36 [PATCH 00/15] drm/rockchip: add display support for rk3368 Heiko Stuebner
                   ` (5 preceding siblings ...)
  2018-12-17 12:36 ` [PATCH 06/15] drm/rockchip: analogix_dp: add support for the rk3368 variant Heiko Stuebner
@ 2018-12-17 12:36 ` Heiko Stuebner
  2018-12-20 21:42   ` Rob Herring
  2018-12-17 12:36 ` [PATCH 08/15] arm64: dts: rockchip: default values for core clocks on rk3368 Heiko Stuebner
                   ` (7 subsequent siblings)
  14 siblings, 1 reply; 21+ messages in thread
From: Heiko Stuebner @ 2018-12-17 12:36 UTC (permalink / raw)
  To: linux-rockchip, hjc
  Cc: linux-arm-kernel, linux-kernel, devicetree, dri-devel, robh+dt,
	mark.rutland, architt, a.hajda, Laurent.pinchart, linux-clk,
	Heiko Stuebner

Add the compatible and grf values and allow the driver to also
not select a specific crtc input on systems with only one vop.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
---
 .../display/rockchip/dw_mipi_dsi_rockchip.txt |  1 +
 .../gpu/drm/rockchip/dw-mipi-dsi-rockchip.c   | 25 +++++++++++++++++--
 2 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/display/rockchip/dw_mipi_dsi_rockchip.txt b/Documentation/devicetree/bindings/display/rockchip/dw_mipi_dsi_rockchip.txt
index 6bb59ab39f2f..869fbc256d51 100644
--- a/Documentation/devicetree/bindings/display/rockchip/dw_mipi_dsi_rockchip.txt
+++ b/Documentation/devicetree/bindings/display/rockchip/dw_mipi_dsi_rockchip.txt
@@ -5,6 +5,7 @@ Required properties:
 - #address-cells: Should be <1>.
 - #size-cells: Should be <0>.
 - compatible: "rockchip,rk3288-mipi-dsi", "snps,dw-mipi-dsi".
+	      "rockchip,rk3368-mipi-dsi", "snps,dw-mipi-dsi".
 	      "rockchip,rk3399-mipi-dsi", "snps,dw-mipi-dsi".
 - reg: Represent the physical address range of the controller.
 - interrupts: Represent the controller's interrupt to the CPU(s).
diff --git a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c b/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
index 7ee359bcee62..041647bfce71 100644
--- a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
+++ b/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
@@ -142,6 +142,11 @@
 #define RK3288_DSI0_LCDC_SEL		BIT(6)
 #define RK3288_DSI1_LCDC_SEL		BIT(9)
 
+#define RK3368_GRF_SOC_CON7		0x41c
+#define RK3368_DSI_TURNDISABLE		BIT(5)
+#define RK3368_DSI_FORCERXMODE		BIT(6)
+#define RK3368_DSI_FORCETXSTOPMODE	(0xf << 7)
+
 #define RK3399_GRF_SOC_CON20		0x6250
 #define RK3399_DSI0_LCDC_SEL		BIT(0)
 #define RK3399_DSI1_LCDC_SEL		BIT(4)
@@ -192,7 +197,7 @@ enum {
 struct rockchip_dw_dsi_chip_data {
 	u32 reg;
 
-	u32 lcdsel_grf_reg;
+	int lcdsel_grf_reg;
 	u32 lcdsel_big;
 	u32 lcdsel_lit;
 
@@ -566,7 +571,7 @@ static const struct dw_mipi_dsi_phy_ops dw_mipi_dsi_rockchip_phy_ops = {
 static void dw_mipi_dsi_rockchip_config(struct dw_mipi_dsi_rockchip *dsi,
 					int mux)
 {
-	if (dsi->cdata->lcdsel_grf_reg)
+	if (dsi->cdata->lcdsel_grf_reg >= 0)
 		regmap_write(dsi->grf_regmap, dsi->cdata->lcdsel_grf_reg,
 			mux ? dsi->cdata->lcdsel_lit : dsi->cdata->lcdsel_big);
 
@@ -1008,6 +1013,19 @@ static const struct rockchip_dw_dsi_chip_data rk3288_chip_data[] = {
 	{ /* sentinel */ }
 };
 
+static const struct rockchip_dw_dsi_chip_data rk3368_chip_data[] = {
+	{
+		.reg = 0xff960000,
+		.lcdsel_grf_reg = -1,
+		.lanecfg1_grf_reg = RK3368_GRF_SOC_CON7,
+		.lanecfg1 = HIWORD_UPDATE(0, RK3368_DSI_TURNDISABLE |
+					     RK3368_DSI_FORCERXMODE |
+					     RK3368_DSI_FORCETXSTOPMODE),
+		.max_data_lanes = 4,
+	},
+	{ /* sentinel */ }
+};
+
 static const struct rockchip_dw_dsi_chip_data rk3399_chip_data[] = {
 	{
 		.reg = 0xff960000,
@@ -1058,6 +1076,9 @@ static const struct of_device_id dw_mipi_dsi_rockchip_dt_ids[] = {
 	{
 	 .compatible = "rockchip,rk3288-mipi-dsi",
 	 .data = &rk3288_chip_data,
+	}, {
+	 .compatible = "rockchip,rk3368-mipi-dsi",
+	 .data = &rk3368_chip_data,
 	}, {
 	 .compatible = "rockchip,rk3399-mipi-dsi",
 	 .data = &rk3399_chip_data,
-- 
2.19.2


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

* [PATCH 08/15] arm64: dts: rockchip: default values for core clocks on rk3368
  2018-12-17 12:36 [PATCH 00/15] drm/rockchip: add display support for rk3368 Heiko Stuebner
                   ` (6 preceding siblings ...)
  2018-12-17 12:36 ` [PATCH 07/15] drm/rockchip: dw-mipi-dsi: add support for rk3368-variant Heiko Stuebner
@ 2018-12-17 12:36 ` Heiko Stuebner
  2018-12-17 12:36 ` [PATCH 09/15] arm64: dts: rockchip: add power-domain nodes " Heiko Stuebner
                   ` (6 subsequent siblings)
  14 siblings, 0 replies; 21+ messages in thread
From: Heiko Stuebner @ 2018-12-17 12:36 UTC (permalink / raw)
  To: linux-rockchip, hjc
  Cc: linux-arm-kernel, linux-kernel, devicetree, dri-devel, robh+dt,
	mark.rutland, architt, a.hajda, Laurent.pinchart, linux-clk,
	Heiko Stuebner

Add better default values for PLLs and core clocks on rk3368.
This includes all plls as well as core aclk,hclk and pclk in
both the cpu as well as peripheral domain.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
---
 arch/arm64/boot/dts/rockchip/rk3368.dtsi | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/arch/arm64/boot/dts/rockchip/rk3368.dtsi b/arch/arm64/boot/dts/rockchip/rk3368.dtsi
index 7014d10b954c..3ef1c27cb7d3 100644
--- a/arch/arm64/boot/dts/rockchip/rk3368.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3368.dtsi
@@ -650,6 +650,16 @@
 		rockchip,grf = <&grf>;
 		#clock-cells = <1>;
 		#reset-cells = <1>;
+		assigned-clocks = <&cru PLL_GPLL>, <&cru PLL_CPLL>,
+				  <&cru PLL_NPLL>, <&cru ACLK_BUS>,
+				  <&cru HCLK_BUS>, <&cru PCLK_BUS>,
+				  <&cru ACLK_PERI>, <&cru HCLK_PERI>,
+				  <&cru PCLK_PERI>;
+		assigned-clock-rates = <594000000>, <400000000>,
+				       <500000000>, <300000000>,
+				       <150000000>, <75000000>,
+				       <300000000>, <150000000>,
+				       <75000000>;
 	};
 
 	grf: syscon@ff770000 {
-- 
2.19.2


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

* [PATCH 09/15] arm64: dts: rockchip: add power-domain nodes on rk3368
  2018-12-17 12:36 [PATCH 00/15] drm/rockchip: add display support for rk3368 Heiko Stuebner
                   ` (7 preceding siblings ...)
  2018-12-17 12:36 ` [PATCH 08/15] arm64: dts: rockchip: default values for core clocks on rk3368 Heiko Stuebner
@ 2018-12-17 12:36 ` Heiko Stuebner
  2018-12-17 12:36 ` [PATCH 10/15] arm64: dts: rockchip: add dw-hdmi controller " Heiko Stuebner
                   ` (5 subsequent siblings)
  14 siblings, 0 replies; 21+ messages in thread
From: Heiko Stuebner @ 2018-12-17 12:36 UTC (permalink / raw)
  To: linux-rockchip, hjc
  Cc: linux-arm-kernel, linux-kernel, devicetree, dri-devel, robh+dt,
	mark.rutland, architt, a.hajda, Laurent.pinchart, linux-clk,
	Heiko Stuebner

Add the power-controller main node, the individual power domains
below it and their used quality-of-service syscons on rk3368
and hook the power-domains to their user-devicenodes.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
---
 arch/arm64/boot/dts/rockchip/rk3368.dtsi | 177 +++++++++++++++++++++++
 1 file changed, 177 insertions(+)

diff --git a/arch/arm64/boot/dts/rockchip/rk3368.dtsi b/arch/arm64/boot/dts/rockchip/rk3368.dtsi
index 3ef1c27cb7d3..e79c5985f60a 100644
--- a/arch/arm64/boot/dts/rockchip/rk3368.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3368.dtsi
@@ -8,6 +8,7 @@
 #include <dt-bindings/interrupt-controller/irq.h>
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 #include <dt-bindings/pinctrl/rockchip.h>
+#include <dt-bindings/power/rk3368-power.h>
 #include <dt-bindings/soc/rockchip,boot-mode.h>
 #include <dt-bindings/thermal/thermal.h>
 
@@ -625,6 +626,112 @@
 		status = "disabled";
 	};
 
+	pmu: power-management@ff730000 {
+		compatible = "rockchip,rk3368-pmu", "syscon", "simple-mfd";
+		reg = <0x0 0xff730000 0x0 0x1000>;
+
+		power: power-controller {
+			compatible = "rockchip,rk3368-power-controller";
+			#power-domain-cells = <1>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			/*
+			 * Note: Although SCLK_* are the working clocks
+			 * of device without including on the NOC, needed for
+			 * synchronous reset.
+			 *
+			 * The clocks on the which NOC:
+			 * ACLK_IEP/ACLK_VIP/ACLK_VOP0 are on ACLK_VIO0_NIU.
+			 * ACLK_ISP/ACLK_VOP1 are on ACLK_VIO1_NIU.
+			 * ACLK_RGA is on ACLK_RGA_NIU.
+			 * The others (HCLK_*,PLCK_*) are on HCLK_VIO_NIU.
+			 *
+			 * Which clock are device clocks:
+			 *	clocks		devices
+			 *	*_IEP		IEP:Image Enhancement Processor
+			 *	*_ISP		ISP:Image Signal Processing
+			 *	*_VIP		VIP:Video Input Processor
+			 *	*_VOP*		VOP:Visual Output Processor
+			 *	*_RGA		RGA
+			 *	*_EDP*		EDP
+			 *	*_DPHY*		LVDS
+			 *	*_HDMI		HDMI
+			 *	*_MIPI_*	MIPI
+			 */
+			pd_vio@RK3368_PD_VIO {
+				reg = <RK3368_PD_VIO>;
+				clocks = <&cru ACLK_IEP>,
+					 <&cru ACLK_ISP>,
+					 <&cru ACLK_VIP>,
+					 <&cru ACLK_RGA>,
+					 <&cru ACLK_VOP>,
+					 <&cru ACLK_VOP_IEP>,
+					 <&cru DCLK_VOP>,
+					 <&cru HCLK_IEP>,
+					 <&cru HCLK_ISP>,
+					 <&cru HCLK_RGA>,
+					 <&cru HCLK_VIP>,
+					 <&cru HCLK_VOP>,
+					 <&cru HCLK_VIO_HDCPMMU>,
+					 <&cru PCLK_EDP_CTRL>,
+					 <&cru PCLK_HDMI_CTRL>,
+					 <&cru PCLK_HDCP>,
+					 <&cru PCLK_ISP>,
+					 <&cru PCLK_VIP>,
+					 <&cru PCLK_DPHYRX>,
+					 <&cru PCLK_DPHYTX>,
+					 <&cru PCLK_MIPI_CSI>,
+					 <&cru PCLK_MIPI_DSI0>,
+					 <&cru SCLK_VOP0_PWM>,
+					 <&cru SCLK_EDP_24M>,
+					 <&cru SCLK_EDP>,
+					 <&cru SCLK_HDCP>,
+					 <&cru SCLK_ISP>,
+					 <&cru SCLK_RGA>,
+					 <&cru SCLK_HDMI_CEC>,
+					 <&cru SCLK_HDMI_HDCP>;
+				pm_qos = <&qos_iep>,
+					 <&qos_isp_r0>,
+					 <&qos_isp_r1>,
+					 <&qos_isp_w0>,
+					 <&qos_isp_w1>,
+					 <&qos_vip>,
+					 <&qos_vop>,
+					 <&qos_rga_r>,
+					 <&qos_rga_w>;
+			};
+
+			/*
+			 * Note: ACLK_VCODEC/HCLK_VCODEC are VCODEC
+			 * (video endecoder & decoder) clocks that on the
+			 * ACLK_VCODEC_NIU and HCLK_VCODEC_NIU (NOC).
+			 */
+			pd_video@RK3368_PD_VIDEO {
+				reg = <RK3368_PD_VIDEO>;
+				clocks = <&cru ACLK_VIDEO>,
+					 <&cru HCLK_VIDEO>,
+					 <&cru SCLK_HEVC_CABAC>,
+					 <&cru SCLK_HEVC_CORE>;
+				pm_qos = <&qos_hevc_r>,
+					 <&qos_vpu_r>,
+					 <&qos_vpu_w>;
+			};
+
+			/*
+			 * Note: ACLK_GPU is the GPU clock,
+			 * and on the ACLK_GPU_NIU (NOC).
+			 */
+			pd_gpu_1@RK3368_PD_GPU_1 {
+				reg = <RK3368_PD_GPU_1>;
+				clocks = <&cru ACLK_GPU_CFG>,
+					 <&cru ACLK_GPU_MEM>,
+					 <&cru SCLK_GPU_CORE>;
+				pm_qos = <&qos_gpu>;
+			};
+		};
+	};
+
 	pmugrf: syscon@ff738000 {
 		compatible = "rockchip,rk3368-pmugrf", "syscon", "simple-mfd";
 		reg = <0x0 0xff738000 0x0 0x1000>;
@@ -731,6 +838,7 @@
 		clocks = <&cru ACLK_IEP>, <&cru HCLK_IEP>;
 		clock-names = "aclk", "iface";
 		#iommu-cells = <0>;
+		power-domains = <&power RK3368_PD_VIO>;
 		status = "disabled";
 	};
 
@@ -743,6 +851,7 @@
 		clocks = <&cru ACLK_ISP>, <&cru HCLK_ISP>;
 		clock-names = "aclk", "iface";
 		#iommu-cells = <0>;
+		power-domains = <&power RK3368_PD_VIO>;
 		rockchip,disable-mmu-reset;
 		status = "disabled";
 	};
@@ -754,6 +863,7 @@
 		interrupt-names = "vop_mmu";
 		clocks = <&cru ACLK_VOP>, <&cru HCLK_VOP>;
 		clock-names = "aclk", "iface";
+		power-domains = <&power RK3368_PD_VIO>;
 		#iommu-cells = <0>;
 		status = "disabled";
 	};
@@ -767,6 +877,7 @@
 		clocks = <&cru ACLK_VIDEO>, <&cru HCLK_VIDEO>;
 		clock-names = "aclk", "iface";
 		#iommu-cells = <0>;
+		power-domains = <&power RK3368_PD_VIDEO>;
 		status = "disabled";
 	};
 
@@ -779,9 +890,75 @@
 		clocks = <&cru ACLK_VIDEO>, <&cru HCLK_VIDEO>;
 		clock-names = "aclk", "iface";
 		#iommu-cells = <0>;
+		power-domains = <&power RK3368_PD_VIDEO>;
 		status = "disabled";
 	};
 
+	qos_iep: qos@ffad0000 {
+		compatible = "syscon";
+		reg = <0x0 0xffad0000 0x0 0x20>;
+	};
+
+	qos_isp_r0: qos@ffad0080 {
+		compatible = "syscon";
+		reg = <0x0 0xffad0080 0x0 0x20>;
+	};
+
+	qos_isp_r1: qos@ffad0100 {
+		compatible = "syscon";
+		reg = <0x0 0xffad0100 0x0 0x20>;
+	};
+
+	qos_isp_w0: qos@ffad0180 {
+		compatible = "syscon";
+		reg = <0x0 0xffad0180 0x0 0x20>;
+	};
+
+	qos_isp_w1: qos@ffad0200 {
+		compatible = "syscon";
+		reg = <0x0 0xffad0200 0x0 0x20>;
+	};
+
+	qos_vip: qos@ffad0280 {
+		compatible = "syscon";
+		reg = <0x0 0xffad0280 0x0 0x20>;
+	};
+
+	qos_vop: qos@ffad0300 {
+		compatible = "syscon";
+		reg = <0x0 0xffad0300 0x0 0x20>;
+	};
+
+	qos_rga_r: qos@ffad0380 {
+		compatible = "syscon";
+		reg = <0x0 0xffad0380 0x0 0x20>;
+	};
+
+	qos_rga_w: qos@ffad0400 {
+		compatible = "syscon";
+		reg = <0x0 0xffad0400 0x0 0x20>;
+	};
+
+	qos_hevc_r: qos@ffae0000 {
+		compatible = "syscon";
+		reg = <0x0 0xffae0000 0x0 0x20>;
+	};
+
+	qos_vpu_r: qos@ffae0100 {
+		compatible = "syscon";
+		reg = <0x0 0xffae0100 0x0 0x20>;
+	};
+
+	qos_vpu_w: qos@ffae0180 {
+		compatible = "syscon";
+		reg = <0x0 0xffae0180 0x0 0x20>;
+	};
+
+	qos_gpu: qos@ffaf0000 {
+		compatible = "syscon";
+		reg = <0x0 0xffaf0000 0x0 0x20>;
+	};
+
 	efuse256: efuse@ffb00000 {
 		compatible = "rockchip,rk3368-efuse";
 		reg = <0x0 0xffb00000 0x0 0x20>;
-- 
2.19.2


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

* [PATCH 10/15] arm64: dts: rockchip: add dw-hdmi controller on rk3368
  2018-12-17 12:36 [PATCH 00/15] drm/rockchip: add display support for rk3368 Heiko Stuebner
                   ` (8 preceding siblings ...)
  2018-12-17 12:36 ` [PATCH 09/15] arm64: dts: rockchip: add power-domain nodes " Heiko Stuebner
@ 2018-12-17 12:36 ` Heiko Stuebner
  2018-12-17 12:36 ` [PATCH 11/15] arm64: dts: rockchip: add analogix-dp " Heiko Stuebner
                   ` (4 subsequent siblings)
  14 siblings, 0 replies; 21+ messages in thread
From: Heiko Stuebner @ 2018-12-17 12:36 UTC (permalink / raw)
  To: linux-rockchip, hjc
  Cc: linux-arm-kernel, linux-kernel, devicetree, dri-devel, robh+dt,
	mark.rutland, architt, a.hajda, Laurent.pinchart, linux-clk,
	Heiko Stuebner

Add the core node for the dw-hdmi controller found on rk3368 socs.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
---
 arch/arm64/boot/dts/rockchip/rk3368.dtsi | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/arch/arm64/boot/dts/rockchip/rk3368.dtsi b/arch/arm64/boot/dts/rockchip/rk3368.dtsi
index e79c5985f60a..4ddf380a2c2d 100644
--- a/arch/arm64/boot/dts/rockchip/rk3368.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3368.dtsi
@@ -868,6 +868,20 @@
 		status = "disabled";
 	};
 
+	hdmi: hdmi@ff980000 {
+		compatible = "rockchip,rk3368-dw-hdmi";
+		reg = <0x0 0xff980000 0x0 0x20000>;
+		reg-io-width = <4>;
+		rockchip,grf = <&grf>;
+		interrupts = <GIC_SPI 103 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&cru PCLK_HDMI_CTRL>,
+			 <&cru SCLK_HDMI_HDCP>,
+			 <&cru SCLK_HDMI_CEC>;
+		clock-names = "iahb", "isfr", "cec";
+		power-domains = <&power RK3368_PD_VIO>;
+		status = "disabled";
+	};
+
 	hevc_mmu: iommu@ff9a0440 {
 		compatible = "rockchip,iommu";
 		reg = <0x0 0xff9a0440 0x0 0x40>,
-- 
2.19.2


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

* [PATCH 11/15] arm64: dts: rockchip: add analogix-dp controller on rk3368
  2018-12-17 12:36 [PATCH 00/15] drm/rockchip: add display support for rk3368 Heiko Stuebner
                   ` (9 preceding siblings ...)
  2018-12-17 12:36 ` [PATCH 10/15] arm64: dts: rockchip: add dw-hdmi controller " Heiko Stuebner
@ 2018-12-17 12:36 ` Heiko Stuebner
  2018-12-17 12:36 ` [PATCH 12/15] arm64: dts: rockchip: add dw-mipi-dsi " Heiko Stuebner
                   ` (3 subsequent siblings)
  14 siblings, 0 replies; 21+ messages in thread
From: Heiko Stuebner @ 2018-12-17 12:36 UTC (permalink / raw)
  To: linux-rockchip, hjc
  Cc: linux-arm-kernel, linux-kernel, devicetree, dri-devel, robh+dt,
	mark.rutland, architt, a.hajda, Laurent.pinchart, linux-clk,
	Heiko Stuebner

Add the core node for the Analogix displayport controller
found on rk3368 socs.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
---
 arch/arm64/boot/dts/rockchip/rk3368.dtsi | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/arch/arm64/boot/dts/rockchip/rk3368.dtsi b/arch/arm64/boot/dts/rockchip/rk3368.dtsi
index 4ddf380a2c2d..e30cbf30c026 100644
--- a/arch/arm64/boot/dts/rockchip/rk3368.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3368.dtsi
@@ -868,6 +868,21 @@
 		status = "disabled";
 	};
 
+	edp: dp@ff970000 {
+		compatible = "rockchip,rk3368-dp";
+		reg = <0x0 0xff970000 0x0 0x4000>;
+		interrupts = <GIC_SPI 105 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&cru SCLK_EDP>, <&cru PCLK_EDP_CTRL>;
+		clock-names = "dp", "pclk";
+		pinctrl-names = "default";
+		pinctrl-0 = <&edp_hpd>;
+		power-domains = <&power RK3368_PD_VIO>;
+		resets = <&cru SRST_EDP>;
+		reset-names = "dp";
+		rockchip,grf = <&grf>;
+		status = "disabled";
+	};
+
 	hdmi: hdmi@ff980000 {
 		compatible = "rockchip,rk3368-dw-hdmi";
 		reg = <0x0 0xff980000 0x0 0x20000>;
@@ -1080,6 +1095,13 @@
 			drive-strength = <12>;
 		};
 
+		edp {
+			edp_hpd: edp-hpd {
+				rockchip,pins =
+					<2 RK_PC7 RK_FUNC_2 &pcfg_pull_none>;
+			};
+		};
+
 		emmc {
 			emmc_clk: emmc-clk {
 				rockchip,pins = <2 4 RK_FUNC_2 &pcfg_pull_none>;
-- 
2.19.2


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

* [PATCH 12/15] arm64: dts: rockchip: add dw-mipi-dsi controller on rk3368
  2018-12-17 12:36 [PATCH 00/15] drm/rockchip: add display support for rk3368 Heiko Stuebner
                   ` (10 preceding siblings ...)
  2018-12-17 12:36 ` [PATCH 11/15] arm64: dts: rockchip: add analogix-dp " Heiko Stuebner
@ 2018-12-17 12:36 ` Heiko Stuebner
  2018-12-17 12:36 ` [PATCH 13/15] arm64: dts: rockchip: add core display support for rk3368 Heiko Stuebner
                   ` (2 subsequent siblings)
  14 siblings, 0 replies; 21+ messages in thread
From: Heiko Stuebner @ 2018-12-17 12:36 UTC (permalink / raw)
  To: linux-rockchip, hjc
  Cc: linux-arm-kernel, linux-kernel, devicetree, dri-devel, robh+dt,
	mark.rutland, architt, a.hajda, Laurent.pinchart, linux-clk,
	Heiko Stuebner

Add the core node for the mipi-dsi controller found on rk3368 socs.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
---
 arch/arm64/boot/dts/rockchip/rk3368.dtsi | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/arch/arm64/boot/dts/rockchip/rk3368.dtsi b/arch/arm64/boot/dts/rockchip/rk3368.dtsi
index e30cbf30c026..f03f57d96515 100644
--- a/arch/arm64/boot/dts/rockchip/rk3368.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3368.dtsi
@@ -868,6 +868,19 @@
 		status = "disabled";
 	};
 
+	mipi_dsi: mipi@ff960000 {
+		compatible = "rockchip,rk3368-mipi-dsi", "snps,dw-mipi-dsi";
+		reg = <0x0 0xff960000 0x0 0x4000>;
+		interrupts = <GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&cru SCLK_MIPIDSI_24M>, <&cru PCLK_MIPI_DSI0>;
+		clock-names = "ref", "pclk";
+		power-domains = <&power RK3368_PD_VIO>;
+		rockchip,grf = <&grf>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+		status = "disabled";
+	};
+
 	edp: dp@ff970000 {
 		compatible = "rockchip,rk3368-dp";
 		reg = <0x0 0xff970000 0x0 0x4000>;
-- 
2.19.2


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

* [PATCH 13/15] arm64: dts: rockchip: add core display support for rk3368
  2018-12-17 12:36 [PATCH 00/15] drm/rockchip: add display support for rk3368 Heiko Stuebner
                   ` (11 preceding siblings ...)
  2018-12-17 12:36 ` [PATCH 12/15] arm64: dts: rockchip: add dw-mipi-dsi " Heiko Stuebner
@ 2018-12-17 12:36 ` Heiko Stuebner
  2018-12-17 12:36 ` [PATCH 14/15] arm64: dts: rockchip: enable display on rk3368-r88 Heiko Stuebner
  2018-12-17 12:36 ` [PATCH 15/15] arm64: defconfig: enable hym8563 rtc driver Heiko Stuebner
  14 siblings, 0 replies; 21+ messages in thread
From: Heiko Stuebner @ 2018-12-17 12:36 UTC (permalink / raw)
  To: linux-rockchip, hjc
  Cc: linux-arm-kernel, linux-kernel, devicetree, dri-devel, robh+dt,
	mark.rutland, architt, a.hajda, Laurent.pinchart, linux-clk,
	Heiko Stuebner

Add the display subsystem and vop and hook up the individual
encoder ports.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
---
 arch/arm64/boot/dts/rockchip/rk3368.dtsi | 73 ++++++++++++++++++++++++
 1 file changed, 73 insertions(+)

diff --git a/arch/arm64/boot/dts/rockchip/rk3368.dtsi b/arch/arm64/boot/dts/rockchip/rk3368.dtsi
index f03f57d96515..0a2523e706ae 100644
--- a/arch/arm64/boot/dts/rockchip/rk3368.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3368.dtsi
@@ -181,6 +181,11 @@
 				     <&cpu_b2>, <&cpu_b3>;
 	};
 
+	display-subsystem {
+		compatible = "rockchip,display-subsystem";
+		ports = <&vop_out>;
+	};
+
 	psci {
 		compatible = "arm,psci-0.2";
 		method = "smc";
@@ -856,6 +861,40 @@
 		status = "disabled";
 	};
 
+	vop: vop@ff930000 {
+		compatible = "rockchip,rk3368-vop";
+		reg = <0x0 0xff930000 0x0 0x2f4>;
+		interrupts = <GIC_SPI 15 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&cru ACLK_VOP>, <&cru DCLK_VOP>, <&cru HCLK_VOP>;
+		clock-names = "aclk_vop", "dclk_vop", "hclk_vop";
+		power-domains = <&power RK3368_PD_VIO>;
+		resets = <&cru SRST_LCDC0_AXI>, <&cru SRST_LCDC0_AHB>,
+			 <&cru SRST_LCDC0_DCLK>;
+		reset-names = "axi", "ahb", "dclk";
+		iommus = <&vop_mmu>;
+		status = "disabled";
+
+		vop_out: port {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			vop_out_hdmi: endpoint@0 {
+				reg = <0>;
+				remote-endpoint = <&hdmi_in_vop>;
+			};
+
+			vop_out_edp: endpoint@1 {
+				reg = <1>;
+				remote-endpoint = <&edp_in_vop>;
+			};
+
+			vop_out_mipi: endpoint@2 {
+				reg = <2>;
+				remote-endpoint = <&mipi_in_vop>;
+			};
+		};
+	};
+
 	vop_mmu: iommu@ff930300 {
 		compatible = "rockchip,iommu";
 		reg = <0x0 0xff930300 0x0 0x100>;
@@ -879,6 +918,19 @@
 		#address-cells = <1>;
 		#size-cells = <0>;
 		status = "disabled";
+
+		ports {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			mipi_in: port@0 {
+				reg = <0>;
+
+				mipi_in_vop: endpoint {
+					remote-endpoint = <&vop_out_mipi>;
+				};
+			};
+		};
 	};
 
 	edp: dp@ff970000 {
@@ -894,6 +946,19 @@
 		reset-names = "dp";
 		rockchip,grf = <&grf>;
 		status = "disabled";
+
+		ports {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			edp_in: port@0 {
+				reg = <0>;
+
+				edp_in_vop: endpoint {
+					remote-endpoint = <&vop_out_edp>;
+				};
+			};
+		};
 	};
 
 	hdmi: hdmi@ff980000 {
@@ -908,6 +973,14 @@
 		clock-names = "iahb", "isfr", "cec";
 		power-domains = <&power RK3368_PD_VIO>;
 		status = "disabled";
+
+		ports {
+			hdmi_in: port {
+				hdmi_in_vop: endpoint {
+					remote-endpoint = <&vop_out_hdmi>;
+				};
+			};
+		};
 	};
 
 	hevc_mmu: iommu@ff9a0440 {
-- 
2.19.2


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

* [PATCH 14/15] arm64: dts: rockchip: enable display on rk3368-r88
  2018-12-17 12:36 [PATCH 00/15] drm/rockchip: add display support for rk3368 Heiko Stuebner
                   ` (12 preceding siblings ...)
  2018-12-17 12:36 ` [PATCH 13/15] arm64: dts: rockchip: add core display support for rk3368 Heiko Stuebner
@ 2018-12-17 12:36 ` Heiko Stuebner
  2018-12-17 12:36 ` [PATCH 15/15] arm64: defconfig: enable hym8563 rtc driver Heiko Stuebner
  14 siblings, 0 replies; 21+ messages in thread
From: Heiko Stuebner @ 2018-12-17 12:36 UTC (permalink / raw)
  To: linux-rockchip, hjc
  Cc: linux-arm-kernel, linux-kernel, devicetree, dri-devel, robh+dt,
	mark.rutland, architt, a.hajda, Laurent.pinchart, linux-clk,
	Heiko Stuebner

Enable vop, hdmi and hdmi-i2c on the R88 board.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
---
 arch/arm64/boot/dts/rockchip/rk3368-r88.dts | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/arch/arm64/boot/dts/rockchip/rk3368-r88.dts b/arch/arm64/boot/dts/rockchip/rk3368-r88.dts
index 7452bedf1a7e..1469f9d59bb9 100644
--- a/arch/arm64/boot/dts/rockchip/rk3368-r88.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3368-r88.dts
@@ -171,6 +171,11 @@
 	status = "ok";
 };
 
+&hdmi {
+	ddc-i2c-bus = <&i2c5>;
+	status = "okay";
+};
+
 &i2c0 {
 	status = "okay";
 
@@ -198,6 +203,10 @@
 	};
 };
 
+&i2c5 {
+	status = "okay";
+};
+
 &io_domains {
 	status = "ok";
 
@@ -329,6 +338,14 @@
 	status = "okay";
 };
 
+&vop {
+	status = "okay";
+};
+
+&vop_mmu {
+	status = "okay";
+};
+
 &wdt {
 	status = "okay";
 };
-- 
2.19.2


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

* [PATCH 15/15] arm64: defconfig: enable hym8563 rtc driver
  2018-12-17 12:36 [PATCH 00/15] drm/rockchip: add display support for rk3368 Heiko Stuebner
                   ` (13 preceding siblings ...)
  2018-12-17 12:36 ` [PATCH 14/15] arm64: dts: rockchip: enable display on rk3368-r88 Heiko Stuebner
@ 2018-12-17 12:36 ` Heiko Stuebner
  14 siblings, 0 replies; 21+ messages in thread
From: Heiko Stuebner @ 2018-12-17 12:36 UTC (permalink / raw)
  To: linux-rockchip, hjc
  Cc: linux-arm-kernel, linux-kernel, devicetree, dri-devel, robh+dt,
	mark.rutland, architt, a.hajda, Laurent.pinchart, linux-clk,
	Heiko Stuebner

The hym8563 is used on a number of Rockchip boards on 64bit as well
and maybe even more importantly is the source for 32kHz clock on those
as well, completing the clock tree of the soc. So enable it as built-in.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
---
 arch/arm64/configs/defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig
index c9a57d11330b..eb5b0320c3a2 100644
--- a/arch/arm64/configs/defconfig
+++ b/arch/arm64/configs/defconfig
@@ -557,6 +557,7 @@ CONFIG_LEDS_TRIGGER_PANIC=y
 CONFIG_EDAC=y
 CONFIG_EDAC_GHES=y
 CONFIG_RTC_CLASS=y
+CONFIG_RTC_DRV_HYM8563=y
 CONFIG_RTC_DRV_MAX77686=y
 CONFIG_RTC_DRV_RK808=m
 CONFIG_RTC_DRV_S5M=y
-- 
2.19.2


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

* Re: [PATCH 01/15] clk: rockchip: add clock ids for dphy rx and tx channels on rk3368
  2018-12-17 12:36 ` [PATCH 01/15] clk: rockchip: add clock ids for dphy rx and tx channels on rk3368 Heiko Stuebner
@ 2018-12-20 21:37   ` Rob Herring
  0 siblings, 0 replies; 21+ messages in thread
From: Rob Herring @ 2018-12-20 21:37 UTC (permalink / raw)
  To: Heiko Stuebner
  Cc: linux-rockchip, hjc, linux-arm-kernel, linux-kernel, devicetree,
	dri-devel, robh+dt, mark.rutland, architt, a.hajda,
	Laurent.pinchart, linux-clk, Heiko Stuebner

On Mon, 17 Dec 2018 13:36:36 +0100, Heiko Stuebner wrote:
> Add the clock ids so that they can be exported from the clock driver
> and referenced in the rk3368 devicetree.
> 
> Signed-off-by: Heiko Stuebner <heiko@sntech.de>
> ---
>  include/dt-bindings/clock/rk3368-cru.h | 2 ++
>  1 file changed, 2 insertions(+)
> 

Reviewed-by: Rob Herring <robh@kernel.org>

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

* Re: [PATCH 02/15] clk: rockchip: add clock id 24m dsi clock on rk3368
  2018-12-17 12:36 ` [PATCH 02/15] clk: rockchip: add clock id 24m dsi clock " Heiko Stuebner
@ 2018-12-20 21:37   ` Rob Herring
  0 siblings, 0 replies; 21+ messages in thread
From: Rob Herring @ 2018-12-20 21:37 UTC (permalink / raw)
  To: Heiko Stuebner
  Cc: linux-rockchip, hjc, mark.rutland, devicetree, linux-kernel,
	dri-devel, robh+dt, Laurent.pinchart, linux-clk,
	linux-arm-kernel

On Mon, 17 Dec 2018 13:36:37 +0100, Heiko Stuebner wrote:
> Needed as input for the dsi controller.
> 
> Signed-off-by: Heiko Stuebner <heiko@sntech.de>
> ---
>  include/dt-bindings/clock/rk3368-cru.h | 1 +
>  1 file changed, 1 insertion(+)
> 

Reviewed-by: Rob Herring <robh@kernel.org>

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

* Re: [PATCH 05/15] drm/rockchip: dw_hdmi: add support for rk3368
  2018-12-17 12:36 ` [PATCH 05/15] drm/rockchip: dw_hdmi: add support for rk3368 Heiko Stuebner
@ 2018-12-20 21:39   ` Rob Herring
  0 siblings, 0 replies; 21+ messages in thread
From: Rob Herring @ 2018-12-20 21:39 UTC (permalink / raw)
  To: Heiko Stuebner
  Cc: linux-rockchip, hjc, linux-arm-kernel, linux-kernel, devicetree,
	dri-devel, mark.rutland, architt, a.hajda, Laurent.pinchart,
	linux-clk

On Mon, Dec 17, 2018 at 01:36:40PM +0100, Heiko Stuebner wrote:
> The rk3368 only has one vop block and thus the dw_hdmi does not need to
> do the source selection.
> 
> Signed-off-by: Heiko Stuebner <heiko@sntech.de>
> ---
>  .../display/rockchip/dw_hdmi-rockchip.txt         |  1 +

Acked-by: Rob Herring <robh@kernel.org>

>  drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c       | 15 +++++++++++++++
>  2 files changed, 16 insertions(+)

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

* Re: [PATCH 06/15] drm/rockchip: analogix_dp: add support for the rk3368 variant
  2018-12-17 12:36 ` [PATCH 06/15] drm/rockchip: analogix_dp: add support for the rk3368 variant Heiko Stuebner
@ 2018-12-20 21:40   ` Rob Herring
  0 siblings, 0 replies; 21+ messages in thread
From: Rob Herring @ 2018-12-20 21:40 UTC (permalink / raw)
  To: Heiko Stuebner
  Cc: linux-rockchip, hjc, linux-arm-kernel, linux-kernel, devicetree,
	dri-devel, robh+dt, mark.rutland, architt, a.hajda,
	Laurent.pinchart, linux-clk, Heiko Stuebner

On Mon, 17 Dec 2018 13:36:41 +0100, Heiko Stuebner wrote:
> Add the compatible and allow the driver to also not set any crtc input
> on socs that only have one vop. While that was already possible
> because the driver checked against the grf-reg being 0, make that
> var an int as "0x0" is a valid grf address itself. So standardize
> on -1 for "no setting needed".
> 
> The dp controller behaves similar to the one found on rk3288, so we
> don't add a new chip_type to not overly pollute the bridge driver.
> 
> Signed-off-by: Heiko Stuebner <heiko@sntech.de>
> ---
>  .../display/rockchip/analogix_dp-rockchip.txt   |  1 +
>  drivers/gpu/drm/rockchip/analogix_dp-rockchip.c | 17 +++++++++++++----
>  2 files changed, 14 insertions(+), 4 deletions(-)
> 

Reviewed-by: Rob Herring <robh@kernel.org>

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

* Re: [PATCH 07/15] drm/rockchip: dw-mipi-dsi: add support for rk3368-variant
  2018-12-17 12:36 ` [PATCH 07/15] drm/rockchip: dw-mipi-dsi: add support for rk3368-variant Heiko Stuebner
@ 2018-12-20 21:42   ` Rob Herring
  0 siblings, 0 replies; 21+ messages in thread
From: Rob Herring @ 2018-12-20 21:42 UTC (permalink / raw)
  To: Heiko Stuebner
  Cc: linux-rockchip, hjc, linux-arm-kernel, linux-kernel, devicetree,
	dri-devel, robh+dt, mark.rutland, architt, a.hajda,
	Laurent.pinchart, linux-clk, Heiko Stuebner

On Mon, 17 Dec 2018 13:36:42 +0100, Heiko Stuebner wrote:
> Add the compatible and grf values and allow the driver to also
> not select a specific crtc input on systems with only one vop.
> 
> Signed-off-by: Heiko Stuebner <heiko@sntech.de>
> ---
>  .../display/rockchip/dw_mipi_dsi_rockchip.txt |  1 +
>  .../gpu/drm/rockchip/dw-mipi-dsi-rockchip.c   | 25 +++++++++++++++++--
>  2 files changed, 24 insertions(+), 2 deletions(-)
> 

Reviewed-by: Rob Herring <robh@kernel.org>

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

end of thread, other threads:[~2018-12-20 21:42 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-17 12:36 [PATCH 00/15] drm/rockchip: add display support for rk3368 Heiko Stuebner
2018-12-17 12:36 ` [PATCH 01/15] clk: rockchip: add clock ids for dphy rx and tx channels on rk3368 Heiko Stuebner
2018-12-20 21:37   ` Rob Herring
2018-12-17 12:36 ` [PATCH 02/15] clk: rockchip: add clock id 24m dsi clock " Heiko Stuebner
2018-12-20 21:37   ` Rob Herring
2018-12-17 12:36 ` [PATCH 03/15] clk: rockchip: use clock ids for dphy rx and tx " Heiko Stuebner
2018-12-17 12:36 ` [PATCH 04/15] clk: rockchip: use clock id for 24m dsi " Heiko Stuebner
2018-12-17 12:36 ` [PATCH 05/15] drm/rockchip: dw_hdmi: add support for rk3368 Heiko Stuebner
2018-12-20 21:39   ` Rob Herring
2018-12-17 12:36 ` [PATCH 06/15] drm/rockchip: analogix_dp: add support for the rk3368 variant Heiko Stuebner
2018-12-20 21:40   ` Rob Herring
2018-12-17 12:36 ` [PATCH 07/15] drm/rockchip: dw-mipi-dsi: add support for rk3368-variant Heiko Stuebner
2018-12-20 21:42   ` Rob Herring
2018-12-17 12:36 ` [PATCH 08/15] arm64: dts: rockchip: default values for core clocks on rk3368 Heiko Stuebner
2018-12-17 12:36 ` [PATCH 09/15] arm64: dts: rockchip: add power-domain nodes " Heiko Stuebner
2018-12-17 12:36 ` [PATCH 10/15] arm64: dts: rockchip: add dw-hdmi controller " Heiko Stuebner
2018-12-17 12:36 ` [PATCH 11/15] arm64: dts: rockchip: add analogix-dp " Heiko Stuebner
2018-12-17 12:36 ` [PATCH 12/15] arm64: dts: rockchip: add dw-mipi-dsi " Heiko Stuebner
2018-12-17 12:36 ` [PATCH 13/15] arm64: dts: rockchip: add core display support for rk3368 Heiko Stuebner
2018-12-17 12:36 ` [PATCH 14/15] arm64: dts: rockchip: enable display on rk3368-r88 Heiko Stuebner
2018-12-17 12:36 ` [PATCH 15/15] arm64: defconfig: enable hym8563 rtc driver Heiko Stuebner

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