Deleted Added
full compact
ofw_pcibus.c (256816) ofw_pcibus.c (256994)
1/*-
2 * Copyright (c) 1997, Stefan Esser <se@freebsd.org>
3 * Copyright (c) 2000, Michael Smith <msmith@freebsd.org>
4 * Copyright (c) 2000, BSDi
5 * Copyright (c) 2003, Thomas Moestl <tmm@FreeBSD.org>
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 14 unchanged lines hidden (view full) ---

23 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 */
29
30#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1997, Stefan Esser <se@freebsd.org>
3 * Copyright (c) 2000, Michael Smith <msmith@freebsd.org>
4 * Copyright (c) 2000, BSDi
5 * Copyright (c) 2003, Thomas Moestl <tmm@FreeBSD.org>
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 14 unchanged lines hidden (view full) ---

23 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 */
29
30#include <sys/cdefs.h>
31__FBSDID("$FreeBSD: head/sys/powerpc/ofw/ofw_pcibus.c 256816 2013-10-21 00:04:26Z nwhitehorn $");
31__FBSDID("$FreeBSD: head/sys/powerpc/ofw/ofw_pcibus.c 256994 2013-10-23 17:24:21Z nwhitehorn $");
32
33#include <sys/param.h>
34#include <sys/bus.h>
35#include <sys/kernel.h>
36#include <sys/libkern.h>
37#include <sys/module.h>
38#include <sys/pciio.h>
39

--- 173 unchanged lines hidden (view full) ---

213 iparent = 0;
214 icells = 1;
215 OF_getprop(child, "interrupt-parent", &iparent,
216 sizeof(iparent));
217 if (iparent != 0) {
218 OF_getprop(OF_xref_phandle(iparent),
219 "#interrupt-cells", &icells,
220 sizeof(icells));
32
33#include <sys/param.h>
34#include <sys/bus.h>
35#include <sys/kernel.h>
36#include <sys/libkern.h>
37#include <sys/module.h>
38#include <sys/pciio.h>
39

--- 173 unchanged lines hidden (view full) ---

213 iparent = 0;
214 icells = 1;
215 OF_getprop(child, "interrupt-parent", &iparent,
216 sizeof(iparent));
217 if (iparent != 0) {
218 OF_getprop(OF_xref_phandle(iparent),
219 "#interrupt-cells", &icells,
220 sizeof(icells));
221 intr[0] = MAP_IRQ(iparent, intr[0]);
221 intr[0] = ofw_bus_map_intr(dev, iparent,
222 intr[0]);
222 }
223
223 }
224
224 if (iparent != 0 && icells > 1) {
225 powerpc_config_intr(intr[0],
226 (intr[1] & 1) ? INTR_TRIGGER_LEVEL :
227 INTR_TRIGGER_EDGE,
228 INTR_POLARITY_LOW);
229 }
225 if (iparent != 0 && icells > 1)
226 ofw_bus_config_intr(dev, intr[0],
227 intr[1]);
230
231 resource_list_add(&dinfo->opd_dinfo.resources,
232 SYS_RES_IRQ, 0, intr[0], intr[0], 1);
233 }
234 }
235 }
236}
237

--- 100 unchanged lines hidden (view full) ---

338
339 /*
340 * Any AAPL,interrupts property gets priority and is
341 * fully specified (i.e. does not need routing)
342 */
343
344 isz = OF_getprop(node, "AAPL,interrupts", &intr, sizeof(intr));
345 if (isz == sizeof(intr))
228
229 resource_list_add(&dinfo->opd_dinfo.resources,
230 SYS_RES_IRQ, 0, intr[0], intr[0], 1);
231 }
232 }
233 }
234}
235

--- 100 unchanged lines hidden (view full) ---

336
337 /*
338 * Any AAPL,interrupts property gets priority and is
339 * fully specified (i.e. does not need routing)
340 */
341
342 isz = OF_getprop(node, "AAPL,interrupts", &intr, sizeof(intr));
343 if (isz == sizeof(intr))
346 return ((iparent == -1) ? intr : MAP_IRQ(iparent, intr));
344 return ((iparent == -1) ? intr : ofw_bus_map_intr(dev, iparent,
345 intr));
347
348 isz = OF_getprop(node, "interrupts", &intr, sizeof(intr));
349 if (isz == sizeof(intr)) {
350 if (iparent != -1)
346
347 isz = OF_getprop(node, "interrupts", &intr, sizeof(intr));
348 if (isz == sizeof(intr)) {
349 if (iparent != -1)
351 intr = MAP_IRQ(iparent, intr);
350 intr = ofw_bus_map_intr(dev, iparent, intr);
352 } else {
353 /* No property: our best guess is the intpin. */
354 intr = pci_get_intpin(child);
355 }
356
357 /*
358 * If we got intr from a property, it may or may not be an intpin.
359 * For on-board devices, it frequently is not, and is completely out

--- 19 unchanged lines hidden ---
351 } else {
352 /* No property: our best guess is the intpin. */
353 intr = pci_get_intpin(child);
354 }
355
356 /*
357 * If we got intr from a property, it may or may not be an intpin.
358 * For on-board devices, it frequently is not, and is completely out

--- 19 unchanged lines hidden ---