Mon Jun 6 16:42:19 2011 UTC ()
More device_t, cfdata, CFATTACH_DECL_NEW cleanup.


(matt)
diff -r1.6 -r1.7 src/sys/arch/evbppc/explora/dev/elb.c
diff -r1.3 -r1.4 src/sys/arch/evbppc/pmppc/dev/cpc_mainbus.c
diff -r1.1 -r1.2 src/sys/arch/evbppc/virtex/dev/xcvbus.c
diff -r1.10 -r1.11 src/sys/arch/evbppc/walnut/dev/pbus.c
diff -r1.9 -r1.10 src/sys/arch/evbppc/walnut/pci/pchb.c
diff -r1.18 -r1.19 src/sys/arch/powerpc/ibm4xx/dev/plb.c
diff -r1.7 -r1.8 src/sys/arch/powerpc/ibm4xx/pci/pchb.c
diff -r1.4 -r1.5 src/sys/arch/powerpc/pci/pchb.c
diff -r1.9 -r1.10 src/sys/arch/prep/isa/isabeep.c
diff -r1.3 -r1.4 src/sys/arch/prep/pci/pceb.c
diff -r1.3 -r1.4 src/sys/arch/sandpoint/sandpoint/eumb.c

cvs diff -r1.6 -r1.7 src/sys/arch/evbppc/explora/dev/elb.c (expand / switch to unified diff)

