Mainline:Broadcom Kona/BCM590xx/RTC: Difference between revisions

No edit summary
No edit summary
 
(5 intermediate revisions by the same user not shown)
Line 30: Line 30:
|3
|3
|Weekday (<code>WD</code>)
|Weekday (<code>WD</code>)
|{{speculation|0x0F}}
|0x07
|Day of week, from 0 to 6. Appears to roll over whenever the day changes; {{speculation|the hardware does not enforce a specific start.}} Sets itself to 0 on reset. '''Not used in downstream.'''<br>{{speculation|The day of month sets itself to 0 on reset, which should be an invalid value, but would suggest that the range is 0 -> Sunday, 6 -> Monday, but there is no downstream code to confirm this.}}
|Day of week, from 0 to 6. Appears to roll over whenever the day changes; {{speculation|the hardware does not enforce a specific start.}} Sets itself to 0 on reset. '''Not used in downstream.'''<br>{{speculation|The day of month sets itself to 0 on reset, which should be an invalid value, but would suggest that the range is 0 -> Sunday, 6 -> Monday, but there is no downstream code to confirm this.}}
|-
|-
Line 49: Line 49:
|}
|}


This exact format is used for both the time and alarm registers.
This exact format is used for both the time and alarm registers. The masks are enforced by hardware - any bit written outside of the mask gets ignored.
 
TODO: What happens on year overflow? Is there a reason as to why the downstream driver limits the values it gets?


== Getting the time ==
== Getting the time ==
Line 59: Line 57:
There are interrupts for updates of each of the time values.
There are interrupts for updates of each of the time values.


The default reset value is <code>0 0 0 0 0 1 7</code> (2007-01-00 00:00:00, weekday 0). Notably, the day of month is invalid (0). In this state, the RTCADJ interrupt will be raised.
The default reset value is <code>0 0 0 0 0 1 7</code> (2007-01-00 00:00:00, weekday 0). Notably, the day of month is invalid (0).
 
If the date overflows (1 second after 2255-12-31 23:59:59), the clock returns to 2255-12-01 00:00:00.
 
=== Adjustment IRQ ===
 
There is an RTCADJ IRQ that is supposed to fire when the RTC value is invalid (at least according to the comments of the downstream driver, and the downstream BCM59055 RTC driver). However, I haven't been able to get it to fire in my testing.


== Alarm ==
== Alarm ==