diff options
author | ian <ian@FreeBSD.org> | 2014-05-13 18:06:26 +0000 |
---|---|---|
committer | ian <ian@FreeBSD.org> | 2014-05-13 18:06:26 +0000 |
commit | 399f18336611368662b09e65882f98bf17a5587a (patch) | |
tree | 3ed47a96a6001c3efbae46873c17573b47209815 /sys/dev/fdt/fdt_common.c | |
parent | 41e4178a5bf9750ed65445b40e81c0b5f56d0c4e (diff) | |
download | FreeBSD-src-399f18336611368662b09e65882f98bf17a5587a.zip FreeBSD-src-399f18336611368662b09e65882f98bf17a5587a.tar.gz |
MFC r256994, r257016, r257055, r257059, r257060, r257075
Add two new interfaces to ofw_bus:
- ofw_bus_map_intr()
Maps an (iparent, IRQ) tuple to a system-global interrupt number in some
platform dependent way. This is meant to be implemented as a replacement
for [FDT_]MAP_IRQ() that is an MI interface that knows about the bus
hierarchy.
- ofw_bus_config_intr()
Configures an interrupt (previously mapped) based on firmware sense flags.
This replaces manual interpretation of the sense field in bus drivers and
will, in a follow-up, allow that interpretation to be redirected to the PIC
drivers where it belongs. This will eventually replace the tables in
/sys/dev/fdt/fdt_ARCH.c
The PowerPC/AIM code has been converted to use these globally, with an
implementation in terms of MAP_IRQ() and powerpc_config_intr(), assuming
OpenPIC, at the bus root in nexus(4). The ofw_bus_config_intr() will shortly
be integrated into pic_if.m and bounced through nexus into the PIC tree.
Factor out MI portions of the PowerPC nexus device into /sys/dev/ofw. The
sparc64 driver will be modified to use this shortly.
Allow PIC drivers to translate firmware sense codes for themselves. This
is designed to replace the tables in dev/fdt/fdt_ARCH.c, but will not
happen quite yet.
Do not map IRQs twice. This fixes PowerPC/FDT systems with multiple PICs,
which would try to treat the previously-mapped interrupts from
fdt_decode_intr() as interrupt line numbers on the same parent PIC.
Remove some of the code required for supporting ssm(4) on SPARC in favor
of a more PowerPC/FDT-focused design. Whenever SPARC64 is integrated
into this rework, this should be (trivially) revisited.
Diffstat (limited to 'sys/dev/fdt/fdt_common.c')
-rw-r--r-- | sys/dev/fdt/fdt_common.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/dev/fdt/fdt_common.c b/sys/dev/fdt/fdt_common.c index d6401d2..15bf964 100644 --- a/sys/dev/fdt/fdt_common.c +++ b/sys/dev/fdt/fdt_common.c @@ -514,7 +514,7 @@ fdt_intr_to_rl(phandle_t node, struct resource_list *rl, pcell_t *intr; pcell_t intr_cells; int interrupt, trig, pol; - int i, intr_num, irq, rv; + int i, intr_num, rv; if (OF_getproplen(node, "interrupts") <= 0) /* Node does not have 'interrupts' property. */ @@ -566,8 +566,7 @@ fdt_intr_to_rl(phandle_t node, struct resource_list *rl, intr_sl[i].trig = trig; intr_sl[i].pol = pol; - irq = FDT_MAP_IRQ(iph, interrupt); - resource_list_add(rl, SYS_RES_IRQ, i, irq, irq, 1); + resource_list_add(rl, SYS_RES_IRQ, i, interrupt, interrupt, 1); } out: |