| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: amlogic_machdep.c,v 1.4 2015/02/27 19:57:10 jmcneill Exp $ */ | | 1 | /* $NetBSD: amlogic_machdep.c,v 1.5 2015/02/27 20:41:01 jmcneill Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Machine dependent functions for kernel setup for TI OSK5912 board. | | 4 | * Machine dependent functions for kernel setup for TI OSK5912 board. |
5 | * Based on lubbock_machdep.c which in turn was based on iq80310_machhdep.c | | 5 | * Based on lubbock_machdep.c which in turn was based on iq80310_machhdep.c |
6 | * | | 6 | * |
7 | * Copyright (c) 2002, 2003, 2005 Genetec Corporation. All rights reserved. | | 7 | * Copyright (c) 2002, 2003, 2005 Genetec Corporation. All rights reserved. |
8 | * Written by Hiroyuki Bessho for Genetec Corporation. | | 8 | * Written by Hiroyuki Bessho for Genetec Corporation. |
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. |
| @@ -115,27 +115,27 @@ | | | @@ -115,27 +115,27 @@ |
115 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | | 115 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
116 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | | 116 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
117 | * IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTERS BE LIABLE FOR ANY DIRECT, | | 117 | * IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTERS BE LIABLE FOR ANY DIRECT, |
118 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | | 118 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
119 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | | 119 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
120 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | | 120 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
121 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | | 121 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
122 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | | 122 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
123 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | | 123 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
124 | * SUCH DAMAGE. | | 124 | * SUCH DAMAGE. |
125 | */ | | 125 | */ |
126 | | | 126 | |
127 | #include <sys/cdefs.h> | | 127 | #include <sys/cdefs.h> |
128 | __KERNEL_RCSID(0, "$NetBSD: amlogic_machdep.c,v 1.4 2015/02/27 19:57:10 jmcneill Exp $"); | | 128 | __KERNEL_RCSID(0, "$NetBSD: amlogic_machdep.c,v 1.5 2015/02/27 20:41:01 jmcneill Exp $"); |
129 | | | 129 | |
130 | #include "opt_machdep.h" | | 130 | #include "opt_machdep.h" |
131 | #include "opt_ddb.h" | | 131 | #include "opt_ddb.h" |
132 | #include "opt_kgdb.h" | | 132 | #include "opt_kgdb.h" |
133 | #include "opt_ipkdb.h" | | 133 | #include "opt_ipkdb.h" |
134 | #include "opt_md.h" | | 134 | #include "opt_md.h" |
135 | #include "opt_amlogic.h" | | 135 | #include "opt_amlogic.h" |
136 | #include "opt_arm_debug.h" | | 136 | #include "opt_arm_debug.h" |
137 | | | 137 | |
138 | #include "amlogic_com.h" | | 138 | #include "amlogic_com.h" |
139 | #if 0 | | 139 | #if 0 |
140 | #include "prcm.h" | | 140 | #include "prcm.h" |
141 | #include "sdhc.h" | | 141 | #include "sdhc.h" |
| @@ -551,14 +551,23 @@ amlogic_device_register(device_t self, v | | | @@ -551,14 +551,23 @@ amlogic_device_register(device_t self, v |
551 | return; | | 551 | return; |
552 | } | | 552 | } |
553 | | | 553 | |
554 | /* | | 554 | /* |
555 | * We need to tell the A9 Global/Watchdog Timer | | 555 | * We need to tell the A9 Global/Watchdog Timer |
556 | * what frequency it runs at. | | 556 | * what frequency it runs at. |
557 | */ | | 557 | */ |
558 | if (device_is_a(self, "a9tmr") || device_is_a(self, "a9wdt")) { | | 558 | if (device_is_a(self, "a9tmr") || device_is_a(self, "a9wdt")) { |
559 | prop_dictionary_set_uint32(dict, "frequency", | | 559 | prop_dictionary_set_uint32(dict, "frequency", |
560 | 1600000000 / 2); | | 560 | 1600000000 / 2); |
561 | | | 561 | |
562 | return; | | 562 | return; |
563 | } | | 563 | } |
| | | 564 | |
| | | 565 | if (device_is_a(self, "arml2cc")) { |
| | | 566 | /* |
| | | 567 | * L2 cache regs are at C4200000 and A9 periph base is |
| | | 568 | * at C4300000; pass as a negative offset for the benefit |
| | | 569 | * of armperiph bus. |
| | | 570 | */ |
| | | 571 | prop_dictionary_set_uint32(dict, "offset", 0xfff00000); |
| | | 572 | } |
564 | } | | 573 | } |