Skip to contentSkip to conversation

Configure genpd domains for omap4

PATCH In review Tony Lindgren 2 participants 10 messages Nov 19, 2020 – Dec 9, 2020

Subsystems (8)
lore
Share & tools
lore

Tony Lindgren

author maintainer
#0 lore raw

cover Configure genpd domains for omap4

Hi all,

Here are few patches to configure genpd domains for omap4 and enable it for dss, dsp and iva. And we also drop gpmc legacy platform data while at it.

Regards,

Tony

Tero Kristo (2):
soc: ti: omap-prm: omap4: add genpd support for remaining PRM
instances
ARM: dts: omap4: add remaining PRM instances

Tony Lindgren (5):
clk: ti: omap4: Drop idlest polling from IVA clkctrl clocks
ARM: dts: Configure power domain for omap4 dss
ARM: dts: Configure power domain for omap4 dsp
ARM: OMAP2+: Drop legacy platform data for omap4 iva
ARM: OMAP2+: Drop legacy platform data for omap4 gpmc

 arch/arm/boot/dts/omap4-l4.dtsi            |   1 +
 arch/arm/boot/dts/omap4.dtsi               | 150 ++++++++++++++++++---
 arch/arm/mach-omap2/omap_hwmod_44xx_data.c | 114 ----------------
 drivers/clk/ti/clk-44xx.c                  |   2 +-
 drivers/soc/ti/omap_prm.c                  |  71 +++++++++-
 5 files changed, 198 insertions(+), 140 deletions(-)
Signature · 1 line
2.29.2
author maintainer
#1 lore raw

PATCH 1/7 clk: ti: omap4: Drop idlest polling from IVA clkctrl clocks

Similar to what we've done for IPU and DSP let's ignore the status bit for the IVA clkctrl register.

The clkctrl status won't change unless the related rstctrl is deasserted, and the rstctrl status won't change unless the clkctrl is enabled.

Cc Michael Turquette <[email protected]>
Cc Stephen Boyd <[email protected]>
Cc Suman Anna <[email protected]>
Cc Tero Kristo <[email protected]>
---
 drivers/clk/ti/clk-44xx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/ti/clk-44xx.c +1 -1
@@ -255,7 +255,7 @@ static const struct omap_clkctrl_reg_data omap4_l3_instr_clkctrl_regs[] __initco
 };
 
 static const struct omap_clkctrl_reg_data omap4_ivahd_clkctrl_regs[] __initconst = {
-	{ OMAP4_IVA_CLKCTRL, NULL, CLKF_HW_SUP, "dpll_iva_m5x2_ck" },
+	{ OMAP4_IVA_CLKCTRL, NULL, CLKF_HW_SUP | CLKF_NO_IDLEST, "dpll_iva_m5x2_ck" },
 	{ OMAP4_SL2IF_CLKCTRL, NULL, CLKF_HW_SUP, "dpll_iva_m5x2_ck" },
 	{ 0 },
 };
Signature · 1 line
2.29.2
author maintainer
#3 lore raw

PATCH 2/7 soc: ti: omap-prm: omap4: add genpd support for remaining PRM instances

In reply to Tony Lindgren

From: Tero Kristo <[email protected]>

Add genpd support for mpu, tesla, always_on_core, core, ivahd, cam, dss, gfx, l3init, l4per, cefuse, wkup and emu instances.

---
 drivers/soc/ti/omap_prm.c | 71 ++++++++++++++++++++++++++++++++++++---
 1 file changed, 67 insertions(+), 4 deletions(-)
drivers/soc/ti/omap_prm.c +67 -4
@@ -128,6 +128,12 @@ static const struct omap_prm_domain_map omap_prm_alwon = {
 	.usable_modes = BIT(OMAP_PRMD_ON_ACTIVE),
 };
 
