Skip to contentSkip to conversation

drm/rockchip: add display support for rk3368

PATCH In review Heiko Stuebner 2 participants 21 messages Dec 17, 2018 – Dec 20, 2018

Subsystems (6)
lore
Share & tools
lore

Heiko Stuebner

author maintainer
#0 lore raw

cover drm/rockchip: add display support for rk3368

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(-)
Signature · 6 lines
2.19.2

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
author maintainer
#1 lore raw

PATCH 1/15 clk: rockchip: add clock ids for dphy rx and tx channels on rk3368

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

---
 include/dt-bindings/clock/rk3368-cru.h | 2 ++
 1 file changed, 2 insertions(+)
include/dt-bindings/clock/rk3368-cru.h +2 -0
index a0063ed7284a..a4ed1f094da8 100644
@@ -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
Signature · 1 line
2.19.2
maintainer Reviewed-by on v1 1/15
#2 lore raw

Re: [PATCH 01/15] clk: rockchip: add clock ids for dphy rx and tx channels on rk3368

Quoted 8 lines · Heiko Stuebner

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

---
 include/dt-bindings/clock/rk3368-cru.h | 2 ++
 1 file changed, 2 insertions(+)
author maintainer
#3 lore raw

PATCH 2/15 clk: rockchip: add clock id 24m dsi clock on rk3368

In reply to Heiko Stuebner

Needed as input for the dsi controller.

---
 include/dt-bindings/clock/rk3368-cru.h | 1 +
 1 file changed, 1 insertion(+)
include/dt-bindings/clock/rk3368-cru.h +1 -0
index a4ed1f094da8..04fbcd92adc0 100644
@@ -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
Signature · 6 lines
2.19.2

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
author maintainer
#5 lore raw

PATCH 3/15 clk: rockchip: use clock ids for dphy rx and tx on rk3368

In reply to Heiko Stuebner

Export the clocks using the newly added clock ids.

---
 drivers/clk/rockchip/clk-rk3368.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/clk/rockchip/clk-rk3368.c +2 -2
index 7c4d242f19c1..58debf7daf85 100644
@@ -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),
Signature · 1 line
2.19.2
author maintainer
#6 lore raw

PATCH 4/15 clk: rockchip: use clock id for 24m dsi on rk3368

In reply to Heiko Stuebner

Export the clock using the newly added clock id.

---
 drivers/clk/rockchip/clk-rk3368.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/rockchip/clk-rk3368.c +1 -1
index 58debf7daf85..56ca10fe3e96 100644
@@ -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
Signature · 6 lines
2.19.2

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
author maintainer
#7 lore raw

PATCH 5/15 drm/rockchip: dw_hdmi: add support for rk3368

In reply to Heiko Stuebner

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

---
 .../display/rockchip/dw_hdmi-rockchip.txt         |  1 +
 drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c       | 15 +++++++++++++++
 2 files changed, 16 insertions(+)
Documentation/devicetree/bindings/display/rockchip/dw_hdmi-rockchip.txt +1 -0
index 39143424a474..6b8159a8bc57 100644
@@ -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.
drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c +15 -0
index 89c63cfde5c8..eca9a7d213ea 100644
@@ -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
 	},
Signature · 6 lines
2.19.2

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
maintainer Acked-by on v1 5/15
#8 lore raw

Re: [PATCH 05/15] drm/rockchip: dw_hdmi: add support for rk3368

Quoted 6 lines · Heiko Stuebner

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

---
 .../display/rockchip/dw_hdmi-rockchip.txt         |  1 +
Quoted 2 lines
 drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c       | 15 +++++++++++++++
 2 files changed, 16 insertions(+)
author maintainer
#9 lore raw

PATCH 6/15 drm/rockchip: analogix_dp: add support for the rk3368 variant

In reply to 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.

---
 .../display/rockchip/analogix_dp-rockchip.txt   |  1 +
 drivers/gpu/drm/rockchip/analogix_dp-rockchip.c | 17 +++++++++++++----
 2 files changed, 14 insertions(+), 4 deletions(-)
Documentation/devicetree/bindings/display/rockchip/analogix_dp-rockchip.txt +1 -0
index 43561584c13a..d0f7a1292355 100644
@@ -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
drivers/gpu/drm/rockchip/analogix_dp-rockchip.c +13 -4
index 080f05352195..acfcffc279ea 100644
@@ -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 },
 	{}
 };
Signature · 6 lines
2.19.2

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
maintainer Reviewed-by on v1 6/15
#10 lore raw

Re: [PATCH 06/15] drm/rockchip: analogix_dp: add support for the rk3368 variant

Quoted 6 lines · 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".

Quoted 9 lines

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.

---
 .../display/rockchip/analogix_dp-rockchip.txt   |  1 +
 drivers/gpu/drm/rockchip/analogix_dp-rockchip.c | 17 +++++++++++++----
 2 files changed, 14 insertions(+), 4 deletions(-)

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

author maintainer
#11 lore raw

