Fri Jan 29 14:11:14 2021 UTC ()
fdtbus_intr_establish -> fdtbus_intr_establish_xname


(skrll)
diff -r1.5 -r1.6 src/sys/arch/arm/broadcom/bcm2835_bsc_fdt.c
diff -r1.7 -r1.8 src/sys/arch/arm/broadcom/bcm2835_com.c
diff -r1.7 -r1.8 src/sys/arch/arm/broadcom/bcm2835_sdhost.c
diff -r1.18 -r1.19 src/sys/arch/arm/broadcom/bcm2835_dmac.c
diff -r1.18 -r1.19 src/sys/arch/arm/broadcom/bcm2835_gpio.c
diff -r1.9 -r1.10 src/sys/arch/arm/broadcom/bcm2835_dwctwo.c
diff -r1.42 -r1.43 src/sys/arch/arm/broadcom/bcm2835_emmc.c
diff -r1.2 -r1.3 src/sys/arch/arm/broadcom/bcm2835_mbox_fdt.c
diff -r1.8 -r1.9 src/sys/arch/arm/broadcom/bcm2835_spi.c
diff -r1.11 -r1.12 src/sys/arch/arm/broadcom/bcm2835_tmr.c

cvs diff -r1.5 -r1.6 src/sys/arch/arm/broadcom/bcm2835_bsc_fdt.c (expand / switch to unified diff)

--- src/sys/arch/arm/broadcom/bcm2835_bsc_fdt.c 2021/01/27 03:10:19 1.5
+++ src/sys/arch/arm/broadcom/bcm2835_bsc_fdt.c 2021/01/29 14:11:14 1.6
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: bcm2835_bsc_fdt.c,v 1.5 2021/01/27 03:10:19 thorpej Exp $ */ 1/* $NetBSD: bcm2835_bsc_fdt.c,v 1.6 2021/01/29 14:11:14 skrll Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2019 Jason R. Thorpe 4 * Copyright (c) 2019 Jason R. Thorpe
5 * Copyright (c) 2012 Jonathan A. Kollasch 5 * Copyright (c) 2012 Jonathan A. Kollasch
6 * All rights reserved. 6 * All rights reserved.
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 the above copyright 11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer. 12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright 13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the 14 * notice, this list of conditions and the following disclaimer in the
@@ -18,27 +18,27 @@ @@ -18,27 +18,27 @@
18 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 18 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
19 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 19 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
20 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 20 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
21 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
22 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
23 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
24 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
25 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
26 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
27 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 */ 28 */
29 29
30#include <sys/cdefs.h> 30#include <sys/cdefs.h>
31__KERNEL_RCSID(0, "$NetBSD: bcm2835_bsc_fdt.c,v 1.5 2021/01/27 03:10:19 thorpej Exp $"); 31__KERNEL_RCSID(0, "$NetBSD: bcm2835_bsc_fdt.c,v 1.6 2021/01/29 14:11:14 skrll Exp $");
32 32
33#include <sys/param.h> 33#include <sys/param.h>
34#include <sys/bus.h> 34#include <sys/bus.h>
35#include <sys/device.h> 35#include <sys/device.h>
36#include <sys/kernhist.h> 36#include <sys/kernhist.h>
37#include <sys/intr.h> 37#include <sys/intr.h>
38#include <sys/mutex.h> 38#include <sys/mutex.h>
39#include <sys/systm.h> 39#include <sys/systm.h>
40 40
41#include <dev/i2c/i2cvar.h> 41#include <dev/i2c/i2cvar.h>
42 42
43#include <arm/broadcom/bcm2835reg.h> 43#include <arm/broadcom/bcm2835reg.h>
44#include <arm/broadcom/bcm2835_bscreg.h> 44#include <arm/broadcom/bcm2835_bscreg.h>
@@ -108,28 +108,28 @@ bsciic_fdt_attach(device_t parent, devic @@ -108,28 +108,28 @@ bsciic_fdt_attach(device_t parent, devic
108 return; 108 return;
109 } 109 }
110 110
111 aprint_naive("\n"); 111 aprint_naive("\n");
112 aprint_normal(": Broadcom Serial Controller\n"); 112 aprint_normal(": Broadcom Serial Controller\n");
113 113
114 bsciic_attach(sc); 114 bsciic_attach(sc);
115 115
116 char intrstr[128]; 116 char intrstr[128];
117 if (!fdtbus_intr_str(phandle, 0, intrstr, sizeof(intrstr))) { 117 if (!fdtbus_intr_str(phandle, 0, intrstr, sizeof(intrstr))) {
118 aprint_error_dev(sc->sc_dev, "failed to decode interrupt\n"); 118 aprint_error_dev(sc->sc_dev, "failed to decode interrupt\n");
119 return; 119 return;
120 } 120 }
121 sc->sc_inth = fdtbus_intr_establish(phandle, 0, IPL_VM, 121 sc->sc_inth = fdtbus_intr_establish_xname(phandle, 0, IPL_VM,
122 FDT_INTR_MPSAFE, bsciic_intr, sc); 122 FDT_INTR_MPSAFE, bsciic_intr, sc, device_xname(sc->sc_dev));
123 if (sc->sc_inth == NULL) { 123 if (sc->sc_inth == NULL) {
124 aprint_error_dev(sc->sc_dev, 124 aprint_error_dev(sc->sc_dev,
125 "failed to establish interrupt %s\n", intrstr); 125 "failed to establish interrupt %s\n", intrstr);
126 return; 126 return;
127 } 127 }
128 aprint_normal_dev(sc->sc_dev, "interrupting on %s\n", intrstr); 128 aprint_normal_dev(sc->sc_dev, "interrupting on %s\n", intrstr);
129 129
130 iic_tag_init(&sc->sc_i2c); 130 iic_tag_init(&sc->sc_i2c);
131 sc->sc_i2c.ic_cookie = sc; 131 sc->sc_i2c.ic_cookie = sc;
132 sc->sc_i2c.ic_acquire_bus = bsciic_acquire_bus; 132 sc->sc_i2c.ic_acquire_bus = bsciic_acquire_bus;
133 sc->sc_i2c.ic_release_bus = bsciic_release_bus; 133 sc->sc_i2c.ic_release_bus = bsciic_release_bus;
134 sc->sc_i2c.ic_exec = bsciic_exec; 134 sc->sc_i2c.ic_exec = bsciic_exec;
135 135

