| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
based on include-what-you-use suggestions
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The timecounter struct is large and I think it may change in the
future. Changing it later will be easier if we use C99-style
initialization for all timecounter structs. It also makes reading the
code a bit easier.
For reasons I cannot explain, switching to C99-style initialization
sometimes changes the hash of the resulting object file, even though
the resulting struct should be the same. So there is a binary change
here, but only sometimes. No behavior should change in either case.
I can't compile-test this everywhere but I have been staring at the
diff for days now and I'm relatively confident this will not break
compilation. Fingers crossed.
ok gnezdo@
|
|
|
|
| |
ok tb@, deraadt@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
a struct cpu_info *. From a driver point of view the fdt_intr_establish_*
API now also exist same functions with a *_cpu suffix. Internally the
"old" functions now call their *_cpu counterparts, passing NULL as ci.
NULL will be interpreted as primary CPU in the interrupt controller code.
The internal framework for interrupt controllers has been changed so that
the establish methods provided by an interrupt controller function always
takes a struct cpu_info *.
Some drivers, like imxgpio(4) and rkgpio(4), only have a single interrupt
line for multiple pins. On those we simply disallow trying to establish
an interrupt on a non-primary CPU, returning NULL.
Since we do not have MP yet on armv7, all armv7 interrupt controllers do
return NULL if an attempt is made to establish an interrupt on a different
CPU. That said, so far there's no way this can happen. If we ever gain
MP support, this is a reminder that the interrupt controller drivers have
to be adjusted.
Prompted by dlg@
ok kettenis@
|
|
|
|
|
|
|
|
|
| |
Checked against
* ARM Architecture Reference Manual (agtimer)
* ARM Cortex-A9 MPCore Technical Reference Manual (amptimer)
* OMAP35x Applications Processor Technical Reference Manual (gptimer)
Artturi Alm had independently suggested this in the past.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This diff exposes parts of clock_gettime(2) and gettimeofday(2) to
userland via libc eliberating processes from the need for a context
switch everytime they want to count the passage of time.
If a timecounter clock can be exposed to userland than it needs to set
its tc_user member to a non-zero value. Tested with one or multiple
counters per architecture.
The timing data is shared through a pointer found in the new ELF
auxiliary vector AUX_openbsd_timekeep containing timehands information
that is frequently updated by the kernel.
Timing differences between the last kernel update and the current time
are adjusted in userland by the tc_get_timecount() function inside the
MD usertc.c file.
This permits a much more responsive environment, quite visible in
browsers, office programs and gaming (apparently one is are able to fly
in Minecraft now).
Tested by robert@, sthen@, naddy@, kmos@, phessler@, and many others!
OK from at least kettenis@, cheloha@, naddy@, sthen@
|
|
|
|
|
|
|
|
|
|
|
| |
DMA remapping in the same way as arm64. This relies on the dma-ranges
property in the device tree and allows us to get rid of the hack for
the Raspberry Pi in the dwctwo(4) driver.
Note that this does not include the hack in simplebus(4) that we have on
arm64 since firmware that has the dma-ranges is in widespread use now.
ok patrick@
|
|
|
|
| |
ok patrick@
|
|
|
|
| |
ok patrick@, jsg@
|
|
|
|
|
|
|
| |
version. The divergence was probably an accident and the arm64 code makes
more sense and is better tested.
ok patrick@
|
|
|
|
| |
No functional changes.
|
|
|
|
|
|
|
|
| |
with the lowest IPL. Once we actually run the IRQ handler
we raise to the highest IPL. Fixes a crash seen when having
a network card in the PCIe slot of the MacchiatoBin.
ok ccardenas@
|
|
|
|
| |
ok jsg@, patrick@
|
|
|
|
|
|
|
|
| |
doesn't actually spin up any secondary CPUs, it does run. Mostly a cleanup
of <machine/cpu.h> along the lines of what I did earlier on arm64. Makes
armv7 use the MI mplock implementation and implements copyin32.
ok patrick@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
extension to the GIC controller, which is represented as subnode in the
device tree. There can be multiple GICv2Ms, so it makes sense to attach
those to ampintc(4) as some kind of simplebus. The GICv2M is simply an
interrupt generator that can be used by PCIe devices to ring the door
bell. There is no need for further configuration, we only need to find
out which SPIs we are allowed to use for MSI and to register an edge
triggered interrupt on a (randomly) allocated SPI.
Implement support for interrupt types. The GIC only seems to support
level triggered active-high or egdge triggered low-to-high interrupts.
We currently always configure them to be level triggered, which is a
sane default for most controllers. Since MSI interupts on the GIC are
edge triggered, we need to be able to parse the type information and to
configure the interrupt correspondingly.
ok kettenis@
|
|
|
|
|
|
|
| |
Using a name with the 'db_' prefix makes it invisible from the dynamic
profiler.
ok deraadt@, kettenis@, visa@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
an element for each CPU. Use this mask directly instead of converting
it into a cpu number and back into a mask again when routing interrupts.
This avoids the need to handle uniprocessor systems in a special way
as they will return 0 as the mask (the relevant register is defined as RAZ)
and ignore what's written into the destination registers (the relevant
registers are defined as WI).
Future code that hatches the secondary CPUs will have to call into the
driver to establish the masks for those CPUs.
ok patrick@
|
|
|
|
|
|
|
|
| |
the target CPU interface when establishing an interrupt. Makes interrupts
work on machines that boot up on a CPU that is attached to a CPU interface
that isn't zero.
Discussed with Dale Rahn.
|
|
|
|
|
|
|
| |
these currently to 255. Thus making it impossible to use higher IRQs
than that. The AMD Seattle SoC though seems to provide 448 IRQs, which
is kind of out of bounds, so raise them to the proper values. This
makes interrupts work on that machine.
|
|
|
|
| |
ok patrick@ kettenis@
|
|
|
|
|
|
|
|
|
| |
supported by the controller is not too big. Otherwise the mask will be
wrong and the calculated IRQ as well. Split the dynamic mask into two
pieces. First of all use a static mask to remove the bits we don't want
to look at. Then we use that value to check for spurious or false IRQs.
ok jsg@
|
|
|
|
|
|
| |
of an array to a null pointer that is always false. Found with clang.
ok jsg@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
BUS_DMA_COHERENT flag was mapped as device memory which does not use the
store buffer. It is now mapped as normal inner and outer non-cacheable
which does.
While we drain the cpu store buffer for this case, on cortex a9 systems we
also need to explicitly drain the PL310 L2's store buffer. With PL310
revisions r3p2 and later this is done automatically after being present in
the store buffer for 256 cycles. On i.MX6 PL310 is rev r3p1 which does
not have this behaviour. This issue is i.MX6 errata ERR055199 and PL310
errata 769419.
This change restores io performance with a usb flash drive attached to
my cubox. Raw reads go from 3 MB/s to 19 MB/s for example.
Based on code written by patrick@ some time ago.
ok kettenis@ patrick@
|
|
|
|
|
|
| |
Exynos differed from everything else by not having GIC at fixed offsets
from PERIPHBASE. Now that ampintc/GIC attaches using FDT we get the ranges
out of the FDT instead of using offsets from PERIPHBASE.
|
|
|
|
|
|
|
|
|
|
| |
function for platforms that have it, rework the code a bit such that it can
be used before agtimer(4) attaches. Introduce a new agtimer_init()
function that checks whether the CPU implements the Generic Timer feature
and switches to agtimer_delay() if that feature is present. Call this
function from the generic platform initialization code.
ok jsg@
|
|
|
|
| |
Requested by and ok kettenis@
|
|
|
|
|
|
|
| |
This will be helpful for interrupt combiner that need to re-establish
their main interrupt when their interrupt priorities change.
ok kettenis@
|
|
|
|
|
|
|
| |
its job. Recalculate the mask after the handler is taken from the
list to properly set the new prioritization.
ok kettenis@
|
|
|
|
| |
ok patrick@, jsg@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
controller. Switch all i.MX6 devices over to the new FDT-aware interrupt
establish API and enable imxgpc(4).
This may break other platforms that use ampintc(4) as their interrupt
controller. We will fix this as soon as possible by switching them over
to the new interrupt establish API as well.
This also removes the hack in fec(4) to avoid the gpio-based interrupt
workaround. This commit is an essential step on the road to fix that
issue properly.
ok patrick@, jsg@
|
|
|
|
|
|
|
| |
topology based on device tree information. Introduce a common attach
args structure to be used for all fdt-capable bus devices.
ok jsg@ kettenis@
|
|
|
|
|
|
| |
args are actually looking for the cortex bus.
ok kettenis@
|
|
|
|
|
| |
This matches FreeBSD and makes things a bit more consistent.
Discussed with Patrick.
|
| |
|
| |
|
|
|
|
|
|
|
| |
the other socs. Handle this by setting variables in exynos{4,5}_init
functions and calling the board_init callback earlier.
tested by and ok bmercer@
|
|
|
|
|
|
|
|
|
| |
the qemu cortex a15 useable without trustzone.
Establish the interrupt for the non-secure physical timer (30), in
addition to the secure physical timer (29).
Stop masking the timer output signal in the interrupt handler.
|
| |
|
|
|
|
| |
coprocessor space.
|
|
|
|
| |
From Patrick Wildt in bitrig.
|
|
|
|
| |
ok tedu@ deraadt@
|
|
|
|
| |
ok jsg@ bmercer@
|
|
|
|
| |
after discussions with beck deraadt kettenis.
|
| |
|
|
|
|
| |
how many of those there have been.
|
|
|
|
| |
ok patrick@
|
|
|
|
| |
ok rapha@ jsg@
|
|
|
|
|
|
| |
timer and the newer Cortexes have another generic timer.
ok rapha@ jsg@
|
|
|
|
|
|
| |
the arm one.
ok bmercer@
|
|
|
|
|
|
|
| |
for SMP on the newer ARMv7 boards.
From drahn at dalerahn.com.
ok bmercer@
|