| @@ -1,90 +1,89 @@ | | | @@ -1,90 +1,89 @@ |
1 | /* $NetBSD: mainbus.c,v 1.5 2009/07/20 05:10:49 kiyohara Exp $ */ | | 1 | /* $NetBSD: mainbus.c,v 1.6 2009/07/20 06:12:41 kiyohara Exp $ */ |
2 | | | 2 | |
3 | /*- | | 3 | /*- |
4 | * Copyright (c) 2006 The NetBSD Foundation, Inc. | | 4 | * Copyright (c) 2006 The NetBSD Foundation, Inc. |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | * | | 6 | * |
7 | * Author: | | 7 | * Author: |
8 | * | | 8 | * |
9 | * Redistribution and use in source and binary forms, with or without | | 9 | * Redistribution and use in source and binary forms, with or without |
10 | * modification, are permitted provided that the following conditions | | 10 | * modification, are permitted provided that the following conditions |
11 | * are met: | | 11 | * are met: |
12 | * 1. Redistributions of source code must retain the above copyright | | 12 | * 1. Redistributions of source code must retain the above copyright |
13 | * notice, this list of conditions and the following disclaimer. | | 13 | * notice, this list of conditions and the following disclaimer. |
14 | * 2. Redistributions in binary form must reproduce the above copyright | | 14 | * 2. Redistributions in binary form must reproduce the above copyright |
15 | * notice, this list of conditions and the following disclaimer in the | | 15 | * notice, this list of conditions and the following disclaimer in the |
16 | * documentation and/or other materials provided with the distribution. | | 16 | * documentation and/or other materials provided with the distribution. |
17 | * | | 17 | * |
18 | * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS | | 18 | * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS |
19 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | | 19 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED |
20 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | | 20 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
21 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | | 21 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS |
22 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | | 22 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | | 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | | 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | | 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | | 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | | 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
28 | * POSSIBILITY OF SUCH DAMAGE. | | 28 | * POSSIBILITY OF SUCH DAMAGE. |
29 | */ | | 29 | */ |
30 | | | 30 | |
31 | #include <sys/cdefs.h> | | 31 | #include <sys/cdefs.h> |
32 | __KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.5 2009/07/20 05:10:49 kiyohara Exp $"); | | 32 | __KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.6 2009/07/20 06:12:41 kiyohara Exp $"); |
33 | | | 33 | |
34 | #include "acpi.h" | | 34 | #include "acpi.h" |
35 | | | 35 | |
36 | #include <sys/param.h> | | 36 | #include <sys/param.h> |
37 | #include <sys/device.h> | | 37 | #include <sys/device.h> |
38 | #include <sys/errno.h> | | 38 | #include <sys/errno.h> |
39 | | | 39 | |
40 | #include <machine/bus.h> | | | |
41 | | | | |
42 | #include <dev/acpi/acpivar.h> | | 40 | #include <dev/acpi/acpivar.h> |
43 | | | 41 | |
44 | | | 42 | |
45 | static int mainbus_match(struct device *, struct cfdata *, void *); | | 43 | static int mainbus_match(device_t, cfdata_t, void *); |
46 | static void mainbus_attach(struct device *, struct device *, void *); | | 44 | static void mainbus_attach(device_t, device_t, void *); |
47 | | | 45 | |
48 | CFATTACH_DECL_NEW(mainbus, sizeof(struct device), | | 46 | CFATTACH_DECL_NEW(mainbus, |
| | | 47 | /*sizeof(struct device): XXXXX It doesn't use it now*/ 0, |
49 | mainbus_match, mainbus_attach, NULL, NULL); | | 48 | mainbus_match, mainbus_attach, NULL, NULL); |
50 | | | 49 | |
51 | | | 50 | |
52 | /* | | 51 | /* |
53 | * Probe for the mainbus; always succeeds. | | 52 | * Probe for the mainbus; always succeeds. |
54 | */ | | 53 | */ |
55 | static int | | 54 | static int |
56 | mainbus_match(device_t parent, struct cfdata *match, void *aux) | | 55 | mainbus_match(device_t parent, cfdata_t match, void *aux) |
57 | { | | 56 | { |
58 | | | 57 | |
59 | return 1; | | 58 | return 1; |
60 | } | | 59 | } |
61 | | | 60 | |
62 | /* | | 61 | /* |
63 | * Attach the mainbus. | | 62 | * Attach the mainbus. |
64 | */ | | 63 | */ |
65 | static void | | 64 | static void |
66 | mainbus_attach(device_t parent, device_t self, void *aux) | | 65 | mainbus_attach(device_t parent, device_t self, void *aux) |
67 | { | | 66 | { |
68 | #if NACPI > 0 | | 67 | #if NACPI > 0 |
69 | struct acpibus_attach_args aaa; | | 68 | struct acpibus_attach_args aaa; |
70 | #endif | | 69 | #endif |
71 | | | 70 | |
72 | aprint_naive("\n"); | | 71 | aprint_naive("\n"); |
73 | aprint_normal("\n"); | | 72 | aprint_normal("\n"); |
74 | | | 73 | |
75 | #if NACPI > 0 | | 74 | #if NACPI > 0 |
76 | acpi_probe(); | | 75 | acpi_probe(); |
77 | | | 76 | |
78 | aaa.aa_iot = IA64_BUS_SPACE_IO; | | 77 | aaa.aa_iot = IA64_BUS_SPACE_IO; |
79 | aaa.aa_memt = IA64_BUS_SPACE_MEM; | | 78 | aaa.aa_memt = IA64_BUS_SPACE_MEM; |
80 | aaa.aa_pc = 0; | | 79 | aaa.aa_pc = 0; |
81 | aaa.aa_pciflags = | | 80 | aaa.aa_pciflags = |
82 | PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED | | | 81 | PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED | |
83 | PCI_FLAGS_MRL_OKAY | PCI_FLAGS_MRM_OKAY | | | 82 | PCI_FLAGS_MRL_OKAY | PCI_FLAGS_MRM_OKAY | |
84 | PCI_FLAGS_MWI_OKAY; | | 83 | PCI_FLAGS_MWI_OKAY; |
85 | aaa.aa_ic = 0; | | 84 | aaa.aa_ic = 0; |
86 | config_found_ia(self, "acpibus", &aaa, 0); | | 85 | config_found_ia(self, "acpibus", &aaa, 0); |
87 | #endif | | 86 | #endif |
88 | | | 87 | |
89 | return; | | 88 | return; |
90 | } | | 89 | } |