Use DEVICE_COMPAT_EOL.diff -r1.4 -r1.5 src/sys/arch/arm/nxp/if_enet_imx.c
(thorpej)
--- src/sys/arch/arm/nxp/if_enet_imx.c 2021/01/25 14:20:38 1.4
+++ src/sys/arch/arm/nxp/if_enet_imx.c 2021/01/27 02:14:49 1.5
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: if_enet_imx.c,v 1.4 2021/01/25 14:20:38 thorpej Exp $ */ | 1 | /* $NetBSD: if_enet_imx.c,v 1.5 2021/01/27 02:14:49 thorpej Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2019 Genetec Corporation. All rights reserved. | 4 | * Copyright (c) 2019 Genetec Corporation. All rights reserved. | |
5 | * Written by Hashimoto Kenichi for Genetec Corporation. | 5 | * Written by Hashimoto Kenichi for Genetec Corporation. | |
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,53 +17,53 @@ | @@ -17,53 +17,53 @@ | |||
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: if_enet_imx.c,v 1.4 2021/01/25 14:20:38 thorpej Exp $"); | 30 | __KERNEL_RCSID(0, "$NetBSD: if_enet_imx.c,v 1.5 2021/01/27 02:14:49 thorpej Exp $"); | |
31 | 31 | |||
32 | #include "opt_fdt.h" | 32 | #include "opt_fdt.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 | 37 | |||
38 | #include <arm/imx/if_enetreg.h> | 38 | #include <arm/imx/if_enetreg.h> | |
39 | #include <arm/imx/if_enetvar.h> | 39 | #include <arm/imx/if_enetvar.h> | |
40 | 40 | |||
41 | #include <dev/fdt/fdtvar.h> | 41 | #include <dev/fdt/fdtvar.h> | |
42 | 42 | |||
43 | struct enet_fdt_softc { | 43 | struct enet_fdt_softc { | |
44 | struct enet_softc sc_enet; | 44 | struct enet_softc sc_enet; | |
45 | 45 | |||
46 | struct fdtbus_gpio_pin *sc_pin_reset; | 46 | struct fdtbus_gpio_pin *sc_pin_reset; | |
47 | }; | 47 | }; | |
48 | 48 | |||
49 | CFATTACH_DECL_NEW(enet_fdt, sizeof(struct enet_fdt_softc), | 49 | CFATTACH_DECL_NEW(enet_fdt, sizeof(struct enet_fdt_softc), | |
50 | enet_match, enet_attach, NULL, NULL); | 50 | enet_match, enet_attach, NULL, NULL); | |
51 | 51 | |||
52 | static const struct device_compatible_entry compat_data[] = { | 52 | static const struct device_compatible_entry compat_data[] = { | |
53 | /* compatible imxtype */ | 53 | /* compatible imxtype */ | |
54 | { .compat = "fsl,imx6q-fec", .value = 6 }, | 54 | { .compat = "fsl,imx6q-fec", .value = 6 }, | |
55 | { .compat = "fsl,imx6sx-fec", .value = 7 }, | 55 | { .compat = "fsl,imx6sx-fec", .value = 7 }, | |
56 | { } | 56 | DEVICE_COMPAT_EOL | |
57 | }; | 57 | }; | |
58 | 58 | |||
59 | static int enet_init_clocks(struct enet_softc *); | 59 | static int enet_init_clocks(struct enet_softc *); | |
60 | static void enet_phy_reset(struct enet_fdt_softc *, const int); | 60 | static void enet_phy_reset(struct enet_fdt_softc *, const int); | |
61 | static int enet_phy_id(struct enet_softc *, const int); | 61 | static int enet_phy_id(struct enet_softc *, const int); | |
62 | static void *enet_intr_establish(struct enet_softc *, int, u_int); | 62 | static void *enet_intr_establish(struct enet_softc *, int, u_int); | |
63 | 63 | |||
64 | int | 64 | int | |
65 | enet_match(device_t parent, cfdata_t cf, void *aux) | 65 | enet_match(device_t parent, cfdata_t cf, void *aux) | |
66 | { | 66 | { | |
67 | struct fdt_attach_args * const faa = aux; | 67 | struct fdt_attach_args * const faa = aux; | |
68 | 68 | |||
69 | return of_match_compat_data(faa->faa_phandle, compat_data); | 69 | return of_match_compat_data(faa->faa_phandle, compat_data); |
--- src/sys/arch/arm/nxp/imx6_pcie.c 2021/01/25 14:20:38 1.4
+++ src/sys/arch/arm/nxp/imx6_pcie.c 2021/01/27 02:14:49 1.5
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: imx6_pcie.c,v 1.4 2021/01/25 14:20:38 thorpej Exp $ */ | 1 | /* $NetBSD: imx6_pcie.c,v 1.5 2021/01/27 02:14:49 thorpej Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2019 Genetec Corporation. All rights reserved. | 4 | * Copyright (c) 2019 Genetec Corporation. All rights reserved. | |
5 | * Written by Hashimoto Kenichi for Genetec Corporation. | 5 | * Written by Hashimoto Kenichi for Genetec Corporation. | |
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: imx6_pcie.c,v 1.4 2021/01/25 14:20:38 thorpej Exp $"); | 30 | __KERNEL_RCSID(0, "$NetBSD: imx6_pcie.c,v 1.5 2021/01/27 02:14:49 thorpej Exp $"); | |
31 | 31 | |||
32 | #include "opt_pci.h" | 32 | #include "opt_pci.h" | |
33 | #include "opt_fdt.h" | 33 | #include "opt_fdt.h" | |
34 | 34 | |||
35 | #include "pci.h" | 35 | #include "pci.h" | |
36 | #include "locators.h" | 36 | #include "locators.h" | |
37 | 37 | |||
38 | #define _INTR_PRIVATE | 38 | #define _INTR_PRIVATE | |
39 | 39 | |||
40 | #include <sys/bus.h> | 40 | #include <sys/bus.h> | |
41 | #include <sys/device.h> | 41 | #include <sys/device.h> | |
42 | #include <sys/intr.h> | 42 | #include <sys/intr.h> | |
43 | #include <sys/systm.h> | 43 | #include <sys/systm.h> | |
@@ -82,27 +82,27 @@ static void imx6_pcie_reset(void *); | @@ -82,27 +82,27 @@ static void imx6_pcie_reset(void *); | |||
82 | #define IMX6_PCIE_MEM_BASE 0x01000000 | 82 | #define IMX6_PCIE_MEM_BASE 0x01000000 | |
83 | #define IMX6_PCIE_MEM_SIZE 0x00f00000 /* 15MB */ | 83 | #define IMX6_PCIE_MEM_SIZE 0x00f00000 /* 15MB */ | |
84 | #define IMX6_PCIE_ROOT_BASE 0x01f00000 | 84 | #define IMX6_PCIE_ROOT_BASE 0x01f00000 | |
85 | #define IMX6_PCIE_ROOT_SIZE 0x00080000 /* 512KB */ | 85 | #define IMX6_PCIE_ROOT_SIZE 0x00080000 /* 512KB */ | |
86 | #define IMX6_PCIE_IO_BASE 0x01f80000 | 86 | #define IMX6_PCIE_IO_BASE 0x01f80000 | |
87 | #define IMX6_PCIE_IO_SIZE 0x00010000 /* 64KB */ | 87 | #define IMX6_PCIE_IO_SIZE 0x00010000 /* 64KB */ | |
88 | 88 | |||
89 | CFATTACH_DECL_NEW(imxpcie_fdt, sizeof(struct imxpcie_fdt_softc), | 89 | CFATTACH_DECL_NEW(imxpcie_fdt, sizeof(struct imxpcie_fdt_softc), | |
90 | imx6_pcie_match, imx6_pcie_attach, NULL, NULL); | 90 | imx6_pcie_match, imx6_pcie_attach, NULL, NULL); | |
91 | 91 | |||
92 | static const struct device_compatible_entry compat_data[] = { | 92 | static const struct device_compatible_entry compat_data[] = { | |
93 | { .compat = "fsl,imx6q-pcie", .value = false }, | 93 | { .compat = "fsl,imx6q-pcie", .value = false }, | |
94 | { .compat = "fsl,imx6qp-pcie", .value = true }, | 94 | { .compat = "fsl,imx6qp-pcie", .value = true }, | |
95 | { } | 95 | DEVICE_COMPAT_EOL | |
96 | }; | 96 | }; | |
97 | 97 | |||
98 | static int | 98 | static int | |
99 | imx6_pcie_match(device_t parent, cfdata_t cf, void *aux) | 99 | imx6_pcie_match(device_t parent, cfdata_t cf, void *aux) | |
100 | { | 100 | { | |
101 | struct fdt_attach_args * const faa = aux; | 101 | struct fdt_attach_args * const faa = aux; | |
102 | 102 | |||
103 | return of_match_compat_data(faa->faa_phandle, compat_data); | 103 | return of_match_compat_data(faa->faa_phandle, compat_data); | |
104 | } | 104 | } | |
105 | 105 | |||
106 | static void | 106 | static void | |
107 | imx6_pcie_attach(device_t parent, device_t self, void *aux) | 107 | imx6_pcie_attach(device_t parent, device_t self, void *aux) | |
108 | { | 108 | { |
--- src/sys/arch/arm/nxp/imx_sdhc.c 2021/01/25 14:20:38 1.4
+++ src/sys/arch/arm/nxp/imx_sdhc.c 2021/01/27 02:14:49 1.5
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: imx_sdhc.c,v 1.4 2021/01/25 14:20:38 thorpej Exp $ */ | 1 | /* $NetBSD: imx_sdhc.c,v 1.5 2021/01/27 02:14:49 thorpej Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2019 Genetec Corporation. All rights reserved. | 4 | * Copyright (c) 2019 Genetec Corporation. All rights reserved. | |
5 | * Written by Hashimoto Kenichi for Genetec Corporation. | 5 | * Written by Hashimoto Kenichi for Genetec Corporation. | |
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: imx_sdhc.c,v 1.4 2021/01/25 14:20:38 thorpej Exp $"); | 30 | __KERNEL_RCSID(0, "$NetBSD: imx_sdhc.c,v 1.5 2021/01/27 02:14:49 thorpej Exp $"); | |
31 | 31 | |||
32 | #include "opt_fdt.h" | 32 | #include "opt_fdt.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 <dev/sdmmc/sdhcreg.h> | 42 | #include <dev/sdmmc/sdhcreg.h> | |
43 | #include <dev/sdmmc/sdhcvar.h> | 43 | #include <dev/sdmmc/sdhcvar.h> | |
@@ -77,27 +77,27 @@ struct imx6_sdhc_config { | @@ -77,27 +77,27 @@ struct imx6_sdhc_config { | |||
77 | 77 | |||
78 | static const struct imx6_sdhc_config imx6q_config = { | 78 | static const struct imx6_sdhc_config imx6q_config = { | |
79 | .flags = SDHC_FLAG_BROKEN_ADMA2_ZEROLEN | | 79 | .flags = SDHC_FLAG_BROKEN_ADMA2_ZEROLEN | | |
80 | SDHC_FLAG_NO_BUSY_INTR, | 80 | SDHC_FLAG_NO_BUSY_INTR, | |
81 | }; | 81 | }; | |
82 | 82 | |||
83 | static const struct imx6_sdhc_config imx7d_config = { | 83 | static const struct imx6_sdhc_config imx7d_config = { | |
84 | .flags = 0 | 84 | .flags = 0 | |
85 | }; | 85 | }; | |
86 | 86 | |||
87 | static const struct device_compatible_entry compat_data[] = { | 87 | static const struct device_compatible_entry compat_data[] = { | |
88 | { .compat = "fsl,imx6q-usdhc", .data = &imx6q_config }, | 88 | { .compat = "fsl,imx6q-usdhc", .data = &imx6q_config }, | |
89 | { .compat = "fsl,imx7d-usdhc", .data = &imx7d_config }, | 89 | { .compat = "fsl,imx7d-usdhc", .data = &imx7d_config }, | |
90 | { } | 90 | DEVICE_COMPAT_EOL | |
91 | }; | 91 | }; | |
92 | 92 | |||
93 | static int | 93 | static int | |
94 | imx_sdhc_match(device_t parent, cfdata_t cf, void *aux) | 94 | imx_sdhc_match(device_t parent, cfdata_t cf, void *aux) | |
95 | { | 95 | { | |
96 | struct fdt_attach_args * const faa = aux; | 96 | struct fdt_attach_args * const faa = aux; | |
97 | 97 | |||
98 | return of_match_compat_data(faa->faa_phandle, compat_data); | 98 | return of_match_compat_data(faa->faa_phandle, compat_data); | |
99 | } | 99 | } | |
100 | 100 | |||
101 | static void | 101 | static void | |
102 | imx_sdhc_attach(device_t parent, device_t self, void *aux) | 102 | imx_sdhc_attach(device_t parent, device_t self, void *aux) | |
103 | { | 103 | { |
--- src/sys/arch/arm/nxp/imx6_spi.c 2021/01/25 14:20:38 1.5
+++ src/sys/arch/arm/nxp/imx6_spi.c 2021/01/27 02:14:49 1.6
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: imx6_spi.c,v 1.5 2021/01/25 14:20:38 thorpej Exp $ */ | 1 | /* $NetBSD: imx6_spi.c,v 1.6 2021/01/27 02:14:49 thorpej Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2019 Genetec Corporation. All rights reserved. | 4 | * Copyright (c) 2019 Genetec Corporation. All rights reserved. | |
5 | * Written by Hashimoto Kenichi for Genetec Corporation. | 5 | * Written by Hashimoto Kenichi for Genetec Corporation. | |
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: imx6_spi.c,v 1.5 2021/01/25 14:20:38 thorpej Exp $"); | 30 | __KERNEL_RCSID(0, "$NetBSD: imx6_spi.c,v 1.6 2021/01/27 02:14:49 thorpej Exp $"); | |
31 | 31 | |||
32 | #include "opt_imxspi.h" | 32 | #include "opt_imxspi.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/kmem.h> | 37 | #include <sys/kmem.h> | |
38 | #include <sys/gpio.h> | 38 | #include <sys/gpio.h> | |
39 | 39 | |||
40 | #include <arm/imx/imxspivar.h> | 40 | #include <arm/imx/imxspivar.h> | |
41 | 41 | |||
42 | #include <dev/fdt/fdtvar.h> | 42 | #include <dev/fdt/fdtvar.h> | |
43 | 43 | |||
@@ -52,27 +52,27 @@ struct imxspi_fdt_softc { | @@ -52,27 +52,27 @@ struct imxspi_fdt_softc { | |||
52 | 52 | |||
53 | struct imx_spi_config { | 53 | struct imx_spi_config { | |
54 | bool enhanced; | 54 | bool enhanced; | |
55 | enum imxspi_type type; | 55 | enum imxspi_type type; | |
56 | }; | 56 | }; | |
57 | 57 | |||
58 | static const struct imx_spi_config imx6q_spi_config = { | 58 | static const struct imx_spi_config imx6q_spi_config = { | |
59 | .enhanced = true, | 59 | .enhanced = true, | |
60 | .type = IMX51_ECSPI, | 60 | .type = IMX51_ECSPI, | |
61 | }; | 61 | }; | |
62 | 62 | |||
63 | static const struct device_compatible_entry compat_data[] = { | 63 | static const struct device_compatible_entry compat_data[] = { | |
64 | { .compat = "fsl,imx6q-ecspi", .data = &imx6q_spi_config }, | 64 | { .compat = "fsl,imx6q-ecspi", .data = &imx6q_spi_config }, | |
65 | { } | 65 | DEVICE_COMPAT_EOL | |
66 | }; | 66 | }; | |
67 | 67 | |||
68 | CFATTACH_DECL_NEW(imxspi_fdt, sizeof(struct imxspi_fdt_softc), | 68 | CFATTACH_DECL_NEW(imxspi_fdt, sizeof(struct imxspi_fdt_softc), | |
69 | imxspi_match, imxspi_attach, NULL, NULL); | 69 | imxspi_match, imxspi_attach, NULL, NULL); | |
70 | 70 | |||
71 | static int | 71 | static int | |
72 | imxspi_cs_enable(void *arg, int slave) | 72 | imxspi_cs_enable(void *arg, int slave) | |
73 | { | 73 | { | |
74 | struct imxspi_fdt_softc * const sc = arg; | 74 | struct imxspi_fdt_softc * const sc = arg; | |
75 | fdtbus_gpio_write(sc->sc_pin_cs[slave], 1); | 75 | fdtbus_gpio_write(sc->sc_pin_cs[slave], 1); | |
76 | return 0; | 76 | return 0; | |
77 | } | 77 | } | |
78 | 78 |
--- src/sys/arch/arm/nxp/imx8mq_usbphy.c 2021/01/25 14:20:38 1.3
+++ src/sys/arch/arm/nxp/imx8mq_usbphy.c 2021/01/27 02:14:49 1.4
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: imx8mq_usbphy.c,v 1.3 2021/01/25 14:20:38 thorpej Exp $ */ | 1 | /* $NetBSD: imx8mq_usbphy.c,v 1.4 2021/01/27 02:14:49 thorpej Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2020 Jared McNeill <jmcneill@invisible.ca> | 4 | * Copyright (c) 2020 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: imx8mq_usbphy.c,v 1.3 2021/01/25 14:20:38 thorpej Exp $"); | 31 | __KERNEL_RCSID(0, "$NetBSD: imx8mq_usbphy.c,v 1.4 2021/01/27 02:14:49 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/fdt/fdtvar.h> | 40 | #include <dev/fdt/fdtvar.h> | |
41 | 41 | |||
42 | #define PHY_CTL0_ADDR 0x00 | 42 | #define PHY_CTL0_ADDR 0x00 | |
43 | #define REF_SSP_EN __BIT(2) | 43 | #define REF_SSP_EN __BIT(2) | |
44 | 44 | |||
@@ -47,27 +47,27 @@ __KERNEL_RCSID(0, "$NetBSD: imx8mq_usbph | @@ -47,27 +47,27 @@ __KERNEL_RCSID(0, "$NetBSD: imx8mq_usbph | |||
47 | #define PHY_VDATSRCENB0 __BIT(19) | 47 | #define PHY_VDATSRCENB0 __BIT(19) | |
48 | #define PHY_ATERESET __BIT(3) | 48 | #define PHY_ATERESET __BIT(3) | |
49 | #define PHY_COMMONONN __BIT(1) | 49 | #define PHY_COMMONONN __BIT(1) | |
50 | #define PHY_RESET __BIT(0) | 50 | #define PHY_RESET __BIT(0) | |
51 | 51 | |||
52 | #define PHY_CTL2_ADDR 0x08 | 52 | #define PHY_CTL2_ADDR 0x08 | |
53 | #define PHY_TXENABLEN0 __BIT(8) | 53 | #define PHY_TXENABLEN0 __BIT(8) | |
54 | 54 | |||
55 | static int imx8mq_usbphy_match(device_t, cfdata_t, void *); | 55 | static int imx8mq_usbphy_match(device_t, cfdata_t, void *); | |
56 | static void imx8mq_usbphy_attach(device_t, device_t, void *); | 56 | static void imx8mq_usbphy_attach(device_t, device_t, void *); | |
57 | 57 | |||
58 | static const struct device_compatible_entry compat_data[] = { | 58 | static const struct device_compatible_entry compat_data[] = { | |
59 | { .compat = "fsl,imx8mq-usb-phy" }, | 59 | { .compat = "fsl,imx8mq-usb-phy" }, | |
60 | { } | 60 | DEVICE_COMPAT_EOL | |
61 | }; | 61 | }; | |
62 | 62 | |||
63 | struct imx8mq_usbphy_softc { | 63 | struct imx8mq_usbphy_softc { | |
64 | device_t sc_dev; | 64 | device_t sc_dev; | |
65 | bus_space_tag_t sc_bst; | 65 | bus_space_tag_t sc_bst; | |
66 | bus_space_handle_t sc_bsh; | 66 | bus_space_handle_t sc_bsh; | |
67 | int sc_phandle; | 67 | int sc_phandle; | |
68 | }; | 68 | }; | |
69 | 69 | |||
70 | #define PHY_READ(sc, reg) \ | 70 | #define PHY_READ(sc, reg) \ | |
71 | bus_space_read_4((sc)->sc_bst, (sc)->sc_bsh, (reg)) | 71 | bus_space_read_4((sc)->sc_bst, (sc)->sc_bsh, (reg)) | |
72 | #define PHY_WRITE(sc, reg, val) \ | 72 | #define PHY_WRITE(sc, reg, val) \ | |
73 | bus_space_write_4((sc)->sc_bst, (sc)->sc_bsh, (reg), (val)) | 73 | bus_space_write_4((sc)->sc_bst, (sc)->sc_bsh, (reg), (val)) |