Wed Jan 27 01:58:15 2021 UTC ()
Use DEVICE_COMPAT_EOL.


(thorpej)
diff -r1.16 -r1.17 src/sys/arch/arm/nvidia/tegra_ahcisata.c
diff -r1.34 -r1.35 src/sys/arch/arm/nvidia/tegra_pcie.c
diff -r1.11 -r1.12 src/sys/arch/arm/nvidia/tegra_soctherm.c
diff -r1.24 -r1.25 src/sys/arch/arm/nvidia/tegra_xusb.c

cvs diff -r1.16 -r1.17 src/sys/arch/arm/nvidia/tegra_ahcisata.c (expand / switch to unified diff)

--- src/sys/arch/arm/nvidia/tegra_ahcisata.c 2021/01/25 14:20:38 1.16
+++ src/sys/arch/arm/nvidia/tegra_ahcisata.c 2021/01/27 01:58:15 1.17
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: tegra_ahcisata.c,v 1.16 2021/01/25 14:20:38 thorpej Exp $ */ 1/* $NetBSD: tegra_ahcisata.c,v 1.17 2021/01/27 01:58:15 thorpej Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2015 Jared D. McNeill <jmcneill@invisible.ca> 4 * Copyright (c) 2015 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.
@@ -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: tegra_ahcisata.c,v 1.16 2021/01/25 14:20:38 thorpej Exp $"); 30__KERNEL_RCSID(0, "$NetBSD: tegra_ahcisata.c,v 1.17 2021/01/27 01:58:15 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/kernel.h> 37#include <sys/kernel.h>
38 38
39#include <dev/ata/atavar.h> 39#include <dev/ata/atavar.h>
40#include <dev/ic/ahcisatavar.h> 40#include <dev/ic/ahcisatavar.h>
41 41
42#include <arm/nvidia/tegra_var.h> 42#include <arm/nvidia/tegra_var.h>
43#include <arm/nvidia/tegra_pmcreg.h> 43#include <arm/nvidia/tegra_pmcreg.h>
@@ -95,27 +95,27 @@ struct tegra_ahcisata_data tegra124_ahci @@ -95,27 +95,27 @@ struct tegra_ahcisata_data tegra124_ahci
95 .tad_type = TEGRA124, 95 .tad_type = TEGRA124,
96 .tad_supplies = tegra124_ahcisata_supplies, 96 .tad_supplies = tegra124_ahcisata_supplies,
97 .tad_nsupplies = __arraycount(tegra124_ahcisata_supplies), 97 .tad_nsupplies = __arraycount(tegra124_ahcisata_supplies),
98}; 98};
99 99
100struct tegra_ahcisata_data tegra210_ahcisata_data = { 100struct tegra_ahcisata_data tegra210_ahcisata_data = {
101 .tad_type = TEGRA210, 101 .tad_type = TEGRA210,
102}; 102};
103 103
104 104
105static const struct device_compatible_entry compat_data[] = { 105static const struct device_compatible_entry compat_data[] = {
106 { .compat = "nvidia,tegra124-ahci", .data = &tegra124_ahcisata_data }, 106 { .compat = "nvidia,tegra124-ahci", .data = &tegra124_ahcisata_data },
107 { .compat = "nvidia,tegra210-ahci", .data = &tegra210_ahcisata_data }, 107 { .compat = "nvidia,tegra210-ahci", .data = &tegra210_ahcisata_data },
108 { }, 108 DEVICE_COMPAT_EOL,
109}; 109};
110 110
111 111
112static void tegra_ahcisata_init(struct tegra_ahcisata_softc *); 112static void tegra_ahcisata_init(struct tegra_ahcisata_softc *);
113static int tegra_ahcisata_init_clocks(struct tegra_ahcisata_softc *); 113static int tegra_ahcisata_init_clocks(struct tegra_ahcisata_softc *);
114 114
115CFATTACH_DECL_NEW(tegra_ahcisata, sizeof(struct tegra_ahcisata_softc), 115CFATTACH_DECL_NEW(tegra_ahcisata, sizeof(struct tegra_ahcisata_softc),
116 tegra_ahcisata_match, tegra_ahcisata_attach, NULL, NULL); 116 tegra_ahcisata_match, tegra_ahcisata_attach, NULL, NULL);
117 117
118static int 118static int
119tegra_ahcisata_match(device_t parent, cfdata_t cf, void *aux) 119tegra_ahcisata_match(device_t parent, cfdata_t cf, void *aux)
120{ 120{
121 struct fdt_attach_args * const faa = aux; 121 struct fdt_attach_args * const faa = aux;

cvs diff -r1.34 -r1.35 src/sys/arch/arm/nvidia/tegra_pcie.c (expand / switch to unified diff)

--- src/sys/arch/arm/nvidia/tegra_pcie.c 2021/01/25 14:20:38 1.34
+++ src/sys/arch/arm/nvidia/tegra_pcie.c 2021/01/27 01:58:15 1.35
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: tegra_pcie.c,v 1.34 2021/01/25 14:20:38 thorpej Exp $ */ 1/* $NetBSD: tegra_pcie.c,v 1.35 2021/01/27 01:58:15 thorpej Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2015 Jared D. McNeill <jmcneill@invisible.ca> 4 * Copyright (c) 2015 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.
@@ -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: tegra_pcie.c,v 1.34 2021/01/25 14:20:38 thorpej Exp $"); 30__KERNEL_RCSID(0, "$NetBSD: tegra_pcie.c,v 1.35 2021/01/27 01:58:15 thorpej Exp $");
31 31
32#include <sys/param.h> 32#include <sys/param.h>
33 33
34#include <sys/bus.h> 34#include <sys/bus.h>
35#include <sys/device.h> 35#include <sys/device.h>
36#include <sys/intr.h> 36#include <sys/intr.h>
37#include <sys/kmem.h> 37#include <sys/kmem.h>
38#include <sys/kernel.h> 38#include <sys/kernel.h>
39#include <sys/lwp.h> 39#include <sys/lwp.h>
40#include <sys/mutex.h> 40#include <sys/mutex.h>
41#include <sys/queue.h> 41#include <sys/queue.h>
42#include <sys/systm.h> 42#include <sys/systm.h>
43 43
@@ -129,27 +129,27 @@ const struct evcnt *tegra_pcie_intr_evcn @@ -129,27 +129,27 @@ const struct evcnt *tegra_pcie_intr_evcn
129static int tegra_pcie_intr_setattr(void *, pci_intr_handle_t *, int, 129static int tegra_pcie_intr_setattr(void *, pci_intr_handle_t *, int,
130 uint64_t); 130 uint64_t);
131static void * tegra_pcie_intr_establish(void *, pci_intr_handle_t, 131static void * tegra_pcie_intr_establish(void *, pci_intr_handle_t,
132 int, int (*)(void *), void *, 132 int, int (*)(void *), void *,
133 const char *); 133 const char *);
134static void tegra_pcie_intr_disestablish(void *, void *); 134static void tegra_pcie_intr_disestablish(void *, void *);
135 135
136CFATTACH_DECL_NEW(tegra_pcie, sizeof(struct tegra_pcie_softc), 136CFATTACH_DECL_NEW(tegra_pcie, sizeof(struct tegra_pcie_softc),
137 tegra_pcie_match, tegra_pcie_attach, NULL, NULL); 137 tegra_pcie_match, tegra_pcie_attach, NULL, NULL);
138 138
139static const struct device_compatible_entry compat_data[] = { 139static const struct device_compatible_entry compat_data[] = {
140 { .compat = "nvidia,tegra210-pcie", .value = TEGRA_PCIE_210 }, 140 { .compat = "nvidia,tegra210-pcie", .value = TEGRA_PCIE_210 },
141 { .compat = "nvidia,tegra124-pcie", .value = TEGRA_PCIE_124 }, 141 { .compat = "nvidia,tegra124-pcie", .value = TEGRA_PCIE_124 },
142 { } 142 DEVICE_COMPAT_EOL
143}; 143};
144 144
145static int 145static int
146tegra_pcie_match(device_t parent, cfdata_t cf, void *aux) 146tegra_pcie_match(device_t parent, cfdata_t cf, void *aux)
147{ 147{
148 struct fdt_attach_args * const faa = aux; 148 struct fdt_attach_args * const faa = aux;
149 149
150 return of_match_compat_data(faa->faa_phandle, compat_data); 150 return of_match_compat_data(faa->faa_phandle, compat_data);
151} 151}
152 152
153static void 153static void
154tegra_pcie_attach(device_t parent, device_t self, void *aux) 154tegra_pcie_attach(device_t parent, device_t self, void *aux)
155{ 155{

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

--- src/sys/arch/arm/nvidia/tegra_soctherm.c 2021/01/25 14:20:38 1.11
+++ src/sys/arch/arm/nvidia/tegra_soctherm.c 2021/01/27 01:58:15 1.12
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: tegra_soctherm.c,v 1.11 2021/01/25 14:20:38 thorpej Exp $ */ 1/* $NetBSD: tegra_soctherm.c,v 1.12 2021/01/27 01:58:15 thorpej Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2015 Jared D. McNeill <jmcneill@invisible.ca> 4 * Copyright (c) 2015 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.
@@ -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: tegra_soctherm.c,v 1.11 2021/01/25 14:20:38 thorpej Exp $"); 30__KERNEL_RCSID(0, "$NetBSD: tegra_soctherm.c,v 1.12 2021/01/27 01:58:15 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/kernel.h> 37#include <sys/kernel.h>
38#include <sys/kmem.h> 38#include <sys/kmem.h>
39 39
40#include <dev/sysmon/sysmonvar.h> 40#include <dev/sysmon/sysmonvar.h>
41 41
42#include <arm/nvidia/tegra_reg.h> 42#include <arm/nvidia/tegra_reg.h>
43#include <arm/nvidia/tegra_socthermreg.h> 43#include <arm/nvidia/tegra_socthermreg.h>
@@ -153,27 +153,27 @@ CFATTACH_DECL_NEW(tegra_soctherm, sizeof @@ -153,27 +153,27 @@ CFATTACH_DECL_NEW(tegra_soctherm, sizeof
153 tegra_reg_set_clear((sc)->sc_bst, (sc)->sc_bsh, (reg), (set), (clr)) 153 tegra_reg_set_clear((sc)->sc_bst, (sc)->sc_bsh, (reg), (set), (clr))
154 154
155#define SENSOR_READ(sc, s, reg) \ 155#define SENSOR_READ(sc, s, reg) \
156 bus_space_read_4((sc)->sc_bst, (sc)->sc_bsh, (s)->s_base + (reg)) 156 bus_space_read_4((sc)->sc_bst, (sc)->sc_bsh, (s)->s_base + (reg))
157#define SENSOR_WRITE(sc, s, reg, val) \ 157#define SENSOR_WRITE(sc, s, reg, val) \
158 bus_space_write_4((sc)->sc_bst, (sc)->sc_bsh, (s)->s_base + (reg), (val)) 158 bus_space_write_4((sc)->sc_bst, (sc)->sc_bsh, (s)->s_base + (reg), (val))
159#define SENSOR_SET_CLEAR(sc, s, reg, set, clr) \ 159#define SENSOR_SET_CLEAR(sc, s, reg, set, clr) \
160 tegra_reg_set_clear((sc)->sc_bst, (sc)->sc_bsh, (s)->s_base + (reg), (set), (clr)) 160 tegra_reg_set_clear((sc)->sc_bst, (sc)->sc_bsh, (s)->s_base + (reg), (set), (clr))
161 161
162static const struct device_compatible_entry compat_data[] = { 162static const struct device_compatible_entry compat_data[] = {
163 { .compat = "nvidia,tegra124-soctherm", 163 { .compat = "nvidia,tegra124-soctherm",
164 .data = &tegra124_soctherm_config }, 164 .data = &tegra124_soctherm_config },
165 165
166 { } 166 DEVICE_COMPAT_EOL
167}; 167};
168 168
169static int 169static int
170tegra_soctherm_match(device_t parent, cfdata_t cf, void *aux) 170tegra_soctherm_match(device_t parent, cfdata_t cf, void *aux)
171{ 171{
172 struct fdt_attach_args * const faa = aux; 172 struct fdt_attach_args * const faa = aux;
173 173
174 return of_match_compat_data(faa->faa_phandle, compat_data); 174 return of_match_compat_data(faa->faa_phandle, compat_data);
175} 175}
176 176
177static void 177static void
178tegra_soctherm_attach(device_t parent, device_t self, void *aux) 178tegra_soctherm_attach(device_t parent, device_t self, void *aux)
179{ 179{

cvs diff -r1.24 -r1.25 src/sys/arch/arm/nvidia/tegra_xusb.c (expand / switch to unified diff)

--- src/sys/arch/arm/nvidia/tegra_xusb.c 2021/01/25 14:20:38 1.24
+++ src/sys/arch/arm/nvidia/tegra_xusb.c 2021/01/27 01:58:15 1.25
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: tegra_xusb.c,v 1.24 2021/01/25 14:20:38 thorpej Exp $ */ 1/* $NetBSD: tegra_xusb.c,v 1.25 2021/01/27 01:58:15 thorpej Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2016 Jonathan A. Kollasch 4 * Copyright (c) 2016 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.
@@ -20,27 +20,27 @@ @@ -20,27 +20,27 @@
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 "locators.h" 29#include "locators.h"
30#include "opt_tegra.h" 30#include "opt_tegra.h"
31 31
32#include <sys/cdefs.h> 32#include <sys/cdefs.h>
33__KERNEL_RCSID(0, "$NetBSD: tegra_xusb.c,v 1.24 2021/01/25 14:20:38 thorpej Exp $"); 33__KERNEL_RCSID(0, "$NetBSD: tegra_xusb.c,v 1.25 2021/01/27 01:58:15 thorpej Exp $");
34 34
35#include <sys/param.h> 35#include <sys/param.h>
36#include <sys/bus.h> 36#include <sys/bus.h>
37#include <sys/device.h> 37#include <sys/device.h>
38#include <sys/intr.h> 38#include <sys/intr.h>
39#include <sys/systm.h> 39#include <sys/systm.h>
40#include <sys/kernel.h> 40#include <sys/kernel.h>
41 41
42#include <arm/nvidia/tegra_reg.h> 42#include <arm/nvidia/tegra_reg.h>
43#include <arm/nvidia/tegra_var.h> 43#include <arm/nvidia/tegra_var.h>
44#include <arm/nvidia/tegra_xusbpad.h> 44#include <arm/nvidia/tegra_xusbpad.h>
45#include <arm/nvidia/tegra_xusbreg.h> 45#include <arm/nvidia/tegra_xusbreg.h>
46#include <arm/nvidia/tegra_pmcreg.h> 46#include <arm/nvidia/tegra_pmcreg.h>
@@ -138,27 +138,27 @@ const char *tegra210_xhci_supplies[] = { @@ -138,27 +138,27 @@ const char *tegra210_xhci_supplies[] = {
138 "hvdd-pex-pll-e", 138 "hvdd-pex-pll-e",
139}; 139};
140 140
141struct tegra_xhci_data tegra210_xhci_data = { 141struct tegra_xhci_data tegra210_xhci_data = {
142 .txd_type = XUSB_T210, 142 .txd_type = XUSB_T210,
143 .txd_supplies = tegra210_xhci_supplies, 143 .txd_supplies = tegra210_xhci_supplies,
144 .txd_nsupplies = __arraycount(tegra210_xhci_supplies), 144 .txd_nsupplies = __arraycount(tegra210_xhci_supplies),
145 .txd_scale_ss_clock = false, 145 .txd_scale_ss_clock = false,
146}; 146};
147 147
148static const struct device_compatible_entry compat_data[] = { 148static const struct device_compatible_entry compat_data[] = {
149 { .compat = "nvidia,tegra124-xusb", .data = &tegra124_xhci_data }, 149 { .compat = "nvidia,tegra124-xusb", .data = &tegra124_xhci_data },
150 { .compat = "nvidia,tegra210-xusb", .data = &tegra210_xhci_data }, 150 { .compat = "nvidia,tegra210-xusb", .data = &tegra210_xhci_data },
151 { } 151 DEVICE_COMPAT_EOL
152}; 152};
153 153
154struct fw_dma { 154struct fw_dma {
155 bus_dmamap_t map; 155 bus_dmamap_t map;
156 void * addr; 156 void * addr;
157 bus_dma_segment_t segs[1]; 157 bus_dma_segment_t segs[1];
158 int nsegs; 158 int nsegs;
159 size_t size; 159 size_t size;
160}; 160};
161 161
162struct tegra_xusb_softc { 162struct tegra_xusb_softc {
163 struct xhci_softc sc_xhci; 163 struct xhci_softc sc_xhci;
164 int sc_phandle; 164 int sc_phandle;