+static const struct omap_prm_domain_map omap_prm_reton = {
+	.usable_modes = BIT(OMAP_PRMD_ON_ACTIVE) | BIT(OMAP_PRMD_RETENTION),
+	.statechange = 1,
+	.logicretstate = 1,
+};
+
 static const struct omap_rst_map rst_map_0[] = {
 	{ .rst = 0, .st = 0 },
 	{ .rst = -1 },
@@ -147,14 +153,71 @@ static const struct omap_rst_map rst_map_012[] = {
 };
 
 static const struct omap_prm_data omap4_prm_data[] = {
-	{ .name = "tesla", .base = 0x4a306400, .rstctrl = 0x10, .rstst = 0x14, .rstmap = rst_map_01 },
+	{
+		.name = "mpu", .base = 0x4a306300,
+		.pwrstctrl = 0x0, .pwrstst = 0x4, .dmap = &omap_prm_reton,
+	},
+	{
+		.name = "tesla", .base = 0x4a306400,
+		.pwrstctrl = 0x0, .pwrstst = 0x4, .dmap = &omap_prm_noinact,
+		.rstctrl = 0x10, .rstst = 0x14, .rstmap = rst_map_01
+	},
 	{
 		.name = "abe", .base = 0x4a306500,
 		.pwrstctrl = 0, .pwrstst = 0x4, .dmap = &omap_prm_all,
 	},
-	{ .name = "core", .base = 0x4a306700, .rstctrl = 0x210, .rstst = 0x214, .clkdm_name = "ducati", .rstmap = rst_map_012 },
-	{ .name = "ivahd", .base = 0x4a306f00, .rstctrl = 0x10, .rstst = 0x14, .rstmap = rst_map_012 },
-	{ .name = "device", .base = 0x4a307b00, .rstctrl = 0x0, .rstst = 0x4, .rstmap = rst_map_01, .flags = OMAP_PRM_HAS_RSTCTRL | OMAP_PRM_HAS_NO_CLKDM },
+	{
+		.name = "always_on_core", .base = 0x4a306600,
+		.pwrstctrl = 0x0, .pwrstst = 0x4, .dmap = &omap_prm_alwon,
+	},
+	{
+		.name = "core", .base = 0x4a306700,
+		.pwrstctrl = 0x0, .pwrstst = 0x4, .dmap = &omap_prm_reton,
+		.rstctrl = 0x210, .rstst = 0x214, .clkdm_name = "ducati",
+		.rstmap = rst_map_012
+	},
+	{
+		.name = "ivahd", .base = 0x4a306f00,
+		.pwrstctrl = 0x0, .pwrstst = 0x4, .dmap = &omap_prm_noinact,
+		.rstctrl = 0x10, .rstst = 0x14, .rstmap = rst_map_012
+	},
+	{
+		.name = "cam", .base = 0x4a307000,
+		.pwrstctrl = 0x0, .pwrstst = 0x4, .dmap = &omap_prm_onoff_noauto,
+	},
+	{
+		.name = "dss", .base = 0x4a307100,
+		.pwrstctrl = 0x0, .pwrstst = 0x4, .dmap = &omap_prm_noinact
+	},
+	{
+		.name = "gfx", .base = 0x4a307200,
+		.pwrstctrl = 0x0, .pwrstst = 0x4, .dmap = &omap_prm_onoff_noauto
+	},
+	{
+		.name = "l3init", .base = 0x4a307300,
+		.pwrstctrl = 0x0, .pwrstst = 0x4, .dmap = &omap_prm_reton
+	},
+	{
+		.name = "l4per", .base = 0x4a307400,
+		.pwrstctrl = 0x0, .pwrstst = 0x4, .dmap = &omap_prm_reton
+	},
+	{
+		.name = "cefuse", .base = 0x4a307600,
+		.pwrstctrl = 0x0, .pwrstst = 0x4, .dmap = &omap_prm_onoff_noauto
+	},
+	{
+		.name = "wkup", .base = 0x4a307700,
+		.pwrstctrl = 0x0, .pwrstst = 0x4, .dmap = &omap_prm_alwon
+	},
+	{
+		.name = "emu", .base = 0x4a307900,
+		.pwrstctrl = 0x0, .pwrstst = 0x4, .dmap = &omap_prm_onoff_noauto
+	},
+	{
+		.name = "device", .base = 0x4a307b00,
+		.rstctrl = 0x0, .rstst = 0x4, .rstmap = rst_map_01,
+		.flags = OMAP_PRM_HAS_RSTCTRL | OMAP_PRM_HAS_NO_CLKDM
+	},
 	{ },
 };
 
Signature · 1 line
2.29.2
author maintainer
#4 lore raw

PATCH 3/7 ARM: dts: omap4: add remaining PRM instances

In reply to Tony Lindgren

From: Tero Kristo <[email protected]>

Add remaining PRM instances for the omap4 SoC. Additionally enable the genpd support for them.

---
 arch/arm/boot/dts/omap4.dtsi | 63 ++++++++++++++++++++++++++++++++++++
 1 file changed, 63 insertions(+)
arch/arm/boot/dts/omap4.dtsi +63 -0
@@ -658,10 +658,17 @@ hdmi: encoder@0 {
 #include "omap44xx-clocks.dtsi"
 
 &prm {
+	prm_mpu: prm@300 {
+		compatible = "ti,omap4-prm-inst", "ti,omap-prm-inst";
+		reg = <0x300 0x100>;
+		#power-domain-cells = <0>;
+	};
+
 	prm_tesla: prm@400 {
 		compatible = "ti,omap4-prm-inst", "ti,omap-prm-inst";
 		reg = <0x400 0x100>;
 		#reset-cells = <1>;
+		#power-domain-cells = <0>;
 	};
 
 	prm_abe: prm@500 {
@@ -670,16 +677,72 @@ prm_abe: prm@500 {
 		#power-domain-cells = <0>;
 	};
 
+	prm_always_on_core: prm@600 {
+		compatible = "ti,omap4-prm-inst", "ti,omap-prm-inst";
+		reg = <0x600 0x100>;
+		#power-domain-cells = <0>;
+	};
+
 	prm_core: prm@700 {
 		compatible = "ti,omap4-prm-inst", "ti,omap-prm-inst";
 		reg = <0x700 0x100>;
 		#reset-cells = <1>;
+		#power-domain-cells = <0>;
 	};
 
 	prm_ivahd: prm@f00 {
 		compatible = "ti,omap4-prm-inst", "ti,omap-prm-inst";
 		reg = <0xf00 0x100>;
 		#reset-cells = <1>;
+		#power-domain-cells = <0>;
+	};
+
+	prm_cam: prm@1000 {
+		compatible = "ti,omap4-prm-inst", "ti,omap-prm-inst";
+		reg = <0x1000 0x100>;
+		#power-domain-cells = <0>;
+	};
+
+	prm_dss: prm@1100 {
+		compatible = "ti,omap4-prm-inst", "ti,omap-prm-inst";
+		reg = <0x1100 0x100>;
+		#power-domain-cells = <0>;
+	};
+
+	prm_gfx: prm@1200 {
+		compatible = "ti,omap4-prm-inst", "ti,omap-prm-inst";
+		reg = <0x1200 0x100>;
+		#power-domain-cells = <0>;
+	};
+
+	prm_l3init: prm@1300 {
+		compatible = "ti,omap4-prm-inst", "ti,omap-prm-inst";
+		reg = <0x1300 0x100>;
+		#power-domain-cells = <0>;
+	};
+
+	prm_l4per: prm@1400 {
+		compatible = "ti,omap4-prm-inst", "ti,omap-prm-inst";
+		reg = <0x1400 0x100>;
+		#power-domain-cells = <0>;
+	};
+
+	prm_cefuse: prm@1600 {
+		compatible = "ti,omap4-prm-inst", "ti,omap-prm-inst";
+		reg = <0x1600 0x100>;
+		#power-domain-cells = <0>;
+	};
+
+	prm_wkup: prm@1700 {
+		compatible = "ti,omap4-prm-inst", "ti,omap-prm-inst";
+		reg = <0x1700 0x100>;
+		#power-domain-cells = <0>;
+	};
+
+	prm_emu: prm@1900 {
+		compatible = "ti,omap4-prm-inst", "ti,omap-prm-inst";
+		reg = <0x1900 0x100>;
+		#power-domain-cells = <0>;
 	};
 
 	prm_device: prm@1b00 {
Signature · 1 line
2.29.2
author maintainer
#5 lore raw

PATCH 4/7 ARM: dts: Configure power domain for omap4 dss

In reply to Tony Lindgren

This allows shutting down dss domain when the screen blanks.

---
 arch/arm/boot/dts/omap4.dtsi | 7 +++++++
 1 file changed, 7 insertions(+)
arch/arm/boot/dts/omap4.dtsi +7 -0
@@ -445,6 +445,7 @@ target-module@58000000 {
 			      <0x58000014 4>;
 			reg-names = "rev", "syss";
 			ti,syss-mask = <1>;
+			power-domains = <&prm_dss>;
 			clocks = <&l3_dss_clkctrl OMAP4_DSS_CORE_CLKCTRL 0>,
 				 <&l3_dss_clkctrl OMAP4_DSS_CORE_CLKCTRL 9>,
 				 <&l3_dss_clkctrl OMAP4_DSS_CORE_CLKCTRL 10>,
@@ -745,6 +746,12 @@ prm_emu: prm@1900 {
 		#power-domain-cells = <0>;
 	};
 
+	prm_dss: prm@1100 {
+		compatible = "ti,omap4-prm-inst", "ti,omap-prm-inst";
+		reg = <0x1100 0x40>;
+		#power-domain-cells = <0>;
+	};
+
 	prm_device: prm@1b00 {
 		compatible = "ti,omap4-prm-inst", "ti,omap-prm-inst";
 		reg = <0x1b00 0x40>;
Signature · 1 line
2.29.2
author maintainer
#6 lore raw

PATCH 5/7 ARM: dts: Configure power domain for omap4 dsp

In reply to Tony Lindgren

This allows shutting down the dsp domain when not in use.

---
 arch/arm/boot/dts/omap4-l4.dtsi | 1 +
 1 file changed, 1 insertion(+)
arch/arm/boot/dts/omap4-l4.dtsi +1 -0
@@ -330,6 +330,7 @@ SYSC_OMAP2_SOFTRESET |
 			/* Domains (V, P, C): iva, tesla_pwrdm, tesla_clkdm */
 			clocks = <&tesla_clkctrl OMAP4_DSP_CLKCTRL 0>;
 			clock-names = "fck";
+			power-domains = <&prm_tesla>;
 			resets = <&prm_tesla 1>;
 			reset-names = "rstctrl";
 			#address-cells = <1>;
Signature · 1 line
2.29.2
author maintainer
#7 lore raw

PATCH 6/7 ARM: OMAP2+: Drop legacy platform data for omap4 iva

In reply to Tony Lindgren

We can now probe devices with ti-sysc interconnect driver and dts data. Let's drop the related platform data and custom ti,hwmods dts property.

---
 arch/arm/boot/dts/omap4.dtsi               | 31 ++++++++--
 arch/arm/mach-omap2/omap_hwmod_44xx_data.c | 69 ----------------------
 2 files changed, 26 insertions(+), 74 deletions(-)
arch/arm/boot/dts/omap4.dtsi +26 -5
@@ -107,11 +107,6 @@ mpu {
 			ti,hwmods = "mpu";
 			sram = <&ocmcram>;
 		};
-
-		iva {
-			compatible = "ti,ivahd";
-			ti,hwmods = "iva";
-		};
 	};
 
 	/*
@@ -651,6 +646,32 @@ hdmi: encoder@0 {
 				};
 			};
 		};
+
+		iva_hd_target: target-module@5a000000 {
+			compatible = "ti,sysc-omap4", "ti,sysc";
+			reg = <0x5a05a400 0x4>,
+			      <0x5a05a410 0x4>;
+			reg-names = "rev", "sysc";
+			ti,sysc-midle = <SYSC_IDLE_FORCE>,
+					<SYSC_IDLE_NO>,
+					<SYSC_IDLE_SMART>;
+			ti,sysc-sidle = <SYSC_IDLE_FORCE>,
+					<SYSC_IDLE_NO>,
+					<SYSC_IDLE_SMART>;
+			power-domains = <&prm_ivahd>;
+			resets = <&prm_ivahd 2>;
+			reset-names = "rstctrl";
+			clocks = <&ivahd_clkctrl OMAP4_IVA_CLKCTRL 0>;
+			clock-names = "fck";
+			#address-cells = <1>;
+			#size-cells = <1>;
+			ranges = <0x5a000000 0x5a000000 0x1000000>,
+				 <0x5b000000 0x5b000000 0x1000000>;
+
+			iva {
+				compatible = "ti,ivahd";
+			};
+		};
 	};
 };
 
arch/arm/mach-omap2/omap_hwmod_44xx_data.c +0 -69

111 lines not on this page · raw message

Signature · 1 line
2.29.2
author maintainer
#8 lore raw

PATCH 7/7 ARM: OMAP2+: Drop legacy platform data for omap4 gpmc

In reply to Tony Lindgren

We can now probe devices with ti-sysc interconnect driver and dts data. Let's drop the related platform data and custom ti,hwmods dts property.

---
 arch/arm/boot/dts/omap4.dtsi               | 49 +++++++++++++++-------
 arch/arm/mach-omap2/omap_hwmod_44xx_data.c | 45 --------------------
 2 files changed, 33 insertions(+), 61 deletions(-)
arch/arm/boot/dts/omap4.dtsi +33 -16
@@ -145,24 +145,41 @@ ocmcram: sram@40304000 {
 			reg = <0x40304000 0xa000>; /* 40k */
 		};
 
-		gpmc: gpmc@50000000 {
-			compatible = "ti,omap4430-gpmc";
-			reg = <0x50000000 0x1000>;
-			#address-cells = <2>;
-			#size-cells = <1>;
-			interrupts = <GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH>;
-			dmas = <&sdma 4>;
-			dma-names = "rxtx";
-			gpmc,num-cs = <8>;
-			gpmc,num-waitpins = <4>;
-			ti,hwmods = "gpmc";
+		target-module@50000000 {
+			compatible = "ti,sysc-omap2", "ti,sysc";
+			reg = <0x50000000 4>,
+			      <0x50000010 4>,
+			      <0x50000014 4>;
+			reg-names = "rev", "sysc", "syss";
+			ti,sysc-sidle = <SYSC_IDLE_FORCE>,
+					<SYSC_IDLE_NO>,
+					<SYSC_IDLE_SMART>;
+			ti,syss-mask = <1>;
 			ti,no-idle-on-init;
-			clocks = <&l3_div_ck>;
+			clocks = <&l3_2_clkctrl OMAP4_GPMC_CLKCTRL 0>;
 			clock-names = "fck";
-			interrupt-controller;
-			#interrupt-cells = <2>;
-			gpio-controller;
-			#gpio-cells = <2>;
+			#address-cells = <1>;
+			#size-cells = <1>;
+			ranges = <0x50000000 0x50000000 0x00001000>, /* regs */
+				 <0x00000000 0x00000000 0x40000000>; /* data */
+
+			gpmc: gpmc@50000000 {
+				compatible = "ti,omap4430-gpmc";
+				reg = <0x50000000 0x1000>;
+				#address-cells = <2>;
+				#size-cells = <1>;
+				interrupts = <GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH>;
+				dmas = <&sdma 4>;
+				dma-names = "rxtx";
+				gpmc,num-cs = <8>;
+				gpmc,num-waitpins = <4>;
+				clocks = <&l3_div_ck>;
+				clock-names = "fck";
+				interrupt-controller;
+				#interrupt-cells = <2>;
+				gpio-controller;
+				#gpio-cells = <2>;
+			};
 		};
 
 		target-module@52000000 {
arch/arm/mach-omap2/omap_hwmod_44xx_data.c +0 -45

63 lines not on this page · raw message

Signature · 1 line
2.29.2
author maintainer
#9 lore raw
In reply to Tony Lindgren
Quoted 5 lines · Tony Lindgren

Hi all,

Here are few patches to configure genpd domains for omap4 and enable it for dss, dsp and iva. And we also drop gpmc legacy platform data while at it.

These depend on the earlier patches:

PATCH 2/4] ARM: OMAP2+: Fix missing select PM_GENERIC_DOMAINS_OF [PATCHv2 0/9] Genpd related code changes to drop am335x pdata

To make testing things easier, I've pushed out these changes also to a temporary test branch at [0][1] below.

Regards,

Tony

[0] git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap.git omap-for-v5.11/tmp-testing-genpd
[1] https://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap.git/log/?h=omap-for-v5.11/tmp-testing-genp

maintainer Acked-by on v1 1/7
#2 lore raw

Re: [PATCH 1/7] clk: ti: omap4: Drop idlest polling from IVA clkctrl clocks

In reply to Tony Lindgren

Quoting Tony Lindgren (2020-11-19 05:07:14)

Quoted 6 lines

Similar to what we've done for IPU and DSP let's ignore the status bit for the IVA clkctrl register.

The clkctrl status won't change unless the related rstctrl is deasserted, and the rstctrl status won't change unless the clkctrl is enabled.

Quoted 7 lines
Cc Michael Turquette <[email protected]>
Cc Stephen Boyd <[email protected]>
Cc Suman Anna <[email protected]>
Cc Tero Kristo <[email protected]>

---