Re: (tiny) patch review: return if RTC diag fails
Emile `iMil' Heitor <[email protected]>
| Newsgroups | gmane.os.netbsd.devel.kernel |
|---|---|
| Message-ID | <[email protected]> |
On Tue, 18 Feb 2025, Emile `iMil' Heitor wrote:
> if ((mc146818_read(NULL, MC_REGD) & MC_REGD_VRT) == 0)
> return (-1);
My bad, this test assumes the chip is replying something valid, what
we want to test is that bits 0 to 6 are set to 0, so in startrtclock()
it would be:
/* RTC is present, bits 0 to 6 are 0 */
if ((mc146818_read(NULL, MC_REGD) & 0x7f) != 0)
return;
------------------------------------------------------------------------
Emile `iMil' Heitor <imil@{home.imil.net,NetBSD.org}> | https://imil.net