Skip to contentSkip to conversation

soc: imx: gpc: Add i.MX6SX PCI power domain

PATCH New Fabio Estevam 3 participants 6 messages Dec 15, 2017 – Dec 26, 2017

Subsystems (2)
lore
Share & tools
lore

Fabio Estevam

author reviewer
#0 lore raw

PATCH 1/2 soc: imx: gpc: Add i.MX6SX PCI power domain

From: Fabio Estevam <[email protected]>

i.MX6SX has a PCI power domain in PGC. Add support for it.

---
 Documentation/devicetree/bindings/power/fsl,imx-gpc.txt |  3 +++
 drivers/soc/imx/gpc.c                                   | 16 +++++++++++++++-
 2 files changed, 18 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/power/fsl,imx-gpc.txt +3 -0
index e371b26..441f71e 100644
@@ -9,6 +9,7 @@ Required properties:
   - fsl,imx6q-gpc
   - fsl,imx6qp-gpc
   - fsl,imx6sl-gpc
+  - fsl,imx6sx-gpc
 - reg: should be register base and length as documented in the
   datasheet
 - interrupts: Should contain one interrupt specifier for the GPC interrupt
@@ -29,6 +30,8 @@ Required properties:
   PU_DOMAIN      1
   The following additional DOMAIN_INDEX value is valid for i.MX6SL:
   DISPLAY_DOMAIN 2
+  The following additional DOMAIN_INDEX value is valid for i.MX6SX:
+  PCI_DOMAIN     3
 
 - #power-domain-cells: Should be 0
 
drivers/soc/imx/gpc.c +15 -1
index 47e7aa9..53f7275 100644
@@ -273,7 +273,15 @@ static struct imx_pm_domain imx_gpc_domains[] = {
 		},
 		.reg_offs = 0x240,
 		.cntr_pdn_bit = 4,
-	}
+	}, {
+		.base = {
+			.name = "PCI",
+			.power_off = imx6_pm_domain_power_off,
+			.power_on = imx6_pm_domain_power_on,
+		},
+		.reg_offs = 0x200,
+		.cntr_pdn_bit = 6,
+	},
 };
 
 struct imx_gpc_dt_data {
@@ -296,10 +304,16 @@ static const struct imx_gpc_dt_data imx6sl_dt_data = {
 	.err009619_present = false,
 };
 
+static const struct imx_gpc_dt_data imx6sx_dt_data = {
+	.num_domains = 4,
+	.err009619_present = false,
+};
+
 static const struct of_device_id imx_gpc_dt_ids[] = {
 	{ .compatible = "fsl,imx6q-gpc", .data = &imx6q_dt_data },
 	{ .compatible = "fsl,imx6qp-gpc", .data = &imx6qp_dt_data },
 	{ .compatible = "fsl,imx6sl-gpc", .data = &imx6sl_dt_data },
+	{ .compatible = "fsl,imx6sx-gpc", .data = &imx6sx_dt_data },
 	{ }
 };
 
Signature · 1 line
2.7.4
author reviewer
#1 lore raw

PATCH 2/2 ARM: dts: imx6sx: Add support for PCI power domain

From: Fabio Estevam <[email protected]>

Previously PCI support was working because the bootloader has previously powered up the PCI power domain.

Represent the PCI power domain, so that PCI is functional without relying on the PCI support from the bootloader.

Tested on a imx6sx-sdb board with no PCI support in the bootloader.

---
 arch/arm/boot/dts/imx6sx.dtsi | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
arch/arm/boot/dts/imx6sx.dtsi +14 -0
index 40c6738c..c6ea6ec 100644
@@ -750,6 +750,19 @@
 				#interrupt-cells = <3>;
 				interrupts = <GIC_SPI 89 IRQ_TYPE_LEVEL_HIGH>;
 				interrupt-parent = <&intc>;
+				clocks = <&clks IMX6SX_CLK_IPG>;
+				clock-names = "ipg";
+
+				pgc {
+					#address-cells = <1>;
+					#size-cells = <0>;
+
+					pd_pci: power-domain at 3 {
+						reg = <3>;
+						#power-domain-cells = <0>;
+						power-supply = <&reg_pcie>;
+					};
+				};
 			};
 
 			iomuxc: iomuxc at 20e0000 {
@@ -1328,6 +1341,7 @@
 				 <&clks IMX6SX_CLK_PCIE_REF_125M>,
 				 <&clks IMX6SX_CLK_DISPLAY_AXI>;
 			clock-names = "pcie", "pcie_bus", "pcie_phy", "pcie_inbound_axi";
+			power-domains = <&pd_pci>;
 			status = "disabled";
 		};
 	};
Signature · 1 line
2.7.4
#2 lore raw

PATCH 2/2 ARM: dts: imx6sx: Add support for PCI power domain

Am Freitag, den 15.12.2017, 00:24 -0200 schrieb Fabio Estevam:

Quoted 5 lines
Quoted 1 line

From: Fabio Estevam <[email protected]>

Previously PCI support was working because the bootloader has previously powered up the PCI power domain.

Quoted 7 lines

Represent the PCI power domain, so that PCI is functional without relying on the PCI support from the bootloader.

Tested on a imx6sx-sdb board with no PCI support in the bootloader.

Quoted 1 line
Quoted 36 lines

---
?arch/arm/boot/dts/imx6sx.dtsi | 14 ++++++++++++++ ?1 file changed, 14 insertions(+)

