linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCHv2 00/10] ARM: DRA7: add display support
@ 2015-03-24 14:55 Tomi Valkeinen
  2015-03-24 14:55 ` [PATCHv2 01/10] arm/dts: dra7xx: add 'ti, set-rate-parent' for dss_dss_clk Tomi Valkeinen
                   ` (9 more replies)
  0 siblings, 10 replies; 14+ messages in thread
From: Tomi Valkeinen @ 2015-03-24 14:55 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

This series adds the arch/arm/ side of the display support for DRA7 (DRA72x,
DRA74x, AM54xx) SoCs. Also support for HDMI output on x15 and DRA72 EVM boards
is added.

This series is v2, and is based on Tero's "[PATCHv5 00/35] ARM: OMAP2+:
PRCM/SCM cleanups against 4.0-rc" series. The difference to v1 is that the
DESHDCP clock is a real clock, even if we still always enable it at boot time.

 Tomi

Tomi Valkeinen (10):
  arm/dts: dra7xx: add 'ti,set-rate-parent' for dss_dss_clk
  ARM: DRA7: hwmod: add DMM hwmod description
  ARM: DRA7: hwmod: set DSS submodule parent hwmods
  ARM: OMAP: display: change compat names to array
  ARM: OMAP2+: display: detect DRA7 DSS
  arm/dts: dra7.dtsi: add DSS support
  arm/dts: dra72-evm.dts: add HDMI
  arm/dts: am57xx-beagle-x15.dts: add HDMI
  arm: dra7: add DESHDCP clock
  CLK: TI: always enable DESHDCP clock

 arch/arm/boot/dts/am57xx-beagle-x15.dts   |  81 ++++++++++++++++++++++
 arch/arm/boot/dts/dra7.dtsi               |  43 ++++++++++++
 arch/arm/boot/dts/dra72-evm.dts           | 110 ++++++++++++++++++++++++++++++
 arch/arm/boot/dts/dra72x.dtsi             |  11 +++
 arch/arm/boot/dts/dra74x.dtsi             |  15 ++++
 arch/arm/boot/dts/dra7xx-clocks.dtsi      |  11 +++
 arch/arm/mach-omap2/display.c             |  32 +++++----
 arch/arm/mach-omap2/omap_hwmod_7xx_data.c |  33 +++++++++
 drivers/clk/ti/clk-7xx.c                  |   8 ++-
 9 files changed, 328 insertions(+), 16 deletions(-)

-- 
2.3.3

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

* [PATCHv2 01/10] arm/dts: dra7xx: add 'ti, set-rate-parent' for dss_dss_clk
  2015-03-24 14:55 [PATCHv2 00/10] ARM: DRA7: add display support Tomi Valkeinen
@ 2015-03-24 14:55 ` Tomi Valkeinen
  2015-03-24 14:55 ` [PATCHv2 02/10] ARM: DRA7: hwmod: add DMM hwmod description Tomi Valkeinen
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: Tomi Valkeinen @ 2015-03-24 14:55 UTC (permalink / raw)
  To: linux-arm-kernel

We need set-rate-parent flags for the display's clock path so that the
DSS driver can change the clock rate of the PLL.

This patchs adds the ti,set-rate-parent flag to 'dss_dss_clk' clock
node, which is only a gate clock, allowing the setting of the clock rate
to propagate to the PLL.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: devicetree at vger.kernel.org
---
 arch/arm/boot/dts/dra7xx-clocks.dtsi | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/boot/dts/dra7xx-clocks.dtsi b/arch/arm/boot/dts/dra7xx-clocks.dtsi
index 4bdcbd61ce47..0d76233840e6 100644
--- a/arch/arm/boot/dts/dra7xx-clocks.dtsi
+++ b/arch/arm/boot/dts/dra7xx-clocks.dtsi
@@ -1451,6 +1451,7 @@
 		clocks = <&dpll_per_h12x2_ck>;
 		ti,bit-shift = <8>;
 		reg = <0x1120>;
