| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: bcm53xx_machdep.c,v 1.13 2018/08/04 21:59:28 skrll Exp $ */ | | 1 | /* $NetBSD: bcm53xx_machdep.c,v 1.14 2018/08/05 13:41:27 kre Exp $ */ |
2 | | | 2 | |
3 | /*- | | 3 | /*- |
4 | * Copyright (c) 2012 The NetBSD Foundation, Inc. | | 4 | * Copyright (c) 2012 The NetBSD Foundation, Inc. |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | * | | 6 | * |
7 | * This code is derived from software contributed to The NetBSD Foundation | | 7 | * This code is derived from software contributed to The NetBSD Foundation |
8 | * by Matt Thomas of 3am Software Foundry. | | 8 | * by Matt Thomas of 3am Software Foundry. |
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. |
| @@ -23,27 +23,27 @@ | | | @@ -23,27 +23,27 @@ |
23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | | 23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | | 24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | | 25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | | 26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | | 27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | | 28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
29 | * POSSIBILITY OF SUCH DAMAGE. | | 29 | * POSSIBILITY OF SUCH DAMAGE. |
30 | */ | | 30 | */ |
31 | | | 31 | |
32 | #define CCA_PRIVATE | | 32 | #define CCA_PRIVATE |
33 | #define IDM_PRIVATE | | 33 | #define IDM_PRIVATE |
34 | | | 34 | |
35 | #include <sys/cdefs.h> | | 35 | #include <sys/cdefs.h> |
36 | __KERNEL_RCSID(0, "$NetBSD: bcm53xx_machdep.c,v 1.13 2018/08/04 21:59:28 skrll Exp $"); | | 36 | __KERNEL_RCSID(0, "$NetBSD: bcm53xx_machdep.c,v 1.14 2018/08/05 13:41:27 kre Exp $"); |
37 | | | 37 | |
38 | #include "opt_arm_debug.h" | | 38 | #include "opt_arm_debug.h" |
39 | #include "opt_evbarm_boardtype.h" | | 39 | #include "opt_evbarm_boardtype.h" |
40 | #include "opt_broadcom.h" | | 40 | #include "opt_broadcom.h" |
41 | #include "opt_kgdb.h" | | 41 | #include "opt_kgdb.h" |
42 | #include "com.h" | | 42 | #include "com.h" |
43 | #include "pci.h" | | 43 | #include "pci.h" |
44 | #include "bcmrng_ccb.h" | | 44 | #include "bcmrng_ccb.h" |
45 | | | 45 | |
46 | #include <sys/param.h> | | 46 | #include <sys/param.h> |
47 | #include <sys/bus.h> | | 47 | #include <sys/bus.h> |
48 | #include <sys/atomic.h> | | 48 | #include <sys/atomic.h> |
49 | #include <sys/device.h> | | 49 | #include <sys/device.h> |
| @@ -85,26 +85,28 @@ static char bootargs[MAX_BOOT_STRING]; | | | @@ -85,26 +85,28 @@ static char bootargs[MAX_BOOT_STRING]; |
85 | char *boot_args = NULL; | | 85 | char *boot_args = NULL; |
86 | | | 86 | |
87 | /* filled in before cleaning bss. keep in .data */ | | 87 | /* filled in before cleaning bss. keep in .data */ |
88 | u_int uboot_args[4] __attribute__((__section__(".data"))); | | 88 | u_int uboot_args[4] __attribute__((__section__(".data"))); |
89 | | | 89 | |
90 | static void bcm53xx_system_reset(void); | | 90 | static void bcm53xx_system_reset(void); |
91 | | | 91 | |
92 | /* | | 92 | /* |
93 | * Macros to translate between physical and virtual for a subset of the | | 93 | * Macros to translate between physical and virtual for a subset of the |
94 | * kernel address space. *Not* for general use. | | 94 | * kernel address space. *Not* for general use. |
95 | */ | | 95 | */ |
96 | #define KERN_VTOPDIFF ((vaddr_t)KERNEL_BASE_phys - (vaddr_t)KERNEL_BASE_virt) | | 96 | #define KERN_VTOPDIFF ((vaddr_t)KERNEL_BASE_phys - (vaddr_t)KERNEL_BASE_virt) |
97 | | | 97 | |
| | | 98 | vaddr_t kern_vtopdiff; /*XXX should be in some header ?? XXX*/ |
| | | 99 | |
98 | #ifndef CONADDR | | 100 | #ifndef CONADDR |
99 | #define CONADDR (BCM53XX_IOREG_PBASE + CCA_UART0_BASE) | | 101 | #define CONADDR (BCM53XX_IOREG_PBASE + CCA_UART0_BASE) |
100 | #endif | | 102 | #endif |
101 | #ifndef CONSPEED | | 103 | #ifndef CONSPEED |
102 | #define CONSPEED B115200 | | 104 | #define CONSPEED B115200 |
103 | #endif | | 105 | #endif |
104 | #ifndef CONMODE | | 106 | #ifndef CONMODE |
105 | #define CONMODE ((TTYDEF_CFLAG & ~(CSIZE | CSTOPB | PARENB)) | CS8) /* 8N1 */ | | 107 | #define CONMODE ((TTYDEF_CFLAG & ~(CSIZE | CSTOPB | PARENB)) | CS8) /* 8N1 */ |
106 | #endif | | 108 | #endif |
107 | | | 109 | |
108 | #if (NCOM > 0) | | 110 | #if (NCOM > 0) |
109 | static const bus_addr_t comcnaddr = (bus_addr_t)CONADDR; | | 111 | static const bus_addr_t comcnaddr = (bus_addr_t)CONADDR; |
110 | | | 112 | |