Page MenuHomeFreeBSD

DS1307: Add the mcp7941x enable bit
ClosedPublic

Authored by jhibbits on Nov 5 2017, 3:25 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 22, 9:10 PM
Unknown Object (File)
Thu, Nov 21, 1:44 AM
Unknown Object (File)
Mon, Nov 11, 4:19 AM
Unknown Object (File)
Oct 29 2024, 11:46 AM
Unknown Object (File)
Oct 22 2024, 4:43 PM
Unknown Object (File)
Oct 17 2024, 8:47 PM
Unknown Object (File)
Oct 2 2024, 5:04 PM
Unknown Object (File)
Oct 1 2024, 11:59 PM
Subscribers

Details

Summary

Existing code recognizes the mcp7941x RTC, but this RTC has an
enable bit at the same location as the "Clock Halt" bit on the ds1307, with an
opposite assertion (set == on, whereas CH set == clock stopped). Thus the
current code halts the clock, with no way to enable it.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 12503
Build 12778: arc lint + arc unit

Event Timeline

ian requested changes to this revision.Nov 5 2017, 7:53 PM
ian added inline comments.
sys/dev/iicbus/ds1307.c
300

You must never start a stopped RTC oscillator in the attach/init code, because it clears the time-is-invalid indication and the first attempt to read time from the RTC will return garbage as if it were valid.

The reason this bit lives in the seconds register on many rtc chips is that when you eventually write a valid time to the chip, that also automatically starts the oscillator and clears the time-is-invalid status.

This revision now requires changes to proceed.Nov 5 2017, 7:53 PM

Drop the enable part, it doesn't make sense. This changes the revision to instead just add the mcp7941x enable bit.

jhibbits retitled this revision from DS1307: Attempt to enable the oscillator to DS1307: Add the mcp7941x enable bit.Nov 5 2017, 10:17 PM
jhibbits edited the summary of this revision. (Show Details)
This revision is now accepted and ready to land.Nov 7 2017, 4:47 PM
This revision was automatically updated to reflect the committed changes.