soc: imx: add scu power domain driver
Subsystems (2)
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 stringv5->v6:
* only compatible string name updated from fsl,scu-pd to fsl,imx8qxp-scu-pd accordinglyv4->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
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.
---
ChangeLog:v6->v7:
* keep "fsl,scu-pd" as fall back compatible stringv5->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
@@ -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
Rob Herring
maintainerPATCH 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.orgSuggested-by Sascha Hauer <[email protected]>Signed-off-by Dong Aisheng <[email protected]>---
ChangeLog:v6->v7:
* keep "fsl,scu-pd" as fall back compatible stringv5->v6:
* new patch
Quoted 4 lines
--- Documentation/devicetree/bindings/arm/freescale/fsl,scu.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
PATCH v7 2/3 firmware: imx: add pm svc headfile
In reply to A.s. DongAdd 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.
---v3->v4:
* update firmware headfile patch from include/soc/imx to include/linux/firmware/imxv2->v3:
* name updated with IMX_SC prefixv1->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
@@ -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
PATCH v7 3/3 firmware: imx: add SCU power domain driver
In reply to A.s. DongSome 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.
---
ChangeLog:v6->v7:
* still using generic "fsl,scu-pd" to driver binding incase the future SoC is compatible
* remove unnecessary castv5->v6:
* only compatible string name updated from fsl,scu-pd to fsl,imx8qxp-scu-pd accordinglyv4->v5:
* minor improvements according to Sascha's suggestionsv3->v4:
* update firmware headfile patch from include/soc/imx to include/linux/firmware/imxv2->v3:
* name of structures/enums updated with imx_sc prefixv1->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
@@ -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
@@ -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