| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: pchb.c,v 1.34 2012/04/16 04:57:42 pgoyette Exp $ */ | | 1 | /* $NetBSD: pchb.c,v 1.35 2016/10/01 21:51:52 mrg Exp $ */ |
2 | | | 2 | |
3 | /*- | | 3 | /*- |
4 | * Copyright (c) 1996, 1998, 2000 The NetBSD Foundation, Inc. | | 4 | * Copyright (c) 1996, 1998, 2000 The NetBSD Foundation, Inc. |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | * | | 6 | * |
7 | * This code is derived from software contributed to The NetBSD Foundation | | 7 | * This code is derived from software contributed to The NetBSD Foundation |
8 | * by Jason R. Thorpe. | | 8 | * by Jason R. Thorpe. |
9 | * | | 9 | * |
10 | * Redistribution and use in source and binary forms, with or without | | 10 | * Redistribution and use in source and binary forms, with or without |
11 | * modification, are permitted provided that the following conditions | | 11 | * modification, are permitted provided that the following conditions |
12 | * are met: | | 12 | * are met: |
13 | * 1. Redistributions of source code must retain the above copyright | | 13 | * 1. Redistributions of source code must retain the above copyright |
14 | * notice, this list of conditions and the following disclaimer. | | 14 | * notice, this list of conditions and the following disclaimer. |
| @@ -20,27 +20,27 @@ | | | @@ -20,27 +20,27 @@ |
20 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | | 20 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED |
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | | 21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | | 22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS |
23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | | 23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | | 24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | | 25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | | 26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | | 27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | | 28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
29 | * POSSIBILITY OF SUCH DAMAGE. | | 29 | * POSSIBILITY OF SUCH DAMAGE. |
30 | */ | | 30 | */ |
31 | | | 31 | |
32 | #include <sys/cdefs.h> | | 32 | #include <sys/cdefs.h> |
33 | __KERNEL_RCSID(0, "$NetBSD: pchb.c,v 1.34 2012/04/16 04:57:42 pgoyette Exp $"); | | 33 | __KERNEL_RCSID(0, "$NetBSD: pchb.c,v 1.35 2016/10/01 21:51:52 mrg Exp $"); |
34 | | | 34 | |
35 | #include <sys/types.h> | | 35 | #include <sys/types.h> |
36 | #include <sys/param.h> | | 36 | #include <sys/param.h> |
37 | #include <sys/systm.h> | | 37 | #include <sys/systm.h> |
38 | #include <sys/device.h> | | 38 | #include <sys/device.h> |
39 | | | 39 | |
40 | #include <sys/bus.h> | | 40 | #include <sys/bus.h> |
41 | | | 41 | |
42 | #include <dev/pci/pcivar.h> | | 42 | #include <dev/pci/pcivar.h> |
43 | #include <dev/pci/pcireg.h> | | 43 | #include <dev/pci/pcireg.h> |
44 | | | 44 | |
45 | #include <dev/pci/pcidevs.h> | | 45 | #include <dev/pci/pcidevs.h> |
46 | | | 46 | |
| @@ -51,33 +51,33 @@ __KERNEL_RCSID(0, "$NetBSD: pchb.c,v 1.3 | | | @@ -51,33 +51,33 @@ __KERNEL_RCSID(0, "$NetBSD: pchb.c,v 1.3 |
51 | | | 51 | |
52 | #define PCISET_BRIDGETYPE_MASK 0x3 | | 52 | #define PCISET_BRIDGETYPE_MASK 0x3 |
53 | #define PCISET_TYPE_COMPAT 0x1 | | 53 | #define PCISET_TYPE_COMPAT 0x1 |
54 | #define PCISET_TYPE_AUX 0x2 | | 54 | #define PCISET_TYPE_AUX 0x2 |
55 | | | 55 | |
56 | #define PCISET_BUSCONFIG_REG 0x48 | | 56 | #define PCISET_BUSCONFIG_REG 0x48 |
57 | #define PCISET_BRIDGE_NUMBER(reg) (((reg) >> 8) & 0xff) | | 57 | #define PCISET_BRIDGE_NUMBER(reg) (((reg) >> 8) & 0xff) |
58 | #define PCISET_PCI_BUS_NUMBER(reg) (((reg) >> 16) & 0xff) | | 58 | #define PCISET_PCI_BUS_NUMBER(reg) (((reg) >> 16) & 0xff) |
59 | | | 59 | |
60 | /* XXX should be in dev/ic/i82443reg.h */ | | 60 | /* XXX should be in dev/ic/i82443reg.h */ |
61 | #define I82443BX_SDRAMC_REG 0x74 /* upper 16 bits */ | | 61 | #define I82443BX_SDRAMC_REG 0x74 /* upper 16 bits */ |
62 | | | 62 | |
63 | /* XXX should be in dev/ic/i82424{reg.var}.h */ | | 63 | /* XXX should be in dev/ic/i82424{reg.var}.h */ |
64 | #define I82424_CPU_BCTL_REG 0x53 | | 64 | #define I82424_CPU_BCTL_REG 0x50 /* upper 8 bits */ |
65 | #define I82424_PCI_BCTL_REG 0x54 | | 65 | #define I82424_PCI_BCTL_REG 0x54 |
66 | | | 66 | |
67 | #define I82424_BCTL_CPUMEM_POSTEN 0x01 | | 67 | #define I82424_BCTL_CPUMEM_POSTEN 0x01000000 |
68 | #define I82424_BCTL_CPUPCI_POSTEN 0x02 | | 68 | #define I82424_BCTL_CPUPCI_POSTEN 0x02000000 |
69 | #define I82424_BCTL_PCIMEM_BURSTEN 0x01 | | 69 | #define I82424_BCTL_PCIMEM_BURSTEN 0x01000000 |
70 | #define I82424_BCTL_PCI_BURSTEN 0x02 | | 70 | #define I82424_BCTL_PCI_BURSTEN 0x02000000 |
71 | | | 71 | |
72 | static int pchbmatch(device_t, cfdata_t, void *); | | 72 | static int pchbmatch(device_t, cfdata_t, void *); |
73 | static void pchbattach(device_t, device_t, void *); | | 73 | static void pchbattach(device_t, device_t, void *); |
74 | static int pchbdetach(device_t, int); | | 74 | static int pchbdetach(device_t, int); |
75 | | | 75 | |
76 | static bool pchb_resume(device_t, const pmf_qual_t *); | | 76 | static bool pchb_resume(device_t, const pmf_qual_t *); |
77 | static bool pchb_suspend(device_t, const pmf_qual_t *); | | 77 | static bool pchb_suspend(device_t, const pmf_qual_t *); |
78 | | | 78 | |
79 | CFATTACH_DECL3_NEW(pchb, sizeof(struct pchb_softc), | | 79 | CFATTACH_DECL3_NEW(pchb, sizeof(struct pchb_softc), |
80 | pchbmatch, pchbattach, pchbdetach, NULL, NULL, NULL, DVF_DETACH_SHUTDOWN); | | 80 | pchbmatch, pchbattach, pchbdetach, NULL, NULL, NULL, DVF_DETACH_SHUTDOWN); |
81 | | | 81 | |
82 | static int | | 82 | static int |
83 | pchbmatch(device_t parent, cfdata_t match, void *aux) | | 83 | pchbmatch(device_t parent, cfdata_t match, void *aux) |