Skip to contentSkip to conversation

soc: imx: add scu power domain driver

PATCH Superseded A.s. Dong 2 participants 5 messages Oct 18, 2018

Subsystems (2)

v7 of 9 Superseded Latest is v9 →

lore
Share & tools
lore

A.s. Dong

author
#0 lore raw

v7 cover soc: imx: add scu power domain driver

This patch set adds the scu based power domain driver. It depends on SCU driver.

Change Log:
v6->v7:
* keep "fsl,scu-pd" as fall back compatible string
v5->v6:
* only compatible string name updated from fsl,scu-pd to fsl,imx8qxp-scu-pd accordingly
v4->v5:
* some minor improvements according to Sascha's suggestion
Note: did not use dev_* print functions due to we already have proper
prefix by redefining pr_fmt. So it seems not quite neccesary to pass in a struct device * pointer for debug purpose only in each functions.
v3->v4:
* only scu headfile path update

v2->v3:
* structure and enums name update
* api usage update

Dong Aisheng (3):
dt-bindings: fsl: scu: make power domain compatible string SoC
specific
firmware: imx: add pm svc headfile
firmware: imx: add SCU power domain driver

 .../devicetree/bindings/arm/freescale/fsl,scu.txt  |   6 +-
 drivers/firmware/imx/Kconfig                       |   6 +
 drivers/firmware/imx/Makefile                      |   3 +-
 drivers/firmware/imx/scu-pd.c                      | 164 +++++++++++++++++++++
 include/linux/firmware/imx/sci.h                   |   1 +
 include/linux/firmware/imx/svc/pm.h                |  85 +++++++++++
 6 files changed, 262 insertions(+), 3 deletions(-)
 create mode 100644 drivers/firmware/imx/scu-pd.c
 create mode 100644 include/linux/firmware/imx/svc/pm.h
Signature · 1 line
2.7.4
author
#1 lore raw

PATCH v7 1/3 dt-bindings: fsl: scu: make power domain compatible string SoC specific

As the power domain API might change in the future for new SoCs, although in a very low possibility, it's still better to make the compatible string more SoC specific to avoid the possible version change for new SoCs.

Due to there're still no users in kernel, it's safe to update it without breaking anything.

Cc Shawn Guo <[email protected]>
Cc Sascha Hauer <[email protected]>
Cc Fabio Estevam <[email protected]>
Cc Rob Herring <[email protected]>
Cc Mark Rutland <[email protected]>
Cc devicetree at vger.kernel.org

---
ChangeLog:
v6->v7:
* keep "fsl,scu-pd" as fall back compatible string
v5->v6:
* new patch

---
 Documentation/devicetree/bindings/arm/freescale/fsl,scu.txt | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/arm/freescale/fsl,scu.txt +4 -2
index 46d0af1..e5f3edf 100644
@@ -58,7 +58,9 @@ This binding for the SCU power domain providers uses the generic power
 domain binding[2].
 
 Required properties:
-- compatible:		Should be "fsl,scu-pd".
+- compatible:		Should be one of:
+			  "fsl,imx8qxp-scu-pd"
+			followed by "fsl,scu-pd"
 - #address-cells:	Should be 1.
 - #size-cells:		Should be 0.
 
