Mon Mar 29 13:14:14 2021 UTC ()
Make VIRTEX_* kernels compile. Not tested.


(rin)
diff -r1.5 -r1.6 src/sys/arch/evbppc/virtex/autoconf.c
diff -r1.3 -r1.4 src/sys/arch/evbppc/virtex/consinit.c
diff -r1.4 -r1.5 src/sys/arch/evbppc/virtex/design_gsrd2.c
diff -r1.25 -r1.26 src/sys/arch/evbppc/virtex/machdep.c
diff -r1.16 -r1.17 src/sys/arch/evbppc/virtex/dev/if_temac.c
diff -r1.4 -r1.5 src/sys/arch/evbppc/virtex/dev/tft_ll.c

cvs diff -r1.5 -r1.6 src/sys/arch/evbppc/virtex/autoconf.c (expand / switch to unified diff)

--- src/sys/arch/evbppc/virtex/autoconf.c 2012/07/29 18:05:42 1.5
+++ src/sys/arch/evbppc/virtex/autoconf.c 2021/03/29 13:14:13 1.6
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: autoconf.c,v 1.5 2012/07/29 18:05:42 mlelstv Exp $ */ 1/* $NetBSD: autoconf.c,v 1.6 2021/03/29 13:14:13 rin 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.
@@ -51,42 +51,42 @@ @@ -51,42 +51,42 @@
51 * THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``AS IS'' AND ANY EXPRESS OR 51 * THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``AS IS'' AND ANY EXPRESS OR
52 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 52 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
53 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 53 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
54 * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 54 * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
55 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 55 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
56 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 56 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
57 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 57 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
58 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 58 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
59 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 59 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
60 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 60 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
61 */ 61 */
62 62
63#include <sys/cdefs.h> 63#include <sys/cdefs.h>
64__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.5 2012/07/29 18:05:42 mlelstv Exp $"); 64__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.6 2021/03/29 13:14:13 rin Exp $");
65 65
66#include <sys/param.h> 66#include <sys/param.h>
67#include <sys/conf.h> 67#include <sys/conf.h>
68#include <sys/cpu.h> 68#include <sys/cpu.h>
69#include <sys/device_if.h> 69#include <sys/device_if.h>
70#include <sys/systm.h> 70#include <sys/systm.h>
71 71
72#include <powerpc/ibm4xx/spr.h> 72#include <powerpc/ibm4xx/spr.h>
73 73
74#include <powerpc/ibm4xx/cpu.h> 74#include <powerpc/ibm4xx/cpu.h>
75#include <powerpc/ibm4xx/dev/plbvar.h> 75#include <powerpc/ibm4xx/dev/plbvar.h>
76 76
77 77
78/* List of port-specific devices to attach to the processor local bus. */ 78/* List of port-specific devices to attach to the processor local bus. */
79static const struct plb_dev local_plb_devs [] = { 79static struct plb_dev local_plb_devs [] = {
80 { XILVIRTEX, "xcvbus" }, 80 { XILVIRTEX, "xcvbus" },
81 { 0, NULL } 81 { 0, NULL }
82}; 82};
83 83
84/* 84/*
85 * Determine device configuration for a machine. 85 * Determine device configuration for a machine.
86 */ 86 */
87void 87void
88cpu_configure(void) 88cpu_configure(void)
89{ 89{
90 intr_init(); 90 intr_init();
91 calc_delayconst(); 91 calc_delayconst();
92 92

cvs diff -r1.3 -r1.4 src/sys/arch/evbppc/virtex/consinit.c (expand / switch to unified diff)

--- src/sys/arch/evbppc/virtex/consinit.c 2011/07/01 19:03:50 1.3
+++ src/sys/arch/evbppc/virtex/consinit.c 2021/03/29 13:14:13 1.4
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: consinit.c,v 1.3 2011/07/01 19:03:50 dyoung Exp $ */ 1/* $NetBSD: consinit.c,v 1.4 2021/03/29 13:14:13 rin 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.
@@ -23,48 +23,47 @@ @@ -23,48 +23,47 @@
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 "opt_cons.h" 32#include "opt_cons.h"
33#include "xlcom.h" 33#include "xlcom.h"
34 34
35#include <sys/cdefs.h> 35#include <sys/cdefs.h>
36__KERNEL_RCSID(0, "$NetBSD: consinit.c,v 1.3 2011/07/01 19:03:50 dyoung Exp $"); 36__KERNEL_RCSID(0, "$NetBSD: consinit.c,v 1.4 2021/03/29 13:14:13 rin Exp $");
37 37
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 41
42#include <sys/bus.h> 42#include <sys/bus.h>
43 43
44#include <evbppc/virtex/virtex.h> 44#include <evbppc/virtex/virtex.h>
45 45
46#include <dev/cons.h> 46#include <dev/cons.h>
47 47
48 48
49#if NXLCOM > 0 49#if NXLCOM > 0
50extern struct consdev consdev_xlcom; 50extern struct consdev consdev_xlcom;
51void xlcom_cninit(struct consdev *, bus_addr_t); 51void xlcom_cninit(struct consdev *, bus_addr_t);
52#if defined(KGDB) 52#if defined(KGDB)
53void xlcom_kgdbinit(void); 53void xlcom_kgdbinit(void);
54#endif 54#endif
55#endif 55#endif
56 56
57struct consdev *cn_tab = NULL; 
58bus_space_tag_t consdev_iot; 57bus_space_tag_t consdev_iot;
59bus_space_handle_t consdev_ioh; 58bus_space_handle_t consdev_ioh;
60 59
61#if defined(KGDB) 60#if defined(KGDB)
62bus_space_tag_t kgdb_iot; 61bus_space_tag_t kgdb_iot;
63bus_space_handle_t kgdb_ioh; 62bus_space_handle_t kgdb_ioh;
64#endif 63#endif
65 64
66 65
67/* 66/*
68 * Initialize the system console (hmm, as if anyone can see those panics). 67 * Initialize the system console (hmm, as if anyone can see those panics).
69 */ 68 */
70void 69void

cvs diff -r1.4 -r1.5 src/sys/arch/evbppc/virtex/design_gsrd2.c (expand / switch to unified diff)

--- src/sys/arch/evbppc/virtex/design_gsrd2.c 2011/06/18 06:44:27 1.4
+++ src/sys/arch/evbppc/virtex/design_gsrd2.c 2021/03/29 13:14:13 1.5
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: design_gsrd2.c,v 1.4 2011/06/18 06:44:27 matt Exp $ */ 1/* $NetBSD: design_gsrd2.c,v 1.5 2021/03/29 13:14:13 rin 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.
@@ -22,27 +22,27 @@ @@ -22,27 +22,27 @@
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 "opt_virtex.h" 32#include "opt_virtex.h"
33 33
34#include <sys/cdefs.h> 34#include <sys/cdefs.h>
35__KERNEL_RCSID(0, "$NetBSD: design_gsrd2.c,v 1.4 2011/06/18 06:44:27 matt Exp $"); 35__KERNEL_RCSID(0, "$NetBSD: design_gsrd2.c,v 1.5 2021/03/29 13:14:13 rin Exp $");
36 36
37#include <sys/param.h> 37#include <sys/param.h>
38#include <sys/systm.h> 38#include <sys/systm.h>
39#include <sys/device.h> 39#include <sys/device.h>
40#include <sys/kernel.h> 40#include <sys/kernel.h>
41#include <sys/malloc.h> 41#include <sys/malloc.h>
42#include <sys/extent.h> 42#include <sys/extent.h>
43#include <sys/cpu.h> 43#include <sys/cpu.h>
44#include <sys/bus.h> 44#include <sys/bus.h>
45#include <sys/intr.h> 45#include <sys/intr.h>
46 46
47#include <machine/powerpc.h> 47#include <machine/powerpc.h>
48#include <machine/tlb.h> 48#include <machine/tlb.h>
@@ -86,26 +86,27 @@ typedef struct cdmac_intrhand { @@ -86,26 +86,27 @@ typedef struct cdmac_intrhand {
86 void (*cih_func)(void *); 86 void (*cih_func)(void *);
87 void *cih_arg; 87 void *cih_arg;
88} *cdmac_intrhand_t; 88} *cdmac_intrhand_t;
89 89
90/* Two instantiated channels, one logical interrupt per direction. */ 90/* Two instantiated channels, one logical interrupt per direction. */
91static struct cdmac_intrhand cdmacintr[CDMAC_NCHAN]; 91static struct cdmac_intrhand cdmacintr[CDMAC_NCHAN];
92static void *cdmac_ih; 92static void *cdmac_ih;
93 93
94 94
95/* 95/*
96 * DCR bus space leaf access routines. 96 * DCR bus space leaf access routines.
97 */ 97 */
98 98
 99#ifndef DESIGN_DFC
99static void 100static void
100tft0_write_4(bus_space_tag_t t, bus_space_handle_t h, uint32_t addr, 101tft0_write_4(bus_space_tag_t t, bus_space_handle_t h, uint32_t addr,
101 uint32_t val) 102 uint32_t val)
102{ 103{
103 addr += h; 104 addr += h;
104 105
105 switch (addr) { 106 switch (addr) {
106 WCASE(DCR_TFT0_BASE, TFT_CTRL); 107 WCASE(DCR_TFT0_BASE, TFT_CTRL);
107 WCASE(DCR_TFT0_BASE, TFT_ADDR); 108 WCASE(DCR_TFT0_BASE, TFT_ADDR);
108 WDEAD(addr); 109 WDEAD(addr);
109 } 110 }
110} 111}
111 112
@@ -114,26 +115,27 @@ tft0_read_4(bus_space_tag_t t, bus_space @@ -114,26 +115,27 @@ tft0_read_4(bus_space_tag_t t, bus_space
114{ 115{
115 uint32_t val; 116 uint32_t val;
116 117
117 addr += h; 118 addr += h;
118 119
119 switch (addr) { 120 switch (addr) {
120 RCASE(DCR_TFT0_BASE, TFT_CTRL); 121 RCASE(DCR_TFT0_BASE, TFT_CTRL);
121 RCASE(DCR_TFT0_BASE, TFT_ADDR); 122 RCASE(DCR_TFT0_BASE, TFT_ADDR);
122 RDEAD(addr); 123 RDEAD(addr);
123 } 124 }
124 125
125 return (val); 126 return (val);
126} 127}
 128#endif /* !DESIGN_DFC */
127 129
128static void 130static void
129tft1_write_4(bus_space_tag_t t, bus_space_handle_t h, uint32_t addr, 131tft1_write_4(bus_space_tag_t t, bus_space_handle_t h, uint32_t addr,
130 uint32_t val) 132 uint32_t val)
131{ 133{
132 addr += h; 134 addr += h;
133 135
134 switch (addr) { 136 switch (addr) {
135 WCASE(DCR_TFT1_BASE, TFT_CTRL); 137 WCASE(DCR_TFT1_BASE, TFT_CTRL);
136 WCASE(DCR_TFT0_BASE, TFT_ADDR); 138 WCASE(DCR_TFT0_BASE, TFT_ADDR);
137 WDEAD(addr); 139 WDEAD(addr);
138 } 140 }
139} 141}
@@ -222,29 +224,31 @@ temac_read_4(bus_space_tag_t t, bus_spac @@ -222,29 +224,31 @@ temac_read_4(bus_space_tag_t t, bus_spac
222 } 224 }
223 225
224 return (val); 226 return (val);
225} 227}
226 228
227static const struct powerpc_bus_space cdmac_bst = { 229static const struct powerpc_bus_space cdmac_bst = {
228 DCR_BST_BODY(DCR_CDMAC_BASE, cdmac_read_4, cdmac_write_4) 230 DCR_BST_BODY(DCR_CDMAC_BASE, cdmac_read_4, cdmac_write_4)
229}; 231};
230 232
231static const struct powerpc_bus_space temac_bst = { 233static const struct powerpc_bus_space temac_bst = {
232 DCR_BST_BODY(DCR_TEMAC_BASE, temac_read_4, temac_write_4) 234 DCR_BST_BODY(DCR_TEMAC_BASE, temac_read_4, temac_write_4)
233}; 235};
234 236
 237#ifndef DESIGN_DFC
235static const struct powerpc_bus_space tft0_bst = { 238static const struct powerpc_bus_space tft0_bst = {
236 DCR_BST_BODY(DCR_TFT0_BASE, tft0_read_4, tft0_write_4) 239 DCR_BST_BODY(DCR_TFT0_BASE, tft0_read_4, tft0_write_4)
237}; 240};
 241#endif
238 242
239static const struct powerpc_bus_space tft1_bst = { 243static const struct powerpc_bus_space tft1_bst = {
240 DCR_BST_BODY(DCR_TFT1_BASE, tft1_read_4, tft1_write_4) 244 DCR_BST_BODY(DCR_TFT1_BASE, tft1_read_4, tft1_write_4)
241}; 245};
242 246
243static struct powerpc_bus_space opb_bst = { 247static struct powerpc_bus_space opb_bst = {
244 .pbs_flags = _BUS_SPACE_BIG_ENDIAN|_BUS_SPACE_MEM_TYPE, 248 .pbs_flags = _BUS_SPACE_BIG_ENDIAN|_BUS_SPACE_MEM_TYPE,
245 .pbs_base = 0 /*OPB_BASE*/, 249 .pbs_base = 0 /*OPB_BASE*/,
246 .pbs_offset = OPB_BASE, 250 .pbs_offset = OPB_BASE,
247}; 251};
248 252
249static char opb_extent_storage[EXTENT_FIXED_STORAGE_SIZE(8)] __aligned(8); 253static char opb_extent_storage[EXTENT_FIXED_STORAGE_SIZE(8)] __aligned(8);
250 254

cvs diff -r1.25 -r1.26 src/sys/arch/evbppc/virtex/machdep.c (expand / switch to unified diff)

--- src/sys/arch/evbppc/virtex/machdep.c 2020/06/11 19:20:43 1.25
+++ src/sys/arch/evbppc/virtex/machdep.c 2021/03/29 13:14:13 1.26
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: machdep.c,v 1.25 2020/06/11 19:20:43 ad Exp $ */ 1/* $NetBSD: machdep.c,v 1.26 2021/03/29 13:14:13 rin 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.
@@ -24,27 +24,27 @@ @@ -24,27 +24,27 @@
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/* 32/*
33 * Based on Walnut and Explora. 33 * Based on Walnut and Explora.
34 */ 34 */
35 35
36#include <sys/cdefs.h> 36#include <sys/cdefs.h>
37__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.25 2020/06/11 19:20:43 ad Exp $"); 37__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.26 2021/03/29 13:14:13 rin Exp $");
38 38
39#include "opt_compat_netbsd.h" 39#include "opt_compat_netbsd.h"
40#include "opt_ddb.h" 40#include "opt_ddb.h"
41#include "opt_virtex.h" 41#include "opt_virtex.h"
42#include "opt_kgdb.h" 42#include "opt_kgdb.h"
43 43
44#include <sys/param.h> 44#include <sys/param.h>
45#include <sys/boot_flag.h> 45#include <sys/boot_flag.h>
46#include <sys/buf.h> 46#include <sys/buf.h>
47#include <sys/bus.h> 47#include <sys/bus.h>
48#include <sys/device.h> 48#include <sys/device.h>
49#include <sys/exec.h> 49#include <sys/exec.h>
50#include <sys/malloc.h> 50#include <sys/malloc.h>
@@ -90,27 +90,26 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v  @@ -90,27 +90,26 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v
90 90
91/* 91/*
92 * Global variables used here and there 92 * Global variables used here and there
93 */ 93 */
94struct vm_map *phys_map = NULL; 94struct vm_map *phys_map = NULL;
95 95
96/* 96/*
97 * This should probably be in autoconf! XXX 97 * This should probably be in autoconf! XXX
98 */ 98 */
99char machine[] = MACHINE; /* from <machine/param.h> */ 99char machine[] = MACHINE; /* from <machine/param.h> */
100char machine_arch[] = MACHINE_ARCH; /* from <machine/param.h> */ 100char machine_arch[] = MACHINE_ARCH; /* from <machine/param.h> */
101 101
102char bootpath[256]; 102char bootpath[256];
103vaddr_t msgbuf_vaddr; 
104 103
105void initppc(vaddr_t, vaddr_t); 104void initppc(vaddr_t, vaddr_t);
106 105
107static void dumpsys(void); 106static void dumpsys(void);
108 107
109/* BSS segment start & end. */ 108/* BSS segment start & end. */
110extern char edata[], end[]; 109extern char edata[], end[];
111 110
112/* One region holds all memory, the other is terminator expected by 405 pmap. */ 111/* One region holds all memory, the other is terminator expected by 405 pmap. */
113#define MEMREGIONS 2 112#define MEMREGIONS 2
114struct mem_region physmemr[MEMREGIONS]; 113struct mem_region physmemr[MEMREGIONS];
115struct mem_region availmemr[MEMREGIONS]; 114struct mem_region availmemr[MEMREGIONS];
116 115

cvs diff -r1.16 -r1.17 src/sys/arch/evbppc/virtex/dev/if_temac.c (expand / switch to unified diff)

--- src/sys/arch/evbppc/virtex/dev/if_temac.c 2020/02/04 07:36:04 1.16
+++ src/sys/arch/evbppc/virtex/dev/if_temac.c 2021/03/29 13:14:13 1.17
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: if_temac.c,v 1.16 2020/02/04 07:36:04 skrll Exp $ */ 1/* $NetBSD: if_temac.c,v 1.17 2021/03/29 13:14:13 rin 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.
@@ -30,27 +30,27 @@ @@ -30,27 +30,27 @@
30 */ 30 */
31 31
32/* 32/*
33 * Driver for Xilinx LocalLink TEMAC as wired on the GSRD platform. 33 * Driver for Xilinx LocalLink TEMAC as wired on the GSRD platform.
34 * 34 *
35 * TODO: 35 * TODO:
36 * - Optimize 36 * - Optimize
37 * - Checksum offload 37 * - Checksum offload
38 * - Address filters 38 * - Address filters
39 * - Support jumbo frames 39 * - Support jumbo frames
40 */ 40 */
41 41
42#include <sys/cdefs.h> 42#include <sys/cdefs.h>
43__KERNEL_RCSID(0, "$NetBSD: if_temac.c,v 1.16 2020/02/04 07:36:04 skrll Exp $"); 43__KERNEL_RCSID(0, "$NetBSD: if_temac.c,v 1.17 2021/03/29 13:14:13 rin Exp $");
44 44
45 45
46#include <sys/param.h> 46#include <sys/param.h>
47#include <sys/systm.h> 47#include <sys/systm.h>
48#include <sys/mbuf.h> 48#include <sys/mbuf.h>
49#include <sys/kernel.h> 49#include <sys/kernel.h>
50#include <sys/socket.h> 50#include <sys/socket.h>
51#include <sys/ioctl.h> 51#include <sys/ioctl.h>
52#include <sys/device.h> 52#include <sys/device.h>
53#include <sys/bus.h> 53#include <sys/bus.h>
54#include <sys/cpu.h> 54#include <sys/cpu.h>
55 55
56#include <uvm/uvm_extern.h> 56#include <uvm/uvm_extern.h>
@@ -220,27 +220,27 @@ static inline void temac_txcdsync(struc @@ -220,27 +220,27 @@ static inline void temac_txcdsync(struc
220static void temac_txreap(struct temac_softc *); 220static void temac_txreap(struct temac_softc *);
221static void temac_rxreap(struct temac_softc *); 221static void temac_rxreap(struct temac_softc *);
222static int temac_rxalloc(struct temac_softc *, int, int); 222static int temac_rxalloc(struct temac_softc *, int, int);
223static void temac_rxtimo(void *); 223static void temac_rxtimo(void *);
224static void temac_rxdrain(struct temac_softc *); 224static void temac_rxdrain(struct temac_softc *);
225static void temac_reset(struct temac_softc *); 225static void temac_reset(struct temac_softc *);
226static void temac_txkick(struct temac_softc *); 226static void temac_txkick(struct temac_softc *);
227 227
228/* Register access. */ 228/* Register access. */
229static inline void gmi_write_8(uint32_t, uint32_t, uint32_t); 229static inline void gmi_write_8(uint32_t, uint32_t, uint32_t);
230static inline void gmi_write_4(uint32_t, uint32_t); 230static inline void gmi_write_4(uint32_t, uint32_t);
231static inline void gmi_read_8(uint32_t, uint32_t *, uint32_t *); 231static inline void gmi_read_8(uint32_t, uint32_t *, uint32_t *);
232static inline uint32_t gmi_read_4(uint32_t); 232static inline uint32_t gmi_read_4(uint32_t);
233static inline void hif_wait_stat(uint32_t); 233static inline int hif_wait_stat(uint32_t);
234 234
235#define cdmac_rx_stat(sc) \ 235#define cdmac_rx_stat(sc) \
236 bus_space_read_4((sc)->sc_dma_rxt, (sc)->sc_dma_rsh, 0 /* XXX hack */) 236 bus_space_read_4((sc)->sc_dma_rxt, (sc)->sc_dma_rsh, 0 /* XXX hack */)
237 237
238#define cdmac_rx_reset(sc) \ 238#define cdmac_rx_reset(sc) \
239 bus_space_write_4((sc)->sc_dma_rxt, (sc)->sc_dma_rsh, 0, CDMAC_STAT_RESET) 239 bus_space_write_4((sc)->sc_dma_rxt, (sc)->sc_dma_rsh, 0, CDMAC_STAT_RESET)
240 240
241#define cdmac_rx_start(sc, val) \ 241#define cdmac_rx_start(sc, val) \
242 bus_space_write_4((sc)->sc_dma_rxt, (sc)->sc_dma_rxh, CDMAC_CURDESC, (val)) 242 bus_space_write_4((sc)->sc_dma_rxt, (sc)->sc_dma_rxh, CDMAC_CURDESC, (val))
243 243
244#define cdmac_tx_stat(sc) \ 244#define cdmac_tx_stat(sc) \
245 bus_space_read_4((sc)->sc_dma_txt, (sc)->sc_dma_tsh, 0 /* XXX hack */) 245 bus_space_read_4((sc)->sc_dma_txt, (sc)->sc_dma_tsh, 0 /* XXX hack */)
246 246
@@ -1019,27 +1019,27 @@ temac_txreap(struct temac_softc *sc) @@ -1019,27 +1019,27 @@ temac_txreap(struct temac_softc *sc)
1019 * XXX we rely on that we make EXACTLY one batch per intr, no more 1019 * XXX we rely on that we make EXACTLY one batch per intr, no more
1020 */ 1020 */
1021 while (sc->sc_txsfree != TEMAC_TXQLEN) { 1021 while (sc->sc_txsfree != TEMAC_TXQLEN) {
1022 txs = &sc->sc_txsoft[sc->sc_txsreap]; 1022 txs = &sc->sc_txsoft[sc->sc_txsreap];
1023 dmap = txs->txs_dmap; 1023 dmap = txs->txs_dmap;
1024 1024
1025 sc->sc_txreap = TEMAC_TXINC(sc->sc_txreap, dmap->dm_nsegs); 1025 sc->sc_txreap = TEMAC_TXINC(sc->sc_txreap, dmap->dm_nsegs);
1026 sc->sc_txfree += dmap->dm_nsegs; 1026 sc->sc_txfree += dmap->dm_nsegs;
1027 1027
1028 bus_dmamap_unload(sc->sc_dmat, txs->txs_dmap); 1028 bus_dmamap_unload(sc->sc_dmat, txs->txs_dmap);
1029 m_freem(txs->txs_mbuf); 1029 m_freem(txs->txs_mbuf);
1030 txs->txs_mbuf = NULL; 1030 txs->txs_mbuf = NULL;
1031 1031
1032 sc->sc_if.if_opackets++; 1032 if_statinc(&sc->sc_if, if_opackets);
1033 sent = 1; 1033 sent = 1;
1034 1034
1035 sc->sc_txsreap = TEMAC_TXSNEXT(sc->sc_txsreap); 1035 sc->sc_txsreap = TEMAC_TXSNEXT(sc->sc_txsreap);
1036 sc->sc_txsfree++; 1036 sc->sc_txsfree++;
1037 1037
1038 if (txs->txs_last) { 1038 if (txs->txs_last) {
1039 txs->txs_last = 0; 1039 txs->txs_last = 0;
1040 sc->sc_txbusy = 0; /* channel stopped now */ 1040 sc->sc_txbusy = 0; /* channel stopped now */
1041 1041
1042 temac_txkick(sc); 1042 temac_txkick(sc);
1043 break; 1043 break;
1044 } 1044 }
1045 } 1045 }

cvs diff -r1.4 -r1.5 src/sys/arch/evbppc/virtex/dev/tft_ll.c (expand / switch to unified diff)

--- src/sys/arch/evbppc/virtex/dev/tft_ll.c 2011/07/01 19:03:50 1.4
+++ src/sys/arch/evbppc/virtex/dev/tft_ll.c 2021/03/29 13:14:13 1.5
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: tft_ll.c,v 1.4 2011/07/01 19:03:50 dyoung Exp $ */ 1/* $NetBSD: tft_ll.c,v 1.5 2021/03/29 13:14:13 rin 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,27 +20,27 @@ @@ -20,27 +20,27 @@
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: tft_ll.c,v 1.4 2011/07/01 19:03:50 dyoung Exp $"); 33__KERNEL_RCSID(0, "$NetBSD: tft_ll.c,v 1.5 2021/03/29 13:14:13 rin 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/mbuf.h> 37#include <sys/mbuf.h>
38#include <sys/kernel.h> 38#include <sys/kernel.h>
39#include <sys/socket.h> 39#include <sys/socket.h>
40#include <sys/ioctl.h> 40#include <sys/ioctl.h>
41#include <sys/device.h> 41#include <sys/device.h>
42#include <sys/queue.h> 42#include <sys/queue.h>
43 43
44#include <uvm/uvm_extern.h> 44#include <uvm/uvm_extern.h>
45 45
46#include <sys/bus.h> 46#include <sys/bus.h>
@@ -50,27 +50,29 @@ __KERNEL_RCSID(0, "$NetBSD: tft_ll.c,v 1 @@ -50,27 +50,29 @@ __KERNEL_RCSID(0, "$NetBSD: tft_ll.c,v 1
50#include <dev/wscons/wsconsio.h> 50#include <dev/wscons/wsconsio.h>
51#include <dev/rasops/rasops.h> 51#include <dev/rasops/rasops.h>
52#include <dev/wscons/wsdisplay_vconsvar.h> 52#include <dev/wscons/wsdisplay_vconsvar.h>
53 53
54#include <evbppc/virtex/dev/xcvbusvar.h> 54#include <evbppc/virtex/dev/xcvbusvar.h>
55#include <evbppc/virtex/dev/cdmacreg.h> 55#include <evbppc/virtex/dev/cdmacreg.h>
56#include <evbppc/virtex/dev/tftreg.h> 56#include <evbppc/virtex/dev/tftreg.h>
57#include <evbppc/virtex/dev/tftvar.h> 57#include <evbppc/virtex/dev/tftvar.h>
58 58
59 59
60struct ll_tft_control { 60struct ll_tft_control {
61 struct cdmac_descr cd_dsc; 61 struct cdmac_descr cd_dsc;
62 u_char cd_img[]; 62 u_char cd_img[];
63} __packed; 63};
 64
 65CTASSERT(offsetof(struct ll_tft_control, cd_img) == sizeof(struct cdmac_descr));
64 66
65struct ll_tft_softc { 67struct ll_tft_softc {
66 struct tft_softc lsc_sc; 68 struct tft_softc lsc_sc;
67 69
68 bus_space_tag_t lsc_dma_iot; 70 bus_space_tag_t lsc_dma_iot;
69 bus_space_handle_t lsc_dma_ioh; 71 bus_space_handle_t lsc_dma_ioh;
70 72
71 bus_dma_tag_t lsc_dmat; 73 bus_dma_tag_t lsc_dmat;
72 bus_dmamap_t lsc_dmap; 74 bus_dmamap_t lsc_dmap;
73 75
74 struct ll_tft_control *lsc_cd; 76 struct ll_tft_control *lsc_cd;
75 bus_dma_segment_t lsc_seg; 77 bus_dma_segment_t lsc_seg;
76}; 78};