Skip to contentSkip to conversation

dt-bindings: fsl: scu: Update RTC compatible string

PATCH In review [email protected] 6 participants 11 messages Jun 11, 2019 – Jul 9, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/3 dt-bindings: fsl: scu: Update RTC compatible string

From: Anson Huang <[email protected]>

Update RTC compatible string to make system controller RTC driver more generic for all i.MX SoCs with system controller inside.

---
This patch should be based on below patch which is already picked by watchdog maintainer:
https://patchwork.kernel.org/patch/10962183/

---
 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 fc3844e..7ca20a1 100644
@@ -131,7 +131,9 @@ RTC bindings based on SCU Message Protocol
 ------------------------------------------------------------
 
 Required properties:
-- compatible: should be "fsl,imx8qxp-sc-rtc";
+- compatible: should be:
+              "fsl,imx8qxp-sc-rtc"
+              followed by "fsl,imx-sc-rtc";
 
 OCOTP bindings based on SCU Message Protocol
 ------------------------------------------------------------
@@ -226,7 +228,7 @@ firmware {
 		};
 
 		rtc: rtc {
-			compatible = "fsl,imx8qxp-sc-rtc";
+			compatible = "fsl,imx8qxp-sc-rtc", "fsl,imx-sc-rtc";
 		};
 
 		watchdog {
Signature · 1 line
2.7.4
#1 lore raw

PATCH 2/3 rtc: imx-sc: Make compatible string more generic

From: Anson Huang <[email protected]>

i.MX system controller RTC driver can support all i.MX SoCs with system controller inside, this patch makes the compatible string more generic to support other i.MX SoCs with system controller inside, such as i.MX8QM etc..

---
 drivers/rtc/rtc-imx-sc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/rtc/rtc-imx-sc.c +1 -1
index c933045..38ef3ca 100644
@@ -178,7 +178,7 @@ static int imx_sc_rtc_probe(struct platform_device *pdev)
 }
 
 static const struct of_device_id imx_sc_dt_ids[] = {
-	{ .compatible = "fsl,imx8qxp-sc-rtc", },
+	{ .compatible = "fsl,imx-sc-rtc", },
 	{}
 };
 MODULE_DEVICE_TABLE(of, imx_sc_dt_ids);
Signature · 1 line
2.7.4
Reviewed-by on v1 2/3
#2 lore raw

RE: [PATCH 2/3] rtc: imx-sc: Make compatible string more generic

Quoted 8 lines

From: [email protected] [mailto:[email protected]]
Sent: Tuesday, June 11, 2019 2:34 PM

i.MX system controller RTC driver can support all i.MX SoCs with system controller inside, this patch makes the compatible string more generic to support other i.MX SoCs with system controller inside, such as i.MX8QM etc..

Regards
Dong Aisheng

Quoted 19 lines
---
 drivers/rtc/rtc-imx-sc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/rtc/rtc-imx-sc.c index renamed from drivers/rtc/rtc-imx-sc.c +0 -0

c933045..38ef3ca 100644

drivers/rtc/rtc-imx-sc.c +1 -2
@@ -178,7 +178,7 @@ static int imx_sc_rtc_probe(struct platform_device
 *pdev)  }
 
 static const struct of_device_id imx_sc_dt_ids[] = {
-	{ .compatible = "fsl,imx8qxp-sc-rtc", },
+	{ .compatible = "fsl,imx-sc-rtc", },
 	{}
 };
 MODULE_DEVICE_TABLE(of, imx_sc_dt_ids);
--

2.7.4

#3 lore raw

Re: [PATCH 2/3] rtc: imx-sc: Make compatible string more generic

Quoted 25 lines · Aisheng Dong
Quoted 8 lines

From: [email protected] [mailto:[email protected]]
Sent: Tuesday, June 11, 2019 2:34 PM

i.MX system controller RTC driver can support all i.MX SoCs with system controller inside, this patch makes the compatible string more generic to support other i.MX SoCs with system controller inside, such as i.MX8QM etc..

Regards
Dong Aisheng

Quoted 11 lines
---
 drivers/rtc/rtc-imx-sc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/rtc/rtc-imx-sc.c index renamed from drivers/rtc/rtc-imx-sc.c +0 -0

c933045..38ef3ca 100644

drivers/rtc/rtc-imx-sc.c +0 -0
@@ -178,7 +178,7 @@ static int imx_sc_rtc_probe(struct platform_device
 *pdev)  }
 
Quoted 2 lines

drivers/rtc/rtc-imx-sc.c static int imx_sc_rtc_probe(struct platform_device *pdev) · line 181