cvs diff -r1.7 -r1.8 src/sys/arch/arm/broadcom/bcm2835_com.c (expand / switch to unified diff)

--- src/sys/arch/arm/broadcom/bcm2835_com.c 2021/01/27 03:10:19 1.7
+++ src/sys/arch/arm/broadcom/bcm2835_com.c 2021/01/29 14:11:14 1.8
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: bcm2835_com.c,v 1.7 2021/01/27 03:10:19 thorpej Exp $ */ 1/* $NetBSD: bcm2835_com.c,v 1.8 2021/01/29 14:11:14 skrll Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2017 Jared McNeill <jmcneill@invisible.ca> 4 * Copyright (c) 2017 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: bcm2835_com.c,v 1.7 2021/01/27 03:10:19 thorpej Exp $"); 30__KERNEL_RCSID(0, "$NetBSD: bcm2835_com.c,v 1.8 2021/01/29 14:11:14 skrll 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/termios.h> 37#include <sys/termios.h>
38 38
39#include <arm/broadcom/bcm2835reg.h> 39#include <arm/broadcom/bcm2835reg.h>
40#include <arm/broadcom/bcm2835var.h> 40#include <arm/broadcom/bcm2835var.h>
41#include <arm/broadcom/bcm2835_intr.h> 41#include <arm/broadcom/bcm2835_intr.h>
42 42
43#include <dev/fdt/fdtvar.h> 43#include <dev/fdt/fdtvar.h>
@@ -106,28 +106,28 @@ bcm_com_attach(device_t parent, device_t @@ -106,28 +106,28 @@ bcm_com_attach(device_t parent, device_t
106 sc->sc_frequency *= 2; 106 sc->sc_frequency *= 2;
107 107
108 com_init_regs_stride(&sc->sc_regs, bst, bsh, addr, 2); 108 com_init_regs_stride(&sc->sc_regs, bst, bsh, addr, 2);
109 109
110 com_attach_subr(sc); 110 com_attach_subr(sc);
111 aprint_naive("\n"); 111 aprint_naive("\n");
112 112
113 char intrstr[128]; 113 char intrstr[128];
114 if (!fdtbus_intr_str(phandle, 0, intrstr, sizeof(intrstr))) { 114 if (!fdtbus_intr_str(phandle, 0, intrstr, sizeof(intrstr))) {
115 aprint_error(": failed to decode interrupt\n"); 115 aprint_error(": failed to decode interrupt\n");
116 return; 116 return;
117 } 117 }
118 118
119 ih = fdtbus_intr_establish(phandle, 0, IPL_SERIAL, FDT_INTR_MPSAFE, 119 ih = fdtbus_intr_establish_xname(phandle, 0, IPL_SERIAL, FDT_INTR_MPSAFE,
120 comintr, sc); 120 comintr, sc, device_xname(sc->sc_dev));
121 if (ih == NULL) { 121 if (ih == NULL) {
122 aprint_error_dev(self, "failed to establish interrupt %s\n", 122 aprint_error_dev(self, "failed to establish interrupt %s\n",
123 intrstr); 123 intrstr);
124 return; 124 return;
125 } 125 }
126 aprint_normal_dev(self, "interrupting on %s\n", intrstr); 126 aprint_normal_dev(self, "interrupting on %s\n", intrstr);
127} 127}
128 128
129static int 129static int
130bcmaux_com_console_match(int phandle) 130bcmaux_com_console_match(int phandle)
131{ 131{
132 132
133 return of_compatible_match(phandle, compat_data); 133 return of_compatible_match(phandle, compat_data);

cvs diff -r1.7 -r1.8 src/sys/arch/arm/broadcom/bcm2835_sdhost.c (expand / switch to unified diff)

--- src/sys/arch/arm/broadcom/bcm2835_sdhost.c 2021/01/27 03:10:19 1.7
+++ src/sys/arch/arm/broadcom/bcm2835_sdhost.c 2021/01/29 14:11:14 1.8
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: bcm2835_sdhost.c,v 1.7 2021/01/27 03:10:19 thorpej Exp $ */ 1/* $NetBSD: bcm2835_sdhost.c,v 1.8 2021/01/29 14:11:14 skrll Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2017 Jared McNeill <jmcneill@invisible.ca> 4 * Copyright (c) 2017 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: bcm2835_sdhost.c,v 1.7 2021/01/27 03:10:19 thorpej Exp $"); 30__KERNEL_RCSID(0, "$NetBSD: bcm2835_sdhost.c,v 1.8 2021/01/29 14:11:14 skrll Exp $");
31 31
32#include "bcmdmac.h" 32#include "bcmdmac.h"
33 33
34#include <sys/param.h> 34#include <sys/param.h>
35#include <sys/bus.h> 35#include <sys/bus.h>
36#include <sys/device.h> 36#include <sys/device.h>
37#include <sys/intr.h> 37#include <sys/intr.h>
38#include <sys/systm.h> 38#include <sys/systm.h>
39#include <sys/kernel.h> 39#include <sys/kernel.h>
40#include <sys/gpio.h> 40#include <sys/gpio.h>
41 41
42#include <arm/broadcom/bcm2835reg.h> 42#include <arm/broadcom/bcm2835reg.h>
43#include <arm/broadcom/bcm2835_dmac.h> 43#include <arm/broadcom/bcm2835_dmac.h>
@@ -233,28 +233,28 @@ sdhost_attach(device_t parent, device_t  @@ -233,28 +233,28 @@ sdhost_attach(device_t parent, device_t
233 aprint_debug_dev(self, "ref freq %u Hz\n", sc->sc_rate); 233 aprint_debug_dev(self, "ref freq %u Hz\n", sc->sc_rate);
234 234
235 if (sdhost_dma_setup(sc) != 0) { 235 if (sdhost_dma_setup(sc) != 0) {
236 aprint_error_dev(self, "failed to setup DMA\n"); 236 aprint_error_dev(self, "failed to setup DMA\n");
237 return; 237 return;
238 } 238 }
239 239
240 char intrstr[128]; 240 char intrstr[128];
241 if (!fdtbus_intr_str(phandle, 0, intrstr, sizeof(intrstr))) { 241 if (!fdtbus_intr_str(phandle, 0, intrstr, sizeof(intrstr))) {
242 aprint_error(": failed to decode interrupt\n"); 242 aprint_error(": failed to decode interrupt\n");
243 return; 243 return;
244 } 244 }
245 245
246 sc->sc_ih = fdtbus_intr_establish(phandle, 0, IPL_SDMMC, 246 sc->sc_ih = fdtbus_intr_establish_xname(phandle, 0, IPL_SDMMC,
247 FDT_INTR_MPSAFE, sdhost_intr, sc); 247 FDT_INTR_MPSAFE, sdhost_intr, sc, device_xname(self));
248 if (sc->sc_ih == NULL) { 248 if (sc->sc_ih == NULL) {
249 aprint_error_dev(self, "failed to establish interrupt %s\n", 249 aprint_error_dev(self, "failed to establish interrupt %s\n",
250 intrstr); 250 intrstr);
251 return; 251 return;
252 } 252 }
253 aprint_normal_dev(self, "interrupting on %s\n", intrstr); 253 aprint_normal_dev(self, "interrupting on %s\n", intrstr);
254 254
255 config_interrupts(self, sdhost_attach_i); 255 config_interrupts(self, sdhost_attach_i);
256} 256}
257 257
258static int 258static int
259sdhost_dma_setup(struct sdhost_softc *sc) 259sdhost_dma_setup(struct sdhost_softc *sc)
260{ 260{

cvs diff -r1.18 -r1.19 src/sys/arch/arm/broadcom/bcm2835_dmac.c (expand / switch to unified diff)

--- src/sys/arch/arm/broadcom/bcm2835_dmac.c 2021/01/27 03:10:19 1.18
+++ src/sys/arch/arm/broadcom/bcm2835_dmac.c 2021/01/29 14:11:14 1.19
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: bcm2835_dmac.c,v 1.18 2021/01/27 03:10:19 thorpej Exp $ */ 1/* $NetBSD: bcm2835_dmac.c,v 1.19 2021/01/29 14:11:14 skrll Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2014 Jared D. McNeill <jmcneill@invisible.ca> 4 * Copyright (c) 2014 Jared D. 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.
@@ -19,27 +19,27 @@ @@ -19,27 +19,27 @@
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 "opt_ddb.h" 29#include "opt_ddb.h"
30 30
31#include <sys/cdefs.h> 31#include <sys/cdefs.h>
32__KERNEL_RCSID(0, "$NetBSD: bcm2835_dmac.c,v 1.18 2021/01/27 03:10:19 thorpej Exp $"); 32__KERNEL_RCSID(0, "$NetBSD: bcm2835_dmac.c,v 1.19 2021/01/29 14:11:14 skrll Exp $");
33 33
34#include <sys/param.h> 34#include <sys/param.h>
35#include <sys/bus.h> 35#include <sys/bus.h>
36#include <sys/device.h> 36#include <sys/device.h>
37#include <sys/intr.h> 37#include <sys/intr.h>
38#include <sys/systm.h> 38#include <sys/systm.h>
39#include <sys/kmem.h> 39#include <sys/kmem.h>
40#include <sys/mutex.h> 40#include <sys/mutex.h>
41 41
42#include <arm/broadcom/bcm2835reg.h> 42#include <arm/broadcom/bcm2835reg.h>
43#include <arm/broadcom/bcm2835_intr.h> 43#include <arm/broadcom/bcm2835_intr.h>
44 44
45#include <arm/broadcom/bcm2835_dmac.h> 45#include <arm/broadcom/bcm2835_dmac.h>
@@ -225,28 +225,31 @@ bcm_dmac_alloc(enum bcm_dmac_type type,  @@ -225,28 +225,31 @@ bcm_dmac_alloc(enum bcm_dmac_type type,
225 if (ch == NULL) 225 if (ch == NULL)
226 return NULL; 226 return NULL;
227 227
228 KASSERT(ch->ch_ih == NULL); 228 KASSERT(ch->ch_ih == NULL);
229 229
230 const int phandle = sc->sc_phandle; 230 const int phandle = sc->sc_phandle;
231 char intrstr[128]; 231 char intrstr[128];
232 232
233 if (!fdtbus_intr_str(phandle, ch->ch_index, intrstr, sizeof(intrstr))) { 233 if (!fdtbus_intr_str(phandle, ch->ch_index, intrstr, sizeof(intrstr))) {
234 aprint_error(": failed to decode interrupt\n"); 234 aprint_error(": failed to decode interrupt\n");
235 return NULL; 235 return NULL;
236 } 236 }
237 237
238 ch->ch_ih = fdtbus_intr_establish(phandle, ch->ch_index, ipl, 0, 238 char xname[16];
239 bcm_dmac_intr, ch); 239 snprintf(xname, sizeof(xname), "%s #%u", device_xname(sc->sc_dev),
 240 ch->ch_index);
 241 ch->ch_ih = fdtbus_intr_establish_xname(phandle, ch->ch_index, ipl, 0,
 242 bcm_dmac_intr, ch, xname);
240 if (ch->ch_ih == NULL) { 243 if (ch->ch_ih == NULL) {
241 aprint_error_dev(sc->sc_dev, 244 aprint_error_dev(sc->sc_dev,
242 "failed to establish interrupt for DMA%d and %s\n", ch->ch_index, 245 "failed to establish interrupt for DMA%d and %s\n", ch->ch_index,
243 intrstr); 246 intrstr);
244 ch->ch_callback = NULL; 247 ch->ch_callback = NULL;
245 ch->ch_callbackarg = NULL; 248 ch->ch_callbackarg = NULL;
246 ch = NULL; 249 ch = NULL;
247 } 250 }
248 251
249 return ch; 252 return ch;
250} 253}
251 254
252void 255void

cvs diff -r1.18 -r1.19 src/sys/arch/arm/broadcom/bcm2835_gpio.c (expand / switch to unified diff)

--- src/sys/arch/arm/broadcom/bcm2835_gpio.c 2021/01/27 03:10:19 1.18
+++ src/sys/arch/arm/broadcom/bcm2835_gpio.c 2021/01/29 14:11:14 1.19
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: bcm2835_gpio.c,v 1.18 2021/01/27 03:10:19 thorpej Exp $ */ 1/* $NetBSD: bcm2835_gpio.c,v 1.19 2021/01/29 14:11:14 skrll Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2013, 2014, 2017 The NetBSD Foundation, Inc. 4 * Copyright (c) 2013, 2014, 2017 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 Jonathan A. Kollasch, Frank Kardel and Nick Hudson 8 * by Jonathan A. Kollasch, Frank Kardel and Nick Hudson
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -20,27 +20,27 @@ @@ -20,27 +20,27 @@
20 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 20 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
23 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 23 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
24 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
25 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 25 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
26 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 26 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
27 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 27 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
28 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 28 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
29 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32#include <sys/cdefs.h> 32#include <sys/cdefs.h>
33__KERNEL_RCSID(0, "$NetBSD: bcm2835_gpio.c,v 1.18 2021/01/27 03:10:19 thorpej Exp $"); 33__KERNEL_RCSID(0, "$NetBSD: bcm2835_gpio.c,v 1.19 2021/01/29 14:11:14 skrll Exp $");
34 34
35/* 35/*
36 * Driver for BCM2835 GPIO 36 * Driver for BCM2835 GPIO
37 * 37 *
38 * see: http://www.raspberrypi.org/wp-content/uploads/2012/02/BCM2835-ARM-Peripherals.pdf 38 * see: http://www.raspberrypi.org/wp-content/uploads/2012/02/BCM2835-ARM-Peripherals.pdf
39 */ 39 */
40 40
41#include <sys/param.h> 41#include <sys/param.h>
42#include <sys/device.h> 42#include <sys/device.h>
43#include <sys/systm.h> 43#include <sys/systm.h>
44#include <sys/mutex.h> 44#include <sys/mutex.h>
45#include <sys/bus.h> 45#include <sys/bus.h>
46#include <sys/intr.h> 46#include <sys/intr.h>
@@ -327,32 +327,34 @@ bcmgpio_attach(device_t parent, device_t @@ -327,32 +327,34 @@ bcmgpio_attach(device_t parent, device_t
327 aprint_debug_dev(sc->sc_dev, "skip pin %d - func = %x\n", pin, func); 327 aprint_debug_dev(sc->sc_dev, "skip pin %d - func = %x\n", pin, func);
328 } 328 }
329 } 329 }
330 330
331 /* Initialize interrupts. */ 331 /* Initialize interrupts. */
332 for (bank = 0; bank < BCMGPIO_NBANKS; bank++) { 332 for (bank = 0; bank < BCMGPIO_NBANKS; bank++) {
333 char intrstr[128]; 333 char intrstr[128];
334 334
335 if (!fdtbus_intr_str(phandle, bank, intrstr, sizeof(intrstr))) { 335 if (!fdtbus_intr_str(phandle, bank, intrstr, sizeof(intrstr))) {
336 aprint_error_dev(self, "failed to decode interrupt\n"); 336 aprint_error_dev(self, "failed to decode interrupt\n");
337 continue; 337 continue;
338 } 338 }
339 339
 340 char xname[16];
 341 snprintf(xname, sizeof(xname), "%s #%u", device_xname(self),
 342 bank);
340 sc->sc_banks[bank].sc_bankno = bank; 343 sc->sc_banks[bank].sc_bankno = bank;
341 sc->sc_banks[bank].sc_bcm = sc; 344 sc->sc_banks[bank].sc_bcm = sc;
342 sc->sc_banks[bank].sc_ih = 345 sc->sc_banks[bank].sc_ih = fdtbus_intr_establish_xname(phandle,
343 fdtbus_intr_establish(phandle, bank, IPL_VM, 346 bank, IPL_VM, FDT_INTR_MPSAFE, bcmgpio_intr,
344 FDT_INTR_MPSAFE, 347 &sc->sc_banks[bank], xname);
345 bcmgpio_intr, &sc->sc_banks[bank]); 
346 if (sc->sc_banks[bank].sc_ih) { 348 if (sc->sc_banks[bank].sc_ih) {
347 aprint_normal_dev(self, 349 aprint_normal_dev(self,
348 "pins %d..%d interrupting on %s\n", 350 "pins %d..%d interrupting on %s\n",
349 bank * 32, 351 bank * 32,
350 MIN((bank * 32) + 31, sc->sc_maxpins), 352 MIN((bank * 32) + 31, sc->sc_maxpins),
351 intrstr); 353 intrstr);
352 } else { 354 } else {
353 aprint_error_dev(self, 355 aprint_error_dev(self,
354 "failed to establish interrupt for pins %d..%d\n", 356 "failed to establish interrupt for pins %d..%d\n",
355 bank * 32, 357 bank * 32,
356 MIN((bank * 32) + 31, sc->sc_maxpins)); 358 MIN((bank * 32) + 31, sc->sc_maxpins));
357 } 359 }
358 } 360 }

