diff options
| author | briggs <briggs@NetBSD.org> | 2005-01-08 03:24:58 +0000 |
|---|---|---|
| committer | briggs <briggs@NetBSD.org> | 2005-01-08 03:24:58 +0000 |
| commit | c5aa4aada249816dd5c8f7ef70daf04fd80d0d8a (patch) | |
| tree | 25ff269715a89d929d429cd596f18405a04ae247 /sys | |
| parent | 02d2680603993a687d8781f684e9f0b8c3906540 (diff) | |
Make obio match multiple times to allow access to devices on systems
where there might be devices under two I/O bridges (like PowerBook G3s).
Attempt to have devices under 'gatwick' share parental interrupt. This
may still need some work, but a step in the right direction.
From Tim Kelly.
Diffstat (limited to 'sys')
| -rw-r--r-- | sys/arch/macppc/conf/GENERIC | 8 | ||||
| -rw-r--r-- | sys/arch/macppc/conf/INSTALL | 4 | ||||
| -rw-r--r-- | sys/arch/macppc/conf/POWERMAC | 4 | ||||
| -rw-r--r-- | sys/arch/macppc/dev/obio.c | 53 |
4 files changed, 39 insertions, 30 deletions
diff --git a/sys/arch/macppc/conf/GENERIC b/sys/arch/macppc/conf/GENERIC index c013cd3c087..1d5df7b6ed8 100644 --- a/sys/arch/macppc/conf/GENERIC +++ b/sys/arch/macppc/conf/GENERIC @@ -1,4 +1,4 @@ -# $NetBSD: GENERIC,v 1.185 2004/11/24 20:49:24 bouyer Exp $ +# $NetBSD: GENERIC,v 1.186 2005/01/08 03:24:58 briggs Exp $ # # GENERIC machine description file # @@ -22,7 +22,7 @@ include "arch/macppc/conf/std.macppc" options INCLUDE_CONFIG_FILE # embed config file in kernel binary -#ident "GENERIC-$Revision: 1.185 $" +#ident "GENERIC-$Revision: 1.186 $" maxusers 32 @@ -269,7 +269,7 @@ slide* at pci? dev ? function ? # Symphony Labs IDE controllers viaide* at pci? dev ? function ? # VIA/AMD/Nvidia IDE controllers wdc* at pci? dev ? function ? # Kauai ATA cbb* at pci? dev ? function ? # PCI-CardBus bridge -obio0 at pci? dev ? function ? +obio* at pci? dev ? function ? #macofcons0 at pci? dev ? function ? # OpenFirmware console (for debugging) acphy* at mii? phy ? # DAltima AC101 and AMD Am79c874 PHYs @@ -345,7 +345,7 @@ rtk* at cardbus? dev ? function ? # Realtek 8129/8139 wsdisplay0 at ofb? console ? wskbd0 at akbd? console ? -wsmouse0 at ams? +wsmouse* at ams? # Cryptographic Devices diff --git a/sys/arch/macppc/conf/INSTALL b/sys/arch/macppc/conf/INSTALL index d8a9d1f1600..a7662db55b3 100644 --- a/sys/arch/macppc/conf/INSTALL +++ b/sys/arch/macppc/conf/INSTALL @@ -1,4 +1,4 @@ -# $NetBSD: INSTALL,v 1.82 2004/12/09 02:54:18 briggs Exp $ +# $NetBSD: INSTALL,v 1.83 2005/01/08 03:24:58 briggs Exp $ # # config file for INSTALL FLOPPY # @@ -109,7 +109,7 @@ siside* at pci? dev ? function ? # SiS IDE controllers slide* at pci? dev ? function ? # Symphony Labs IDE controllers viaide* at pci? dev ? function ? # VIA/AMD/Nvidia IDE controllers wdc* at pci? dev ? function ? # Kauai ATA -obio0 at pci? dev ? function ? +obio* at pci? dev ? function ? tlp* at pci? dev ? function ? # DECchip 21x4x and clones bmtphy* at mii? phy ? # Broadcom BCM5201/BCM5202 PHYs diff --git a/sys/arch/macppc/conf/POWERMAC b/sys/arch/macppc/conf/POWERMAC index b4d74c17b0e..21e55d89436 100644 --- a/sys/arch/macppc/conf/POWERMAC +++ b/sys/arch/macppc/conf/POWERMAC @@ -1,4 +1,4 @@ -# $NetBSD: POWERMAC,v 1.41 2004/11/10 17:54:05 christos Exp $ +# $NetBSD: POWERMAC,v 1.42 2005/01/08 03:24:58 briggs Exp $ # # POWERMAC config file # @@ -77,7 +77,7 @@ ep* at pci? dev ? function ? # 3Com 3c59x tlp* at pci? dev ? function ? # DECchip 21x4x and clones ofb* at pci? dev ? function ? # Generic Open Firmware Framebuffer #options OFB_ENABLE_CACHE # Speed up console -obio0 at pci? dev ? function ? +obio* at pci? dev ? function ? nsphy* at mii? phy ? # NS83840 PHYs ukphy* at mii? phy ? # generic unknown PHYs diff --git a/sys/arch/macppc/dev/obio.c b/sys/arch/macppc/dev/obio.c index 1c4bb4e6975..cd344e0e907 100644 --- a/sys/arch/macppc/dev/obio.c +++ b/sys/arch/macppc/dev/obio.c @@ -1,4 +1,4 @@ -/* $NetBSD: obio.c,v 1.20 2004/12/09 03:19:56 briggs Exp $ */ +/* $NetBSD: obio.c,v 1.21 2005/01/08 03:24:58 briggs Exp $ */ /*- * Copyright (C) 1998 Internet Research Institute, Inc. @@ -32,7 +32,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: obio.c,v 1.20 2004/12/09 03:19:56 briggs Exp $"); +__KERNEL_RCSID(0, "$NetBSD: obio.c,v 1.21 2005/01/08 03:24:58 briggs Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -69,7 +69,6 @@ obio_match(parent, cf, aux) if (PCI_VENDOR(pa->pa_id) == PCI_VENDOR_APPLE) switch (PCI_PRODUCT(pa->pa_id)) { - case PCI_PRODUCT_APPLE_GC: case PCI_PRODUCT_APPLE_OHARE: case PCI_PRODUCT_APPLE_HEATHROW: @@ -96,28 +95,24 @@ obio_attach(parent, self, aux) struct confargs ca; int node, child, namelen; u_int reg[20]; - int intr[6]; + int intr[6], parent_intr = 0, parent_nintr = 0; char name[32]; + char compat[32]; switch (PCI_PRODUCT(pa->pa_id)) { - /* XXX should not use name */ case PCI_PRODUCT_APPLE_GC: - node = OF_finddevice("/bandit/gc"); - break; - case PCI_PRODUCT_APPLE_OHARE: - node = OF_finddevice("/bandit/ohare"); - break; - case PCI_PRODUCT_APPLE_HEATHROW: case PCI_PRODUCT_APPLE_PADDINGTON: case PCI_PRODUCT_APPLE_KEYLARGO: case PCI_PRODUCT_APPLE_PANGEA_MACIO: case PCI_PRODUCT_APPLE_INTREPID: - node = OF_finddevice("mac-io"); + node = pcidev_to_ofdev(pa->pa_pc, pa->pa_tag); if (node == -1) - node = OF_finddevice("/pci/mac-io"); + node = OF_finddevice("mac-io"); + if (node == -1) + node = OF_finddevice("/pci/mac-io"); break; default: @@ -147,10 +142,19 @@ obio_attach(parent, self, aux) out8(ca.ca_baseaddr + 0x006a + 0x03, 0x05); /* unset reset */ } - /* Enable CD and microphone sound input. */ - if (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_APPLE_PADDINGTON) - out8(ca.ca_baseaddr + 0x37, 0x03); + /* Gatwick and Paddington use same product ID */ + namelen = OF_getprop(node, "compatible", compat, sizeof(compat)); + if (strcmp(compat, "gatwick") == 0) { + parent_nintr = OF_getprop(node, "AAPL,interrupts", intr, + sizeof(intr)); + parent_intr = intr[0]; + } else { + /* Enable CD and microphone sound input. */ + if (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_APPLE_PADDINGTON) + out8(ca.ca_baseaddr + 0x37, 0x03); + } + for (child = OF_child(node); child; child = OF_peer(child)) { namelen = OF_getprop(child, "name", name, sizeof(name)); if (namelen < 0) @@ -162,13 +166,18 @@ obio_attach(parent, self, aux) ca.ca_name = name; ca.ca_node = child; - ca.ca_nreg = OF_getprop(child, "reg", reg, sizeof(reg)); - ca.ca_nintr = OF_getprop(child, "AAPL,interrupts", intr, - sizeof(intr)); - if (ca.ca_nintr == -1) - ca.ca_nintr = OF_getprop(child, "interrupts", intr, - sizeof(intr)); + ca.ca_nreg = OF_getprop(child, "reg", reg, sizeof(reg)); + if (strcmp(compat, "gatwick") != 0) { + ca.ca_nintr = OF_getprop(child, "AAPL,interrupts", intr, + sizeof(intr)); + if (ca.ca_nintr == -1) + ca.ca_nintr = OF_getprop(child, "interrupts", intr, + sizeof(intr)); + } else { + intr[0] = parent_intr; + ca.ca_nintr = parent_nintr; + } ca.ca_reg = reg; ca.ca_intr = intr; |
