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.
Details
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
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.