Quoted 2 lines
drivers/rtc/rtc-imx-sc.c +0 -1
 static const struct of_device_id imx_sc_dt_ids[] = {
-	{ .compatible = "fsl,imx8qxp-sc-rtc", },

Don't you want to keep that compatible for backward compatibility?

Quoted 7 lines
Quoted 6 lines
drivers/rtc/rtc-imx-sc.c +1 -1
+	{ .compatible = "fsl,imx-sc-rtc", },
 	{}
 };
 MODULE_DEVICE_TABLE(of, imx_sc_dt_ids);
--

2.7.4

Signature · 3 lines
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
reviewer
#4 lore raw

Re: [PATCH 2/3] rtc: imx-sc: Make compatible string more generic

In reply to [email protected]

Hi Anson,

Quoted 18 lines · On Tue, Jun 11, 2019 at 3:31 AM <[email protected]> wrote:

From: Anson Huang <[email protected]>

i.MX system controller RTC driver can support all i.MX SoCs with system controller inside, this patch makes the compatible string more generic to support other i.MX SoCs with system controller inside, such as i.MX8QM etc..

---
 drivers/rtc/rtc-imx-sc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/rtc/rtc-imx-sc.c +0 -0
index c933045..38ef3ca 100644

drivers/rtc/rtc-imx-sc.c static int imx_sc_rtc_probe(struct platform_device *pdev) · line 181

