Use DEVICE_COMPAT_EOL.diff -r1.8 -r1.9 src/sys/arch/arm/rockchip/rk3399_iomux.c
(thorpej)
--- src/sys/arch/arm/rockchip/rk3399_iomux.c 2021/01/25 14:20:38 1.8
+++ src/sys/arch/arm/rockchip/rk3399_iomux.c 2021/01/27 02:00:02 1.9
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: rk3399_iomux.c,v 1.8 2021/01/25 14:20:38 thorpej Exp $ */ | 1 | /* $NetBSD: rk3399_iomux.c,v 1.9 2021/01/27 02:00:02 thorpej Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2018 Jared McNeill <jmcneill@invisible.ca> | 4 | * Copyright (c) 2018 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. | |
@@ -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 | //#define RK3399_IOMUX_DEBUG | 29 | //#define RK3399_IOMUX_DEBUG | |
30 | 30 | |||
31 | #include <sys/cdefs.h> | 31 | #include <sys/cdefs.h> | |
32 | __KERNEL_RCSID(0, "$NetBSD: rk3399_iomux.c,v 1.8 2021/01/25 14:20:38 thorpej Exp $"); | 32 | __KERNEL_RCSID(0, "$NetBSD: rk3399_iomux.c,v 1.9 2021/01/27 02:00:02 thorpej 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/mutex.h> | 39 | #include <sys/mutex.h> | |
40 | #include <sys/kmem.h> | 40 | #include <sys/kmem.h> | |
41 | #include <sys/gpio.h> | 41 | #include <sys/gpio.h> | |
42 | #include <sys/lwp.h> | 42 | #include <sys/lwp.h> | |
43 | 43 | |||
44 | #include <dev/fdt/fdtvar.h> | 44 | #include <dev/fdt/fdtvar.h> | |
45 | #include <dev/fdt/syscon.h> | 45 | #include <dev/fdt/syscon.h> | |
@@ -173,27 +173,27 @@ static const struct rk3399_iomux_bank rk | @@ -173,27 +173,27 @@ static const struct rk3399_iomux_bank rk | |||
173 | 173 | |||
174 | struct rk3399_iomux_conf { | 174 | struct rk3399_iomux_conf { | |
175 | const struct rk3399_iomux_bank *banks; | 175 | const struct rk3399_iomux_bank *banks; | |
176 | u_int nbanks; | 176 | u_int nbanks; | |
177 | }; | 177 | }; | |
178 | 178 | |||
179 | static const struct rk3399_iomux_conf rk3399_iomux_conf = { | 179 | static const struct rk3399_iomux_conf rk3399_iomux_conf = { | |
180 | .banks = rk3399_iomux_banks, | 180 | .banks = rk3399_iomux_banks, | |
181 | .nbanks = __arraycount(rk3399_iomux_banks), | 181 | .nbanks = __arraycount(rk3399_iomux_banks), | |
182 | }; | 182 | }; | |
183 | 183 | |||
184 | static const struct device_compatible_entry compat_data[] = { | 184 | static const struct device_compatible_entry compat_data[] = { | |
185 | { .compat = "rockchip,rk3399-pinctrl", .data = &rk3399_iomux_conf }, | 185 | { .compat = "rockchip,rk3399-pinctrl", .data = &rk3399_iomux_conf }, | |
186 | { } | 186 | DEVICE_COMPAT_EOL | |
187 | }; | 187 | }; | |
188 | 188 | |||
189 | struct rk3399_iomux_softc { | 189 | struct rk3399_iomux_softc { | |
190 | device_t sc_dev; | 190 | device_t sc_dev; | |
191 | struct syscon *sc_syscon[2]; | 191 | struct syscon *sc_syscon[2]; | |
192 | 192 | |||
193 | const struct rk3399_iomux_conf *sc_conf; | 193 | const struct rk3399_iomux_conf *sc_conf; | |
194 | }; | 194 | }; | |
195 | 195 | |||
196 | #define LOCK(syscon) \ | 196 | #define LOCK(syscon) \ | |
197 | syscon_lock(syscon) | 197 | syscon_lock(syscon) | |
198 | #define UNLOCK(syscon) \ | 198 | #define UNLOCK(syscon) \ | |
199 | syscon_unlock(syscon) | 199 | syscon_unlock(syscon) |
--- src/sys/arch/arm/rockchip/rk_vop.c 2021/01/25 14:20:38 1.8
+++ src/sys/arch/arm/rockchip/rk_vop.c 2021/01/27 02:00:02 1.9
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: rk_vop.c,v 1.8 2021/01/25 14:20:38 thorpej Exp $ */ | 1 | /* $NetBSD: rk_vop.c,v 1.9 2021/01/27 02:00:02 thorpej Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2019 Jared D. McNeill <jmcneill@invisible.ca> | 4 | * Copyright (c) 2019 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: rk_vop.c,v 1.8 2021/01/25 14:20:38 thorpej Exp $"); | 30 | __KERNEL_RCSID(0, "$NetBSD: rk_vop.c,v 1.9 2021/01/27 02:00:02 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/conf.h> | 38 | #include <sys/conf.h> | |
39 | #include <sys/sysctl.h> | 39 | #include <sys/sysctl.h> | |
40 | 40 | |||
41 | #include <drm/drmP.h> | 41 | #include <drm/drmP.h> | |
42 | #include <drm/drm_crtc.h> | 42 | #include <drm/drm_crtc.h> | |
43 | #include <drm/drm_crtc_helper.h> | 43 | #include <drm/drm_crtc_helper.h> | |
@@ -214,27 +214,27 @@ static const struct rk_vop_config rk3399 | @@ -214,27 +214,27 @@ static const struct rk_vop_config rk3399 | |||
214 | static const struct rk_vop_config rk3399_vop_big_config = { | 214 | static const struct rk_vop_config rk3399_vop_big_config = { | |
215 | .descr = "RK3399 VOPB", | 215 | .descr = "RK3399 VOPB", | |
216 | .out_mode = DSP_OUT_MODE_RGBaaa, | 216 | .out_mode = DSP_OUT_MODE_RGBaaa, | |
217 | .init = rk3399_vop_init, | 217 | .init = rk3399_vop_init, | |
218 | .set_polarity = rk3399_vop_set_polarity, | 218 | .set_polarity = rk3399_vop_set_polarity, | |
219 | }; | 219 | }; | |
220 | 220 | |||
221 | static const struct device_compatible_entry compat_data[] = { | 221 | static const struct device_compatible_entry compat_data[] = { | |
222 | { .compat = "rockchip,rk3399-vop-big", | 222 | { .compat = "rockchip,rk3399-vop-big", | |
223 | .data = &rk3399_vop_big_config }, | 223 | .data = &rk3399_vop_big_config }, | |
224 | { .compat = "rockchip,rk3399-vop-lit", | 224 | { .compat = "rockchip,rk3399-vop-lit", | |
225 | .data = &rk3399_vop_lit_config }, | 225 | .data = &rk3399_vop_lit_config }, | |
226 | 226 | |||
227 | { } | 227 | DEVICE_COMPAT_EOL | |
228 | }; | 228 | }; | |
229 | 229 | |||
230 | static int | 230 | static int | |
231 | rk_vop_mode_do_set_base(struct drm_crtc *crtc, struct drm_framebuffer *fb, | 231 | rk_vop_mode_do_set_base(struct drm_crtc *crtc, struct drm_framebuffer *fb, | |
232 | int x, int y, int atomic) | 232 | int x, int y, int atomic) | |
233 | { | 233 | { | |
234 | struct rk_vop_crtc *mixer_crtc = to_rk_vop_crtc(crtc); | 234 | struct rk_vop_crtc *mixer_crtc = to_rk_vop_crtc(crtc); | |
235 | struct rk_vop_softc * const sc = mixer_crtc->sc; | 235 | struct rk_vop_softc * const sc = mixer_crtc->sc; | |
236 | struct rk_drm_framebuffer *sfb = atomic? | 236 | struct rk_drm_framebuffer *sfb = atomic? | |
237 | to_rk_drm_framebuffer(fb) : | 237 | to_rk_drm_framebuffer(fb) : | |
238 | to_rk_drm_framebuffer(crtc->primary->fb); | 238 | to_rk_drm_framebuffer(crtc->primary->fb); | |
239 | 239 | |||
240 | uint64_t paddr = (uint64_t)sfb->obj->dmamap->dm_segs[0].ds_addr; | 240 | uint64_t paddr = (uint64_t)sfb->obj->dmamap->dm_segs[0].ds_addr; |
--- src/sys/arch/arm/rockchip/rk_pwm.c 2021/01/25 14:20:38 1.5
+++ src/sys/arch/arm/rockchip/rk_pwm.c 2021/01/27 02:00:02 1.6
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: rk_pwm.c,v 1.5 2021/01/25 14:20:38 thorpej Exp $ */ | 1 | /* $NetBSD: rk_pwm.c,v 1.6 2021/01/27 02:00:02 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. | |
@@ -18,27 +18,27 @@ | @@ -18,27 +18,27 @@ | |||
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 FOUNDATION OR CONTRIBUTORS | 19 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | |
20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
26 | * POSSIBILITY OF SUCH DAMAGE. | 26 | * POSSIBILITY OF SUCH DAMAGE. | |
27 | */ | 27 | */ | |
28 | 28 | |||
29 | #include <sys/cdefs.h> | 29 | #include <sys/cdefs.h> | |
30 | 30 | |||
31 | __KERNEL_RCSID(1, "$NetBSD: rk_pwm.c,v 1.5 2021/01/25 14:20:38 thorpej Exp $"); | 31 | __KERNEL_RCSID(1, "$NetBSD: rk_pwm.c,v 1.6 2021/01/27 02:00:02 thorpej 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/intr.h> | 36 | #include <sys/intr.h> | |
37 | #include <sys/systm.h> | 37 | #include <sys/systm.h> | |
38 | #include <sys/time.h> | 38 | #include <sys/time.h> | |
39 | 39 | |||
40 | #include <dev/pwm/pwmvar.h> | 40 | #include <dev/pwm/pwmvar.h> | |
41 | 41 | |||
42 | #include <dev/fdt/fdtvar.h> | 42 | #include <dev/fdt/fdtvar.h> | |
43 | 43 | |||
44 | #define PWM0_CNT 0x00 | 44 | #define PWM0_CNT 0x00 | |
@@ -55,27 +55,27 @@ __KERNEL_RCSID(1, "$NetBSD: rk_pwm.c,v 1 | @@ -55,27 +55,27 @@ __KERNEL_RCSID(1, "$NetBSD: rk_pwm.c,v 1 | |||
55 | #define CTRL_DUTY_POL __BIT(3) | 55 | #define CTRL_DUTY_POL __BIT(3) | |
56 | #define CTRL_PWM_MODE __BITS(2,1) | 56 | #define CTRL_PWM_MODE __BITS(2,1) | |
57 | #define CTRL_PWM_MODE_ONESHOT 0 | 57 | #define CTRL_PWM_MODE_ONESHOT 0 | |
58 | #define CTRL_PWM_MODE_CONTINUOUS 1 | 58 | #define CTRL_PWM_MODE_CONTINUOUS 1 | |
59 | #define CTRL_PWM_MODE_CAPTURE 2 | 59 | #define CTRL_PWM_MODE_CAPTURE 2 | |
60 | #define CTRL_PWM_EN __BIT(0) | 60 | #define CTRL_PWM_EN __BIT(0) | |
61 | 61 | |||
62 | enum rk_pwm_type { | 62 | enum rk_pwm_type { | |
63 | PWM_RK3288 = 1, | 63 | PWM_RK3288 = 1, | |
64 | }; | 64 | }; | |
65 | 65 | |||
66 | static const struct device_compatible_entry compat_data[] = { | 66 | static const struct device_compatible_entry compat_data[] = { | |
67 | { .compat = "rockchip,rk3288-pwm", .value = PWM_RK3288 }, | 67 | { .compat = "rockchip,rk3288-pwm", .value = PWM_RK3288 }, | |
68 | { } | 68 | DEVICE_COMPAT_EOL | |
69 | }; | 69 | }; | |
70 | 70 | |||
71 | struct rk_pwm_softc { | 71 | struct rk_pwm_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 | 75 | |||
76 | struct pwm_controller sc_pwm; | 76 | struct pwm_controller sc_pwm; | |
77 | struct pwm_config sc_conf; | 77 | struct pwm_config sc_conf; | |
78 | 78 | |||
79 | u_int sc_clkfreq; | 79 | u_int sc_clkfreq; | |
80 | }; | 80 | }; | |
81 | 81 |
--- src/sys/arch/arm/rockchip/rk_v1crypto.c 2021/01/25 14:20:38 1.5
+++ src/sys/arch/arm/rockchip/rk_v1crypto.c 2021/01/27 02:00:02 1.6
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: rk_v1crypto.c,v 1.5 2021/01/25 14:20:38 thorpej Exp $ */ | 1 | /* $NetBSD: rk_v1crypto.c,v 1.6 2021/01/27 02:00:02 thorpej Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2020 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 2020 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 Taylor R. Campbell. | 8 | * by Taylor R. Campbell. | |
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. | |
@@ -26,27 +26,27 @@ | @@ -26,27 +26,27 @@ | |||
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
29 | * POSSIBILITY OF SUCH DAMAGE. | 29 | * POSSIBILITY OF SUCH DAMAGE. | |
30 | */ | 30 | */ | |
31 | 31 | |||
32 | /* | 32 | /* | |
33 | * rk_v1crypto -- Rockchip crypto v1 driver | 33 | * rk_v1crypto -- Rockchip crypto v1 driver | |
34 | * | 34 | * | |
35 | * This is just the RNG for now. | 35 | * This is just the RNG for now. | |
36 | */ | 36 | */ | |
37 | 37 | |||
38 | #include <sys/cdefs.h> | 38 | #include <sys/cdefs.h> | |
39 | __KERNEL_RCSID(1, "$NetBSD: rk_v1crypto.c,v 1.5 2021/01/25 14:20:38 thorpej Exp $"); | 39 | __KERNEL_RCSID(1, "$NetBSD: rk_v1crypto.c,v 1.6 2021/01/27 02:00:02 thorpej Exp $"); | |
40 | 40 | |||
41 | #include <sys/types.h> | 41 | #include <sys/types.h> | |
42 | 42 | |||
43 | #include <sys/bus.h> | 43 | #include <sys/bus.h> | |
44 | #include <sys/device.h> | 44 | #include <sys/device.h> | |
45 | #include <sys/errno.h> | 45 | #include <sys/errno.h> | |
46 | #include <sys/mutex.h> | 46 | #include <sys/mutex.h> | |
47 | #include <sys/rndsource.h> | 47 | #include <sys/rndsource.h> | |
48 | #include <sys/sysctl.h> | 48 | #include <sys/sysctl.h> | |
49 | 49 | |||
50 | #include <dev/fdt/fdtvar.h> | 50 | #include <dev/fdt/fdtvar.h> | |
51 | 51 | |||
52 | #include <arm/rockchip/rk_v1crypto.h> | 52 | #include <arm/rockchip/rk_v1crypto.h> | |
@@ -90,27 +90,27 @@ RKC_CTRL(struct rk_v1crypto_softc *sc, u | @@ -90,27 +90,27 @@ RKC_CTRL(struct rk_v1crypto_softc *sc, u | |||
90 | { | 90 | { | |
91 | uint32_t c = 0; | 91 | uint32_t c = 0; | |
92 | 92 | |||
93 | c |= __SHIFTIN(m, RK_V1CRYPTO_CTRL_MASK); | 93 | c |= __SHIFTIN(m, RK_V1CRYPTO_CTRL_MASK); | |
94 | c |= __SHIFTIN(v, m); | 94 | c |= __SHIFTIN(v, m); | |
95 | RKC_WRITE(sc, RK_V1CRYPTO_CTRL, c); | 95 | RKC_WRITE(sc, RK_V1CRYPTO_CTRL, c); | |
96 | } | 96 | } | |
97 | 97 | |||
98 | CFATTACH_DECL_NEW(rk_v1crypto, sizeof(struct rk_v1crypto_softc), | 98 | CFATTACH_DECL_NEW(rk_v1crypto, sizeof(struct rk_v1crypto_softc), | |
99 | rk_v1crypto_match, rk_v1crypto_attach, NULL, NULL); | 99 | rk_v1crypto_match, rk_v1crypto_attach, NULL, NULL); | |
100 | 100 | |||
101 | static const struct device_compatible_entry compat_data[] = { | 101 | static const struct device_compatible_entry compat_data[] = { | |
102 | { .compat = "rockchip,rk3288-crypto" }, | 102 | { .compat = "rockchip,rk3288-crypto" }, | |
103 | { } | 103 | DEVICE_COMPAT_EOL | |
104 | }; | 104 | }; | |
105 | 105 | |||
106 | static int | 106 | static int | |
107 | rk_v1crypto_match(device_t parent, cfdata_t cf, void *aux) | 107 | rk_v1crypto_match(device_t parent, cfdata_t cf, void *aux) | |
108 | { | 108 | { | |
109 | const struct fdt_attach_args *const faa = aux; | 109 | const struct fdt_attach_args *const faa = aux; | |
110 | 110 | |||
111 | return of_match_compat_data(faa->faa_phandle, compat_data); | 111 | return of_match_compat_data(faa->faa_phandle, compat_data); | |
112 | } | 112 | } | |
113 | 113 | |||
114 | static void | 114 | static void | |
115 | rk_v1crypto_attach(device_t parent, device_t self, void *aux) | 115 | rk_v1crypto_attach(device_t parent, device_t self, void *aux) | |
116 | { | 116 | { |
--- src/sys/arch/arm/rockchip/rk_tsadc.c 2021/01/25 14:20:38 1.10
+++ src/sys/arch/arm/rockchip/rk_tsadc.c 2021/01/27 02:00:02 1.11
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: rk_tsadc.c,v 1.10 2021/01/25 14:20:38 thorpej Exp $ */ | 1 | /* $NetBSD: rk_tsadc.c,v 1.11 2021/01/27 02:00:02 thorpej Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 2019 Matthew R. Green | 4 | * Copyright (c) 2019 Matthew R. Green | |
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 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | 20 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | |
21 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | 21 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | |
22 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | 22 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | |
23 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 23 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | |
24 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED | 24 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED | |
25 | * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | 25 | * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |
26 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 26 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
27 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 27 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
28 | * SUCH DAMAGE. | 28 | * SUCH DAMAGE. | |
29 | */ | 29 | */ | |
30 | 30 | |||
31 | #include <sys/cdefs.h> | 31 | #include <sys/cdefs.h> | |
32 | 32 | |||
33 | __KERNEL_RCSID(0, "$NetBSD: rk_tsadc.c,v 1.10 2021/01/25 14:20:38 thorpej Exp $"); | 33 | __KERNEL_RCSID(0, "$NetBSD: rk_tsadc.c,v 1.11 2021/01/27 02:00:02 thorpej Exp $"); | |
34 | 34 | |||
35 | /* | 35 | /* | |
36 | * Driver for the TSADC temperature sensor monitor in RK3328 and RK3399. | 36 | * Driver for the TSADC temperature sensor monitor in RK3328 and RK3399. | |
37 | * | 37 | * | |
38 | * TODO: | 38 | * TODO: | |
39 | * - handle setting various temp values | 39 | * - handle setting various temp values | |
40 | * - handle DT trips/temp value defaults | 40 | * - handle DT trips/temp value defaults | |
41 | * - interrupts aren't triggered (test by lowering warn/crit values), and | 41 | * - interrupts aren't triggered (test by lowering warn/crit values), and | |
42 | * once they work, make the interrupt do something | 42 | * once they work, make the interrupt do something | |
43 | */ | 43 | */ | |
44 | 44 | |||
45 | #include <sys/param.h> | 45 | #include <sys/param.h> | |
46 | #include <sys/bus.h> | 46 | #include <sys/bus.h> | |
@@ -367,27 +367,27 @@ static const rk_data rk3399_data_table = | @@ -367,27 +367,27 @@ static const rk_data rk3399_data_table = | |||
367 | .rd_array = rk3399_data_array, | 367 | .rd_array = rk3399_data_array, | |
368 | .rd_size = __arraycount(rk3399_data_array), | 368 | .rd_size = __arraycount(rk3399_data_array), | |
369 | .rd_init = rk_tsadc_init_rk3399, | 369 | .rd_init = rk_tsadc_init_rk3399, | |
370 | .rd_decr = false, | 370 | .rd_decr = false, | |
371 | .rd_max = 686, | 371 | .rd_max = 686, | |
372 | .rd_min = 401, | 372 | .rd_min = 401, | |
373 | .rd_auto_period = RK3399_TSADC_AUTO_PERIOD_TIME, | 373 | .rd_auto_period = RK3399_TSADC_AUTO_PERIOD_TIME, | |
374 | .rd_num_sensors = 2, | 374 | .rd_num_sensors = 2, | |
375 | }; | 375 | }; | |
376 | 376 | |||
377 | static const struct device_compatible_entry compat_data[] = { | 377 | static const struct device_compatible_entry compat_data[] = { | |
378 | { .compat = "rockchip,rk3328-tsadc", .data = &rk3328_data_table }, | 378 | { .compat = "rockchip,rk3328-tsadc", .data = &rk3328_data_table }, | |
379 | { .compat = "rockchip,rk3399-tsadc", .data = &rk3399_data_table }, | 379 | { .compat = "rockchip,rk3399-tsadc", .data = &rk3399_data_table }, | |
380 | { } | 380 | DEVICE_COMPAT_EOL | |
381 | }; | 381 | }; | |
382 | 382 | |||
383 | #define TSADC_READ(sc, reg) \ | 383 | #define TSADC_READ(sc, reg) \ | |
384 | bus_space_read_4((sc)->sc_bst, (sc)->sc_bsh, (reg)) | 384 | bus_space_read_4((sc)->sc_bst, (sc)->sc_bsh, (reg)) | |
385 | #define TSADC_WRITE(sc, reg, val) \ | 385 | #define TSADC_WRITE(sc, reg, val) \ | |
386 | bus_space_write_4((sc)->sc_bst, (sc)->sc_bsh, (reg), (val)) | 386 | bus_space_write_4((sc)->sc_bst, (sc)->sc_bsh, (reg), (val)) | |
387 | 387 | |||
388 | CFATTACH_DECL3_NEW(rk_tsadc, sizeof(struct rk_tsadc_softc), | 388 | CFATTACH_DECL3_NEW(rk_tsadc, sizeof(struct rk_tsadc_softc), | |
389 | rk_tsadc_match, rk_tsadc_attach, rk_tsadc_detach, NULL, NULL, NULL, | 389 | rk_tsadc_match, rk_tsadc_attach, rk_tsadc_detach, NULL, NULL, NULL, | |
390 | DVF_DETACH_SHUTDOWN); | 390 | DVF_DETACH_SHUTDOWN); | |
391 | 391 | |||
392 | /* init/teardown support */ | 392 | /* init/teardown support */ | |
393 | static int | 393 | static int |
--- src/sys/arch/arm/rockchip/rk_usb.c 2021/01/25 14:20:38 1.9
+++ src/sys/arch/arm/rockchip/rk_usb.c 2021/01/27 02:00:02 1.10
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: rk_usb.c,v 1.9 2021/01/25 14:20:38 thorpej Exp $ */ | 1 | /* $NetBSD: rk_usb.c,v 1.10 2021/01/27 02:00:02 thorpej Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2018 Jared McNeill <jmcneill@invisible.ca> | 4 | * Copyright (c) 2018 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. | |
@@ -18,27 +18,27 @@ | @@ -18,27 +18,27 @@ | |||
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 FOUNDATION OR CONTRIBUTORS | 19 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | |
20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
26 | * POSSIBILITY OF SUCH DAMAGE. | 26 | * POSSIBILITY OF SUCH DAMAGE. | |
27 | */ | 27 | */ | |
28 | 28 | |||
29 | #include <sys/cdefs.h> | 29 | #include <sys/cdefs.h> | |
30 | 30 | |||
31 | __KERNEL_RCSID(0, "$NetBSD: rk_usb.c,v 1.9 2021/01/25 14:20:38 thorpej Exp $"); | 31 | __KERNEL_RCSID(0, "$NetBSD: rk_usb.c,v 1.10 2021/01/27 02:00:02 thorpej 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/intr.h> | 36 | #include <sys/intr.h> | |
37 | #include <sys/systm.h> | 37 | #include <sys/systm.h> | |
38 | #include <sys/time.h> | 38 | #include <sys/time.h> | |
39 | #include <sys/kmem.h> | 39 | #include <sys/kmem.h> | |
40 | 40 | |||
41 | #include <dev/clk/clk_backend.h> | 41 | #include <dev/clk/clk_backend.h> | |
42 | 42 | |||
43 | #include <dev/fdt/fdtvar.h> | 43 | #include <dev/fdt/fdtvar.h> | |
44 | #include <dev/fdt/syscon.h> | 44 | #include <dev/fdt/syscon.h> | |
@@ -61,27 +61,27 @@ static void rk_usb_attach(device_t, devi | @@ -61,27 +61,27 @@ static void rk_usb_attach(device_t, devi | |||
61 | #define RK3399_USBPHY_SUSPEND_N __BIT(1) | 61 | #define RK3399_USBPHY_SUSPEND_N __BIT(1) | |
62 | #define RK3399_USBPHY_UTMI_SEL __BIT(0) | 62 | #define RK3399_USBPHY_UTMI_SEL __BIT(0) | |
63 | 63 | |||
64 | #define RK3399_PHY_NO(_sc) ((_sc)->sc_reg == 0xe450 ? 0 : 1) | 64 | #define RK3399_PHY_NO(_sc) ((_sc)->sc_reg == 0xe450 ? 0 : 1) | |
65 | 65 | |||
66 | enum rk_usb_type { | 66 | enum rk_usb_type { | |
67 | USB_RK3328 = 1, | 67 | USB_RK3328 = 1, | |
68 | USB_RK3399, | 68 | USB_RK3399, | |
69 | }; | 69 | }; | |
70 | 70 | |||
71 | static const struct device_compatible_entry compat_data[] = { | 71 | static const struct device_compatible_entry compat_data[] = { | |
72 | { .compat = "rockchip,rk3328-usb2phy", .value = USB_RK3328 }, | 72 | { .compat = "rockchip,rk3328-usb2phy", .value = USB_RK3328 }, | |
73 | { .compat = "rockchip,rk3399-usb2phy", .value = USB_RK3399 }, | 73 | { .compat = "rockchip,rk3399-usb2phy", .value = USB_RK3399 }, | |
74 | { } | 74 | DEVICE_COMPAT_EOL | |
75 | }; | 75 | }; | |
76 | 76 | |||
77 | struct rk_usb_clk { | 77 | struct rk_usb_clk { | |
78 | struct clk base; | 78 | struct clk base; | |
79 | }; | 79 | }; | |
80 | 80 | |||
81 | struct rk_usb_softc { | 81 | struct rk_usb_softc { | |
82 | device_t sc_dev; | 82 | device_t sc_dev; | |
83 | struct syscon *sc_syscon; | 83 | struct syscon *sc_syscon; | |
84 | enum rk_usb_type sc_type; | 84 | enum rk_usb_type sc_type; | |
85 | 85 | |||
86 | struct clk_domain sc_clkdom; | 86 | struct clk_domain sc_clkdom; | |
87 | struct rk_usb_clk sc_usbclk; | 87 | struct rk_usb_clk sc_usbclk; |