+		ti,set-rate-parent;
 	};
 
 	dss_hdmi_clk: dss_hdmi_clk {
-- 
2.3.3

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

* [PATCHv2 02/10] ARM: DRA7: hwmod: add DMM hwmod description
  2015-03-24 14:55 [PATCHv2 00/10] ARM: DRA7: add display support Tomi Valkeinen
  2015-03-24 14:55 ` [PATCHv2 01/10] arm/dts: dra7xx: add 'ti, set-rate-parent' for dss_dss_clk Tomi Valkeinen
@ 2015-03-24 14:55 ` Tomi Valkeinen
  2015-04-03 19:02   ` Paul Walmsley
  2015-03-24 14:55 ` [PATCHv2 03/10] ARM: DRA7: hwmod: set DSS submodule parent hwmods Tomi Valkeinen
                   ` (7 subsequent siblings)
  9 siblings, 1 reply; 14+ messages in thread
From: Tomi Valkeinen @ 2015-03-24 14:55 UTC (permalink / raw)
  To: linux-arm-kernel

Add DMM hwmod entries for DRA7. This is identical to DMM on OMAP5.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
 arch/arm/mach-omap2/omap_hwmod_7xx_data.c | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/arch/arm/mach-omap2/omap_hwmod_7xx_data.c b/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
index e8692e7675b8..c236ea9bb940 100644
--- a/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
@@ -49,6 +49,27 @@
  */
 
 /*
+ * 'dmm' class
+ * instance(s): dmm
+ */
+static struct omap_hwmod_class dra7xx_dmm_hwmod_class = {
+	.name	= "dmm",
+};
+
+/* dmm */
+static struct omap_hwmod dra7xx_dmm_hwmod = {
+	.name		= "dmm",
+	.class		= &dra7xx_dmm_hwmod_class,
+	.clkdm_name	= "emif_clkdm",
+	.prcm = {
+		.omap4 = {
+			.clkctrl_offs = DRA7XX_CM_EMIF_DMM_CLKCTRL_OFFSET,
+			.context_offs = DRA7XX_RM_EMIF_DMM_CONTEXT_OFFSET,
+		},
+	},
+};
+
+/*
  * 'l3' class
  * instance(s): l3_instr, l3_main_1, l3_main_2
  */
@@ -2313,6 +2334,14 @@ static struct omap_hwmod dra7xx_wd_timer2_hwmod = {
  * Interfaces
  */
 
+/* l3_main_1 -> dmm */
+static struct omap_hwmod_ocp_if dra7xx_l3_main_1__dmm = {
+	.master		= &dra7xx_l3_main_1_hwmod,
+	.slave		= &dra7xx_dmm_hwmod,
+	.clk		= "l3_iclk_div",
+	.user		= OCP_USER_SDMA,
+};
+
 /* l3_main_2 -> l3_instr */
 static struct omap_hwmod_ocp_if dra7xx_l3_main_2__l3_instr = {
 	.master		= &dra7xx_l3_main_2_hwmod,
@@ -3265,6 +3294,7 @@ static struct omap_hwmod_ocp_if dra7xx_l4_wkup__wd_timer2 = {
 };
 
 static struct omap_hwmod_ocp_if *dra7xx_hwmod_ocp_ifs[] __initdata = {
+	&dra7xx_l3_main_1__dmm,
 	&dra7xx_l3_main_2__l3_instr,
 	&dra7xx_l4_cfg__l3_main_1,
 	&dra7xx_mpu__l3_main_1,
-- 
2.3.3

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

* [PATCHv2 03/10] ARM: DRA7: hwmod: set DSS submodule parent hwmods
  2015-03-24 14:55 [PATCHv2 00/10] ARM: DRA7: add display support Tomi Valkeinen
  2015-03-24 14:55 ` [PATCHv2 01/10] arm/dts: dra7xx: add 'ti, set-rate-parent' for dss_dss_clk Tomi Valkeinen
  2015-03-24 14:55 ` [PATCHv2 02/10] ARM: DRA7: hwmod: add DMM hwmod description Tomi Valkeinen
@ 2015-03-24 14:55 ` Tomi Valkeinen
  2015-04-03 19:03   ` Paul Walmsley
  2015-03-24 14:55 ` [PATCHv2 04/10] ARM: OMAP: display: change compat names to array Tomi Valkeinen
                   ` (6 subsequent siblings)
  9 siblings, 1 reply; 14+ messages in thread
From: Tomi Valkeinen @ 2015-03-24 14:55 UTC (permalink / raw)
  To: linux-arm-kernel

Set DSS core hwmod as the parent for all the DSS submodules.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
 arch/arm/mach-omap2/omap_hwmod_7xx_data.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/mach-omap2/omap_hwmod_7xx_data.c b/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
index c236ea9bb940..0411b838b4fa 100644
--- a/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
@@ -521,6 +521,7 @@ static struct omap_hwmod dra7xx_dss_dispc_hwmod = {
 		},
 	},
 	.dev_attr	= &dss_dispc_dev_attr,
+	.parent_hwmod	= &dra7xx_dss_hwmod,
 };
 
 /*
@@ -562,6 +563,7 @@ static struct omap_hwmod dra7xx_dss_hdmi_hwmod = {
 	},
 	.opt_clks	= dss_hdmi_opt_clks,
 	.opt_clks_cnt	= ARRAY_SIZE(dss_hdmi_opt_clks),
+	.parent_hwmod	= &dra7xx_dss_hwmod,
 };
 
 /*
-- 
2.3.3

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

* [PATCHv2 04/10] ARM: OMAP: display: change compat names to array
  2015-03-24 14:55 [PATCHv2 00/10] ARM: DRA7: add display support Tomi Valkeinen
                   ` (2 preceding siblings ...)
  2015-03-24 14:55 ` [PATCHv2 03/10] ARM: DRA7: hwmod: set DSS submodule parent hwmods Tomi Valkeinen
@ 2015-03-24 14:55 ` Tomi Valkeinen
  2015-03-24 14:55 ` [PATCHv2 05/10] ARM: OMAP2+: display: detect DRA7 DSS Tomi Valkeinen
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: Tomi Valkeinen @ 2015-03-24 14:55 UTC (permalink / raw)
  To: linux-arm-kernel

Simplify the DSS detection logic by creating a list of the omapdss
compat strings, instead of checking each separately with an 'if'.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
 arch/arm/mach-omap2/display.c | 29 ++++++++++++++---------------
 1 file changed, 14 insertions(+), 15 deletions(-)

diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c
index f492ae147c6a..9868d0bc7805 100644
--- a/arch/arm/mach-omap2/display.c
+++ b/arch/arm/mach-omap2/display.c
@@ -568,25 +568,24 @@ void __init omapdss_early_init_of(void)
 
 }
 
+static const char * const omapdss_compat_names[] __initconst = {
+	"ti,omap2-dss",
+	"ti,omap3-dss",
+	"ti,omap4-dss",
+	"ti,omap5-dss",
+};
+
 struct device_node * __init omapdss_find_dss_of_node(void)
 {
 	struct device_node *node;
+	int i;
 
-	node = of_find_compatible_node(NULL, NULL, "ti,omap2-dss");
-	if (node)
-		return node;
-
-	node = of_find_compatible_node(NULL, NULL, "ti,omap3-dss");
-	if (node)
-		return node;
-
-	node = of_find_compatible_node(NULL, NULL, "ti,omap4-dss");
-	if (node)
-		return node;
-
-	node = of_find_compatible_node(NULL, NULL, "ti,omap5-dss");
-	if (node)
-		return node;
+	for (i = 0; i < ARRAY_SIZE(omapdss_compat_names); ++i) {
+		node = of_find_compatible_node(NULL, NULL,
+			omapdss_compat_names[i]);
+		if (node)
+			return node;
+	}
 
 	return NULL;
 }
-- 
2.3.3

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

* [PATCHv2 05/10] ARM: OMAP2+: display: detect DRA7 DSS
  2015-03-24 14:55 [PATCHv2 00/10] ARM: DRA7: add display support Tomi Valkeinen
                   ` (3 preceding siblings ...)
  2015-03-24 14:55 ` [PATCHv2 04/10] ARM: OMAP: display: change compat names to array Tomi Valkeinen
@ 2015-03-24 14:55 ` Tomi Valkeinen
  2015-03-24 14:55 ` [PATCHv2 06/10] arm/dts: dra7.dtsi: add DSS support Tomi Valkeinen
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: Tomi Valkeinen @ 2015-03-24 14:55 UTC (permalink / raw)
  To: linux-arm-kernel

Add platform code to detect DRA7 DSS.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
 arch/arm/mach-omap2/display.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c
index 9868d0bc7805..6ab13d18c636 100644
--- a/arch/arm/mach-omap2/display.c
+++ b/arch/arm/mach-omap2/display.c
@@ -287,6 +287,8 @@ static enum omapdss_version __init omap_display_get_version(void)
 		return OMAPDSS_VER_OMAP5;
 	else if (soc_is_am43xx())
 		return OMAPDSS_VER_AM43xx;
+	else if (soc_is_dra7xx())
+		return OMAPDSS_VER_DRA7xx;
 	else
 		return OMAPDSS_VER_UNKNOWN;
 }
@@ -573,6 +575,7 @@ static const char * const omapdss_compat_names[] __initconst = {
 	"ti,omap3-dss",
 	"ti,omap4-dss",
 	"ti,omap5-dss",
+	"ti,dra7-dss",
 };
 
 struct device_node * __init omapdss_find_dss_of_node(void)
-- 
2.3.3

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

* [PATCHv2 06/10] arm/dts: dra7.dtsi: add DSS support
  2015-03-24 14:55 [PATCHv2 00/10] ARM: DRA7: add display support Tomi Valkeinen
                   ` (4 preceding siblings ...)
  2015-03-24 14:55 ` [PATCHv2 05/10] ARM: OMAP2+: display: detect DRA7 DSS Tomi Valkeinen
@ 2015-03-24 14:55 ` Tomi Valkeinen
  2015-03-24 14:55 ` [PATCHv2 07/10] arm/dts: dra72-evm.dts: add HDMI Tomi Valkeinen
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: Tomi Valkeinen @ 2015-03-24 14:55 UTC (permalink / raw)
  To: linux-arm-kernel

DRA7xxx contains a very similar DSS to OMAP5. The main differences are:

* no DSI or RFBI support.
* 1 or 2 dedicated video PLLs.
* need to do additional configuration to the DRA7 CONTROL module.

DRA72xx has only one video PLL, and DRA74xx has two.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: devicetree at vger.kernel.org
---
 arch/arm/boot/dts/dra7.dtsi   | 38 ++++++++++++++++++++++++++++++++++++++
 arch/arm/boot/dts/dra72x.dtsi | 11 +++++++++++
 arch/arm/boot/dts/dra74x.dtsi | 15 +++++++++++++++
 3 files changed, 64 insertions(+)

diff --git a/arch/arm/boot/dts/dra7.dtsi b/arch/arm/boot/dts/dra7.dtsi
index 8e50ca3fc102..312ede660b23 100644
--- a/arch/arm/boot/dts/dra7.dtsi
+++ b/arch/arm/boot/dts/dra7.dtsi
@@ -1445,6 +1445,44 @@
 			clocks = <&sys_clkin1>;
 			status = "disabled";
 		};
+
+		dss: dss at 58000000 {
+			compatible = "ti,dra7-dss";
+			/* 'reg' defined in dra72x.dtsi and dra74x.dtsi */
+			/* 'clocks' defined in dra72x.dtsi and dra74x.dtsi */
+			status = "disabled";
+			ti,hwmods = "dss_core";
+			/* CTRL_CORE_DSS_PLL_CONTROL */
+			syscon-pll-ctrl = <&scm_conf 0x538>;
+			#address-cells = <1>;
+			#size-cells = <1>;
+			ranges;
+
+			dispc at 58001000 {
+				compatible = "ti,dra7-dispc";
+				reg = <0x58001000 0x1000>;
+				interrupts = <GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH>;
+				ti,hwmods = "dss_dispc";
+				clocks = <&dss_dss_clk>;
+				clock-names = "fck";
+				/* CTRL_CORE_SMA_SW_1 */
+				syscon-pol = <&scm_conf 0x534>;
+			};
+
+			hdmi: encoder at 58060000 {
+				compatible = "ti,dra7-hdmi";
+				reg = <0x58040000 0x200>,
+				      <0x58040200 0x80>,
+				      <0x58040300 0x80>,
+				      <0x58060000 0x19000>;
+				reg-names = "wp", "pll", "phy", "core";
+				interrupts = <GIC_SPI 96 IRQ_TYPE_LEVEL_HIGH>;
+				status = "disabled";
+				ti,hwmods = "dss_hdmi";
+				clocks = <&dss_48mhz_clk>, <&dss_hdmi_clk>;
+				clock-names = "fck", "sys_clk";
+			};
+		};
 	};
 };
 
diff --git a/arch/arm/boot/dts/dra72x.dtsi b/arch/arm/boot/dts/dra72x.dtsi
index e5a3d23a3df1..0866866c8e94 100644
--- a/arch/arm/boot/dts/dra72x.dtsi
+++ b/arch/arm/boot/dts/dra72x.dtsi
@@ -28,3 +28,14 @@
 		interrupts = <GIC_SPI DIRECT_IRQ(131) IRQ_TYPE_LEVEL_HIGH>;
 	};
 };
+
+&dss {
+	reg = <0x58000000 0x80>,
+	      <0x58004054 0x4>,
+	      <0x58004300 0x20>;
+	reg-names = "dss", "pll1_clkctrl", "pll1";
+
+	clocks = <&dss_dss_clk>,
+		 <&dss_video1_clk>;
+	clock-names = "fck", "video1_clk";
+};
diff --git a/arch/arm/boot/dts/dra74x.dtsi b/arch/arm/boot/dts/dra74x.dtsi
index 10173fab1a15..1a4f4970aaad 100644
--- a/arch/arm/boot/dts/dra74x.dtsi
+++ b/arch/arm/boot/dts/dra74x.dtsi
@@ -67,3 +67,18 @@
 		};
 	};
 };
+
+&dss {
+	reg = <0x58000000 0x80>,
+	      <0x58004054 0x4>,
+	      <0x58004300 0x20>,
+	      <0x58005054 0x4>,
+	      <0x58005300 0x20>;
+	reg-names = "dss", "pll1_clkctrl", "pll1",
+		    "pll2_clkctrl", "pll2";
+
+	clocks = <&dss_dss_clk>,
+		 <&dss_video1_clk>,
+		 <&dss_video2_clk>;
+	clock-names = "fck", "video1_clk", "video2_clk";
+};
-- 
2.3.3

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

* [PATCHv2 07/10] arm/dts: dra72-evm.dts: add HDMI
  2015-03-24 14:55 [PATCHv2 00/10] ARM: DRA7: add display support Tomi Valkeinen
                   ` (5 preceding siblings ...)
  2015-03-24 14:55 ` [PATCHv2 06/10] arm/dts: dra7.dtsi: add DSS support Tomi Valkeinen
@ 2015-03-24 14:55 ` Tomi Valkeinen
  2015-03-24 14:55 ` [PATCHv2 08/10] arm/dts: am57xx-beagle-x15.dts: " Tomi Valkeinen
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: Tomi Valkeinen @ 2015-03-24 14:55 UTC (permalink / raw)
  To: linux-arm-kernel

DRA72 EVM has a HDMI output. This patch adds the device tree nodes
required for HDMI.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: devicetree at vger.kernel.org
---
 arch/arm/boot/dts/dra72-evm.dts | 110 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 110 insertions(+)

diff --git a/arch/arm/boot/dts/dra72-evm.dts b/arch/arm/boot/dts/dra72-evm.dts
index 4d8711713610..c752d7aa302d 100644
--- a/arch/arm/boot/dts/dra72-evm.dts
+++ b/arch/arm/boot/dts/dra72-evm.dts
@@ -19,6 +19,10 @@
 		reg = <0x80000000 0x40000000>; /* 1024 MB */
 	};
 
+	aliases {
+		display0 = &hdmi0;
+	};
+
 	evm_3v3: fixedregulator-evm_3v3 {
 		compatible = "regulator-fixed";
 		regulator-name = "evm_3v3";
@@ -35,6 +39,51 @@
 		compatible = "linux,extcon-usb-gpio";
 		id-gpio = <&pcf_gpio_21 2 GPIO_ACTIVE_HIGH>;
 	};
+
+	hdmi0: connector {
+		compatible = "hdmi-connector";
+		label = "hdmi";
+
+		type = "a";
+
+		port {
+			hdmi_connector_in: endpoint {
+				remote-endpoint = <&tpd12s015_out>;
+			};
+		};
+	};
+
+	tpd12s015: encoder {
+		compatible = "ti,tpd12s015";
+
+		pinctrl-names = "default";
+		pinctrl-0 = <&tpd12s015_pins>;
+
+		gpios = <&pcf_hdmi 4 GPIO_ACTIVE_HIGH>,	/* P4, CT CP HPD */
+			<&pcf_hdmi 5 GPIO_ACTIVE_HIGH>,	/* P5, LS OE */
+			<&gpio7 12 GPIO_ACTIVE_HIGH>;	/* gpio7_12/sp1_cs2, HPD */
+
+		ports {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			port at 0 {
+				reg = <0>;
+
+				tpd12s015_in: endpoint {
+					remote-endpoint = <&hdmi_out>;
+				};
+			};
+
+			port at 1 {
+				reg = <1>;
+
+				tpd12s015_out: endpoint {
+					remote-endpoint = <&hdmi_connector_in>;
+				};
+			};
+		};
+	};
 };
 
 &dra7_pmx_core {
@@ -45,6 +94,13 @@
 		>;
 	};
 
+	i2c5_pins: pinmux_i2c5_pins {
+		pinctrl-single,pins = <
+			0x2b4 (PIN_INPUT | MUX_MODE10) /* mcasp1_axr0.i2c5_sda */
+			0x2b8 (PIN_INPUT | MUX_MODE10) /* mcasp1_axr1.i2c5_scl */
+		>;
+	};
+
 	nand_default: nand_default {
 		pinctrl-single,pins = <
 			0x0	(PIN_INPUT  | MUX_MODE0) /* gpmc_ad0 */
@@ -144,6 +200,19 @@
 			0xb8 (PIN_OUTPUT | MUX_MODE1)	/* gpmc_cs2.qspi1_cs0 */
 		>;
 	};
+
+	hdmi_pins: pinmux_hdmi_pins {
+		pinctrl-single,pins = <
+			0x408 (PIN_INPUT | MUX_MODE1) /* i2c2_sda.hdmi1_ddc_scl */
+			0x40c (PIN_INPUT | MUX_MODE1) /* i2c2_scl.hdmi1_ddc_sda */
+		>;
+	};
+
+	tpd12s015_pins: pinmux_tpd12s015_pins {
+		pinctrl-single,pins = <
+			0x3b8 (PIN_INPUT_PULLDOWN | MUX_MODE14) /* gpio7_12 HPD */
+		>;
+	};
 };
 
 &i2c1 {
@@ -280,6 +349,27 @@
 	};
 };
 
+&i2c5 {
+	status = "okay";
+	pinctrl-names = "default";
+	pinctrl-0 = <&i2c5_pins>;
+	clock-frequency = <400000>;
+
+	pcf_hdmi: pcf8575 at 26 {
+		compatible = "nxp,pcf8575";
+		reg = <0x26>;
+		gpio-controller;
+		#gpio-cells = <2>;
+		/*
+		 * initial state is used here to keep the mdio interface
+		 * selected on RU89 through SEL_VIN4_MUX_S0, VIN2_S1 and
+		 * VIN2_S0 driven high otherwise Ethernet stops working
+		 * VIN6_SEL_S0 is low, thus selecting McASP3 over VIN6
+		 */
+		lines-initial-states = <0x0f2b>;
+	};
+};
+
 &uart1 {
 	status = "okay";
 };
@@ -569,3 +659,23 @@
 		};
 	};
 };
+
+&dss {
+	status = "ok";
+
+	vdda_video-supply = <&ldo5_reg>;
+};
+
+&hdmi {
+	status = "ok";
+	vdda-supply = <&ldo3_reg>;
+
+	pinctrl-names = "default";
+	pinctrl-0 = <&hdmi_pins>;
+
+	port {
+		hdmi_out: endpoint {
+			remote-endpoint = <&tpd12s015_in>;
+		};
+	};
+};
-- 
2.3.3

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

* [PATCHv2 08/10] arm/dts: am57xx-beagle-x15.dts: add HDMI
  2015-03-24 14:55 [PATCHv2 00/10] ARM: DRA7: add display support Tomi Valkeinen
                   ` (6 preceding siblings ...)
  2015-03-24 14:55 ` [PATCHv2 07/10] arm/dts: dra72-evm.dts: add HDMI Tomi Valkeinen
@ 2015-03-24 14:55 ` Tomi Valkeinen
  2015-03-24 14:55 ` [PATCHv2 09/10] arm: dra7: add DESHDCP clock Tomi Valkeinen
  2015-03-24 14:55 ` [PATCHv2 10/10] CLK: TI: always enable " Tomi Valkeinen
  9 siblings, 0 replies; 14+ messages in thread
From: Tomi Valkeinen @ 2015-03-24 14:55 UTC (permalink / raw)
  To: linux-arm-kernel

AM57xx Beagle X15 has a HDMI output. This patch adds the device tree
nodes required for HDMI.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: devicetree at vger.kernel.org
---
 arch/arm/boot/dts/am57xx-beagle-x15.dts | 81 +++++++++++++++++++++++++++++++++
 1 file changed, 81 insertions(+)

diff --git a/arch/arm/boot/dts/am57xx-beagle-x15.dts b/arch/arm/boot/dts/am57xx-beagle-x15.dts
index 03750af3b49a..7184fc16d31e 100644
--- a/arch/arm/boot/dts/am57xx-beagle-x15.dts
+++ b/arch/arm/boot/dts/am57xx-beagle-x15.dts
@@ -19,6 +19,7 @@
 	aliases {
 		rtc0 = &mcp_rtc;
 		rtc1 = &tps659038_rtc;
+		display0 = &hdmi0;
 	};
 
 	memory {
@@ -102,6 +103,51 @@
 		pinctrl-names = "default";
 		pinctrl-0 = <&extcon_usb2_pins>;
 	};
+
+	hdmi0: connector {
+		compatible = "hdmi-connector";
+		label = "hdmi";
+
+		type = "a";
+
+		port {
+			hdmi_connector_in: endpoint {
+				remote-endpoint = <&tpd12s015_out>;
+			};
+		};
+	};
+
+	tpd12s015: encoder {
+		compatible = "ti,tpd12s015";
+
+		pinctrl-names = "default";
+		pinctrl-0 = <&tpd12s015_pins>;
+
+		gpios = <&gpio7 10 GPIO_ACTIVE_HIGH>,	/* gpio7_10, CT CP HPD */
+			<&gpio6 28 GPIO_ACTIVE_HIGH>,	/* gpio6_28, LS OE */
+			<&gpio7 12 GPIO_ACTIVE_HIGH>;	/* gpio7_12/sp1_cs2, HPD */
+
+		ports {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			port at 0 {
+				reg = <0>;
+
+				tpd12s015_in: endpoint {
+					remote-endpoint = <&hdmi_out>;
+				};
+			};
+
+			port at 1 {
+				reg = <1>;
+
+				tpd12s015_out: endpoint {
+					remote-endpoint = <&hdmi_connector_in>;
+				};
+			};
+		};
+	};
 };
 
 &dra7_pmx_core {
@@ -121,6 +167,13 @@
 		>;
 	};
 
