Message ID | 1454056802-23386-3-git-send-email-linux@rempel-privat.de |
---|---|
State | Changes Requested, archived |
Headers | show |
On Fri, Jan 29, 2016 at 09:40:02AM +0100, Oleksij Rempel wrote: > Document Alphascale asm9260 RTC bindings > > Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> > --- > .../bindings/rtc/alphascale,asm9260-rtc.txt | 25 ++++++++++++++++++++++ > 1 file changed, 25 insertions(+) > create mode 100644 Documentation/devicetree/bindings/rtc/alphascale,asm9260-rtc.txt > > diff --git a/Documentation/devicetree/bindings/rtc/alphascale,asm9260-rtc.txt b/Documentation/devicetree/bindings/rtc/alphascale,asm9260-rtc.txt > new file mode 100644 > index 0000000..2c0ff3c > --- /dev/null > +++ b/Documentation/devicetree/bindings/rtc/alphascale,asm9260-rtc.txt > @@ -0,0 +1,25 @@ > +* Alphascale asm9260 SoC Real Time Clock > + > +Required properties: > +- compatible: Should be "alphascale,asm9260-rtc" > +- reg: Physical base address of the controller and length > + of memory mapped region. > +- interrupts: IRQ line for the RTC. > +- clocks: Reference to the clock entry. > +- clock-names: should contain: > + * "ahb" for the SoC RTC clock > + > +Optional: > +- calibration: calibration value for 1 sec period. > + Max value for forward calibration is 0x1ffff (131071), > + Min value for backward calibration is 0xfffe0001 (-131071). This should be prefixed with 'alphascale,' How is this value determined? Rob -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On 01/02/2016 at 09:27:50 -0600, Rob Herring wrote : > On Fri, Jan 29, 2016 at 09:40:02AM +0100, Oleksij Rempel wrote: > > Document Alphascale asm9260 RTC bindings > > > > Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> > > --- > > .../bindings/rtc/alphascale,asm9260-rtc.txt | 25 ++++++++++++++++++++++ > > 1 file changed, 25 insertions(+) > > create mode 100644 Documentation/devicetree/bindings/rtc/alphascale,asm9260-rtc.txt > > > > diff --git a/Documentation/devicetree/bindings/rtc/alphascale,asm9260-rtc.txt b/Documentation/devicetree/bindings/rtc/alphascale,asm9260-rtc.txt > > new file mode 100644 > > index 0000000..2c0ff3c > > --- /dev/null > > +++ b/Documentation/devicetree/bindings/rtc/alphascale,asm9260-rtc.txt > > @@ -0,0 +1,25 @@ > > +* Alphascale asm9260 SoC Real Time Clock > > + > > +Required properties: > > +- compatible: Should be "alphascale,asm9260-rtc" > > +- reg: Physical base address of the controller and length > > + of memory mapped region. > > +- interrupts: IRQ line for the RTC. > > +- clocks: Reference to the clock entry. > > +- clock-names: should contain: > > + * "ahb" for the SoC RTC clock > > + > > +Optional: > > +- calibration: calibration value for 1 sec period. > > + Max value for forward calibration is 0x1ffff (131071), > > + Min value for backward calibration is 0xfffe0001 (-131071). > > This should be prefixed with 'alphascale,' > > How is this value determined? > I think this should stay in userspace, see that series: https://groups.google.com/forum/#!topic/rtc-linux/HGQqiHnMiuw It quite often depends on environmental things like temperature so it may be updated at runtime.
Am 01.02.2016 um 16:27 schrieb Rob Herring: > On Fri, Jan 29, 2016 at 09:40:02AM +0100, Oleksij Rempel wrote: >> Document Alphascale asm9260 RTC bindings >> >> Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> >> --- >> .../bindings/rtc/alphascale,asm9260-rtc.txt | 25 ++++++++++++++++++++++ >> 1 file changed, 25 insertions(+) >> create mode 100644 Documentation/devicetree/bindings/rtc/alphascale,asm9260-rtc.txt >> >> diff --git a/Documentation/devicetree/bindings/rtc/alphascale,asm9260-rtc.txt b/Documentation/devicetree/bindings/rtc/alphascale,asm9260-rtc.txt >> new file mode 100644 >> index 0000000..2c0ff3c >> --- /dev/null >> +++ b/Documentation/devicetree/bindings/rtc/alphascale,asm9260-rtc.txt >> @@ -0,0 +1,25 @@ >> +* Alphascale asm9260 SoC Real Time Clock >> + >> +Required properties: >> +- compatible: Should be "alphascale,asm9260-rtc" >> +- reg: Physical base address of the controller and length >> + of memory mapped region. >> +- interrupts: IRQ line for the RTC. >> +- clocks: Reference to the clock entry. >> +- clock-names: should contain: >> + * "ahb" for the SoC RTC clock >> + >> +Optional: >> +- calibration: calibration value for 1 sec period. >> + Max value for forward calibration is 0x1ffff (131071), >> + Min value for backward calibration is 0xfffe0001 (-131071). > > This should be prefixed with 'alphascale,' ok, > How is this value determined? To each second the counter value will be increased to decreased by calibration value - if google translated it correctly from chinese :) It is RAW value which will be written to register. Since DT compiler do not support signed values i converted it to HEX.
Am 01.02.2016 um 16:55 schrieb Alexandre Belloni: > On 01/02/2016 at 09:27:50 -0600, Rob Herring wrote : >> On Fri, Jan 29, 2016 at 09:40:02AM +0100, Oleksij Rempel wrote: >>> Document Alphascale asm9260 RTC bindings >>> >>> Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> >>> --- >>> .../bindings/rtc/alphascale,asm9260-rtc.txt | 25 ++++++++++++++++++++++ >>> 1 file changed, 25 insertions(+) >>> create mode 100644 Documentation/devicetree/bindings/rtc/alphascale,asm9260-rtc.txt >>> >>> diff --git a/Documentation/devicetree/bindings/rtc/alphascale,asm9260-rtc.txt b/Documentation/devicetree/bindings/rtc/alphascale,asm9260-rtc.txt >>> new file mode 100644 >>> index 0000000..2c0ff3c >>> --- /dev/null >>> +++ b/Documentation/devicetree/bindings/rtc/alphascale,asm9260-rtc.txt >>> @@ -0,0 +1,25 @@ >>> +* Alphascale asm9260 SoC Real Time Clock >>> + >>> +Required properties: >>> +- compatible: Should be "alphascale,asm9260-rtc" >>> +- reg: Physical base address of the controller and length >>> + of memory mapped region. >>> +- interrupts: IRQ line for the RTC. >>> +- clocks: Reference to the clock entry. >>> +- clock-names: should contain: >>> + * "ahb" for the SoC RTC clock >>> + >>> +Optional: >>> +- calibration: calibration value for 1 sec period. >>> + Max value for forward calibration is 0x1ffff (131071), >>> + Min value for backward calibration is 0xfffe0001 (-131071). >> >> This should be prefixed with 'alphascale,' >> >> How is this value determined? >> > > I think this should stay in userspace, see that series: > https://groups.google.com/forum/#!topic/rtc-linux/HGQqiHnMiuw > > It quite often depends on environmental things like temperature so it may be updated at runtime. > I partially agree. IMO default configuration should work properly by 20C. My devkit provide terrible results without default offset.
On 02/02/2016 at 09:46:02 +0100, Oleksij Rempel wrote : > Am 01.02.2016 um 16:55 schrieb Alexandre Belloni: > > On 01/02/2016 at 09:27:50 -0600, Rob Herring wrote : > >> On Fri, Jan 29, 2016 at 09:40:02AM +0100, Oleksij Rempel wrote: > >>> Document Alphascale asm9260 RTC bindings > >>> > >>> Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> > >>> --- > >>> .../bindings/rtc/alphascale,asm9260-rtc.txt | 25 ++++++++++++++++++++++ > >>> 1 file changed, 25 insertions(+) > >>> create mode 100644 Documentation/devicetree/bindings/rtc/alphascale,asm9260-rtc.txt > >>> > >>> diff --git a/Documentation/devicetree/bindings/rtc/alphascale,asm9260-rtc.txt b/Documentation/devicetree/bindings/rtc/alphascale,asm9260-rtc.txt > >>> new file mode 100644 > >>> index 0000000..2c0ff3c > >>> --- /dev/null > >>> +++ b/Documentation/devicetree/bindings/rtc/alphascale,asm9260-rtc.txt > >>> @@ -0,0 +1,25 @@ > >>> +* Alphascale asm9260 SoC Real Time Clock > >>> + > >>> +Required properties: > >>> +- compatible: Should be "alphascale,asm9260-rtc" > >>> +- reg: Physical base address of the controller and length > >>> + of memory mapped region. > >>> +- interrupts: IRQ line for the RTC. > >>> +- clocks: Reference to the clock entry. > >>> +- clock-names: should contain: > >>> + * "ahb" for the SoC RTC clock > >>> + > >>> +Optional: > >>> +- calibration: calibration value for 1 sec period. > >>> + Max value for forward calibration is 0x1ffff (131071), > >>> + Min value for backward calibration is 0xfffe0001 (-131071). > >> > >> This should be prefixed with 'alphascale,' > >> > >> How is this value determined? > >> > > > > I think this should stay in userspace, see that series: > > https://groups.google.com/forum/#!topic/rtc-linux/HGQqiHnMiuw > > > > It quite often depends on environmental things like temperature so it may be updated at runtime. > > > > I partially agree. IMO default configuration should work properly by > 20C. My devkit provide terrible results without default offset. > I'm not against having a sane default. What I would do is set a default hardcoded value from the driver at the time the RTC is reset (that is: it has never been set yet) then let the user adjust that calibration through sysfs.
This patch set provide support for RTC controller found on Alphascale ASM9260 SoC. v2: - change license to GPLv2 and later - remove HW_RTC_AUX and HW_RTC_AUXEN. Thay was taken from reference driver. Documentation do not provide any info about it. According to my tests this regs are not available on asm9260. - remove calibration from DT. It will be beter to set it over sysfs. Oleksij Rempel (2): rtc: add rtc-asm9260 driver doc: dt: add documentation for alphascale,asm9260-rtc .../bindings/rtc/alphascale,asm9260-rtc.txt | 19 ++ drivers/rtc/Kconfig | 10 + drivers/rtc/Makefile | 1 + drivers/rtc/rtc-asm9260.c | 355 +++++++++++++++++++++ 4 files changed, 385 insertions(+) create mode 100644 Documentation/devicetree/bindings/rtc/alphascale,asm9260-rtc.txt create mode 100644 drivers/rtc/rtc-asm9260.c
On 02/02/2016 at 20:56:09 +0100, Oleksij Rempel wrote : > This patch set provide support for RTC controller found on Alphascale > ASM9260 SoC. > > v2: > - change license to GPLv2 and later > - remove HW_RTC_AUX and HW_RTC_AUXEN. Thay was taken from reference driver. > Documentation do not provide any info about it. According to my tests > this regs are not available on asm9260. > - remove calibration from DT. It will be beter to set it over sysfs. > > Oleksij Rempel (2): > rtc: add rtc-asm9260 driver > doc: dt: add documentation for alphascale,asm9260-rtc > > .../bindings/rtc/alphascale,asm9260-rtc.txt | 19 ++ > drivers/rtc/Kconfig | 10 + > drivers/rtc/Makefile | 1 + > drivers/rtc/rtc-asm9260.c | 355 +++++++++++++++++++++ > 4 files changed, 385 insertions(+) > create mode 100644 Documentation/devicetree/bindings/rtc/alphascale,asm9260-rtc.txt > create mode 100644 drivers/rtc/rtc-asm9260.c > Applied, thanks!
diff --git a/Documentation/devicetree/bindings/rtc/alphascale,asm9260-rtc.txt b/Documentation/devicetree/bindings/rtc/alphascale,asm9260-rtc.txt new file mode 100644 index 0000000..2c0ff3c --- /dev/null +++ b/Documentation/devicetree/bindings/rtc/alphascale,asm9260-rtc.txt @@ -0,0 +1,25 @@ +* Alphascale asm9260 SoC Real Time Clock + +Required properties: +- compatible: Should be "alphascale,asm9260-rtc" +- reg: Physical base address of the controller and length + of memory mapped region. +- interrupts: IRQ line for the RTC. +- clocks: Reference to the clock entry. +- clock-names: should contain: + * "ahb" for the SoC RTC clock + +Optional: +- calibration: calibration value for 1 sec period. + Max value for forward calibration is 0x1ffff (131071), + Min value for backward calibration is 0xfffe0001 (-131071). + +Example: +rtc0: rtc@800a0000 { + compatible = "alphascale,asm9260-rtc"; + reg = <0x800a0000 0x100>; + clocks = <&acc CLKID_AHB_RTC>; + clock-names = "ahb"; + interrupts = <2>; + calibration = <0x129c>; +};
Document Alphascale asm9260 RTC bindings Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> --- .../bindings/rtc/alphascale,asm9260-rtc.txt | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 Documentation/devicetree/bindings/rtc/alphascale,asm9260-rtc.txt