u_intNN_t -> uintNN_t "same" code before and after.diff -r1.13 -r1.14 src/sys/arch/hp700/dev/asp.c
(skrll)
--- src/sys/arch/hp700/dev/Attic/asp.c 2009/05/08 09:33:57 1.13
+++ src/sys/arch/hp700/dev/Attic/asp.c 2009/05/24 06:53:34 1.14
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: asp.c,v 1.13 2009/05/08 09:33:57 skrll Exp $ */ | 1 | /* $NetBSD: asp.c,v 1.14 2009/05/24 06:53:34 skrll Exp $ */ | |
2 | 2 | |||
3 | /* $OpenBSD: asp.c,v 1.5 2000/02/09 05:04:22 mickey Exp $ */ | 3 | /* $OpenBSD: asp.c,v 1.5 2000/02/09 05:04:22 mickey Exp $ */ | |
4 | 4 | |||
5 | /* | 5 | /* | |
6 | * Copyright (c) 1998,1999 Michael Shalayeff | 6 | * Copyright (c) 1998,1999 Michael Shalayeff | |
7 | * All rights reserved. | 7 | * All rights reserved. | |
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 | |
@@ -31,63 +31,63 @@ | @@ -31,63 +31,63 @@ | |||
31 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 31 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | |
32 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 32 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
33 | */ | 33 | */ | |
34 | 34 | |||
35 | /* | 35 | /* | |
36 | * References: | 36 | * References: | |
37 | * | 37 | * | |
38 | * 1. Cobra/Coral I/O Subsystem External Reference Specification | 38 | * 1. Cobra/Coral I/O Subsystem External Reference Specification | |
39 | * Hewlett-Packard | 39 | * Hewlett-Packard | |
40 | * | 40 | * | |
41 | */ | 41 | */ | |
42 | 42 | |||
43 | #include <sys/cdefs.h> | 43 | #include <sys/cdefs.h> | |
44 | __KERNEL_RCSID(0, "$NetBSD: asp.c,v 1.13 2009/05/08 09:33:57 skrll Exp $"); | 44 | __KERNEL_RCSID(0, "$NetBSD: asp.c,v 1.14 2009/05/24 06:53:34 skrll Exp $"); | |
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/device.h> | 48 | #include <sys/device.h> | |
49 | #include <sys/reboot.h> | 49 | #include <sys/reboot.h> | |
50 | 50 | |||
51 | #include <machine/bus.h> | 51 | #include <machine/bus.h> | |
52 | #include <machine/iomod.h> | 52 | #include <machine/iomod.h> | |
53 | #include <machine/autoconf.h> | 53 | #include <machine/autoconf.h> | |
54 | #include <machine/cpufunc.h> | 54 | #include <machine/cpufunc.h> | |
55 | 55 | |||
56 | #include <hp700/hp700/machdep.h> | 56 | #include <hp700/hp700/machdep.h> | |
57 | #include <hp700/dev/cpudevs.h> | 57 | #include <hp700/dev/cpudevs.h> | |
58 | #include <hp700/dev/viper.h> | 58 | #include <hp700/dev/viper.h> | |
59 | 59 | |||
60 | #include <hp700/gsc/gscbusvar.h> | 60 | #include <hp700/gsc/gscbusvar.h> | |
61 | 61 | |||
62 | struct asp_hwr { | 62 | struct asp_hwr { | |
63 | u_int8_t asp_reset; | 63 | uint8_t asp_reset; | |
64 | u_int8_t asp_resv[31]; | 64 | uint8_t asp_resv[31]; | |
65 | u_int8_t asp_version; | 65 | uint8_t asp_version; | |
66 | u_int8_t asp_resv1[15]; | 66 | uint8_t asp_resv1[15]; | |
67 | u_int8_t asp_scsidsync; | 67 | uint8_t asp_scsidsync; | |
68 | u_int8_t asp_resv2[15]; | 68 | uint8_t asp_resv2[15]; | |
69 | u_int8_t asp_error; | 69 | uint8_t asp_error; | |
70 | }; | 70 | }; | |
71 | 71 | |||
72 | struct asp_trs { | 72 | struct asp_trs { | |
73 | u_int32_t asp_irr; | 73 | uint32_t asp_irr; | |
74 | u_int32_t asp_imr; | 74 | uint32_t asp_imr; | |
75 | u_int32_t asp_ipr; | 75 | uint32_t asp_ipr; | |
76 | u_int32_t asp_icr; | 76 | uint32_t asp_icr; | |
77 | u_int32_t asp_iar; | 77 | uint32_t asp_iar; | |
78 | u_int32_t asp_resv[3]; | 78 | uint32_t asp_resv[3]; | |
79 | u_int8_t asp_cled; | 79 | uint8_t asp_cled; | |
80 | u_int8_t asp_resv1[3]; | 80 | uint8_t asp_resv1[3]; | |
81 | struct { | 81 | struct { | |
82 | u_int :20, | 82 | u_int :20, | |
83 | asp_spu : 3, /* SPU ID board jumper */ | 83 | asp_spu : 3, /* SPU ID board jumper */ | |
84 | #define ASP_SPUCOBRA 0 | 84 | #define ASP_SPUCOBRA 0 | |
85 | #define ASP_SPUCORAL 1 | 85 | #define ASP_SPUCORAL 1 | |
86 | #define ASP_SPUBUSH 2 | 86 | #define ASP_SPUBUSH 2 | |
87 | #define ASP_SPUHARDBALL 3 | 87 | #define ASP_SPUHARDBALL 3 | |
88 | #define ASP_SPUSCORPIO 4 | 88 | #define ASP_SPUSCORPIO 4 | |
89 | #define ASP_SPUCORAL2 5 | 89 | #define ASP_SPUCORAL2 5 | |
90 | asp_sw : 1, /* front switch is normal */ | 90 | asp_sw : 1, /* front switch is normal */ | |
91 | asp_clk : 1, /* SCSI clock is doubled */ | 91 | asp_clk : 1, /* SCSI clock is doubled */ | |
92 | asp_lan : 2, /* LAN iface selector */ | 92 | asp_lan : 2, /* LAN iface selector */ | |
93 | #define ASP_LANINVAL 0 | 93 | #define ASP_LANINVAL 0 |
--- src/sys/arch/hp700/dev/Attic/lasi.c 2009/05/07 15:34:49 1.13
+++ src/sys/arch/hp700/dev/Attic/lasi.c 2009/05/24 06:53:34 1.14
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: lasi.c,v 1.13 2009/05/07 15:34:49 skrll Exp $ */ | 1 | /* $NetBSD: lasi.c,v 1.14 2009/05/24 06:53:34 skrll Exp $ */ | |
2 | 2 | |||
3 | /* $OpenBSD: lasi.c,v 1.4 2001/06/09 03:57:19 mickey Exp $ */ | 3 | /* $OpenBSD: lasi.c,v 1.4 2001/06/09 03:57:19 mickey Exp $ */ | |
4 | 4 | |||
5 | /* | 5 | /* | |
6 | * Copyright (c) 1998,1999 Michael Shalayeff | 6 | * Copyright (c) 1998,1999 Michael Shalayeff | |
7 | * All rights reserved. | 7 | * All rights reserved. | |
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 | |
@@ -23,59 +23,59 @@ | @@ -23,59 +23,59 @@ | |||
23 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR | 23 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR | |
24 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | 24 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |
25 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | 25 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | |
26 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | 26 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | |
27 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | 27 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | |
28 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 28 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
29 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 29 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
30 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 30 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
31 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 31 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | |
32 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 32 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
33 | */ | 33 | */ | |
34 | 34 | |||
35 | #include <sys/cdefs.h> | 35 | #include <sys/cdefs.h> | |
36 | __KERNEL_RCSID(0, "$NetBSD: lasi.c,v 1.13 2009/05/07 15:34:49 skrll Exp $"); | 36 | __KERNEL_RCSID(0, "$NetBSD: lasi.c,v 1.14 2009/05/24 06:53:34 skrll Exp $"); | |
37 | 37 | |||
38 | #undef LASIDEBUG | 38 | #undef LASIDEBUG | |
39 | 39 | |||
40 | #include <sys/param.h> | 40 | #include <sys/param.h> | |
41 | #include <sys/systm.h> | 41 | #include <sys/systm.h> | |
42 | #include <sys/device.h> | 42 | #include <sys/device.h> | |
43 | #include <sys/reboot.h> | 43 | #include <sys/reboot.h> | |
44 | 44 | |||
45 | #include <machine/bus.h> | 45 | #include <machine/bus.h> | |
46 | #include <machine/iomod.h> | 46 | #include <machine/iomod.h> | |
47 | #include <machine/autoconf.h> | 47 | #include <machine/autoconf.h> | |
48 | 48 | |||
49 | #include <hp700/dev/cpudevs.h> | 49 | #include <hp700/dev/cpudevs.h> | |
50 | 50 | |||
51 | #include <hp700/gsc/gscbusvar.h> | 51 | #include <hp700/gsc/gscbusvar.h> | |
52 | 52 | |||
53 | struct lasi_hwr { | 53 | struct lasi_hwr { | |
54 | u_int32_t lasi_power; | 54 | uint32_t lasi_power; | |
55 | #define LASI_BLINK 0x01 | 55 | #define LASI_BLINK 0x01 | |
56 | #define LASI_OFF 0x02 | 56 | #define LASI_OFF 0x02 | |
57 | u_int32_t lasi_error; | 57 | uint32_t lasi_error; | |
58 | u_int32_t lasi_version; | 58 | uint32_t lasi_version; | |
59 | u_int32_t lasi_reset; | 59 | uint32_t lasi_reset; | |
60 | u_int32_t lasi_arbmask; | 60 | uint32_t lasi_arbmask; | |
61 | }; | 61 | }; | |
62 | 62 | |||
63 | struct lasi_trs { | 63 | struct lasi_trs { | |
64 | u_int32_t lasi_irr; /* int requset register */ | 64 | uint32_t lasi_irr; /* int requset register */ | |
65 | u_int32_t lasi_imr; /* int mask register */ | 65 | uint32_t lasi_imr; /* int mask register */ | |
66 | u_int32_t lasi_ipr; /* int pending register */ | 66 | uint32_t lasi_ipr; /* int pending register */ | |
67 | u_int32_t lasi_icr; /* int command? register */ | 67 | uint32_t lasi_icr; /* int command? register */ | |
68 | u_int32_t lasi_iar; /* int acquire? register */ | 68 | uint32_t lasi_iar; /* int acquire? register */ | |
69 | }; | 69 | }; | |
70 | 70 | |||
71 | #define LASI_BANK_SZ 0x200000 | 71 | #define LASI_BANK_SZ 0x200000 | |
72 | #define LASI_REG_INT 0x100000 | 72 | #define LASI_REG_INT 0x100000 | |
73 | #define LASI_REG_MISC 0x10c000 | 73 | #define LASI_REG_MISC 0x10c000 | |
74 | 74 | |||
75 | struct lasi_softc { | 75 | struct lasi_softc { | |
76 | device_t sc_dev; | 76 | device_t sc_dev; | |
77 | 77 | |||
78 | struct hp700_int_reg sc_int_reg; | 78 | struct hp700_int_reg sc_int_reg; | |
79 | 79 | |||
80 | struct lasi_hwr volatile *sc_hw; | 80 | struct lasi_hwr volatile *sc_hw; | |
81 | struct lasi_trs volatile *sc_trs; | 81 | struct lasi_trs volatile *sc_trs; |
--- src/sys/arch/hp700/dev/Attic/dino.c 2009/05/11 06:10:30 1.12
+++ src/sys/arch/hp700/dev/Attic/dino.c 2009/05/24 06:53:34 1.13
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: dino.c,v 1.12 2009/05/11 06:10:30 skrll Exp $ */ | 1 | /* $NetBSD: dino.c,v 1.13 2009/05/24 06:53:34 skrll Exp $ */ | |
2 | 2 | |||
3 | /* $OpenBSD: dino.c,v 1.5 2004/02/13 20:39:31 mickey Exp $ */ | 3 | /* $OpenBSD: dino.c,v 1.5 2004/02/13 20:39:31 mickey Exp $ */ | |
4 | 4 | |||
5 | /* | 5 | /* | |
6 | * Copyright (c) 2003 Michael Shalayeff | 6 | * Copyright (c) 2003 Michael Shalayeff | |
7 | * All rights reserved. | 7 | * All rights reserved. | |
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 | |
@@ -19,27 +19,27 @@ | @@ -19,27 +19,27 @@ | |||
19 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | 19 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |
20 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | 20 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | |
21 | * IN NO EVENT SHALL THE AUTHOR OR HIS RELATIVES BE LIABLE FOR ANY DIRECT, | 21 | * IN NO EVENT SHALL THE AUTHOR OR HIS RELATIVES BE LIABLE FOR ANY DIRECT, | |
22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 22 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | |
23 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | 23 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |
24 | * SERVICES; LOSS OF MIND, USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | 24 | * SERVICES; LOSS OF MIND, USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
25 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | 25 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | |
26 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING | 26 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING | |
27 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF | 27 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF | |
28 | * THE POSSIBILITY OF SUCH DAMAGE. | 28 | * THE POSSIBILITY OF SUCH DAMAGE. | |
29 | */ | 29 | */ | |
30 | 30 | |||
31 | #include <sys/cdefs.h> | 31 | #include <sys/cdefs.h> | |
32 | __KERNEL_RCSID(0, "$NetBSD: dino.c,v 1.12 2009/05/11 06:10:30 skrll Exp $"); | 32 | __KERNEL_RCSID(0, "$NetBSD: dino.c,v 1.13 2009/05/24 06:53:34 skrll Exp $"); | |
33 | 33 | |||
34 | /* #include "cardbus.h" */ | 34 | /* #include "cardbus.h" */ | |
35 | 35 | |||
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 | #include <sys/reboot.h> | 39 | #include <sys/reboot.h> | |
40 | #include <sys/malloc.h> | 40 | #include <sys/malloc.h> | |
41 | #include <sys/extent.h> | 41 | #include <sys/extent.h> | |
42 | 42 | |||
43 | #include <machine/iomod.h> | 43 | #include <machine/iomod.h> | |
44 | #include <machine/autoconf.h> | 44 | #include <machine/autoconf.h> | |
45 | #include <machine/intr.h> | 45 | #include <machine/intr.h> | |
@@ -52,68 +52,68 @@ __KERNEL_RCSID(0, "$NetBSD: dino.c,v 1.1 | @@ -52,68 +52,68 @@ __KERNEL_RCSID(0, "$NetBSD: dino.c,v 1.1 | |||
52 | #include <dev/cardbus/rbus.h> | 52 | #include <dev/cardbus/rbus.h> | |
53 | #endif | 53 | #endif | |
54 | 54 | |||
55 | #include <dev/pci/pcireg.h> | 55 | #include <dev/pci/pcireg.h> | |
56 | #include <dev/pci/pcivar.h> | 56 | #include <dev/pci/pcivar.h> | |
57 | #include <dev/pci/pcidevs.h> | 57 | #include <dev/pci/pcidevs.h> | |
58 | 58 | |||
59 | #define DINO_MEM_CHUNK 0x800000 | 59 | #define DINO_MEM_CHUNK 0x800000 | |
60 | 60 | |||
61 | /* from machdep.c */ | 61 | /* from machdep.c */ | |
62 | extern struct extent *hp700_io_extent; | 62 | extern struct extent *hp700_io_extent; | |
63 | 63 | |||
64 | struct dino_regs { | 64 | struct dino_regs { | |
65 | u_int32_t pad0; /* 0x000 */ | 65 | uint32_t pad0; /* 0x000 */ | |
66 | u_int32_t iar0; /* 0x004 rw intr addr reg 0 */ | 66 | uint32_t iar0; /* 0x004 rw intr addr reg 0 */ | |
67 | u_int32_t iodc; /* 0x008 rw iodc data/addr */ | 67 | uint32_t iodc; /* 0x008 rw iodc data/addr */ | |
68 | u_int32_t irr0; /* 0x00c r intr req reg 0 */ | 68 | uint32_t irr0; /* 0x00c r intr req reg 0 */ | |
69 | u_int32_t iar1; /* 0x010 rw intr addr reg 1 */ | 69 | uint32_t iar1; /* 0x010 rw intr addr reg 1 */ | |
70 | u_int32_t irr1; /* 0x014 r intr req reg 1 */ | 70 | uint32_t irr1; /* 0x014 r intr req reg 1 */ | |
71 | u_int32_t imr; /* 0x018 rw intr mask reg */ | 71 | uint32_t imr; /* 0x018 rw intr mask reg */ | |
72 | u_int32_t ipr; /* 0x01c rw intr pending reg */ | 72 | uint32_t ipr; /* 0x01c rw intr pending reg */ | |
73 | u_int32_t toc_addr; /* 0x020 rw TOC addr reg */ | 73 | uint32_t toc_addr; /* 0x020 rw TOC addr reg */ | |
74 | u_int32_t icr; /* 0x024 rw intr control reg */ | 74 | uint32_t icr; /* 0x024 rw intr control reg */ | |
75 | u_int32_t ilr; /* 0x028 r intr level reg */ | 75 | uint32_t ilr; /* 0x028 r intr level reg */ | |
76 | u_int32_t pad1; /* 0x02c */ | 76 | uint32_t pad1; /* 0x02c */ | |
77 | u_int32_t io_command; /* 0x030 w command register */ | 77 | uint32_t io_command; /* 0x030 w command register */ | |
78 | u_int32_t io_status; /* 0x034 r status register */ | 78 | uint32_t io_status; /* 0x034 r status register */ | |
79 | u_int32_t io_control; /* 0x038 rw control register */ | 79 | uint32_t io_control; /* 0x038 rw control register */ | |
80 | u_int32_t pad2; /* 0x03c AUX registers follow */ | 80 | uint32_t pad2; /* 0x03c AUX registers follow */ | |
81 | u_int32_t io_gsc_err_addr;/* 0x040 GSC error address */ | 81 | uint32_t io_gsc_err_addr;/* 0x040 GSC error address */ | |
82 | u_int32_t io_err_info; /* 0x044 error info register */ | 82 | uint32_t io_err_info; /* 0x044 error info register */ | |
83 | u_int32_t io_pci_err_addr;/* 0x048 PCI error address */ | 83 | uint32_t io_pci_err_addr;/* 0x048 PCI error address */ | |
84 | u_int32_t pad3[4]; /* 0x04c */ | 84 | uint32_t pad3[4]; /* 0x04c */ | |
85 | u_int32_t io_fbb_en; /* 0x05c fast back2back enable reg */ | 85 | uint32_t io_fbb_en; /* 0x05c fast back2back enable reg */ | |
86 | u_int32_t io_addr_en; /* 0x060 address enable reg */ | 86 | uint32_t io_addr_en; /* 0x060 address enable reg */ | |
87 | u_int32_t pci_addr; /* 0x064 PCI conf/io/mem addr reg */ | 87 | uint32_t pci_addr; /* 0x064 PCI conf/io/mem addr reg */ | |
88 | u_int32_t pci_conf_data; /* 0x068 PCI conf data reg */ | 88 | uint32_t pci_conf_data; /* 0x068 PCI conf data reg */ | |
89 | u_int32_t pci_io_data; /* 0x06c PCI io data reg */ | 89 | uint32_t pci_io_data; /* 0x06c PCI io data reg */ | |
90 | u_int32_t pci_mem_data; /* 0x070 PCI memory data reg */ | 90 | uint32_t pci_mem_data; /* 0x070 PCI memory data reg */ | |
91 | u_int32_t pad4[0x740/4]; /* 0x074 */ | 91 | uint32_t pad4[0x740/4]; /* 0x074 */ | |
92 | u_int32_t gsc2x_config; /* 0x7b4 GSC2X config reg */ | 92 | uint32_t gsc2x_config; /* 0x7b4 GSC2X config reg */ | |
93 | u_int32_t pad5[0x48/4]; /* 0x7b8: BSRS registers follow */ | 93 | uint32_t pad5[0x48/4]; /* 0x7b8: BSRS registers follow */ | |
94 | u_int32_t gmask; /* 0x800 GSC arbitration mask */ | 94 | uint32_t gmask; /* 0x800 GSC arbitration mask */ | |
95 | u_int32_t pamr; /* 0x804 PCI arbitration mask */ | 95 | uint32_t pamr; /* 0x804 PCI arbitration mask */ | |
96 | u_int32_t papr; /* 0x808 PCI arbitration priority */ | 96 | uint32_t papr; /* 0x808 PCI arbitration priority */ | |
97 | u_int32_t damode; /* 0x80c PCI arbitration mode */ | 97 | uint32_t damode; /* 0x80c PCI arbitration mode */ | |
98 | u_int32_t pcicmd; /* 0x810 PCI command register */ | 98 | uint32_t pcicmd; /* 0x810 PCI command register */ | |
99 | u_int32_t pcists; /* 0x814 PCI status register */ | 99 | uint32_t pcists; /* 0x814 PCI status register */ | |
100 | u_int32_t pad6; /* 0x818 */ | 100 | uint32_t pad6; /* 0x818 */ | |
101 | u_int32_t mltim; /* 0x81c PCI master latency timer */ | 101 | uint32_t mltim; /* 0x81c PCI master latency timer */ | |
102 | u_int32_t brdg_feat; /* 0x820 PCI bridge feature enable */ | 102 | uint32_t brdg_feat; /* 0x820 PCI bridge feature enable */ | |
103 | u_int32_t pciror; /* 0x824 PCI read optimization reg */ | 103 | uint32_t pciror; /* 0x824 PCI read optimization reg */ | |
104 | u_int32_t pciwor; /* 0x828 PCI write optimization reg */ | 104 | uint32_t pciwor; /* 0x828 PCI write optimization reg */ | |
105 | u_int32_t pad7; /* 0x82c */ | 105 | uint32_t pad7; /* 0x82c */ | |
106 | u_int32_t tltim; /* 0x830 PCI target latency reg */ | 106 | uint32_t tltim; /* 0x830 PCI target latency reg */ | |
107 | }; | 107 | }; | |
108 | 108 | |||
109 | struct dino_softc { | 109 | struct dino_softc { | |
110 | device_t sc_dv; | 110 | device_t sc_dv; | |
111 | 111 | |||
112 | int sc_ver; | 112 | int sc_ver; | |
113 | void *sc_ih; | 113 | void *sc_ih; | |
114 | struct hp700_int_reg sc_int_reg; | 114 | struct hp700_int_reg sc_int_reg; | |
115 | bus_space_tag_t sc_bt; | 115 | bus_space_tag_t sc_bt; | |
116 | bus_space_handle_t sc_bh; | 116 | bus_space_handle_t sc_bh; | |
117 | bus_space_handle_t sc_memh; | 117 | bus_space_handle_t sc_memh; | |
118 | bus_dma_tag_t sc_dmat; | 118 | bus_dma_tag_t sc_dmat; | |
119 | volatile struct dino_regs *sc_regs; | 119 | volatile struct dino_regs *sc_regs; | |
@@ -151,90 +151,90 @@ void dino_intr_disestablish(void *, void | @@ -151,90 +151,90 @@ void dino_intr_disestablish(void *, void | |||
151 | void *dino_alloc_parent(device_t, struct pci_attach_args *, int); | 151 | void *dino_alloc_parent(device_t, struct pci_attach_args *, int); | |
152 | int dino_iomap(void *, bus_addr_t, bus_size_t, int, bus_space_handle_t *); | 152 | int dino_iomap(void *, bus_addr_t, bus_size_t, int, bus_space_handle_t *); | |
153 | int dino_memmap(void *, bus_addr_t, bus_size_t, int, bus_space_handle_t *); | 153 | int dino_memmap(void *, bus_addr_t, bus_size_t, int, bus_space_handle_t *); | |
154 | int dino_subregion(void *, bus_space_handle_t, bus_size_t, bus_size_t, | 154 | int dino_subregion(void *, bus_space_handle_t, bus_size_t, bus_size_t, | |
155 | bus_space_handle_t *); | 155 | bus_space_handle_t *); | |
156 | int dino_ioalloc(void *, bus_addr_t, bus_addr_t, bus_size_t, | 156 | int dino_ioalloc(void *, bus_addr_t, bus_addr_t, bus_size_t, | |
157 | bus_size_t, bus_size_t, int, bus_addr_t *, bus_space_handle_t *); | 157 | bus_size_t, bus_size_t, int, bus_addr_t *, bus_space_handle_t *); | |
158 | int dino_memalloc(void *, bus_addr_t, bus_addr_t, bus_size_t, bus_size_t, | 158 | int dino_memalloc(void *, bus_addr_t, bus_addr_t, bus_size_t, bus_size_t, | |
159 | bus_size_t, int, bus_addr_t *, bus_space_handle_t *); | 159 | bus_size_t, int, bus_addr_t *, bus_space_handle_t *); | |
160 | void dino_unmap(void *, bus_space_handle_t, bus_size_t); | 160 | void dino_unmap(void *, bus_space_handle_t, bus_size_t); | |
161 | void dino_free(void *, bus_space_handle_t, bus_size_t); | 161 | void dino_free(void *, bus_space_handle_t, bus_size_t); | |
162 | void dino_barrier(void *, bus_space_handle_t, bus_size_t, bus_size_t, int); | 162 | void dino_barrier(void *, bus_space_handle_t, bus_size_t, bus_size_t, int); | |
163 | void *dino_vaddr(void *, bus_space_handle_t); | 163 | void *dino_vaddr(void *, bus_space_handle_t); | |
164 | u_int8_t dino_r1(void *, bus_space_handle_t, bus_size_t); | 164 | uint8_t dino_r1(void *, bus_space_handle_t, bus_size_t); | |
165 | u_int16_t dino_r2(void *, bus_space_handle_t, bus_size_t); | 165 | uint16_t dino_r2(void *, bus_space_handle_t, bus_size_t); | |
166 | u_int32_t dino_r4(void *, bus_space_handle_t, bus_size_t); | 166 | uint32_t dino_r4(void *, bus_space_handle_t, bus_size_t); | |
167 | u_int64_t dino_r8(void *, bus_space_handle_t, bus_size_t); | 167 | uint64_t dino_r8(void *, bus_space_handle_t, bus_size_t); | |
168 | void dino_w1(void *, bus_space_handle_t, bus_size_t, u_int8_t); | 168 | void dino_w1(void *, bus_space_handle_t, bus_size_t, uint8_t); | |
169 | void dino_w2(void *, bus_space_handle_t, bus_size_t, u_int16_t); | 169 | void dino_w2(void *, bus_space_handle_t, bus_size_t, uint16_t); | |
170 | void dino_w4(void *, bus_space_handle_t, bus_size_t, u_int32_t); | 170 | void dino_w4(void *, bus_space_handle_t, bus_size_t, uint32_t); | |
171 | void dino_w8(void *, bus_space_handle_t, bus_size_t, u_int64_t); | 171 | void dino_w8(void *, bus_space_handle_t, bus_size_t, uint64_t); | |
172 | void dino_rm_1(void *, bus_space_handle_t, bus_size_t, u_int8_t *, bus_size_t); | 172 | void dino_rm_1(void *, bus_space_handle_t, bus_size_t, uint8_t *, bus_size_t); | |
173 | void dino_rm_2(void *, bus_space_handle_t, bus_size_t, u_int16_t *, bus_size_t); | 173 | void dino_rm_2(void *, bus_space_handle_t, bus_size_t, uint16_t *, bus_size_t); | |
174 | void dino_rm_4(void *, bus_space_handle_t, bus_size_t, u_int32_t *, bus_size_t); | 174 | void dino_rm_4(void *, bus_space_handle_t, bus_size_t, uint32_t *, bus_size_t); | |
175 | void dino_rm_8(void *, bus_space_handle_t, bus_size_t, u_int64_t *, bus_size_t); | 175 | void dino_rm_8(void *, bus_space_handle_t, bus_size_t, uint64_t *, bus_size_t); | |
176 | void dino_wm_1(void *, bus_space_handle_t, bus_size_t, const u_int8_t *, | 176 | void dino_wm_1(void *, bus_space_handle_t, bus_size_t, const uint8_t *, | |
177 | bus_size_t); | 177 | bus_size_t); | |
178 | void dino_wm_2(void *, bus_space_handle_t, bus_size_t, const u_int16_t *, | 178 | void dino_wm_2(void *, bus_space_handle_t, bus_size_t, const uint16_t *, | |
179 | bus_size_t); | 179 | bus_size_t); | |
180 | void dino_wm_4(void *, bus_space_handle_t, bus_size_t, const u_int32_t *, | 180 | void dino_wm_4(void *, bus_space_handle_t, bus_size_t, const uint32_t *, | |
181 | bus_size_t); | 181 | bus_size_t); | |
182 | void dino_wm_8(void *, bus_space_handle_t, bus_size_t, const u_int64_t *, | 182 | void dino_wm_8(void *, bus_space_handle_t, bus_size_t, const uint64_t *, | |
183 | bus_size_t); | 183 | bus_size_t); | |
184 | void dino_sm_1(void *, bus_space_handle_t, bus_size_t, u_int8_t, bus_size_t); | 184 | void dino_sm_1(void *, bus_space_handle_t, bus_size_t, uint8_t, bus_size_t); | |
185 | void dino_sm_2(void *, bus_space_handle_t, bus_size_t, u_int16_t, bus_size_t); | 185 | void dino_sm_2(void *, bus_space_handle_t, bus_size_t, uint16_t, bus_size_t); | |
186 | void dino_sm_4(void *, bus_space_handle_t, bus_size_t, u_int32_t, bus_size_t); | 186 | void dino_sm_4(void *, bus_space_handle_t, bus_size_t, uint32_t, bus_size_t); | |
187 | void dino_sm_8(void *, bus_space_handle_t, bus_size_t, u_int64_t, bus_size_t); | 187 | void dino_sm_8(void *, bus_space_handle_t, bus_size_t, uint64_t, bus_size_t); | |
188 | void dino_rrm_2(void *, bus_space_handle_t, bus_size_t, u_int16_t *, | 188 | void dino_rrm_2(void *, bus_space_handle_t, bus_size_t, uint16_t *, | |
189 | bus_size_t); | 189 | bus_size_t); | |
190 | void dino_rrm_4(void *, bus_space_handle_t, bus_size_t, u_int32_t *, | 190 | void dino_rrm_4(void *, bus_space_handle_t, bus_size_t, uint32_t *, | |
191 | bus_size_t); | 191 | bus_size_t); | |
192 | void dino_rrm_8(void *, bus_space_handle_t, bus_size_t, u_int64_t *, | 192 | void dino_rrm_8(void *, bus_space_handle_t, bus_size_t, uint64_t *, | |
193 | bus_size_t); | 193 | bus_size_t); | |
194 | void dino_wrm_2(void *, bus_space_handle_t, bus_size_t, const u_int16_t *, | 194 | void dino_wrm_2(void *, bus_space_handle_t, bus_size_t, const uint16_t *, | |
195 | bus_size_t); | 195 | bus_size_t); | |
196 | void dino_wrm_4(void *, bus_space_handle_t, bus_size_t, const u_int32_t *, | 196 | void dino_wrm_4(void *, bus_space_handle_t, bus_size_t, const uint32_t *, | |
197 | bus_size_t); | 197 | bus_size_t); | |
198 | void dino_wrm_8(void *, bus_space_handle_t, bus_size_t, const u_int64_t *, | 198 | void dino_wrm_8(void *, bus_space_handle_t, bus_size_t, const uint64_t *, | |
199 | bus_size_t); | 199 | bus_size_t); | |
200 | void dino_rr_1(void *, bus_space_handle_t, bus_size_t, u_int8_t *, bus_size_t); | 200 | void dino_rr_1(void *, bus_space_handle_t, bus_size_t, uint8_t *, bus_size_t); | |
201 | void dino_rr_2(void *, bus_space_handle_t, bus_size_t, u_int16_t *, bus_size_t); | 201 | void dino_rr_2(void *, bus_space_handle_t, bus_size_t, uint16_t *, bus_size_t); | |
202 | void dino_rr_4(void *, bus_space_handle_t, bus_size_t, u_int32_t *, bus_size_t); | 202 | void dino_rr_4(void *, bus_space_handle_t, bus_size_t, uint32_t *, bus_size_t); | |
203 | void dino_rr_8(void *, bus_space_handle_t, bus_size_t, u_int64_t *, bus_size_t); | 203 | void dino_rr_8(void *, bus_space_handle_t, bus_size_t, uint64_t *, bus_size_t); | |
204 | void dino_wr_1(void *, bus_space_handle_t, bus_size_t, const u_int8_t *, | 204 | void dino_wr_1(void *, bus_space_handle_t, bus_size_t, const uint8_t *, | |
205 | bus_size_t); | 205 | bus_size_t); | |
206 | void dino_wr_2(void *, bus_space_handle_t, bus_size_t, const u_int16_t *, | 206 | void dino_wr_2(void *, bus_space_handle_t, bus_size_t, const uint16_t *, | |
207 | bus_size_t); | 207 | bus_size_t); | |
208 | void dino_wr_4(void *, bus_space_handle_t, bus_size_t, const u_int32_t *, | 208 | void dino_wr_4(void *, bus_space_handle_t, bus_size_t, const uint32_t *, | |
209 | bus_size_t); | 209 | bus_size_t); | |
210 | void dino_wr_8(void *, bus_space_handle_t, bus_size_t, const u_int64_t *, | 210 | void dino_wr_8(void *, bus_space_handle_t, bus_size_t, const uint64_t *, | |
211 | bus_size_t); | 211 | bus_size_t); | |
212 | void dino_rrr_2(void *, bus_space_handle_t, bus_size_t, u_int16_t *, | 212 | void dino_rrr_2(void *, bus_space_handle_t, bus_size_t, uint16_t *, | |
213 | bus_size_t); | 213 | bus_size_t); | |
214 | void dino_rrr_4(void *, bus_space_handle_t, bus_size_t, u_int32_t *, | 214 | void dino_rrr_4(void *, bus_space_handle_t, bus_size_t, uint32_t *, | |
215 | bus_size_t); | 215 | bus_size_t); | |
216 | void dino_rrr_8(void *, bus_space_handle_t, bus_size_t, u_int64_t *, | 216 | void dino_rrr_8(void *, bus_space_handle_t, bus_size_t, uint64_t *, | |
217 | bus_size_t); | 217 | bus_size_t); | |
218 | void dino_wrr_2(void *, bus_space_handle_t, bus_size_t, const u_int16_t *, | 218 | void dino_wrr_2(void *, bus_space_handle_t, bus_size_t, const uint16_t *, | |
219 | bus_size_t); | 219 | bus_size_t); | |
220 | void dino_wrr_4(void *, bus_space_handle_t, bus_size_t, const u_int32_t *, | 220 | void dino_wrr_4(void *, bus_space_handle_t, bus_size_t, const uint32_t *, | |
221 | bus_size_t); | 221 | bus_size_t); | |
222 | void dino_wrr_8(void *, bus_space_handle_t, bus_size_t, const u_int64_t *, | 222 | void dino_wrr_8(void *, bus_space_handle_t, bus_size_t, const uint64_t *, | |
223 | bus_size_t); | 223 | bus_size_t); | |
224 | void dino_sr_1(void *, bus_space_handle_t, bus_size_t, u_int8_t, bus_size_t); | 224 | void dino_sr_1(void *, bus_space_handle_t, bus_size_t, uint8_t, bus_size_t); | |
225 | void dino_sr_2(void *, bus_space_handle_t, bus_size_t, u_int16_t, bus_size_t); | 225 | void dino_sr_2(void *, bus_space_handle_t, bus_size_t, uint16_t, bus_size_t); | |
226 | void dino_sr_4(void *, bus_space_handle_t, bus_size_t, u_int32_t, bus_size_t); | 226 | void dino_sr_4(void *, bus_space_handle_t, bus_size_t, uint32_t, bus_size_t); | |
227 | void dino_sr_8(void *, bus_space_handle_t, bus_size_t, u_int64_t, bus_size_t); | 227 | void dino_sr_8(void *, bus_space_handle_t, bus_size_t, uint64_t, bus_size_t); | |
228 | void dino_cp_1(void *, bus_space_handle_t, bus_size_t, bus_space_handle_t, | 228 | void dino_cp_1(void *, bus_space_handle_t, bus_size_t, bus_space_handle_t, | |
229 | bus_size_t, bus_size_t); | 229 | bus_size_t, bus_size_t); | |
230 | void dino_cp_2(void *, bus_space_handle_t, bus_size_t, bus_space_handle_t, | 230 | void dino_cp_2(void *, bus_space_handle_t, bus_size_t, bus_space_handle_t, | |
231 | bus_size_t, bus_size_t); | 231 | bus_size_t, bus_size_t); | |
232 | void dino_cp_4(void *, bus_space_handle_t, bus_size_t, bus_space_handle_t, | 232 | void dino_cp_4(void *, bus_space_handle_t, bus_size_t, bus_space_handle_t, | |
233 | bus_size_t, bus_size_t); | 233 | bus_size_t, bus_size_t); | |
234 | void dino_cp_8(void *, bus_space_handle_t, bus_size_t, bus_space_handle_t, | 234 | void dino_cp_8(void *, bus_space_handle_t, bus_size_t, bus_space_handle_t, | |
235 | bus_size_t, bus_size_t); | 235 | bus_size_t, bus_size_t); | |
236 | int dino_dmamap_create(void *, bus_size_t, int, bus_size_t, bus_size_t, int, | 236 | int dino_dmamap_create(void *, bus_size_t, int, bus_size_t, bus_size_t, int, | |
237 | bus_dmamap_t *); | 237 | bus_dmamap_t *); | |
238 | void dino_dmamap_destroy(void *, bus_dmamap_t); | 238 | void dino_dmamap_destroy(void *, bus_dmamap_t); | |
239 | int dino_dmamap_load(void *, bus_dmamap_t, void *, bus_size_t, struct proc *, | 239 | int dino_dmamap_load(void *, bus_dmamap_t, void *, bus_size_t, struct proc *, | |
240 | int); | 240 | int); | |
@@ -435,27 +435,27 @@ dino_iomap(void *v, bus_addr_t bpa, bus_ | @@ -435,27 +435,27 @@ dino_iomap(void *v, bus_addr_t bpa, bus_ | |||
435 | 435 | |||
436 | if (bshp) | 436 | if (bshp) | |
437 | *bshp = bpa; | 437 | *bshp = bpa; | |
438 | 438 | |||
439 | return 0; | 439 | return 0; | |
440 | } | 440 | } | |
441 | 441 | |||
442 | int | 442 | int | |
443 | dino_memmap(void *v, bus_addr_t bpa, bus_size_t size, | 443 | dino_memmap(void *v, bus_addr_t bpa, bus_size_t size, | |
444 | int flags, bus_space_handle_t *bshp) | 444 | int flags, bus_space_handle_t *bshp) | |
445 | { | 445 | { | |
446 | struct dino_softc *sc = v; | 446 | struct dino_softc *sc = v; | |
447 | volatile struct dino_regs *r = sc->sc_regs; | 447 | volatile struct dino_regs *r = sc->sc_regs; | |
448 | u_int32_t reg; | 448 | uint32_t reg; | |
449 | int error; | 449 | int error; | |
450 | 450 | |||
451 | reg = r->io_addr_en; | 451 | reg = r->io_addr_en; | |
452 | reg |= 1 << ((bpa >> 23) & 0x1f); | 452 | reg |= 1 << ((bpa >> 23) & 0x1f); | |
453 | #ifdef DEBUG | 453 | #ifdef DEBUG | |
454 | if (reg & 0x80000001) | 454 | if (reg & 0x80000001) | |
455 | panic("mapping outside the mem extent range"); | 455 | panic("mapping outside the mem extent range"); | |
456 | #endif | 456 | #endif | |
457 | if ((error = bus_space_map(sc->sc_bt, bpa, size, flags, bshp))) | 457 | if ((error = bus_space_map(sc->sc_bt, bpa, size, flags, bshp))) | |
458 | return error; | 458 | return error; | |
459 | ++sc->sc_memrefcount[((bpa >> 23) & 0x1f)]; | 459 | ++sc->sc_memrefcount[((bpa >> 23) & 0x1f)]; | |
460 | /* map into the upper bus space, if not yet mapped this 8M */ | 460 | /* map into the upper bus space, if not yet mapped this 8M */ | |
461 | if (reg != r->io_addr_en) | 461 | if (reg != r->io_addr_en) | |
@@ -493,27 +493,27 @@ dino_ioalloc(void *v, bus_addr_t rstart, | @@ -493,27 +493,27 @@ dino_ioalloc(void *v, bus_addr_t rstart, | |||
493 | if (bshp) | 493 | if (bshp) | |
494 | *bshp = bpa; | 494 | *bshp = bpa; | |
495 | 495 | |||
496 | return 0; | 496 | return 0; | |
497 | } | 497 | } | |
498 | 498 | |||
499 | int | 499 | int | |
500 | dino_memalloc(void *v, bus_addr_t rstart, bus_addr_t rend, bus_size_t size, | 500 | dino_memalloc(void *v, bus_addr_t rstart, bus_addr_t rend, bus_size_t size, | |
501 | bus_size_t align, bus_size_t boundary, int flags, bus_addr_t *addrp, | 501 | bus_size_t align, bus_size_t boundary, int flags, bus_addr_t *addrp, | |
502 | bus_space_handle_t *bshp) | 502 | bus_space_handle_t *bshp) | |
503 | { | 503 | { | |
504 | struct dino_softc *sc = v; | 504 | struct dino_softc *sc = v; | |
505 | volatile struct dino_regs *r = sc->sc_regs; | 505 | volatile struct dino_regs *r = sc->sc_regs; | |
506 | u_int32_t reg; | 506 | uint32_t reg; | |
507 | int i, error; | 507 | int i, error; | |
508 | 508 | |||
509 | /* | 509 | /* | |
510 | * Allow allocation only when PCI MEM is already maped. | 510 | * Allow allocation only when PCI MEM is already maped. | |
511 | * Needed to avoid allocation of I/O space used by devices that | 511 | * Needed to avoid allocation of I/O space used by devices that | |
512 | * have no driver in the current kernel. | 512 | * have no driver in the current kernel. | |
513 | * Dino can map PCI MEM in the range 0xf0800000..0xff800000 only. | 513 | * Dino can map PCI MEM in the range 0xf0800000..0xff800000 only. | |
514 | */ | 514 | */ | |
515 | reg = r->io_addr_en; | 515 | reg = r->io_addr_en; | |
516 | if (rstart < 0xf0800000 || rend >= 0xff800000 || reg == 0) | 516 | if (rstart < 0xf0800000 || rend >= 0xff800000 || reg == 0) | |
517 | return -1; | 517 | return -1; | |
518 | /* Find used PCI MEM and narrow allocateble region down to it. */ | 518 | /* Find used PCI MEM and narrow allocateble region down to it. */ | |
519 | for (i = 1; i < 31; i++) | 519 | for (i = 1; i < 31; i++) | |
@@ -559,807 +559,807 @@ void | @@ -559,807 +559,807 @@ void | |||
559 | dino_barrier(void *v, bus_space_handle_t h, bus_size_t o, bus_size_t l, int op) | 559 | dino_barrier(void *v, bus_space_handle_t h, bus_size_t o, bus_size_t l, int op) | |
560 | { | 560 | { | |
561 | sync_caches(); | 561 | sync_caches(); | |
562 | } | 562 | } | |
563 | 563 | |||
564 | void* | 564 | void* | |
565 | dino_vaddr(void *v, bus_space_handle_t h) | 565 | dino_vaddr(void *v, bus_space_handle_t h) | |
566 | { | 566 | { | |
567 | struct dino_softc *sc = v; | 567 | struct dino_softc *sc = v; | |
568 | 568 | |||
569 | return bus_space_vaddr(sc->sc_bt, h); | 569 | return bus_space_vaddr(sc->sc_bt, h); | |
570 | } | 570 | } | |
571 | 571 | |||
572 | u_int8_t | 572 | uint8_t | |
573 | dino_r1(void *v, bus_space_handle_t h, bus_size_t o) | 573 | dino_r1(void *v, bus_space_handle_t h, bus_size_t o) | |
574 | { | 574 | { | |
575 | h += o; | 575 | h += o; | |
576 | if (h & 0xf0000000) | 576 | if (h & 0xf0000000) | |
577 | return *(volatile u_int8_t *)h; | 577 | return *(volatile uint8_t *)h; | |
578 | else { | 578 | else { | |
579 | struct dino_softc *sc = v; | 579 | struct dino_softc *sc = v; | |
580 | volatile struct dino_regs *r = sc->sc_regs; | 580 | volatile struct dino_regs *r = sc->sc_regs; | |
581 | 581 | |||
582 | r->pci_addr = h & ~3; | 582 | r->pci_addr = h & ~3; | |
583 | return *((volatile u_int8_t *)&r->pci_io_data + (h & 3)); | 583 | return *((volatile uint8_t *)&r->pci_io_data + (h & 3)); | |
584 | } | 584 | } | |
585 | } | 585 | } | |
586 | 586 | |||
587 | u_int16_t | 587 | uint16_t | |
588 | dino_r2(void *v, bus_space_handle_t h, bus_size_t o) | 588 | dino_r2(void *v, bus_space_handle_t h, bus_size_t o) | |
589 | { | 589 | { | |
590 | volatile u_int16_t *p; | 590 | volatile uint16_t *p; | |
591 | volatile u_int16_t d; | 591 | volatile uint16_t d; | |
592 | 592 | |||
593 | h += o; | 593 | h += o; | |
594 | if (h & 0xf0000000) { | 594 | if (h & 0xf0000000) { | |
595 | p = (volatile u_int16_t *)h; | 595 | p = (volatile uint16_t *)h; | |
596 | d = le16toh(*p); | 596 | d = le16toh(*p); | |
597 | } else { | 597 | } else { | |
598 | struct dino_softc *sc = v; | 598 | struct dino_softc *sc = v; | |
599 | volatile struct dino_regs *r = sc->sc_regs; | 599 | volatile struct dino_regs *r = sc->sc_regs; | |
600 | 600 | |||
601 | r->pci_addr = h & ~3; | 601 | r->pci_addr = h & ~3; | |
602 | p = (volatile u_int16_t *)&r->pci_io_data; | 602 | p = (volatile uint16_t *)&r->pci_io_data; | |
603 | if (h & 2) | 603 | if (h & 2) | |
604 | p++; | 604 | p++; | |
605 | d = le16toh(*p); | 605 | d = le16toh(*p); | |
606 | } | 606 | } | |
607 | 607 | |||
608 | return d; | 608 | return d; | |
609 | } | 609 | } | |
610 | 610 | |||
611 | u_int32_t | 611 | uint32_t | |
612 | dino_r4(void *v, bus_space_handle_t h, bus_size_t o) | 612 | dino_r4(void *v, bus_space_handle_t h, bus_size_t o) | |
613 | { | 613 | { | |
614 | u_int32_t data; | 614 | uint32_t data; | |
615 | 615 | |||
616 | h += o; | 616 | h += o; | |
617 | if (h & 0xf0000000) | 617 | if (h & 0xf0000000) | |
618 | data = *(volatile u_int32_t *)h; | 618 | data = *(volatile uint32_t *)h; | |
619 | else { | 619 | else { | |
620 | struct dino_softc *sc = v; | 620 | struct dino_softc *sc = v; | |
621 | volatile struct dino_regs *r = sc->sc_regs; | 621 | volatile struct dino_regs *r = sc->sc_regs; | |
622 | 622 | |||
623 | r->pci_addr = h; | 623 | r->pci_addr = h; | |
624 | data = r->pci_io_data; | 624 | data = r->pci_io_data; | |
625 | } | 625 | } | |
626 | 626 | |||
627 | return le32toh(data); | 627 | return le32toh(data); | |
628 | } | 628 | } | |
629 | 629 | |||
630 | u_int64_t | 630 | uint64_t | |
631 | dino_r8(void *v, bus_space_handle_t h, bus_size_t o) | 631 | dino_r8(void *v, bus_space_handle_t h, bus_size_t o) | |
632 | { | 632 | { | |
633 | h += o; | 633 | h += o; | |
634 | if (h & 0xf0000000) | 634 | if (h & 0xf0000000) | |
635 | return *(volatile u_int64_t *)h; | 635 | return *(volatile uint64_t *)h; | |
636 | else | 636 | else | |
637 | panic("dino_r8: not implemented"); | 637 | panic("dino_r8: not implemented"); | |
638 | } | 638 | } | |
639 | 639 | |||
640 | void | 640 | void | |
641 | dino_w1(void *v, bus_space_handle_t h, bus_size_t o, u_int8_t vv) | 641 | dino_w1(void *v, bus_space_handle_t h, bus_size_t o, uint8_t vv) | |
642 | { | 642 | { | |
643 | h += o; | 643 | h += o; | |
644 | if (h & 0xf0000000) | 644 | if (h & 0xf0000000) | |
645 | *(volatile u_int8_t *)h = vv; | 645 | *(volatile uint8_t *)h = vv; | |
646 | else { | 646 | else { | |
647 | struct dino_softc *sc = v; | 647 | struct dino_softc *sc = v; | |
648 | volatile struct dino_regs *r = sc->sc_regs; | 648 | volatile struct dino_regs *r = sc->sc_regs; | |
649 | 649 | |||
650 | r->pci_addr = h & ~3; | 650 | r->pci_addr = h & ~3; | |
651 | *((volatile u_int8_t *)&r->pci_io_data + (h & 3)) = vv; | 651 | *((volatile uint8_t *)&r->pci_io_data + (h & 3)) = vv; | |
652 | } | 652 | } | |
653 | } | 653 | } | |
654 | 654 | |||
655 | void | 655 | void | |
656 | dino_w2(void *v, bus_space_handle_t h, bus_size_t o, u_int16_t vv) | 656 | dino_w2(void *v, bus_space_handle_t h, bus_size_t o, uint16_t vv) | |
657 | { | 657 | { | |
658 | volatile u_int16_t *p; | 658 | volatile uint16_t *p; | |
659 | 659 | |||
660 | h += o; | 660 | h += o; | |
661 | if (h & 0xf0000000) | 661 | if (h & 0xf0000000) | |
662 | p = (volatile u_int16_t *)h; | 662 | p = (volatile uint16_t *)h; | |
663 | else { | 663 | else { | |
664 | struct dino_softc *sc = v; | 664 | struct dino_softc *sc = v; | |
665 | volatile struct dino_regs *r = sc->sc_regs; | 665 | volatile struct dino_regs *r = sc->sc_regs; | |
666 | 666 | |||
667 | r->pci_addr = h & ~3; | 667 | r->pci_addr = h & ~3; | |
668 | p = (volatile u_int16_t *)&r->pci_io_data; | 668 | p = (volatile uint16_t *)&r->pci_io_data; | |
669 | if (h & 2) | 669 | if (h & 2) | |
670 | p++; | 670 | p++; | |
671 | } | 671 | } | |
672 | 672 | |||
673 | *p = htole16(vv); | 673 | *p = htole16(vv); | |
674 | } | 674 | } | |
675 | 675 | |||
676 | void | 676 | void | |
677 | dino_w4(void *v, bus_space_handle_t h, bus_size_t o, u_int32_t vv) | 677 | dino_w4(void *v, bus_space_handle_t h, bus_size_t o, uint32_t vv) | |
678 | { | 678 | { | |
679 | h += o; | 679 | h += o; | |
680 | vv = htole32(vv); | 680 | vv = htole32(vv); | |
681 | if (h & 0xf0000000) | 681 | if (h & 0xf0000000) | |
682 | *(volatile u_int32_t *)h = vv; | 682 | *(volatile uint32_t *)h = vv; | |
683 | else { | 683 | else { | |
684 | struct dino_softc *sc = v; | 684 | struct dino_softc *sc = v; | |
685 | volatile struct dino_regs *r = sc->sc_regs; | 685 | volatile struct dino_regs *r = sc->sc_regs; | |
686 | 686 | |||
687 | r->pci_addr = h; | 687 | r->pci_addr = h; | |
688 | r->pci_io_data = vv; | 688 | r->pci_io_data = vv; | |
689 | } | 689 | } | |
690 | } | 690 | } | |
691 | 691 | |||
692 | void | 692 | void | |
693 | dino_w8(void *v, bus_space_handle_t h, bus_size_t o, u_int64_t vv) | 693 | dino_w8(void *v, bus_space_handle_t h, bus_size_t o, uint64_t vv) | |
694 | { | 694 | { | |
695 | h += o; | 695 | h += o; | |
696 | if (h & 0xf0000000) | 696 | if (h & 0xf0000000) | |
697 | *(volatile u_int64_t *)h = vv; | 697 | *(volatile uint64_t *)h = vv; | |
698 | else | 698 | else | |
699 | panic("dino_w8: not implemented"); | 699 | panic("dino_w8: not implemented"); | |
700 | } | 700 | } | |
701 | 701 | |||
702 | 702 | |||
703 | void | 703 | void | |
704 | dino_rm_1(void *v, bus_space_handle_t h, bus_size_t o, u_int8_t *a, bus_size_t c) | 704 | dino_rm_1(void *v, bus_space_handle_t h, bus_size_t o, uint8_t *a, bus_size_t c) | |
705 | { | 705 | { | |
706 | volatile u_int8_t *p; | 706 | volatile uint8_t *p; | |
707 | 707 | |||
708 | h += o; | 708 | h += o; | |
709 | if (h & 0xf0000000) | 709 | if (h & 0xf0000000) | |
710 | p = (volatile u_int8_t *)h; | 710 | p = (volatile uint8_t *)h; | |
711 | else { | 711 | else { | |
712 | struct dino_softc *sc = v; | 712 | struct dino_softc *sc = v; | |
713 | volatile struct dino_regs *r = sc->sc_regs; | 713 | volatile struct dino_regs *r = sc->sc_regs; | |
714 | 714 | |||
715 | r->pci_addr = h & ~3; | 715 | r->pci_addr = h & ~3; | |
716 | p = (volatile u_int8_t *)&r->pci_io_data + (h & 3); | 716 | p = (volatile uint8_t *)&r->pci_io_data + (h & 3); | |
717 | } | 717 | } | |
718 | 718 | |||
719 | while (c--) | 719 | while (c--) | |
720 | *a++ = *p; | 720 | *a++ = *p; | |
721 | } | 721 | } | |
722 | 722 | |||
723 | void | 723 | void | |
724 | dino_rm_2(void *v, bus_space_handle_t h, bus_size_t o, u_int16_t *a, bus_size_t c) | 724 | dino_rm_2(void *v, bus_space_handle_t h, bus_size_t o, uint16_t *a, bus_size_t c) | |
725 | { | 725 | { | |
726 | volatile u_int16_t *p; | 726 | volatile uint16_t *p; | |
727 | 727 | |||
728 | h += o; | 728 | h += o; | |
729 | if (h & 0xf0000000) | 729 | if (h & 0xf0000000) | |
730 | p = (volatile u_int16_t *)h; | 730 | p = (volatile uint16_t *)h; | |
731 | else { | 731 | else { | |
732 | struct dino_softc *sc = v; | 732 | struct dino_softc *sc = v; | |
733 | volatile struct dino_regs *r = sc->sc_regs; | 733 | volatile struct dino_regs *r = sc->sc_regs; | |
734 | 734 | |||
735 | r->pci_addr = h & ~3; | 735 | r->pci_addr = h & ~3; | |
736 | p = (volatile u_int16_t *)&r->pci_io_data; | 736 | p = (volatile uint16_t *)&r->pci_io_data; | |
737 | if (h & 2) | 737 | if (h & 2) | |
738 | p++; | 738 | p++; | |
739 | } | 739 | } | |
740 | 740 | |||
741 | while (c--) | 741 | while (c--) | |
742 | *a++ = le16toh(*p); | 742 | *a++ = le16toh(*p); | |
743 | } | 743 | } | |
744 | 744 | |||
745 | void | 745 | void | |
746 | dino_rm_4(void *v, bus_space_handle_t h, bus_size_t o, u_int32_t *a, bus_size_t c) | 746 | dino_rm_4(void *v, bus_space_handle_t h, bus_size_t o, uint32_t *a, bus_size_t c) | |
747 | { | 747 | { | |
748 | volatile u_int32_t *p; | 748 | volatile uint32_t *p; | |
749 | 749 | |||
750 | h += o; | 750 | h += o; | |
751 | if (h & 0xf0000000) | 751 | if (h & 0xf0000000) | |
752 | p = (volatile u_int32_t *)h; | 752 | p = (volatile uint32_t *)h; | |
753 | else { | 753 | else { | |
754 | struct dino_softc *sc = v; | 754 | struct dino_softc *sc = v; | |
755 | volatile struct dino_regs *r = sc->sc_regs; | 755 | volatile struct dino_regs *r = sc->sc_regs; | |
756 | 756 | |||
757 | r->pci_addr = h; | 757 | r->pci_addr = h; | |
758 | p = (volatile u_int32_t *)&r->pci_io_data; | 758 | p = (volatile uint32_t *)&r->pci_io_data; | |
759 | } | 759 | } | |
760 | 760 | |||
761 | while (c--) | 761 | while (c--) | |
762 | *a++ = le32toh(*p); | 762 | *a++ = le32toh(*p); | |
763 | } | 763 | } | |
764 | 764 | |||
765 | void | 765 | void | |
766 | dino_rm_8(void *v, bus_space_handle_t h, bus_size_t o, u_int64_t *a, bus_size_t c) | 766 | dino_rm_8(void *v, bus_space_handle_t h, bus_size_t o, uint64_t *a, bus_size_t c) | |
767 | { | 767 | { | |
768 | panic("dino_rm_8: not implemented"); | 768 | panic("dino_rm_8: not implemented"); | |
769 | } | 769 | } | |
770 | 770 | |||
771 | void | 771 | void | |
772 | dino_wm_1(void *v, bus_space_handle_t h, bus_size_t o, const u_int8_t *a, bus_size_t c) | 772 | dino_wm_1(void *v, bus_space_handle_t h, bus_size_t o, const uint8_t *a, bus_size_t c) | |
773 | { | 773 | { | |
774 | volatile u_int8_t *p; | 774 | volatile uint8_t *p; | |
775 | 775 | |||
776 | h += o; | 776 | h += o; | |
777 | if (h & 0xf0000000) | 777 | if (h & 0xf0000000) | |
778 | p = (volatile u_int8_t *)h; | 778 | p = (volatile uint8_t *)h; | |
779 | else { | 779 | else { | |
780 | struct dino_softc *sc = v; | 780 | struct dino_softc *sc = v; | |
781 | volatile struct dino_regs *r = sc->sc_regs; | 781 | volatile struct dino_regs *r = sc->sc_regs; | |
782 | 782 | |||
783 | r->pci_addr = h & ~3; | 783 | r->pci_addr = h & ~3; | |
784 | p = (volatile u_int8_t *)&r->pci_io_data + (h & 3); | 784 | p = (volatile uint8_t *)&r->pci_io_data + (h & 3); | |
785 | } | 785 | } | |
786 | 786 | |||
787 | while (c--) | 787 | while (c--) | |
788 | *p = *a++; | 788 | *p = *a++; | |
789 | } | 789 | } | |
790 | 790 | |||
791 | void | 791 | void | |
792 | dino_wm_2(void *v, bus_space_handle_t h, bus_size_t o, const u_int16_t *a, bus_size_t c) | 792 | dino_wm_2(void *v, bus_space_handle_t h, bus_size_t o, const uint16_t *a, bus_size_t c) | |
793 | { | 793 | { | |
794 | volatile u_int16_t *p; | 794 | volatile uint16_t *p; | |
795 | 795 | |||
796 | h += o; | 796 | h += o; | |
797 | if (h & 0xf0000000) | 797 | if (h & 0xf0000000) | |
798 | p = (volatile u_int16_t *)h; | 798 | p = (volatile uint16_t *)h; | |
799 | else { | 799 | else { | |
800 | struct dino_softc *sc = v; | 800 | struct dino_softc *sc = v; | |
801 | volatile struct dino_regs *r = sc->sc_regs; | 801 | volatile struct dino_regs *r = sc->sc_regs; | |
802 | 802 | |||
803 | r->pci_addr = h & ~3; | 803 | r->pci_addr = h & ~3; | |
804 | p = (volatile u_int16_t *)&r->pci_io_data; | 804 | p = (volatile uint16_t *)&r->pci_io_data; | |
805 | if (h & 2) | 805 | if (h & 2) | |
806 | p++; | 806 | p++; | |
807 | } | 807 | } | |
808 | 808 | |||
809 | while (c--) | 809 | while (c--) | |
810 | *p = htole16(*a++); | 810 | *p = htole16(*a++); | |
811 | } | 811 | } | |
812 | 812 | |||
813 | void | 813 | void | |
814 | dino_wm_4(void *v, bus_space_handle_t h, bus_size_t o, const u_int32_t *a, bus_size_t c) | 814 | dino_wm_4(void *v, bus_space_handle_t h, bus_size_t o, const uint32_t *a, bus_size_t c) | |
815 | { | 815 | { | |
816 | volatile u_int32_t *p; | 816 | volatile uint32_t *p; | |
817 | 817 | |||
818 | h += o; | 818 | h += o; | |
819 | if (h & 0xf0000000) | 819 | if (h & 0xf0000000) | |
820 | p = (volatile u_int32_t *)h; | 820 | p = (volatile uint32_t *)h; | |
821 | else { | 821 | else { | |
822 | struct dino_softc *sc = v; | 822 | struct dino_softc *sc = v; | |
823 | volatile struct dino_regs *r = sc->sc_regs; | 823 | volatile struct dino_regs *r = sc->sc_regs; | |
824 | 824 | |||
825 | r->pci_addr = h; | 825 | r->pci_addr = h; | |
826 | p = (volatile u_int32_t *)&r->pci_io_data; | 826 | p = (volatile uint32_t *)&r->pci_io_data; | |
827 | } | 827 | } | |
828 | 828 | |||
829 | while (c--) | 829 | while (c--) | |
830 | *p = htole32(*a++); | 830 | *p = htole32(*a++); | |
831 | } | 831 | } | |
832 | 832 | |||
833 | void | 833 | void | |
834 | dino_wm_8(void *v, bus_space_handle_t h, bus_size_t o, const u_int64_t *a, bus_size_t c) | 834 | dino_wm_8(void *v, bus_space_handle_t h, bus_size_t o, const uint64_t *a, bus_size_t c) | |
835 | { | 835 | { | |
836 | panic("dino_wm_8: not implemented"); | 836 | panic("dino_wm_8: not implemented"); | |
837 | } | 837 | } | |
838 | 838 | |||
839 | void | 839 | void | |
840 | dino_sm_1(void *v, bus_space_handle_t h, bus_size_t o, u_int8_t vv, bus_size_t c) | 840 | dino_sm_1(void *v, bus_space_handle_t h, bus_size_t o, uint8_t vv, bus_size_t c) | |
841 | { | 841 | { | |
842 | volatile u_int8_t *p; | 842 | volatile uint8_t *p; | |
843 | 843 | |||
844 | h += o; | 844 | h += o; | |
845 | if (h & 0xf0000000) | 845 | if (h & 0xf0000000) | |
846 | p = (volatile u_int8_t *)h; | 846 | p = (volatile uint8_t *)h; | |
847 | else { | 847 | else { | |
848 | struct dino_softc *sc = v; | 848 | struct dino_softc *sc = v; | |
849 | volatile struct dino_regs *r = sc->sc_regs; | 849 | volatile struct dino_regs *r = sc->sc_regs; | |
850 | 850 | |||
851 | r->pci_addr = h & ~3; | 851 | r->pci_addr = h & ~3; | |
852 | p = (volatile u_int8_t *)&r->pci_io_data + (h & 3); | 852 | p = (volatile uint8_t *)&r->pci_io_data + (h & 3); | |
853 | } | 853 | } | |
854 | 854 | |||
855 | while (c--) | 855 | while (c--) | |
856 | *p = vv; | 856 | *p = vv; | |
857 | } | 857 | } | |
858 | 858 | |||
859 | void | 859 | void | |
860 | dino_sm_2(void *v, bus_space_handle_t h, bus_size_t o, u_int16_t vv, bus_size_t c) | 860 | dino_sm_2(void *v, bus_space_handle_t h, bus_size_t o, uint16_t vv, bus_size_t c) | |
861 | { | 861 | { | |
862 | volatile u_int16_t *p; | 862 | volatile uint16_t *p; | |
863 | 863 | |||
864 | h += o; | 864 | h += o; | |
865 | if (h & 0xf0000000) | 865 | if (h & 0xf0000000) | |
866 | p = (volatile u_int16_t *)h; | 866 | p = (volatile uint16_t *)h; | |
867 | else { | 867 | else { | |
868 | struct dino_softc *sc = v; | 868 | struct dino_softc *sc = v; | |
869 | volatile struct dino_regs *r = sc->sc_regs; | 869 | volatile struct dino_regs *r = sc->sc_regs; | |
870 | 870 | |||
871 | r->pci_addr = h & ~3; | 871 | r->pci_addr = h & ~3; | |
872 | p = (volatile u_int16_t *)&r->pci_io_data; | 872 | p = (volatile uint16_t *)&r->pci_io_data; | |
873 | if (h & 2) | 873 | if (h & 2) | |
874 | p++; | 874 | p++; | |
875 | } | 875 | } | |
876 | 876 | |||
877 | while (c--) | 877 | while (c--) | |
878 | *p = htole16(vv); | 878 | *p = htole16(vv); | |
879 | } | 879 | } | |
880 | 880 | |||
881 | void | 881 | void | |
882 | dino_sm_4(void *v, bus_space_handle_t h, bus_size_t o, u_int32_t vv, bus_size_t c) | 882 | dino_sm_4(void *v, bus_space_handle_t h, bus_size_t o, uint32_t vv, bus_size_t c) | |
883 | { | 883 | { | |
884 | volatile u_int32_t *p; | 884 | volatile uint32_t *p; | |
885 | 885 | |||
886 | h += o; | 886 | h += o; | |
887 | if (h & 0xf0000000) | 887 | if (h & 0xf0000000) | |
888 | p = (volatile u_int32_t *)h; | 888 | p = (volatile uint32_t *)h; | |
889 | else { | 889 | else { | |
890 | struct dino_softc *sc = v; | 890 | struct dino_softc *sc = v; | |
891 | volatile struct dino_regs *r = sc->sc_regs; | 891 | volatile struct dino_regs *r = sc->sc_regs; | |
892 | 892 | |||
893 | r->pci_addr = h; | 893 | r->pci_addr = h; | |
894 | p = (volatile u_int32_t *)&r->pci_io_data; | 894 | p = (volatile uint32_t *)&r->pci_io_data; | |
895 | } | 895 | } | |
896 | 896 | |||
897 | while (c--) | 897 | while (c--) | |
898 | *p = htole32(vv); | 898 | *p = htole32(vv); | |
899 | } | 899 | } | |
900 | 900 | |||
901 | void | 901 | void | |
902 | dino_sm_8(void *v, bus_space_handle_t h, bus_size_t o, u_int64_t vv, bus_size_t c) | 902 | dino_sm_8(void *v, bus_space_handle_t h, bus_size_t o, uint64_t vv, bus_size_t c) | |
903 | { | 903 | { | |
904 | panic("dino_sm_8: not implemented"); | 904 | panic("dino_sm_8: not implemented"); | |
905 | } | 905 | } | |
906 | 906 | |||
907 | void | 907 | void | |
908 | dino_rrm_2(void *v, bus_space_handle_t h, bus_size_t o, | 908 | dino_rrm_2(void *v, bus_space_handle_t h, bus_size_t o, | |
909 | u_int16_t *a, bus_size_t c) | 909 | uint16_t *a, bus_size_t c) | |
910 | { | 910 | { | |
911 | volatile u_int16_t *p; | 911 | volatile uint16_t *p; | |
912 | 912 | |||
913 | h += o; | 913 | h += o; | |
914 | if (h & 0xf0000000) | 914 | if (h & 0xf0000000) | |
915 | p = (volatile u_int16_t *)h; | 915 | p = (volatile uint16_t *)h; | |
916 | else { | 916 | else { | |
917 | struct dino_softc *sc = v; | 917 | struct dino_softc *sc = v; | |
918 | volatile struct dino_regs *r = sc->sc_regs; | 918 | volatile struct dino_regs *r = sc->sc_regs; | |
919 | 919 | |||
920 | r->pci_addr = h & ~3; | 920 | r->pci_addr = h & ~3; | |
921 | p = (volatile u_int16_t *)&r->pci_io_data; | 921 | p = (volatile uint16_t *)&r->pci_io_data; | |
922 | if (h & 2) | 922 | if (h & 2) | |
923 | p++; | 923 | p++; | |
924 | } | 924 | } | |
925 | 925 | |||
926 | while (c--) | 926 | while (c--) | |
927 | *a++ = *p; | 927 | *a++ = *p; | |
928 | } | 928 | } | |
929 | 929 | |||
930 | void | 930 | void | |
931 | dino_rrm_4(void *v, bus_space_handle_t h, bus_size_t o, | 931 | dino_rrm_4(void *v, bus_space_handle_t h, bus_size_t o, | |
932 | u_int32_t *a, bus_size_t c) | 932 | uint32_t *a, bus_size_t c) | |
933 | { | 933 | { | |
934 | volatile u_int32_t *p; | 934 | volatile uint32_t *p; | |
935 | 935 | |||
936 | h += o; | 936 | h += o; | |
937 | if (h & 0xf0000000) | 937 | if (h & 0xf0000000) | |
938 | p = (volatile u_int32_t *)h; | 938 | p = (volatile uint32_t *)h; | |
939 | else { | 939 | else { | |
940 | struct dino_softc *sc = v; | 940 | struct dino_softc *sc = v; | |
941 | volatile struct dino_regs *r = sc->sc_regs; | 941 | volatile struct dino_regs *r = sc->sc_regs; | |
942 | 942 | |||
943 | r->pci_addr = h; | 943 | r->pci_addr = h; | |
944 | p = (volatile u_int32_t *)&r->pci_io_data; | 944 | p = (volatile uint32_t *)&r->pci_io_data; | |
945 | } | 945 | } | |
946 | 946 | |||
947 | while (c--) | 947 | while (c--) | |
948 | *a++ = *p; | 948 | *a++ = *p; | |
949 | } | 949 | } | |
950 | 950 | |||
951 | void | 951 | void | |
952 | dino_rrm_8(void *v, bus_space_handle_t h, bus_size_t o, | 952 | dino_rrm_8(void *v, bus_space_handle_t h, bus_size_t o, | |
953 | u_int64_t *a, bus_size_t c) | 953 | uint64_t *a, bus_size_t c) | |
954 | { | 954 | { | |
955 | panic("dino_rrm_8: not implemented"); | 955 | panic("dino_rrm_8: not implemented"); | |
956 | } | 956 | } | |
957 | 957 | |||
958 | void | 958 | void | |
959 | dino_wrm_2(void *v, bus_space_handle_t h, bus_size_t o, | 959 | dino_wrm_2(void *v, bus_space_handle_t h, bus_size_t o, | |
960 | const u_int16_t *a, bus_size_t c) | 960 | const uint16_t *a, bus_size_t c) | |
961 | { | 961 | { | |
962 | volatile u_int16_t *p; | 962 | volatile uint16_t *p; | |
963 | 963 | |||
964 | h += o; | 964 | h += o; | |
965 | if (h & 0xf0000000) | 965 | if (h & 0xf0000000) | |
966 | p = (volatile u_int16_t *)h; | 966 | p = (volatile uint16_t *)h; | |
967 | else { | 967 | else { | |
968 | struct dino_softc *sc = v; | 968 | struct dino_softc *sc = v; | |
969 | volatile struct dino_regs *r = sc->sc_regs; | 969 | volatile struct dino_regs *r = sc->sc_regs; | |
970 | 970 | |||
971 | r->pci_addr = h & ~3; | 971 | r->pci_addr = h & ~3; | |
972 | p = (volatile u_int16_t *)&r->pci_io_data; | 972 | p = (volatile uint16_t *)&r->pci_io_data; | |
973 | if (h & 2) | 973 | if (h & 2) | |
974 | p++; | 974 | p++; | |
975 | } | 975 | } | |
976 | 976 | |||
977 | while (c--) | 977 | while (c--) | |
978 | *p = *a++; | 978 | *p = *a++; | |
979 | } | 979 | } | |
980 | 980 | |||
981 | void | 981 | void | |
982 | dino_wrm_4(void *v, bus_space_handle_t h, bus_size_t o, | 982 | dino_wrm_4(void *v, bus_space_handle_t h, bus_size_t o, | |
983 | const u_int32_t *a, bus_size_t c) | 983 | const uint32_t *a, bus_size_t c) | |
984 | { | 984 | { | |
985 | volatile u_int32_t *p; | 985 | volatile uint32_t *p; | |
986 | 986 | |||
987 | h += o; | 987 | h += o; | |
988 | if (h & 0xf0000000) | 988 | if (h & 0xf0000000) | |
989 | p = (volatile u_int32_t *)h; | 989 | p = (volatile uint32_t *)h; | |
990 | else { | 990 | else { | |
991 | struct dino_softc *sc = v; | 991 | struct dino_softc *sc = v; | |
992 | volatile struct dino_regs *r = sc->sc_regs; | 992 | volatile struct dino_regs *r = sc->sc_regs; | |
993 | 993 | |||
994 | r->pci_addr = h; | 994 | r->pci_addr = h; | |
995 | p = (volatile u_int32_t *)&r->pci_io_data; | 995 | p = (volatile uint32_t *)&r->pci_io_data; | |
996 | } | 996 | } | |
997 | 997 | |||
998 | while (c--) | 998 | while (c--) | |
999 | *p = *a++; | 999 | *p = *a++; | |
1000 | } | 1000 | } | |
1001 | 1001 | |||
1002 | void | 1002 | void | |
1003 | dino_wrm_8(void *v, bus_space_handle_t h, bus_size_t o, | 1003 | dino_wrm_8(void *v, bus_space_handle_t h, bus_size_t o, | |
1004 | const u_int64_t *a, bus_size_t c) | 1004 | const uint64_t *a, bus_size_t c) | |
1005 | { | 1005 | { | |
1006 | panic("dino_wrm_8: not implemented"); | 1006 | panic("dino_wrm_8: not implemented"); | |
1007 | } | 1007 | } | |
1008 | 1008 | |||
1009 | void | 1009 | void | |
1010 | dino_rr_1(void *v, bus_space_handle_t h, bus_size_t o, u_int8_t *a, bus_size_t c) | 1010 | dino_rr_1(void *v, bus_space_handle_t h, bus_size_t o, uint8_t *a, bus_size_t c) | |
1011 | { | 1011 | { | |
1012 | volatile u_int8_t *p; | 1012 | volatile uint8_t *p; | |
1013 | 1013 | |||
1014 | h += o; | 1014 | h += o; | |
1015 | if (h & 0xf0000000) { | 1015 | if (h & 0xf0000000) { | |
1016 | p = (volatile u_int8_t *)h; | 1016 | p = (volatile uint8_t *)h; | |
1017 | while (c--) | 1017 | while (c--) | |
1018 | *a++ = *p++; | 1018 | *a++ = *p++; | |
1019 | } else { | 1019 | } else { | |
1020 | struct dino_softc *sc = v; | 1020 | struct dino_softc *sc = v; | |
1021 | volatile struct dino_regs *r = sc->sc_regs; | 1021 | volatile struct dino_regs *r = sc->sc_regs; | |
1022 | 1022 | |||
1023 | r->pci_addr = h & ~3; | 1023 | r->pci_addr = h & ~3; | |
1024 | while (c--) { | 1024 | while (c--) { | |
1025 | p = (volatile u_int8_t *)&r->pci_io_data + (h & 3); | 1025 | p = (volatile uint8_t *)&r->pci_io_data + (h & 3); | |
1026 | *a++ = *p; | 1026 | *a++ = *p; | |
1027 | if (!(++h & 3)) | 1027 | if (!(++h & 3)) | |
1028 | r->pci_addr = h; | 1028 | r->pci_addr = h; | |
1029 | } | 1029 | } | |
1030 | } | 1030 | } | |
1031 | } | 1031 | } | |
1032 | 1032 | |||
1033 | void | 1033 | void | |
1034 | dino_rr_2(void *v, bus_space_handle_t h, bus_size_t o, u_int16_t *a, bus_size_t c) | 1034 | dino_rr_2(void *v, bus_space_handle_t h, bus_size_t o, uint16_t *a, bus_size_t c) | |
1035 | { | 1035 | { | |
1036 | volatile u_int16_t *p; | 1036 | volatile uint16_t *p; | |
1037 | 1037 | |||
1038 | h += o; | 1038 | h += o; | |
1039 | if (h & 0xf0000000) { | 1039 | if (h & 0xf0000000) { | |
1040 | p = (volatile u_int16_t *)h; | 1040 | p = (volatile uint16_t *)h; | |
1041 | while (c--) | 1041 | while (c--) | |
1042 | *a++ = le16toh(*p++); | 1042 | *a++ = le16toh(*p++); | |
1043 | } else { | 1043 | } else { | |
1044 | struct dino_softc *sc = v; | 1044 | struct dino_softc *sc = v; | |
1045 | volatile struct dino_regs *r = sc->sc_regs; | 1045 | volatile struct dino_regs *r = sc->sc_regs; | |
1046 | 1046 | |||
1047 | r->pci_addr = h & ~3; | 1047 | r->pci_addr = h & ~3; | |
1048 | while (c--) { | 1048 | while (c--) { | |
1049 | p = (volatile u_int16_t *)&r->pci_io_data; | 1049 | p = (volatile uint16_t *)&r->pci_io_data; | |
1050 | if (h & 2) | 1050 | if (h & 2) | |
1051 | p++; | 1051 | p++; | |
1052 | *a++ = le16toh(*p); | 1052 | *a++ = le16toh(*p); | |
1053 | h += 2; | 1053 | h += 2; | |
1054 | if (!(h & 2)) | 1054 | if (!(h & 2)) | |
1055 | r->pci_addr = h; | 1055 | r->pci_addr = h; | |
1056 | } | 1056 | } | |
1057 | } | 1057 | } | |
1058 | } | 1058 | } | |
1059 | 1059 | |||
1060 | void | 1060 | void | |
1061 | dino_rr_4(void *v, bus_space_handle_t h, bus_size_t o, u_int32_t *a, bus_size_t c) | 1061 | dino_rr_4(void *v, bus_space_handle_t h, bus_size_t o, uint32_t *a, bus_size_t c) | |
1062 | { | 1062 | { | |
1063 | volatile u_int32_t *p; | 1063 | volatile uint32_t *p; | |
1064 | 1064 | |||
1065 | h += o; | 1065 | h += o; | |
1066 | if (h & 0xf0000000) { | 1066 | if (h & 0xf0000000) { | |
1067 | p = (volatile u_int32_t *)h; | 1067 | p = (volatile uint32_t *)h; | |
1068 | while (c--) | 1068 | while (c--) | |
1069 | *a++ = le32toh(*p++); | 1069 | *a++ = le32toh(*p++); | |
1070 | } else { | 1070 | } else { | |
1071 | struct dino_softc *sc = v; | 1071 | struct dino_softc *sc = v; | |
1072 | volatile struct dino_regs *r = sc->sc_regs; | 1072 | volatile struct dino_regs *r = sc->sc_regs; | |
1073 | 1073 | |||
1074 | for (; c--; h += 4) { | 1074 | for (; c--; h += 4) { | |
1075 | r->pci_addr = h; | 1075 | r->pci_addr = h; | |
1076 | *a++ = le32toh(r->pci_io_data); | 1076 | *a++ = le32toh(r->pci_io_data); | |
1077 | } | 1077 | } | |
1078 | } | 1078 | } | |
1079 | } | 1079 | } | |
1080 | 1080 | |||
1081 | void | 1081 | void | |
1082 | dino_rr_8(void *v, bus_space_handle_t h, bus_size_t o, u_int64_t *a, bus_size_t c) | 1082 | dino_rr_8(void *v, bus_space_handle_t h, bus_size_t o, uint64_t *a, bus_size_t c) | |
1083 | { | 1083 | { | |
1084 | panic("dino_rr_8: not implemented"); | 1084 | panic("dino_rr_8: not implemented"); | |
1085 | } | 1085 | } | |
1086 | 1086 | |||
1087 | void | 1087 | void | |
1088 | dino_wr_1(void *v, bus_space_handle_t h, bus_size_t o, const u_int8_t *a, bus_size_t c) | 1088 | dino_wr_1(void *v, bus_space_handle_t h, bus_size_t o, const uint8_t *a, bus_size_t c) | |
1089 | { | 1089 | { | |
1090 | volatile u_int8_t *p; | 1090 | volatile uint8_t *p; | |
1091 | 1091 | |||
1092 | h += o; | 1092 | h += o; | |
1093 | if (h & 0xf0000000) { | 1093 | if (h & 0xf0000000) { | |
1094 | p = (volatile u_int8_t *)h; | 1094 | p = (volatile uint8_t *)h; | |
1095 | while (c--) | 1095 | while (c--) | |
1096 | *p++ = *a++; | 1096 | *p++ = *a++; | |
1097 | } else { | 1097 | } else { | |
1098 | struct dino_softc *sc = v; | 1098 | struct dino_softc *sc = v; | |
1099 | volatile struct dino_regs *r = sc->sc_regs; | 1099 | volatile struct dino_regs *r = sc->sc_regs; | |
1100 | 1100 | |||
1101 | r->pci_addr = h & ~3; | 1101 | r->pci_addr = h & ~3; | |
1102 | while (c--) { | 1102 | while (c--) { | |
1103 | p = (volatile u_int8_t *)&r->pci_io_data + (h & 3); | 1103 | p = (volatile uint8_t *)&r->pci_io_data + (h & 3); | |
1104 | *p = *a++; | 1104 | *p = *a++; | |
1105 | if (!(++h & 3)) | 1105 | if (!(++h & 3)) | |
1106 | r->pci_addr = h; | 1106 | r->pci_addr = h; | |
1107 | } | 1107 | } | |
1108 | } | 1108 | } | |
1109 | } | 1109 | } | |
1110 | 1110 | |||
1111 | void | 1111 | void | |
1112 | dino_wr_2(void *v, bus_space_handle_t h, bus_size_t o, const u_int16_t *a, bus_size_t c) | 1112 | dino_wr_2(void *v, bus_space_handle_t h, bus_size_t o, const uint16_t *a, bus_size_t c) | |
1113 | { | 1113 | { | |
1114 | volatile u_int16_t *p; | 1114 | volatile uint16_t *p; | |
1115 | 1115 | |||
1116 | h += o; | 1116 | h += o; | |
1117 | if (h & 0xf0000000) { | 1117 | if (h & 0xf0000000) { | |
1118 | p = (volatile u_int16_t *)h; | 1118 | p = (volatile uint16_t *)h; | |
1119 | while (c--) | 1119 | while (c--) | |
1120 | *p++ = htole16(*a++); | 1120 | *p++ = htole16(*a++); | |
1121 | } else { | 1121 | } else { | |
1122 | struct dino_softc *sc = v; | 1122 | struct dino_softc *sc = v; | |
1123 | volatile struct dino_regs *r = sc->sc_regs; | 1123 | volatile struct dino_regs *r = sc->sc_regs; | |
1124 | 1124 | |||
1125 | r->pci_addr = h & ~3; | 1125 | r->pci_addr = h & ~3; | |
1126 | while (c--) { | 1126 | while (c--) { | |
1127 | p = (volatile u_int16_t *)&r->pci_io_data; | 1127 | p = (volatile uint16_t *)&r->pci_io_data; | |
1128 | if (h & 2) | 1128 | if (h & 2) | |
1129 | p++; | 1129 | p++; | |
1130 | *p = htole16(*a++); | 1130 | *p = htole16(*a++); | |
1131 | h += 2; | 1131 | h += 2; | |
1132 | if (!(h & 2)) | 1132 | if (!(h & 2)) | |
1133 | r->pci_addr = h; | 1133 | r->pci_addr = h; | |
1134 | } | 1134 | } | |
1135 | } | 1135 | } | |
1136 | } | 1136 | } | |
1137 | 1137 | |||
1138 | void | 1138 | void | |
1139 | dino_wr_4(void *v, bus_space_handle_t h, bus_size_t o, const u_int32_t *a, bus_size_t c) | 1139 | dino_wr_4(void *v, bus_space_handle_t h, bus_size_t o, const uint32_t *a, bus_size_t c) | |
1140 | { | 1140 | { | |
1141 | volatile u_int32_t *p; | 1141 | volatile uint32_t *p; | |
1142 | 1142 | |||
1143 | h += o; | 1143 | h += o; | |
1144 | if (h & 0xf0000000) { | 1144 | if (h & 0xf0000000) { | |
1145 | p = (volatile u_int32_t *)h; | 1145 | p = (volatile uint32_t *)h; | |
1146 | while (c--) | 1146 | while (c--) | |
1147 | *p++ = htole32(*a++); | 1147 | *p++ = htole32(*a++); | |
1148 | } else { | 1148 | } else { | |
1149 | struct dino_softc *sc = v; | 1149 | struct dino_softc *sc = v; | |
1150 | volatile struct dino_regs *r = sc->sc_regs; | 1150 | volatile struct dino_regs *r = sc->sc_regs; | |
1151 | 1151 | |||
1152 | for (; c--; h += 4) { | 1152 | for (; c--; h += 4) { | |
1153 | r->pci_addr = h; | 1153 | r->pci_addr = h; | |
1154 | r->pci_io_data = htole32(*a++); | 1154 | r->pci_io_data = htole32(*a++); | |
1155 | } | 1155 | } | |
1156 | } | 1156 | } | |
1157 | } | 1157 | } | |
1158 | 1158 | |||
1159 | void | 1159 | void | |
1160 | dino_wr_8(void *v, bus_space_handle_t h, bus_size_t o, const u_int64_t *a, bus_size_t c) | 1160 | dino_wr_8(void *v, bus_space_handle_t h, bus_size_t o, const uint64_t *a, bus_size_t c) | |
1161 | { | 1161 | { | |
1162 | panic("dino_wr_8: not implemented"); | 1162 | panic("dino_wr_8: not implemented"); | |
1163 | } | 1163 | } | |
1164 | 1164 | |||
1165 | void | 1165 | void | |
1166 | dino_rrr_2(void *v, bus_space_handle_t h, bus_size_t o, | 1166 | dino_rrr_2(void *v, bus_space_handle_t h, bus_size_t o, | |
1167 | u_int16_t *a, bus_size_t c) | 1167 | uint16_t *a, bus_size_t c) | |
1168 | { | 1168 | { | |
1169 | volatile u_int16_t *p; | 1169 | volatile uint16_t *p; | |
1170 | 1170 | |||
1171 | h += o; | 1171 | h += o; | |
1172 | if (h & 0xf0000000) { | 1172 | if (h & 0xf0000000) { | |
1173 | p = (volatile u_int16_t *)h; | 1173 | p = (volatile uint16_t *)h; | |
1174 | while (c--) | 1174 | while (c--) | |
1175 | *a++ = *p++; | 1175 | *a++ = *p++; | |
1176 | } else { | 1176 | } else { | |
1177 | struct dino_softc *sc = v; | 1177 | struct dino_softc *sc = v; | |
1178 | volatile struct dino_regs *r = sc->sc_regs; | 1178 | volatile struct dino_regs *r = sc->sc_regs; | |
1179 | 1179 | |||
1180 | r->pci_addr = h & ~3; | 1180 | r->pci_addr = h & ~3; | |
1181 | while (c--) { | 1181 | while (c--) { | |
1182 | p = (volatile u_int16_t *)&r->pci_io_data; | 1182 | p = (volatile uint16_t *)&r->pci_io_data; | |
1183 | if (h & 2) | 1183 | if (h & 2) | |
1184 | p++; | 1184 | p++; | |
1185 | *a++ = *p; | 1185 | *a++ = *p; | |
1186 | h += 2; | 1186 | h += 2; | |
1187 | if (!(h & 2)) | 1187 | if (!(h & 2)) | |
1188 | r->pci_addr = h; | 1188 | r->pci_addr = h; | |
1189 | } | 1189 | } | |
1190 | } | 1190 | } | |
1191 | } | 1191 | } | |
1192 | 1192 | |||
1193 | void | 1193 | void | |
1194 | dino_rrr_4(void *v, bus_space_handle_t h, bus_size_t o, | 1194 | dino_rrr_4(void *v, bus_space_handle_t h, bus_size_t o, | |
1195 | u_int32_t *a, bus_size_t c) | 1195 | uint32_t *a, bus_size_t c) | |
1196 | { | 1196 | { | |
1197 | volatile u_int32_t *p; | 1197 | volatile uint32_t *p; | |
1198 | 1198 | |||
1199 | h += o; | 1199 | h += o; | |
1200 | if (h & 0xf0000000) { | 1200 | if (h & 0xf0000000) { | |
1201 | p = (volatile u_int32_t *)h; | 1201 | p = (volatile uint32_t *)h; | |
1202 | while (c--) | 1202 | while (c--) | |
1203 | *a++ = *p++; | 1203 | *a++ = *p++; | |
1204 | } else { | 1204 | } else { | |
1205 | struct dino_softc *sc = v; | 1205 | struct dino_softc *sc = v; | |
1206 | volatile struct dino_regs *r = sc->sc_regs; | 1206 | volatile struct dino_regs *r = sc->sc_regs; | |
1207 | 1207 | |||
1208 | for (; c--; h += 4) { | 1208 | for (; c--; h += 4) { | |
1209 | r->pci_addr = h; | 1209 | r->pci_addr = h; | |
1210 | *a++ = r->pci_io_data; | 1210 | *a++ = r->pci_io_data; | |
1211 | } | 1211 | } | |
1212 | } | 1212 | } | |
1213 | } | 1213 | } | |
1214 | 1214 | |||
1215 | void | 1215 | void | |
1216 | dino_rrr_8(void *v, bus_space_handle_t h, bus_size_t o, | 1216 | dino_rrr_8(void *v, bus_space_handle_t h, bus_size_t o, | |
1217 | u_int64_t *a, bus_size_t c) | 1217 | uint64_t *a, bus_size_t c) | |
1218 | { | 1218 | { | |
1219 | panic("dino_rrr_8: not implemented"); | 1219 | panic("dino_rrr_8: not implemented"); | |
1220 | } | 1220 | } | |
1221 | 1221 | |||
1222 | void | 1222 | void | |
1223 | dino_wrr_2(void *v, bus_space_handle_t h, bus_size_t o, | 1223 | dino_wrr_2(void *v, bus_space_handle_t h, bus_size_t o, | |
1224 | const u_int16_t *a, bus_size_t c) | 1224 | const uint16_t *a, bus_size_t c) | |
1225 | { | 1225 | { | |
1226 | volatile u_int16_t *p; | 1226 | volatile uint16_t *p; | |
1227 | 1227 | |||
1228 | h += o; | 1228 | h += o; | |
1229 | if (h & 0xf0000000) { | 1229 | if (h & 0xf0000000) { | |
1230 | p = (volatile u_int16_t *)h; | 1230 | p = (volatile uint16_t *)h; | |
1231 | while (c--) | 1231 | while (c--) | |
1232 | *p++ = *a++; | 1232 | *p++ = *a++; | |
1233 | } else { | 1233 | } else { | |
1234 | struct dino_softc *sc = v; | 1234 | struct dino_softc *sc = v; | |
1235 | volatile struct dino_regs *r = sc->sc_regs; | 1235 | volatile struct dino_regs *r = sc->sc_regs; | |
1236 | 1236 | |||
1237 | r->pci_addr = h & ~3; | 1237 | r->pci_addr = h & ~3; | |
1238 | while (c--) { | 1238 | while (c--) { | |
1239 | p = (volatile u_int16_t *)&r->pci_io_data; | 1239 | p = (volatile uint16_t *)&r->pci_io_data; | |
1240 | if (h & 2) | 1240 | if (h & 2) | |
1241 | p++; | 1241 | p++; | |
1242 | *p = *a++; | 1242 | *p = *a++; | |
1243 | h += 2; | 1243 | h += 2; | |
1244 | if (!(h & 2)) | 1244 | if (!(h & 2)) | |
1245 | r->pci_addr = h; | 1245 | r->pci_addr = h; | |
1246 | } | 1246 | } | |
1247 | } | 1247 | } | |
1248 | } | 1248 | } | |
1249 | 1249 | |||
1250 | void | 1250 | void | |
1251 | dino_wrr_4(void *v, bus_space_handle_t h, bus_size_t o, | 1251 | dino_wrr_4(void *v, bus_space_handle_t h, bus_size_t o, | |
1252 | const u_int32_t *a, bus_size_t c) | 1252 | const uint32_t *a, bus_size_t c) | |
1253 | { | 1253 | { | |
1254 | volatile u_int32_t *p; | 1254 | volatile uint32_t *p; | |
1255 | 1255 | |||
1256 | h += o; | 1256 | h += o; | |
1257 | if (h & 0xf0000000) { | 1257 | if (h & 0xf0000000) { | |
1258 | p = (volatile u_int32_t *)h; | 1258 | p = (volatile uint32_t *)h; | |
1259 | while (c--) | 1259 | while (c--) | |
1260 | *p++ = *a++; | 1260 | *p++ = *a++; | |
1261 | } else { | 1261 | } else { | |
1262 | struct dino_softc *sc = v; | 1262 | struct dino_softc *sc = v; | |
1263 | volatile struct dino_regs *r = sc->sc_regs; | 1263 | volatile struct dino_regs *r = sc->sc_regs; | |
1264 | 1264 | |||
1265 | for (; c--; h += 4) { | 1265 | for (; c--; h += 4) { | |
1266 | r->pci_addr = h; | 1266 | r->pci_addr = h; | |
1267 | r->pci_io_data = *a++; | 1267 | r->pci_io_data = *a++; | |
1268 | } | 1268 | } | |
1269 | } | 1269 | } | |
1270 | } | 1270 | } | |
1271 | 1271 | |||
1272 | void | 1272 | void | |
1273 | dino_wrr_8(void *v, bus_space_handle_t h, bus_size_t o, | 1273 | dino_wrr_8(void *v, bus_space_handle_t h, bus_size_t o, | |
1274 | const u_int64_t *a, bus_size_t c) | 1274 | const uint64_t *a, bus_size_t c) | |
1275 | { | 1275 | { | |
1276 | panic("dino_wrr_8: not implemented"); | 1276 | panic("dino_wrr_8: not implemented"); | |
1277 | } | 1277 | } | |
1278 | 1278 | |||
1279 | void | 1279 | void | |
1280 | dino_sr_1(void *v, bus_space_handle_t h, bus_size_t o, u_int8_t vv, bus_size_t c) | 1280 | dino_sr_1(void *v, bus_space_handle_t h, bus_size_t o, uint8_t vv, bus_size_t c) | |
1281 | { | 1281 | { | |
1282 | volatile u_int8_t *p; | 1282 | volatile uint8_t *p; | |
1283 | 1283 | |||
1284 | h += o; | 1284 | h += o; | |
1285 | if (h & 0xf0000000) { | 1285 | if (h & 0xf0000000) { | |
1286 | p = (volatile u_int8_t *)h; | 1286 | p = (volatile uint8_t *)h; | |
1287 | while (c--) | 1287 | while (c--) | |
1288 | *p++ = vv; | 1288 | *p++ = vv; | |
1289 | } else { | 1289 | } else { | |
1290 | struct dino_softc *sc = v; | 1290 | struct dino_softc *sc = v; | |
1291 | volatile struct dino_regs *r = sc->sc_regs; | 1291 | volatile struct dino_regs *r = sc->sc_regs; | |
1292 | 1292 | |||
1293 | r->pci_addr = h & ~3; | 1293 | r->pci_addr = h & ~3; | |
1294 | while (c--) { | 1294 | while (c--) { | |
1295 | p = (volatile u_int8_t *)&r->pci_io_data + (h & 3); | 1295 | p = (volatile uint8_t *)&r->pci_io_data + (h & 3); | |
1296 | *p = vv; | 1296 | *p = vv; | |
1297 | if (!(++h & 3)) | 1297 | if (!(++h & 3)) | |
1298 | r->pci_addr = h; | 1298 | r->pci_addr = h; | |
1299 | } | 1299 | } | |
1300 | } | 1300 | } | |
1301 | } | 1301 | } | |
1302 | 1302 | |||
1303 | void | 1303 | void | |
1304 | dino_sr_2(void *v, bus_space_handle_t h, bus_size_t o, u_int16_t vv, bus_size_t c) | 1304 | dino_sr_2(void *v, bus_space_handle_t h, bus_size_t o, uint16_t vv, bus_size_t c) | |
1305 | { | 1305 | { | |
1306 | volatile u_int16_t *p; | 1306 | volatile uint16_t *p; | |
1307 | 1307 | |||
1308 | h += o; | 1308 | h += o; | |
1309 | if (h & 0xf0000000) { | 1309 | if (h & 0xf0000000) { | |
1310 | p = (volatile u_int16_t *)h; | 1310 | p = (volatile uint16_t *)h; | |
1311 | while (c--) | 1311 | while (c--) | |
1312 | *p++ = htole16(vv); | 1312 | *p++ = htole16(vv); | |
1313 | } else { | 1313 | } else { | |
1314 | struct dino_softc *sc = v; | 1314 | struct dino_softc *sc = v; | |
1315 | volatile struct dino_regs *r = sc->sc_regs; | 1315 | volatile struct dino_regs *r = sc->sc_regs; | |
1316 | 1316 | |||
1317 | r->pci_addr = h & ~3; | 1317 | r->pci_addr = h & ~3; | |
1318 | while (c--) { | 1318 | while (c--) { | |
1319 | p = (volatile u_int16_t *)&r->pci_io_data; | 1319 | p = (volatile uint16_t *)&r->pci_io_data; | |
1320 | if (h & 2) | 1320 | if (h & 2) | |
1321 | p++; | 1321 | p++; | |
1322 | *p = htole16(vv); | 1322 | *p = htole16(vv); | |
1323 | h += 2; | 1323 | h += 2; | |
1324 | if (!(h & 2)) | 1324 | if (!(h & 2)) | |
1325 | r->pci_addr = h; | 1325 | r->pci_addr = h; | |
1326 | } | 1326 | } | |
1327 | } | 1327 | } | |
1328 | } | 1328 | } | |
1329 | 1329 | |||
1330 | void | 1330 | void | |
1331 | dino_sr_4(void *v, bus_space_handle_t h, bus_size_t o, u_int32_t vv, bus_size_t c) | 1331 | dino_sr_4(void *v, bus_space_handle_t h, bus_size_t o, uint32_t vv, bus_size_t c) | |
1332 | { | 1332 | { | |
1333 | volatile u_int32_t *p; | 1333 | volatile uint32_t *p; | |
1334 | 1334 | |||
1335 | h += o; | 1335 | h += o; | |
1336 | if (h & 0xf0000000) { | 1336 | if (h & 0xf0000000) { | |
1337 | p = (volatile u_int32_t *)h; | 1337 | p = (volatile uint32_t *)h; | |
1338 | while (c--) | 1338 | while (c--) | |
1339 | *p++ = htole32(vv); | 1339 | *p++ = htole32(vv); | |
1340 | } else { | 1340 | } else { | |
1341 | struct dino_softc *sc = v; | 1341 | struct dino_softc *sc = v; | |
1342 | volatile struct dino_regs *r = sc->sc_regs; | 1342 | volatile struct dino_regs *r = sc->sc_regs; | |
1343 | 1343 | |||
1344 | for (; c--; h += 4) { | 1344 | for (; c--; h += 4) { | |
1345 | r->pci_addr = h; | 1345 | r->pci_addr = h; | |
1346 | r->pci_io_data = htole32(vv); | 1346 | r->pci_io_data = htole32(vv); | |
1347 | } | 1347 | } | |
1348 | } | 1348 | } | |
1349 | } | 1349 | } | |
1350 | 1350 | |||
1351 | void | 1351 | void | |
1352 | dino_sr_8(void *v, bus_space_handle_t h, bus_size_t o, u_int64_t vv, bus_size_t c) | 1352 | dino_sr_8(void *v, bus_space_handle_t h, bus_size_t o, uint64_t vv, bus_size_t c) | |
1353 | { | 1353 | { | |
1354 | panic("dino_sr_8: not implemented"); | 1354 | panic("dino_sr_8: not implemented"); | |
1355 | } | 1355 | } | |
1356 | 1356 | |||
1357 | void | 1357 | void | |
1358 | dino_cp_1(void *v, bus_space_handle_t h1, bus_size_t o1, | 1358 | dino_cp_1(void *v, bus_space_handle_t h1, bus_size_t o1, | |
1359 | bus_space_handle_t h2, bus_size_t o2, bus_size_t c) | 1359 | bus_space_handle_t h2, bus_size_t o2, bus_size_t c) | |
1360 | { | 1360 | { | |
1361 | while (c--) | 1361 | while (c--) | |
1362 | dino_w1(v, h1, o1++, dino_r1(v, h2, o2++)); | 1362 | dino_w1(v, h1, o1++, dino_r1(v, h2, o2++)); | |
1363 | } | 1363 | } | |
1364 | 1364 | |||
1365 | void | 1365 | void |
--- src/sys/arch/hp700/dev/Attic/wax.c 2009/05/08 09:33:58 1.12
+++ src/sys/arch/hp700/dev/Attic/wax.c 2009/05/24 06:53:34 1.13
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: wax.c,v 1.12 2009/05/08 09:33:58 skrll Exp $ */ | 1 | /* $NetBSD: wax.c,v 1.13 2009/05/24 06:53:34 skrll Exp $ */ | |
2 | 2 | |||
3 | /* $OpenBSD: wax.c,v 1.1 1998/11/23 03:04:10 mickey Exp $ */ | 3 | /* $OpenBSD: wax.c,v 1.1 1998/11/23 03:04:10 mickey Exp $ */ | |
4 | 4 | |||
5 | /* | 5 | /* | |
6 | * Copyright (c) 1998 Michael Shalayeff | 6 | * Copyright (c) 1998 Michael Shalayeff | |
7 | * All rights reserved. | 7 | * All rights reserved. | |
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 | |
@@ -23,49 +23,49 @@ | @@ -23,49 +23,49 @@ | |||
23 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR | 23 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR | |
24 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | 24 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |
25 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | 25 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | |
26 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | 26 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | |
27 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | 27 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | |
28 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 28 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
29 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 29 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
30 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 30 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
31 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 31 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | |
32 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 32 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
33 | */ | 33 | */ | |
34 | 34 | |||
35 | #include <sys/cdefs.h> | 35 | #include <sys/cdefs.h> | |
36 | __KERNEL_RCSID(0, "$NetBSD: wax.c,v 1.12 2009/05/08 09:33:58 skrll Exp $"); | 36 | __KERNEL_RCSID(0, "$NetBSD: wax.c,v 1.13 2009/05/24 06:53:34 skrll 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 | #include <sys/reboot.h> | 41 | #include <sys/reboot.h> | |
42 | 42 | |||
43 | #include <machine/iomod.h> | 43 | #include <machine/iomod.h> | |
44 | #include <machine/autoconf.h> | 44 | #include <machine/autoconf.h> | |
45 | 45 | |||
46 | #include <hp700/dev/cpudevs.h> | 46 | #include <hp700/dev/cpudevs.h> | |
47 | 47 | |||
48 | #include <hp700/gsc/gscbusvar.h> | 48 | #include <hp700/gsc/gscbusvar.h> | |
49 | 49 | |||
50 | #define WAX_IOMASK 0xfff00000 | 50 | #define WAX_IOMASK 0xfff00000 | |
51 | #define WAX_REGS 0xc000 | 51 | #define WAX_REGS 0xc000 | |
52 | 52 | |||
53 | struct wax_regs { | 53 | struct wax_regs { | |
54 | u_int32_t wax_irr; /* int requset register */ | 54 | uint32_t wax_irr; /* int requset register */ | |
55 | u_int32_t wax_imr; /* int mask register */ | 55 | uint32_t wax_imr; /* int mask register */ | |
56 | u_int32_t wax_ipr; /* int pending register */ | 56 | uint32_t wax_ipr; /* int pending register */ | |
57 | u_int32_t wax_icr; /* int control register */ | 57 | uint32_t wax_icr; /* int control register */ | |
58 | u_int32_t wax_iar; /* int address register */ | 58 | uint32_t wax_iar; /* int address register */ | |
59 | }; | 59 | }; | |
60 | 60 | |||
61 | struct wax_softc { | 61 | struct wax_softc { | |
62 | device_t sc_dv; | 62 | device_t sc_dv; | |
63 | struct hp700_int_reg sc_int_reg; | 63 | struct hp700_int_reg sc_int_reg; | |
64 | struct wax_regs volatile *sc_regs; | 64 | struct wax_regs volatile *sc_regs; | |
65 | }; | 65 | }; | |
66 | 66 | |||
67 | int waxmatch(device_t, cfdata_t, void *); | 67 | int waxmatch(device_t, cfdata_t, void *); | |
68 | void waxattach(device_t, device_t, void *); | 68 | void waxattach(device_t, device_t, void *); | |
69 | 69 | |||
70 | 70 | |||
71 | CFATTACH_DECL_NEW(wax, sizeof(struct wax_softc), | 71 | CFATTACH_DECL_NEW(wax, sizeof(struct wax_softc), |
--- src/sys/arch/hp700/dev/Attic/mongoose.c 2009/05/12 19:35:59 1.14
+++ src/sys/arch/hp700/dev/Attic/mongoose.c 2009/05/24 06:53:34 1.15
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: mongoose.c,v 1.14 2009/05/12 19:35:59 skrll Exp $ */ | 1 | /* $NetBSD: mongoose.c,v 1.15 2009/05/24 06:53:34 skrll Exp $ */ | |
2 | 2 | |||
3 | /* $OpenBSD: mongoose.c,v 1.7 2000/08/15 19:42:56 mickey Exp $ */ | 3 | /* $OpenBSD: mongoose.c,v 1.7 2000/08/15 19:42:56 mickey Exp $ */ | |
4 | 4 | |||
5 | /* | 5 | /* | |
6 | * Copyright (c) 1998,1999 Michael Shalayeff | 6 | * Copyright (c) 1998,1999 Michael Shalayeff | |
7 | * All rights reserved. | 7 | * All rights reserved. | |
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 | |
@@ -24,150 +24,150 @@ | @@ -24,150 +24,150 @@ | |||
24 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | 24 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |
25 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | 25 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | |
26 | * IN NO EVENT SHALL THE AUTHOR OR HIS RELATIVES BE LIABLE FOR ANY DIRECT, | 26 | * IN NO EVENT SHALL THE AUTHOR OR HIS RELATIVES BE LIABLE FOR ANY DIRECT, | |
27 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 27 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | |
28 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | 28 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |
29 | * SERVICES; LOSS OF MIND, USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | 29 | * SERVICES; LOSS OF MIND, USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
30 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | 30 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | |
31 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING | 31 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING | |
32 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF | 32 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF | |
33 | * THE POSSIBILITY OF SUCH DAMAGE. | 33 | * THE POSSIBILITY OF SUCH DAMAGE. | |
34 | */ | 34 | */ | |
35 | 35 | |||
36 | #include <sys/cdefs.h> | 36 | #include <sys/cdefs.h> | |
37 | __KERNEL_RCSID(0, "$NetBSD: mongoose.c,v 1.14 2009/05/12 19:35:59 skrll Exp $"); | 37 | __KERNEL_RCSID(0, "$NetBSD: mongoose.c,v 1.15 2009/05/24 06:53:34 skrll Exp $"); | |
38 | 38 | |||
39 | #define MONGOOSE_DEBUG 9 | 39 | #define MONGOOSE_DEBUG 9 | |
40 | 40 | |||
41 | #include <sys/param.h> | 41 | #include <sys/param.h> | |
42 | #include <sys/systm.h> | 42 | #include <sys/systm.h> | |
43 | #include <sys/device.h> | 43 | #include <sys/device.h> | |
44 | #include <sys/reboot.h> | 44 | #include <sys/reboot.h> | |
45 | 45 | |||
46 | #include <machine/bus.h> | 46 | #include <machine/bus.h> | |
47 | #include <machine/iomod.h> | 47 | #include <machine/iomod.h> | |
48 | #include <machine/autoconf.h> | 48 | #include <machine/autoconf.h> | |
49 | 49 | |||
50 | #include <hp700/hp700/intr.h> | 50 | #include <hp700/hp700/intr.h> | |
51 | #include <hp700/dev/cpudevs.h> | 51 | #include <hp700/dev/cpudevs.h> | |
52 | #include <hp700/dev/viper.h> | 52 | #include <hp700/dev/viper.h> | |
53 | 53 | |||
54 | #include <dev/eisa/eisareg.h> | 54 | #include <dev/eisa/eisareg.h> | |
55 | #include <dev/eisa/eisavar.h> | 55 | #include <dev/eisa/eisavar.h> | |
56 | 56 | |||
57 | #include <dev/isa/isareg.h> | 57 | #include <dev/isa/isareg.h> | |
58 | #include <dev/isa/isavar.h> | 58 | #include <dev/isa/isavar.h> | |
59 | 59 | |||
60 | /* EISA Bus Adapter registers definitions */ | 60 | /* EISA Bus Adapter registers definitions */ | |
61 | #define MONGOOSE_MONGOOSE 0x10000 | 61 | #define MONGOOSE_MONGOOSE 0x10000 | |
62 | struct mongoose_regs { | 62 | struct mongoose_regs { | |
63 | u_int8_t version; | 63 | uint8_t version; | |
64 | u_int8_t lock; | 64 | uint8_t lock; | |
65 | u_int8_t liowait; | 65 | uint8_t liowait; | |
66 | u_int8_t clock; | 66 | uint8_t clock; | |
67 | u_int8_t reserved[0xf000 - 4]; | 67 | uint8_t reserved[0xf000 - 4]; | |
68 | u_int8_t intack; | 68 | uint8_t intack; | |
69 | }; | 69 | }; | |
70 | 70 | |||
71 | #define MONGOOSE_CTRL 0x00000 | 71 | #define MONGOOSE_CTRL 0x00000 | |
72 | #define MONGOOSE_NINTS 16 | 72 | #define MONGOOSE_NINTS 16 | |
73 | struct mongoose_ctrl { | 73 | struct mongoose_ctrl { | |
74 | struct dma0 { | 74 | struct dma0 { | |
75 | struct { | 75 | struct { | |
76 | u_int32_t addr : 8; | 76 | uint32_t addr : 8; | |
77 | u_int32_t count: 8; | 77 | uint32_t count: 8; | |
78 | } ch[4]; | 78 | } ch[4]; | |
79 | u_int8_t command; | 79 | uint8_t command; | |
80 | u_int8_t request; | 80 | uint8_t request; | |
81 | u_int8_t mask_channel; | 81 | uint8_t mask_channel; | |
82 | u_int8_t mode; | 82 | uint8_t mode; | |
83 | u_int8_t clr_byte_ptr; | 83 | uint8_t clr_byte_ptr; | |
84 | u_int8_t master_clear; | 84 | uint8_t master_clear; | |
85 | u_int8_t mask_clear; | 85 | uint8_t mask_clear; | |
86 | u_int8_t master_write; | 86 | uint8_t master_write; | |
87 | u_int8_t pad[8]; | 87 | uint8_t pad[8]; | |
88 | } dma0; | 88 | } dma0; | |
89 | 89 | |||
90 | u_int8_t irr0; /* 0x20 */ | 90 | uint8_t irr0; /* 0x20 */ | |
91 | u_int8_t imr0; | 91 | uint8_t imr0; | |
92 | u_int8_t iack; /* 0x22 -- 2 b2b reads generate | 92 | uint8_t iack; /* 0x22 -- 2 b2b reads generate | |
93 | (e)isa Iack cycle & returns int level */ | 93 | (e)isa Iack cycle & returns int level */ | |
94 | u_int8_t pad0[29]; | 94 | uint8_t pad0[29]; | |
95 | 95 | |||
96 | struct timers { | 96 | struct timers { | |
97 | u_int8_t sysclk; | 97 | uint8_t sysclk; | |
98 | u_int8_t refresh; | 98 | uint8_t refresh; | |
99 | u_int8_t spkr; | 99 | uint8_t spkr; | |
100 | u_int8_t ctrl; | 100 | uint8_t ctrl; | |
101 | u_int32_t pad; | 101 | uint32_t pad; | |
102 | } tmr[2]; /* 0x40 -- timers control */ | 102 | } tmr[2]; /* 0x40 -- timers control */ | |
103 | u_int8_t pad1[16]; | 103 | uint8_t pad1[16]; | |
104 | 104 | |||
105 | u_int16_t inmi; /* 0x60 NMI control */ | 105 | uint16_t inmi; /* 0x60 NMI control */ | |
106 | u_int8_t pad2[30]; | 106 | uint8_t pad2[30]; | |
107 | struct { | 107 | struct { | |
108 | u_int8_t pad0; | 108 | uint8_t pad0; | |
109 | u_int8_t ch2; | 109 | uint8_t ch2; | |
110 | u_int8_t ch3; | 110 | uint8_t ch3; | |
111 | u_int8_t ch1; | 111 | uint8_t ch1; | |
112 | u_int8_t pad1; | 112 | uint8_t pad1; | |
113 | u_int8_t pad2[3]; | 113 | uint8_t pad2[3]; | |
114 | u_int8_t ch0; | 114 | uint8_t ch0; | |
115 | u_int8_t pad4; | 115 | uint8_t pad4; | |
116 | u_int8_t ch6; | 116 | uint8_t ch6; | |
117 | u_int8_t ch7; | 117 | uint8_t ch7; | |
118 | u_int8_t ch5; | 118 | uint8_t ch5; | |
119 | u_int8_t pad5[3]; | 119 | uint8_t pad5[3]; | |
120 | u_int8_t pad6[16]; | 120 | uint8_t pad6[16]; | |
121 | } pr; /* 0x80 */ | 121 | } pr; /* 0x80 */ | |
122 | 122 | |||
123 | u_int8_t irr1; /* 0xa0 */ | 123 | uint8_t irr1; /* 0xa0 */ | |
124 | u_int8_t imr1; | 124 | uint8_t imr1; | |
125 | u_int8_t pad3[30]; | 125 | uint8_t pad3[30]; | |
126 | 126 | |||
127 | struct dma1 { | 127 | struct dma1 { | |
128 | struct { | 128 | struct { | |
129 | u_int32_t addr : 8; | 129 | uint32_t addr : 8; | |
130 | u_int32_t pad0 : 8; | 130 | uint32_t pad0 : 8; | |
131 | u_int32_t count: 8; | 131 | uint32_t count: 8; | |
132 | u_int32_t pad1 : 8; | 132 | uint32_t pad1 : 8; | |
133 | } ch[4]; | 133 | } ch[4]; | |
134 | u_int8_t command; | 134 | uint8_t command; | |
135 | u_int8_t pad0; | 135 | uint8_t pad0; | |
136 | u_int8_t request; | 136 | uint8_t request; | |
137 | u_int8_t pad1; | 137 | uint8_t pad1; | |
138 | u_int8_t mask_channel; | 138 | uint8_t mask_channel; | |
139 | u_int8_t pad2; | 139 | uint8_t pad2; | |
140 | u_int8_t mode; | 140 | uint8_t mode; | |
141 | u_int8_t pad3; | 141 | uint8_t pad3; | |
142 | u_int8_t clr_byte_ptr; | 142 | uint8_t clr_byte_ptr; | |
143 | u_int8_t pad4; | 143 | uint8_t pad4; | |
144 | u_int8_t master_clear; | 144 | uint8_t master_clear; | |
145 | u_int8_t pad5; | 145 | uint8_t pad5; | |
146 | u_int8_t mask_clear; | 146 | uint8_t mask_clear; | |
147 | u_int8_t pad6; | 147 | uint8_t pad6; | |
148 | u_int8_t master_write; | 148 | uint8_t master_write; | |
149 | u_int8_t pad7; | 149 | uint8_t pad7; | |
150 | } dma1; /* 0xc0 */ | 150 | } dma1; /* 0xc0 */ | |
151 | 151 | |||
152 | u_int8_t master_req; /* 0xe0 master request register */ | 152 | uint8_t master_req; /* 0xe0 master request register */ | |
153 | u_int8_t pad4[31]; | 153 | uint8_t pad4[31]; | |
154 | 154 | |||
155 | u_int8_t pad5[0x3d0]; /* 0x4d0 */ | 155 | uint8_t pad5[0x3d0]; /* 0x4d0 */ | |
156 | u_int8_t pic0; /* 0 - edge, 1 - level */ | 156 | uint8_t pic0; /* 0 - edge, 1 - level */ | |
157 | u_int8_t pic1; | 157 | uint8_t pic1; | |
158 | u_int8_t pad6[0x460]; | 158 | uint8_t pad6[0x460]; | |
159 | u_int8_t nmi; | 159 | uint8_t nmi; | |
160 | u_int8_t nmi_ext; | 160 | uint8_t nmi_ext; | |
161 | #define MONGOOSE_NMI_BUSRESET 0x01 | 161 | #define MONGOOSE_NMI_BUSRESET 0x01 | |
162 | #define MONGOOSE_NMI_IOPORT_EN 0x02 | 162 | #define MONGOOSE_NMI_IOPORT_EN 0x02 | |
163 | #define MONGOOSE_NMI_EN 0x04 | 163 | #define MONGOOSE_NMI_EN 0x04 | |
164 | #define MONGOOSE_NMI_MTMO_EN 0x08 | 164 | #define MONGOOSE_NMI_MTMO_EN 0x08 | |
165 | #define MONGOOSE_NMI_RES4 0x10 | 165 | #define MONGOOSE_NMI_RES4 0x10 | |
166 | #define MONGOOSE_NMI_IOPORT_INT 0x20 | 166 | #define MONGOOSE_NMI_IOPORT_INT 0x20 | |
167 | #define MONGOOSE_NMI_MASTER_INT 0x40 | 167 | #define MONGOOSE_NMI_MASTER_INT 0x40 | |
168 | #define MONGOOSE_NMI_INT 0x80 | 168 | #define MONGOOSE_NMI_INT 0x80 | |
169 | }; | 169 | }; | |
170 | 170 | |||
171 | #define MONGOOSE_IOMAP 0x100000 | 171 | #define MONGOOSE_IOMAP 0x100000 | |
172 | 172 | |||
173 | struct hppa_isa_iv { | 173 | struct hppa_isa_iv { | |
@@ -211,42 +211,42 @@ union mongoose_attach_args { | @@ -211,42 +211,42 @@ union mongoose_attach_args { | |||
211 | 211 | |||
212 | void mg_eisa_attach_hook(device_t, device_t, struct eisabus_attach_args *); | 212 | void mg_eisa_attach_hook(device_t, device_t, struct eisabus_attach_args *); | |
213 | int mg_intr_map(void *, u_int, eisa_intr_handle_t *); | 213 | int mg_intr_map(void *, u_int, eisa_intr_handle_t *); | |
214 | const char *mg_intr_string(void *, int); | 214 | const char *mg_intr_string(void *, int); | |
215 | void mg_isa_attach_hook(device_t, device_t, struct isabus_attach_args *); | 215 | void mg_isa_attach_hook(device_t, device_t, struct isabus_attach_args *); | |
216 | void *mg_intr_establish(void *, int, int, int, int (*)(void *), void *); | 216 | void *mg_intr_establish(void *, int, int, int, int (*)(void *), void *); | |
217 | void mg_intr_disestablish(void *, void *); | 217 | void mg_intr_disestablish(void *, void *); | |
218 | int mg_intr_check(void *, int, int); | 218 | int mg_intr_check(void *, int, int); | |
219 | int mg_intr(void *); | 219 | int mg_intr(void *); | |
220 | int mg_eisa_iomap(void *, bus_addr_t, bus_size_t, int, bus_space_handle_t *); | 220 | int mg_eisa_iomap(void *, bus_addr_t, bus_size_t, int, bus_space_handle_t *); | |
221 | int mg_eisa_memmap(void *, bus_addr_t, bus_size_t, int, bus_space_handle_t *); | 221 | int mg_eisa_memmap(void *, bus_addr_t, bus_size_t, int, bus_space_handle_t *); | |
222 | void mg_eisa_memunmap(void *, bus_space_handle_t, bus_size_t); | 222 | void mg_eisa_memunmap(void *, bus_space_handle_t, bus_size_t); | |
223 | void mg_isa_barrier(void *, bus_space_handle_t, bus_size_t, bus_size_t, int); | 223 | void mg_isa_barrier(void *, bus_space_handle_t, bus_size_t, bus_size_t, int); | |
224 | u_int16_t mg_isa_r2(void *, bus_space_handle_t, bus_size_t); | 224 | uint16_t mg_isa_r2(void *, bus_space_handle_t, bus_size_t); | |
225 | u_int32_t mg_isa_r4(void *, bus_space_handle_t, bus_size_t); | 225 | uint32_t mg_isa_r4(void *, bus_space_handle_t, bus_size_t); | |
226 | void mg_isa_w2(void *, bus_space_handle_t, bus_size_t, u_int16_t); | 226 | void mg_isa_w2(void *, bus_space_handle_t, bus_size_t, uint16_t); | |
227 | void mg_isa_w4(void *, bus_space_handle_t, bus_size_t, u_int32_t); | 227 | void mg_isa_w4(void *, bus_space_handle_t, bus_size_t, uint32_t); | |
228 | void mg_isa_rm_2(void *, bus_space_handle_t, bus_size_t, u_int16_t *, bus_size_t); | 228 | void mg_isa_rm_2(void *, bus_space_handle_t, bus_size_t, uint16_t *, bus_size_t); | |
229 | void mg_isa_rm_4(void *, bus_space_handle_t, bus_size_t, u_int32_t *, bus_size_t); | 229 | void mg_isa_rm_4(void *, bus_space_handle_t, bus_size_t, uint32_t *, bus_size_t); | |
230 | void mg_isa_wm_2(void *, bus_space_handle_t, bus_size_t, const u_int16_t *, bus_size_t); | 230 | void mg_isa_wm_2(void *, bus_space_handle_t, bus_size_t, const uint16_t *, bus_size_t); | |
231 | void mg_isa_wm_4(void *, bus_space_handle_t, bus_size_t, const u_int32_t *, bus_size_t); | 231 | void mg_isa_wm_4(void *, bus_space_handle_t, bus_size_t, const uint32_t *, bus_size_t); | |
232 | void mg_isa_sm_2(void *, bus_space_handle_t, bus_size_t, u_int16_t, bus_size_t); | 232 | void mg_isa_sm_2(void *, bus_space_handle_t, bus_size_t, uint16_t, bus_size_t); | |
233 | void mg_isa_sm_4(void *, bus_space_handle_t, bus_size_t, u_int32_t, bus_size_t); | 233 | void mg_isa_sm_4(void *, bus_space_handle_t, bus_size_t, uint32_t, bus_size_t); | |
234 | void mg_isa_rr_2(void *, bus_space_handle_t, bus_size_t, u_int16_t *, bus_size_t); | 234 | void mg_isa_rr_2(void *, bus_space_handle_t, bus_size_t, uint16_t *, bus_size_t); | |
235 | void mg_isa_rr_4(void *, bus_space_handle_t, bus_size_t, u_int32_t *, bus_size_t); | 235 | void mg_isa_rr_4(void *, bus_space_handle_t, bus_size_t, uint32_t *, bus_size_t); | |
236 | void mg_isa_wr_2(void *, bus_space_handle_t, bus_size_t, const u_int16_t *, bus_size_t); | 236 | void mg_isa_wr_2(void *, bus_space_handle_t, bus_size_t, const uint16_t *, bus_size_t); | |
237 | void mg_isa_wr_4(void *, bus_space_handle_t, bus_size_t, const u_int32_t *, bus_size_t); | 237 | void mg_isa_wr_4(void *, bus_space_handle_t, bus_size_t, const uint32_t *, bus_size_t); | |
238 | void mg_isa_sr_2(void *, bus_space_handle_t, bus_size_t, u_int16_t, bus_size_t); | 238 | void mg_isa_sr_2(void *, bus_space_handle_t, bus_size_t, uint16_t, bus_size_t); | |
239 | void mg_isa_sr_4(void *, bus_space_handle_t, bus_size_t, u_int32_t, bus_size_t); | 239 | void mg_isa_sr_4(void *, bus_space_handle_t, bus_size_t, uint32_t, bus_size_t); | |
240 | 240 | |||
241 | int mgmatch(device_t, cfdata_t, void *); | 241 | int mgmatch(device_t, cfdata_t, void *); | |
242 | void mgattach(device_t, device_t, void *); | 242 | void mgattach(device_t, device_t, void *); | |
243 | 243 | |||
244 | CFATTACH_DECL_NEW(mongoose, sizeof(struct mongoose_softc), | 244 | CFATTACH_DECL_NEW(mongoose, sizeof(struct mongoose_softc), | |
245 | mgmatch, mgattach, NULL, NULL); | 245 | mgmatch, mgattach, NULL, NULL); | |
246 | 246 | |||
247 | /* TODO: DMA guts */ | 247 | /* TODO: DMA guts */ | |
248 | 248 | |||
249 | void | 249 | void | |
250 | mg_eisa_attach_hook(device_t parent, device_t self, | 250 | mg_eisa_attach_hook(device_t parent, device_t self, | |
251 | struct eisabus_attach_args *mg) | 251 | struct eisabus_attach_args *mg) | |
252 | { | 252 | { | |
@@ -271,27 +271,27 @@ mg_intr_string(void *v, int irq) | @@ -271,27 +271,27 @@ mg_intr_string(void *v, int irq) | |||
271 | void | 271 | void | |
272 | mg_isa_attach_hook(device_t parent, device_t self, | 272 | mg_isa_attach_hook(device_t parent, device_t self, | |
273 | struct isabus_attach_args *iba) | 273 | struct isabus_attach_args *iba) | |
274 | { | 274 | { | |
275 | 275 | |||
276 | } | 276 | } | |
277 | 277 | |||
278 | void * | 278 | void * | |
279 | mg_intr_establish(void *v, int irq, int type, int pri, | 279 | mg_intr_establish(void *v, int irq, int type, int pri, | |
280 | int (*handler)(void *), void *arg) | 280 | int (*handler)(void *), void *arg) | |
281 | { | 281 | { | |
282 | struct hppa_isa_iv *iv; | 282 | struct hppa_isa_iv *iv; | |
283 | struct mongoose_softc *sc = v; | 283 | struct mongoose_softc *sc = v; | |
284 | volatile u_int8_t *imr, *pic; | 284 | volatile uint8_t *imr, *pic; | |
285 | 285 | |||
286 | if (!sc || irq < 0 || irq >= MONGOOSE_NINTS || | 286 | if (!sc || irq < 0 || irq >= MONGOOSE_NINTS || | |
287 | (0 <= irq && irq < MONGOOSE_NINTS && sc->sc_iv[irq].iv_handler)) | 287 | (0 <= irq && irq < MONGOOSE_NINTS && sc->sc_iv[irq].iv_handler)) | |
288 | return NULL; | 288 | return NULL; | |
289 | 289 | |||
290 | if (type != IST_LEVEL && type != IST_EDGE) { | 290 | if (type != IST_LEVEL && type != IST_EDGE) { | |
291 | aprint_debug_dev(sc->sc_dev, "bad interrupt level (%d)\n", | 291 | aprint_debug_dev(sc->sc_dev, "bad interrupt level (%d)\n", | |
292 | type); | 292 | type); | |
293 | return NULL; | 293 | return NULL; | |
294 | } | 294 | } | |
295 | 295 | |||
296 | iv = &sc->sc_iv[irq]; | 296 | iv = &sc->sc_iv[irq]; | |
297 | if (iv->iv_handler) { | 297 | if (iv->iv_handler) { | |
@@ -317,27 +317,27 @@ mg_intr_establish(void *v, int irq, int | @@ -317,27 +317,27 @@ mg_intr_establish(void *v, int irq, int | |||
317 | *pic |= (type == IST_LEVEL) << irq; | 317 | *pic |= (type == IST_LEVEL) << irq; | |
318 | 318 | |||
319 | /* TODO: ack it? */ | 319 | /* TODO: ack it? */ | |
320 | 320 | |||
321 | return iv; | 321 | return iv; | |
322 | } | 322 | } | |
323 | 323 | |||
324 | void | 324 | void | |
325 | mg_intr_disestablish(void *v, void *cookie) | 325 | mg_intr_disestablish(void *v, void *cookie) | |
326 | { | 326 | { | |
327 | struct hppa_isa_iv *iv = cookie; | 327 | struct hppa_isa_iv *iv = cookie; | |
328 | struct mongoose_softc *sc = v; | 328 | struct mongoose_softc *sc = v; | |
329 | int irq = iv - sc->sc_iv; | 329 | int irq = iv - sc->sc_iv; | |
330 | volatile u_int8_t *imr; | 330 | volatile uint8_t *imr; | |
331 | 331 | |||
332 | if (!sc || !cookie) | 332 | if (!sc || !cookie) | |
333 | return; | 333 | return; | |
334 | 334 | |||
335 | if (irq < 8) | 335 | if (irq < 8) | |
336 | imr = &sc->sc_ctrl->imr0; | 336 | imr = &sc->sc_ctrl->imr0; | |
337 | else | 337 | else | |
338 | imr = &sc->sc_ctrl->imr1; | 338 | imr = &sc->sc_ctrl->imr1; | |
339 | *imr &= ~(1 << irq); | 339 | *imr &= ~(1 << irq); | |
340 | /* TODO: ack it? */ | 340 | /* TODO: ack it? */ | |
341 | 341 | |||
342 | iv->iv_handler = NULL; | 342 | iv->iv_handler = NULL; | |
343 | } | 343 | } | |
@@ -390,184 +390,184 @@ mg_eisa_memmap(void *v, bus_addr_t addr, | @@ -390,184 +390,184 @@ mg_eisa_memmap(void *v, bus_addr_t addr, | |||
390 | 390 | |||
391 | void | 391 | void | |
392 | mg_eisa_memunmap(void *v, bus_space_handle_t bsh, bus_size_t size) | 392 | mg_eisa_memunmap(void *v, bus_space_handle_t bsh, bus_size_t size) | |
393 | { | 393 | { | |
394 | /* TODO: eisa memory unmap */ | 394 | /* TODO: eisa memory unmap */ | |
395 | } | 395 | } | |
396 | 396 | |||
397 | void | 397 | void | |
398 | mg_isa_barrier(void *v, bus_space_handle_t h, bus_size_t o, bus_size_t l, int op) | 398 | mg_isa_barrier(void *v, bus_space_handle_t h, bus_size_t o, bus_size_t l, int op) | |
399 | { | 399 | { | |
400 | sync_caches(); | 400 | sync_caches(); | |
401 | } | 401 | } | |
402 | 402 | |||
403 | u_int16_t | 403 | uint16_t | |
404 | mg_isa_r2(void *v, bus_space_handle_t h, bus_size_t o) | 404 | mg_isa_r2(void *v, bus_space_handle_t h, bus_size_t o) | |
405 | { | 405 | { | |
406 | u_int16_t r = *((volatile u_int16_t *)(h + o)); | 406 | uint16_t r = *((volatile uint16_t *)(h + o)); | |
407 | 407 | |||
408 | return le16toh(r); | 408 | return le16toh(r); | |
409 | } | 409 | } | |
410 | 410 | |||
411 | u_int32_t | 411 | uint32_t | |
412 | mg_isa_r4(void *v, bus_space_handle_t h, bus_size_t o) | 412 | mg_isa_r4(void *v, bus_space_handle_t h, bus_size_t o) | |
413 | { | 413 | { | |
414 | u_int32_t r = *((volatile u_int32_t *)(h + o)); | 414 | uint32_t r = *((volatile uint32_t *)(h + o)); | |
415 | 415 | |||
416 | return le32toh(r); | 416 | return le32toh(r); | |
417 | } | 417 | } | |
418 | 418 | |||
419 | void | 419 | void | |
420 | mg_isa_w2(void *v, bus_space_handle_t h, bus_size_t o, u_int16_t vv) | 420 | mg_isa_w2(void *v, bus_space_handle_t h, bus_size_t o, uint16_t vv) | |
421 | { | 421 | { | |
422 | *((volatile u_int16_t *)(h + o)) = htole16(vv); | 422 | *((volatile uint16_t *)(h + o)) = htole16(vv); | |
423 | } | 423 | } | |
424 | 424 | |||
425 | void | 425 | void | |
426 | mg_isa_w4(void *v, bus_space_handle_t h, bus_size_t o, u_int32_t vv) | 426 | mg_isa_w4(void *v, bus_space_handle_t h, bus_size_t o, uint32_t vv) | |
427 | { | 427 | { | |
428 | *((volatile u_int32_t *)(h + o)) = htole32(vv); | 428 | *((volatile uint32_t *)(h + o)) = htole32(vv); | |
429 | } | 429 | } | |
430 | 430 | |||
431 | void | 431 | void | |
432 | mg_isa_rm_2(void *v, bus_space_handle_t h, bus_size_t o, u_int16_t *a, bus_size_t c) | 432 | mg_isa_rm_2(void *v, bus_space_handle_t h, bus_size_t o, uint16_t *a, bus_size_t c) | |
433 | { | 433 | { | |
434 | h += o; | 434 | h += o; | |
435 | while (c--) | 435 | while (c--) | |
436 | *(a++) = le16toh(*(volatile u_int16_t *)h); | 436 | *(a++) = le16toh(*(volatile uint16_t *)h); | |
437 | } | 437 | } | |
438 | 438 | |||
439 | void | 439 | void | |
440 | mg_isa_rm_4(void *v, bus_space_handle_t h, bus_size_t o, u_int32_t *a, bus_size_t c) | 440 | mg_isa_rm_4(void *v, bus_space_handle_t h, bus_size_t o, uint32_t *a, bus_size_t c) | |
441 | { | 441 | { | |
442 | h += o; | 442 | h += o; | |
443 | while (c--) | 443 | while (c--) | |
444 | *(a++) = le32toh(*(volatile u_int32_t *)h); | 444 | *(a++) = le32toh(*(volatile uint32_t *)h); | |
445 | } | 445 | } | |
446 | 446 | |||
447 | void | 447 | void | |
448 | mg_isa_wm_2(void *v, bus_space_handle_t h, bus_size_t o, const u_int16_t *a, bus_size_t c) | 448 | mg_isa_wm_2(void *v, bus_space_handle_t h, bus_size_t o, const uint16_t *a, bus_size_t c) | |
449 | { | 449 | { | |
450 | u_int16_t r; | 450 | uint16_t r; | |
451 | 451 | |||
452 | h += o; | 452 | h += o; | |
453 | while (c--) { | 453 | while (c--) { | |
454 | r = *(a++); | 454 | r = *(a++); | |
455 | *(volatile u_int16_t *)h = htole16(r); | 455 | *(volatile uint16_t *)h = htole16(r); | |
456 | } | 456 | } | |
457 | } | 457 | } | |
458 | 458 | |||
459 | void | 459 | void | |
460 | mg_isa_wm_4(void *v, bus_space_handle_t h, bus_size_t o, const u_int32_t *a, bus_size_t c) | 460 | mg_isa_wm_4(void *v, bus_space_handle_t h, bus_size_t o, const uint32_t *a, bus_size_t c) | |
461 | { | 461 | { | |
462 | u_int32_t r; | 462 | uint32_t r; | |
463 | 463 | |||
464 | h += o; | 464 | h += o; | |
465 | while (c--) { | 465 | while (c--) { | |
466 | r = *(a++); | 466 | r = *(a++); | |
467 | *(volatile u_int32_t *)h = htole32(r); | 467 | *(volatile uint32_t *)h = htole32(r); | |
468 | } | 468 | } | |
469 | } | 469 | } | |
470 | 470 | |||
471 | void | 471 | void | |
472 | mg_isa_sm_2(void *v, bus_space_handle_t h, bus_size_t o, u_int16_t vv, bus_size_t c) | 472 | mg_isa_sm_2(void *v, bus_space_handle_t h, bus_size_t o, uint16_t vv, bus_size_t c) | |
473 | { | 473 | { | |
474 | vv = htole16(vv); | 474 | vv = htole16(vv); | |
475 | h += o; | 475 | h += o; | |
476 | while (c--) | 476 | while (c--) | |
477 | *(volatile u_int16_t *)h = vv; | 477 | *(volatile uint16_t *)h = vv; | |
478 | } | 478 | } | |
479 | 479 | |||
480 | void | 480 | void | |
481 | mg_isa_sm_4(void *v, bus_space_handle_t h, bus_size_t o, u_int32_t vv, bus_size_t c) | 481 | mg_isa_sm_4(void *v, bus_space_handle_t h, bus_size_t o, uint32_t vv, bus_size_t c) | |
482 | { | 482 | { | |
483 | vv = htole32(vv); | 483 | vv = htole32(vv); | |
484 | h += o; | 484 | h += o; | |
485 | while (c--) | 485 | while (c--) | |
486 | *(volatile u_int32_t *)h = vv; | 486 | *(volatile uint32_t *)h = vv; | |
487 | } | 487 | } | |
488 | 488 | |||
489 | void | 489 | void | |
490 | mg_isa_rr_2(void *v, bus_space_handle_t h, bus_size_t o, u_int16_t *a, bus_size_t c) | 490 | mg_isa_rr_2(void *v, bus_space_handle_t h, bus_size_t o, uint16_t *a, bus_size_t c) | |
491 | { | 491 | { | |
492 | u_int16_t r; | 492 | uint16_t r; | |
493 | volatile u_int16_t *p; | 493 | volatile uint16_t *p; | |
494 | 494 | |||
495 | h += o; | 495 | h += o; | |
496 | p = (void *)h; | 496 | p = (void *)h; | |
497 | while (c--) { | 497 | while (c--) { | |
498 | r = *p++; | 498 | r = *p++; | |
499 | *a++ = le16toh(r); | 499 | *a++ = le16toh(r); | |
500 | } | 500 | } | |
501 | } | 501 | } | |
502 | 502 | |||
503 | void | 503 | void | |
504 | mg_isa_rr_4(void *v, bus_space_handle_t h, bus_size_t o, u_int32_t *a, bus_size_t c) | 504 | mg_isa_rr_4(void *v, bus_space_handle_t h, bus_size_t o, uint32_t *a, bus_size_t c) | |
505 | { | 505 | { | |
506 | u_int32_t r; | 506 | uint32_t r; | |
507 | volatile u_int32_t *p; | 507 | volatile uint32_t *p; | |
508 | 508 | |||
509 | h += o; | 509 | h += o; | |
510 | p = (void *)h; | 510 | p = (void *)h; | |
511 | while (c--) { | 511 | while (c--) { | |
512 | r = *p++; | 512 | r = *p++; | |
513 | *a++ = le32toh(r); | 513 | *a++ = le32toh(r); | |
514 | } | 514 | } | |
515 | } | 515 | } | |
516 | 516 | |||
517 | void | 517 | void | |
518 | mg_isa_wr_2(void *v, bus_space_handle_t h, bus_size_t o, const u_int16_t *a, bus_size_t c) | 518 | mg_isa_wr_2(void *v, bus_space_handle_t h, bus_size_t o, const uint16_t *a, bus_size_t c) | |
519 | { | 519 | { | |
520 | u_int16_t r; | 520 | uint16_t r; | |
521 | volatile u_int16_t *p; | 521 | volatile uint16_t *p; | |
522 | 522 | |||
523 | h += o; | 523 | h += o; | |
524 | p = (void *)h; | 524 | p = (void *)h; | |
525 | while (c--) { | 525 | while (c--) { | |
526 | r = *a++; | 526 | r = *a++; | |
527 | *p++ = htole16(r); | 527 | *p++ = htole16(r); | |
528 | } | 528 | } | |
529 | } | 529 | } | |
530 | 530 | |||
531 | void | 531 | void | |
532 | mg_isa_wr_4(void *v, bus_space_handle_t h, bus_size_t o, const u_int32_t *a, bus_size_t c) | 532 | mg_isa_wr_4(void *v, bus_space_handle_t h, bus_size_t o, const uint32_t *a, bus_size_t c) | |
533 | { | 533 | { | |
534 | u_int32_t r; | 534 | uint32_t r; | |
535 | volatile u_int32_t *p; | 535 | volatile uint32_t *p; | |
536 | 536 | |||
537 | h += o; | 537 | h += o; | |
538 | p = (void *)h; | 538 | p = (void *)h; | |
539 | while (c--) { | 539 | while (c--) { | |
540 | r = *a++; | 540 | r = *a++; | |
541 | *p++ = htole32(r); | 541 | *p++ = htole32(r); | |
542 | } | 542 | } | |
543 | } | 543 | } | |
544 | 544 | |||
545 | void | 545 | void | |
546 | mg_isa_sr_2(void *v, bus_space_handle_t h, bus_size_t o, u_int16_t vv, bus_size_t c) | 546 | mg_isa_sr_2(void *v, bus_space_handle_t h, bus_size_t o, uint16_t vv, bus_size_t c) | |
547 | { | 547 | { | |
548 | volatile u_int16_t *p; | 548 | volatile uint16_t *p; | |
549 | 549 | |||
550 | vv = htole16(vv); | 550 | vv = htole16(vv); | |
551 | h += o; | 551 | h += o; | |
552 | p = (void *)h; | 552 | p = (void *)h; | |
553 | while (c--) | 553 | while (c--) | |
554 | *p++ = vv; | 554 | *p++ = vv; | |
555 | } | 555 | } | |
556 | 556 | |||
557 | void | 557 | void | |
558 | mg_isa_sr_4(void *v, bus_space_handle_t h, bus_size_t o, u_int32_t vv, bus_size_t c) | 558 | mg_isa_sr_4(void *v, bus_space_handle_t h, bus_size_t o, uint32_t vv, bus_size_t c) | |
559 | { | 559 | { | |
560 | volatile u_int32_t *p; | 560 | volatile uint32_t *p; | |
561 | 561 | |||
562 | vv = htole32(vv); | 562 | vv = htole32(vv); | |
563 | h += o; | 563 | h += o; | |
564 | p = (void *)h; | 564 | p = (void *)h; | |
565 | while (c--) | 565 | while (c--) | |
566 | *p++ = vv; | 566 | *p++ = vv; | |
567 | } | 567 | } | |
568 | 568 | |||
569 | int | 569 | int | |
570 | mgmatch(device_t parent, cfdata_t cf, void *aux) | 570 | mgmatch(device_t parent, cfdata_t cf, void *aux) | |
571 | { | 571 | { | |
572 | struct confargs *ca = aux; | 572 | struct confargs *ca = aux; | |
573 | bus_space_handle_t ioh; | 573 | bus_space_handle_t ioh; | |
@@ -609,29 +609,29 @@ mgattach(device_t parent, device_t self, | @@ -609,29 +609,29 @@ mgattach(device_t parent, device_t self, | |||
609 | panic("mgattach: can't map control registers"); | 609 | panic("mgattach: can't map control registers"); | |
610 | sc->sc_ctrl = (struct mongoose_ctrl *)ioh; | 610 | sc->sc_ctrl = (struct mongoose_ctrl *)ioh; | |
611 | 611 | |||
612 | viper_eisa_en(); | 612 | viper_eisa_en(); | |
613 | 613 | |||
614 | /* BUS RESET */ | 614 | /* BUS RESET */ | |
615 | sc->sc_ctrl->nmi_ext = MONGOOSE_NMI_BUSRESET; | 615 | sc->sc_ctrl->nmi_ext = MONGOOSE_NMI_BUSRESET; | |
616 | DELAY(1); | 616 | DELAY(1); | |
617 | sc->sc_ctrl->nmi_ext = 0; | 617 | sc->sc_ctrl->nmi_ext = 0; | |
618 | DELAY(100); | 618 | DELAY(100); | |
619 | 619 | |||
620 | /* determine eisa board id */ | 620 | /* determine eisa board id */ | |
621 | { | 621 | { | |
622 | u_int8_t id[4], *p; | 622 | uint8_t id[4], *p; | |
623 | /* XXX this is awful */ | 623 | /* XXX this is awful */ | |
624 | p = (u_int8_t *)(ioh + EISA_SLOTOFF_VID); | 624 | p = (uint8_t *)(ioh + EISA_SLOTOFF_VID); | |
625 | id[0] = *p++; | 625 | id[0] = *p++; | |
626 | id[1] = *p++; | 626 | id[1] = *p++; | |
627 | id[2] = *p++; | 627 | id[2] = *p++; | |
628 | id[3] = *p++; | 628 | id[3] = *p++; | |
629 | 629 | |||
630 | brid[0] = EISA_VENDID_0(id); | 630 | brid[0] = EISA_VENDID_0(id); | |
631 | brid[1] = EISA_VENDID_1(id); | 631 | brid[1] = EISA_VENDID_1(id); | |
632 | brid[2] = EISA_VENDID_2(id); | 632 | brid[2] = EISA_VENDID_2(id); | |
633 | brid[3] = EISA_PRODID_0(id + 2); | 633 | brid[3] = EISA_PRODID_0(id + 2); | |
634 | brid[4] = EISA_PRODID_1(id + 2); | 634 | brid[4] = EISA_PRODID_1(id + 2); | |
635 | brid[5] = EISA_PRODID_2(id + 2); | 635 | brid[5] = EISA_PRODID_2(id + 2); | |
636 | brid[6] = EISA_PRODID_3(id + 2); | 636 | brid[6] = EISA_PRODID_3(id + 2); | |
637 | brid[7] = '\0'; | 637 | brid[7] = '\0'; |
--- src/sys/arch/hp700/dev/Attic/siop_sgc.c 2009/05/15 17:55:44 1.4
+++ src/sys/arch/hp700/dev/Attic/siop_sgc.c 2009/05/24 06:53:34 1.5
@@ -1,35 +1,35 @@ | @@ -1,35 +1,35 @@ | |||
1 | /* $NetBSD: siop_sgc.c,v 1.4 2009/05/15 17:55:44 tsutsui Exp $ */ | 1 | /* $NetBSD: siop_sgc.c,v 1.5 2009/05/24 06:53:34 skrll Exp $ */ | |
2 | 2 | |||
3 | /* $OpenBSD: siop_sgc.c,v 1.1 2007/08/05 19:09:52 kettenis Exp $ */ | 3 | /* $OpenBSD: siop_sgc.c,v 1.1 2007/08/05 19:09:52 kettenis Exp $ */ | |
4 | 4 | |||
5 | /* | 5 | /* | |
6 | * Copyright (c) 2007 Mark Kettenis | 6 | * Copyright (c) 2007 Mark Kettenis | |
7 | * | 7 | * | |
8 | * Permission to use, copy, modify, and distribute this software for any | 8 | * Permission to use, copy, modify, and distribute this software for any | |
9 | * purpose with or without fee is hereby granted, provided that the above | 9 | * purpose with or without fee is hereby granted, provided that the above | |
10 | * copyright notice and this permission notice appear in all copies. | 10 | * copyright notice and this permission notice appear in all copies. | |
11 | * | 11 | * | |
12 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | 12 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | |
13 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | 13 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | |
14 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | 14 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | |
15 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | 15 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | |
16 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | 16 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | |
17 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | 17 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | |
18 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | 18 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | |
19 | */ | 19 | */ | |
20 | 20 | |||
21 | #include <sys/cdefs.h> | 21 | #include <sys/cdefs.h> | |
22 | __KERNEL_RCSID(0, "$NetBSD: siop_sgc.c,v 1.4 2009/05/15 17:55:44 tsutsui Exp $"); | 22 | __KERNEL_RCSID(0, "$NetBSD: siop_sgc.c,v 1.5 2009/05/24 06:53:34 skrll Exp $"); | |
23 | 23 | |||
24 | #include <sys/param.h> | 24 | #include <sys/param.h> | |
25 | #include <sys/device.h> | 25 | #include <sys/device.h> | |
26 | #include <sys/systm.h> | 26 | #include <sys/systm.h> | |
27 | 27 | |||
28 | #include <uvm/uvm_extern.h> | 28 | #include <uvm/uvm_extern.h> | |
29 | 29 | |||
30 | #include <machine/autoconf.h> | 30 | #include <machine/autoconf.h> | |
31 | #include <machine/bus.h> | 31 | #include <machine/bus.h> | |
32 | #include <machine/iomod.h> | 32 | #include <machine/iomod.h> | |
33 | 33 | |||
34 | #include <dev/scsipi/scsi_all.h> | 34 | #include <dev/scsipi/scsi_all.h> | |
35 | #include <dev/scsipi/scsipi_all.h> | 35 | #include <dev/scsipi/scsipi_all.h> | |
@@ -41,30 +41,30 @@ __KERNEL_RCSID(0, "$NetBSD: siop_sgc.c,v | @@ -41,30 +41,30 @@ __KERNEL_RCSID(0, "$NetBSD: siop_sgc.c,v | |||
41 | 41 | |||
42 | #include <hp700/dev/cpudevs.h> | 42 | #include <hp700/dev/cpudevs.h> | |
43 | #include <hp700/hp700/intr.h> | 43 | #include <hp700/hp700/intr.h> | |
44 | 44 | |||
45 | #define IO_II_INTEN 0x20000000 | 45 | #define IO_II_INTEN 0x20000000 | |
46 | #define IO_II_PACKEN 0x10000000 | 46 | #define IO_II_PACKEN 0x10000000 | |
47 | #define IO_II_PREFETCHEN 0x08000000 | 47 | #define IO_II_PREFETCHEN 0x08000000 | |
48 | 48 | |||
49 | int siop_sgc_match(device_t, cfdata_t, void *); | 49 | int siop_sgc_match(device_t, cfdata_t, void *); | |
50 | void siop_sgc_attach(device_t, device_t, void *); | 50 | void siop_sgc_attach(device_t, device_t, void *); | |
51 | int siop_sgc_intr(void *); | 51 | int siop_sgc_intr(void *); | |
52 | void siop_sgc_reset(struct siop_common_softc *); | 52 | void siop_sgc_reset(struct siop_common_softc *); | |
53 | 53 | |||
54 | u_int8_t siop_sgc_r1(void *, bus_space_handle_t, bus_size_t); | 54 | uint8_t siop_sgc_r1(void *, bus_space_handle_t, bus_size_t); | |
55 | u_int16_t siop_sgc_r2(void *, bus_space_handle_t, bus_size_t); | 55 | uint16_t siop_sgc_r2(void *, bus_space_handle_t, bus_size_t); | |
56 | void siop_sgc_w1(void *, bus_space_handle_t, bus_size_t, u_int8_t); | 56 | void siop_sgc_w1(void *, bus_space_handle_t, bus_size_t, uint8_t); | |
57 | void siop_sgc_w2(void *, bus_space_handle_t, bus_size_t, u_int16_t); | 57 | void siop_sgc_w2(void *, bus_space_handle_t, bus_size_t, uint16_t); | |
58 | 58 | |||
59 | struct siop_sgc_softc { | 59 | struct siop_sgc_softc { | |
60 | struct siop_softc sc_siop; | 60 | struct siop_softc sc_siop; | |
61 | bus_space_tag_t sc_iot; | 61 | bus_space_tag_t sc_iot; | |
62 | bus_space_handle_t sc_ioh; | 62 | bus_space_handle_t sc_ioh; | |
63 | struct hppa_bus_space_tag sc_bustag; | 63 | struct hppa_bus_space_tag sc_bustag; | |
64 | }; | 64 | }; | |
65 | 65 | |||
66 | CFATTACH_DECL_NEW(siop_gedoens, sizeof(struct siop_sgc_softc), | 66 | CFATTACH_DECL_NEW(siop_gedoens, sizeof(struct siop_sgc_softc), | |
67 | siop_sgc_match, siop_sgc_attach, NULL, NULL); | 67 | siop_sgc_match, siop_sgc_attach, NULL, NULL); | |
68 | 68 | |||
69 | int | 69 | int | |
70 | siop_sgc_match(device_t parent, cfdata_t match, void *aux) | 70 | siop_sgc_match(device_t parent, cfdata_t match, void *aux) | |
@@ -139,43 +139,43 @@ siop_sgc_attach(device_t parent, device_ | @@ -139,43 +139,43 @@ siop_sgc_attach(device_t parent, device_ | |||
139 | } | 139 | } | |
140 | 140 | |||
141 | void | 141 | void | |
142 | siop_sgc_reset(struct siop_common_softc *sc) | 142 | siop_sgc_reset(struct siop_common_softc *sc) | |
143 | { | 143 | { | |
144 | bus_space_write_1(sc->sc_rt, sc->sc_rh, SIOP_DCNTL, DCNTL_EA); | 144 | bus_space_write_1(sc->sc_rt, sc->sc_rh, SIOP_DCNTL, DCNTL_EA); | |
145 | bus_space_write_1(sc->sc_rt, sc->sc_rh, SIOP_CTEST0, CTEST0_EHP); | 145 | bus_space_write_1(sc->sc_rt, sc->sc_rh, SIOP_CTEST0, CTEST0_EHP); | |
146 | bus_space_write_1(sc->sc_rt, sc->sc_rh, SIOP_CTEST4, CTEST4_MUX); | 146 | bus_space_write_1(sc->sc_rt, sc->sc_rh, SIOP_CTEST4, CTEST4_MUX); | |
147 | 147 | |||
148 | bus_space_write_1(sc->sc_rt, sc->sc_rh, SIOP_STIME0, | 148 | bus_space_write_1(sc->sc_rt, sc->sc_rh, SIOP_STIME0, | |
149 | (0xc << STIME0_SEL_SHIFT)); | 149 | (0xc << STIME0_SEL_SHIFT)); | |
150 | } | 150 | } | |
151 | 151 | |||
152 | u_int8_t | 152 | uint8_t | |
153 | siop_sgc_r1(void *v, bus_space_handle_t h, bus_size_t o) | 153 | siop_sgc_r1(void *v, bus_space_handle_t h, bus_size_t o) | |
154 | { | 154 | { | |
155 | return *(volatile u_int8_t *)(h + (o ^ 3)); | 155 | return *(volatile uint8_t *)(h + (o ^ 3)); | |
156 | } | 156 | } | |
157 | 157 | |||
158 | u_int16_t | 158 | uint16_t | |
159 | siop_sgc_r2(void *v, bus_space_handle_t h, bus_size_t o) | 159 | siop_sgc_r2(void *v, bus_space_handle_t h, bus_size_t o) | |
160 | { | 160 | { | |
161 | if (o == SIOP_SIST0) { | 161 | if (o == SIOP_SIST0) { | |
162 | u_int16_t reg; | 162 | uint16_t reg; | |
163 | 163 | |||
164 | reg = siop_sgc_r1(v, h, SIOP_SIST0); | 164 | reg = siop_sgc_r1(v, h, SIOP_SIST0); | |
165 | reg |= siop_sgc_r1(v, h, SIOP_SIST1) << 8; | 165 | reg |= siop_sgc_r1(v, h, SIOP_SIST1) << 8; | |
166 | return reg; | 166 | return reg; | |
167 | } | 167 | } | |
168 | return *(volatile u_int16_t *)(h + (o ^ 2)); | 168 | return *(volatile uint16_t *)(h + (o ^ 2)); | |
169 | } | 169 | } | |
170 | 170 | |||
171 | void | 171 | void | |
172 | siop_sgc_w1(void *v, bus_space_handle_t h, bus_size_t o, u_int8_t vv) | 172 | siop_sgc_w1(void *v, bus_space_handle_t h, bus_size_t o, uint8_t vv) | |
173 | { | 173 | { | |
174 | *(volatile u_int8_t *)(h + (o ^ 3)) = vv; | 174 | *(volatile uint8_t *)(h + (o ^ 3)) = vv; | |
175 | } | 175 | } | |
176 | 176 | |||
177 | void | 177 | void | |
178 | siop_sgc_w2(void *v, bus_space_handle_t h, bus_size_t o, u_int16_t vv) | 178 | siop_sgc_w2(void *v, bus_space_handle_t h, bus_size_t o, uint16_t vv) | |
179 | { | 179 | { | |
180 | *(volatile u_int16_t *)(h + (o ^ 2)) = vv; | 180 | *(volatile uint16_t *)(h + (o ^ 2)) = vv; | |
181 | } | 181 | } |
--- src/sys/arch/hp700/dev/Attic/uturn.c 2009/05/23 13:39:54 1.4
+++ src/sys/arch/hp700/dev/Attic/uturn.c 2009/05/24 06:53:34 1.5
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: uturn.c,v 1.4 2009/05/23 13:39:54 skrll Exp $ */ | 1 | /* $NetBSD: uturn.c,v 1.5 2009/05/24 06:53:34 skrll Exp $ */ | |
2 | 2 | |||
3 | /* $OpenBSD: uturn.c,v 1.6 2007/12/29 01:26:14 kettenis Exp $ */ | 3 | /* $OpenBSD: uturn.c,v 1.6 2007/12/29 01:26:14 kettenis Exp $ */ | |
4 | 4 | |||
5 | /* | 5 | /* | |
6 | * Copyright (c) 2004 Michael Shalayeff | 6 | * Copyright (c) 2004 Michael Shalayeff | |
7 | * All rights reserved. | 7 | * All rights reserved. | |
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 | |
@@ -31,30 +31,30 @@ | @@ -31,30 +31,30 @@ | |||
31 | /* TODO IOA programming */ | 31 | /* TODO IOA programming */ | |
32 | 32 | |||
33 | #include <sys/param.h> | 33 | #include <sys/param.h> | |
34 | #include <sys/systm.h> | 34 | #include <sys/systm.h> | |
35 | #include <sys/device.h> | 35 | #include <sys/device.h> | |
36 | #include <sys/reboot.h> | 36 | #include <sys/reboot.h> | |
37 | 37 | |||
38 | #include <machine/iomod.h> | 38 | #include <machine/iomod.h> | |
39 | #include <machine/autoconf.h> | 39 | #include <machine/autoconf.h> | |
40 | 40 | |||
41 | #include <hp700/dev/cpudevs.h> | 41 | #include <hp700/dev/cpudevs.h> | |
42 | 42 | |||
43 | struct uturn_regs { | 43 | struct uturn_regs { | |
44 | u_int64_t resv0[2]; | 44 | uint64_t resv0[2]; | |
45 | u_int64_t status; /* 0x10: */ | 45 | uint64_t status; /* 0x10: */ | |
46 | u_int64_t resv1[5]; | 46 | uint64_t resv1[5]; | |
47 | u_int64_t debug; /* 0x40: */ | 47 | uint64_t debug; /* 0x40: */ | |
48 | }; | 48 | }; | |
49 | 49 | |||
50 | struct uturn_softc { | 50 | struct uturn_softc { | |
51 | device_t sc_dv; | 51 | device_t sc_dv; | |
52 | 52 | |||
53 | struct uturn_regs volatile *sc_regs; | 53 | struct uturn_regs volatile *sc_regs; | |
54 | }; | 54 | }; | |
55 | 55 | |||
56 | int uturnmatch(device_t, cfdata_t, void *); | 56 | int uturnmatch(device_t, cfdata_t, void *); | |
57 | void uturnattach(device_t, device_t, void *); | 57 | void uturnattach(device_t, device_t, void *); | |
58 | static void uturn_callback(device_t self, struct confargs *ca); | 58 | static void uturn_callback(device_t self, struct confargs *ca); | |
59 | 59 | |||
60 | CFATTACH_DECL_NEW(uturn, sizeof(struct uturn_softc), | 60 | CFATTACH_DECL_NEW(uturn, sizeof(struct uturn_softc), |
--- src/sys/arch/hp700/dev/Attic/sti_sgc.c 2009/05/08 09:33:58 1.16
+++ src/sys/arch/hp700/dev/Attic/sti_sgc.c 2009/05/24 06:53:34 1.17
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: sti_sgc.c,v 1.16 2009/05/08 09:33:58 skrll Exp $ */ | 1 | /* $NetBSD: sti_sgc.c,v 1.17 2009/05/24 06:53:34 skrll Exp $ */ | |
2 | 2 | |||
3 | /* $OpenBSD: sti_sgc.c,v 1.21 2003/12/22 23:39:06 mickey Exp $ */ | 3 | /* $OpenBSD: sti_sgc.c,v 1.21 2003/12/22 23:39:06 mickey Exp $ */ | |
4 | 4 | |||
5 | /* | 5 | /* | |
6 | * Copyright (c) 2000-2003 Michael Shalayeff | 6 | * Copyright (c) 2000-2003 Michael Shalayeff | |
7 | * All rights reserved. | 7 | * All rights reserved. | |
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 | |
@@ -29,27 +29,27 @@ | @@ -29,27 +29,27 @@ | |||
29 | * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 29 | * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
30 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 30 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
31 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 31 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | |
32 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 32 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
33 | */ | 33 | */ | |
34 | /* | 34 | /* | |
35 | * These cards has to be known to work so far: | 35 | * These cards has to be known to work so far: | |
36 | * - HPA1991AGrayscale rev 0.02 (705/35) (byte-wide) | 36 | * - HPA1991AGrayscale rev 0.02 (705/35) (byte-wide) | |
37 | * - HPA1991AC19 rev 0.02 (715/33) (byte-wide) | 37 | * - HPA1991AC19 rev 0.02 (715/33) (byte-wide) | |
38 | * - HPA208LC1280 rev 8.04 (712/80) just works | 38 | * - HPA208LC1280 rev 8.04 (712/80) just works | |
39 | */ | 39 | */ | |
40 | 40 | |||
41 | #include <sys/cdefs.h> | 41 | #include <sys/cdefs.h> | |
42 | __KERNEL_RCSID(0, "$NetBSD: sti_sgc.c,v 1.16 2009/05/08 09:33:58 skrll Exp $"); | 42 | __KERNEL_RCSID(0, "$NetBSD: sti_sgc.c,v 1.17 2009/05/24 06:53:34 skrll Exp $"); | |
43 | 43 | |||
44 | #include <sys/param.h> | 44 | #include <sys/param.h> | |
45 | #include <sys/systm.h> | 45 | #include <sys/systm.h> | |
46 | #include <sys/device.h> | 46 | #include <sys/device.h> | |
47 | 47 | |||
48 | #include <uvm/uvm.h> | 48 | #include <uvm/uvm.h> | |
49 | 49 | |||
50 | #include <machine/bus.h> | 50 | #include <machine/bus.h> | |
51 | #include <machine/cpu.h> | 51 | #include <machine/cpu.h> | |
52 | #include <machine/iomod.h> | 52 | #include <machine/iomod.h> | |
53 | #include <machine/autoconf.h> | 53 | #include <machine/autoconf.h> | |
54 | 54 | |||
55 | #include <dev/wscons/wsdisplayvar.h> | 55 | #include <dev/wscons/wsdisplayvar.h> | |
@@ -118,27 +118,27 @@ sti_sgc_getrom(struct confargs *ca) | @@ -118,27 +118,27 @@ sti_sgc_getrom(struct confargs *ca) | |||
118 | case STI_INEG_REV: | 118 | case STI_INEG_REV: | |
119 | rom = STI_INEG_PROM; | 119 | rom = STI_INEG_PROM; | |
120 | break; | 120 | break; | |
121 | } | 121 | } | |
122 | return rom; | 122 | return rom; | |
123 | } | 123 | } | |
124 | 124 | |||
125 | int | 125 | int | |
126 | sti_sgc_probe(device_t parent, cfdata_t cf, void *aux) | 126 | sti_sgc_probe(device_t parent, cfdata_t cf, void *aux) | |
127 | { | 127 | { | |
128 | struct confargs *ca = aux; | 128 | struct confargs *ca = aux; | |
129 | bus_space_handle_t romh; | 129 | bus_space_handle_t romh; | |
130 | paddr_t rom; | 130 | paddr_t rom; | |
131 | u_int32_t id, romend; | 131 | uint32_t id, romend; | |
132 | u_char devtype; | 132 | u_char devtype; | |
133 | int rv = 0, romunmapped = 0; | 133 | int rv = 0, romunmapped = 0; | |
134 | 134 | |||
135 | if (ca->ca_type.iodc_type != HPPA_TYPE_FIO) | 135 | if (ca->ca_type.iodc_type != HPPA_TYPE_FIO) | |
136 | return (0); | 136 | return (0); | |
137 | 137 | |||
138 | /* these need futher checking for the graphics id */ | 138 | /* these need futher checking for the graphics id */ | |
139 | if (ca->ca_type.iodc_sv_model != HPPA_FIO_GSGC && | 139 | if (ca->ca_type.iodc_sv_model != HPPA_FIO_GSGC && | |
140 | ca->ca_type.iodc_sv_model != HPPA_FIO_SGC) | 140 | ca->ca_type.iodc_sv_model != HPPA_FIO_SGC) | |
141 | return 0; | 141 | return 0; | |
142 | 142 | |||
143 | rom = sti_sgc_getrom(ca); | 143 | rom = sti_sgc_getrom(ca); | |
144 | #ifdef STIDEBUG | 144 | #ifdef STIDEBUG | |
@@ -214,27 +214,27 @@ sti_sgc_probe(device_t parent, cfdata_t | @@ -214,27 +214,27 @@ sti_sgc_probe(device_t parent, cfdata_t | |||
214 | ca->ca_naddrs++; | 214 | ca->ca_naddrs++; | |
215 | 215 | |||
216 | if (!romunmapped) | 216 | if (!romunmapped) | |
217 | bus_space_unmap(ca->ca_iot, romh, STI_ROMSIZE); | 217 | bus_space_unmap(ca->ca_iot, romh, STI_ROMSIZE); | |
218 | return (rv); | 218 | return (rv); | |
219 | } | 219 | } | |
220 | 220 | |||
221 | void | 221 | void | |
222 | sti_sgc_attach(device_t parent, device_t self, void *aux) | 222 | sti_sgc_attach(device_t parent, device_t self, void *aux) | |
223 | { | 223 | { | |
224 | struct sti_softc *sc = device_private(self); | 224 | struct sti_softc *sc = device_private(self); | |
225 | struct confargs *ca = aux; | 225 | struct confargs *ca = aux; | |
226 | paddr_t rom; | 226 | paddr_t rom; | |
227 | u_int32_t romlen; | 227 | uint32_t romlen; | |
228 | int rv; | 228 | int rv; | |
229 | int pagezero_cookie; | 229 | int pagezero_cookie; | |
230 | 230 | |||
231 | pagezero_cookie = hp700_pagezero_map(); | 231 | pagezero_cookie = hp700_pagezero_map(); | |
232 | sc->sc_dev = self; | 232 | sc->sc_dev = self; | |
233 | sc->memt = sc->iot = ca->ca_iot; | 233 | sc->memt = sc->iot = ca->ca_iot; | |
234 | sc->base = ca->ca_hpa; | 234 | sc->base = ca->ca_hpa; | |
235 | 235 | |||
236 | /* we stashed rom addr/len into the last slot during probe */ | 236 | /* we stashed rom addr/len into the last slot during probe */ | |
237 | rom = ca->ca_addrs[ca->ca_naddrs - 1].addr; | 237 | rom = ca->ca_addrs[ca->ca_naddrs - 1].addr; | |
238 | romlen = ca->ca_addrs[ca->ca_naddrs - 1].size; | 238 | romlen = ca->ca_addrs[ca->ca_naddrs - 1].size; | |
239 | if ((rv = bus_space_map(ca->ca_iot, rom, romlen, 0, &sc->romh))) { | 239 | if ((rv = bus_space_map(ca->ca_iot, rom, romlen, 0, &sc->romh))) { | |
240 | if ((rom & HPPA_IOBEGIN) == HPPA_IOBEGIN) | 240 | if ((rom & HPPA_IOBEGIN) == HPPA_IOBEGIN) |
--- src/sys/arch/hp700/gsc/Attic/com_gsc.c 2008/03/14 15:09:10 1.12
+++ src/sys/arch/hp700/gsc/Attic/com_gsc.c 2009/05/24 06:53:35 1.13
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: com_gsc.c,v 1.12 2008/03/14 15:09:10 cube Exp $ */ | 1 | /* $NetBSD: com_gsc.c,v 1.13 2009/05/24 06:53:35 skrll Exp $ */ | |
2 | 2 | |||
3 | /* $OpenBSD: com_gsc.c,v 1.8 2000/03/13 14:39:59 mickey Exp $ */ | 3 | /* $OpenBSD: com_gsc.c,v 1.8 2000/03/13 14:39:59 mickey Exp $ */ | |
4 | 4 | |||
5 | /* | 5 | /* | |
6 | * Copyright (c) 1998 Michael Shalayeff | 6 | * Copyright (c) 1998 Michael Shalayeff | |
7 | * All rights reserved. | 7 | * All rights reserved. | |
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 | |
@@ -23,27 +23,27 @@ | @@ -23,27 +23,27 @@ | |||
23 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR | 23 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR | |
24 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | 24 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |
25 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | 25 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | |
26 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | 26 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | |
27 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | 27 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | |
28 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 28 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
29 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 29 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
30 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 30 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
31 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 31 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | |
32 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 32 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
33 | */ | 33 | */ | |
34 | 34 | |||
35 | #include <sys/cdefs.h> | 35 | #include <sys/cdefs.h> | |
36 | __KERNEL_RCSID(0, "$NetBSD: com_gsc.c,v 1.12 2008/03/14 15:09:10 cube Exp $"); | 36 | __KERNEL_RCSID(0, "$NetBSD: com_gsc.c,v 1.13 2009/05/24 06:53:35 skrll Exp $"); | |
37 | 37 | |||
38 | #include "opt_kgdb.h" | 38 | #include "opt_kgdb.h" | |
39 | 39 | |||
40 | #include <sys/param.h> | 40 | #include <sys/param.h> | |
41 | #include <sys/systm.h> | 41 | #include <sys/systm.h> | |
42 | #include <sys/device.h> | 42 | #include <sys/device.h> | |
43 | #include <sys/tty.h> | 43 | #include <sys/tty.h> | |
44 | 44 | |||
45 | #ifdef KGDB | 45 | #ifdef KGDB | |
46 | #include <sys/kgdb.h> | 46 | #include <sys/kgdb.h> | |
47 | #endif | 47 | #endif | |
48 | 48 | |||
49 | #include <machine/bus.h> | 49 | #include <machine/bus.h> | |
@@ -52,27 +52,27 @@ __KERNEL_RCSID(0, "$NetBSD: com_gsc.c,v | @@ -52,27 +52,27 @@ __KERNEL_RCSID(0, "$NetBSD: com_gsc.c,v | |||
52 | #include <machine/autoconf.h> | 52 | #include <machine/autoconf.h> | |
53 | 53 | |||
54 | #include <dev/ic/comreg.h> | 54 | #include <dev/ic/comreg.h> | |
55 | #include <dev/ic/comvar.h> | 55 | #include <dev/ic/comvar.h> | |
56 | 56 | |||
57 | #include <hp700/dev/cpudevs.h> | 57 | #include <hp700/dev/cpudevs.h> | |
58 | #include <hp700/gsc/gscbusvar.h> | 58 | #include <hp700/gsc/gscbusvar.h> | |
59 | #include <hp700/hp700/machdep.h> | 59 | #include <hp700/hp700/machdep.h> | |
60 | 60 | |||
61 | #define COMGSC_OFFSET 0x800 | 61 | #define COMGSC_OFFSET 0x800 | |
62 | #define COMGSC_FREQUENCY (1843200 * 4) /* 16-bit baud rate divisor */ | 62 | #define COMGSC_FREQUENCY (1843200 * 4) /* 16-bit baud rate divisor */ | |
63 | 63 | |||
64 | struct com_gsc_regs { | 64 | struct com_gsc_regs { | |
65 | u_int8_t reset; | 65 | uint8_t reset; | |
66 | }; | 66 | }; | |
67 | 67 | |||
68 | struct com_gsc_softc { | 68 | struct com_gsc_softc { | |
69 | struct com_softc sc_com; /* real "com" softc */ | 69 | struct com_softc sc_com; /* real "com" softc */ | |
70 | 70 | |||
71 | /* GSC-specific goo. */ | 71 | /* GSC-specific goo. */ | |
72 | void *sc_ih; /* interrupt handler */ | 72 | void *sc_ih; /* interrupt handler */ | |
73 | }; | 73 | }; | |
74 | 74 | |||
75 | int com_gsc_probe(device_t, cfdata_t , void *); | 75 | int com_gsc_probe(device_t, cfdata_t , void *); | |
76 | void com_gsc_attach(device_t, device_t, void *); | 76 | void com_gsc_attach(device_t, device_t, void *); | |
77 | 77 | |||
78 | CFATTACH_DECL_NEW(com_gsc, sizeof(struct com_gsc_softc), | 78 | CFATTACH_DECL_NEW(com_gsc, sizeof(struct com_gsc_softc), |
--- src/sys/arch/hp700/gsc/Attic/gscbusvar.h 2009/05/08 09:33:58 1.7
+++ src/sys/arch/hp700/gsc/Attic/gscbusvar.h 2009/05/24 06:53:35 1.8
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: gscbusvar.h,v 1.7 2009/05/08 09:33:58 skrll Exp $ */ | 1 | /* $NetBSD: gscbusvar.h,v 1.8 2009/05/24 06:53:35 skrll Exp $ */ | |
2 | 2 | |||
3 | /* $OpenBSD: gscbusvar.h,v 1.3 1999/08/16 02:48:39 mickey Exp $ */ | 3 | /* $OpenBSD: gscbusvar.h,v 1.3 1999/08/16 02:48:39 mickey Exp $ */ | |
4 | 4 | |||
5 | /* | 5 | /* | |
6 | * Copyright (c) 1998 Michael Shalayeff | 6 | * Copyright (c) 1998 Michael Shalayeff | |
7 | * All rights reserved. | 7 | * All rights reserved. | |
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 | |
@@ -47,17 +47,17 @@ struct gsc_attach_args { | @@ -47,17 +47,17 @@ struct gsc_attach_args { | |||
47 | /*#define ga_pdc_iodc_read ga_ca.ca_pdc_iodc_read */ | 47 | /*#define ga_pdc_iodc_read ga_ca.ca_pdc_iodc_read */ | |
48 | 48 | |||
49 | /* The interrupt register for this GSC bus. */ | 49 | /* The interrupt register for this GSC bus. */ | |
50 | struct hp700_int_reg *ga_int_reg; | 50 | struct hp700_int_reg *ga_int_reg; | |
51 | 51 | |||
52 | /* This fixes a module's attach arguments. */ | 52 | /* This fixes a module's attach arguments. */ | |
53 | void (*ga_fix_args)(void *, struct gsc_attach_args *); | 53 | void (*ga_fix_args)(void *, struct gsc_attach_args *); | |
54 | void *ga_fix_args_cookie; | 54 | void *ga_fix_args_cookie; | |
55 | 55 | |||
56 | /* The SCSI target for the host adapter. */ | 56 | /* The SCSI target for the host adapter. */ | |
57 | int ga_scsi_target; | 57 | int ga_scsi_target; | |
58 | 58 | |||
59 | /* The address for the Ethernet adapter. */ | 59 | /* The address for the Ethernet adapter. */ | |
60 | u_int8_t ga_ether_address[6]; | 60 | uint8_t ga_ether_address[6]; | |
61 | }; | 61 | }; | |
62 | 62 | |||
63 | int gscprint(void *, const char *); | 63 | int gscprint(void *, const char *); |
--- src/sys/arch/hp700/gsc/Attic/if_ie_gsc.c 2009/05/08 09:33:58 1.18
+++ src/sys/arch/hp700/gsc/Attic/if_ie_gsc.c 2009/05/24 06:53:35 1.19
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: if_ie_gsc.c,v 1.18 2009/05/08 09:33:58 skrll Exp $ */ | 1 | /* $NetBSD: if_ie_gsc.c,v 1.19 2009/05/24 06:53:35 skrll Exp $ */ | |
2 | 2 | |||
3 | /* $OpenBSD: if_ie_gsc.c,v 1.6 2001/01/12 22:57:04 mickey Exp $ */ | 3 | /* $OpenBSD: if_ie_gsc.c,v 1.6 2001/01/12 22:57:04 mickey Exp $ */ | |
4 | 4 | |||
5 | /* | 5 | /* | |
6 | * Copyright (c) 1998,1999 Michael Shalayeff | 6 | * Copyright (c) 1998,1999 Michael Shalayeff | |
7 | * All rights reserved. | 7 | * All rights reserved. | |
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 | |
@@ -32,27 +32,27 @@ | @@ -32,27 +32,27 @@ | |||
32 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 32 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
33 | */ | 33 | */ | |
34 | 34 | |||
35 | /* | 35 | /* | |
36 | * Referencies: | 36 | * Referencies: | |
37 | * 1. 82596DX and 82596SX High-Perfomance 32-bit Local Area Network Coprocessor | 37 | * 1. 82596DX and 82596SX High-Perfomance 32-bit Local Area Network Coprocessor | |
38 | * Intel Corporation, November 1996, Order Number: 290219-006 | 38 | * Intel Corporation, November 1996, Order Number: 290219-006 | |
39 | * | 39 | * | |
40 | * 2. 712 I/O Subsystem ERS Rev 1.0 | 40 | * 2. 712 I/O Subsystem ERS Rev 1.0 | |
41 | * Hewlett-Packard, June 17 1992, Dwg No. A-A2263-66510-31 | 41 | * Hewlett-Packard, June 17 1992, Dwg No. A-A2263-66510-31 | |
42 | */ | 42 | */ | |
43 | 43 | |||
44 | #include <sys/cdefs.h> | 44 | #include <sys/cdefs.h> | |
45 | __KERNEL_RCSID(0, "$NetBSD: if_ie_gsc.c,v 1.18 2009/05/08 09:33:58 skrll Exp $"); | 45 | __KERNEL_RCSID(0, "$NetBSD: if_ie_gsc.c,v 1.19 2009/05/24 06:53:35 skrll Exp $"); | |
46 | 46 | |||
47 | #include <sys/param.h> | 47 | #include <sys/param.h> | |
48 | #include <sys/systm.h> | 48 | #include <sys/systm.h> | |
49 | #include <sys/device.h> | 49 | #include <sys/device.h> | |
50 | #include <sys/socket.h> | 50 | #include <sys/socket.h> | |
51 | #include <sys/sockio.h> | 51 | #include <sys/sockio.h> | |
52 | 52 | |||
53 | #include <uvm/uvm_extern.h> | 53 | #include <uvm/uvm_extern.h> | |
54 | 54 | |||
55 | #include <net/if.h> | 55 | #include <net/if.h> | |
56 | #include <net/if_dl.h> | 56 | #include <net/if_dl.h> | |
57 | #include <net/if_ether.h> | 57 | #include <net/if_ether.h> | |
58 | #include <net/if_types.h> | 58 | #include <net/if_types.h> | |
@@ -75,29 +75,29 @@ __KERNEL_RCSID(0, "$NetBSD: if_ie_gsc.c, | @@ -75,29 +75,29 @@ __KERNEL_RCSID(0, "$NetBSD: if_ie_gsc.c, | |||
75 | #define I82596_DEBUG I82586_DEBUG | 75 | #define I82596_DEBUG I82586_DEBUG | |
76 | 76 | |||
77 | /* | 77 | /* | |
78 | * XXX fredette - I'm defining these on a hunch. When things | 78 | * XXX fredette - I'm defining these on a hunch. When things | |
79 | * appear to be working, remove these. | 79 | * appear to be working, remove these. | |
80 | */ | 80 | */ | |
81 | #if 1 | 81 | #if 1 | |
82 | #define fdcache_small fdcache | 82 | #define fdcache_small fdcache | |
83 | #define pdcache_small pdcache | 83 | #define pdcache_small pdcache | |
84 | #endif | 84 | #endif | |
85 | 85 | |||
86 | #ifdef __for_reference_only | 86 | #ifdef __for_reference_only | |
87 | struct ie_gsc_regs { | 87 | struct ie_gsc_regs { | |
88 | u_int32_t ie_reset; | 88 | uint32_t ie_reset; | |
89 | u_int32_t ie_port; | 89 | uint32_t ie_port; | |
90 | u_int32_t ie_attn; | 90 | uint32_t ie_attn; | |
91 | }; | 91 | }; | |
92 | #endif | 92 | #endif | |
93 | 93 | |||
94 | #define IE_GSC_BANK_SZ (12) | 94 | #define IE_GSC_BANK_SZ (12) | |
95 | #define IE_GSC_REG_RESET (0) | 95 | #define IE_GSC_REG_RESET (0) | |
96 | #define IE_GSC_REG_PORT (4) | 96 | #define IE_GSC_REG_PORT (4) | |
97 | #define IE_GSC_REG_ATTN (8) | 97 | #define IE_GSC_REG_ATTN (8) | |
98 | 98 | |||
99 | #define IE_GSC_ALIGN(v) ((((u_int) (v)) + 0xf) & ~0xf) | 99 | #define IE_GSC_ALIGN(v) ((((u_int) (v)) + 0xf) & ~0xf) | |
100 | 100 | |||
101 | #define IE_GSC_SYSBUS (IE_SYSBUS_596_RSVD_SET | \ | 101 | #define IE_GSC_SYSBUS (IE_SYSBUS_596_RSVD_SET | \ | |
102 | IE_SYSBUS_596_82586 | \ | 102 | IE_SYSBUS_596_82586 | \ | |
103 | IE_SYSBUS_596_INTLOW | \ | 103 | IE_SYSBUS_596_INTLOW | \ | |
@@ -381,27 +381,27 @@ ie_gsc_probe(device_t parent, cfdata_t m | @@ -381,27 +381,27 @@ ie_gsc_probe(device_t parent, cfdata_t m | |||
381 | 381 | |||
382 | return 1; | 382 | return 1; | |
383 | } | 383 | } | |
384 | 384 | |||
385 | void | 385 | void | |
386 | ie_gsc_attach(device_t parent, device_t self, void *aux) | 386 | ie_gsc_attach(device_t parent, device_t self, void *aux) | |
387 | { | 387 | { | |
388 | struct ie_gsc_softc *gsc = device_private(self); | 388 | struct ie_gsc_softc *gsc = device_private(self); | |
389 | struct ie_softc *sc = &gsc->ie; | 389 | struct ie_softc *sc = &gsc->ie; | |
390 | struct gsc_attach_args *ga = aux; | 390 | struct gsc_attach_args *ga = aux; | |
391 | bus_dma_segment_t seg; | 391 | bus_dma_segment_t seg; | |
392 | int rseg; | 392 | int rseg; | |
393 | int rv; | 393 | int rv; | |
394 | u_int8_t myaddr[ETHER_ADDR_LEN]; | 394 | uint8_t myaddr[ETHER_ADDR_LEN]; | |
395 | #ifdef PMAPDEBUG | 395 | #ifdef PMAPDEBUG | |
396 | extern int pmapdebug; | 396 | extern int pmapdebug; | |
397 | int opmapdebug = pmapdebug; | 397 | int opmapdebug = pmapdebug; | |
398 | pmapdebug = 0; | 398 | pmapdebug = 0; | |
399 | #endif | 399 | #endif | |
400 | 400 | |||
401 | if (ga->ga_type.iodc_sv_model == HPPA_FIO_GLAN) | 401 | if (ga->ga_type.iodc_sv_model == HPPA_FIO_GLAN) | |
402 | gsc->flags |= IEGSC_GECKO; | 402 | gsc->flags |= IEGSC_GECKO; | |
403 | 403 | |||
404 | /* | 404 | /* | |
405 | * Map the GSC registers. | 405 | * Map the GSC registers. | |
406 | */ | 406 | */ | |
407 | if (bus_space_map(ga->ga_iot, ga->ga_hpa, | 407 | if (bus_space_map(ga->ga_iot, ga->ga_hpa, |
--- src/sys/arch/hp700/gsc/Attic/if_iee_gsc.c 2009/05/10 04:26:19 1.14
+++ src/sys/arch/hp700/gsc/Attic/if_iee_gsc.c 2009/05/24 06:53:35 1.15
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: if_iee_gsc.c,v 1.14 2009/05/10 04:26:19 tsutsui Exp $ */ | 1 | /* $NetBSD: if_iee_gsc.c,v 1.15 2009/05/24 06:53:35 skrll Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 2003 Jochen Kunz. | 4 | * Copyright (c) 2003 Jochen Kunz. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * Redistribution and use in source and binary forms, with or without | 7 | * Redistribution and use in source and binary forms, with or without | |
8 | * modification, are permitted provided that the following conditions | 8 | * modification, are permitted provided that the following conditions | |
9 | * are met: | 9 | * are met: | |
10 | * 1. Redistributions of source code must retain the above copyright | 10 | * 1. Redistributions of source code must retain the above copyright | |
11 | * notice, this list of conditions and the following disclaimer. | 11 | * notice, this list of conditions and the following disclaimer. | |
12 | * 2. Redistributions in binary form must reproduce the above copyright | 12 | * 2. Redistributions in binary form must reproduce the above copyright | |
13 | * notice, this list of conditions and the following disclaimer in the | 13 | * notice, this list of conditions and the following disclaimer in the | |
14 | * documentation and/or other materials provided with the distribution. | 14 | * documentation and/or other materials provided with the distribution. | |
@@ -24,27 +24,27 @@ | @@ -24,27 +24,27 @@ | |||
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 | /* | 32 | /* | |
33 | * hp700 GSC bus MD frontend for the iee(4) Intel i82596 Ethernet driver. | 33 | * hp700 GSC bus MD frontend for the iee(4) Intel i82596 Ethernet driver. | |
34 | */ | 34 | */ | |
35 | 35 | |||
36 | #include <sys/cdefs.h> | 36 | #include <sys/cdefs.h> | |
37 | __KERNEL_RCSID(0, "$NetBSD: if_iee_gsc.c,v 1.14 2009/05/10 04:26:19 tsutsui Exp $"); | 37 | __KERNEL_RCSID(0, "$NetBSD: if_iee_gsc.c,v 1.15 2009/05/24 06:53:35 skrll Exp $"); | |
38 | 38 | |||
39 | /* autoconfig and device stuff */ | 39 | /* autoconfig and device stuff */ | |
40 | #include <sys/param.h> | 40 | #include <sys/param.h> | |
41 | #include <sys/device.h> | 41 | #include <sys/device.h> | |
42 | #include <sys/conf.h> | 42 | #include <sys/conf.h> | |
43 | #include <machine/iomod.h> | 43 | #include <machine/iomod.h> | |
44 | #include <machine/autoconf.h> | 44 | #include <machine/autoconf.h> | |
45 | #include <hp700/dev/cpudevs.h> | 45 | #include <hp700/dev/cpudevs.h> | |
46 | #include <hp700/gsc/gscbusvar.h> | 46 | #include <hp700/gsc/gscbusvar.h> | |
47 | #include "locators.h" | 47 | #include "locators.h" | |
48 | #include "ioconf.h" | 48 | #include "ioconf.h" | |
49 | 49 | |||
50 | /* bus_space / bus_dma etc. */ | 50 | /* bus_space / bus_dma etc. */ | |
@@ -95,31 +95,31 @@ struct iee_gsc_softc { | @@ -95,31 +95,31 @@ struct iee_gsc_softc { | |||
95 | bus_space_handle_t sc_ioh; | 95 | bus_space_handle_t sc_ioh; | |
96 | void *sc_ih; | 96 | void *sc_ih; | |
97 | }; | 97 | }; | |
98 | 98 | |||
99 | CFATTACH_DECL_NEW( | 99 | CFATTACH_DECL_NEW( | |
100 | iee_gsc, | 100 | iee_gsc, | |
101 | sizeof(struct iee_gsc_softc), | 101 | sizeof(struct iee_gsc_softc), | |
102 | iee_gsc_match, | 102 | iee_gsc_match, | |
103 | iee_gsc_attach, | 103 | iee_gsc_attach, | |
104 | iee_gsc_detach, | 104 | iee_gsc_detach, | |
105 | NULL | 105 | NULL | |
106 | ); | 106 | ); | |
107 | 107 | |||
108 | int iee_gsc_cmd(struct iee_softc *, u_int32_t); | 108 | int iee_gsc_cmd(struct iee_softc *, uint32_t); | |
109 | int iee_gsc_reset(struct iee_softc *); | 109 | int iee_gsc_reset(struct iee_softc *); | |
110 | 110 | |||
111 | int | 111 | int | |
112 | iee_gsc_cmd(struct iee_softc *sc, u_int32_t cmd) | 112 | iee_gsc_cmd(struct iee_softc *sc, uint32_t cmd) | |
113 | { | 113 | { | |
114 | struct iee_gsc_softc *sc_gsc = (struct iee_gsc_softc *)sc; | 114 | struct iee_gsc_softc *sc_gsc = (struct iee_gsc_softc *)sc; | |
115 | int n; | 115 | int n; | |
116 | uint16_t ack; | 116 | uint16_t ack; | |
117 | 117 | |||
118 | SC_SCB(sc)->scb_cmd = cmd; | 118 | SC_SCB(sc)->scb_cmd = cmd; | |
119 | IEE_SCBSYNC(sc, BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE); | 119 | IEE_SCBSYNC(sc, BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE); | |
120 | /* Issue a Channel Attention to force the chip to read the cmd. */ | 120 | /* Issue a Channel Attention to force the chip to read the cmd. */ | |
121 | bus_space_write_4(sc_gsc->sc_iot, sc_gsc->sc_ioh, IEE_GSC_CHANATT, 0); | 121 | bus_space_write_4(sc_gsc->sc_iot, sc_gsc->sc_ioh, IEE_GSC_CHANATT, 0); | |
122 | /* Wait for the cmd to finish */ | 122 | /* Wait for the cmd to finish */ | |
123 | for (n = 0 ; n < 100000; n++) { | 123 | for (n = 0 ; n < 100000; n++) { | |
124 | DELAY(1); | 124 | DELAY(1); | |
125 | IEE_SCBSYNC(sc, BUS_DMASYNC_POSTREAD|BUS_DMASYNC_POSTWRITE); | 125 | IEE_SCBSYNC(sc, BUS_DMASYNC_POSTREAD|BUS_DMASYNC_POSTWRITE); |
--- src/sys/arch/hp700/gsc/Attic/lpt_gsc.c 2009/05/08 09:33:58 1.10
+++ src/sys/arch/hp700/gsc/Attic/lpt_gsc.c 2009/05/24 06:53:35 1.11
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: lpt_gsc.c,v 1.10 2009/05/08 09:33:58 skrll Exp $ */ | 1 | /* $NetBSD: lpt_gsc.c,v 1.11 2009/05/24 06:53:35 skrll Exp $ */ | |
2 | 2 | |||
3 | /* $OpenBSD: lpt_gsc.c,v 1.6 2000/07/21 17:41:06 mickey Exp $ */ | 3 | /* $OpenBSD: lpt_gsc.c,v 1.6 2000/07/21 17:41:06 mickey Exp $ */ | |
4 | 4 | |||
5 | /* | 5 | /* | |
6 | * Copyright (c) 1998 Michael Shalayeff | 6 | * Copyright (c) 1998 Michael Shalayeff | |
7 | * Copyright (c) 1993, 1994 Charles Hannum. | 7 | * Copyright (c) 1993, 1994 Charles Hannum. | |
8 | * Copyright (c) 1990 William F. Jolitz, TeleMuse | 8 | * Copyright (c) 1990 William F. Jolitz, TeleMuse | |
9 | * All rights reserved. | 9 | * All rights reserved. | |
10 | * | 10 | * | |
11 | * Redistribution and use in source and binary forms, with or without | 11 | * Redistribution and use in source and binary forms, with or without | |
12 | * modification, are permitted provided that the following conditions | 12 | * modification, are permitted provided that the following conditions | |
13 | * are met: | 13 | * are met: | |
14 | * 1. Redistributions of source code must retain the above copyright | 14 | * 1. Redistributions of source code must retain the above copyright | |
@@ -43,27 +43,27 @@ | @@ -43,27 +43,27 @@ | |||
43 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | 43 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
44 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 44 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
45 | * ARE DISCLAIMED. IN NO EVENT SHALL THE DEVELOPER BE LIABLE | 45 | * ARE DISCLAIMED. IN NO EVENT SHALL THE DEVELOPER BE LIABLE | |
46 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | 46 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
47 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 47 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
48 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | 48 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
49 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | 49 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
50 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 50 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
51 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 51 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
52 | * SUCH DAMAGE. | 52 | * SUCH DAMAGE. | |
53 | */ | 53 | */ | |
54 | 54 | |||
55 | #include <sys/cdefs.h> | 55 | #include <sys/cdefs.h> | |
56 | __KERNEL_RCSID(0, "$NetBSD: lpt_gsc.c,v 1.10 2009/05/08 09:33:58 skrll Exp $"); | 56 | __KERNEL_RCSID(0, "$NetBSD: lpt_gsc.c,v 1.11 2009/05/24 06:53:35 skrll Exp $"); | |
57 | 57 | |||
58 | #include <sys/param.h> | 58 | #include <sys/param.h> | |
59 | #include <sys/systm.h> | 59 | #include <sys/systm.h> | |
60 | #include <sys/device.h> | 60 | #include <sys/device.h> | |
61 | 61 | |||
62 | #include <machine/bus.h> | 62 | #include <machine/bus.h> | |
63 | #include <machine/intr.h> | 63 | #include <machine/intr.h> | |
64 | #include <machine/iomod.h> | 64 | #include <machine/iomod.h> | |
65 | #include <machine/autoconf.h> | 65 | #include <machine/autoconf.h> | |
66 | 66 | |||
67 | #include <dev/ic/lptreg.h> | 67 | #include <dev/ic/lptreg.h> | |
68 | #include <dev/ic/lptvar.h> | 68 | #include <dev/ic/lptvar.h> | |
69 | 69 | |||
@@ -128,27 +128,27 @@ lpt_port_test(bus_space_tag_t iot, bus_s | @@ -128,27 +128,27 @@ lpt_port_test(bus_space_tag_t iot, bus_s | |||
128 | * | 128 | * | |
129 | * XXX Some printers may not like a fast pulse on init or strobe, I | 129 | * XXX Some printers may not like a fast pulse on init or strobe, I | |
130 | * don't know at this point, if that becomes a problem these bits | 130 | * don't know at this point, if that becomes a problem these bits | |
131 | * should be turned off in the mask byte for the control port test. | 131 | * should be turned off in the mask byte for the control port test. | |
132 | * | 132 | * | |
133 | * 3) Set the data and control ports to a value of 0 | 133 | * 3) Set the data and control ports to a value of 0 | |
134 | */ | 134 | */ | |
135 | int | 135 | int | |
136 | lpt_gsc_probe(device_t parent, cfdata_t match, void *aux) | 136 | lpt_gsc_probe(device_t parent, cfdata_t match, void *aux) | |
137 | { | 137 | { | |
138 | struct gsc_attach_args *ga = aux; | 138 | struct gsc_attach_args *ga = aux; | |
139 | bus_space_handle_t ioh; | 139 | bus_space_handle_t ioh; | |
140 | bus_addr_t base; | 140 | bus_addr_t base; | |
141 | u_int8_t mask, data; | 141 | uint8_t mask, data; | |
142 | int i, rv; | 142 | int i, rv; | |
143 | 143 | |||
144 | if (ga->ga_type.iodc_type != HPPA_TYPE_FIO || | 144 | if (ga->ga_type.iodc_type != HPPA_TYPE_FIO || | |
145 | ga->ga_type.iodc_sv_model != HPPA_FIO_CENT) | 145 | ga->ga_type.iodc_sv_model != HPPA_FIO_CENT) | |
146 | return 0; | 146 | return 0; | |
147 | 147 | |||
148 | #ifdef DEBUG | 148 | #ifdef DEBUG | |
149 | #define ABORT \ | 149 | #define ABORT \ | |
150 | do { \ | 150 | do { \ | |
151 | printf("lpt_gsc_probe: mask %x data %x failed\n", mask, \ | 151 | printf("lpt_gsc_probe: mask %x data %x failed\n", mask, \ | |
152 | data); \ | 152 | data); \ | |
153 | bus_space_unmap(ga->ga_iot, ioh, LPT_NPORTS); \ | 153 | bus_space_unmap(ga->ga_iot, ioh, LPT_NPORTS); \ | |
154 | return 0; \ | 154 | return 0; \ |
--- src/sys/arch/hp700/gsc/Attic/siop_gsc.c 2009/05/15 17:55:44 1.10
+++ src/sys/arch/hp700/gsc/Attic/siop_gsc.c 2009/05/24 06:53:35 1.11
@@ -1,35 +1,35 @@ | @@ -1,35 +1,35 @@ | |||
1 | /* $NetBSD: siop_gsc.c,v 1.10 2009/05/15 17:55:44 tsutsui Exp $ */ | 1 | /* $NetBSD: siop_gsc.c,v 1.11 2009/05/24 06:53:35 skrll Exp $ */ | |
2 | 2 | |||
3 | /* $OpenBSD: siop_gsc.c,v 1.4 2007/08/23 21:01:22 kettenis Exp $ */ | 3 | /* $OpenBSD: siop_gsc.c,v 1.4 2007/08/23 21:01:22 kettenis Exp $ */ | |
4 | 4 | |||
5 | /* | 5 | /* | |
6 | * Copyright (c) 2007 Mark Kettenis | 6 | * Copyright (c) 2007 Mark Kettenis | |
7 | * | 7 | * | |
8 | * Permission to use, copy, modify, and distribute this software for any | 8 | * Permission to use, copy, modify, and distribute this software for any | |
9 | * purpose with or without fee is hereby granted, provided that the above | 9 | * purpose with or without fee is hereby granted, provided that the above | |
10 | * copyright notice and this permission notice appear in all copies. | 10 | * copyright notice and this permission notice appear in all copies. | |
11 | * | 11 | * | |
12 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | 12 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | |
13 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | 13 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | |
14 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | 14 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | |
15 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | 15 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | |
16 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | 16 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | |
17 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | 17 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | |
18 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | 18 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | |
19 | */ | 19 | */ | |
20 | 20 | |||
21 | #include <sys/cdefs.h> | 21 | #include <sys/cdefs.h> | |
22 | __KERNEL_RCSID(0, "$NetBSD: siop_gsc.c,v 1.10 2009/05/15 17:55:44 tsutsui Exp $"); | 22 | __KERNEL_RCSID(0, "$NetBSD: siop_gsc.c,v 1.11 2009/05/24 06:53:35 skrll Exp $"); | |
23 | 23 | |||
24 | #include <sys/param.h> | 24 | #include <sys/param.h> | |
25 | #include <sys/device.h> | 25 | #include <sys/device.h> | |
26 | #include <sys/systm.h> | 26 | #include <sys/systm.h> | |
27 | 27 | |||
28 | #include <uvm/uvm_extern.h> | 28 | #include <uvm/uvm_extern.h> | |
29 | 29 | |||
30 | #include <machine/autoconf.h> | 30 | #include <machine/autoconf.h> | |
31 | #include <machine/bus.h> | 31 | #include <machine/bus.h> | |
32 | #include <machine/iomod.h> | 32 | #include <machine/iomod.h> | |
33 | 33 | |||
34 | #include <dev/scsipi/scsi_all.h> | 34 | #include <dev/scsipi/scsi_all.h> | |
35 | #include <dev/scsipi/scsipi_all.h> | 35 | #include <dev/scsipi/scsipi_all.h> | |
@@ -40,30 +40,30 @@ __KERNEL_RCSID(0, "$NetBSD: siop_gsc.c,v | @@ -40,30 +40,30 @@ __KERNEL_RCSID(0, "$NetBSD: siop_gsc.c,v | |||
40 | #include <dev/ic/siopvar.h> | 40 | #include <dev/ic/siopvar.h> | |
41 | 41 | |||
42 | #include <hp700/dev/cpudevs.h> | 42 | #include <hp700/dev/cpudevs.h> | |
43 | #include <hp700/gsc/gscbusvar.h> | 43 | #include <hp700/gsc/gscbusvar.h> | |
44 | 44 | |||
45 | #define SIOP_GSC_RESET 0x0000 | 45 | #define SIOP_GSC_RESET 0x0000 | |
46 | #define SIOP_GSC_OFFSET 0x0100 | 46 | #define SIOP_GSC_OFFSET 0x0100 | |
47 | 47 | |||
48 | int siop_gsc_match(device_t, cfdata_t, void *); | 48 | int siop_gsc_match(device_t, cfdata_t, void *); | |
49 | void siop_gsc_attach(device_t, device_t, void *); | 49 | void siop_gsc_attach(device_t, device_t, void *); | |
50 | int siop_gsc_intr(void *); | 50 | int siop_gsc_intr(void *); | |
51 | void siop_gsc_reset(struct siop_common_softc *); | 51 | void siop_gsc_reset(struct siop_common_softc *); | |
52 | 52 | |||
53 | u_int8_t siop_gsc_r1(void *, bus_space_handle_t, bus_size_t); | 53 | uint8_t siop_gsc_r1(void *, bus_space_handle_t, bus_size_t); | |
54 | u_int16_t siop_gsc_r2(void *, bus_space_handle_t, bus_size_t); | 54 | uint16_t siop_gsc_r2(void *, bus_space_handle_t, bus_size_t); | |
55 | void siop_gsc_w1(void *, bus_space_handle_t, bus_size_t, u_int8_t); | 55 | void siop_gsc_w1(void *, bus_space_handle_t, bus_size_t, uint8_t); | |
56 | void siop_gsc_w2(void *, bus_space_handle_t, bus_size_t, u_int16_t); | 56 | void siop_gsc_w2(void *, bus_space_handle_t, bus_size_t, uint16_t); | |
57 | 57 | |||
58 | struct siop_gsc_softc { | 58 | struct siop_gsc_softc { | |
59 | struct siop_softc sc_siop; | 59 | struct siop_softc sc_siop; | |
60 | bus_space_tag_t sc_iot; | 60 | bus_space_tag_t sc_iot; | |
61 | bus_space_handle_t sc_ioh; | 61 | bus_space_handle_t sc_ioh; | |
62 | struct hppa_bus_space_tag sc_bustag; | 62 | struct hppa_bus_space_tag sc_bustag; | |
63 | }; | 63 | }; | |
64 | 64 | |||
65 | CFATTACH_DECL_NEW(siop_gsc, sizeof(struct siop_gsc_softc), | 65 | CFATTACH_DECL_NEW(siop_gsc, sizeof(struct siop_gsc_softc), | |
66 | siop_gsc_match, siop_gsc_attach, NULL, NULL); | 66 | siop_gsc_match, siop_gsc_attach, NULL, NULL); | |
67 | 67 | |||
68 | int | 68 | int | |
69 | siop_gsc_match(device_t parent, cfdata_t match, void *aux) | 69 | siop_gsc_match(device_t parent, cfdata_t match, void *aux) | |
@@ -130,43 +130,43 @@ siop_gsc_attach(device_t parent, device_ | @@ -130,43 +130,43 @@ siop_gsc_attach(device_t parent, device_ | |||
130 | } | 130 | } | |
131 | 131 | |||
132 | void | 132 | void | |
133 | siop_gsc_reset(struct siop_common_softc *sc) | 133 | siop_gsc_reset(struct siop_common_softc *sc) | |
134 | { | 134 | { | |
135 | bus_space_write_1(sc->sc_rt, sc->sc_rh, SIOP_DCNTL, DCNTL_EA); | 135 | bus_space_write_1(sc->sc_rt, sc->sc_rh, SIOP_DCNTL, DCNTL_EA); | |
136 | bus_space_write_1(sc->sc_rt, sc->sc_rh, SIOP_CTEST0, CTEST0_EHP); | 136 | bus_space_write_1(sc->sc_rt, sc->sc_rh, SIOP_CTEST0, CTEST0_EHP); | |
137 | bus_space_write_1(sc->sc_rt, sc->sc_rh, SIOP_CTEST4, CTEST4_MUX); | 137 | bus_space_write_1(sc->sc_rt, sc->sc_rh, SIOP_CTEST4, CTEST4_MUX); | |
138 | 138 | |||
139 | bus_space_write_1(sc->sc_rt, sc->sc_rh, SIOP_STIME0, | 139 | bus_space_write_1(sc->sc_rt, sc->sc_rh, SIOP_STIME0, | |
140 | (0xc << STIME0_SEL_SHIFT)); | 140 | (0xc << STIME0_SEL_SHIFT)); | |
141 | } | 141 | } | |
142 | 142 | |||
143 | u_int8_t | 143 | uint8_t | |
144 | siop_gsc_r1(void *v, bus_space_handle_t h, bus_size_t o) | 144 | siop_gsc_r1(void *v, bus_space_handle_t h, bus_size_t o) | |
145 | { | 145 | { | |
146 | return *(volatile u_int8_t *)(h + (o ^ 3)); | 146 | return *(volatile uint8_t *)(h + (o ^ 3)); | |
147 | } | 147 | } | |
148 | 148 | |||
149 | u_int16_t | 149 | uint16_t | |
150 | siop_gsc_r2(void *v, bus_space_handle_t h, bus_size_t o) | 150 | siop_gsc_r2(void *v, bus_space_handle_t h, bus_size_t o) | |
151 | { | 151 | { | |
152 | if (o == SIOP_SIST0) { | 152 | if (o == SIOP_SIST0) { | |
153 | u_int16_t reg; | 153 | uint16_t reg; | |
154 | 154 | |||
155 | reg = siop_gsc_r1(v, h, SIOP_SIST0); | 155 | reg = siop_gsc_r1(v, h, SIOP_SIST0); | |
156 | reg |= siop_gsc_r1(v, h, SIOP_SIST1) << 8; | 156 | reg |= siop_gsc_r1(v, h, SIOP_SIST1) << 8; | |
157 | return reg; | 157 | return reg; | |
158 | } | 158 | } | |
159 | return *(volatile u_int16_t *)(h + (o ^ 2)); | 159 | return *(volatile uint16_t *)(h + (o ^ 2)); | |
160 | } | 160 | } | |
161 | 161 | |||
162 | void | 162 | void | |
163 | siop_gsc_w1(void *v, bus_space_handle_t h, bus_size_t o, u_int8_t vv) | 163 | siop_gsc_w1(void *v, bus_space_handle_t h, bus_size_t o, uint8_t vv) | |
164 | { | 164 | { | |
165 | *(volatile u_int8_t *)(h + (o ^ 3)) = vv; | 165 | *(volatile uint8_t *)(h + (o ^ 3)) = vv; | |
166 | } | 166 | } | |
167 | 167 | |||
168 | void | 168 | void | |
169 | siop_gsc_w2(void *v, bus_space_handle_t h, bus_size_t o, u_int16_t vv) | 169 | siop_gsc_w2(void *v, bus_space_handle_t h, bus_size_t o, uint16_t vv) | |
170 | { | 170 | { | |
171 | *(volatile u_int16_t *)(h + (o ^ 2)) = vv; | 171 | *(volatile uint16_t *)(h + (o ^ 2)) = vv; | |
172 | } | 172 | } |
--- src/sys/arch/hp700/gsc/Attic/osiop_gsc.c 2009/05/08 09:33:58 1.13
+++ src/sys/arch/hp700/gsc/Attic/osiop_gsc.c 2009/05/24 06:53:35 1.14
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: osiop_gsc.c,v 1.13 2009/05/08 09:33:58 skrll Exp $ */ | 1 | /* $NetBSD: osiop_gsc.c,v 1.14 2009/05/24 06:53:35 skrll Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 2001 Matt Fredette. All rights reserved. | 4 | * Copyright (c) 2001 Matt Fredette. All rights reserved. | |
5 | * | 5 | * | |
6 | * Redistribution and use in source and binary forms, with or without | 6 | * Redistribution and use in source and binary forms, with or without | |
7 | * modification, are permitted provided that the following conditions | 7 | * modification, are permitted provided that the following conditions | |
8 | * are met: | 8 | * are met: | |
9 | * 1. Redistributions of source code must retain the above copyright | 9 | * 1. Redistributions of source code must retain the above copyright | |
10 | * notice, this list of conditions and the following disclaimer. | 10 | * notice, this list of conditions and the following disclaimer. | |
11 | * 2. Redistributions in binary form must reproduce the above copyright | 11 | * 2. Redistributions in binary form must reproduce the above copyright | |
12 | * notice, this list of conditions and the following disclaimer in the | 12 | * notice, this list of conditions and the following disclaimer in the | |
13 | * documentation and/or other materials provided with the distribution. | 13 | * documentation and/or other materials provided with the distribution. | |
14 | * 3. The name of the author may not be used to endorse or promote products | 14 | * 3. The name of the author may not be used to endorse or promote products | |
@@ -73,27 +73,27 @@ | @@ -73,27 +73,27 @@ | |||
73 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR | 73 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR | |
74 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | 74 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |
75 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | 75 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | |
76 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | 76 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | |
77 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | 77 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | |
78 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 78 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
79 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 79 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
80 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 80 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
81 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 81 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | |
82 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 82 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
83 | */ | 83 | */ | |
84 | 84 | |||
85 | #include <sys/cdefs.h> | 85 | #include <sys/cdefs.h> | |
86 | __KERNEL_RCSID(0, "$NetBSD: osiop_gsc.c,v 1.13 2009/05/08 09:33:58 skrll Exp $"); | 86 | __KERNEL_RCSID(0, "$NetBSD: osiop_gsc.c,v 1.14 2009/05/24 06:53:35 skrll Exp $"); | |
87 | 87 | |||
88 | #include <sys/param.h> | 88 | #include <sys/param.h> | |
89 | #include <sys/systm.h> | 89 | #include <sys/systm.h> | |
90 | #include <sys/device.h> | 90 | #include <sys/device.h> | |
91 | #include <sys/buf.h> | 91 | #include <sys/buf.h> | |
92 | #include <sys/malloc.h> | 92 | #include <sys/malloc.h> | |
93 | 93 | |||
94 | #include <dev/scsipi/scsi_all.h> | 94 | #include <dev/scsipi/scsi_all.h> | |
95 | #include <dev/scsipi/scsipi_all.h> | 95 | #include <dev/scsipi/scsipi_all.h> | |
96 | #include <dev/scsipi/scsiconf.h> | 96 | #include <dev/scsipi/scsiconf.h> | |
97 | 97 | |||
98 | #include <machine/cpu.h> | 98 | #include <machine/cpu.h> | |
99 | #include <machine/intr.h> | 99 | #include <machine/intr.h> | |
@@ -183,27 +183,27 @@ osiop_gsc_attach(device_t parent, device | @@ -183,27 +183,27 @@ osiop_gsc_attach(device_t parent, device | |||
183 | osiop_attach(sc); | 183 | osiop_attach(sc); | |
184 | 184 | |||
185 | (void)hp700_intr_establish(self, IPL_BIO, | 185 | (void)hp700_intr_establish(self, IPL_BIO, | |
186 | osiop_gsc_intr, sc, ga->ga_int_reg, ga->ga_irq); | 186 | osiop_gsc_intr, sc, ga->ga_int_reg, ga->ga_irq); | |
187 | } | 187 | } | |
188 | 188 | |||
189 | /* | 189 | /* | |
190 | * interrupt handler | 190 | * interrupt handler | |
191 | */ | 191 | */ | |
192 | int | 192 | int | |
193 | osiop_gsc_intr(void *arg) | 193 | osiop_gsc_intr(void *arg) | |
194 | { | 194 | { | |
195 | struct osiop_softc *sc = arg; | 195 | struct osiop_softc *sc = arg; | |
196 | u_int8_t istat; | 196 | uint8_t istat; | |
197 | 197 | |||
198 | /* This is potentially nasty, since the IRQ is level triggered... */ | 198 | /* This is potentially nasty, since the IRQ is level triggered... */ | |
199 | if (sc->sc_flags & OSIOP_INTSOFF) | 199 | if (sc->sc_flags & OSIOP_INTSOFF) | |
200 | return (0); | 200 | return (0); | |
201 | 201 | |||
202 | istat = osiop_read_1(sc, OSIOP_ISTAT); | 202 | istat = osiop_read_1(sc, OSIOP_ISTAT); | |
203 | 203 | |||
204 | if ((istat & (OSIOP_ISTAT_SIP | OSIOP_ISTAT_DIP)) == 0) | 204 | if ((istat & (OSIOP_ISTAT_SIP | OSIOP_ISTAT_DIP)) == 0) | |
205 | return (0); | 205 | return (0); | |
206 | 206 | |||
207 | /* Save interrupt details for the back-end interrupt handler */ | 207 | /* Save interrupt details for the back-end interrupt handler */ | |
208 | sc->sc_sstat0 = osiop_read_1(sc, OSIOP_SSTAT0); | 208 | sc->sc_sstat0 = osiop_read_1(sc, OSIOP_SSTAT0); | |
209 | sc->sc_istat = istat; | 209 | sc->sc_istat = istat; |
--- src/sys/arch/hp700/include/Attic/bus.h 2007/03/04 05:59:51 1.12
+++ src/sys/arch/hp700/include/Attic/bus.h 2009/05/24 06:53:35 1.13
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: bus.h,v 1.12 2007/03/04 05:59:51 christos Exp $ */ | 1 | /* $NetBSD: bus.h,v 1.13 2009/05/24 06:53:35 skrll Exp $ */ | |
2 | 2 | |||
3 | /* $OpenBSD: bus.h,v 1.13 2001/07/30 14:15:59 art Exp $ */ | 3 | /* $OpenBSD: bus.h,v 1.13 2001/07/30 14:15:59 art Exp $ */ | |
4 | 4 | |||
5 | /* | 5 | /* | |
6 | * Copyright (c) 1998,1999 Michael Shalayeff | 6 | * Copyright (c) 1998,1999 Michael Shalayeff | |
7 | * All rights reserved. | 7 | * All rights reserved. | |
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 | |
@@ -55,117 +55,117 @@ struct hppa_bus_space_tag { | @@ -55,117 +55,117 @@ struct hppa_bus_space_tag { | |||
55 | bus_size_t size); | 55 | bus_size_t size); | |
56 | int (*hbt_subregion)(void *v, bus_space_handle_t bsh, | 56 | int (*hbt_subregion)(void *v, bus_space_handle_t bsh, | |
57 | bus_size_t offset, bus_size_t size, | 57 | bus_size_t offset, bus_size_t size, | |
58 | bus_space_handle_t *nbshp); | 58 | bus_space_handle_t *nbshp); | |
59 | int (*hbt_alloc)(void *v, bus_addr_t rstart, bus_addr_t rend, | 59 | int (*hbt_alloc)(void *v, bus_addr_t rstart, bus_addr_t rend, | |
60 | bus_size_t size, bus_size_t align, | 60 | bus_size_t size, bus_size_t align, | |
61 | bus_size_t boundary, int flags, | 61 | bus_size_t boundary, int flags, | |
62 | bus_addr_t *addrp, bus_space_handle_t *bshp); | 62 | bus_addr_t *addrp, bus_space_handle_t *bshp); | |
63 | void (*hbt_free)(void *, bus_space_handle_t, bus_size_t); | 63 | void (*hbt_free)(void *, bus_space_handle_t, bus_size_t); | |
64 | void (*hbt_barrier)(void *v, bus_space_handle_t h, | 64 | void (*hbt_barrier)(void *v, bus_space_handle_t h, | |
65 | bus_size_t o, bus_size_t l, int op); | 65 | bus_size_t o, bus_size_t l, int op); | |
66 | void *(*hbt_vaddr)(void *, bus_space_handle_t); | 66 | void *(*hbt_vaddr)(void *, bus_space_handle_t); | |
67 | 67 | |||
68 | u_int8_t (*hbt_r1)(void *, bus_space_handle_t, bus_size_t); | 68 | uint8_t (*hbt_r1)(void *, bus_space_handle_t, bus_size_t); | |
69 | u_int16_t (*hbt_r2)(void *, bus_space_handle_t, bus_size_t); | 69 | uint16_t (*hbt_r2)(void *, bus_space_handle_t, bus_size_t); | |
70 | u_int32_t (*hbt_r4)(void *, bus_space_handle_t, bus_size_t); | 70 | uint32_t (*hbt_r4)(void *, bus_space_handle_t, bus_size_t); | |
71 | u_int64_t (*hbt_r8)(void *, bus_space_handle_t, bus_size_t); | 71 | uint64_t (*hbt_r8)(void *, bus_space_handle_t, bus_size_t); | |
72 | 72 | |||
73 | void (*hbt_w1)(void *, bus_space_handle_t, bus_size_t, u_int8_t); | 73 | void (*hbt_w1)(void *, bus_space_handle_t, bus_size_t, uint8_t); | |
74 | void (*hbt_w2)(void *, bus_space_handle_t, bus_size_t, u_int16_t); | 74 | void (*hbt_w2)(void *, bus_space_handle_t, bus_size_t, uint16_t); | |
75 | void (*hbt_w4)(void *, bus_space_handle_t, bus_size_t, u_int32_t); | 75 | void (*hbt_w4)(void *, bus_space_handle_t, bus_size_t, uint32_t); | |
76 | void (*hbt_w8)(void *, bus_space_handle_t, bus_size_t, u_int64_t); | 76 | void (*hbt_w8)(void *, bus_space_handle_t, bus_size_t, uint64_t); | |
77 | 77 | |||
78 | void (*hbt_rm_1)(void *v, bus_space_handle_t h, | 78 | void (*hbt_rm_1)(void *v, bus_space_handle_t h, | |
79 | bus_size_t o, u_int8_t *a, bus_size_t c); | 79 | bus_size_t o, uint8_t *a, bus_size_t c); | |
80 | void (*hbt_rm_2)(void *v, bus_space_handle_t h, | 80 | void (*hbt_rm_2)(void *v, bus_space_handle_t h, | |
81 | bus_size_t o, u_int16_t *a, bus_size_t c); | 81 | bus_size_t o, uint16_t *a, bus_size_t c); | |
82 | void (*hbt_rm_4)(void *v, bus_space_handle_t h, | 82 | void (*hbt_rm_4)(void *v, bus_space_handle_t h, | |
83 | bus_size_t o, u_int32_t *a, bus_size_t c); | 83 | bus_size_t o, uint32_t *a, bus_size_t c); | |
84 | void (*hbt_rm_8)(void *v, bus_space_handle_t h, | 84 | void (*hbt_rm_8)(void *v, bus_space_handle_t h, | |
85 | bus_size_t o, u_int64_t *a, bus_size_t c); | 85 | bus_size_t o, uint64_t *a, bus_size_t c); | |
86 | 86 | |||
87 | void (*hbt_wm_1)(void *v, bus_space_handle_t h, bus_size_t o, | 87 | void (*hbt_wm_1)(void *v, bus_space_handle_t h, bus_size_t o, | |
88 | const u_int8_t *a, bus_size_t c); | 88 | const uint8_t *a, bus_size_t c); | |
89 | void (*hbt_wm_2)(void *v, bus_space_handle_t h, bus_size_t o, | 89 | void (*hbt_wm_2)(void *v, bus_space_handle_t h, bus_size_t o, | |
90 | const u_int16_t *a, bus_size_t c); | 90 | const uint16_t *a, bus_size_t c); | |
91 | void (*hbt_wm_4)(void *v, bus_space_handle_t h, bus_size_t o, | 91 | void (*hbt_wm_4)(void *v, bus_space_handle_t h, bus_size_t o, | |
92 | const u_int32_t *a, bus_size_t c); | 92 | const uint32_t *a, bus_size_t c); | |
93 | void (*hbt_wm_8)(void *v, bus_space_handle_t h, bus_size_t o, | 93 | void (*hbt_wm_8)(void *v, bus_space_handle_t h, bus_size_t o, | |
94 | const u_int64_t *a, bus_size_t c); | 94 | const uint64_t *a, bus_size_t c); | |
95 | 95 | |||
96 | void (*hbt_sm_1)(void *v, bus_space_handle_t h, bus_size_t o, | 96 | void (*hbt_sm_1)(void *v, bus_space_handle_t h, bus_size_t o, | |
97 | u_int8_t vv, bus_size_t c); | 97 | uint8_t vv, bus_size_t c); | |
98 | void (*hbt_sm_2)(void *v, bus_space_handle_t h, bus_size_t o, | 98 | void (*hbt_sm_2)(void *v, bus_space_handle_t h, bus_size_t o, | |
99 | u_int16_t vv, bus_size_t c); | 99 | uint16_t vv, bus_size_t c); | |
100 | void (*hbt_sm_4)(void *v, bus_space_handle_t h, bus_size_t o, | 100 | void (*hbt_sm_4)(void *v, bus_space_handle_t h, bus_size_t o, | |
101 | u_int32_t vv, bus_size_t c); | 101 | uint32_t vv, bus_size_t c); | |
102 | void (*hbt_sm_8)(void *v, bus_space_handle_t h, bus_size_t o, | 102 | void (*hbt_sm_8)(void *v, bus_space_handle_t h, bus_size_t o, | |
103 | u_int64_t vv, bus_size_t c); | 103 | uint64_t vv, bus_size_t c); | |
104 | 104 | |||
105 | void (*hbt_rrm_2)(void *v, bus_space_handle_t h, | 105 | void (*hbt_rrm_2)(void *v, bus_space_handle_t h, | |
106 | bus_size_t o, u_int16_t *a, bus_size_t c); | 106 | bus_size_t o, uint16_t *a, bus_size_t c); | |
107 | void (*hbt_rrm_4)(void *v, bus_space_handle_t h, | 107 | void (*hbt_rrm_4)(void *v, bus_space_handle_t h, | |
108 | bus_size_t o, u_int32_t *a, bus_size_t c); | 108 | bus_size_t o, uint32_t *a, bus_size_t c); | |
109 | void (*hbt_rrm_8)(void *v, bus_space_handle_t h, | 109 | void (*hbt_rrm_8)(void *v, bus_space_handle_t h, | |
110 | bus_size_t o, u_int64_t *a, bus_size_t c); | 110 | bus_size_t o, uint64_t *a, bus_size_t c); | |
111 | 111 | |||
112 | void (*hbt_wrm_2)(void *v, bus_space_handle_t h, | 112 | void (*hbt_wrm_2)(void *v, bus_space_handle_t h, | |
113 | bus_size_t o, const u_int16_t *a, bus_size_t c); | 113 | bus_size_t o, const uint16_t *a, bus_size_t c); | |
114 | void (*hbt_wrm_4)(void *v, bus_space_handle_t h, | 114 | void (*hbt_wrm_4)(void *v, bus_space_handle_t h, | |
115 | bus_size_t o, const u_int32_t *a, bus_size_t c); | 115 | bus_size_t o, const uint32_t *a, bus_size_t c); | |
116 | void (*hbt_wrm_8)(void *v, bus_space_handle_t h, | 116 | void (*hbt_wrm_8)(void *v, bus_space_handle_t h, | |
117 | bus_size_t o, const u_int64_t *a, bus_size_t c); | 117 | bus_size_t o, const uint64_t *a, bus_size_t c); | |
118 | 118 | |||
119 | void (*hbt_rr_1)(void *v, bus_space_handle_t h, | 119 | void (*hbt_rr_1)(void *v, bus_space_handle_t h, | |
120 | bus_size_t o, u_int8_t *a, bus_size_t c); | 120 | bus_size_t o, uint8_t *a, bus_size_t c); | |
121 | void (*hbt_rr_2)(void *v, bus_space_handle_t h, | 121 | void (*hbt_rr_2)(void *v, bus_space_handle_t h, | |
122 | bus_size_t o, u_int16_t *a, bus_size_t c); | 122 | bus_size_t o, uint16_t *a, bus_size_t c); | |
123 | void (*hbt_rr_4)(void *v, bus_space_handle_t h, | 123 | void (*hbt_rr_4)(void *v, bus_space_handle_t h, | |
124 | bus_size_t o, u_int32_t *a, bus_size_t c); | 124 | bus_size_t o, uint32_t *a, bus_size_t c); | |
125 | void (*hbt_rr_8)(void *v, bus_space_handle_t h, | 125 | void (*hbt_rr_8)(void *v, bus_space_handle_t h, | |
126 | bus_size_t o, u_int64_t *a, bus_size_t c); | 126 | bus_size_t o, uint64_t *a, bus_size_t c); | |
127 | 127 | |||
128 | void (*hbt_wr_1)(void *v, bus_space_handle_t h, | 128 | void (*hbt_wr_1)(void *v, bus_space_handle_t h, | |
129 | bus_size_t o, const u_int8_t *a, bus_size_t c); | 129 | bus_size_t o, const uint8_t *a, bus_size_t c); | |
130 | void (*hbt_wr_2)(void *v, bus_space_handle_t h, | 130 | void (*hbt_wr_2)(void *v, bus_space_handle_t h, | |
131 | bus_size_t o, const u_int16_t *a, bus_size_t c); | 131 | bus_size_t o, const uint16_t *a, bus_size_t c); | |
132 | void (*hbt_wr_4)(void *v, bus_space_handle_t h, | 132 | void (*hbt_wr_4)(void *v, bus_space_handle_t h, | |
133 | bus_size_t o, const u_int32_t *a, bus_size_t c); | 133 | bus_size_t o, const uint32_t *a, bus_size_t c); | |
134 | void (*hbt_wr_8)(void *v, bus_space_handle_t h, | 134 | void (*hbt_wr_8)(void *v, bus_space_handle_t h, | |
135 | bus_size_t o, const u_int64_t *a, bus_size_t c); | 135 | bus_size_t o, const uint64_t *a, bus_size_t c); | |
136 | 136 | |||
137 | void (*hbt_rrr_2)(void *v, bus_space_handle_t h, | 137 | void (*hbt_rrr_2)(void *v, bus_space_handle_t h, | |
138 | bus_size_t o, u_int16_t *a, bus_size_t c); | 138 | bus_size_t o, uint16_t *a, bus_size_t c); | |
139 | void (*hbt_rrr_4)(void *v, bus_space_handle_t h, | 139 | void (*hbt_rrr_4)(void *v, bus_space_handle_t h, | |
140 | bus_size_t o, u_int32_t *a, bus_size_t c); | 140 | bus_size_t o, uint32_t *a, bus_size_t c); | |
141 | void (*hbt_rrr_8)(void *v, bus_space_handle_t h, | 141 | void (*hbt_rrr_8)(void *v, bus_space_handle_t h, | |
142 | bus_size_t o, u_int64_t *a, bus_size_t c); | 142 | bus_size_t o, uint64_t *a, bus_size_t c); | |
143 | 143 | |||
144 | void (*hbt_wrr_2)(void *v, bus_space_handle_t h, | 144 | void (*hbt_wrr_2)(void *v, bus_space_handle_t h, | |
145 | bus_size_t o, const u_int16_t *a, bus_size_t c); | 145 | bus_size_t o, const uint16_t *a, bus_size_t c); | |
146 | void (*hbt_wrr_4)(void *v, bus_space_handle_t h, | 146 | void (*hbt_wrr_4)(void *v, bus_space_handle_t h, | |
147 | bus_size_t o, const u_int32_t *a, bus_size_t c); | 147 | bus_size_t o, const uint32_t *a, bus_size_t c); | |
148 | void (*hbt_wrr_8)(void *v, bus_space_handle_t h, | 148 | void (*hbt_wrr_8)(void *v, bus_space_handle_t h, | |
149 | bus_size_t o, const u_int64_t *a, bus_size_t c); | 149 | bus_size_t o, const uint64_t *a, bus_size_t c); | |
150 | 150 | |||
151 | void (*hbt_sr_1)(void *v, bus_space_handle_t h, | 151 | void (*hbt_sr_1)(void *v, bus_space_handle_t h, | |
152 | bus_size_t o, u_int8_t vv, bus_size_t c); | 152 | bus_size_t o, uint8_t vv, bus_size_t c); | |
153 | void (*hbt_sr_2)(void *v, bus_space_handle_t h, | 153 | void (*hbt_sr_2)(void *v, bus_space_handle_t h, | |
154 | bus_size_t o, u_int16_t vv, bus_size_t c); | 154 | bus_size_t o, uint16_t vv, bus_size_t c); | |
155 | void (*hbt_sr_4)(void *v, bus_space_handle_t h, | 155 | void (*hbt_sr_4)(void *v, bus_space_handle_t h, | |
156 | bus_size_t o, u_int32_t vv, bus_size_t c); | 156 | bus_size_t o, uint32_t vv, bus_size_t c); | |
157 | void (*hbt_sr_8)(void *v, bus_space_handle_t h, | 157 | void (*hbt_sr_8)(void *v, bus_space_handle_t h, | |
158 | bus_size_t o, u_int64_t vv, bus_size_t c); | 158 | bus_size_t o, uint64_t vv, bus_size_t c); | |
159 | 159 | |||
160 | void (*hbt_cp_1)(void *v, bus_space_handle_t h1, bus_size_t o1, | 160 | void (*hbt_cp_1)(void *v, bus_space_handle_t h1, bus_size_t o1, | |
161 | bus_space_handle_t h2, bus_size_t o2, bus_size_t c); | 161 | bus_space_handle_t h2, bus_size_t o2, bus_size_t c); | |
162 | void (*hbt_cp_2)(void *v, bus_space_handle_t h1, bus_size_t o1, | 162 | void (*hbt_cp_2)(void *v, bus_space_handle_t h1, bus_size_t o1, | |
163 | bus_space_handle_t h2, bus_size_t o2, bus_size_t c); | 163 | bus_space_handle_t h2, bus_size_t o2, bus_size_t c); | |
164 | void (*hbt_cp_4)(void *v, bus_space_handle_t h1, bus_size_t o1, | 164 | void (*hbt_cp_4)(void *v, bus_space_handle_t h1, bus_size_t o1, | |
165 | bus_space_handle_t h2, bus_size_t o2, bus_size_t c); | 165 | bus_space_handle_t h2, bus_size_t o2, bus_size_t c); | |
166 | void (*hbt_cp_8)(void *v, bus_space_handle_t h1, bus_size_t o1, | 166 | void (*hbt_cp_8)(void *v, bus_space_handle_t h1, bus_size_t o1, | |
167 | bus_space_handle_t h2, bus_size_t o2, bus_size_t c); | 167 | bus_space_handle_t h2, bus_size_t o2, bus_size_t c); | |
168 | }; | 168 | }; | |
169 | typedef const struct hppa_bus_space_tag *bus_space_tag_t; | 169 | typedef const struct hppa_bus_space_tag *bus_space_tag_t; | |
170 | extern const struct hppa_bus_space_tag hppa_bustag; | 170 | extern const struct hppa_bus_space_tag hppa_bustag; | |
171 | 171 |
--- src/sys/arch/hp700/include/Attic/pdc.h 2009/05/08 09:33:58 1.9
+++ src/sys/arch/hp700/include/Attic/pdc.h 2009/05/24 06:53:35 1.10
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: pdc.h,v 1.9 2009/05/08 09:33:58 skrll Exp $ */ | 1 | /* $NetBSD: pdc.h,v 1.10 2009/05/24 06:53:35 skrll Exp $ */ | |
2 | 2 | |||
3 | /* $OpenBSD: pdc.h,v 1.35 2007/07/15 20:03:48 kettenis Exp $ */ | 3 | /* $OpenBSD: pdc.h,v 1.35 2007/07/15 20:03:48 kettenis Exp $ */ | |
4 | 4 | |||
5 | /* | 5 | /* | |
6 | * Copyright (c) 1990 mt Xinu, Inc. All rights reserved. | 6 | * Copyright (c) 1990 mt Xinu, Inc. All rights reserved. | |
7 | * Copyright (c) 1990,1991,1992,1994 University of Utah. All rights reserved. | 7 | * Copyright (c) 1990,1991,1992,1994 University of Utah. All rights reserved. | |
8 | * | 8 | * | |
9 | * Permission to use, copy, modify and distribute this software is hereby | 9 | * Permission to use, copy, modify and distribute this software is hereby | |
10 | * granted provided that (1) source code retains these copyright, permission, | 10 | * granted provided that (1) source code retains these copyright, permission, | |
11 | * and disclaimer notices, and (2) redistributions including binaries | 11 | * and disclaimer notices, and (2) redistributions including binaries | |
12 | * reproduce the notices in supporting documentation, and (3) all advertising | 12 | * reproduce the notices in supporting documentation, and (3) all advertising | |
13 | * materials mentioning features or use of this software display the following | 13 | * materials mentioning features or use of this software display the following | |
14 | * acknowledgement: ``This product includes software developed by the | 14 | * acknowledgement: ``This product includes software developed by the | |
@@ -561,60 +561,60 @@ struct pdc_pat_cell_module { /* PDC_PAT_ | @@ -561,60 +561,60 @@ struct pdc_pat_cell_module { /* PDC_PAT_ | |||
561 | #define PDC_PAT_CELL_MODIOC(t) (((t) >> 40) & 0xff) | 561 | #define PDC_PAT_CELL_MODIOC(t) (((t) >> 40) & 0xff) | |
562 | #define PDC_PAT_CELL_MODSIZE(t) (((t) & 0xffffff) << PAGE_SHIFT) | 562 | #define PDC_PAT_CELL_MODSIZE(t) (((t) & 0xffffff) << PAGE_SHIFT) | |
563 | u_long loc; /* module location */ | 563 | u_long loc; /* module location */ | |
564 | struct device_path dp; /* module path */ | 564 | struct device_path dp; /* module path */ | |
565 | u_long pad[508]; /* cell module gedoens */ | 565 | u_long pad[508]; /* cell module gedoens */ | |
566 | }; | 566 | }; | |
567 | 567 | |||
568 | struct pdc_pat_io_num { /* PDC_PAT_IO */ | 568 | struct pdc_pat_io_num { /* PDC_PAT_IO */ | |
569 | u_int num; | 569 | u_int num; | |
570 | u_int filler[31]; | 570 | u_int filler[31]; | |
571 | }; | 571 | }; | |
572 | 572 | |||
573 | struct pdc_pat_pci_rt { /* PDC_PAT_IO_GET_PCI_RT */ | 573 | struct pdc_pat_pci_rt { /* PDC_PAT_IO_GET_PCI_RT */ | |
574 | u_int8_t type; /* 0x8b */ | 574 | uint8_t type; /* 0x8b */ | |
575 | u_int8_t len; | 575 | uint8_t len; | |
576 | u_int8_t itype; /* 0 -- vectored int */ | 576 | uint8_t itype; /* 0 -- vectored int */ | |
577 | u_int8_t trigger; /* polarity/level */ | 577 | uint8_t trigger; /* polarity/level */ | |
578 | u_int8_t pin; /* PCI pin number */ | 578 | uint8_t pin; /* PCI pin number */ | |
579 | u_int8_t bus; | 579 | uint8_t bus; | |
580 | u_int8_t seg; /* reserved */ | 580 | uint8_t seg; /* reserved */ | |
581 | u_int8_t line; | 581 | uint8_t line; | |
582 | u_int64_t addr; /* io sapic address */ | 582 | uint64_t addr; /* io sapic address */ | |
583 | }; | 583 | }; | |
584 | 584 | |||
585 | struct pdc_memmap { /* PDC_MEMMAP */ | 585 | struct pdc_memmap { /* PDC_MEMMAP */ | |
586 | u_int hpa; /* HPA for module */ | 586 | u_int hpa; /* HPA for module */ | |
587 | u_int morepages; /* additional IO pages */ | 587 | u_int morepages; /* additional IO pages */ | |
588 | u_int filler[30]; | 588 | u_int filler[30]; | |
589 | }; | 589 | }; | |
590 | 590 | |||
591 | struct pdc_system_map_find_mod { /* PDC_SYSTEM_MAP_FIND_MOD */ | 591 | struct pdc_system_map_find_mod { /* PDC_SYSTEM_MAP_FIND_MOD */ | |
592 | u_int hpa; | 592 | u_int hpa; | |
593 | u_int size; /* pages */ | 593 | u_int size; /* pages */ | |
594 | u_int naddrs; | 594 | u_int naddrs; | |
595 | u_int mod_index; | 595 | u_int mod_index; | |
596 | u_int filler[28]; | 596 | u_int filler[28]; | |
597 | }; | 597 | }; | |
598 | 598 | |||
599 | struct pdc_system_map_find_addr { /* PDC_SYSTEM_MAP_FIND_ADDR */ | 599 | struct pdc_system_map_find_addr { /* PDC_SYSTEM_MAP_FIND_ADDR */ | |
600 | u_int hpa; | 600 | u_int hpa; | |
601 | u_int size; /* pages */ | 601 | u_int size; /* pages */ | |
602 | u_int filler[30]; | 602 | u_int filler[30]; | |
603 | }; | 603 | }; | |
604 | 604 | |||
605 | struct pdc_lan_station_id { /* PDC_LAN_STATION_ID */ | 605 | struct pdc_lan_station_id { /* PDC_LAN_STATION_ID */ | |
606 | u_int8_t addr[6]; | 606 | uint8_t addr[6]; | |
607 | u_int8_t filler1[2]; | 607 | uint8_t filler1[2]; | |
608 | u_int filler2[30]; | 608 | u_int filler2[30]; | |
609 | }; | 609 | }; | |
610 | 610 | |||
611 | /* | 611 | /* | |
612 | * The PDC_CHASSIS is a strange bird. The format for updating the display | 612 | * The PDC_CHASSIS is a strange bird. The format for updating the display | |
613 | * is as follows: | 613 | * is as follows: | |
614 | * | 614 | * | |
615 | * 0 11 12 14 15 16 19 20 23 24 27 28 31 | 615 | * 0 11 12 14 15 16 19 20 23 24 27 28 31 | |
616 | * +-------+----------+-------+--------+--------+--------+--------+ | 616 | * +-------+----------+-------+--------+--------+--------+--------+ | |
617 | * | R | OS State | Blank | Hex1 | Hex2 | Hex3 | Hex4 | | 617 | * | R | OS State | Blank | Hex1 | Hex2 | Hex3 | Hex4 | | |
618 | * +-------+----------+-------+--------+--------+--------+--------+ | 618 | * +-------+----------+-------+--------+--------+--------+--------+ | |
619 | * | 619 | * | |
620 | * Unfortunately, someone forgot to tell the hardware designers that | 620 | * Unfortunately, someone forgot to tell the hardware designers that | |
@@ -650,30 +650,30 @@ struct pdc_lan_station_id { /* PDC_LAN_S | @@ -650,30 +650,30 @@ struct pdc_lan_station_id { /* PDC_LAN_S | |||
650 | 650 | |||
651 | struct pdc_chassis_info { | 651 | struct pdc_chassis_info { | |
652 | u_int size; | 652 | u_int size; | |
653 | u_int max_size; | 653 | u_int max_size; | |
654 | u_int filler[30]; | 654 | u_int filler[30]; | |
655 | }; | 655 | }; | |
656 | 656 | |||
657 | struct pdc_chassis_lcd { | 657 | struct pdc_chassis_lcd { | |
658 | u_int model : 16, | 658 | u_int model : 16, | |
659 | width : 16; | 659 | width : 16; | |
660 | u_int cmd_addr; | 660 | u_int cmd_addr; | |
661 | u_int data_addr; | 661 | u_int data_addr; | |
662 | u_int delay; | 662 | u_int delay; | |
663 | u_int8_t line[2]; | 663 | uint8_t line[2]; | |
664 | u_int8_t enabled; | 664 | uint8_t enabled; | |
665 | u_int8_t heartbeat[3]; | 665 | uint8_t heartbeat[3]; | |
666 | u_int8_t disk[3]; | 666 | uint8_t disk[3]; | |
667 | u_int filler[25]; | 667 | u_int filler[25]; | |
668 | }; | 668 | }; | |
669 | 669 | |||
670 | /* | 670 | /* | |
671 | * A processors Stable Storage is accessed through the PDC. There are | 671 | * A processors Stable Storage is accessed through the PDC. There are | |
672 | * at least 96 bytes of stable storage (the device path information may | 672 | * at least 96 bytes of stable storage (the device path information may | |
673 | * or may not exist). However, as far as I know, processors provide at | 673 | * or may not exist). However, as far as I know, processors provide at | |
674 | * least 192 bytes of stable storage. | 674 | * least 192 bytes of stable storage. | |
675 | */ | 675 | */ | |
676 | struct stable_storage { | 676 | struct stable_storage { | |
677 | struct device_path ss_pri_boot; /* (see above) */ | 677 | struct device_path ss_pri_boot; /* (see above) */ | |
678 | char ss_filenames[32]; | 678 | char ss_filenames[32]; | |
679 | u_short ss_os_version; /* 0 == none, 1 == HP-UX, 2 == MPE-XL */ | 679 | u_short ss_os_version; /* 0 == none, 1 == HP-UX, 2 == MPE-XL */ |
--- src/sys/arch/hppa/hppa/fpu.c 2009/04/30 15:34:24 1.17
+++ src/sys/arch/hppa/hppa/fpu.c 2009/05/24 06:53:35 1.18
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: fpu.c,v 1.17 2009/04/30 15:34:24 skrll Exp $ */ | 1 | /* $NetBSD: fpu.c,v 1.18 2009/05/24 06:53:35 skrll 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 Matthew Fredette. | 8 | * by Matthew Fredette. | |
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. | |
@@ -24,27 +24,27 @@ | @@ -24,27 +24,27 @@ | |||
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 | /* | 32 | /* | |
33 | * FPU handling for NetBSD/hppa. | 33 | * FPU handling for NetBSD/hppa. | |
34 | */ | 34 | */ | |
35 | 35 | |||
36 | #include <sys/cdefs.h> | 36 | #include <sys/cdefs.h> | |
37 | __KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.17 2009/04/30 15:34:24 skrll Exp $"); | 37 | __KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.18 2009/05/24 06:53:35 skrll Exp $"); | |
38 | 38 | |||
39 | #include <sys/param.h> | 39 | #include <sys/param.h> | |
40 | #include <sys/systm.h> | 40 | #include <sys/systm.h> | |
41 | #include <sys/proc.h> | 41 | #include <sys/proc.h> | |
42 | #include <sys/signalvar.h> | 42 | #include <sys/signalvar.h> | |
43 | #include <sys/user.h> | 43 | #include <sys/user.h> | |
44 | 44 | |||
45 | #include <uvm/uvm_extern.h> | 45 | #include <uvm/uvm_extern.h> | |
46 | 46 | |||
47 | #include <machine/cpufunc.h> | 47 | #include <machine/cpufunc.h> | |
48 | #include <machine/frame.h> | 48 | #include <machine/frame.h> | |
49 | #include <machine/reg.h> | 49 | #include <machine/reg.h> | |
50 | #include <machine/pmap.h> | 50 | #include <machine/pmap.h> | |
@@ -131,28 +131,28 @@ const int _frame_reg_positions[32] = { | @@ -131,28 +131,28 @@ const int _frame_reg_positions[32] = { | |||
131 | _FRAME_POSITION(tf_ret0), /* r28 */ | 131 | _FRAME_POSITION(tf_ret0), /* r28 */ | |
132 | _FRAME_POSITION(tf_ret1), /* r29 */ | 132 | _FRAME_POSITION(tf_ret1), /* r29 */ | |
133 | _FRAME_POSITION(tf_sp), /* r30 */ | 133 | _FRAME_POSITION(tf_sp), /* r30 */ | |
134 | _FRAME_POSITION(tf_r31), | 134 | _FRAME_POSITION(tf_r31), | |
135 | }; | 135 | }; | |
136 | #endif /* FPEMUL */ | 136 | #endif /* FPEMUL */ | |
137 | 137 | |||
138 | /* | 138 | /* | |
139 | * Bootstraps the FPU. | 139 | * Bootstraps the FPU. | |
140 | */ | 140 | */ | |
141 | void | 141 | void | |
142 | hppa_fpu_bootstrap(u_int ccr_enable) | 142 | hppa_fpu_bootstrap(u_int ccr_enable) | |
143 | { | 143 | { | |
144 | u_int32_t junk[2]; | 144 | uint32_t junk[2]; | |
145 | u_int32_t vers[2]; | 145 | uint32_t vers[2]; | |
146 | extern u_int hppa_fpu_nop0; | 146 | extern u_int hppa_fpu_nop0; | |
147 | extern u_int hppa_fpu_nop1; | 147 | extern u_int hppa_fpu_nop1; | |
148 | 148 | |||
149 | /* See if we have a present and functioning hardware FPU. */ | 149 | /* See if we have a present and functioning hardware FPU. */ | |
150 | fpu_present = (ccr_enable & HPPA_FPUS) == HPPA_FPUS; | 150 | fpu_present = (ccr_enable & HPPA_FPUS) == HPPA_FPUS; | |
151 | 151 | |||
152 | /* Initialize the FPU and get its version. */ | 152 | /* Initialize the FPU and get its version. */ | |
153 | if (fpu_present) { | 153 | if (fpu_present) { | |
154 | 154 | |||
155 | /* | 155 | /* | |
156 | * To somewhat optimize the emulation | 156 | * To somewhat optimize the emulation | |
157 | * assist trap handling and context | 157 | * assist trap handling and context | |
158 | * switching (to save them from having | 158 | * switching (to save them from having |
--- src/sys/arch/hppa/include/pcb.h 2008/01/18 10:03:27 1.6
+++ src/sys/arch/hppa/include/pcb.h 2009/05/24 06:53:35 1.7
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: pcb.h,v 1.6 2008/01/18 10:03:27 skrll Exp $ */ | 1 | /* $NetBSD: pcb.h,v 1.7 2009/05/24 06:53:35 skrll Exp $ */ | |
2 | 2 | |||
3 | /* $OpenBSD: pcb.h,v 1.6 2000/01/12 07:24:35 mickey Exp $ */ | 3 | /* $OpenBSD: pcb.h,v 1.6 2000/01/12 07:24:35 mickey Exp $ */ | |
4 | 4 | |||
5 | /* | 5 | /* | |
6 | * Copyright (c) 1999-2000 Michael Shalayeff | 6 | * Copyright (c) 1999-2000 Michael Shalayeff | |
7 | * All rights reserved. | 7 | * All rights reserved. | |
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 | |
@@ -30,27 +30,27 @@ | @@ -30,27 +30,27 @@ | |||
30 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | 30 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | |
31 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING | 31 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING | |
32 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF | 32 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF | |
33 | * THE POSSIBILITY OF SUCH DAMAGE. | 33 | * THE POSSIBILITY OF SUCH DAMAGE. | |
34 | */ | 34 | */ | |
35 | 35 | |||
36 | 36 | |||
37 | #ifndef _HPPA_PCB_H_ | 37 | #ifndef _HPPA_PCB_H_ | |
38 | #define _HPPA_PCB_H_ | 38 | #define _HPPA_PCB_H_ | |
39 | 39 | |||
40 | #include <machine/reg.h> | 40 | #include <machine/reg.h> | |
41 | 41 | |||
42 | struct pcb { | 42 | struct pcb { | |
43 | u_int64_t pcb_fpregs[HPPA_NFPREGS+1]; | 43 | uint64_t pcb_fpregs[HPPA_NFPREGS+1]; | |
44 | /* not in the trapframe */ | 44 | /* not in the trapframe */ | |
45 | u_int pcb_onfault; /* SW copy fault handler */ | 45 | u_int pcb_onfault; /* SW copy fault handler */ | |
46 | pa_space_t pcb_space; /* copy pmap_space, for asm's sake */ | 46 | pa_space_t pcb_space; /* copy pmap_space, for asm's sake */ | |
47 | vaddr_t pcb_uva; /* KVA for U-area */ | 47 | vaddr_t pcb_uva; /* KVA for U-area */ | |
48 | u_int pcb_ksp; /* kernel sp for ctxsw */ | 48 | u_int pcb_ksp; /* kernel sp for ctxsw */ | |
49 | }; | 49 | }; | |
50 | 50 | |||
51 | struct md_coredump { | 51 | struct md_coredump { | |
52 | struct reg md_reg; | 52 | struct reg md_reg; | |
53 | struct fpreg md_fpreg; | 53 | struct fpreg md_fpreg; | |
54 | }; | 54 | }; | |
55 | 55 | |||
56 | 56 |
--- src/sys/arch/hppa/include/pmap.h 2009/04/30 19:15:18 1.20
+++ src/sys/arch/hppa/include/pmap.h 2009/05/24 06:53:35 1.21
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: pmap.h,v 1.20 2009/04/30 19:15:18 skrll Exp $ */ | 1 | /* $NetBSD: pmap.h,v 1.21 2009/05/24 06:53:35 skrll Exp $ */ | |
2 | 2 | |||
3 | /* $OpenBSD: pmap.h,v 1.35 2007/12/14 18:32:23 deraadt Exp $ */ | 3 | /* $OpenBSD: pmap.h,v 1.35 2007/12/14 18:32:23 deraadt Exp $ */ | |
4 | 4 | |||
5 | /* | 5 | /* | |
6 | * Copyright (c) 2002-2004 Michael Shalayeff | 6 | * Copyright (c) 2002-2004 Michael Shalayeff | |
7 | * All rights reserved. | 7 | * All rights reserved. | |
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 | |
@@ -39,27 +39,27 @@ | @@ -39,27 +39,27 @@ | |||
39 | #include <machine/pte.h> | 39 | #include <machine/pte.h> | |
40 | #include <machine/cpufunc.h> | 40 | #include <machine/cpufunc.h> | |
41 | 41 | |||
42 | #include <uvm/uvm_pglist.h> | 42 | #include <uvm/uvm_pglist.h> | |
43 | #include <uvm/uvm_object.h> | 43 | #include <uvm/uvm_object.h> | |
44 | 44 | |||
45 | #ifdef _KERNEL | 45 | #ifdef _KERNEL | |
46 | 46 | |||
47 | struct pmap { | 47 | struct pmap { | |
48 | struct uvm_object pm_obj; /* object (lck by object lock) */ | 48 | struct uvm_object pm_obj; /* object (lck by object lock) */ | |
49 | #define pm_lock pm_obj.vmobjlock | 49 | #define pm_lock pm_obj.vmobjlock | |
50 | struct vm_page *pm_ptphint; | 50 | struct vm_page *pm_ptphint; | |
51 | struct vm_page *pm_pdir_pg; /* vm_page for pdir */ | 51 | struct vm_page *pm_pdir_pg; /* vm_page for pdir */ | |
52 | volatile u_int32_t *pm_pdir; /* page dir (read-only after create) */ | 52 | volatile uint32_t *pm_pdir; /* page dir (read-only after create) */ | |
53 | pa_space_t pm_space; /* space id (read-only after create) */ | 53 | pa_space_t pm_space; /* space id (read-only after create) */ | |
54 | u_int pm_pid; /* prot id (read-only after create) */ | 54 | u_int pm_pid; /* prot id (read-only after create) */ | |
55 | 55 | |||
56 | struct pmap_statistics pm_stats; | 56 | struct pmap_statistics pm_stats; | |
57 | }; | 57 | }; | |
58 | 58 | |||
59 | #define PMAP_NC 0x100 | 59 | #define PMAP_NC 0x100 | |
60 | 60 | |||
61 | /* | 61 | /* | |
62 | * Flags that indicate attributes of pages or mappings of pages. | 62 | * Flags that indicate attributes of pages or mappings of pages. | |
63 | * | 63 | * | |
64 | * We need two flags for cacheability because pages/mappings can be marked | 64 | * We need two flags for cacheability because pages/mappings can be marked | |
65 | * uncacheable for two reasons, | 65 | * uncacheable for two reasons, |
--- src/sys/arch/hppa/include/reg.h 2009/05/16 12:57:05 1.8
+++ src/sys/arch/hppa/include/reg.h 2009/05/24 06:53:35 1.9
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: reg.h,v 1.8 2009/05/16 12:57:05 skrll Exp $ */ | 1 | /* $NetBSD: reg.h,v 1.9 2009/05/24 06:53:35 skrll Exp $ */ | |
2 | 2 | |||
3 | /* $OpenBSD: reg.h,v 1.7 2000/06/15 17:00:37 mickey Exp $ */ | 3 | /* $OpenBSD: reg.h,v 1.7 2000/06/15 17:00:37 mickey Exp $ */ | |
4 | 4 | |||
5 | /* | 5 | /* | |
6 | * Copyright (c) 1998 Michael Shalayeff | 6 | * Copyright (c) 1998 Michael Shalayeff | |
7 | * All rights reserved. | 7 | * All rights reserved. | |
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 | |
@@ -177,41 +177,41 @@ | @@ -177,41 +177,41 @@ | |||
177 | #define DR_ITLB_SIZE_0 25 | 177 | #define DR_ITLB_SIZE_0 25 | |
178 | 178 | |||
179 | #define DR_DTLB_SIZE_1 26 | 179 | #define DR_DTLB_SIZE_1 26 | |
180 | #define DR_DTLB_SIZE_0 27 | 180 | #define DR_DTLB_SIZE_0 27 | |
181 | 181 | |||
182 | #define CCR_MASK 0xff | 182 | #define CCR_MASK 0xff | |
183 | 183 | |||
184 | #define HPPA_NREGS (32) | 184 | #define HPPA_NREGS (32) | |
185 | #define HPPA_NFPREGS (33) /* 33rd is used for r0 in fpemul */ | 185 | #define HPPA_NFPREGS (33) /* 33rd is used for r0 in fpemul */ | |
186 | 186 | |||
187 | #ifndef __ASSEMBLER__ | 187 | #ifndef __ASSEMBLER__ | |
188 | 188 | |||
189 | struct reg { | 189 | struct reg { | |
190 | u_int32_t r_regs[HPPA_NREGS]; /* r0 is psw */ | 190 | uint32_t r_regs[HPPA_NREGS]; /* r0 is psw */ | |
191 | 191 | |||
192 | u_int32_t r_sar; | 192 | uint32_t r_sar; | |
193 | 193 | |||
194 | u_int32_t r_pcsqh; | 194 | uint32_t r_pcsqh; | |
195 | u_int32_t r_pcsqt; | 195 | uint32_t r_pcsqt; | |
196 | u_int32_t r_pcoqh; | 196 | uint32_t r_pcoqh; | |
197 | u_int32_t r_pcoqt; | 197 | uint32_t r_pcoqt; | |
198 | 198 | |||
199 | u_int32_t r_sr0; | 199 | uint32_t r_sr0; | |
200 | u_int32_t r_sr1; | 200 | uint32_t r_sr1; | |
201 | u_int32_t r_sr2; | 201 | uint32_t r_sr2; | |
202 | u_int32_t r_sr3; | 202 | uint32_t r_sr3; | |
203 | u_int32_t r_sr4; | 203 | uint32_t r_sr4; | |
204 | u_int32_t r_sr5; /* !mcontext */ | 204 | uint32_t r_sr5; /* !mcontext */ | |
205 | u_int32_t r_sr6; /* !mcontext */ | 205 | uint32_t r_sr6; /* !mcontext */ | |
206 | u_int32_t r_sr7; /* !mcontext */ | 206 | uint32_t r_sr7; /* !mcontext */ | |
207 | 207 | |||
208 | u_int32_t r_cr26; | 208 | uint32_t r_cr26; | |
209 | u_int32_t r_cr27; | 209 | uint32_t r_cr27; | |
210 | }; | 210 | }; | |
211 | 211 | |||
212 | struct fpreg { | 212 | struct fpreg { | |
213 | u_int64_t fpr_regs[HPPA_NFPREGS]; | 213 | uint64_t fpr_regs[HPPA_NFPREGS]; | |
214 | }; | 214 | }; | |
215 | #endif /* !__ASSEMBLER__ */ | 215 | #endif /* !__ASSEMBLER__ */ | |
216 | 216 | |||
217 | #endif /* _HPPA_REG_H_ */ | 217 | #endif /* _HPPA_REG_H_ */ |