--- src/sys/arch/evbppc/explora/dev/elb.c 2008/04/28 20:23:17 1.6
+++ src/sys/arch/evbppc/explora/dev/elb.c 2011/06/06 16:42:17 1.7
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: elb.c,v 1.6 2008/04/28 20:23:17 martin Exp $ */ 1/* $NetBSD: elb.c,v 1.7 2011/06/06 16:42:17 matt Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2003 The NetBSD Foundation, Inc. 4 * Copyright (c) 2003 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 Juergen Hannken-Illjes. 8 * by Juergen Hannken-Illjes.
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,52 +20,52 @@ @@ -20,52 +20,52 @@
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: elb.c,v 1.6 2008/04/28 20:23:17 martin Exp $"); 33__KERNEL_RCSID(0, "$NetBSD: elb.c,v 1.7 2011/06/06 16:42:17 matt Exp $");
34 34
35#include <sys/param.h> 35#include <sys/param.h>
36#include <sys/conf.h> 36#include <sys/conf.h>
37#include <sys/device.h> 37#include <sys/device.h>
38#include <sys/systm.h> 38#include <sys/systm.h>
39#include <sys/extent.h> 39#include <sys/extent.h>
40 40
41#include <machine/explora.h> 41#include <machine/explora.h>
42#define _POWERPC_BUS_DMA_PRIVATE 42#define _POWERPC_BUS_DMA_PRIVATE
43#include <machine/bus.h> 43#include <machine/bus.h>
44 44
45#include <powerpc/ibm4xx/dcr403cgx.h> 45#include <powerpc/ibm4xx/dcr403cgx.h>
46 46
47#include <evbppc/explora/dev/elbvar.h> 47#include <evbppc/explora/dev/elbvar.h>
48 48
49struct elb_dev { 49struct elb_dev {
50 const char *elb_name; 50 const char *elb_name;
51 int elb_addr; 51 int elb_addr;
52 int elb_addr2; 52 int elb_addr2;
53 int elb_irq; 53 int elb_irq;
54 bus_space_tag_t elb_bt; 54 bus_space_tag_t elb_bt;
55}; 55};
56 56
57static int elb_match(struct device *, struct cfdata *, void *); 57static int elb_match(device_t, cfdata_t, void *);
58static void elb_attach(struct device *, struct device *, void *); 58static void elb_attach(device_t, device_t, void *);
59static int elb_print(void *, const char *); 59static int elb_print(void *, const char *);
60 60
61static struct powerpc_bus_space elb_tag = { 61static struct powerpc_bus_space elb_tag = {
62 _BUS_SPACE_LITTLE_ENDIAN | _BUS_SPACE_MEM_TYPE | 1, /* stride 1 */ 62 _BUS_SPACE_LITTLE_ENDIAN | _BUS_SPACE_MEM_TYPE | 1, /* stride 1 */
63 0x00000000, 63 0x00000000,
64 BASE_PCKBC, 64 BASE_PCKBC,
65 BASE_PCKBC + 0x6ff 65 BASE_PCKBC + 0x6ff
66}; 66};
67static char elb_ex_storage[EXTENT_FIXED_STORAGE_SIZE(8)] 67static char elb_ex_storage[EXTENT_FIXED_STORAGE_SIZE(8)]
68 __attribute__((aligned(8))); 68 __attribute__((aligned(8)));
69static int elb_tag_init_done; 69static int elb_tag_init_done;
70 70
71static struct powerpc_bus_space elb_fb_tag = { 71static struct powerpc_bus_space elb_fb_tag = {
@@ -99,43 +99,43 @@ static struct powerpc_bus_dma_tag elb_bu @@ -99,43 +99,43 @@ static struct powerpc_bus_dma_tag elb_bu
99 _bus_dma_phys_to_bus_mem_generic, 99 _bus_dma_phys_to_bus_mem_generic,
100 _bus_dma_bus_mem_to_phys_generic, 100 _bus_dma_bus_mem_to_phys_generic,
101}; 101};
102 102
103static struct elb_dev elb_devs[] = { 103static struct elb_dev elb_devs[] = {
104 { "cpu", 0, 0, -1, NULL }, 104 { "cpu", 0, 0, -1, NULL },
105 { "pckbc", BASE_PCKBC, BASE_PCKBC2, 31, &elb_tag }, 105 { "pckbc", BASE_PCKBC, BASE_PCKBC2, 31, &elb_tag },
106 { "com", BASE_COM, 0, 30, &elb_tag }, 106 { "com", BASE_COM, 0, 30, &elb_tag },
107 { "lpt", BASE_LPT, 0, -1, &elb_tag }, 107 { "lpt", BASE_LPT, 0, -1, &elb_tag },
108 { "fb", BASE_FB, BASE_FB2, -1, &elb_fb_tag }, 108 { "fb", BASE_FB, BASE_FB2, -1, &elb_fb_tag },
109 { "le", BASE_LE, 0, 28, &elb_fb_tag }, 109 { "le", BASE_LE, 0, 28, &elb_fb_tag },
110}; 110};
111 111
112CFATTACH_DECL(elb, sizeof(struct device), 112CFATTACH_DECL_NEW(elb, 0,
113 elb_match, elb_attach, NULL, NULL); 113 elb_match, elb_attach, NULL, NULL);
114 114
115/* 115/*
116 * Probe for the elb; always succeeds. 116 * Probe for the elb; always succeeds.
117 */ 117 */
118static int 118static int
119elb_match(struct device *parent, struct cfdata *cf, void *aux) 119elb_match(device_t parent, cfdata_t cf, void *aux)
120{ 120{
121 return (1); 121 return (1);
122} 122}
123 123
124/* 124/*
125 * Attach the Explora local bus. 125 * Attach the Explora local bus.
126 */ 126 */
127static void 127static void
128elb_attach(struct device *parent, struct device *self, void *aux) 128elb_attach(device_t parent, device_t self, void *aux)
129{ 129{
130 struct elb_attach_args eaa; 130 struct elb_attach_args eaa;
131 int i; 131 int i;
132 132
133 printf("\n"); 133 printf("\n");
134 for (i = 0; i < sizeof(elb_devs)/sizeof(elb_devs[0]); i++) { 134 for (i = 0; i < sizeof(elb_devs)/sizeof(elb_devs[0]); i++) {
135 eaa.elb_name = elb_devs[i].elb_name; 135 eaa.elb_name = elb_devs[i].elb_name;
136 eaa.elb_bt = elb_get_bus_space_tag(elb_devs[i].elb_addr); 136 eaa.elb_bt = elb_get_bus_space_tag(elb_devs[i].elb_addr);
137 eaa.elb_dmat = &elb_bus_dma_tag; 137 eaa.elb_dmat = &elb_bus_dma_tag;
138 eaa.elb_base = elb_devs[i].elb_addr; 138 eaa.elb_base = elb_devs[i].elb_addr;
139 eaa.elb_base2 = elb_devs[i].elb_addr2; 139 eaa.elb_base2 = elb_devs[i].elb_addr2;
140 eaa.elb_irq = elb_devs[i].elb_irq; 140 eaa.elb_irq = elb_devs[i].elb_irq;
141 141

cvs diff -r1.3 -r1.4 src/sys/arch/evbppc/pmppc/dev/cpc_mainbus.c (expand / switch to unified diff)

--- src/sys/arch/evbppc/pmppc/dev/cpc_mainbus.c 2008/04/28 20:23:17 1.3
+++ src/sys/arch/evbppc/pmppc/dev/cpc_mainbus.c 2011/06/06 16:42:17 1.4
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: cpc_mainbus.c,v 1.3 2008/04/28 20:23:17 martin Exp $ */ 1/* $NetBSD: cpc_mainbus.c,v 1.4 2011/06/06 16:42:17 matt Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2002 The NetBSD Foundation, Inc. 4 * Copyright (c) 2002 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 Lennart Augustsson (lennart@augustsson.net) at Sandburst Corp. 8 * by Lennart Augustsson (lennart@augustsson.net) at Sandburst Corp.
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,71 +20,71 @@ @@ -20,71 +20,71 @@
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: cpc_mainbus.c,v 1.3 2008/04/28 20:23:17 martin Exp $"); 33__KERNEL_RCSID(0, "$NetBSD: cpc_mainbus.c,v 1.4 2011/06/06 16:42:17 matt Exp $");
34 34
35#include <sys/param.h> 35#include <sys/param.h>
36#include <sys/extent.h> 36#include <sys/extent.h>
37#include <sys/device.h> 37#include <sys/device.h>
38#include <sys/malloc.h> 38#include <sys/malloc.h>
39#include <sys/systm.h> 39#include <sys/systm.h>
40 40
41#include <machine/bus.h> 41#include <machine/bus.h>
42#include "locators.h" 42#include "locators.h"
43 43
44#include <dev/pci/pcivar.h> 44#include <dev/pci/pcivar.h>
45#include <dev/pci/pcireg.h> 45#include <dev/pci/pcireg.h>
46#include <dev/pci/pciconf.h> 46#include <dev/pci/pciconf.h>
47 47
48#include <dev/ic/cpc700reg.h> 48#include <dev/ic/cpc700reg.h>
49#include <dev/ic/cpc700var.h> 49#include <dev/ic/cpc700var.h>
50#include <dev/ic/cpc700uic.h> 50#include <dev/ic/cpc700uic.h>
51 51
52#include <machine/pmppc.h> 52#include <machine/pmppc.h>
53#include <arch/evbppc/pmppc/dev/mainbus.h> 53#include <arch/evbppc/pmppc/dev/mainbus.h>
54 54
55struct genppc_pci_chipset *genppc_pct; 55struct genppc_pci_chipset *genppc_pct;
56 56
57void 57void
58cpc_attach(struct device *self, pci_chipset_tag_t pc, bus_space_tag_t mem, 58cpc_attach(device_t self, pci_chipset_tag_t pc, bus_space_tag_t mem,
59 bus_space_tag_t pciio, bus_dma_tag_t tag, int attachpci, 59 bus_space_tag_t pciio, bus_dma_tag_t tag, int attachpci,
60 uint freq); 60 uint freq);
61 61
62static int cpc_mainbus_match(struct device *, struct cfdata *, void *); 62static int cpc_mainbus_match(device_t, cfdata_t, void *);
63static void cpc_mainbus_attach(struct device *, struct device *, void *); 63static void cpc_mainbus_attach(device_t, device_t, void *);
64 64
65CFATTACH_DECL(cpc_mainbus, sizeof(struct device), 65CFATTACH_DECL_NEW(cpc_mainbus, 0,
66 cpc_mainbus_match, cpc_mainbus_attach, NULL, NULL); 66 cpc_mainbus_match, cpc_mainbus_attach, NULL, NULL);
67 67
68int 68int
69cpc_mainbus_match(struct device *parent, struct cfdata *cf, void *aux) 69cpc_mainbus_match(device_t parent, cfdata_t cf, void *aux)
70{ 70{
71 struct mainbus_attach_args *maa = aux; 71 struct mainbus_attach_args *maa = aux;
72 72
73 return (strcmp(maa->mb_name, "cpc") == 0); 73 return (strcmp(maa->mb_name, "cpc") == 0);
74} 74}
75 75
76void 76void
77cpc_mainbus_attach(struct device *parent, struct device *self, void *aux) 77cpc_mainbus_attach(device_t parent, device_t self, void *aux)
78{ 78{
79 struct genppc_pci_chipset_businfo *pbi; 79 struct genppc_pci_chipset_businfo *pbi;
80 80
81 genppc_pct = malloc(sizeof(struct genppc_pci_chipset), M_DEVBUF, 81 genppc_pct = malloc(sizeof(struct genppc_pci_chipset), M_DEVBUF,
82 M_NOWAIT); 82 M_NOWAIT);
83 pmppc_pci_get_chipset_tag(genppc_pct); 83 pmppc_pci_get_chipset_tag(genppc_pct);
84 pbi = malloc(sizeof(struct genppc_pci_chipset_businfo), 84 pbi = malloc(sizeof(struct genppc_pci_chipset_businfo),
85 M_DEVBUF, M_NOWAIT); 85 M_DEVBUF, M_NOWAIT);
86 KASSERT(pbi != NULL); 86 KASSERT(pbi != NULL);
87 pbi->pbi_properties = prop_dictionary_create(); 87 pbi->pbi_properties = prop_dictionary_create();
88 KASSERT(pbi->pbi_properties != NULL); 88 KASSERT(pbi->pbi_properties != NULL);
89 SIMPLEQ_INIT(&genppc_pct->pc_pbi); 89 SIMPLEQ_INIT(&genppc_pct->pc_pbi);
90 SIMPLEQ_INSERT_TAIL(&genppc_pct->pc_pbi, pbi, next); 90 SIMPLEQ_INSERT_TAIL(&genppc_pct->pc_pbi, pbi, next);

cvs diff -r1.1 -r1.2 src/sys/arch/evbppc/virtex/dev/xcvbus.c (expand / switch to unified diff)

--- src/sys/arch/evbppc/virtex/dev/xcvbus.c 2006/12/02 22:18:47 1.1
+++ src/sys/arch/evbppc/virtex/dev/xcvbus.c 2011/06/06 16:42:18 1.2
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: xcvbus.c,v 1.1 2006/12/02 22:18:47 freza Exp $ */ 1/* $NetBSD: xcvbus.c,v 1.2 2011/06/06 16:42:18 matt Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2006 Jachym Holecek 4 * Copyright (c) 2006 Jachym Holecek
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Written for DFC Design, s.r.o. 7 * Written for DFC Design, s.r.o.
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 * 12 *
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,46 +20,46 @@ @@ -20,46 +20,46 @@
20 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 20 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
21 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 21 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
22 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 22 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
23 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 23 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
24 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 24 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
25 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
29 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32#include <sys/cdefs.h> 32#include <sys/cdefs.h>
33__KERNEL_RCSID(0, "$NetBSD: xcvbus.c,v 1.1 2006/12/02 22:18:47 freza Exp $"); 33__KERNEL_RCSID(0, "$NetBSD: xcvbus.c,v 1.2 2011/06/06 16:42:18 matt Exp $");
34 34
35#include <sys/param.h> 35#include <sys/param.h>
36#include <sys/systm.h> 36#include <sys/systm.h>
37#include <sys/types.h> 37#include <sys/types.h>
38#include <sys/device.h> 38#include <sys/device.h>
39#include <sys/extent.h> 39#include <sys/extent.h>
40#include <sys/malloc.h> 40#include <sys/malloc.h>
41 41
42#include <machine/bus.h> 42#include <machine/bus.h>
43#include <powerpc/ibm4xx/dev/plbvar.h> 43#include <powerpc/ibm4xx/dev/plbvar.h>
44 44
45#include <evbppc/virtex/dev/xcvbusvar.h> 45#include <evbppc/virtex/dev/xcvbusvar.h>
46 46
47 47
48static int xcvbus_match(device_t, cfdata_t, void *); 48static int xcvbus_match(device_t, cfdata_t, void *);
49static void xcvbus_attach(device_t, device_t, void *); 49static void xcvbus_attach(device_t, device_t, void *);
50 50
51 51
52CFATTACH_DECL(xcvbus, sizeof(struct device), 52CFATTACH_DECL_NEW(xcvbus, 0,
53 xcvbus_match, xcvbus_attach, NULL, NULL); 53 xcvbus_match, xcvbus_attach, NULL, NULL);
54 54
55 55
56static int 56static int
57xcvbus_match(device_t parent, cfdata_t cf, void *aux) 57xcvbus_match(device_t parent, cfdata_t cf, void *aux)
58{ 58{
59 struct plb_attach_args *paa = aux; 59 struct plb_attach_args *paa = aux;
60 60
61 return (strcmp(paa->plb_name, cf->cf_name) == 0); 61 return (strcmp(paa->plb_name, cf->cf_name) == 0);
62} 62}
63 63
64static void 64static void
65xcvbus_attach(device_t parent, device_t self, void *aux) 65xcvbus_attach(device_t parent, device_t self, void *aux)
@@ -91,19 +91,19 @@ xcvbus_print(void *aux, const char *pnp) @@ -91,19 +91,19 @@ xcvbus_print(void *aux, const char *pnp)
91 } 91 }
92 92
93 if (vaa->vaa_intr != -1) 93 if (vaa->vaa_intr != -1)
94 aprint_normal(" intr %d", vaa->vaa_intr); 94 aprint_normal(" intr %d", vaa->vaa_intr);
95 if (vaa->vaa_tx_dmac != NULL) 95 if (vaa->vaa_tx_dmac != NULL)
96 aprint_normal(" tx %d", vaa->vaa_tx_dmac->dmac_chan); 96 aprint_normal(" tx %d", vaa->vaa_tx_dmac->dmac_chan);
97 if (vaa->vaa_rx_dmac != NULL) 97 if (vaa->vaa_rx_dmac != NULL)
98 aprint_normal(" rx %d", vaa->vaa_rx_dmac->dmac_chan); 98 aprint_normal(" rx %d", vaa->vaa_rx_dmac->dmac_chan);
99 99
100 return (UNCONF); 100 return (UNCONF);
101} 101}
102 102
103int 103int
104xcvbus_child_match(struct device *parent, struct cfdata *cf, void *aux) 104xcvbus_child_match(device_t parent, cfdata_t cf, void *aux)
105{ 105{
106 struct xcvbus_attach_args *vaa = aux; 106 struct xcvbus_attach_args *vaa = aux;
107 107
108 return (strcmp(vaa->vaa_name, cf->cf_name) == 0); 108 return (strcmp(vaa->vaa_name, cf->cf_name) == 0);
109} 109}

cvs diff -r1.10 -r1.11 src/sys/arch/evbppc/walnut/dev/pbus.c (expand / switch to unified diff)

--- src/sys/arch/evbppc/walnut/dev/pbus.c 2006/05/04 10:53:06 1.10
+++ src/sys/arch/evbppc/walnut/dev/pbus.c 2011/06/06 16:42:18 1.11
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: pbus.c,v 1.10 2006/05/04 10:53:06 simonb Exp $ */ 1/* $NetBSD: pbus.c,v 1.11 2011/06/06 16:42:18 matt Exp $ */
2 2
3/* 3/*
4 * Copyright 2001 Wasabi Systems, Inc. 4 * Copyright 2001 Wasabi Systems, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Written by Eduardo Horvath and Simon Burge for Wasabi Systems, Inc. 7 * Written by Eduardo Horvath and Simon Burge for Wasabi Systems, Inc.
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
@@ -56,27 +56,27 @@ @@ -56,27 +56,27 @@
56 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 56 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
57 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 57 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
58 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 58 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
59 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 59 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
60 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 60 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
61 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 61 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
62 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 62 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
63 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 63 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
64 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 64 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
65 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 65 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
66 */ 66 */
67 67
68#include <sys/cdefs.h> 68#include <sys/cdefs.h>
69__KERNEL_RCSID(0, "$NetBSD: pbus.c,v 1.10 2006/05/04 10:53:06 simonb Exp $"); 69__KERNEL_RCSID(0, "$NetBSD: pbus.c,v 1.11 2011/06/06 16:42:18 matt Exp $");
70 70
71#include "locators.h" 71#include "locators.h"
72#include "pckbc.h" 72#include "pckbc.h"
73 73
74#include <sys/param.h> 74#include <sys/param.h>
75#include <sys/systm.h> 75#include <sys/systm.h>
76#include <sys/device.h> 76#include <sys/device.h>
77 77
78#include <machine/bus.h> 78#include <machine/bus.h>
79#include <machine/walnut.h> 79#include <machine/walnut.h>
80 80
81#include <evbppc/walnut/dev/pbusvar.h> 81#include <evbppc/walnut/dev/pbusvar.h>
82 82
@@ -86,60 +86,60 @@ __KERNEL_RCSID(0, "$NetBSD: pbus.c,v 1.1 @@ -86,60 +86,60 @@ __KERNEL_RCSID(0, "$NetBSD: pbus.c,v 1.1
86/* 86/*
87 * The external devices on the Walnut 405GP evaluation board. 87 * The external devices on the Walnut 405GP evaluation board.
88 */ 88 */
89const struct pbus_dev { 89const struct pbus_dev {
90 const char *name; 90 const char *name;
91 bus_addr_t addr; 91 bus_addr_t addr;
92 int irq; 92 int irq;
93} pbus_devs [] = { 93} pbus_devs [] = {
94 { "ds1743rtc", NVRAM_BASE, -1 }, 94 { "ds1743rtc", NVRAM_BASE, -1 },
95 { "pckbc", KEY_MOUSE_BASE, 25 }, /* XXX: really irq x..x+1 */ 95 { "pckbc", KEY_MOUSE_BASE, 25 }, /* XXX: really irq x..x+1 */
96 { NULL } 96 { NULL }
97}; 97};
98 98
99static int pbus_match(struct device *, struct cfdata *, void *); 99static int pbus_match(device_t, cfdata_t, void *);
100static void pbus_attach(struct device *, struct device *, void *); 100static void pbus_attach(device_t, device_t, void *);
101static int pbus_print(void *, const char *); 101static int pbus_print(void *, const char *);
102 102
103CFATTACH_DECL(pbus, sizeof(struct device), 103CFATTACH_DECL_NEW(pbus, 0,
104 pbus_match, pbus_attach, NULL, NULL); 104 pbus_match, pbus_attach, NULL, NULL);
105 105
106static struct powerpc_bus_space pbus_tag = { 106static struct powerpc_bus_space pbus_tag = {
107 _BUS_SPACE_LITTLE_ENDIAN | _BUS_SPACE_MEM_TYPE, 107 _BUS_SPACE_LITTLE_ENDIAN | _BUS_SPACE_MEM_TYPE,
108 0x00000000, 108 0x00000000,
109 NVRAM_BASE, 109 NVRAM_BASE,
110 NVRAM_BASE + 0x0300010 /* Cover from NVRAM_BASE -> FPGA_BASE */ 110 NVRAM_BASE + 0x0300010 /* Cover from NVRAM_BASE -> FPGA_BASE */
111}; 111};
112 112
113/* 113/*
114 * Probe for the peripheral bus. 114 * Probe for the peripheral bus.
115 */ 115 */
116static int 116static int
117pbus_match(struct device *parent, struct cfdata *cf, void *aux) 117pbus_match(device_t parent, cfdata_t cf, void *aux)
118{ 118{
119 struct pbus_attach_args *pba = aux; 119 struct pbus_attach_args *pba = aux;
120 120
121 /* match only pbus devices */ 121 /* match only pbus devices */
122 if (strcmp(pba->pb_name, cf->cf_name) != 0) 122 if (strcmp(pba->pb_name, cf->cf_name) != 0)
123 return (0); 123 return (0);
124 124
125 return (1); 125 return (1);
126} 126}
127 127
128/* 128/*
129 * Attach the peripheral bus. 129 * Attach the peripheral bus.
130 */ 130 */
131static void 131static void
132pbus_attach(struct device *parent, struct device *self, void *aux) 132pbus_attach(device_t parent, device_t self, void *aux)
133{ 133{
134 struct plb_attach_args *paa = aux; 134 struct plb_attach_args *paa = aux;
135 struct pbus_attach_args pba; 135 struct pbus_attach_args pba;
136 int i; 136 int i;
137#if NPCKBC > 0 137#if NPCKBC > 0
138 bus_space_handle_t ioh_fpga; 138 bus_space_handle_t ioh_fpga;
139 bus_space_tag_t iot_fpga = &pbus_tag; 139 bus_space_tag_t iot_fpga = &pbus_tag;
140 uint8_t fpga_reg; 140 uint8_t fpga_reg;
141#endif 141#endif
142 142
143 printf("\n"); 143 printf("\n");
144 144
145 if (bus_space_init(&pbus_tag, "pbus", NULL, 0)) 145 if (bus_space_init(&pbus_tag, "pbus", NULL, 0))

cvs diff -r1.9 -r1.10 src/sys/arch/evbppc/walnut/pci/Attic/pchb.c (expand / switch to unified diff)

--- src/sys/arch/evbppc/walnut/pci/Attic/pchb.c 2011/05/17 17:34:49 1.9
+++ src/sys/arch/evbppc/walnut/pci/Attic/pchb.c 2011/06/06 16:42:18 1.10
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: pchb.c,v 1.9 2011/05/17 17:34:49 dyoung Exp $ */ 1/* $NetBSD: pchb.c,v 1.10 2011/06/06 16:42:18 matt Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1996 The NetBSD Foundation, Inc. 4 * Copyright (c) 1996 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.
@@ -19,77 +19,77 @@ @@ -19,77 +19,77 @@
19 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 19 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
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#include <sys/cdefs.h> 31#include <sys/cdefs.h>
32__KERNEL_RCSID(0, "$NetBSD: pchb.c,v 1.9 2011/05/17 17:34:49 dyoung Exp $"); 32__KERNEL_RCSID(0, "$NetBSD: pchb.c,v 1.10 2011/06/06 16:42:18 matt Exp $");
33 33
34#include "pci.h" 34#include "pci.h"
35#include "opt_pci.h" 35#include "opt_pci.h"
36 36
37#include <sys/types.h> 37#include <sys/types.h>
38#include <sys/param.h> 38#include <sys/param.h>
39#include <sys/systm.h> 39#include <sys/systm.h>
40#include <sys/device.h> 40#include <sys/device.h>
41#include <sys/extent.h> 41#include <sys/extent.h>
42#include <sys/malloc.h> 42#include <sys/malloc.h>
43 43
44#define _IBM4XX_BUS_DMA_PRIVATE 44#define _IBM4XX_BUS_DMA_PRIVATE
45#include <machine/walnut.h> 45#include <machine/walnut.h>
46 46
47#include <powerpc/ibm4xx/ibm405gp.h> 47#include <powerpc/ibm4xx/ibm405gp.h>
48#include <powerpc/ibm4xx/dev/plbvar.h> 48#include <powerpc/ibm4xx/dev/plbvar.h>
49 49
50#include <dev/pci/pcivar.h> 50#include <dev/pci/pcivar.h>
51#include <dev/pci/pcireg.h> 51#include <dev/pci/pcireg.h>
52#include <dev/pci/pcidevs.h> 52#include <dev/pci/pcidevs.h>
53#include <dev/pci/pciconf.h> 53#include <dev/pci/pciconf.h>
54 54
55static int pchbmatch(struct device *, struct cfdata *, void *); 55static int pchbmatch(device_t, cfdata_t, void *);
56static void pchbattach(struct device *, struct device *, void *); 56static void pchbattach(device_t, device_t, void *);
57static int pchbprint(void *, const char *); 57static int pchbprint(void *, const char *);
58 58
59CFATTACH_DECL(pchb, sizeof(struct device), 59CFATTACH_DECL_NEW(pchb, 0,
60 pchbmatch, pchbattach, NULL, NULL); 60 pchbmatch, pchbattach, NULL, NULL);
61 61
62static int pcifound = 0; 62static int pcifound = 0;
63 63
64/* IO window located @ e8000000 and maps to 0-0xffff */ 64/* IO window located @ e8000000 and maps to 0-0xffff */
65static struct powerpc_bus_space pchb_io_tag = { 65static struct powerpc_bus_space pchb_io_tag = {
66 _BUS_SPACE_LITTLE_ENDIAN | _BUS_SPACE_IO_TYPE, 66 _BUS_SPACE_LITTLE_ENDIAN | _BUS_SPACE_IO_TYPE,
67 MIN_PLB_PCI_IOADDR, /* offset */ 67 MIN_PLB_PCI_IOADDR, /* offset */
68 MIN_PCI_PCI_IOADDR, /* extent base */ 68 MIN_PCI_PCI_IOADDR, /* extent base */
69 MIN_PCI_PCI_IOADDR + 0xffff, /* extent limit */ 69 MIN_PCI_PCI_IOADDR + 0xffff, /* extent limit */
70}; 70};
71 71
72/* PCI memory window is directly mapped */ 72/* PCI memory window is directly mapped */
73static struct powerpc_bus_space pchb_mem_tag = { 73static struct powerpc_bus_space pchb_mem_tag = {
74 _BUS_SPACE_LITTLE_ENDIAN | _BUS_SPACE_MEM_TYPE, 74 _BUS_SPACE_LITTLE_ENDIAN | _BUS_SPACE_MEM_TYPE,
75 0x00000000, /* offset */ 75 0x00000000, /* offset */
76 MIN_PCI_MEMADDR_NOPREFETCH, /* extent base */ 76 MIN_PCI_MEMADDR_NOPREFETCH, /* extent base */
77 MIN_PCI_MEMADDR_NOPREFETCH + 0x1fffffff, /* extent limit */ 77 MIN_PCI_MEMADDR_NOPREFETCH + 0x1fffffff, /* extent limit */
78}; 78};
79 79
80 80
81static int 81static int
82pchbmatch(struct device *parent, struct cfdata *cf, void *aux) 82pchbmatch(device_t parent, cfdata_t cf, void *aux)
83{ 83{
84 struct plb_attach_args *paa = aux; 84 struct plb_attach_args *paa = aux;
85 /* XXX chipset tag unused by walnut, so just pass 0 */ 85 /* XXX chipset tag unused by walnut, so just pass 0 */
86 pci_chipset_tag_t pc = 0; 86 pci_chipset_tag_t pc = 0;
87 pcitag_t tag;  87 pcitag_t tag;
88 int class, id; 88 int class, id;
89 89
90 /* match only pchb devices */ 90 /* match only pchb devices */
91 if (strcmp(paa->plb_name, cf->cf_name) != 0) 91 if (strcmp(paa->plb_name, cf->cf_name) != 0)
92 return 0; 92 return 0;
93 93
94 pci_machdep_init(); 94 pci_machdep_init();
95 tag = pci_make_tag(pc, 0, 0, 0); 95 tag = pci_make_tag(pc, 0, 0, 0);
@@ -105,27 +105,27 @@ pchbmatch(struct device *parent, struct  @@ -105,27 +105,27 @@ pchbmatch(struct device *parent, struct
105 switch (PCI_VENDOR(id)) { 105 switch (PCI_VENDOR(id)) {
106 case PCI_VENDOR_IBM: 106 case PCI_VENDOR_IBM:
107 switch (PCI_PRODUCT(id)) { 107 switch (PCI_PRODUCT(id)) {
108 case PCI_PRODUCT_IBM_405GP: 108 case PCI_PRODUCT_IBM_405GP:
109 return (!pcifound); 109 return (!pcifound);
110 } 110 }
111 break; 111 break;
112 } 112 }
113 } 113 }
114 return (0); 114 return (0);
115} 115}
116 116
117static void 117static void
118pchbattach(struct device *parent, struct device *self, void *aux) 118pchbattach(device_t parent, device_t self, void *aux)
119{ 119{
120 struct plb_attach_args *paa = aux; 120 struct plb_attach_args *paa = aux;
121 struct pcibus_attach_args pba; 121 struct pcibus_attach_args pba;
122 char devinfo[256]; 122 char devinfo[256];
123#ifdef PCI_NETBSD_CONFIGURE 123#ifdef PCI_NETBSD_CONFIGURE
124 struct extent *ioext, *memext; 124 struct extent *ioext, *memext;
125#ifdef PCI_CONFIGURE_VERBOSE 125#ifdef PCI_CONFIGURE_VERBOSE
126 extern int pci_conf_debug; 126 extern int pci_conf_debug;
127 127
128 pci_conf_debug = 1; 128 pci_conf_debug = 1;
129#endif 129#endif
130#endif 130#endif
131 pci_chipset_tag_t pc = 0; 131 pci_chipset_tag_t pc = 0;

cvs diff -r1.18 -r1.19 src/sys/arch/powerpc/ibm4xx/dev/plb.c (expand / switch to unified diff)

--- src/sys/arch/powerpc/ibm4xx/dev/plb.c 2010/12/13 07:29:12 1.18
+++ src/sys/arch/powerpc/ibm4xx/dev/plb.c 2011/06/06 16:42:18 1.19
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: plb.c,v 1.18 2010/12/13 07:29:12 kiyohara Exp $ */ 1/* $NetBSD: plb.c,v 1.19 2011/06/06 16:42:18 matt Exp $ */
2 2
3/* 3/*
4 * Copyright 2001 Wasabi Systems, Inc. 4 * Copyright 2001 Wasabi Systems, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Written by Eduardo Horvath and Simon Burge for Wasabi Systems, Inc. 7 * Written by Eduardo Horvath and Simon Burge for Wasabi Systems, Inc.
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
@@ -56,27 +56,27 @@ @@ -56,27 +56,27 @@
56 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 56 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
57 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 57 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
58 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 58 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
59 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 59 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
60 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 60 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
61 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 61 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
62 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 62 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
63 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 63 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
64 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 64 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
65 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 65 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
66 */ 66 */
67 67
68#include <sys/cdefs.h> 68#include <sys/cdefs.h>
69__KERNEL_RCSID(0, "$NetBSD: plb.c,v 1.18 2010/12/13 07:29:12 kiyohara Exp $"); 69__KERNEL_RCSID(0, "$NetBSD: plb.c,v 1.19 2011/06/06 16:42:18 matt Exp $");
70 70
71#include "locators.h" 71#include "locators.h"
72#include "emac.h" 72#include "emac.h"
73 73
74#include <sys/param.h> 74#include <sys/param.h>
75#include <sys/systm.h> 75#include <sys/systm.h>
76#include <sys/device.h> 76#include <sys/device.h>
77#include <sys/extent.h> 77#include <sys/extent.h>
78#include <sys/malloc.h> 78#include <sys/malloc.h>
79 79
80#define _POWERPC_BUS_DMA_PRIVATE 80#define _POWERPC_BUS_DMA_PRIVATE
81#include <machine/bus.h> 81#include <machine/bus.h>
82 82
@@ -101,31 +101,31 @@ const struct plb_dev plb_devs [] = { @@ -101,31 +101,31 @@ const struct plb_dev plb_devs [] = {
101 { IBM405GPR, "opb", }, 101 { IBM405GPR, "opb", },
102 { IBM405GPR, "pchb", }, 102 { IBM405GPR, "pchb", },
103 { IBM405GPR, "exb", }, 103 { IBM405GPR, "exb", },
104 104
105 /* AMCC 405EX / EXR */ 105 /* AMCC 405EX / EXR */
106 { AMCC405EX, "cpu", }, 106 { AMCC405EX, "cpu", },
107 { AMCC405EX, "ecc", }, 107 { AMCC405EX, "ecc", },
108 { AMCC405EX, "opb", }, 108 { AMCC405EX, "opb", },
109 { AMCC405EX, "pchb", }, 109 { AMCC405EX, "pchb", },
110 110
111 { 0, NULL } 111 { 0, NULL }
112}; 112};
113 113
114static int plb_match(struct device *, struct cfdata *, void *); 114static int plb_match(device_t, cfdata_t, void *);
115static void plb_attach(struct device *, struct device *, void *); 115static void plb_attach(device_t, device_t, void *);
116static int plb_print(void *, const char *); 116static int plb_print(void *, const char *);
117 117
118CFATTACH_DECL(plb, sizeof(struct device), plb_match, plb_attach, NULL, NULL); 118CFATTACH_DECL_NEW(plb, 0, plb_match, plb_attach, NULL, NULL);
119 119
120/* 120/*
121 * "generic" DMA struct, nothing special. 121 * "generic" DMA struct, nothing special.
122 */ 122 */
123struct powerpc_bus_dma_tag ibm4xx_default_bus_dma_tag = { 123struct powerpc_bus_dma_tag ibm4xx_default_bus_dma_tag = {
124 0, /* _bounce_thresh */ 124 0, /* _bounce_thresh */
125 _bus_dmamap_create, 125 _bus_dmamap_create,
126 _bus_dmamap_destroy, 126 _bus_dmamap_destroy,
127 _bus_dmamap_load, 127 _bus_dmamap_load,
128 _bus_dmamap_load_mbuf, 128 _bus_dmamap_load_mbuf,
129 _bus_dmamap_load_uio, 129 _bus_dmamap_load_uio,
130 _bus_dmamap_load_raw, 130 _bus_dmamap_load_raw,
131 _bus_dmamap_unload, 131 _bus_dmamap_unload,
@@ -133,37 +133,37 @@ struct powerpc_bus_dma_tag ibm4xx_defaul @@ -133,37 +133,37 @@ struct powerpc_bus_dma_tag ibm4xx_defaul
133 _bus_dmamem_alloc, 133 _bus_dmamem_alloc,
134 _bus_dmamem_free, 134 _bus_dmamem_free,
135 _bus_dmamem_map, 135 _bus_dmamem_map,
136 _bus_dmamem_unmap, 136 _bus_dmamem_unmap,
137 _bus_dmamem_mmap, 137 _bus_dmamem_mmap,
138 _bus_dma_phys_to_bus_mem_generic, 138 _bus_dma_phys_to_bus_mem_generic,
139 _bus_dma_bus_mem_to_phys_generic, 139 _bus_dma_bus_mem_to_phys_generic,
140}; 140};
141 141
142/* 142/*
143 * Probe for the plb; always succeeds. 143 * Probe for the plb; always succeeds.
144 */ 144 */
145static int 145static int
146plb_match(struct device *parent, struct cfdata *cf, void *aux) 146plb_match(device_t parent, cfdata_t cf, void *aux)
147{ 147{
148 148
149 return 1; 149 return 1;
150} 150}
151 151
152/* 152/*
153 * Attach the processor local bus. 153 * Attach the processor local bus.
154 */ 154 */
155static void 155static void
156plb_attach(struct device *parent, struct device *self, void *aux) 156plb_attach(device_t parent, device_t self, void *aux)
157{ 157{
158 struct plb_attach_args paa; 158 struct plb_attach_args paa;
159 struct plb_dev *local_plb_devs = aux; 159 struct plb_dev *local_plb_devs = aux;
160 int pvr, i; 160 int pvr, i;
161 161
162 aprint_naive("\n"); 162 aprint_naive("\n");
163 aprint_normal("\n"); 163 aprint_normal("\n");
164 164
165 pvr = mfpvr() >> 16; 165 pvr = mfpvr() >> 16;
166 166
167#if NEMAC > 0 167#if NEMAC > 0
168 mal_attach(pvr); 168 mal_attach(pvr);
169#endif 169#endif

cvs diff -r1.7 -r1.8 src/sys/arch/powerpc/ibm4xx/pci/pchb.c (expand / switch to unified diff)

--- src/sys/arch/powerpc/ibm4xx/pci/pchb.c 2011/05/17 17:34:52 1.7
+++ src/sys/arch/powerpc/ibm4xx/pci/pchb.c 2011/06/06 16:42:18 1.8
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: pchb.c,v 1.7 2011/05/17 17:34:52 dyoung Exp $ */ 1/* $NetBSD: pchb.c,v 1.8 2011/06/06 16:42:18 matt Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1996 The NetBSD Foundation, Inc. 4 * Copyright (c) 1996 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.
@@ -19,77 +19,77 @@ @@ -19,77 +19,77 @@
19 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 19 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
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#include <sys/cdefs.h> 31#include <sys/cdefs.h>
32__KERNEL_RCSID(0, "$NetBSD: pchb.c,v 1.7 2011/05/17 17:34:52 dyoung Exp $"); 32__KERNEL_RCSID(0, "$NetBSD: pchb.c,v 1.8 2011/06/06 16:42:18 matt Exp $");
33 33
34#include "pci.h" 34#include "pci.h"
35#include "opt_pci.h" 35#include "opt_pci.h"
36 36
37#include <sys/types.h> 37#include <sys/types.h>
38#include <sys/param.h> 38#include <sys/param.h>
39#include <sys/systm.h> 39#include <sys/systm.h>
40#include <sys/device.h> 40#include <sys/device.h>
41#include <sys/extent.h> 41#include <sys/extent.h>
42#include <sys/malloc.h> 42#include <sys/malloc.h>
43 43
44#define _IBM4XX_BUS_DMA_PRIVATE 44#define _IBM4XX_BUS_DMA_PRIVATE
45 45
46#include <powerpc/ibm4xx/ibm405gp.h> 46#include <powerpc/ibm4xx/ibm405gp.h>
47#include <powerpc/ibm4xx/dev/plbvar.h> 47#include <powerpc/ibm4xx/dev/plbvar.h>
48 48
49#include <dev/pci/pcivar.h> 49#include <dev/pci/pcivar.h>
50#include <dev/pci/pcireg.h> 50#include <dev/pci/pcireg.h>
51#include <dev/pci/pcidevs.h> 51#include <dev/pci/pcidevs.h>
52#include <dev/pci/pciconf.h> 52#include <dev/pci/pciconf.h>
53 53
54static int pchbmatch(struct device *, struct cfdata *, void *); 54static int pchbmatch(device_t, cfdata_t, void *);
55static void pchbattach(struct device *, struct device *, void *); 55static void pchbattach(device_t, device_t, void *);
56static int pchbprint(void *, const char *); 56static int pchbprint(void *, const char *);
57static pci_chipset_tag_t alloc_chipset_tag(int); 57static pci_chipset_tag_t alloc_chipset_tag(int);
58 58
59CFATTACH_DECL(pchb, sizeof(struct device), 59CFATTACH_DECL_NEW(pchb, 0,
60 pchbmatch, pchbattach, NULL, NULL); 60 pchbmatch, pchbattach, NULL, NULL);
61 61
62static int pcifound = 0; 62static int pcifound = 0;
63 63
64/* IO window located @ e8000000 and maps to 0-0xffff */ 64/* IO window located @ e8000000 and maps to 0-0xffff */
65static struct powerpc_bus_space pchb_io_tag = { 65static struct powerpc_bus_space pchb_io_tag = {
66 _BUS_SPACE_LITTLE_ENDIAN | _BUS_SPACE_IO_TYPE, 66 _BUS_SPACE_LITTLE_ENDIAN | _BUS_SPACE_IO_TYPE,
67 IBM405GP_PLB_PCI_IO_START, /* offset */ 67 IBM405GP_PLB_PCI_IO_START, /* offset */
68 IBM405GP_PCI_PCI_IO_START, /* extent base */ 68 IBM405GP_PCI_PCI_IO_START, /* extent base */
69 IBM405GP_PCI_PCI_IO_START + 0xffff, /* extent limit */ 69 IBM405GP_PCI_PCI_IO_START + 0xffff, /* extent limit */
70}; 70};
71 71
72/* PCI memory window is directly mapped */ 72/* PCI memory window is directly mapped */
73static struct powerpc_bus_space pchb_mem_tag = { 73static struct powerpc_bus_space pchb_mem_tag = {
74 _BUS_SPACE_LITTLE_ENDIAN | _BUS_SPACE_MEM_TYPE, 74 _BUS_SPACE_LITTLE_ENDIAN | _BUS_SPACE_MEM_TYPE,
75 0x00000000, /* offset */ 75 0x00000000, /* offset */
76 IBM405GP_PCI_MEM_START, /* extent base */ 76 IBM405GP_PCI_MEM_START, /* extent base */
77 IBM405GP_PCI_MEM_START + 0x1fffffff, /* extent limit */ 77 IBM405GP_PCI_MEM_START + 0x1fffffff, /* extent limit */
78}; 78};
79 79
80 80
81static int 81static int
82pchbmatch(struct device *parent, struct cfdata *cf, void *aux) 82pchbmatch(device_t parent, cfdata_t cf, void *aux)
83{ 83{
84 struct plb_attach_args *paa = aux; 84 struct plb_attach_args *paa = aux;
85 /* XXX chipset tag unused by walnut, so just pass 0 */ 85 /* XXX chipset tag unused by walnut, so just pass 0 */
86 pci_chipset_tag_t pc = alloc_chipset_tag(0); 86 pci_chipset_tag_t pc = alloc_chipset_tag(0);
87 pcitag_t tag;  87 pcitag_t tag;
88 int class, id; 88 int class, id;
89 89
90 /* match only pchb devices */ 90 /* match only pchb devices */
91 if (strcmp(paa->plb_name, cf->cf_name) != 0) 91 if (strcmp(paa->plb_name, cf->cf_name) != 0)
92 return 0; 92 return 0;
93 93
94 pci_machdep_init(); 94 pci_machdep_init();
95 tag = pci_make_tag(pc, 0, 0, 0); 95 tag = pci_make_tag(pc, 0, 0, 0);
@@ -105,27 +105,27 @@ pchbmatch(struct device *parent, struct  @@ -105,27 +105,27 @@ pchbmatch(struct device *parent, struct
105 switch (PCI_VENDOR(id)) { 105 switch (PCI_VENDOR(id)) {
106 case PCI_VENDOR_IBM: 106 case PCI_VENDOR_IBM:
107 switch (PCI_PRODUCT(id)) { 107 switch (PCI_PRODUCT(id)) {
108 case PCI_PRODUCT_IBM_405GP: 108 case PCI_PRODUCT_IBM_405GP:
109 return (!pcifound); 109 return (!pcifound);
110 } 110 }
111 break; 111 break;
112 } 112 }
113 } 113 }
114 return (0); 114 return (0);
115} 115}
116 116
117static void 117static void
118pchbattach(struct device *parent, struct device *self, void *aux) 118pchbattach(device_t parent, device_t self, void *aux)
119{ 119{
120 struct plb_attach_args *paa = aux; 120 struct plb_attach_args *paa = aux;
121 struct pcibus_attach_args pba; 121 struct pcibus_attach_args pba;
122 char devinfo[256]; 122 char devinfo[256];
123#ifdef PCI_CONFIGURE_VERBOSE 123#ifdef PCI_CONFIGURE_VERBOSE
124 extern int pci_conf_debug; 124 extern int pci_conf_debug;
125 125
126 pci_conf_debug = 1; 126 pci_conf_debug = 1;
127#endif 127#endif
128 pci_chipset_tag_t pc = alloc_chipset_tag(0); 128 pci_chipset_tag_t pc = alloc_chipset_tag(0);
129 pcitag_t tag;  129 pcitag_t tag;
130 int class, id; 130 int class, id;
131 131

cvs diff -r1.4 -r1.5 src/sys/arch/powerpc/pci/pchb.c (expand / switch to unified diff)

--- src/sys/arch/powerpc/pci/pchb.c 2008/04/28 20:23:32 1.4
+++ src/sys/arch/powerpc/pci/pchb.c 2011/06/06 16:42:18 1.5
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: pchb.c,v 1.4 2008/04/28 20:23:32 martin Exp $ */ 1/* $NetBSD: pchb.c,v 1.5 2011/06/06 16:42:18 matt Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2007 The NetBSD Foundation, Inc. 4 * Copyright (c) 2007 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 Tim Rightnour 8 * by Tim Rightnour
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,72 +20,72 @@ @@ -20,72 +20,72 @@
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.4 2008/04/28 20:23:32 martin Exp $"); 33__KERNEL_RCSID(0, "$NetBSD: pchb.c,v 1.5 2011/06/06 16:42:18 matt 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 <machine/bus.h> 40#include <machine/bus.h>
41#include <machine/pio.h> 41#include <machine/pio.h>
42 42
43#include <dev/pci/pcivar.h> 43#include <dev/pci/pcivar.h>
44#include <dev/pci/pcireg.h> 44#include <dev/pci/pcireg.h>
45#include <dev/pci/pcidevs.h> 45#include <dev/pci/pcidevs.h>
46#include <dev/pci/agpreg.h> 46#include <dev/pci/agpreg.h>
47#include <dev/pci/agpvar.h> 47#include <dev/pci/agpvar.h>
48 48
49#include <dev/ic/mpc105reg.h> 49#include <dev/ic/mpc105reg.h>
50#include <dev/ic/mpc106reg.h> 50#include <dev/ic/mpc106reg.h>
51#include <dev/ic/ibm82660reg.h> 51#include <dev/ic/ibm82660reg.h>
52 52
53#include "agp.h" 53#include "agp.h"
54 54
55int pchbmatch(struct device *, struct cfdata *, void *); 55int pchbmatch(device_t, cfdata_t, void *);
56void pchbattach(struct device *, struct device *, void *); 56void pchbattach(device_t, device_t, void *);
57 57
58CFATTACH_DECL(pchb, sizeof(struct device), 58CFATTACH_DECL_NEW(pchb, 0,
59 pchbmatch, pchbattach, NULL, NULL); 59 pchbmatch, pchbattach, NULL, NULL);
60 60
61int 61int
62pchbmatch(struct device *parent, struct cfdata *cf, void *aux) 62pchbmatch(device_t parent, cfdata_t cf, void *aux)
63{ 63{
64 struct pci_attach_args *pa = aux; 64 struct pci_attach_args *pa = aux;
65 65
66 /* 66 /*
67 * Match all known PCI host chipsets. 67 * Match all known PCI host chipsets.
68 */ 68 */
69 if (PCI_CLASS(pa->pa_class) == PCI_CLASS_BRIDGE && 69 if (PCI_CLASS(pa->pa_class) == PCI_CLASS_BRIDGE &&
70 PCI_SUBCLASS(pa->pa_class) == PCI_SUBCLASS_BRIDGE_HOST) { 70 PCI_SUBCLASS(pa->pa_class) == PCI_SUBCLASS_BRIDGE_HOST) {
71 return (1); 71 return (1);
72 } 72 }
73 73
74 return (0); 74 return (0);
75} 75}
76 76
77static void 77static void
78mpc105_print(struct pci_attach_args *pa, struct device *self) 78mpc105_print(struct pci_attach_args *pa, device_t self)
79{ 79{
80 pcireg_t reg1, reg2; 80 pcireg_t reg1, reg2;
81 const char *s1; 81 const char *s1;
82 82
83 reg1 = pci_conf_read(pa->pa_pc, pa->pa_tag, MPC105_PICR1); 83 reg1 = pci_conf_read(pa->pa_pc, pa->pa_tag, MPC105_PICR1);
84 reg2 = pci_conf_read(pa->pa_pc, pa->pa_tag, MPC105_PICR2); 84 reg2 = pci_conf_read(pa->pa_pc, pa->pa_tag, MPC105_PICR2);
85 aprint_normal("%s: L2 cache: ", self->dv_xname); 85 aprint_normal("%s: L2 cache: ", self->dv_xname);
86 86
87 switch (reg2 & MPC105_PICR2_L2_SIZE) { 87 switch (reg2 & MPC105_PICR2_L2_SIZE) {
88 case MPC105_PICR2_L2_SIZE_256K: 88 case MPC105_PICR2_L2_SIZE_256K:
89 s1 = "256K"; 89 s1 = "256K";
90 break; 90 break;
91 case MPC105_PICR2_L2_SIZE_512K: 91 case MPC105_PICR2_L2_SIZE_512K:
@@ -108,27 +108,27 @@ mpc105_print(struct pci_attach_args *pa, @@ -108,27 +108,27 @@ mpc105_print(struct pci_attach_args *pa,
108 s1 = "write-through"; 108 s1 = "write-through";
109 break; 109 break;
110 case MPC105_PICR1_L2_MP_WB: 110 case MPC105_PICR1_L2_MP_WB:
111 s1 = "write-back"; 111 s1 = "write-back";
112 break; 112 break;
113 case MPC105_PICR1_L2_MP_MP: 113 case MPC105_PICR1_L2_MP_MP:
114 s1 = "multiprocessor"; 114 s1 = "multiprocessor";
115 break; 115 break;
116 } 116 }
117 aprint_normal("%s mode\n", s1); 117 aprint_normal("%s mode\n", s1);
118} 118}
119 119
120static void 120static void
121mpc106_print(struct pci_attach_args *pa, struct device *self) 121mpc106_print(struct pci_attach_args *pa, device_t self)
122{ 122{
123 pcireg_t reg1, reg2; 123 pcireg_t reg1, reg2;
124 const char *s1; 124 const char *s1;
125 125
126 reg1 = pci_conf_read(pa->pa_pc, pa->pa_tag, MPC106_PICR1); 126 reg1 = pci_conf_read(pa->pa_pc, pa->pa_tag, MPC106_PICR1);
127 reg2 = pci_conf_read(pa->pa_pc, pa->pa_tag, MPC106_PICR2); 127 reg2 = pci_conf_read(pa->pa_pc, pa->pa_tag, MPC106_PICR2);
128 aprint_normal("%s: L2 cache: ", self->dv_xname); 128 aprint_normal("%s: L2 cache: ", self->dv_xname);
129 129
130 switch (reg2 & MPC106_PICR2_L2_SIZE) { 130 switch (reg2 & MPC106_PICR2_L2_SIZE) {
131 case MPC106_PICR2_L2_SIZE_256K: 131 case MPC106_PICR2_L2_SIZE_256K:
132 s1 = "256K"; 132 s1 = "256K";
133 break; 133 break;
134 case MPC106_PICR2_L2_SIZE_512K: 134 case MPC106_PICR2_L2_SIZE_512K:
@@ -167,27 +167,27 @@ mpc106_print(struct pci_attach_args *pa, @@ -167,27 +167,27 @@ mpc106_print(struct pci_attach_args *pa,
167 break; 167 break;
168 case MPC106_PICR1_L2_MP_MP: 168 case MPC106_PICR1_L2_MP_MP:
169 s1 = "multiprocessors/external"; 169 s1 = "multiprocessors/external";
170 break; 170 break;
171 default: 171 default:
172 s1 = "reserved"; 172 s1 = "reserved";
173 break; 173 break;
174 } 174 }
175 } 175 }
176 aprint_normal("%s mode\n", s1); 176 aprint_normal("%s mode\n", s1);
177} 177}
178 178
179static void 179static void
180ibm82660_print(struct pci_attach_args *pa, struct device *self) 180ibm82660_print(struct pci_attach_args *pa, device_t self)
181{ 181{
182 pcireg_t reg1; 182 pcireg_t reg1;
183#ifdef PREP_BUS_SPACE_IO 183#ifdef PREP_BUS_SPACE_IO
184 pcireg_t reg2; 184 pcireg_t reg2;
185#endif 185#endif
186 const char *s1, *s2; 186 const char *s1, *s2;
187 187
188 reg1 = pci_conf_read(pa->pa_pc, pa->pa_tag, 188 reg1 = pci_conf_read(pa->pa_pc, pa->pa_tag,
189 IBM_82660_CACHE_STATUS); 189 IBM_82660_CACHE_STATUS);
190#ifdef PREP_BUS_SPACE_IO 190#ifdef PREP_BUS_SPACE_IO
191 reg2 = in32rb(PREP_BUS_SPACE_IO+IBM_82660_SYSTEM_CTRL); 191 reg2 = in32rb(PREP_BUS_SPACE_IO+IBM_82660_SYSTEM_CTRL);
192 if (reg2 & IBM_82660_SYSTEM_CTRL_L2_EN) { 192 if (reg2 & IBM_82660_SYSTEM_CTRL_L2_EN) {
193 if (reg1 & IBM_82660_CACHE_STATUS_L2_EN) 193 if (reg1 & IBM_82660_CACHE_STATUS_L2_EN)
@@ -221,27 +221,27 @@ ibm82660_print(struct pci_attach_args *p @@ -221,27 +221,27 @@ ibm82660_print(struct pci_attach_args *p
221 aprint_verbose("%s: PCI/ISA I/O mapping %s\n", self->dv_xname, 221 aprint_verbose("%s: PCI/ISA I/O mapping %s\n", self->dv_xname,
222 (reg1 & IBM_82660_OPTIONS_1_ISA) ? "contiguous" : "non-contiguous"); 222 (reg1 & IBM_82660_OPTIONS_1_ISA) ? "contiguous" : "non-contiguous");
223 223
224 reg1 = pci_conf_read(pa->pa_pc, pa->pa_tag, IBM_82660_OPTIONS_3); 224 reg1 = pci_conf_read(pa->pa_pc, pa->pa_tag, IBM_82660_OPTIONS_3);
225 aprint_normal("%s: DRAM %s (%s) SRAM %s\n", self->dv_xname, 225 aprint_normal("%s: DRAM %s (%s) SRAM %s\n", self->dv_xname,
226 (reg1 & IBM_82660_OPTIONS_3_DRAM) ? "EDO" : "standard", 226 (reg1 & IBM_82660_OPTIONS_3_DRAM) ? "EDO" : "standard",
227 (reg1 & IBM_82660_OPTIONS_3_ECC) ? "ECC" : "parity", 227 (reg1 & IBM_82660_OPTIONS_3_ECC) ? "ECC" : "parity",
228 (reg1 & IBM_82660_OPTIONS_3_SRAM) ? "sync" : "async"); 228 (reg1 & IBM_82660_OPTIONS_3_SRAM) ? "sync" : "async");
229 aprint_verbose("%s: Snoop mode %s\n", self->dv_xname, 229 aprint_verbose("%s: Snoop mode %s\n", self->dv_xname,
230 (reg1 & IBM_82660_OPTIONS_3_SNOOP) ? "603" : "601/604"); 230 (reg1 & IBM_82660_OPTIONS_3_SNOOP) ? "603" : "601/604");
231} 231}
232 232
233void 233void
234pchbattach(struct device *parent, struct device *self, void *aux) 234pchbattach(device_t parent, device_t self, void *aux)
235{ 235{
236 struct pci_attach_args *pa = aux; 236 struct pci_attach_args *pa = aux;
237 char devinfo[256]; 237 char devinfo[256];
238#if NAGP > 0 238#if NAGP > 0
239 struct agpbus_attach_args apa; 239 struct agpbus_attach_args apa;
240#endif 240#endif
241 volatile unsigned char *python; 241 volatile unsigned char *python;
242 uint32_t v; 242 uint32_t v;
243  243
244 aprint_normal("\n"); 244 aprint_normal("\n");
245 245
246 /* 246 /*
247 * All we do is print out a description. Eventually, we 247 * All we do is print out a description. Eventually, we

cvs diff -r1.9 -r1.10 src/sys/arch/prep/isa/isabeep.c (expand / switch to unified diff)

--- src/sys/arch/prep/isa/isabeep.c 2007/10/17 19:56:50 1.9
+++ src/sys/arch/prep/isa/isabeep.c 2011/06/06 16:42:18 1.10
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: isabeep.c,v 1.9 2007/10/17 19:56:50 garbled Exp $ */ 1/* $NetBSD: isabeep.c,v 1.10 2011/06/06 16:42:18 matt Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1995, 1996 Carnegie-Mellon University. 4 * Copyright (c) 1995, 1996 Carnegie-Mellon University.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Author: Chris G. Demetriou 7 * Author: Chris G. Demetriou
8 *  8 *
9 * Permission to use, copy, modify and distribute this software and 9 * Permission to use, copy, modify and distribute this software and
10 * its documentation is hereby granted, provided that both the copyright 10 * its documentation is hereby granted, provided that both the copyright
11 * notice and this permission notice appear in all copies of the 11 * notice and this permission notice appear in all copies of the
12 * software, derivative works or modified versions, and any portions 12 * software, derivative works or modified versions, and any portions
13 * thereof, and that both notices appear in supporting documentation. 13 * thereof, and that both notices appear in supporting documentation.
14 *  14 *
@@ -18,61 +18,61 @@ @@ -18,61 +18,61 @@
18 *  18 *
19 * Carnegie Mellon requests users of this software to return to 19 * Carnegie Mellon requests users of this software to return to
20 * 20 *
21 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU 21 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
22 * School of Computer Science 22 * School of Computer Science
23 * Carnegie Mellon University 23 * Carnegie Mellon University
24 * Pittsburgh PA 15213-3890 24 * Pittsburgh PA 15213-3890
25 * 25 *
26 * any improvements or extensions that they make and grant Carnegie the 26 * any improvements or extensions that they make and grant Carnegie the
27 * rights to redistribute these changes. 27 * rights to redistribute these changes.
28 */ 28 */
29 29
30#include <sys/cdefs.h> 30#include <sys/cdefs.h>
31__KERNEL_RCSID(0, "$NetBSD: isabeep.c,v 1.9 2007/10/17 19:56:50 garbled Exp $"); 31__KERNEL_RCSID(0, "$NetBSD: isabeep.c,v 1.10 2011/06/06 16:42:18 matt Exp $");
32 32
33#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */ 33#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
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/time.h> 37#include <sys/time.h>
38#include <sys/systm.h> 38#include <sys/systm.h>
39#include <sys/errno.h> 39#include <sys/errno.h>
40#include <sys/device.h> 40#include <sys/device.h>
41#include <uvm/uvm_extern.h> 41#include <uvm/uvm_extern.h>
42 42
43#include <dev/isa/isavar.h> 43#include <dev/isa/isavar.h>
44 44
45#include "pcppi.h" 45#include "pcppi.h"
46#if NPCPPI > 0 46#if NPCPPI > 0
47#include <dev/isa/pcppivar.h> 47#include <dev/isa/pcppivar.h>
48 48
49int isabeepmatch(struct device *, struct cfdata *, void *); 49int isabeepmatch(device_t, cfdata_t, void *);
50void isabeepattach(struct device *, struct device *, void *); 50void isabeepattach(device_t, device_t, void *);
51 51
52CFATTACH_DECL(isabeep, sizeof(struct device), 52CFATTACH_DECL_NEW(isabeep, 0,
53 isabeepmatch, isabeepattach, NULL, NULL); 53 isabeepmatch, isabeepattach, NULL, NULL);
54 54
55static int ppi_attached; 55static int ppi_attached;
56static pcppi_tag_t ppicookie; 56static pcppi_tag_t ppicookie;
57 57
58int 58int
59isabeepmatch(struct device *parent, struct cfdata *match, void *aux) 59isabeepmatch(device_t parent, cfdata_t match, void *aux)
60{ 60{
61 return (!ppi_attached); 61 return (!ppi_attached);
62} 62}
63 63
64void 64void
65isabeepattach(struct device *parent, struct device *self, void *aux) 65isabeepattach(device_t parent, device_t self, void *aux)
66{ 66{
67 aprint_normal("\n"); 67 aprint_normal("\n");
68 68
69 ppicookie = ((struct pcppi_attach_args *)aux)->pa_cookie; 69 ppicookie = ((struct pcppi_attach_args *)aux)->pa_cookie;
70 ppi_attached = 1; 70 ppi_attached = 1;
71} 71}
72#endif 72#endif
73 73
74void 74void
75isabeep(int pitch, int period) 75isabeep(int pitch, int period)
76{ 76{
77#if NPCPPI > 0 77#if NPCPPI > 0
78 if (ppi_attached) 78 if (ppi_attached)

cvs diff -r1.3 -r1.4 src/sys/arch/prep/pci/pceb.c (expand / switch to unified diff)

--- src/sys/arch/prep/pci/pceb.c 2008/04/28 20:23:33 1.3
+++ src/sys/arch/prep/pci/pceb.c 2011/06/06 16:42:18 1.4
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: pceb.c,v 1.3 2008/04/28 20:23:33 martin Exp $ */ 1/* $NetBSD: pceb.c,v 1.4 2011/06/06 16:42:18 matt Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1996, 1998 The NetBSD Foundation, Inc. 4 * Copyright (c) 1996, 1998 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,62 +20,62 @@ @@ -20,62 +20,62 @@
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: pceb.c,v 1.3 2008/04/28 20:23:33 martin Exp $"); 33__KERNEL_RCSID(0, "$NetBSD: pceb.c,v 1.4 2011/06/06 16:42:18 matt 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 <machine/bus.h> 40#include <machine/bus.h>
41 41
42#include <dev/isa/isavar.h> 42#include <dev/isa/isavar.h>
43#include <dev/eisa/eisavar.h> 43#include <dev/eisa/eisavar.h>
44 44
45#include <dev/pci/pcivar.h> 45#include <dev/pci/pcivar.h>
46#include <dev/pci/pcireg.h> 46#include <dev/pci/pcireg.h>
47 47
48#include <dev/pci/pcidevs.h> 48#include <dev/pci/pcidevs.h>
49 49
50#include "eisa.h" 50#include "eisa.h"
51#include "isa.h" 51#include "isa.h"
52 52
53int pcebmatch(struct device *, struct cfdata *, void *); 53int pcebmatch(device_t, cfdata_t, void *);
54void pcebattach(struct device *, struct device *, void *); 54void pcebattach(device_t, device_t, void *);
55 55
56CFATTACH_DECL(pceb, sizeof(struct device), 56CFATTACH_DECL_NEW(pceb, 0,
57 pcebmatch, pcebattach, NULL, NULL); 57 pcebmatch, pcebattach, NULL, NULL);
58 58
59void pceb_callback(struct device *); 59void pceb_callback(device_t);
60 60
61union pceb_attach_args { 61union pceb_attach_args {
62 const char *ea_name; /* XXX should be common */ 62 const char *ea_name; /* XXX should be common */
63 struct isabus_attach_args ea_iba; 63 struct isabus_attach_args ea_iba;
64 struct eisabus_attach_args ea_eba; 64 struct eisabus_attach_args ea_eba;
65}; 65};
66 66
67int 67int
68pcebmatch(struct device *parent, struct cfdata *match, void *aux) 68pcebmatch(device_t parent, cfdata_t match, void *aux)
69{ 69{
70 struct pci_attach_args *pa = aux; 70 struct pci_attach_args *pa = aux;
71 71
72 /* 72 /*
73 * Match anything which claims to be PCI-EISA bridge. 73 * Match anything which claims to be PCI-EISA bridge.
74 */ 74 */
75 if (PCI_CLASS(pa->pa_class) == PCI_CLASS_BRIDGE && 75 if (PCI_CLASS(pa->pa_class) == PCI_CLASS_BRIDGE &&
76 PCI_SUBCLASS(pa->pa_class) == PCI_SUBCLASS_BRIDGE_EISA) 76 PCI_SUBCLASS(pa->pa_class) == PCI_SUBCLASS_BRIDGE_EISA)
77 return (1); 77 return (1);
78 78
79 /* 79 /*
80 * Match some known PCI-EISA bridges explicitly. 80 * Match some known PCI-EISA bridges explicitly.
81 * XXX this is probably not necessary, should be matched by above 81 * XXX this is probably not necessary, should be matched by above
@@ -84,27 +84,27 @@ pcebmatch(struct device *parent, struct  @@ -84,27 +84,27 @@ pcebmatch(struct device *parent, struct
84 switch (PCI_VENDOR(pa->pa_id)) { 84 switch (PCI_VENDOR(pa->pa_id)) {
85 case PCI_VENDOR_INTEL: 85 case PCI_VENDOR_INTEL:
86 switch (PCI_PRODUCT(pa->pa_id)) { 86 switch (PCI_PRODUCT(pa->pa_id)) {
87 case PCI_PRODUCT_INTEL_PCEB: 87 case PCI_PRODUCT_INTEL_PCEB:
88 return (1); 88 return (1);
89 } 89 }
90 break; 90 break;
91 } 91 }
92 92
93 return (0); 93 return (0);
94} 94}
95 95
96void 96void
97pcebattach(struct device *parent, struct device *self, void *aux) 97pcebattach(device_t parent, device_t self, void *aux)
98{ 98{
99 struct pci_attach_args *pa = aux; 99 struct pci_attach_args *pa = aux;
100 char devinfo[256]; 100 char devinfo[256];
101 int error; 101 int error;
102 102
103 aprint_normal("\n"); 103 aprint_normal("\n");
104 104
105 /* 105 /*
106 * Just print out a description and defer configuration 106 * Just print out a description and defer configuration
107 * until all PCI devices have been attached. 107 * until all PCI devices have been attached.
108 */ 108 */
109 pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo)); 109 pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo));
110 aprint_normal("%s: %s (rev. 0x%02x)\n", self->dv_xname, devinfo, 110 aprint_normal("%s: %s (rev. 0x%02x)\n", self->dv_xname, devinfo,
@@ -114,27 +114,27 @@ pcebattach(struct device *parent, struct @@ -114,27 +114,27 @@ pcebattach(struct device *parent, struct
114 error = bus_space_init(&prep_eisa_io_space_tag, "eisa-ioport", NULL, 0); 114 error = bus_space_init(&prep_eisa_io_space_tag, "eisa-ioport", NULL, 0);
115 if (error) 115 if (error)
116 panic("prep_bus_space_init: can't init eisa io tag"); 116 panic("prep_bus_space_init: can't init eisa io tag");
117 117
118 prep_eisa_mem_space_tag.pbs_extent = prep_mem_space_tag.pbs_extent; 118 prep_eisa_mem_space_tag.pbs_extent = prep_mem_space_tag.pbs_extent;
119 error = bus_space_init(&prep_eisa_mem_space_tag, "eisa-iomem", NULL, 0); 119 error = bus_space_init(&prep_eisa_mem_space_tag, "eisa-iomem", NULL, 0);
120 if (error) 120 if (error)
121 panic("prep_bus_space_init: can't init eisa mem tag"); 121 panic("prep_bus_space_init: can't init eisa mem tag");
122 122
123 config_defer(self, pceb_callback); 123 config_defer(self, pceb_callback);
124} 124}
125 125
126void 126void
127pceb_callback(struct device *self) 127pceb_callback(device_t self)
128{ 128{
129 union pceb_attach_args ea; 129 union pceb_attach_args ea;
130 130
131 /* 131 /*
132 * Attach the EISA bus behind this bridge. 132 * Attach the EISA bus behind this bridge.
133 */ 133 */
134 memset(&ea, 0, sizeof(ea)); 134 memset(&ea, 0, sizeof(ea));
135 ea.ea_eba.eba_iot = &prep_eisa_io_space_tag; 135 ea.ea_eba.eba_iot = &prep_eisa_io_space_tag;
136 ea.ea_eba.eba_memt = &prep_eisa_mem_space_tag; 136 ea.ea_eba.eba_memt = &prep_eisa_mem_space_tag;
137#if NEISA > 0 137#if NEISA > 0
138 ea.ea_eba.eba_dmat = &eisa_bus_dma_tag; 138 ea.ea_eba.eba_dmat = &eisa_bus_dma_tag;
139#endif 139#endif
140 config_found_ia(self, "eisabus", &ea.ea_eba, eisabusprint); 140 config_found_ia(self, "eisabus", &ea.ea_eba, eisabusprint);

cvs diff -r1.3 -r1.4 src/sys/arch/sandpoint/sandpoint/eumb.c (expand / switch to unified diff)

--- src/sys/arch/sandpoint/sandpoint/eumb.c 2008/04/28 20:23:34 1.3
+++ src/sys/arch/sandpoint/sandpoint/eumb.c 2011/06/06 16:42:19 1.4
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: eumb.c,v 1.3 2008/04/28 20:23:34 martin Exp $ */ 1/* $NetBSD: eumb.c,v 1.4 2011/06/06 16:42:19 matt Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2007 The NetBSD Foundation, Inc. 4 * Copyright (c) 2007 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 Tohru Nishimura. 8 * by Tohru Nishimura.
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,70 +20,69 @@ @@ -20,70 +20,69 @@
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: eumb.c,v 1.3 2008/04/28 20:23:34 martin Exp $"); 33__KERNEL_RCSID(0, "$NetBSD: eumb.c,v 1.4 2011/06/06 16:42:19 matt Exp $");
34 34
35#include <sys/param.h> 35#include <sys/param.h>
36#include <sys/device.h> 36#include <sys/device.h>
37#include <sys/tty.h> 37#include <sys/tty.h>
38#include <sys/systm.h> 38#include <sys/systm.h>
39 39
40#include <machine/bus.h> 40#include <machine/bus.h>
41#include <machine/intr.h> 41#include <machine/intr.h>
42 42
43#include <sandpoint/sandpoint/eumbvar.h> 43#include <sandpoint/sandpoint/eumbvar.h>
44#include "locators.h" 44#include "locators.h"
45 45
46static int eumb_match(struct device *, struct cfdata *, void *); 46static int eumb_match(device_t, cfdata_t, void *);
47static void eumb_attach(struct device *, struct device *, void *); 47static void eumb_attach(device_t, device_t, void *);
48static int eumb_print(void *, const char *); 48static int eumb_print(void *, const char *);
49static int eumb_search(struct device *, struct cfdata *, const int *, void *); 49static int eumb_search(device_t, cfdata_t, const int *, void *);
50 50
51CFATTACH_DECL(eumb, sizeof(struct device), 51CFATTACH_DECL_NEW(eumb, 0,
52 eumb_match, eumb_attach, NULL, NULL); 52 eumb_match, eumb_attach, NULL, NULL);
53 53
54extern struct cfdriver eumb_cd; 54extern struct cfdriver eumb_cd;
55 55
56static int 56static int
57eumb_match(struct device *parent, struct cfdata *cf, void *aux) 57eumb_match(device_t parent, cfdata_t cf, void *aux)
58{ 58{
59 const char **ca_name = aux; /* XXX */ 59 const char **ca_name = aux; /* XXX */
60 60
61 if (strcmp(*ca_name, eumb_cd.cd_name) != 0) 61 if (strcmp(*ca_name, eumb_cd.cd_name) != 0)
62 return (0); 62 return (0);
63 return (1); 63 return (1);
64} 64}
65 65
66static void 66static void
67eumb_attach(struct device *parent, struct device *self, void *aux) 67eumb_attach(device_t parent, device_t self, void *aux)
68{ 68{
69 69
70 printf("\n"); 70 printf("\n");
71 config_search_ia(eumb_search, self, "eumb", NULL); 71 config_search_ia(eumb_search, self, "eumb", NULL);
72} 72}
73 73
74static int 74static int
75eumb_search(struct device *parent, struct cfdata *cf, 75eumb_search(device_t parent, cfdata_t cf, const int *ldesc, void *aux)
76 const int *ldesc, void *aux) 
77{ 76{
78 struct eumb_attach_args eaa; 77 struct eumb_attach_args eaa;
79 78
80 eaa.eumb_name = cf->cf_name; 79 eaa.eumb_name = cf->cf_name;
81 eaa.eumb_bt = &sandpoint_eumb_space_tag; 80 eaa.eumb_bt = &sandpoint_eumb_space_tag;
82 eaa.eumb_unit = cf->cf_loc[EUMBCF_UNIT]; 81 eaa.eumb_unit = cf->cf_loc[EUMBCF_UNIT];
83 if (config_match(parent, cf, &eaa) > 0) 82 if (config_match(parent, cf, &eaa) > 0)
84 config_attach(parent, cf, &eaa, eumb_print); 83 config_attach(parent, cf, &eaa, eumb_print);
85 84
86 return (0); 85 return (0);
87} 86}
88 87
89static int 88static int