+	hdmi_pins: pinmux_hdmi_pins {
+		pinctrl-single,pins = <
+			0x408 (PIN_INPUT | MUX_MODE1)	/* i2c2_sda.hdmi1_ddc_scl */
+			0x40c (PIN_INPUT | MUX_MODE1)	/* i2c2_scl.hdmi1_ddc_sda */
+		>;
+	};
+
 	i2c3_pins_default: i2c3_pins_default {
 		pinctrl-single,pins = <
 			0x2a4 (PIN_INPUT| MUX_MODE10)	/* mcasp1_aclkx.i2c3_sda */
@@ -277,6 +330,14 @@
 			0x3e8 (PIN_INPUT_PULLUP | MUX_MODE14) /* uart1_ctsn.gpio7_24 */
 		>;
 	};
+
+	tpd12s015_pins: pinmux_tpd12s015_pins {
+		pinctrl-single,pins = <
+			0x3b0 (PIN_OUTPUT | MUX_MODE14)		/* gpio7_10 CT_CP_HPD */
+			0x3b8 (PIN_INPUT_PULLDOWN | MUX_MODE14)	/* gpio7_12 HPD */
+			0x370 (PIN_OUTPUT | MUX_MODE14)		/* gpio6_28 LS_OE */
+		>;
+	};
 };
 
 &i2c1 {
@@ -560,3 +621,23 @@
 &usb2 {
 	dr_mode = "peripheral";
 };
+
+&dss {
+	status = "ok";
+
+	vdda_video-supply = <&ldoln_reg>;
+};
+
+&hdmi {
+	status = "ok";
+	vdda-supply = <&ldo3_reg>;
+
+	pinctrl-names = "default";
+	pinctrl-0 = <&hdmi_pins>;
+
+	port {
+		hdmi_out: endpoint {
+			remote-endpoint = <&tpd12s015_in>;
+		};
+	};
+};
-- 
2.3.3

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

* [PATCHv2 09/10] arm: dra7: add DESHDCP clock
  2015-03-24 14:55 [PATCHv2 00/10] ARM: DRA7: add display support Tomi Valkeinen
                   ` (7 preceding siblings ...)
  2015-03-24 14:55 ` [PATCHv2 08/10] arm/dts: am57xx-beagle-x15.dts: " Tomi Valkeinen
@ 2015-03-24 14:55 ` Tomi Valkeinen
  2015-03-24 14:55 ` [PATCHv2 10/10] CLK: TI: always enable " Tomi Valkeinen
  9 siblings, 0 replies; 14+ messages in thread
From: Tomi Valkeinen @ 2015-03-24 14:55 UTC (permalink / raw)
  To: linux-arm-kernel

Add a new Linux clock for DRA7 based SoCs to control DESHDCP clock.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
 arch/arm/boot/dts/dra7.dtsi               |  5 +++++
 arch/arm/boot/dts/dra7xx-clocks.dtsi      | 10 ++++++++++
 arch/arm/mach-omap2/omap_hwmod_7xx_data.c |  1 +
 drivers/clk/ti/clk-7xx.c                  |  1 +
 4 files changed, 17 insertions(+)

diff --git a/arch/arm/boot/dts/dra7.dtsi b/arch/arm/boot/dts/dra7.dtsi
index 312ede660b23..c06f30a76f5c 100644
--- a/arch/arm/boot/dts/dra7.dtsi
+++ b/arch/arm/boot/dts/dra7.dtsi
@@ -123,6 +123,11 @@
 							regulator-max-microvolt = <3000000>;
 						};
 					};
+
+					scm_conf_clocks: clocks {
+						#address-cells = <1>;
+						#size-cells = <0>;
+					};
 				};
 
 				dra7_pmx_core: pinmux at 1400 {
diff --git a/arch/arm/boot/dts/dra7xx-clocks.dtsi b/arch/arm/boot/dts/dra7xx-clocks.dtsi
index 0d76233840e6..a93754cf5e2f 100644
--- a/arch/arm/boot/dts/dra7xx-clocks.dtsi
+++ b/arch/arm/boot/dts/dra7xx-clocks.dtsi
@@ -2057,3 +2057,13 @@
 		clocks = <&dpll_usb_ck>;
 	};
 };
+
+&scm_conf_clocks {
+	dss_deshdcp_clk: dss_deshdcp_clk {
+		#clock-cells = <0>;
+		compatible = "ti,gate-clock";
+		clocks = <&l3_iclk_div>;
+		ti,bit-shift = <0>;
+		reg = <0x558>;
+	};
+};
diff --git a/arch/arm/mach-omap2/omap_hwmod_7xx_data.c b/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
index 0411b838b4fa..97e3d7a62729 100644
--- a/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
@@ -459,6 +459,7 @@ static struct omap_hwmod_opt_clk dss_opt_clks[] = {
 	{ .role = "video2_clk", .clk = "dss_video2_clk" },
 	{ .role = "video1_clk", .clk = "dss_video1_clk" },
 	{ .role = "hdmi_clk", .clk = "dss_hdmi_clk" },
+	{ .role = "hdcp_clk", .clk = "dss_deshdcp_clk" },
 };
 
 static struct omap_hwmod dra7xx_dss_hwmod = {
diff --git a/drivers/clk/ti/clk-7xx.c b/drivers/clk/ti/clk-7xx.c
index ee32f4deebf4..7b859ec31a14 100644
--- a/drivers/clk/ti/clk-7xx.c
+++ b/drivers/clk/ti/clk-7xx.c
@@ -301,6 +301,7 @@ static struct ti_dt_clk dra7xx_clks[] = {
 	DT_CLK("48824000.timer", "timer_sys_ck", "timer_sys_clk_div"),
 	DT_CLK("48826000.timer", "timer_sys_ck", "timer_sys_clk_div"),
 	DT_CLK(NULL, "sys_clkin", "sys_clkin1"),
+	DT_CLK(NULL, "dss_deshdcp_clk", "dss_deshdcp_clk"),
 	{ .node_name = NULL },
 };
 
-- 
2.3.3

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

* [PATCHv2 10/10] CLK: TI: always enable DESHDCP clock
  2015-03-24 14:55 [PATCHv2 00/10] ARM: DRA7: add display support Tomi Valkeinen
                   ` (8 preceding siblings ...)
  2015-03-24 14:55 ` [PATCHv2 09/10] arm: dra7: add DESHDCP clock Tomi Valkeinen
@ 2015-03-24 14:55 ` Tomi Valkeinen
  9 siblings, 0 replies; 14+ messages in thread
From: Tomi Valkeinen @ 2015-03-24 14:55 UTC (permalink / raw)
  To: linux-arm-kernel

DESHDCP clock is needed on DRA7 based SoCs to enable the DSS IP. That
clock is an odd one, as it is not supposed to be any kind of core clock
for DSS, and we don't even support HDCP, but the clock is still needed
even for the HWMOD framework to be able to reset the DSS IP.

As there's no support for multiple core clocks in the HWMOD framework,
we don't have any obvious place to enable this clock when DSS IP is
being enabled.

Furthermore, the HDMI on OMAP5 DSS is the same as on DRA7, and OMAP5
does not have any such clock configuration bit. This suggests that on
OMAP5 the DESHDCP clock is always enabled, and for DRA7 we have the
possibility to gate it.

So, as we don't have any clean way to enable and disable the clock
based on the need, this patch enables the clock at boot time, making it
work similarly to OMAP5.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
 drivers/clk/ti/clk-7xx.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/clk/ti/clk-7xx.c b/drivers/clk/ti/clk-7xx.c
index 7b859ec31a14..e132d0677c03 100644
--- a/drivers/clk/ti/clk-7xx.c
+++ b/drivers/clk/ti/clk-7xx.c
@@ -308,7 +308,7 @@ static struct ti_dt_clk dra7xx_clks[] = {
 int __init dra7xx_dt_clk_init(void)
 {
 	int rc;
-	struct clk *abe_dpll_mux, *sys_clkin2, *dpll_ck;
+	struct clk *abe_dpll_mux, *sys_clkin2, *dpll_ck, *hdcp_ck;
 
 	ti_dt_clocks_register(dra7xx_clks);
 
@@ -344,5 +344,10 @@ int __init dra7xx_dt_clk_init(void)
 	if (rc)
 		pr_err("%s: failed to set USB_DPLL M2 OUT\n", __func__);
 
+	hdcp_ck = clk_get_sys(NULL, "dss_deshdcp_clk");
+	rc = clk_prepare_enable(hdcp_ck);
+	if (rc)
+		pr_err("%s: failed to set dss_deshdcp_clk\n", __func__);
+
 	return rc;
 }
-- 
2.3.3

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

* [PATCHv2 02/10] ARM: DRA7: hwmod: add DMM hwmod description
  2015-03-24 14:55 ` [PATCHv2 02/10] ARM: DRA7: hwmod: add DMM hwmod description Tomi Valkeinen
@ 2015-04-03 19:02   ` Paul Walmsley
  0 siblings, 0 replies; 14+ messages in thread
From: Paul Walmsley @ 2015-04-03 19:02 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, 24 Mar 2015, Tomi Valkeinen wrote:

> Add DMM hwmod entries for DRA7. This is identical to DMM on OMAP5.
> 
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>

Thanks, queued.  Will send a pull request for this to Tony today, but it 
may not make it for v4.1.

Note that I cannot boot-test this since I do not have a DRA7 board.


- Paul

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

* [PATCHv2 03/10] ARM: DRA7: hwmod: set DSS submodule parent hwmods
  2015-03-24 14:55 ` [PATCHv2 03/10] ARM: DRA7: hwmod: set DSS submodule parent hwmods Tomi Valkeinen
@ 2015-04-03 19:03   ` Paul Walmsley
  2015-04-07 12:16     ` Tomi Valkeinen
  0 siblings, 1 reply; 14+ messages in thread
From: Paul Walmsley @ 2015-04-03 19:03 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, 24 Mar 2015, Tomi Valkeinen wrote:

> Set DSS core hwmod as the parent for all the DSS submodules.
> 
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>

Thanks, queued.  Will send a pull request for this to Tony today, but it  
may not make it for v4.1.  

Note that I cannot boot test this since I do not have a DRA7xx board.


- Paul

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

* [PATCHv2 03/10] ARM: DRA7: hwmod: set DSS submodule parent hwmods
  2015-04-03 19:03   ` Paul Walmsley
@ 2015-04-07 12:16     ` Tomi Valkeinen
  0 siblings, 0 replies; 14+ messages in thread
From: Tomi Valkeinen @ 2015-04-07 12:16 UTC (permalink / raw)
  To: linux-arm-kernel

On 03/04/15 22:03, Paul Walmsley wrote:
> On Tue, 24 Mar 2015, Tomi Valkeinen wrote:
> 
>> Set DSS core hwmod as the parent for all the DSS submodules.
>>
>> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
> 
> Thanks, queued.  Will send a pull request for this to Tony today, but it  
> may not make it for v4.1.  
> 
> Note that I cannot boot test this since I do not have a DRA7xx board.

As I mentioned in the reply to the pull request, we can't cherry pick
this patch, we need the HDCP clock.

This series should be changed so that the HDCP clock is handled in the
beginning of the series to keep bisect working. I'll do that for the
next version, which I probably would need to do in any case as Tero's
series is still under work.

Or if we want to get DRA7 DSS support in earlier, we could just use my
earlier simple patch which enables the HDCP clock.

 Tomi


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20150407/ee2b6a56/attachment.sig>

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

end of thread, other threads:[~2015-04-07 12:16 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-24 14:55 [PATCHv2 00/10] ARM: DRA7: add display support Tomi Valkeinen
2015-03-24 14:55 ` [PATCHv2 01/10] arm/dts: dra7xx: add 'ti, set-rate-parent' for dss_dss_clk Tomi Valkeinen
2015-03-24 14:55 ` [PATCHv2 02/10] ARM: DRA7: hwmod: add DMM hwmod description Tomi Valkeinen
2015-04-03 19:02   ` Paul Walmsley
2015-03-24 14:55 ` [PATCHv2 03/10] ARM: DRA7: hwmod: set DSS submodule parent hwmods Tomi Valkeinen
2015-04-03 19:03   ` Paul Walmsley
2015-04-07 12:16     ` Tomi Valkeinen
2015-03-24 14:55 ` [PATCHv2 04/10] ARM: OMAP: display: change compat names to array Tomi Valkeinen
2015-03-24 14:55 ` [PATCHv2 05/10] ARM: OMAP2+: display: detect DRA7 DSS Tomi Valkeinen
2015-03-24 14:55 ` [PATCHv2 06/10] arm/dts: dra7.dtsi: add DSS support Tomi Valkeinen
2015-03-24 14:55 ` [PATCHv2 07/10] arm/dts: dra72-evm.dts: add HDMI Tomi Valkeinen
2015-03-24 14:55 ` [PATCHv2 08/10] arm/dts: am57xx-beagle-x15.dts: " Tomi Valkeinen
2015-03-24 14:55 ` [PATCHv2 09/10] arm: dra7: add DESHDCP clock Tomi Valkeinen
2015-03-24 14:55 ` [PATCHv2 10/10] CLK: TI: always enable " 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).