Page MenuHomeFreeBSD

arm: generic_timer: use interrupt-names when available
ClosedPublic

Authored by kevans on Mar 5 2023, 12:51 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Nov 16, 6:57 AM
Unknown Object (File)
Sat, Nov 16, 5:48 AM
Unknown Object (File)
Sat, Nov 16, 4:05 AM
Unknown Object (File)
Fri, Nov 1, 5:13 PM
Unknown Object (File)
Oct 16 2024, 6:08 AM
Unknown Object (File)
Oct 16 2024, 6:08 AM
Unknown Object (File)
Sep 18 2024, 12:30 AM
Unknown Object (File)
Sep 7 2024, 9:24 PM
Subscribers

Details

Summary

Offsets for all of thse can be a bit complicated as not all interrupts
will be present, only phys and virt are actually required, and sec-phys
could optionally be specified before phys. Push idx/name pairs into
a new config struct and maintain the old indices while still getting the
correct timers.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Tested only on my M1 Mac for the moment.

I'm not a fan of mixing FDT and ACPI code paths, although note we have already done so in this driver. Would it be difficult to create a new attach fuction for FDT that handles interrupt-names then calls arm_tmr_attach?

Split out acpi/fdt attach functions and allocate interrupts there

Assert that we have non-optional interrupts allocated in the common
arm_tmr_attach(). The ACPI path is more clearly basically unchanged with this
patch with its own device_attach, though we mark the secure physical timer as
optional for now to match the spec. We may remove it entirely for now until we
can effectively use it.

While we're here, clean up interrupt resources on error.

sys/arm/arm/generic_timer.c
461

I guess this should probably be an error for !RF_OPTIONAL

sys/arm/arm/generic_timer.c
461

Yes, I think it just needs if !RF_OPTIONAL goto out

  • Not finding a required interrupt in interrupt-names now errors out
  • Less verbose when we can't find optional interrupt-names, bootverbose to bring them back. A large number of platforms won't have hypervisor timers, so this would otherwise add at least two lines worth of noise for non-error scenarios.
This revision is now accepted and ready to land.Mar 10 2023, 4:40 PM