Deleted Added
full compact
apb.c (88701) apb.c (93067)
1/*-
2 * Copyright (c) 1994,1995 Stefan Esser, Wolfgang StanglMeier
3 * Copyright (c) 2000 Michael Smith <msmith@freebsd.org>
4 * Copyright (c) 2000 BSDi
5 * Copyright (c) 2001 Thomas Moestl <tmm@FreeBSD.org>
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without

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

25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 * SUCH DAMAGE.
30 *
31 * from: FreeBSD: src/sys/dev/pci/pci_pci.c,v 1.3 2000/12/13
32 *
1/*-
2 * Copyright (c) 1994,1995 Stefan Esser, Wolfgang StanglMeier
3 * Copyright (c) 2000 Michael Smith <msmith@freebsd.org>
4 * Copyright (c) 2000 BSDi
5 * Copyright (c) 2001 Thomas Moestl <tmm@FreeBSD.org>
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without

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

25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 * SUCH DAMAGE.
30 *
31 * from: FreeBSD: src/sys/dev/pci/pci_pci.c,v 1.3 2000/12/13
32 *
33 * $FreeBSD: head/sys/sparc64/pci/apb.c 88701 2001-12-30 16:14:33Z tmm $
33 * $FreeBSD: head/sys/sparc64/pci/apb.c 93067 2002-03-24 02:11:06Z tmm $
34 */
35
36/*
37 * Support for the Sun APB (Advanced PCI Bridge) PCI-PCI bridge.
38 * This bridge does not fully comply to the PCI bridge specification, and is
39 * therefore not supported by the generic driver.
40 * We can use some pf the pcib methods anyway.
41 */
42
43#include <sys/param.h>
44#include <sys/systm.h>
45#include <sys/kernel.h>
46#include <sys/malloc.h>
47#include <sys/bus.h>
48
34 */
35
36/*
37 * Support for the Sun APB (Advanced PCI Bridge) PCI-PCI bridge.
38 * This bridge does not fully comply to the PCI bridge specification, and is
39 * therefore not supported by the generic driver.
40 * We can use some pf the pcib methods anyway.
41 */
42
43#include <sys/param.h>
44#include <sys/systm.h>
45#include <sys/kernel.h>
46#include <sys/malloc.h>
47#include <sys/bus.h>
48
49#include <dev/ofw/openfirm.h>
50#include <dev/ofw/ofw_pci.h>
51
49#include <machine/resource.h>
50
52#include <machine/resource.h>
53
54#include <sparc64/pci/ofw_pci.h>
55
51#include <pci/pcivar.h>
52#include <pci/pcireg.h>
53
54#include "pcib_if.h"
55
56/*
57 * Bridge-specific data.
58 */

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

338 int width)
339{
340
341 PCIB_WRITE_CONFIG(device_get_parent(device_get_parent(dev)), b, s, f, reg,
342 val, width);
343}
344
345/*
56#include <pci/pcivar.h>
57#include <pci/pcireg.h>
58
59#include "pcib_if.h"
60
61/*
62 * Bridge-specific data.
63 */

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

343 int width)
344{
345
346 PCIB_WRITE_CONFIG(device_get_parent(device_get_parent(dev)), b, s, f, reg,
347 val, width);
348}
349
350/*
346 * Route an interrupt across a PCI bridge - the APB does not route interrupts,
347 * and routing of interrupts that are not preinitialized is not supported yet.
351 * Route an interrupt across a PCI bridge - we need to rely on the firmware
352 * here.
348 */
349static int
350apb_route_interrupt(device_t pcib, device_t dev, int pin)
351{
352
353 */
354static int
355apb_route_interrupt(device_t pcib, device_t dev, int pin)
356{
357
353 panic("apb_route_interrupt");
358 /*
359 * XXX: ugly loathsome hack:
360 * We can't use ofw_pci_route_intr() here; the device passed may be
361 * the one of a bridge, so the original device can't be recovered.
362 *
363 * We need to use the firmware to route interrupts, however it has
364 * no interface which could be used to interpret intpins; instead,
365 * all assignments are done by device.
366 *
367 * The MI pci code will try to reroute interrupts of 0, although they
368 * are correct; all other interrupts are preinitialized, so if we
369 * get here, the intline is either 0 (so return 0), or we hit a
370 * device which was not preinitialized (e.g. hotplugged stuff), in
371 * which case we are lost.
372 */
373 return (0);
354}
374}