arch/arm/boot/dts/imx6sx.dtsi +1 -0
index 40c6738c..c6ea6ec 100644
@@ -750,6 +750,19 @@
 > ?				#interrupt-cells = <3>;
 > ?				interrupts = <GIC_SPI 89 IRQ_TYPE_LEVEL_HIGH>;
 > ?				interrupt-parent = <&intc>;
 > +				clocks = <&clks IMX6SX_CLK_IPG>;
 > +				clock-names = "ipg";
+
 > +				pgc {

arch/arm/boot/dts/imx6sx.dtsi line 758

Quoted 2 lines
arch/arm/boot/dts/imx6sx.dtsi +2 -0
+					#address-cells = <1>;
+					#size-cells = <0>;

+

Quoted 7 lines
Quoted 1 line
arch/arm/boot/dts/imx6sx.dtsi +1 -0
+					pd_pci: power-domain at 3 {
arch/arm/boot/dts/imx6sx.dtsi +5 -0
+						reg = <3>;
+						#power-domain-cells = <0>;
+						power-supply = <&reg_pcie>;
+					};
+				};

? };

?

Quoted 1 line
Quoted 1 line

? iomuxc: iomuxc at 20e0000 {

arch/arm/boot/dts/imx6sx.dtsi +0 -0
@@ -1328,6 +1341,7 @@
 > ?				?<&clks IMX6SX_CLK_PCIE_REF_125M>,
 > ?				?<&clks IMX6SX_CLK_DISPLAY_AXI>;
 > ?			clock-names = "pcie", "pcie_bus", "pcie_phy", "pcie_inbound_axi";
 > +			power-domains = <&pd_pci>;
 > ?			status = "disabled";
 > ?		};
Quoted 1 line

? };

#3 lore raw

PATCH 1/2 soc: imx: gpc: Add i.MX6SX PCI power domain

In reply to Fabio Estevam

Am Freitag, den 15.12.2017, 00:24 -0200 schrieb Fabio Estevam:

Quoted 5 lines
Quoted 1 line

From: Fabio Estevam <[email protected]>

i.MX6SX has a PCI power domain in PGC. Add support for it.

Seems like the GPC rework did turn out to work as expected by making it easy to add additional power domains. :)

I didn't validate the register offsets, so this is:

Quoted 64 lines

---
?Documentation/devicetree/bindings/power/fsl,imx-gpc.txt |??3 +++ ?drivers/soc/imx/gpc.c???????????????????????????????????| 16 +++++++++++++++- ?2 files changed, 18 insertions(+), 1 deletion(-)

Documentation/devicetree/bindings/power/fsl,imx-gpc.txt +0 -0
index e371b26..441f71e 100644
@@ -9,6 +9,7 @@ Required properties:

???- fsl,imx6q-gpc
???- fsl,imx6qp-gpc
???- fsl,imx6sl-gpc
+??- fsl,imx6sx-gpc
?- reg: should be register base and length as documented in the ???datasheet
?- interrupts: Should contain one interrupt specifier for the GPC interrupt

Documentation/devicetree/bindings/power/fsl,imx-gpc.txt +0 -0
@@ -29,6 +30,8 @@ Required properties:

???PU_DOMAIN??????1
???The following additional DOMAIN_INDEX value is valid for i.MX6SL:
???DISPLAY_DOMAIN 2
+??The following additional DOMAIN_INDEX value is valid for i.MX6SX:
+??PCI_DOMAIN?????3
?
?- #power-domain-cells: Should be 0
?

drivers/soc/imx/gpc.c +0 -0
index 47e7aa9..53f7275 100644
@@ -273,7 +273,15 @@ static struct imx_pm_domain imx_gpc_domains[] = {
 > ?		},
 > ?		.reg_offs = 0x240,
 > ?		.cntr_pdn_bit = 4,
 > -	}
 > +	}, {
 > +		.base = {
 > +			.name = "PCI",

drivers/soc/imx/gpc.c static struct imx_pm_domain imx_gpc_domains[] = { · line 284

Quoted 6 lines
drivers/soc/imx/gpc.c +6 -0
+			.power_off = imx6_pm_domain_power_off,
+			.power_on = imx6_pm_domain_power_on,
+		},
+		.reg_offs = 0x200,
+		.cntr_pdn_bit = 6,
+	},

?};
?
?struct imx_gpc_dt_data {

drivers/soc/imx/gpc.c +0 -0
@@ -296,10 +304,16 @@ static const struct imx_gpc_dt_data imx6sl_dt_data = {
 > ?	.err009619_present = false,
 ?};

?
+static const struct imx_gpc_dt_data imx6sx_dt_data = {

Quoted 2 lines
drivers/soc/imx/gpc.c +2 -0
+	.num_domains = 4,
+	.err009619_present = false,
drivers/soc/imx/gpc.c +2 -0
+};
+

?static const struct of_device_id imx_gpc_dt_ids[] = {

Quoted 5 lines

? { .compatible = "fsl,imx6q-gpc", .data = &imx6q_dt_data },
? { .compatible = "fsl,imx6qp-gpc", .data = &imx6qp_dt_data },
? { .compatible = "fsl,imx6sl-gpc", .data = &imx6sl_dt_data },

drivers/soc/imx/gpc.c +1 -0
+	{ .compatible = "fsl,imx6sx-gpc", .data = &imx6sx_dt_data },

? { }

?};
?

author reviewer
#4 lore raw

PATCH 1/2 soc: imx: gpc: Add i.MX6SX PCI power domain

Hi Lucas,

Quoted 2 lines · Lucas Stach

Seems like the GPC rework did turn out to work as expected by making it easy to add additional power domains. :)

Yes, thanks for doing the GPC driver rework. It really helped :-)

Quoted 2 lines

I didn't validate the register offsets, so this is:

Thanks!