[PATCH v2] rtc: snvs: add Freescale rtc-snvs driver
From: Kim Phillips <hidden>
Date: 2012-07-06 22:56:34
Subsystem:
linux for powerpc (32-bit and 64-bit), the rest · Maintainers:
Madhavan Srinivasan, Linus Torvalds
On Fri, 6 Jul 2012 08:22:56 +0800 Shawn Guo [off-list ref] wrote:
On Thu, Jul 05, 2012 at 06:28:29PM -0500, Kim Phillips wrote:quoted
On Wed, 4 Jul 2012 23:38:14 +0800 Shawn Guo [off-list ref] wrote:quoted
+static const struct of_device_id __devinitconst snvs_dt_ids[] = { + { .compatible = "fsl,sec-v4.0-mon-rtc-lp", },the driver should be compatible with "fsl,sec-v4.0-mon", and its probe function search for "fsl,sec-v4.0-mon-rtc-lp" sub-compatibles (and possibly "fsl,sec-v4.0-mon-rtc-hp" in the future?).So you think snvs is all about rtc (lp and hp), nothing else? If that
no, I'm aware that it's more than a couple of RTCs.
is true, it's reasonable to do what you suggested here. Otherwise, we should have a snvs driver be compatible with "fsl,sec-v4.0-mon", and this driver should be responsible for populate all the sub-devices of snvs, rtc-lp, rtc-hp, and others. In the latter case, rtc-snvs should just stay as it stands right now.
but it doesn't function as it stands right now, at least on Power. The compatible in the device tree's sec_mon node "fsl,sec-v4.0-mon" and the driver's "fsl,sec-v4.0-mon-rtc-lp" don't match. Here are the device tree changes I used:
diff --git a/arch/powerpc/boot/dts/fsl/qoriq-sec4.2-0.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-sec4.2-0.dtsi
index 7990e0d..14c933b 100644
--- a/arch/powerpc/boot/dts/fsl/qoriq-sec4.2-0.dtsi
+++ b/arch/powerpc/boot/dts/fsl/qoriq-sec4.2-0.dtsi@@ -104,6 +104,14 @@ crypto: crypto at 300000 { sec_mon: sec_mon at 314000 { compatible = "fsl,sec-v4.2-mon", "fsl,sec-v4.0-mon"; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 0x314000 0x1000>; reg = <0x314000 0x1000>; interrupts = <93 2 0 0>; + + sec_mon_rtc_lp at 34 { + compatible = "fsl,sec-v4.2-mon-rtc-lp", "fsl,sec-v4.0-mon-rtc-lp"; + reg = <0x34 0x58>; + }; };
btw, I don't see any imx6q.dtsi changes. Kim