@@ -153,7 +155,7 @@ firmware {
 		};
 
 		imx8qx-pm {
-			compatible = "fsl,scu-pd";
+			compatible = "fsl,imx8qxp-scu-pd", "fsl,scu-pd";
 			#address-cells = <1>;
 			#size-cells = <0>;
 
Signature · 1 line
2.7.4
maintainer
#2 lore raw

PATCH v7 1/3 dt-bindings: fsl: scu: make power domain compatible string SoC specific

Quoted 21 lines · A.s. Dong

As the power domain API might change in the future for new SoCs, although in a very low possibility, it's still better to make the compatible string more SoC specific to avoid the possible version change for new SoCs.

Due to there're still no users in kernel, it's safe to update it without breaking anything.

Cc Shawn Guo <[email protected]>
Cc Sascha Hauer <[email protected]>
Cc Fabio Estevam <[email protected]>
Cc Rob Herring <[email protected]>
Cc Mark Rutland <[email protected]>
Cc devicetree at vger.kernel.org

---
ChangeLog:
v6->v7:
* keep "fsl,scu-pd" as fall back compatible string
v5->v6:
* new patch

Quoted 4 lines
---
 Documentation/devicetree/bindings/arm/freescale/fsl,scu.txt | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
author
#3 lore raw

PATCH v7 2/3 firmware: imx: add pm svc headfile

In reply to A.s. Dong

Add SCU PM SVC related protocol definitions which will be used by a number of PM functions like Power Domain, Clock, Reset and etc. The detailed implementation of each function will put in the individual function drivers.

Cc Shawn Guo <[email protected]>
Cc Sascha Hauer <[email protected]>

---
v3->v4:
* update firmware headfile patch from include/soc/imx to include/linux/firmware/imx
v2->v3:
* name updated with IMX_SC prefix
v1->v2:
* new introduced

---
 include/linux/firmware/imx/sci.h    |  1 +
 include/linux/firmware/imx/svc/pm.h | 85 +++++++++++++++++++++++++++++++++++++
 2 files changed, 86 insertions(+)
 create mode 100644 include/linux/firmware/imx/svc/pm.h
include/linux/firmware/imx/sci.h +1 -0
index 29ada60..ebc5509 100644
@@ -14,4 +14,5 @@
 #include <linux/firmware/imx/types.h>
 
 #include <linux/firmware/imx/svc/misc.h>
+#include <linux/firmware/imx/svc/pm.h>
 #endif /* _SC_SCI_H */
include/linux/firmware/imx/svc/pm.h new file +85 -0

85 lines not on this page · raw message

Signature · 1 line
2.7.4
author
#4 lore raw

PATCH v7 3/3 firmware: imx: add SCU power domain driver

In reply to A.s. Dong

Some i.MX SoCs contain a system controller that is responsible for controlling the state of the IPs that are present. Communication between the host processor running an OS and the system controller happens through a SCU protocol. This patch adds SCU protocol based power domains drivers.

Cc Shawn Guo <[email protected]>
Cc Sascha Hauer <[email protected]>
Cc Fabio Estevam <[email protected]>
Cc "Rafael J. Wysocki" <[email protected]>
Cc Kevin Hilman <[email protected]>
Cc linux-pm at vger.kernel.org

---
ChangeLog:
v6->v7:
* still using generic "fsl,scu-pd" to driver binding incase the future SoC is compatible
* remove unnecessary cast
v5->v6:
* only compatible string name updated from fsl,scu-pd to fsl,imx8qxp-scu-pd accordingly
v4->v5:
* minor improvements according to Sascha's suggestions
v3->v4:
* update firmware headfile patch from include/soc/imx to include/linux/firmware/imx
v2->v3:
* name of structures/enums updated with imx_sc prefix
v1->v2:
* move into drivers/firmware/imx
* Implement sc_pm_set_resource_power_mode() API in the driver instead of call it via SCU API according to Sascha's suggestion

---
 drivers/firmware/imx/Kconfig  |   6 ++
 drivers/firmware/imx/Makefile |   3 +-
 drivers/firmware/imx/scu-pd.c | 164 ++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 172 insertions(+), 1 deletion(-)
 create mode 100644 drivers/firmware/imx/scu-pd.c
drivers/firmware/imx/Kconfig +6 -0
index b170c28..6a7a7c2 100644
@@ -9,3 +9,9 @@ config IMX_SCU
 
 	  This driver manages the IPC interface between host CPU and the
 	  SCU firmware running on M4.
+
+config IMX_SCU_PD
+	bool "IMX SCU Power Domain driver"
+	depends on IMX_SCU
+	help
+	  The System Controller Firmware (SCFW) based power domain driver.
drivers/firmware/imx/Makefile +2 -1
index 0ac04df..1b2e15b 100644
@@ -1,2 +1,3 @@
 # SPDX-License-Identifier: GPL-2.0
-obj-$(CONFIG_IMX_SCU)	+= imx-scu.o misc.o
+obj-$(CONFIG_IMX_SCU)		+= imx-scu.o misc.o
+obj-$(CONFIG_IMX_SCU_PD)	+= scu-pd.o
drivers/firmware/imx/scu-pd.c new file +164 -0

164 lines not on this page · raw message

Signature · 1 line
2.7.4