Use DEVICE_COMPAT_EOL.diff -r1.8 -r1.9 src/sys/arch/arm/ti/ti_gpio.c
(thorpej)
--- src/sys/arch/arm/ti/ti_gpio.c 2021/01/25 14:20:39 1.8
+++ src/sys/arch/arm/ti/ti_gpio.c 2021/01/27 02:12:16 1.9
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: ti_gpio.c,v 1.8 2021/01/25 14:20:39 thorpej Exp $ */ | 1 | /* $NetBSD: ti_gpio.c,v 1.9 2021/01/27 02:12:16 thorpej Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2019 Jared McNeill <jmcneill@invisible.ca> | 4 | * Copyright (c) 2019 Jared McNeill <jmcneill@invisible.ca> | |
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. | |
@@ -17,27 +17,27 @@ | @@ -17,27 +17,27 @@ | |||
17 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | 17 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |
18 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | 18 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | |
19 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | 19 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | |
20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | |
21 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 21 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | |
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED | 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED | |
23 | * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | 23 | * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |
24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
25 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 25 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
26 | * SUCH DAMAGE. | 26 | * SUCH DAMAGE. | |
27 | */ | 27 | */ | |
28 | 28 | |||
29 | #include <sys/cdefs.h> | 29 | #include <sys/cdefs.h> | |
30 | __KERNEL_RCSID(0, "$NetBSD: ti_gpio.c,v 1.8 2021/01/25 14:20:39 thorpej Exp $"); | 30 | __KERNEL_RCSID(0, "$NetBSD: ti_gpio.c,v 1.9 2021/01/27 02:12:16 thorpej Exp $"); | |
31 | 31 | |||
32 | #include <sys/param.h> | 32 | #include <sys/param.h> | |
33 | #include <sys/bus.h> | 33 | #include <sys/bus.h> | |
34 | #include <sys/device.h> | 34 | #include <sys/device.h> | |
35 | #include <sys/intr.h> | 35 | #include <sys/intr.h> | |
36 | #include <sys/systm.h> | 36 | #include <sys/systm.h> | |
37 | #include <sys/mutex.h> | 37 | #include <sys/mutex.h> | |
38 | #include <sys/kmem.h> | 38 | #include <sys/kmem.h> | |
39 | #include <sys/gpio.h> | 39 | #include <sys/gpio.h> | |
40 | #include <sys/bitops.h> | 40 | #include <sys/bitops.h> | |
41 | 41 | |||
42 | #include <dev/fdt/fdtvar.h> | 42 | #include <dev/fdt/fdtvar.h> | |
43 | #include <dev/gpio/gpiovar.h> | 43 | #include <dev/gpio/gpiovar.h> | |
@@ -92,27 +92,27 @@ static const u_int ti_gpio_regmap[TI_NGP | @@ -92,27 +92,27 @@ static const u_int ti_gpio_regmap[TI_NGP | |||
92 | [GPIO_DATAOUT] = 0x13c, | 92 | [GPIO_DATAOUT] = 0x13c, | |
93 | [GPIO_LEVELDETECT0] = 0x140, | 93 | [GPIO_LEVELDETECT0] = 0x140, | |
94 | [GPIO_LEVELDETECT1] = 0x144, | 94 | [GPIO_LEVELDETECT1] = 0x144, | |
95 | [GPIO_RISINGDETECT] = 0x148, | 95 | [GPIO_RISINGDETECT] = 0x148, | |
96 | [GPIO_FALLINGDETECT] = 0x14c, | 96 | [GPIO_FALLINGDETECT] = 0x14c, | |
97 | [GPIO_CLEARDATAOUT] = 0x190, | 97 | [GPIO_CLEARDATAOUT] = 0x190, | |
98 | [GPIO_SETDATAOUT] = 0x194, | 98 | [GPIO_SETDATAOUT] = 0x194, | |
99 | }, | 99 | }, | |
100 | }; | 100 | }; | |
101 | 101 | |||
102 | static const struct device_compatible_entry compat_data[] = { | 102 | static const struct device_compatible_entry compat_data[] = { | |
103 | { .compat = "ti,omap3-gpio", .value = TI_GPIO_OMAP3 }, | 103 | { .compat = "ti,omap3-gpio", .value = TI_GPIO_OMAP3 }, | |
104 | { .compat = "ti,omap4-gpio", .value = TI_GPIO_OMAP4 }, | 104 | { .compat = "ti,omap4-gpio", .value = TI_GPIO_OMAP4 }, | |
105 | { } | 105 | DEVICE_COMPAT_EOL | |
106 | }; | 106 | }; | |
107 | 107 | |||
108 | struct ti_gpio_intr { | 108 | struct ti_gpio_intr { | |
109 | u_int intr_pin; | 109 | u_int intr_pin; | |
110 | int (*intr_func)(void *); | 110 | int (*intr_func)(void *); | |
111 | void *intr_arg; | 111 | void *intr_arg; | |
112 | bool intr_mpsafe; | 112 | bool intr_mpsafe; | |
113 | }; | 113 | }; | |
114 | 114 | |||
115 | struct ti_gpio_softc { | 115 | struct ti_gpio_softc { | |
116 | device_t sc_dev; | 116 | device_t sc_dev; | |
117 | bus_space_tag_t sc_bst; | 117 | bus_space_tag_t sc_bst; | |
118 | bus_space_handle_t sc_bsh; | 118 | bus_space_handle_t sc_bsh; |
--- src/sys/arch/arm/ti/ti_sdhc.c 2021/01/25 14:20:39 1.8
+++ src/sys/arch/arm/ti/ti_sdhc.c 2021/01/27 02:12:16 1.9
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: ti_sdhc.c,v 1.8 2021/01/25 14:20:39 thorpej Exp $ */ | 1 | /* $NetBSD: ti_sdhc.c,v 1.9 2021/01/27 02:12:16 thorpej Exp $ */ | |
2 | /*- | 2 | /*- | |
3 | * Copyright (c) 2011 The NetBSD Foundation, Inc. | 3 | * Copyright (c) 2011 The NetBSD Foundation, Inc. | |
4 | * All rights reserved. | 4 | * All rights reserved. | |
5 | * | 5 | * | |
6 | * This code is derived from software contributed to The NetBSD Foundation | 6 | * This code is derived from software contributed to The NetBSD Foundation | |
7 | * by Matt Thomas of 3am Software Foundry. | 7 | * by Matt Thomas of 3am Software Foundry. | |
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 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | 19 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | |
20 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 20 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
21 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | 21 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | |
22 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 22 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
28 | * POSSIBILITY OF SUCH DAMAGE. | 28 | * POSSIBILITY OF SUCH DAMAGE. | |
29 | */ | 29 | */ | |
30 | 30 | |||
31 | #include <sys/cdefs.h> | 31 | #include <sys/cdefs.h> | |
32 | __KERNEL_RCSID(0, "$NetBSD: ti_sdhc.c,v 1.8 2021/01/25 14:20:39 thorpej Exp $"); | 32 | __KERNEL_RCSID(0, "$NetBSD: ti_sdhc.c,v 1.9 2021/01/27 02:12:16 thorpej Exp $"); | |
33 | 33 | |||
34 | #include <sys/param.h> | 34 | #include <sys/param.h> | |
35 | #include <sys/systm.h> | 35 | #include <sys/systm.h> | |
36 | #include <sys/device.h> | 36 | #include <sys/device.h> | |
37 | #include <sys/errno.h> | 37 | #include <sys/errno.h> | |
38 | #include <sys/kernel.h> | 38 | #include <sys/kernel.h> | |
39 | #include <sys/proc.h> | 39 | #include <sys/proc.h> | |
40 | #include <sys/queue.h> | 40 | #include <sys/queue.h> | |
41 | #include <sys/mutex.h> | 41 | #include <sys/mutex.h> | |
42 | #include <sys/condvar.h> | 42 | #include <sys/condvar.h> | |
43 | #include <sys/bus.h> | 43 | #include <sys/bus.h> | |
44 | 44 | |||
45 | #include <arm/ti/ti_prcm.h> | 45 | #include <arm/ti/ti_prcm.h> | |
@@ -85,27 +85,27 @@ static const struct ti_sdhc_config omap4 | @@ -85,27 +85,27 @@ static const struct ti_sdhc_config omap4 | |||
85 | .regoff = 0x100 | 85 | .regoff = 0x100 | |
86 | }; | 86 | }; | |
87 | 87 | |||
88 | static const struct device_compatible_entry compat_data[] = { | 88 | static const struct device_compatible_entry compat_data[] = { | |
89 | { .compat = "ti,omap2-hsmmc", | 89 | { .compat = "ti,omap2-hsmmc", | |
90 | .data = &omap2_hsmmc_config }, | 90 | .data = &omap2_hsmmc_config }, | |
91 | { .compat = "ti,omap3-hsmmc", | 91 | { .compat = "ti,omap3-hsmmc", | |
92 | .data = &omap2_hsmmc_config }, | 92 | .data = &omap2_hsmmc_config }, | |
93 | { .compat = "ti,omap3-pre-es3-hsmmc", | 93 | { .compat = "ti,omap3-pre-es3-hsmmc", | |
94 | .data = &omap3_pre_es3_hsmmc_config }, | 94 | .data = &omap3_pre_es3_hsmmc_config }, | |
95 | { .compat = "ti,omap4-hsmmc", | 95 | { .compat = "ti,omap4-hsmmc", | |
96 | .data = &omap4_hsmmc_config }, | 96 | .data = &omap4_hsmmc_config }, | |
97 | 97 | |||
98 | { } | 98 | DEVICE_COMPAT_EOL | |
99 | }; | 99 | }; | |
100 | 100 | |||
101 | enum { | 101 | enum { | |
102 | EDMA_CHAN_TX, | 102 | EDMA_CHAN_TX, | |
103 | EDMA_CHAN_RX, | 103 | EDMA_CHAN_RX, | |
104 | EDMA_NCHAN | 104 | EDMA_NCHAN | |
105 | }; | 105 | }; | |
106 | 106 | |||
107 | struct ti_sdhc_softc { | 107 | struct ti_sdhc_softc { | |
108 | struct sdhc_softc sc; | 108 | struct sdhc_softc sc; | |
109 | int sc_phandle; | 109 | int sc_phandle; | |
110 | bus_addr_t sc_addr; | 110 | bus_addr_t sc_addr; | |
111 | bus_space_tag_t sc_bst; | 111 | bus_space_tag_t sc_bst; |
--- src/sys/arch/arm/ti/ti_iic.c 2021/01/25 14:20:39 1.11
+++ src/sys/arch/arm/ti/ti_iic.c 2021/01/27 02:12:16 1.12
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: ti_iic.c,v 1.11 2021/01/25 14:20:39 thorpej Exp $ */ | 1 | /* $NetBSD: ti_iic.c,v 1.12 2021/01/27 02:12:16 thorpej Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 2013 Manuel Bouyer. All rights reserved. | 4 | * Copyright (c) 2013 Manuel Bouyer. 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 | * | 14 | * | |
@@ -40,27 +40,27 @@ | @@ -40,27 +40,27 @@ | |||
40 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | 40 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |
41 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | 41 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | |
42 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | 42 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | |
43 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | 43 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | |
44 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 44 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | |
45 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED | 45 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED | |
46 | * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | 46 | * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |
47 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 47 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
48 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 48 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
49 | * SUCH DAMAGE. | 49 | * SUCH DAMAGE. | |
50 | */ | 50 | */ | |
51 | 51 | |||
52 | #include <sys/cdefs.h> | 52 | #include <sys/cdefs.h> | |
53 | __KERNEL_RCSID(0, "$NetBSD: ti_iic.c,v 1.11 2021/01/25 14:20:39 thorpej Exp $"); | 53 | __KERNEL_RCSID(0, "$NetBSD: ti_iic.c,v 1.12 2021/01/27 02:12:16 thorpej Exp $"); | |
54 | 54 | |||
55 | #include <sys/param.h> | 55 | #include <sys/param.h> | |
56 | #include <sys/systm.h> | 56 | #include <sys/systm.h> | |
57 | #include <sys/device.h> | 57 | #include <sys/device.h> | |
58 | #include <sys/conf.h> | 58 | #include <sys/conf.h> | |
59 | #include <sys/bus.h> | 59 | #include <sys/bus.h> | |
60 | #include <sys/proc.h> | 60 | #include <sys/proc.h> | |
61 | #include <sys/kernel.h> | 61 | #include <sys/kernel.h> | |
62 | #include <sys/mutex.h> | 62 | #include <sys/mutex.h> | |
63 | #include <sys/condvar.h> | 63 | #include <sys/condvar.h> | |
64 | 64 | |||
65 | #include <dev/i2c/i2cvar.h> | 65 | #include <dev/i2c/i2cvar.h> | |
66 | 66 | |||
@@ -140,27 +140,27 @@ static const u_int ti_iic_regmap[TI_NTYP | @@ -140,27 +140,27 @@ static const u_int ti_iic_regmap[TI_NTYP | |||
140 | [I2C_OA] = 0xa8, | 140 | [I2C_OA] = 0xa8, | |
141 | [I2C_SA] = 0xac, | 141 | [I2C_SA] = 0xac, | |
142 | [I2C_PSC] = 0xb0, | 142 | [I2C_PSC] = 0xb0, | |
143 | [I2C_SCLL] = 0xb4, | 143 | [I2C_SCLL] = 0xb4, | |
144 | [I2C_SCLH] = 0xb8, | 144 | [I2C_SCLH] = 0xb8, | |
145 | [I2C_BUFSTAT] = 0xc0, | 145 | [I2C_BUFSTAT] = 0xc0, | |
146 | }, | 146 | }, | |
147 | }; | 147 | }; | |
148 | 148 | |||
149 | static const struct device_compatible_entry compat_data[] = { | 149 | static const struct device_compatible_entry compat_data[] = { | |
150 | /* compatible type */ | 150 | /* compatible type */ | |
151 | { .compat = "ti,omap3-i2c", .value = TI_IIC_OMAP3 }, | 151 | { .compat = "ti,omap3-i2c", .value = TI_IIC_OMAP3 }, | |
152 | { .compat = "ti,omap4-i2c", .value = TI_IIC_OMAP4 }, | 152 | { .compat = "ti,omap4-i2c", .value = TI_IIC_OMAP4 }, | |
153 | { } | 153 | DEVICE_COMPAT_EOL | |
154 | }; | 154 | }; | |
155 | 155 | |||
156 | /* operation in progress */ | 156 | /* operation in progress */ | |
157 | typedef enum { | 157 | typedef enum { | |
158 | TI_I2CREAD, | 158 | TI_I2CREAD, | |
159 | TI_I2CWRITE, | 159 | TI_I2CWRITE, | |
160 | TI_I2CDONE, | 160 | TI_I2CDONE, | |
161 | TI_I2CERROR | 161 | TI_I2CERROR | |
162 | } ti_i2cop_t; | 162 | } ti_i2cop_t; | |
163 | 163 | |||
164 | struct ti_iic_softc { | 164 | struct ti_iic_softc { | |
165 | device_t sc_dev; | 165 | device_t sc_dev; | |
166 | struct i2c_controller sc_ic; | 166 | struct i2c_controller sc_ic; |
--- src/sys/arch/arm/ti/ti_omapintc.c 2021/01/25 14:20:39 1.6
+++ src/sys/arch/arm/ti/ti_omapintc.c 2021/01/27 02:12:16 1.7
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: ti_omapintc.c,v 1.6 2021/01/25 14:20:39 thorpej Exp $ */ | 1 | /* $NetBSD: ti_omapintc.c,v 1.7 2021/01/27 02:12:16 thorpej Exp $ */ | |
2 | /* | 2 | /* | |
3 | * Define the SDP2430 specific information and then include the generic OMAP | 3 | * Define the SDP2430 specific information and then include the generic OMAP | |
4 | * interrupt header. | 4 | * interrupt header. | |
5 | */ | 5 | */ | |
6 | 6 | |||
7 | /* | 7 | /* | |
8 | * Redistribution and use in source and binary forms, with or without | 8 | * Redistribution and use in source and binary forms, with or without | |
9 | * modification, are permitted provided that the following conditions | 9 | * modification, are permitted provided that the following conditions | |
10 | * are met: | 10 | * are met: | |
11 | * 1. Redistributions of source code must retain this list of conditions | 11 | * 1. Redistributions of source code must retain this list of conditions | |
12 | * and the following disclaimer. | 12 | * and the following disclaimer. | |
13 | * 2. Redistributions in binary form must reproduce this list of conditions | 13 | * 2. Redistributions in binary form must reproduce this list of conditions | |
14 | * and the following disclaimer in the documentation and/or other materials | 14 | * and the following disclaimer in the documentation and/or other materials | |
@@ -19,27 +19,27 @@ | @@ -19,27 +19,27 @@ | |||
19 | * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANY | 19 | * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANY | |
20 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | 20 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | |
21 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | 21 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | |
22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; | 22 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; | |
23 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, | 23 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, | |
24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR | 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR | |
25 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF | 25 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF | |
26 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
27 | */ | 27 | */ | |
28 | 28 | |||
29 | #define _INTR_PRIVATE | 29 | #define _INTR_PRIVATE | |
30 | 30 | |||
31 | #include <sys/cdefs.h> | 31 | #include <sys/cdefs.h> | |
32 | __KERNEL_RCSID(0, "$NetBSD: ti_omapintc.c,v 1.6 2021/01/25 14:20:39 thorpej Exp $"); | 32 | __KERNEL_RCSID(0, "$NetBSD: ti_omapintc.c,v 1.7 2021/01/27 02:12:16 thorpej Exp $"); | |
33 | 33 | |||
34 | #include <sys/param.h> | 34 | #include <sys/param.h> | |
35 | #include <sys/evcnt.h> | 35 | #include <sys/evcnt.h> | |
36 | #include <sys/device.h> | 36 | #include <sys/device.h> | |
37 | #include <sys/kmem.h> | 37 | #include <sys/kmem.h> | |
38 | 38 | |||
39 | #include <uvm/uvm_extern.h> | 39 | #include <uvm/uvm_extern.h> | |
40 | 40 | |||
41 | #include <machine/intr.h> | 41 | #include <machine/intr.h> | |
42 | #include <sys/bus.h> | 42 | #include <sys/bus.h> | |
43 | 43 | |||
44 | #include <arm/cpu.h> | 44 | #include <arm/cpu.h> | |
45 | #include <arm/armreg.h> | 45 | #include <arm/armreg.h> | |
@@ -51,27 +51,27 @@ __KERNEL_RCSID(0, "$NetBSD: ti_omapintc. | @@ -51,27 +51,27 @@ __KERNEL_RCSID(0, "$NetBSD: ti_omapintc. | |||
51 | #define INTC_CONTROL_NEWIRQAGR __BIT(0) | 51 | #define INTC_CONTROL_NEWIRQAGR __BIT(0) | |
52 | #define INTC_ITR 0x080 | 52 | #define INTC_ITR 0x080 | |
53 | #define INTC_MIR 0x084 | 53 | #define INTC_MIR 0x084 | |
54 | #define INTC_MIR_CLEAR 0x088 | 54 | #define INTC_MIR_CLEAR 0x088 | |
55 | #define INTC_MIR_SET 0x08c | 55 | #define INTC_MIR_SET 0x08c | |
56 | #define INTC_PENDING_IRQ 0x098 | 56 | #define INTC_PENDING_IRQ 0x098 | |
57 | 57 | |||
58 | #define INTC_MAX_SOURCES 128 | 58 | #define INTC_MAX_SOURCES 128 | |
59 | 59 | |||
60 | static const struct device_compatible_entry compat_data[] = { | 60 | static const struct device_compatible_entry compat_data[] = { | |
61 | /* compatible number of banks */ | 61 | /* compatible number of banks */ | |
62 | { .compat = "ti,omap3-intc", .value = 3 }, | 62 | { .compat = "ti,omap3-intc", .value = 3 }, | |
63 | { .compat = "ti,am33xx-intc", .value = 4 }, | 63 | { .compat = "ti,am33xx-intc", .value = 4 }, | |
64 | { } | 64 | DEVICE_COMPAT_EOL | |
65 | }; | 65 | }; | |
66 | 66 | |||
67 | #define INTC_READ(sc, g, o) \ | 67 | #define INTC_READ(sc, g, o) \ | |
68 | bus_space_read_4((sc)->sc_memt, (sc)->sc_memh, (g) * 0x20 + (o)) | 68 | bus_space_read_4((sc)->sc_memt, (sc)->sc_memh, (g) * 0x20 + (o)) | |
69 | #define INTC_WRITE(sc, g, o, v) \ | 69 | #define INTC_WRITE(sc, g, o, v) \ | |
70 | bus_space_write_4((sc)->sc_memt, (sc)->sc_memh, (g) * 0x20 + (o), v) | 70 | bus_space_write_4((sc)->sc_memt, (sc)->sc_memh, (g) * 0x20 + (o), v) | |
71 | 71 | |||
72 | static int omap2icu_match(device_t, cfdata_t, void *); | 72 | static int omap2icu_match(device_t, cfdata_t, void *); | |
73 | static void omap2icu_attach(device_t, device_t, void *); | 73 | static void omap2icu_attach(device_t, device_t, void *); | |
74 | 74 | |||
75 | static void omap2icu_unblock_irqs(struct pic_softc *, size_t, uint32_t); | 75 | static void omap2icu_unblock_irqs(struct pic_softc *, size_t, uint32_t); | |
76 | static void omap2icu_block_irqs(struct pic_softc *, size_t, uint32_t); | 76 | static void omap2icu_block_irqs(struct pic_softc *, size_t, uint32_t); | |
77 | static void omap2icu_establish_irq(struct pic_softc *, struct intrsource *); | 77 | static void omap2icu_establish_irq(struct pic_softc *, struct intrsource *); |
--- src/sys/arch/arm/ti/ti_omaptimer.c 2021/01/25 14:20:39 1.7
+++ src/sys/arch/arm/ti/ti_omaptimer.c 2021/01/27 02:12:16 1.8
@@ -1,17 +1,17 @@ | @@ -1,17 +1,17 @@ | |||
1 | /* $NetBSD: ti_omaptimer.c,v 1.7 2021/01/25 14:20:39 thorpej Exp $ */ | 1 | /* $NetBSD: ti_omaptimer.c,v 1.8 2021/01/27 02:12:16 thorpej Exp $ */ | |
2 | 2 | |||
3 | #include <sys/cdefs.h> | 3 | #include <sys/cdefs.h> | |
4 | __KERNEL_RCSID(0, "$NetBSD: ti_omaptimer.c,v 1.7 2021/01/25 14:20:39 thorpej Exp $"); | 4 | __KERNEL_RCSID(0, "$NetBSD: ti_omaptimer.c,v 1.8 2021/01/27 02:12:16 thorpej Exp $"); | |
5 | 5 | |||
6 | #include <sys/types.h> | 6 | #include <sys/types.h> | |
7 | #include <sys/param.h> | 7 | #include <sys/param.h> | |
8 | #include <sys/bus.h> | 8 | #include <sys/bus.h> | |
9 | #include <sys/device.h> | 9 | #include <sys/device.h> | |
10 | #include <sys/timetc.h> | 10 | #include <sys/timetc.h> | |
11 | #include <sys/kernel.h> | 11 | #include <sys/kernel.h> | |
12 | 12 | |||
13 | #include <arm/locore.h> | 13 | #include <arm/locore.h> | |
14 | #include <arm/fdt/arm_fdtvar.h> | 14 | #include <arm/fdt/arm_fdtvar.h> | |
15 | 15 | |||
16 | #include <dev/fdt/fdtvar.h> | 16 | #include <dev/fdt/fdtvar.h> | |
17 | 17 | |||
@@ -55,27 +55,27 @@ static uint8_t omaptimer_regmap[_DM_NTIM | @@ -55,27 +55,27 @@ static uint8_t omaptimer_regmap[_DM_NTIM | |||
55 | [DM_TIMER_OMAP3430] = { | 55 | [DM_TIMER_OMAP3430] = { | |
56 | [TIMER_TISR] = 0x18, | 56 | [TIMER_TISR] = 0x18, | |
57 | [TIMER_TIER] = 0x1c, | 57 | [TIMER_TIER] = 0x1c, | |
58 | [TIMER_TCLR] = 0x24, | 58 | [TIMER_TCLR] = 0x24, | |
59 | [TIMER_TCRR] = 0x28, | 59 | [TIMER_TCRR] = 0x28, | |
60 | [TIMER_TLDR] = 0x2c, | 60 | [TIMER_TLDR] = 0x2c, | |
61 | }, | 61 | }, | |
62 | }; | 62 | }; | |
63 | 63 | |||
64 | static const struct device_compatible_entry compat_data[] = { | 64 | static const struct device_compatible_entry compat_data[] = { | |
65 | { .compat = "ti,am335x-timer-1ms", .value = DM_TIMER_AM335X }, | 65 | { .compat = "ti,am335x-timer-1ms", .value = DM_TIMER_AM335X }, | |
66 | { .compat = "ti,am335x-timer", .value = DM_TIMER_AM335X }, | 66 | { .compat = "ti,am335x-timer", .value = DM_TIMER_AM335X }, | |
67 | { .compat = "ti,omap3430-timer", .value = DM_TIMER_OMAP3430 }, | 67 | { .compat = "ti,omap3430-timer", .value = DM_TIMER_OMAP3430 }, | |
68 | { } | 68 | DEVICE_COMPAT_EOL | |
69 | }; | 69 | }; | |
70 | 70 | |||
71 | struct omaptimer_softc { | 71 | struct omaptimer_softc { | |
72 | device_t sc_dev; | 72 | device_t sc_dev; | |
73 | bus_space_tag_t sc_bst; | 73 | bus_space_tag_t sc_bst; | |
74 | bus_space_handle_t sc_bsh; | 74 | bus_space_handle_t sc_bsh; | |
75 | int sc_phandle; | 75 | int sc_phandle; | |
76 | enum omaptimer_type sc_type; | 76 | enum omaptimer_type sc_type; | |
77 | struct timecounter sc_tc; | 77 | struct timecounter sc_tc; | |
78 | }; | 78 | }; | |
79 | 79 | |||
80 | #define RD4(sc, reg) \ | 80 | #define RD4(sc, reg) \ | |
81 | bus_space_read_4((sc)->sc_bst, (sc)->sc_bsh, omaptimer_regmap[(sc)->sc_type][(reg)]) | 81 | bus_space_read_4((sc)->sc_bst, (sc)->sc_bsh, omaptimer_regmap[(sc)->sc_type][(reg)]) |