Page MenuHomeFreeBSD

arm64: add a driver for the Apple watchdog
ClosedPublic

Authored by kevans on Apr 26 2023, 5:48 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Jan 24, 5:37 PM
Unknown Object (File)
Sat, Jan 18, 5:58 PM
Unknown Object (File)
Jan 5 2025, 8:29 PM
Unknown Object (File)
Dec 17 2024, 6:43 PM
Unknown Object (File)
Dec 9 2024, 5:46 PM
Unknown Object (File)
Nov 29 2024, 9:13 AM
Unknown Object (File)
Nov 28 2024, 4:36 PM
Unknown Object (File)
Oct 1 2024, 5:18 AM

Details

Summary

Ensure it's disarmed upon attach, provide basic reset functionality.

Register definitions/usage obtained from OpenBSD.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 51201
Build 48092: arc lint + arc unit

Event Timeline

Would like a comment in the file mentioning what hardware this applies to

sys/arm64/apple/apple_wdog.c
6

Is this copy-paste from elsewhere? (Can we remove "All rights reserved."?)

Would like a comment in the file mentioning what hardware this applies to

Kyle, do you have any idea how to describe this? "Watchdog timer on Apple M1" is about all I know. We could mention t8103, but I don't know how accurate that is.

sys/arm64/apple/apple_wdog.c
6

It's from bcm2835_wdog.c, which has All Rights Reserved.

Should we mention the source in a comment?

Would like a comment in the file mentioning what hardware this applies to

Kyle, do you have any idea how to describe this? "Watchdog timer on Apple M1" is about all I know. We could mention t8103, but I don't know how accurate that is.

Yeah, I think a simple: /* Watchdog timer on Apple Silicon machines */ is probably sufficient and accurate enough.

sys/arm64/apple/apple_wdog.c
6

CC @ray

sys/arm64/apple/apple_wdog.c
6

IMO it's worth having something like "based on bcm2835_wdog.c".

We can drop the "All rights reserved" (from this copy) if @karels and @ray agree

sys/arm64/apple/apple_wdog.c
6

Fine with me; I wouldn't have included it except that it was in the earlier file.

For what it's worth, I don't see problems with the driver, but I worked on the code (long ago), and don't know arm or watchdogs well enough to approve this. Someone else should approve.

Look good to me. Thanks!

sys/arm64/apple/apple_wdog.c
6

Fine for me too.

This revision is now accepted and ready to land.Jun 9 2023, 9:06 PM

I had forgotten about this one... Kyle, can you remove "All rights reserved" and add the reference?

I had forgotten about this one... Kyle, can you remove "All rights reserved" and add the reference?

Yeah, I think I'll just tidy this up and push it from here. Thanks!

Is this review finished and can be closed?

In D39824#959982, @bcr wrote:

Is this review finished and can be closed?

negative; it hasn't landed yet, as I've been trying to get some consensus on some framework bits needed for the interrupt controller (I was hoping to push them at the same time).

This revision was automatically updated to reflect the committed changes.
ehem_freebsd_m5p.com added inline comments.
sys/arm64/apple/apple_wdog.c
231–235

This should have used DEFINE_CLASS*(...). There are many instances of creating explicit driver_t structures without using the macros. I would like to know why these are still being added when the macros were added more than a score of years ago. I've got a commit out to clean up a whole of these, but that will only be so effective if new instances keep being added.