PATCH 7/15 drm/rockchip: dw-mipi-dsi: add support for rk3368-variant

In reply to 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.

---
 .../display/rockchip/dw_mipi_dsi_rockchip.txt |  1 +
 .../gpu/drm/rockchip/dw-mipi-dsi-rockchip.c   | 25 +++++++++++++++++--
 2 files changed, 24 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/display/rockchip/dw_mipi_dsi_rockchip.txt +1 -0
index 6bb59ab39f2f..869fbc256d51 100644
@@ -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).
drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c +23 -2
index 7ee359bcee62..041647bfce71 100644
@@ -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,
Signature · 6 lines
2.19.2

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
maintainer Reviewed-by on v1 7/15
#12 lore raw

Re: [PATCH 07/15] drm/rockchip: dw-mipi-dsi: add support for rk3368-variant

Quoted 9 lines · 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.

---
 .../display/rockchip/dw_mipi_dsi_rockchip.txt |  1 +
 .../gpu/drm/rockchip/dw-mipi-dsi-rockchip.c   | 25 +++++++++++++++++--
 2 files changed, 24 insertions(+), 2 deletions(-)
author maintainer
#13 lore raw

PATCH 8/15 arm64: dts: rockchip: default values for core clocks on rk3368

In reply to 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.

---
 arch/arm64/boot/dts/rockchip/rk3368.dtsi | 10 ++++++++++
 1 file changed, 10 insertions(+)
arch/arm64/boot/dts/rockchip/rk3368.dtsi +10 -0
index 7014d10b954c..3ef1c27cb7d3 100644
@@ -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 {
Signature · 6 lines
2.19.2

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
author maintainer
#14 lore raw

PATCH 9/15 arm64: dts: rockchip: add power-domain nodes on rk3368

In reply to 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.

---
 arch/arm64/boot/dts/rockchip/rk3368.dtsi | 177 +++++++++++++++++++++++
 1 file changed, 177 insertions(+)
arch/arm64/boot/dts/rockchip/rk3368.dtsi +177 -0
index 3ef1c27cb7d3..e79c5985f60a 100644
@@ -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>;
Signature · 6 lines
2.19.2

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
author maintainer
#15 lore raw

PATCH 10/15 arm64: dts: rockchip: add dw-hdmi controller on rk3368

In reply to Heiko Stuebner

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

---
 arch/arm64/boot/dts/rockchip/rk3368.dtsi | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
arch/arm64/boot/dts/rockchip/rk3368.dtsi +14 -0
index e79c5985f60a..4ddf380a2c2d 100644
@@ -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>,
Signature · 6 lines
2.19.2

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
author maintainer
#16 lore raw

PATCH 11/15 arm64: dts: rockchip: add analogix-dp controller on rk3368

In reply to Heiko Stuebner

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

---
 arch/arm64/boot/dts/rockchip/rk3368.dtsi | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
arch/arm64/boot/dts/rockchip/rk3368.dtsi +22 -0
index 4ddf380a2c2d..e30cbf30c026 100644
@@ -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>;
Signature · 6 lines
2.19.2

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
author maintainer
#17 lore raw

PATCH 12/15 arm64: dts: rockchip: add dw-mipi-dsi controller on rk3368

In reply to Heiko Stuebner

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

---
 arch/arm64/boot/dts/rockchip/rk3368.dtsi | 13 +++++++++++++
 1 file changed, 13 insertions(+)
arch/arm64/boot/dts/rockchip/rk3368.dtsi +13 -0
index e30cbf30c026..f03f57d96515 100644
@@ -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>;
Signature · 6 lines
2.19.2

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
author maintainer
#18 lore raw

PATCH 13/15 arm64: dts: rockchip: add core display support for rk3368

In reply to Heiko Stuebner

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

---
 arch/arm64/boot/dts/rockchip/rk3368.dtsi | 73 ++++++++++++++++++++++++
 1 file changed, 73 insertions(+)
arch/arm64/boot/dts/rockchip/rk3368.dtsi +73 -0
index f03f57d96515..0a2523e706ae 100644
@@ -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 {
Signature · 6 lines
2.19.2

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
author maintainer
#19 lore raw

PATCH 14/15 arm64: dts: rockchip: enable display on rk3368-r88

In reply to Heiko Stuebner

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

---
 arch/arm64/boot/dts/rockchip/rk3368-r88.dts | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
arch/arm64/boot/dts/rockchip/rk3368-r88.dts +17 -0
index 7452bedf1a7e..1469f9d59bb9 100644
@@ -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";
 };
Signature · 6 lines
2.19.2

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
author maintainer
#20 lore raw

PATCH 15/15 arm64: defconfig: enable hym8563 rtc driver

In reply to 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.

---
 arch/arm64/configs/defconfig | 1 +
 1 file changed, 1 insertion(+)
arch/arm64/configs/defconfig +1 -0
index c9a57d11330b..eb5b0320c3a2 100644
@@ -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
Signature · 6 lines
2.19.2

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel