ARM: DRA7: add display support
Subsystems (7)
v3 cover ARM: DRA7: add display support
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 v3, and is based on v4.1-rc2. There are no differences to v2, except rebased and tested.
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(-)
Signature · 1 line
2.1.4
PATCH v3 1/10 arm/dts: dra7xx: add 'ti, set-rate-parent' for dss_dss_clk
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.
--- arch/arm/boot/dts/dra7xx-clocks.dtsi | 1 + 1 file changed, 1 insertion(+)
arch/arm/boot/dts/dra7xx-clocks.dtsi +1 -0
@@ -1531,6 +1531,7 @@ clocks = <&dpll_per_h12x2_ck>; ti,bit-shift = <8>; reg = <0x1120>; + ti,set-rate-parent; }; dss_hdmi_clk: dss_hdmi_clk {
Signature · 1 line
2.1.4
PATCH v3 2/10 ARM: DRA7: hwmod: add DMM hwmod description
In reply to Tomi ValkeinenAdd DMM hwmod entries for DRA7. This is identical to DMM on OMAP5.
--- arch/arm/mach-omap2/omap_hwmod_7xx_data.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+)
arch/arm/mach-omap2/omap_hwmod_7xx_data.c +30 -0
@@ -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 */
@@ -2321,6 +2342,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,
@@ -3289,6 +3318,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,
Signature · 1 line
2.1.4
PATCH v3 3/10 ARM: DRA7: hwmod: set DSS submodule parent hwmods
In reply to Tomi ValkeinenSet DSS core hwmod as the parent for all the DSS submodules.
--- arch/arm/mach-omap2/omap_hwmod_7xx_data.c | 2 ++ 1 file changed, 2 insertions(+)
arch/arm/mach-omap2/omap_hwmod_7xx_data.c +2 -0
@@ -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, };/*
Signature · 1 line
2.1.4
PATCH v3 4/10 ARM: OMAP: display: change compat names to array
In reply to Tomi ValkeinenSimplify the DSS detection logic by creating a list of the omapdss compat strings, instead of checking each separately with an 'if'.
--- arch/arm/mach-omap2/display.c | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-)
arch/arm/mach-omap2/display.c +14 -15
@@ -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 ; }
Signature · 1 line
2.1.4
PATCH v3 5/10 ARM: OMAP2+: display: detect DRA7 DSS
In reply to Tomi ValkeinenAdd platform code to detect DRA7 DSS.
--- arch/arm/mach-omap2/display.c | 3 +++ 1 file changed, 3 insertions(+)
arch/arm/mach-omap2/display.c +3 -0
@@ -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 )
Signature · 1 line
2.1.4
PATCH v3 6/10 arm/dts: dra7.dtsi: add DSS support
In reply to Tomi ValkeinenDRA7xxx 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.
--- 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(+)
arch/arm/boot/dts/dra7.dtsi +38 -0
@@ -1469,6 +1469,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"; + }; + }; }; thermal_zones: thermal-zones {
arch/arm/boot/dts/dra72x.dtsi +11 -0
@@ -34,3 +34,14 @@ interrupts = <GIC_SPI 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"; +};
arch/arm/boot/dts/dra74x.dtsi +15 -0
@@ -73,3 +73,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"; +};
Signature · 1 line
2.1.4
PATCH v3 7/10 arm/dts: dra72-evm.dts: add HDMI
In reply to Tomi ValkeinenDRA72 EVM has a HDMI output. This patch adds the device tree nodes required for HDMI.
--- arch/arm/boot/dts/dra72-evm.dts | 110 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 110 insertions(+)
arch/arm/boot/dts/dra72-evm.dts +110 -0
@@ -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 */
@@ -142,6 +198,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 {
@@ -277,6 +346,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"; };
@@ -566,3 +656,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>; + }; + }; +};
Signature · 1 line
2.1.4
PATCH v3 8/10 arm/dts: am57xx-beagle-x15.dts: add HDMI
In reply to Tomi ValkeinenAM57xx Beagle X15 has a HDMI output. This patch adds the device tree nodes required for HDMI.
--- arch/arm/boot/dts/am57xx-beagle-x15.dts | 81 +++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+)
arch/arm/boot/dts/am57xx-beagle-x15.dts +81 -0
@@ -18,6 +18,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 {
@@ -607,3 +668,23 @@ }; }; }; + +&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>; + }; + }; +};
Signature · 1 line
2.1.4
PATCH v3 9/10 arm: dra7: add DESHDCP clock
In reply to Tomi ValkeinenAdd a new Linux clock for DRA7 based SoCs to control DESHDCP clock.
--- 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(+)
arch/arm/boot/dts/dra7.dtsi +5 -0
@@ -131,6 +131,11 @@ regulator-max-microvolt = <3000000>; }; }; + + scm_conf_clocks: clocks { + #address-cells = <1>; + #size-cells = <0>; + }; }; dra7_pmx_core: pinmux at 1400 {
arch/arm/boot/dts/dra7xx-clocks.dtsi +10 -0
@@ -2137,3 +2137,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>; + }; +};
arch/arm/mach-omap2/omap_hwmod_7xx_data.c +1 -0
@@ -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 = {
drivers/clk/ti/clk-7xx.c +1 -0
@@ -305,6 +305,7 @@ static struct ti_dt_clk dra7xx_clks[] = {DT_CLK ("4882c000.timer" ,"timer_sys_ck" ,"timer_sys_clk_div" ),DT_CLK ("4882e000.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 }, };
Signature · 1 line
2.1.4
PATCH v3 10/10 CLK: TI: always enable DESHDCP clock
In reply to Tomi ValkeinenDESHDCP 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.
--- drivers/clk/ti/clk-7xx.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/clk/ti/clk-7xx.c +6 -1
@@ -312,7 +312,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);
@@ -348,5 +348,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; }
Signature · 1 line
2.1.4
PATCH v3 10/10 CLK: TI: always enable DESHDCP clock
Quoted 38 lines · Tomi Valkeinen
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 <[email protected]>--- drivers/clk/ti/clk-7xx.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)drivers/clk/ti/clk-7xx.c +1
-1@@ -312,7 +312,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);
drivers/clk/ti/clk-7xx.c int __init dra7xx_dt_clk_init(void) · line 357
Quoted 10 lines
drivers/clk/ti/clk-7xx.c +5
-0@@ -348,5 +348,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; }
You should rather use the assigned-clock properties in DT to accomplish this, the manual clock tweaks under the drivers/clk/ti/clk-* files should be converted to DT setup also.
-Tero
PATCH v3 10/10 CLK: TI: always enable DESHDCP clock
Quoted 41 lines · Tero Kristo
Quoted 40 lines · Tomi Valkeinen
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 <[email protected]>--- drivers/clk/ti/clk-7xx.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)drivers/clk/ti/clk-7xx.c +1
-1@@ -312,7 +312,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);@@ -348,5 +348,10 @@ int __init dra7xx_dt_clk_init(void)if (rc)pr_err ("%s: failed to set USB_DPLL M2 OUT\n" , __func__);
Quoted 12 lines
drivers/clk/ti/clk-7xx.c int __init dra7xx_dt_clk_init(void) · line 357
Quoted 8 lines
drivers/clk/ti/clk-7xx.c +5
-0+ 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; }You should rather use the assigned-clock properties in DT to accomplish this, the manual clock tweaks under the
drivers/clk/ti/clk-*files should be converted to DT setup also.
Now that I sent this, I realize we only have support to set_parent / set_rate through the assigned-clock props, no enable. Any plans to extend this support Mike/Stephen?
-Tero
Quoted 3 lines
-Tero
PATCH v3 10/10 CLK: TI: always enable DESHDCP clock
Quoted 19 lines · Tero Kristo
Quoted 6 lines
Quoted 6 lines
drivers/clk/ti/clk-7xx.c +0
-0@@ -348,5 +348,10 @@ int __init dra7xx_dt_clk_init(void)if (rc)pr_err ("%s: failed to set USB_DPLL M2 OUT\n" , __func__);Quoted 12 lines
drivers/clk/ti/clk-7xx.c int __init dra7xx_dt_clk_init(void) · line 357
Quoted 8 lines
drivers/clk/ti/clk-7xx.c +5
-0+ 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; }You should rather use the assigned-clock properties in DT to accomplish this, the manual clock tweaks under the
drivers/clk/ti/clk-*files should be converted to DT setup also.
Quoted 5 lines
Now that I sent this, I realize we only have support to
set_parent/set_ratethrough the assigned-clock props, no enable. Any plans to extend this support Mike/Stephen?
Enable falls under the "critical clocks" discussion that is ongoing. I assume that this is some sort of critical clock that can't be turned off?
Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
Paul Walmsley
maintainerPATCH v3 10/10 CLK: TI: always enable DESHDCP clock
Quoted 20 lines · Stephen Boyd
Quoted 19 lines · Tero Kristo
Quoted 18 lines
Quoted 4 lines
drivers/clk/ti/clk-7xx.c int __init dra7xx_dt_clk_init(void) · line 357
Quoted 10 lines
drivers/clk/ti/clk-7xx.c +5
-0@@ -348,5 +348,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; }You should rather use the assigned-clock properties in DT to accomplish this, the manual clock tweaks under the
drivers/clk/ti/clk-*files should be converted to DT setup also.
Quoted 8 lines
Quoted 5 lines
Now that I sent this, I realize we only have support to
set_parent/set_ratethrough the assigned-clock props, no enable. Any plans to extend this support Mike/Stephen?Enable falls under the "critical clocks" discussion that is ongoing. I assume that this is some sort of critical clock that can't be turned off?
It only needs to be enabled for this particular display IP subsystem to function:
http://marc.info/?l=linux-omap&m=142071550111482&w=2
I believe Tomi is taking this approach (enabling it unconditionally) to avoid adding support for a secondary IP block "main clock" to the hwmod code. Apparently, the chips that contain this clock gating bit are not intended to be used for power-critical use cases, so there's not much motivation to switch it on and off with the display controller.
- Paul
PATCH v3 10/10 CLK: TI: always enable DESHDCP clock
Quoted 10 lines · Paul Walmsley
Quoted 2 lines
Enable falls under the "critical clocks" discussion that is ongoing. I assume that this is some sort of critical clock that can't be turned off?
It only needs to be enabled for this particular display IP subsystem to function:
http://marc.info/?l=linux-omap&m=142071550111482&w=2
I believe Tomi is taking this approach (enabling it unconditionally) to avoid adding support for a secondary IP block "main clock" to the hwmod
Right. I don't think that would be a simple task (correct me if I'm wrong), and that would all be only for this one IP on this particular SoC type.
Quoted 3 lines
code. Apparently, the chips that contain this clock gating bit are not intended to be used for power-critical use cases, so there's not much motivation to switch it on and off with the display controller.
Even in power-critical use cases the the power use difference should be negligible.
Tomi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20150522/ab09ead1/attachment.sig>
PATCH v3 10/10 CLK: TI: always enable DESHDCP clock
In reply to Stephen BoydQuoting Stephen Boyd (2015-05-20 12:34:23)
Quoted 20 lines · Tero Kristo
Quoted 19 lines
Quoted 18 lines
Quoted 4 lines
drivers/clk/ti/clk-7xx.c int __init dra7xx_dt_clk_init(void) · line 357
Quoted 10 lines
drivers/clk/ti/clk-7xx.c +5
-0@@ -348,5 +348,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; }You should rather use the assigned-clock properties in DT to accomplish this, the manual clock tweaks under the
drivers/clk/ti/clk-*files should be converted to DT setup also.
Quoted 8 lines
Quoted 5 lines
Now that I sent this, I realize we only have support to
set_parent/set_ratethrough the assigned-clock props, no enable. Any plans to extend this support Mike/Stephen?Enable falls under the "critical clocks" discussion that is ongoing. I assume that this is some sort of critical clock that can't be turned off?
Just chiming in on the "critical clock" discussion. I'm not planning to merge something that lets Devicetree nodes call clk_enable on a clock. That's what drivers are for.
The assigned-rate and assigned-parent stuff that Tero mentioned is more like configuration data for a downstream clock consumer. Clock gating/ungating does not fall under this type of configuration data in my opinion.
I think that Tomi's patch to call clk_prepare_enable from dra7xx_dt_clk_init is a reasonable solution to the problem.
Regards,
Mike
Quoted 5 lines
Signature · 3 lines
-- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
PATCH v3 10/10 CLK: TI: always enable DESHDCP clock
Quoted 34 lines · Michael Turquette
Quoting Stephen Boyd (2015-05-20 12:34:23)
Quoted 20 lines · Tero Kristo
Quoted 19 lines
Quoted 18 lines
Quoted 4 lines
drivers/clk/ti/clk-7xx.c int __init dra7xx_dt_clk_init(void) · line 357
Quoted 10 lines
drivers/clk/ti/clk-7xx.c +5
-0@@ -348,5 +348,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; }You should rather use the assigned-clock properties in DT to accomplish this, the manual clock tweaks under the
drivers/clk/ti/clk-*files should be converted to DT setup also.Quoted 8 lines
Quoted 5 lines
Now that I sent this, I realize we only have support to
set_parent/set_ratethrough the assigned-clock props, no enable. Any plans to extend this support Mike/Stephen?Enable falls under the "critical clocks" discussion that is ongoing. I assume that this is some sort of critical clock that can't be turned off?
Just chiming in on the "critical clock" discussion. I'm not planning to merge something that lets Devicetree nodes call
clk_enableon a clock. That's what drivers are for.
Quoted 7 lines
The assigned-rate and assigned-parent stuff that Tero mentioned is more like configuration data for a downstream clock consumer. Clock gating/ungating does not fall under this type of configuration data in my opinion.
I think that Tomi's patch to call
clk_prepare_enablefromdra7xx_dt_clk_initis a reasonable solution to the problem.
Yea, after this discussion I am fine with this approach also, seeing it apparently doesn't cause any ill side-effects.
-Tero
Quoted 9 lines
Regards,
MikeQuoted 5 lines
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
PATCH v3 10/10 CLK: TI: always enable DESHDCP clock
Quoted 10 lines · Tero Kristo
Quoted 9 lines · Michael Turquette
Just chiming in on the "critical clock" discussion. I'm not planning to merge something that lets Devicetree nodes call
clk_enableon a clock. That's what drivers are for.The assigned-rate and assigned-parent stuff that Tero mentioned is more like configuration data for a downstream clock consumer. Clock gating/ungating does not fall under this type of configuration data in my opinion.
Quoted 5 lines
Quoted 2 lines
I think that Tomi's patch to call
clk_prepare_enablefromdra7xx_dt_clk_initis a reasonable solution to the problem.Yea, after this discussion I am fine with this approach also, seeing it apparently doesn't cause any ill side-effects.
Well hopefully when the clk is prepared and enabled it isn't orphaned. Or we're going to be in the same problem as we're currently in with Sunxi and trying to make EPROBE_DEFER come out of clk_get().
Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
PATCH v3 10/10 CLK: TI: always enable DESHDCP clock
In reply to Tero KristoQuoted 41 lines · Tero Kristo
Quoted 40 lines · Tomi Valkeinen
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 <[email protected]>--- drivers/clk/ti/clk-7xx.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)drivers/clk/ti/clk-7xx.c +1
-1@@ -312,7 +312,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);@@ -348,5 +348,10 @@ int __init dra7xx_dt_clk_init(void)if (rc)pr_err ("%s: failed to set USB_DPLL M2 OUT\n" , __func__);
Quoted 12 lines
drivers/clk/ti/clk-7xx.c int __init dra7xx_dt_clk_init(void) · line 357
Quoted 8 lines
drivers/clk/ti/clk-7xx.c +5
-0+ 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; }You should rather use the assigned-clock properties in DT to accomplish this, the manual clock tweaks under the
drivers/clk/ti/clk-*files should be converted to DT setup also.
So what should we do?
I got a confirmation from a HW guy that this clock is always enabled on OMAP5, and that's why we haven't seen these issues there. I believe there's a HW bug related to this, as having the HDCP clock disabled should not prevent the use of DSS, but it does.
In my opinion the bit should just be always set, which is what this patch does. Although I think even adding a clock node is kind of extra, as it's clear the bit cannot be properly used.
Tomi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20150527/c7d167a7/attachment.sig>
PATCH v3 10/10 CLK: TI: always enable DESHDCP clock
In reply to Tomi ValkeinenQuoting Tomi Valkeinen (2015-05-06 03:08:58)
Quoted 14 lines
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.
Quoted 5 lines
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 <[email protected]>
Quoted 35 lines
--- drivers/clk/ti/clk-7xx.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)drivers/clk/ti/clk-7xx.c +6
-1@@ -312,7 +312,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);@@ -348,5 +348,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; }Signature · 6 lines
2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo at vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
v3 cover ARM: DRA7: add display support
In reply to Tomi ValkeinenHi,
Quoted 23 lines · Tomi Valkeinen
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 v3, and is based on v4.1-rc2. There are no differences to v2, except rebased and tested.
Tomi
Tomi Valkeinen (10):
arm/dts: dra7xx: add 'ti,set-rate-parent' fordss_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
Quoted 10 lines
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(-)
Ping. Any comments? Can we get this into the next merge window?
Tomi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20150520/f16222d0/attachment.sig>
Paul Walmsley
maintainerv3 cover ARM: DRA7: add display support
In reply to Tomi ValkeinenHi Tomi
Quoted 6 lines · Tomi Valkeinen
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 v3, and is based on v4.1-rc2. There are no differences to v2, except rebased and tested.
Are you still planning to move the DESHDCP clock enable to the beginning of the series to avoid the warnings, per:
http://www.spinics.net/lists/arm-kernel/msg410968.html
?
Also, not sure if you can arrange for someone at TI to send over a DRA7xx board for the testbed, but it would be nice to have a board to test these patches with, to avoid issues like the one mentioned in your E-mails...
- Paul
v3 cover ARM: DRA7: add display support
Quoted 8 lines · Paul Walmsley
Hi Tomi
Quoted 4 lines · Tomi Valkeinen
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.
Quoted 7 lines
Quoted 2 lines
This series is v3, and is based on v4.1-rc2. There are no differences to v2, except rebased and tested.
Are you still planning to move the DESHDCP clock enable to the beginning of the series to avoid the warnings, per:
Sorry, I totally forgot that. I will do that and send a v4.
Quoted 3 lines
Also, not sure if you can arrange for someone at TI to send over a DRA7xx board for the testbed, but it would be nice to have a board to test these patches with, to avoid issues like the one mentioned in your E-mails...
I'll forward the request.
Tomi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20150601/47ec6423/attachment-0001.sig>