Add i.MX system controller RTC driver
Subsystems (3)
v5 cover Add i.MX system controller RTC driver
NXP i.MX8QXP is an ARMv8 SoC with a Cortex-M4 core inside as system controller, the system controller is in charge of system power, clock and secure RTC etc. management, Linux kernel has to communicate with system controller via MU (message unit) IPC to do RTC operation.
Since the RTC set time MUST to be done in secure EL3 mode (required by system controller firmware) and ALARM functions needs to be done with general MU IRQ handle, these are NOT ready NOW, so this patch ONLY supports RTC read time for now.
Note that this patch set is based on [V4,5/5] defconfig: arm64: add imx8qxp support,
https://patchwork.kernel.org/patch/10677315/
Anson Huang (4):
rtc: add i.MX system controller RTC support
dt-bindings: rtc: add binding doc for i.MX system controller RTC
driver
defconfig: arm64: add i.MX system controller RTC support
ARM64: dts: imx: add i.MX8QXP system controller RTC support
.../devicetree/bindings/rtc/rtc-imx-sc.txt | 10 ++ arch/arm64/boot/dts/freescale/imx8qxp.dtsi | 4 + arch/arm64/configs/defconfig | 1 + drivers/rtc/Kconfig | 6 ++ drivers/rtc/Makefile | 1 + drivers/rtc/rtc-imx-sc.c | 104 +++++++++++++++++++++ 6 files changed, 126 insertions(+) create mode 100644 Documentation/devicetree/bindings/rtc/rtc-imx-sc.txt create mode 100644 drivers/rtc/rtc-imx-sc.c
Signature · 1 line
2.7.4
PATCH v5 1/4 dt-bindings: fsl: scu: add rtc binding
NXP i.MX8QXP is an ARMv8 SoC with a Cortex-M4 core inside as system controller, the system controller is in charge of system power, clock and secure RTC etc. management, Linux kernel has to communicate with system controller via MU (message unit) IPC to do RTC operation, this patch adds binding doc for i.MX system controller RTC driver.
---
No change since V4.
--- Documentation/devicetree/bindings/arm/freescale/fsl,scu.txt | 10 ++++++++++ 1 file changed, 10 insertions(+)
Documentation/devicetree/bindings/arm/freescale/fsl,scu.txt +10 -0
@@ -106,6 +106,12 @@ Required properties for Pinctrl sub nodes: [2] Documentation/devicetree/bindings/power/power_domain.txt [3] Documentation/devicetree/bindings/pinctrl/fsl,imx-pinctrl.txt +RTC bindings based on SCU Message Protocol +------------------------------------------------------------ + +Required properties: +- compatible: should be "fsl,imx8qxp-sc-rtc"; + Example (imx8qxp): ------------- lsio_mu1: mailbox@5d1c0000 {
@@ -148,6 +154,10 @@ firmware { compatible = "fsl,imx8qxp-scu-pd"; #power-domain-cells = <1>; }; + + rtc: rtc { + compatible = "fsl,imx8qxp-sc-rtc"; + }; }; };
Signature · 7 lines
2.7.4 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH v5 1/4 dt-bindings: fsl: scu: add rtc binding
In reply to Anson HuangNXP i.MX8QXP is an ARMv8 SoC with a Cortex-M4 core inside as system controller, the system controller is in charge of system power, clock and secure RTC etc. management, Linux kernel has to communicate with system controller via MU (message unit) IPC to do RTC operation, this patch adds binding doc for i.MX system controller RTC driver.
---
No change since V4.
--- Documentation/devicetree/bindings/arm/freescale/fsl,scu.txt | 10 ++++++++++ 1 file changed, 10 insertions(+)
Documentation/devicetree/bindings/arm/freescale/fsl,scu.txt +10 -0
@@ -106,6 +106,12 @@ Required properties for Pinctrl sub nodes: [2] Documentation/devicetree/bindings/power/power_domain.txt [3] Documentation/devicetree/bindings/pinctrl/fsl,imx-pinctrl.txt +RTC bindings based on SCU Message Protocol +------------------------------------------------------------ + +Required properties: +- compatible: should be "fsl,imx8qxp-sc-rtc"; + Example (imx8qxp): ------------- lsio_mu1: mailbox@5d1c0000 {
@@ -148,6 +154,10 @@ firmware { compatible = "fsl,imx8qxp-scu-pd"; #power-domain-cells = <1>; }; + + rtc: rtc { + compatible = "fsl,imx8qxp-sc-rtc"; + }; }; };
Signature · 1 line
2.7.4
PATCH v5 2/4 rtc: add i.MX system controller RTC support
In reply to Anson Huangi.MX8QXP is an ARMv8 SoC which has a Cortex-M4 system controller inside, the system controller is in charge of controlling power, clock and secure rtc etc..
This patch adds i.MX system controller RTC driver support, Linux kernel has to communicate with system controller via MU (message unit) IPC to set/get RTC time and other alarm functions, since the RTC set time needs to be done in secure EL3 mode (required by system controller firmware) and alarm functions needs to be done with general MU IRQ handle, these depend on other components which are NOT ready, so this patch ONLY enables the RTC time read.
---
ChangeLog since V4:
- Add dependency on IMX_SCU to avoid compile error when IMX_SCU is NOT enabled;
- Use dev_err instead of pr_err;
- Remove unneccssary different errors check in imx_scu_get_handle which is already done in API.
--- drivers/rtc/Kconfig | 7 ++++ drivers/rtc/Makefile | 1 + drivers/rtc/rtc-imx-sc.c | 91 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 99 insertions(+) create mode 100644 drivers/rtc/rtc-imx-sc.c
drivers/rtc/Kconfig +7 -0
@@ -1677,6 +1677,13 @@ config RTC_DRV_SNVS This driver can also be built as a module, if so, the module will be called "rtc-snvs". +config RTC_DRV_IMX_SC + depends on IMX_SCU + tristate "NXP i.MX System Controller RTC support" + help + If you say yes here you get support for the NXP i.MX System + Controller RTC module. + config RTC_DRV_SIRFSOC tristate "SiRFSOC RTC" depends on ARCH_SIRF
drivers/rtc/Makefile +1 -0
@@ -75,6 +75,7 @@ obj-$(CONFIG_RTC_DRV_GOLDFISH) += rtc-goldfish.o obj-$(CONFIG_RTC_DRV_HID_SENSOR_TIME) += rtc-hid-sensor-time.o obj-$(CONFIG_RTC_DRV_HYM8563) += rtc-hym8563.o obj-$(CONFIG_RTC_DRV_IMXDI) += rtc-imxdi.o +obj-$(CONFIG_RTC_DRV_IMX_SC) += rtc-imx-sc.o obj-$(CONFIG_RTC_DRV_ISL12022) += rtc-isl12022.o obj-$(CONFIG_RTC_DRV_ISL12026) += rtc-isl12026.o obj-$(CONFIG_RTC_DRV_ISL1208) += rtc-isl1208.o
drivers/rtc/rtc-imx-sc.c new file +91 -0
91 lines not on this page · raw message
Signature · 1 line
2.7.4
PATCH v5 3/4 defconfig: arm64: add i.MX system controller RTC support
In reply to Anson HuangThis patch enables CONFIG_RTC_DRV_IMX_SC as module by default.
---
No change since V4.
--- arch/arm64/configs/defconfig | 1 + 1 file changed, 1 insertion(+)
arch/arm64/configs/defconfig +1 -0
@@ -572,6 +572,7 @@ CONFIG_RTC_DRV_PL031=y CONFIG_RTC_DRV_SUN6I=y CONFIG_RTC_DRV_ARMADA38X=y CONFIG_RTC_DRV_TEGRA=y +CONFIG_RTC_DRV_IMX_SC=m CONFIG_RTC_DRV_XGENE=y CONFIG_DMADEVICES=y CONFIG_DMA_BCM2835=m
Signature · 1 line
2.7.4
PATCH v5 3/4 defconfig: arm64: add i.MX system controller RTC support
In reply to Anson HuangThis patch enables CONFIG_RTC_DRV_IMX_SC as module by default.
---
No change since V4.
--- arch/arm64/configs/defconfig | 1 + 1 file changed, 1 insertion(+)
arch/arm64/configs/defconfig +1 -0
@@ -572,6 +572,7 @@ CONFIG_RTC_DRV_PL031=y CONFIG_RTC_DRV_SUN6I=y CONFIG_RTC_DRV_ARMADA38X=y CONFIG_RTC_DRV_TEGRA=y +CONFIG_RTC_DRV_IMX_SC=m CONFIG_RTC_DRV_XGENE=y CONFIG_DMADEVICES=y CONFIG_DMA_BCM2835=m
Signature · 1 line
2.7.4
PATCH v5 2/4 rtc: add i.MX system controller RTC support
In reply to Anson Huangi.MX8QXP is an ARMv8 SoC which has a Cortex-M4 system controller inside, the system controller is in charge of controlling power, clock and secure rtc etc..
This patch adds i.MX system controller RTC driver support, Linux kernel has to communicate with system controller via MU (message unit) IPC to set/get RTC time and other alarm functions, since the RTC set time needs to be done in secure EL3 mode (required by system controller firmware) and alarm functions needs to be done with general MU IRQ handle, these depend on other components which are NOT ready, so this patch ONLY enables the RTC time read.
---
ChangeLog since V4:
- Add dependency on IMX_SCU to avoid compile error when IMX_SCU is NOT enabled;
- Use dev_err instead of pr_err;
- Remove unneccssary different errors check in imx_scu_get_handle which is already done in API.
--- drivers/rtc/Kconfig | 7 ++++ drivers/rtc/Makefile | 1 + drivers/rtc/rtc-imx-sc.c | 91 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 99 insertions(+) create mode 100644 drivers/rtc/rtc-imx-sc.c
drivers/rtc/Kconfig +7 -0
@@ -1677,6 +1677,13 @@ config RTC_DRV_SNVS This driver can also be built as a module, if so, the module will be called "rtc-snvs". +config RTC_DRV_IMX_SC + depends on IMX_SCU + tristate "NXP i.MX System Controller RTC support" + help + If you say yes here you get support for the NXP i.MX System + Controller RTC module. + config RTC_DRV_SIRFSOC tristate "SiRFSOC RTC" depends on ARCH_SIRF
drivers/rtc/Makefile +1 -0
@@ -75,6 +75,7 @@ obj-$(CONFIG_RTC_DRV_GOLDFISH) += rtc-goldfish.o obj-$(CONFIG_RTC_DRV_HID_SENSOR_TIME) += rtc-hid-sensor-time.o obj-$(CONFIG_RTC_DRV_HYM8563) += rtc-hym8563.o obj-$(CONFIG_RTC_DRV_IMXDI) += rtc-imxdi.o +obj-$(CONFIG_RTC_DRV_IMX_SC) += rtc-imx-sc.o obj-$(CONFIG_RTC_DRV_ISL12022) += rtc-isl12022.o obj-$(CONFIG_RTC_DRV_ISL12026) += rtc-isl12026.o obj-$(CONFIG_RTC_DRV_ISL1208) += rtc-isl1208.o
drivers/rtc/rtc-imx-sc.c new file +91 -0
91 lines not on this page · raw message
Signature · 1 line
2.7.4
PATCH v5 4/4 ARM64: dts: imx: add i.MX8QXP system controller RTC support
In reply to Anson HuangAdd i.MX8QXP system controller RTC support.
---
No change since V4.
--- arch/arm64/boot/dts/freescale/imx8qxp.dtsi | 4 ++++ 1 file changed, 4 insertions(+)
arch/arm64/boot/dts/freescale/imx8qxp.dtsi +4 -0
@@ -83,6 +83,10 @@ compatible = "fsl,imx8qxp-scu-pd"; #power-domain-cells = <1>; }; + + rtc: rtc { + compatible = "fsl,imx8qxp-sc-rtc"; + }; }; adma_subsys: bus@59000000 {
Signature · 1 line
2.7.4
PATCH v5 4/4 ARM64: dts: imx: add i.MX8QXP system controller RTC support
In reply to Anson HuangAdd i.MX8QXP system controller RTC support.
---
No change since V4.
--- arch/arm64/boot/dts/freescale/imx8qxp.dtsi | 4 ++++ 1 file changed, 4 insertions(+)
arch/arm64/boot/dts/freescale/imx8qxp.dtsi +4 -0
@@ -83,6 +83,10 @@ compatible = "fsl,imx8qxp-scu-pd"; #power-domain-cells = <1>; }; + + rtc: rtc { + compatible = "fsl,imx8qxp-sc-rtc"; + }; }; adma_subsys: bus@59000000 {
Signature · 1 line
2.7.4
Re: [PATCH V5 1/4] dt-bindings: fsl: scu: add rtc binding
In reply to Anson HuangQuoted 7 lines · Anson Huang
NXP i.MX8QXP is an ARMv8 SoC with a Cortex-M4 core inside as system controller, the system controller is in charge of system power, clock and secure RTC etc. management, Linux kernel has to communicate with system controller via MU (message unit) IPC to do RTC operation, this patch adds binding doc for i.MX system controller RTC driver.
Quoted 8 lines
Signed-off-by Anson Huang <[email protected]>Reviewed-by Rob Herring <[email protected]>---
No change since V4.--- Documentation/devicetree/bindings/arm/freescale/fsl,scu.txt | 10 ++++++++++ 1 file changed, 10 insertions(+)
Applied, thanks.
Signature · 3 lines
Alexandre Belloni, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
Re: [PATCH V5 2/4] rtc: add i.MX system controller RTC support
In reply to Anson HuangQuoted 18 lines · Anson Huang
i.MX8QXP is an ARMv8 SoC which has a Cortex-M4 system controller inside, the system controller is in charge of controlling power, clock and secure rtc etc..
This patch adds i.MX system controller RTC driver support, Linux kernel has to communicate with system controller via MU (message unit) IPC to set/get RTC time and other alarm functions, since the RTC set time needs to be done in secure EL3 mode (required by system controller firmware) and alarm functions needs to be done with general MU IRQ handle, these depend on other components which are NOT ready, so this patch ONLY enables the RTC time read.
Signed-off-by Anson Huang <[email protected]>---
ChangeLog since V4:
- Add dependency onIMX_SCUto avoid compile error whenIMX_SCUis NOT enabled;
- Usedev_errinstead ofpr_err;
- Remove unneccssary different errors check inimx_scu_get_handlewhich is already done in API.
Quoted 7 lines
--- drivers/rtc/Kconfig | 7 ++++ drivers/rtc/Makefile | 1 + drivers/rtc/rtc-imx-sc.c | 91 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 99 insertions(+) create mode 100644 drivers/rtc/rtc-imx-sc.c
Applied, thanks.
Signature · 3 lines
Alexandre Belloni, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
Shawn Guo
AppliedRe: [PATCH V5 3/4] defconfig: arm64: add i.MX system controller RTC support
In reply to Anson HuangQuoted 3 lines · Anson Huang
This patch enables
CONFIG_RTC_DRV_IMX_SCas module by default.Signed-off-by Anson Huang <[email protected]>
Applied, thanks.
Re: [PATCH V5 4/4] ARM64: dts: imx: add i.MX8QXP system controller RTC support
In reply to Anson HuangQuoted 3 lines · Anson Huang
Add i.MX8QXP system controller RTC support.
Signed-off-by Anson Huang <[email protected]>
Different from arm32 dts patches, we use prefix 'arm64: ...' for arm64 ones. I fixed it up and applied the patch.
Shawn