Quoted 5 lines
drivers/rtc/rtc-imx-sc.c +1 -1
@@ -178,7 +178,7 @@ static int imx_sc_rtc_probe(struct platform_device *pdev)
 }
 
 static const struct of_device_id imx_sc_dt_ids[] = {
-       { .compatible = "fsl,imx8qxp-sc-rtc", },
+       { .compatible = "fsl,imx-sc-rtc", },

What is wrong with the current compatible string?

If you want to support i.MX8QM just add in its dtsi:

compatible = "fsl,imx8qm-sc-rtc", "fsl,imx8qxp-sc-rtc"

and add a dt-bindings entry for "fsl,imx8qm-sc-rtc"

#5 lore raw

Re: [PATCH 2/3] rtc: imx-sc: Make compatible string more generic

Quoted 30 lines · Fabio Estevam

Hi Anson,

Quoted 18 lines · On Tue, Jun 11, 2019 at 3:31 AM <[email protected]> wrote:

From: Anson Huang <[email protected]>

i.MX system controller RTC driver can support all i.MX SoCs with system controller inside, this patch makes the compatible string more generic to support other i.MX SoCs with system controller inside, such as i.MX8QM etc..

---
 drivers/rtc/rtc-imx-sc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/rtc/rtc-imx-sc.c +0 -0
index c933045..38ef3ca 100644

drivers/rtc/rtc-imx-sc.c static int imx_sc_rtc_probe(struct · line 182

Quoted 6 lines
drivers/rtc/rtc-imx-sc.c +1 -1
@@ -178,7 +178,7 @@ static int imx_sc_rtc_probe(struct
 platform_device *pdev)
 }
 
 static const struct of_device_id imx_sc_dt_ids[] = {
-       { .compatible = "fsl,imx8qxp-sc-rtc", },
+       { .compatible = "fsl,imx-sc-rtc", },

What is wrong with the current compatible string?

Quoted 5 lines

If you want to support i.MX8QM just add in its dtsi:

compatible = "fsl,imx8qm-sc-rtc", "fsl,imx8qxp-sc-rtc"

and add a dt-bindings entry for "fsl,imx8qm-sc-rtc"

Yes, I thought this is (was?) the recommended practice for IP blocks in SoCs that don't have their own version (vs something like a Synopsis block used many places):

* Use the first SoC to have the block as the base compatible for the block.
* Always add the current SoC, in additional to the base, in the SoC's dts's list of compatibles. Even if unneeded at the present.
* The driver will list the base compatible in the match table, and will add new ones for specific socs if/when there is a need for it.

#6 lore raw

RE: [PATCH 2/3] rtc: imx-sc: Make compatible string more generic

Hi, Fabio/Trent

Quoted 14 lines

-----Original Message-----
From: Trent Piepho <[email protected]>
Sent: Wednesday, June 12, 2019 4:46 AM
To: [email protected]; Anson Huang <[email protected]>
Cc: Aisheng Dong <[email protected]>; [email protected]; [email protected]; dl-linux-imx <[email protected]>; linux- [email protected]; [email protected]; [email protected]; [email protected]; Peng Fan <[email protected]>; [email protected]; linux-arm- [email protected]; Daniel Baluta <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH 2/3] rtc: imx-sc: Make compatible string more generic

Quoted 29 lines
Quoted 28 lines · Fabio Estevam

Hi Anson,

Quoted 18 lines · On Tue, Jun 11, 2019 at 3:31 AM <[email protected]> wrote:

From: Anson Huang <[email protected]>

i.MX system controller RTC driver can support all i.MX SoCs with system controller inside, this patch makes the compatible string more generic to support other i.MX SoCs with system controller inside, such as i.MX8QM etc..

---
 drivers/rtc/rtc-imx-sc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/rtc/rtc-imx-sc.c +0 -0
index c933045..38ef3ca 100644

drivers/rtc/rtc-imx-sc.c static int imx_sc_rtc_probe(struct · line 181

Quoted 5 lines
drivers/rtc/rtc-imx-sc.c +1 -1
@@ -178,7 +178,7 @@ static int imx_sc_rtc_probe(struct
 platform_device *pdev)  }
 
 static const struct of_device_id imx_sc_dt_ids[] = {
-       { .compatible = "fsl,imx8qxp-sc-rtc", },
+       { .compatible = "fsl,imx-sc-rtc", },

What is wrong with the current compatible string?

Nothing wrong, just want to make it aligned with other SCU drivers, like SCU watchdog, SCU thermal etc., the driver ONLY contains "fsl,imx-sc-xxx" compatible string, then for new SoC, we can just add it as compatible or fallback compatible string, no need to do any change for driver.

Quoted 6 lines
Quoted 6 lines

If you want to support i.MX8QM just add in its dtsi:

compatible = "fsl,imx8qm-sc-rtc", "fsl,imx8qxp-sc-rtc"

and add a dt-bindings entry for "fsl,imx8qm-sc-rtc"

I am OK if we can just use " fsl,imx8qxp-sc-rtc" as fallback compatible string for later SoCs.

Quoted 10 lines

Yes, I thought this is (was?) the recommended practice for IP blocks in SoCs that don't have their own version (vs something like a Synopsis block used many places):

* Use the first SoC to have the block as the base compatible for the block.
* Always add the current SoC, in additional to the base, in the SoC's dts's list of compatibles. Even if unneeded at the present.
* The driver will list the base compatible in the match table, and will add new ones for specific socs if/when there is a need for it.

Make sense, I was recommended to make the fallback compatible string aligned for all SCU drivers, for me, I am OK with either way, so if you think it is NOT necessary to do it, we can drop this series.

Thanks,
Anson

#7 lore raw

PATCH 3/3 arm64: dts: imx8qxp: Add fallback compatible string for RTC node

In reply to [email protected]

From: Anson Huang <[email protected]>

The i.MX system controller RTC driver uses generic compatible string to support all i.MX SoCs with system controller inside, this patch adds the generic system controller RTC compatible string as fallback compatible string accordingly.

---
 arch/arm64/boot/dts/freescale/imx8qxp.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/freescale/imx8qxp.dtsi +1 -1
index 12044be..40811a2 100644
@@ -162,7 +162,7 @@
 		};
 
 		rtc: rtc {
-			compatible = "fsl,imx8qxp-sc-rtc";
+			compatible = "fsl,imx8qxp-sc-rtc", "fsl,imx-sc-rtc";
 		};
 
 		watchdog {
Signature · 1 line
2.7.4
Reviewed-by on v1 3/3
#8 lore raw

RE: [PATCH 3/3] arm64: dts: imx8qxp: Add fallback compatible string for RTC node

Quoted 9 lines

From: [email protected] [mailto:[email protected]]
Sent: Tuesday, June 11, 2019 2:34 PM

The i.MX system controller RTC driver uses generic compatible string to support all i.MX SoCs with system controller inside, this patch adds the generic system controller RTC compatible string as fallback compatible string accordingly.

Regards
Dong Aisheng

maintainer Reviewed-by on v1 1/3
#10 lore raw
In reply to [email protected]
Quoted 6 lines · On Tue, 11 Jun 2019 14:33:31 +0800, [email protected] wrote:

From: Anson Huang <[email protected]>

Update RTC compatible string to make system controller RTC driver more generic for all i.MX SoCs with system controller inside.

Quoted 9 lines

---
This patch should be based on below patch which is already picked by watchdog maintainer:
https://patchwork.kernel.org/patch/10962183/

---
 Documentation/devicetree/bindings/arm/freescale/fsl,scu.txt | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)