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)
Thu, Apr 18, 6:09 AM
Unknown Object (File)
Wed, Apr 17, 11:38 AM
Unknown Object (File)
Tue, Apr 16, 2:25 PM
Unknown Object (File)
Thu, Apr 11, 7:07 PM
Unknown Object (File)
Jan 13 2024, 3:38 AM
Unknown Object (File)
Dec 20 2023, 2:30 AM
Unknown Object (File)
Jun 26 2023, 3:45 PM
Unknown Object (File)
May 4 2023, 9:52 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 Not Applicable
Unit
Tests Not Applicable

Event Timeline

ian requested changes to this revision.Nov 5 2017, 7:53 PM
ian added inline comments.
sys/dev/iicbus/ds1307.c
300 ↗(On Diff #34806)

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.