cvs diff -r1.9 -r1.10 src/sys/arch/arm/broadcom/bcm2835_dwctwo.c (expand / switch to unified diff)

--- src/sys/arch/arm/broadcom/bcm2835_dwctwo.c 2021/01/27 03:10:19 1.9
+++ src/sys/arch/arm/broadcom/bcm2835_dwctwo.c 2021/01/29 14:11:14 1.10
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: bcm2835_dwctwo.c,v 1.9 2021/01/27 03:10:19 thorpej Exp $ */ 1/* $NetBSD: bcm2835_dwctwo.c,v 1.10 2021/01/29 14:11:14 skrll Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2013 The NetBSD Foundation, Inc. 4 * Copyright (c) 2013 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 Nick Hudson 8 * by Nick Hudson
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -20,27 +20,27 @@ @@ -20,27 +20,27 @@
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE. 29 * POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32#include <sys/cdefs.h> 32#include <sys/cdefs.h>
33__KERNEL_RCSID(0, "$NetBSD: bcm2835_dwctwo.c,v 1.9 2021/01/27 03:10:19 thorpej Exp $"); 33__KERNEL_RCSID(0, "$NetBSD: bcm2835_dwctwo.c,v 1.10 2021/01/29 14:11:14 skrll Exp $");
34 34
35#include <sys/param.h> 35#include <sys/param.h>
36#include <sys/systm.h> 36#include <sys/systm.h>
37#include <sys/device.h> 37#include <sys/device.h>
38#include <sys/mutex.h> 38#include <sys/mutex.h>
39#include <sys/bus.h> 39#include <sys/bus.h>
40#include <sys/workqueue.h> 40#include <sys/workqueue.h>
41 41
42#include <arm/broadcom/bcm2835reg.h> 42#include <arm/broadcom/bcm2835reg.h>
43 43
44#include <dev/fdt/fdtvar.h> 44#include <dev/fdt/fdtvar.h>
45 45
46#include <dev/usb/usb.h> 46#include <dev/usb/usb.h>
@@ -139,28 +139,28 @@ bcmdwc2_attach(device_t parent, device_t @@ -139,28 +139,28 @@ bcmdwc2_attach(device_t parent, device_t
139 139
140 error = bus_space_map(faa->faa_bst, addr, size, 0, &sc->sc_dwc2.sc_ioh); 140 error = bus_space_map(faa->faa_bst, addr, size, 0, &sc->sc_dwc2.sc_ioh);
141 if (error) { 141 if (error) {
142 aprint_error(": couldn't map device\n"); 142 aprint_error(": couldn't map device\n");
143 return; 143 return;
144 } 144 }
145 145
146 char intrstr[128]; 146 char intrstr[128];
147 if (!fdtbus_intr_str(phandle, 0, intrstr, sizeof(intrstr))) { 147 if (!fdtbus_intr_str(phandle, 0, intrstr, sizeof(intrstr))) {
148 aprint_error(": failed to decode interrupt\n"); 148 aprint_error(": failed to decode interrupt\n");
149 return; 149 return;
150 } 150 }
151 151
152 sc->sc_ih = fdtbus_intr_establish(phandle, 0, IPL_VM, FDT_INTR_MPSAFE, 152 sc->sc_ih = fdtbus_intr_establish_xname(phandle, 0, IPL_VM, FDT_INTR_MPSAFE,
153 dwc2_intr, &sc->sc_dwc2); 153 dwc2_intr, &sc->sc_dwc2, device_xname(self));
154 154
155 if (sc->sc_ih == NULL) { 155 if (sc->sc_ih == NULL) {
156 aprint_error_dev(self, "failed to establish interrupt %s\n", 156 aprint_error_dev(self, "failed to establish interrupt %s\n",
157 intrstr); 157 intrstr);
158 goto fail; 158 goto fail;
159 } 159 }
160 aprint_normal_dev(self, "interrupting on %s\n", intrstr); 160 aprint_normal_dev(self, "interrupting on %s\n", intrstr);
161 config_interrupts(self, bcmdwc2_deferred); 161 config_interrupts(self, bcmdwc2_deferred);
162 162
163 return; 163 return;
164 164
165fail: 165fail:
166 if (sc->sc_ih) { 166 if (sc->sc_ih) {

cvs diff -r1.42 -r1.43 src/sys/arch/arm/broadcom/bcm2835_emmc.c (expand / switch to unified diff)

--- src/sys/arch/arm/broadcom/bcm2835_emmc.c 2021/01/27 03:10:19 1.42
+++ src/sys/arch/arm/broadcom/bcm2835_emmc.c 2021/01/29 14:11:14 1.43
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: bcm2835_emmc.c,v 1.42 2021/01/27 03:10:19 thorpej Exp $ */ 1/* $NetBSD: bcm2835_emmc.c,v 1.43 2021/01/29 14:11:14 skrll Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2012 The NetBSD Foundation, Inc. 4 * Copyright (c) 2012 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 Nick Hudson 8 * by Nick Hudson
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -20,27 +20,27 @@ @@ -20,27 +20,27 @@
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE. 29 * POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32#include <sys/cdefs.h> 32#include <sys/cdefs.h>
33__KERNEL_RCSID(0, "$NetBSD: bcm2835_emmc.c,v 1.42 2021/01/27 03:10:19 thorpej Exp $"); 33__KERNEL_RCSID(0, "$NetBSD: bcm2835_emmc.c,v 1.43 2021/01/29 14:11:14 skrll Exp $");
34 34
35#include "bcmdmac.h" 35#include "bcmdmac.h"
36 36
37#include <sys/param.h> 37#include <sys/param.h>
38#include <sys/systm.h> 38#include <sys/systm.h>
39#include <sys/device.h> 39#include <sys/device.h>
40#include <sys/bus.h> 40#include <sys/bus.h>
41#include <sys/condvar.h> 41#include <sys/condvar.h>
42#include <sys/mutex.h> 42#include <sys/mutex.h>
43#include <sys/kernel.h> 43#include <sys/kernel.h>
44 44
45#include <arm/broadcom/bcm2835reg.h> 45#include <arm/broadcom/bcm2835reg.h>
46#include <arm/broadcom/bcm2835_dmac.h> 46#include <arm/broadcom/bcm2835_dmac.h>
@@ -162,28 +162,28 @@ bcmemmc_attach(device_t parent, device_t @@ -162,28 +162,28 @@ bcmemmc_attach(device_t parent, device_t
162 } 162 }
163 sc->sc_iob = addr; 163 sc->sc_iob = addr;
164 sc->sc_ios = size; 164 sc->sc_ios = size;
165 165
166 aprint_naive(": SDHC controller\n"); 166 aprint_naive(": SDHC controller\n");
167 aprint_normal(": SDHC controller\n"); 167 aprint_normal(": SDHC controller\n");
168 168
169 char intrstr[128]; 169 char intrstr[128];
170 if (!fdtbus_intr_str(phandle, 0, intrstr, sizeof(intrstr))) { 170 if (!fdtbus_intr_str(phandle, 0, intrstr, sizeof(intrstr))) {
171 aprint_error(": failed to decode interrupt\n"); 171 aprint_error(": failed to decode interrupt\n");
172 return; 172 return;
173 } 173 }
174 174
175 sc->sc_ih = fdtbus_intr_establish(phandle, 0, IPL_SDMMC, 0, 175 sc->sc_ih = fdtbus_intr_establish_xname(phandle, 0, IPL_SDMMC, 0,
176 sdhc_intr, &sc->sc); 176 sdhc_intr, &sc->sc, device_xname(self));
177 177
178 if (sc->sc_ih == NULL) { 178 if (sc->sc_ih == NULL) {
179 aprint_error_dev(self, "failed to establish interrupt %s\n", 179 aprint_error_dev(self, "failed to establish interrupt %s\n",
180 intrstr); 180 intrstr);
181 goto fail; 181 goto fail;
182 } 182 }
183 aprint_normal_dev(self, "interrupting on %s\n", intrstr); 183 aprint_normal_dev(self, "interrupting on %s\n", intrstr);
184 184
185#if NBCMDMAC > 0 185#if NBCMDMAC > 0
186 enum bcmemmc_type type = 186 enum bcmemmc_type type =
187 of_compatible_lookup(phandle, compat_data)->value; 187 of_compatible_lookup(phandle, compat_data)->value;
188 188
189 if (type != BCM2835_SDHCI) 189 if (type != BCM2835_SDHCI)

cvs diff -r1.2 -r1.3 src/sys/arch/arm/broadcom/bcm2835_mbox_fdt.c (expand / switch to unified diff)

--- src/sys/arch/arm/broadcom/bcm2835_mbox_fdt.c 2021/01/27 03:10:19 1.2
+++ src/sys/arch/arm/broadcom/bcm2835_mbox_fdt.c 2021/01/29 14:11:14 1.3
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: bcm2835_mbox_fdt.c,v 1.2 2021/01/27 03:10:19 thorpej Exp $ */ 1/* $NetBSD: bcm2835_mbox_fdt.c,v 1.3 2021/01/29 14:11:14 skrll Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2012 The NetBSD Foundation, Inc. 4 * Copyright (c) 2012 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 Nick Hudson 8 * by Nick Hudson
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -20,27 +20,27 @@ @@ -20,27 +20,27 @@
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE. 29 * POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32#include <sys/cdefs.h> 32#include <sys/cdefs.h>
33__KERNEL_RCSID(0, "$NetBSD: bcm2835_mbox_fdt.c,v 1.2 2021/01/27 03:10:19 thorpej Exp $"); 33__KERNEL_RCSID(0, "$NetBSD: bcm2835_mbox_fdt.c,v 1.3 2021/01/29 14:11:14 skrll Exp $");
34 34
35#include <sys/param.h> 35#include <sys/param.h>
36#include <sys/systm.h> 36#include <sys/systm.h>
37#include <sys/device.h> 37#include <sys/device.h>
38#include <sys/kernel.h> 38#include <sys/kernel.h>
39#include <sys/timetc.h> 39#include <sys/timetc.h>
40#include <sys/bus.h> 40#include <sys/bus.h>
41#include <sys/mutex.h> 41#include <sys/mutex.h>
42 42
43#include <arm/broadcom/bcm2835_mbox.h> 43#include <arm/broadcom/bcm2835_mbox.h>
44#include <arm/broadcom/bcm2835_mboxreg.h> 44#include <arm/broadcom/bcm2835_mboxreg.h>
45#include <arm/broadcom/bcm2835reg.h> 45#include <arm/broadcom/bcm2835reg.h>
46#include <arm/broadcom/bcm2835var.h> 46#include <arm/broadcom/bcm2835var.h>
@@ -89,24 +89,24 @@ bcmmbox_fdt_attach(device_t parent, devi @@ -89,24 +89,24 @@ bcmmbox_fdt_attach(device_t parent, devi
89 if (bus_space_map(faa->faa_bst, addr, size, 0, &sc->sc_ioh) != 0) { 89 if (bus_space_map(faa->faa_bst, addr, size, 0, &sc->sc_ioh) != 0) {
90 aprint_error_dev(sc->sc_dev, "unable to map device\n"); 90 aprint_error_dev(sc->sc_dev, "unable to map device\n");
91 return; 91 return;
92 } 92 }
93 93
94 if (!fdtbus_intr_str(phandle, 0, intrstr, sizeof(intrstr))) { 94 if (!fdtbus_intr_str(phandle, 0, intrstr, sizeof(intrstr))) {
95 aprint_error(": failed to decode interrupt\n"); 95 aprint_error(": failed to decode interrupt\n");
96 return; 96 return;
97 } 97 }
98 98
99 aprint_naive("\n"); 99 aprint_naive("\n");
100 aprint_normal(": VC mailbox\n"); 100 aprint_normal(": VC mailbox\n");
101 101
102 sc->sc_intrh = fdtbus_intr_establish(phandle, 0, IPL_VM, 0, 102 sc->sc_intrh = fdtbus_intr_establish_xname(phandle, 0, IPL_VM, 0,
103 bcmmbox_intr, sc); 103 bcmmbox_intr, sc, device_xname(self));
104 if (sc->sc_intrh == NULL) { 104 if (sc->sc_intrh == NULL) {
105 aprint_error_dev(self, "failed to establish interrupt %s\n", 105 aprint_error_dev(self, "failed to establish interrupt %s\n",
106 intrstr); 106 intrstr);
107 return; 107 return;
108 } 108 }
109 aprint_normal_dev(self, "interrupting on %s\n", intrstr); 109 aprint_normal_dev(self, "interrupting on %s\n", intrstr);
110 110
111 bcmmbox_attach(sc); 111 bcmmbox_attach(sc);
112} 112}

cvs diff -r1.8 -r1.9 src/sys/arch/arm/broadcom/bcm2835_spi.c (expand / switch to unified diff)

--- src/sys/arch/arm/broadcom/bcm2835_spi.c 2021/01/27 03:10:19 1.8
+++ src/sys/arch/arm/broadcom/bcm2835_spi.c 2021/01/29 14:11:14 1.9
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: bcm2835_spi.c,v 1.8 2021/01/27 03:10:19 thorpej Exp $ */ 1/* $NetBSD: bcm2835_spi.c,v 1.9 2021/01/29 14:11:14 skrll Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2012 Jonathan A. Kollasch 4 * Copyright (c) 2012 Jonathan A. Kollasch
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 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 17 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
18 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 18 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 19 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
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#include <sys/cdefs.h> 29#include <sys/cdefs.h>
30__KERNEL_RCSID(0, "$NetBSD: bcm2835_spi.c,v 1.8 2021/01/27 03:10:19 thorpej Exp $"); 30__KERNEL_RCSID(0, "$NetBSD: bcm2835_spi.c,v 1.9 2021/01/29 14:11:14 skrll Exp $");
31 31
32#include <sys/param.h> 32#include <sys/param.h>
33#include <sys/device.h> 33#include <sys/device.h>
34#include <sys/systm.h> 34#include <sys/systm.h>
35#include <sys/mutex.h> 35#include <sys/mutex.h>
36#include <sys/bus.h> 36#include <sys/bus.h>
37#include <sys/intr.h> 37#include <sys/intr.h>
38#include <sys/kernel.h> 38#include <sys/kernel.h>
39 39
40#include <sys/bitops.h> 40#include <sys/bitops.h>
41#include <dev/spi/spivar.h> 41#include <dev/spi/spivar.h>
42 42
43#include <arm/broadcom/bcm2835reg.h> 43#include <arm/broadcom/bcm2835reg.h>
@@ -114,28 +114,28 @@ bcmspi_attach(device_t parent, device_t  @@ -114,28 +114,28 @@ bcmspi_attach(device_t parent, device_t
114 } 114 }
115 115
116 if (bus_space_map(sc->sc_iot, addr, size, 0, &sc->sc_ioh) != 0) { 116 if (bus_space_map(sc->sc_iot, addr, size, 0, &sc->sc_ioh) != 0) {
117 aprint_error_dev(sc->sc_dev, "unable to map device\n"); 117 aprint_error_dev(sc->sc_dev, "unable to map device\n");
118 return; 118 return;
119 } 119 }
120 120
121 char intrstr[128]; 121 char intrstr[128];
122 if (!fdtbus_intr_str(phandle, 0, intrstr, sizeof(intrstr))) { 122 if (!fdtbus_intr_str(phandle, 0, intrstr, sizeof(intrstr))) {
123 aprint_error(": failed to decode interrupt\n"); 123 aprint_error(": failed to decode interrupt\n");
124 return; 124 return;
125 } 125 }
126 126
127 sc->sc_intrh = fdtbus_intr_establish(phandle, 0, IPL_VM, 0, 127 sc->sc_intrh = fdtbus_intr_establish_xname(phandle, 0, IPL_VM, 0,
128 bcmspi_intr, sc); 128 bcmspi_intr, sc, device_xname(self));
129 if (sc->sc_intrh == NULL) { 129 if (sc->sc_intrh == NULL) {
130 aprint_error_dev(sc->sc_dev, "unable to establish interrupt\n"); 130 aprint_error_dev(sc->sc_dev, "unable to establish interrupt\n");
131 return; 131 return;
132 } 132 }
133 aprint_normal_dev(self, "interrupting on %s\n", intrstr); 133 aprint_normal_dev(self, "interrupting on %s\n", intrstr);
134 134
135 sc->sc_spi.sct_cookie = sc; 135 sc->sc_spi.sct_cookie = sc;
136 mutex_init(&sc->sc_mutex, MUTEX_DEFAULT, IPL_VM); 136 mutex_init(&sc->sc_mutex, MUTEX_DEFAULT, IPL_VM);
137 sc->sc_spi.sct_configure = bcmspi_configure; 137 sc->sc_spi.sct_configure = bcmspi_configure;
138 sc->sc_spi.sct_transfer = bcmspi_transfer; 138 sc->sc_spi.sct_transfer = bcmspi_transfer;
139 sc->sc_spi.sct_nslaves = 3; 139 sc->sc_spi.sct_nslaves = 3;
140 140
141 memset(&sba, 0, sizeof(sba)); 141 memset(&sba, 0, sizeof(sba));

cvs diff -r1.11 -r1.12 src/sys/arch/arm/broadcom/bcm2835_tmr.c (expand / switch to unified diff)

--- src/sys/arch/arm/broadcom/bcm2835_tmr.c 2021/01/27 03:10:19 1.11
+++ src/sys/arch/arm/broadcom/bcm2835_tmr.c 2021/01/29 14:11:14 1.12
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: bcm2835_tmr.c,v 1.11 2021/01/27 03:10:19 thorpej Exp $ */ 1/* $NetBSD: bcm2835_tmr.c,v 1.12 2021/01/29 14:11:14 skrll Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2012 The NetBSD Foundation, Inc. 4 * Copyright (c) 2012 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 Nick Hudson 8 * by Nick Hudson
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -20,27 +20,27 @@ @@ -20,27 +20,27 @@
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE. 29 * POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32#include <sys/cdefs.h> 32#include <sys/cdefs.h>
33__KERNEL_RCSID(0, "$NetBSD: bcm2835_tmr.c,v 1.11 2021/01/27 03:10:19 thorpej Exp $"); 33__KERNEL_RCSID(0, "$NetBSD: bcm2835_tmr.c,v 1.12 2021/01/29 14:11:14 skrll Exp $");
34 34
35#include <sys/param.h> 35#include <sys/param.h>
36#include <sys/systm.h> 36#include <sys/systm.h>
37#include <sys/device.h> 37#include <sys/device.h>
38#include <sys/kernel.h> 38#include <sys/kernel.h>
39#include <sys/timetc.h> 39#include <sys/timetc.h>
40#include <sys/bus.h> 40#include <sys/bus.h>
41 41
42#include <arm/broadcom/bcm2835_intr.h> 42#include <arm/broadcom/bcm2835_intr.h>
43#include <arm/broadcom/bcm2835reg.h> 43#include <arm/broadcom/bcm2835reg.h>
44#include <arm/broadcom/bcm2835var.h> 44#include <arm/broadcom/bcm2835var.h>
45 45
46#include <dev/fdt/fdtvar.h> 46#include <dev/fdt/fdtvar.h>
@@ -139,28 +139,28 @@ bcmtmr_attach(device_t parent, device_t  @@ -139,28 +139,28 @@ bcmtmr_attach(device_t parent, device_t
139 } 139 }
140 140
141 if (bus_space_map(sc->sc_iot, addr, size, 0, &sc->sc_ioh) != 0) { 141 if (bus_space_map(sc->sc_iot, addr, size, 0, &sc->sc_ioh) != 0) {
142 aprint_error_dev(sc->sc_dev, "unable to map device\n"); 142 aprint_error_dev(sc->sc_dev, "unable to map device\n");
143 return; 143 return;
144 } 144 }
145 145
146 char intrstr[128]; 146 char intrstr[128];
147 if (!fdtbus_intr_str(phandle, BCMTIMER, intrstr, sizeof(intrstr))) { 147 if (!fdtbus_intr_str(phandle, BCMTIMER, intrstr, sizeof(intrstr))) {
148 aprint_error(": failed to decode interrupt\n"); 148 aprint_error(": failed to decode interrupt\n");
149 return; 149 return;
150 } 150 }
151 151
152 sc->sc_ih = fdtbus_intr_establish(phandle, BCMTIMER, IPL_CLOCK, 152 sc->sc_ih = fdtbus_intr_establish_xname(phandle, BCMTIMER, IPL_CLOCK,
153 FDT_INTR_MPSAFE, clockhandler, NULL); 153 FDT_INTR_MPSAFE, clockhandler, NULL, device_xname(self));
154 if (sc->sc_ih == NULL) { 154 if (sc->sc_ih == NULL) {
155 aprint_error(": failed to establish interrupt on %s\n", 155 aprint_error(": failed to establish interrupt on %s\n",
156 intrstr); 156 intrstr);
157 return; 157 return;
158 } 158 }
159 aprint_normal_dev(self, "interrupting on %s\n", intrstr); 159 aprint_normal_dev(self, "interrupting on %s\n", intrstr);
160 160
161 bcm2835tmr_timecounter.tc_name = device_xname(self); 161 bcm2835tmr_timecounter.tc_name = device_xname(self);
162} 162}
163 163
164void 164void
165cpu_initclocks(void) 165cpu_initclocks(void)
166{ 166{