Fix build without MULTIPROCESSOR.diff -r1.15 -r1.16 src/sys/arch/arm/altera/cycv_platform.c
(rin)
--- src/sys/arch/arm/altera/cycv_platform.c 2020/11/27 07:11:49 1.15
+++ src/sys/arch/arm/altera/cycv_platform.c 2021/01/29 13:10:07 1.16
@@ -1,23 +1,23 @@ | @@ -1,23 +1,23 @@ | |||
1 | /* $NetBSD: cycv_platform.c,v 1.15 2020/11/27 07:11:49 skrll Exp $ */ | 1 | /* $NetBSD: cycv_platform.c,v 1.16 2021/01/29 13:10:07 rin Exp $ */ | |
2 | 2 | |||
3 | /* This file is in the public domain. */ | 3 | /* This file is in the public domain. */ | |
4 | 4 | |||
5 | #include "arml2cc.h" | 5 | #include "arml2cc.h" | |
6 | #include "opt_console.h" | 6 | #include "opt_console.h" | |
7 | #include "opt_multiprocessor.h" | 7 | #include "opt_multiprocessor.h" | |
8 | 8 | |||
9 | #include <sys/cdefs.h> | 9 | #include <sys/cdefs.h> | |
10 | __KERNEL_RCSID(0, "$NetBSD: cycv_platform.c,v 1.15 2020/11/27 07:11:49 skrll Exp $"); | 10 | __KERNEL_RCSID(0, "$NetBSD: cycv_platform.c,v 1.16 2021/01/29 13:10:07 rin Exp $"); | |
11 | 11 | |||
12 | #define _ARM32_BUS_DMA_PRIVATE | 12 | #define _ARM32_BUS_DMA_PRIVATE | |
13 | #include <sys/param.h> | 13 | #include <sys/param.h> | |
14 | #include <sys/bus.h> | 14 | #include <sys/bus.h> | |
15 | #include <sys/cpu.h> | 15 | #include <sys/cpu.h> | |
16 | #include <sys/device.h> | 16 | #include <sys/device.h> | |
17 | 17 | |||
18 | #include <uvm/uvm_extern.h> | 18 | #include <uvm/uvm_extern.h> | |
19 | 19 | |||
20 | #include <arm/arm32/machdep.h> | 20 | #include <arm/arm32/machdep.h> | |
21 | 21 | |||
22 | #include <arm/altera/cycv_reg.h> | 22 | #include <arm/altera/cycv_reg.h> | |
23 | #include <arm/altera/cycv_var.h> | 23 | #include <arm/altera/cycv_var.h> | |
@@ -69,30 +69,32 @@ cycv_platform_bootstrap(void) | @@ -69,30 +69,32 @@ cycv_platform_bootstrap(void) | |||
69 | 69 | |||
70 | bus_space_map(bst, CYCV_L2CACHE_BASE, CYCV_L2CACHE_SIZE, 0, &bsh_l2c); | 70 | bus_space_map(bst, CYCV_L2CACHE_BASE, CYCV_L2CACHE_SIZE, 0, &bsh_l2c); | |
71 | 71 | |||
72 | #if NARML2CC > 0 | 72 | #if NARML2CC > 0 | |
73 | arml2cc_init(bst, bsh_l2c, 0); | 73 | arml2cc_init(bst, bsh_l2c, 0); | |
74 | #endif | 74 | #endif | |
75 | 75 | |||
76 | arm_fdt_cpu_bootstrap(); | 76 | arm_fdt_cpu_bootstrap(); | |
77 | } | 77 | } | |
78 | 78 | |||
79 | static int | 79 | static int | |
80 | cycv_mpstart(void) | 80 | cycv_mpstart(void) | |
81 | { | 81 | { | |
82 | int ret = 0; | |||
83 | ||||
84 | #ifdef MULTIPROCESSOR | |||
82 | bus_space_tag_t bst = &armv7_generic_bs_tag; | 85 | bus_space_tag_t bst = &armv7_generic_bs_tag; | |
83 | bus_space_handle_t bsh_rst; | 86 | bus_space_handle_t bsh_rst; | |
84 | bus_space_handle_t bsh_scu; | 87 | bus_space_handle_t bsh_scu; | |
85 | int ret = 0; | |||
86 | 88 | |||
87 | bus_space_map(bst, CYCV_RSTMGR_BASE, CYCV_RSTMGR_SIZE, 0, &bsh_rst); | 89 | bus_space_map(bst, CYCV_RSTMGR_BASE, CYCV_RSTMGR_SIZE, 0, &bsh_rst); | |
88 | bus_space_map(bst, CYCV_SCU_BASE, CYCV_SCU_SIZE, 0, &bsh_scu); | 90 | bus_space_map(bst, CYCV_SCU_BASE, CYCV_SCU_SIZE, 0, &bsh_scu); | |
89 | 91 | |||
90 | /* Enable Snoop Control Unit */ | 92 | /* Enable Snoop Control Unit */ | |
91 | bus_space_write_4(bst, bsh_scu, SCU_INV_ALL_REG, 0xff); | 93 | bus_space_write_4(bst, bsh_scu, SCU_INV_ALL_REG, 0xff); | |
92 | bus_space_write_4(bst, bsh_scu, SCU_CTL, | 94 | bus_space_write_4(bst, bsh_scu, SCU_CTL, | |
93 | bus_space_read_4(bst, bsh_scu, SCU_CTL) | SCU_CTL_SCU_ENA); | 95 | bus_space_read_4(bst, bsh_scu, SCU_CTL) | SCU_CTL_SCU_ENA); | |
94 | 96 | |||
95 | const uint32_t startfunc = | 97 | const uint32_t startfunc = | |
96 | (uint32_t) KERN_VTOPHYS((vaddr_t) cpu_mpstart); | 98 | (uint32_t) KERN_VTOPHYS((vaddr_t) cpu_mpstart); | |
97 | 99 | |||
98 | /* | 100 | /* | |
@@ -113,26 +115,27 @@ cycv_mpstart(void) | @@ -113,26 +115,27 @@ cycv_mpstart(void) | |||
113 | bus_space_read_4(bst, bsh_rst, CYCV_RSTMGR_MPUMODRST) & | 115 | bus_space_read_4(bst, bsh_rst, CYCV_RSTMGR_MPUMODRST) & | |
114 | ~CYCV_RSTMGR_MPUMODRST_CPU1); | 116 | ~CYCV_RSTMGR_MPUMODRST_CPU1); | |
115 | 117 | |||
116 | /* Wait for secondary processor to start */ | 118 | /* Wait for secondary processor to start */ | |
117 | int i; | 119 | int i; | |
118 | for (i = 0x10000000; i > 0; i--) { | 120 | for (i = 0x10000000; i > 0; i--) { | |
119 | if (cpu_hatched_p(1)) | 121 | if (cpu_hatched_p(1)) | |
120 | break; | 122 | break; | |
121 | } | 123 | } | |
122 | if (i == 0) { | 124 | if (i == 0) { | |
123 | aprint_error("cpu%d: WARNING: AP failed to start\n", 1); | 125 | aprint_error("cpu%d: WARNING: AP failed to start\n", 1); | |
124 | ret++; | 126 | ret++; | |
125 | } | 127 | } | |
128 | #endif | |||
126 | 129 | |||
127 | return ret; | 130 | return ret; | |
128 | } | 131 | } | |
129 | 132 | |||
130 | static void | 133 | static void | |
131 | cycv_platform_init_attach_args(struct fdt_attach_args *faa) { | 134 | cycv_platform_init_attach_args(struct fdt_attach_args *faa) { | |
132 | faa->faa_bst = &armv7_generic_bs_tag; | 135 | faa->faa_bst = &armv7_generic_bs_tag; | |
133 | faa->faa_dmat = &arm_generic_dma_tag; | 136 | faa->faa_dmat = &arm_generic_dma_tag; | |
134 | } | 137 | } | |
135 | 138 | |||
136 | static void | 139 | static void | |
137 | cycv_platform_device_register(device_t dev, void *aux) { | 140 | cycv_platform_device_register(device_t dev, void *aux) { | |
138 | prop_dictionary_t dict = device_properties(dev); | 141 | prop_dictionary_t dict = device_properties(dev); |
--- src/sys/arch/arm/amlogic/meson_platform.c 2020/09/28 11:54:22 1.16
+++ src/sys/arch/arm/amlogic/meson_platform.c 2021/01/29 13:10:07 1.17
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: meson_platform.c,v 1.16 2020/09/28 11:54:22 jmcneill Exp $ */ | 1 | /* $NetBSD: meson_platform.c,v 1.17 2021/01/29 13:10:07 rin 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. | |
@@ -23,27 +23,27 @@ | @@ -23,27 +23,27 @@ | |||
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_soc.h" | 29 | #include "opt_soc.h" | |
30 | #include "opt_multiprocessor.h" | 30 | #include "opt_multiprocessor.h" | |
31 | #include "opt_console.h" | 31 | #include "opt_console.h" | |
32 | 32 | |||
33 | #include "arml2cc.h" | 33 | #include "arml2cc.h" | |
34 | 34 | |||
35 | #include <sys/cdefs.h> | 35 | #include <sys/cdefs.h> | |
36 | __KERNEL_RCSID(0, "$NetBSD: meson_platform.c,v 1.16 2020/09/28 11:54:22 jmcneill Exp $"); | 36 | __KERNEL_RCSID(0, "$NetBSD: meson_platform.c,v 1.17 2021/01/29 13:10:07 rin Exp $"); | |
37 | 37 | |||
38 | #include <sys/param.h> | 38 | #include <sys/param.h> | |
39 | #include <sys/bus.h> | 39 | #include <sys/bus.h> | |
40 | #include <sys/cpu.h> | 40 | #include <sys/cpu.h> | |
41 | #include <sys/device.h> | 41 | #include <sys/device.h> | |
42 | #include <sys/termios.h> | 42 | #include <sys/termios.h> | |
43 | 43 | |||
44 | #include <dev/fdt/fdtvar.h> | 44 | #include <dev/fdt/fdtvar.h> | |
45 | #include <arm/fdt/arm_fdtvar.h> | 45 | #include <arm/fdt/arm_fdtvar.h> | |
46 | 46 | |||
47 | #include <uvm/uvm_extern.h> | 47 | #include <uvm/uvm_extern.h> | |
48 | 48 | |||
49 | #include <machine/bootconfig.h> | 49 | #include <machine/bootconfig.h> | |
@@ -309,36 +309,39 @@ meson8b_platform_reset(void) | @@ -309,36 +309,39 @@ meson8b_platform_reset(void) | |||
309 | bus_space_handle_t bsh; | 309 | bus_space_handle_t bsh; | |
310 | 310 | |||
311 | bus_space_map(bst, MESON8B_WATCHDOG_BASE, MESON8B_WATCHDOG_SIZE, 0, &bsh); | 311 | bus_space_map(bst, MESON8B_WATCHDOG_BASE, MESON8B_WATCHDOG_SIZE, 0, &bsh); | |
312 | 312 | |||
313 | bus_space_write_4(bst, bsh, MESON8B_WATCHDOG_TC, | 313 | bus_space_write_4(bst, bsh, MESON8B_WATCHDOG_TC, | |
314 | MESON8B_WATCHDOG_TC_CPUS | MESON8B_WATCHDOG_TC_ENABLE | __SHIFTIN(0xfff, MESON8B_WATCHDOG_TC_TCNT)); | 314 | MESON8B_WATCHDOG_TC_CPUS | MESON8B_WATCHDOG_TC_ENABLE | __SHIFTIN(0xfff, MESON8B_WATCHDOG_TC_TCNT)); | |
315 | bus_space_write_4(bst, bsh, MESON8B_WATCHDOG_RESET, 0); | 315 | bus_space_write_4(bst, bsh, MESON8B_WATCHDOG_RESET, 0); | |
316 | 316 | |||
317 | for (;;) { | 317 | for (;;) { | |
318 | __asm("wfi"); | 318 | __asm("wfi"); | |
319 | } | 319 | } | |
320 | } | 320 | } | |
321 | 321 | |||
322 | #ifdef MULTIPROCESSOR | |||
322 | static void | 323 | static void | |
323 | meson8b_mpinit_delay(u_int n) | 324 | meson8b_mpinit_delay(u_int n) | |
324 | { | 325 | { | |
325 | for (volatile int i = 0; i < n; i++) | 326 | for (volatile int i = 0; i < n; i++) | |
326 | ; | 327 | ; | |
327 | } | 328 | } | |
329 | #endif | |||
328 | 330 | |||
329 | static int | 331 | static int | |
330 | cpu_enable_meson8b(int phandle) | 332 | cpu_enable_meson8b(int phandle) | |
331 | { | 333 | { | |
334 | #ifdef MULTIPROCESSOR | |||
332 | const bus_addr_t cbar = armreg_cbar_read(); | 335 | const bus_addr_t cbar = armreg_cbar_read(); | |
333 | bus_space_tag_t bst = &arm_generic_bs_tag; | 336 | bus_space_tag_t bst = &arm_generic_bs_tag; | |
334 | 337 | |||
335 | const bus_space_handle_t scu_bsh = | 338 | const bus_space_handle_t scu_bsh = | |
336 | cbar - MESON8B_ARM_PBASE + MESON8B_ARM_VBASE; | 339 | cbar - MESON8B_ARM_PBASE + MESON8B_ARM_VBASE; | |
337 | const bus_space_handle_t cpuconf_bsh = | 340 | const bus_space_handle_t cpuconf_bsh = | |
338 | MESON8B_SRAM_VBASE + MESON8B_SRAM_CPUCONF_OFFSET; | 341 | MESON8B_SRAM_VBASE + MESON8B_SRAM_CPUCONF_OFFSET; | |
339 | const bus_space_handle_t ao_bsh = | 342 | const bus_space_handle_t ao_bsh = | |
340 | MESON8B_AOBUS_VBASE + MESON8B_AOBUS_RTI_OFFSET; | 343 | MESON8B_AOBUS_VBASE + MESON8B_AOBUS_RTI_OFFSET; | |
341 | const bus_space_handle_t cbus_bsh = | 344 | const bus_space_handle_t cbus_bsh = | |
342 | MESON_CORE_APB3_VBASE + MESON_CBUS_OFFSET; | 345 | MESON_CORE_APB3_VBASE + MESON_CBUS_OFFSET; | |
343 | uint32_t pwr_sts, pwr_cntl0, pwr_cntl1, cpuclk, mempd0; | 346 | uint32_t pwr_sts, pwr_cntl0, pwr_cntl1, cpuclk, mempd0; | |
344 | uint64_t mpidr; | 347 | uint64_t mpidr; | |
@@ -386,26 +389,27 @@ cpu_enable_meson8b(int phandle) | @@ -386,26 +389,27 @@ cpu_enable_meson8b(int phandle) | |||
386 | pwr_cntl0 &= ~(1 << cpuno); | 389 | pwr_cntl0 &= ~(1 << cpuno); | |
387 | bus_space_write_4(bst, ao_bsh, MESON_AOBUS_PWR_CTRL0_REG, pwr_cntl0); | 390 | bus_space_write_4(bst, ao_bsh, MESON_AOBUS_PWR_CTRL0_REG, pwr_cntl0); | |
388 | 391 | |||
389 | cpuclk = bus_space_read_4(bst, cbus_bsh, MESON_CBUS_CPU_CLK_CNTL_REG); | 392 | cpuclk = bus_space_read_4(bst, cbus_bsh, MESON_CBUS_CPU_CLK_CNTL_REG); | |
390 | cpuclk &= ~(1 << (24 + cpuno)); | 393 | cpuclk &= ~(1 << (24 + cpuno)); | |
391 | bus_space_write_4(bst, cbus_bsh, MESON_CBUS_CPU_CLK_CNTL_REG, cpuclk); | 394 | bus_space_write_4(bst, cbus_bsh, MESON_CBUS_CPU_CLK_CNTL_REG, cpuclk); | |
392 | 395 | |||
393 | bus_space_write_4(bst, cpuconf_bsh, MESON8B_SRAM_CPUCONF_CPU_ADDR_REG(cpuno), | 396 | bus_space_write_4(bst, cpuconf_bsh, MESON8B_SRAM_CPUCONF_CPU_ADDR_REG(cpuno), | |
394 | KERN_VTOPHYS((vaddr_t)cpu_mpstart)); | 397 | KERN_VTOPHYS((vaddr_t)cpu_mpstart)); | |
395 | 398 | |||
396 | uint32_t ctrl = bus_space_read_4(bst, cpuconf_bsh, MESON8B_SRAM_CPUCONF_CTRL_REG); | 399 | uint32_t ctrl = bus_space_read_4(bst, cpuconf_bsh, MESON8B_SRAM_CPUCONF_CTRL_REG); | |
397 | ctrl |= __BITS(cpuno,0); | 400 | ctrl |= __BITS(cpuno,0); | |
398 | bus_space_write_4(bst, cpuconf_bsh, MESON8B_SRAM_CPUCONF_CTRL_REG, ctrl); | 401 | bus_space_write_4(bst, cpuconf_bsh, MESON8B_SRAM_CPUCONF_CTRL_REG, ctrl); | |
402 | #endif | |||
399 | 403 | |||
400 | return 0; | 404 | return 0; | |
401 | } | 405 | } | |
402 | 406 | |||
403 | ARM_CPU_METHOD(meson8b, "amlogic,meson8b-smp", cpu_enable_meson8b); | 407 | ARM_CPU_METHOD(meson8b, "amlogic,meson8b-smp", cpu_enable_meson8b); | |
404 | 408 | |||
405 | static int | 409 | static int | |
406 | meson8b_mpstart(void) | 410 | meson8b_mpstart(void) | |
407 | { | 411 | { | |
408 | int ret = 0; | 412 | int ret = 0; | |
409 | const bus_addr_t cbar = armreg_cbar_read(); | 413 | const bus_addr_t cbar = armreg_cbar_read(); | |
410 | bus_space_tag_t bst = &arm_generic_bs_tag; | 414 | bus_space_tag_t bst = &arm_generic_bs_tag; | |
411 | 415 |
--- src/sys/arch/arm/nxp/imx6_platform.c 2021/01/27 03:10:20 1.2
+++ src/sys/arch/arm/nxp/imx6_platform.c 2021/01/29 13:10:07 1.3
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: imx6_platform.c,v 1.2 2021/01/27 03:10:20 thorpej Exp $ */ | 1 | /* $NetBSD: imx6_platform.c,v 1.3 2021/01/29 13:10:07 rin 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_platform.c,v 1.2 2021/01/27 03:10:20 thorpej Exp $"); | 30 | __KERNEL_RCSID(0, "$NetBSD: imx6_platform.c,v 1.3 2021/01/29 13:10:07 rin Exp $"); | |
31 | 31 | |||
32 | #include "arml2cc.h" | 32 | #include "arml2cc.h" | |
33 | #include "opt_console.h" | 33 | #include "opt_console.h" | |
34 | #include "opt_fdt.h" | 34 | #include "opt_fdt.h" | |
35 | #include "opt_multiprocessor.h" | 35 | #include "opt_multiprocessor.h" | |
36 | #include "opt_soc.h" | 36 | #include "opt_soc.h" | |
37 | 37 | |||
38 | #include <sys/param.h> | 38 | #include <sys/param.h> | |
39 | #include <sys/bus.h> | 39 | #include <sys/bus.h> | |
40 | #include <sys/cpu.h> | 40 | #include <sys/cpu.h> | |
41 | #include <sys/device.h> | 41 | #include <sys/device.h> | |
42 | #include <sys/termios.h> | 42 | #include <sys/termios.h> | |
43 | 43 | |||
@@ -181,26 +181,28 @@ imx_platform_mpstart(void) | @@ -181,26 +181,28 @@ imx_platform_mpstart(void) | |||
181 | SRC_SCR_CORE3_ENABLE); | 181 | SRC_SCR_CORE3_ENABLE); | |
182 | bus_space_write_4(bst, bsh, SRC_SCR, srcctl); | 182 | bus_space_write_4(bst, bsh, SRC_SCR, srcctl); | |
183 | 183 | |||
184 | for (int i = 1; i < arm_cpu_max; i++) { | 184 | for (int i = 1; i < arm_cpu_max; i++) { | |
185 | bus_space_write_4(bst, bsh, SRC_GPRN_ENTRY(i), mpstart); | 185 | bus_space_write_4(bst, bsh, SRC_GPRN_ENTRY(i), mpstart); | |
186 | srcctl |= SRC_SCR_COREN_RST(i); | 186 | srcctl |= SRC_SCR_COREN_RST(i); | |
187 | srcctl |= SRC_SCR_COREN_ENABLE(i); | 187 | srcctl |= SRC_SCR_COREN_ENABLE(i); | |
188 | } | 188 | } | |
189 | bus_space_write_4(bst, bsh, SRC_SCR, srcctl); | 189 | bus_space_write_4(bst, bsh, SRC_SCR, srcctl); | |
190 | 190 | |||
191 | bus_space_unmap(bst, bsh, AIPS1_SRC_SIZE); | 191 | bus_space_unmap(bst, bsh, AIPS1_SRC_SIZE); | |
192 | 192 | |||
193 | return arm_fdt_cpu_mpstart(); | 193 | return arm_fdt_cpu_mpstart(); | |
194 | #else | |||
195 | return 0; | |||
194 | #endif | 196 | #endif | |
195 | } | 197 | } | |
196 | 198 | |||
197 | static void | 199 | static void | |
198 | imx6_platform_reset(void) | 200 | imx6_platform_reset(void) | |
199 | { | 201 | { | |
200 | bus_space_tag_t bst = &armv7_generic_bs_tag; | 202 | bus_space_tag_t bst = &armv7_generic_bs_tag; | |
201 | bus_space_handle_t bsh; | 203 | bus_space_handle_t bsh; | |
202 | 204 | |||
203 | if (bus_space_map(bst, IMX6_AIPS1_BASE + AIPS1_WDOG1_BASE, AIPS1_WDOG_SIZE, 0, &bsh)) | 205 | if (bus_space_map(bst, IMX6_AIPS1_BASE + AIPS1_WDOG1_BASE, AIPS1_WDOG_SIZE, 0, &bsh)) | |
204 | panic("couldn't map wdog1 registers"); | 206 | panic("couldn't map wdog1 registers"); | |
205 | 207 | |||
206 | delay(1000); /* wait for flushing FIFO of serial console */ | 208 | delay(1000); /* wait for flushing FIFO of serial console */ |
--- src/sys/arch/arm/ti/ti_gpio.c 2021/01/29 13:07:32 1.11
+++ src/sys/arch/arm/ti/ti_gpio.c 2021/01/29 13:10:07 1.12
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: ti_gpio.c,v 1.11 2021/01/29 13:07:32 rin Exp $ */ | 1 | /* $NetBSD: ti_gpio.c,v 1.12 2021/01/29 13:10:07 rin Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2019 Jared McNeill <jmcneill@invisible.ca> | 4 | * Copyright (c) 2019 Jared McNeill <jmcneill@invisible.ca> | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * Redistribution and use in source and binary forms, with or without | 7 | * Redistribution and use in source and binary forms, with or without | |
8 | * modification, are permitted provided that the following conditions | 8 | * modification, are permitted provided that the following conditions | |
9 | * are met: | 9 | * are met: | |
10 | * 1. Redistributions of source code must retain the above copyright | 10 | * 1. Redistributions of source code must retain the above copyright | |
11 | * notice, this list of conditions and the following disclaimer. | 11 | * notice, this list of conditions and the following disclaimer. | |
12 | * 2. Redistributions in binary form must reproduce the above copyright | 12 | * 2. Redistributions in binary form must reproduce the above copyright | |
13 | * notice, this list of conditions and the following disclaimer in the | 13 | * notice, this list of conditions and the following disclaimer in the | |
14 | * documentation and/or other materials provided with the distribution. | 14 | * documentation and/or other materials provided with the distribution. | |
@@ -17,35 +17,36 @@ | @@ -17,35 +17,36 @@ | |||
17 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | 17 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |
18 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | 18 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | |
19 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | 19 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | |
20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | |
21 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 21 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | |
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED | 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED | |
23 | * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | 23 | * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |
24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
25 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 25 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
26 | * SUCH DAMAGE. | 26 | * SUCH DAMAGE. | |
27 | */ | 27 | */ | |
28 | 28 | |||
29 | #include <sys/cdefs.h> | 29 | #include <sys/cdefs.h> | |
30 | __KERNEL_RCSID(0, "$NetBSD: ti_gpio.c,v 1.11 2021/01/29 13:07:32 rin Exp $"); | 30 | __KERNEL_RCSID(0, "$NetBSD: ti_gpio.c,v 1.12 2021/01/29 13:10:07 rin Exp $"); | |
31 | 31 | |||
32 | #include <sys/param.h> | 32 | #include <sys/param.h> | |
33 | #include <sys/bitops.h> | 33 | #include <sys/bitops.h> | |
34 | #include <sys/bus.h> | 34 | #include <sys/bus.h> | |
35 | #include <sys/device.h> | 35 | #include <sys/device.h> | |
36 | #include <sys/gpio.h> | 36 | #include <sys/gpio.h> | |
37 | #include <sys/intr.h> | 37 | #include <sys/intr.h> | |
38 | #include <sys/kmem.h> | 38 | #include <sys/kmem.h> | |
39 | #include <sys/lwp.h> | |||
39 | #include <sys/mutex.h> | 40 | #include <sys/mutex.h> | |
40 | #include <sys/systm.h> | 41 | #include <sys/systm.h> | |
41 | 42 | |||
42 | #include <dev/fdt/fdtvar.h> | 43 | #include <dev/fdt/fdtvar.h> | |
43 | #include <dev/gpio/gpiovar.h> | 44 | #include <dev/gpio/gpiovar.h> | |
44 | 45 | |||
45 | #include <arm/ti/ti_prcm.h> | 46 | #include <arm/ti/ti_prcm.h> | |
46 | 47 | |||
47 | #define TI_GPIO_NPINS 32 | 48 | #define TI_GPIO_NPINS 32 | |
48 | 49 | |||
49 | enum ti_gpio_type { | 50 | enum ti_gpio_type { | |
50 | TI_GPIO_OMAP3, | 51 | TI_GPIO_OMAP3, | |
51 | TI_GPIO_OMAP4, | 52 | TI_GPIO_OMAP4, |