Thu Mar 13 23:45:02 2014 UTC ()
Warn if a cpu failed to hatch.


(matt)
diff -r1.11 -r1.12 src/sys/arch/arm/allwinner/awin_board.c

cvs diff -r1.11 -r1.12 src/sys/arch/arm/allwinner/Attic/awin_board.c (expand / switch to unified diff)

--- src/sys/arch/arm/allwinner/Attic/awin_board.c 2014/03/07 16:38:28 1.11
+++ src/sys/arch/arm/allwinner/Attic/awin_board.c 2014/03/13 23:45:02 1.12
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: awin_board.c,v 1.11 2014/03/07 16:38:28 matt Exp $ */ 1/* $NetBSD: awin_board.c,v 1.12 2014/03/13 23:45:02 matt Exp $ */
2/*- 2/*-
3 * Copyright (c) 2012 The NetBSD Foundation, Inc. 3 * Copyright (c) 2012 The NetBSD Foundation, Inc.
4 * All rights reserved. 4 * All rights reserved.
5 * 5 *
6 * This code is derived from software contributed to The NetBSD Foundation 6 * This code is derived from software contributed to The NetBSD Foundation
7 * by Matt Thomas of 3am Software Foundry. 7 * by Matt Thomas of 3am Software Foundry.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright 14 * 2. Redistributions in binary form must reproduce the above copyright
@@ -24,27 +24,27 @@ @@ -24,27 +24,27 @@
24 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 * POSSIBILITY OF SUCH DAMAGE. 28 * POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31#include "opt_allwinner.h" 31#include "opt_allwinner.h"
32 32
33#define _ARM32_BUS_DMA_PRIVATE 33#define _ARM32_BUS_DMA_PRIVATE
34 34
35#include <sys/cdefs.h> 35#include <sys/cdefs.h>
36 36
37__KERNEL_RCSID(1, "$NetBSD: awin_board.c,v 1.11 2014/03/07 16:38:28 matt Exp $"); 37__KERNEL_RCSID(1, "$NetBSD: awin_board.c,v 1.12 2014/03/13 23:45:02 matt Exp $");
38 38
39#include <sys/param.h> 39#include <sys/param.h>
40#include <sys/bus.h> 40#include <sys/bus.h>
41#include <sys/cpu.h> 41#include <sys/cpu.h>
42#include <sys/device.h> 42#include <sys/device.h>
43 43
44#include <prop/proplib.h> 44#include <prop/proplib.h>
45 45
46#include <net/if.h> 46#include <net/if.h>
47#include <net/if_ether.h> 47#include <net/if_ether.h>
48 48
49#include <arm/locore.h> 49#include <arm/locore.h>
50 50
@@ -190,26 +190,34 @@ awin_bootstrap(vaddr_t iobase, vaddr_t u @@ -190,26 +190,34 @@ awin_bootstrap(vaddr_t iobase, vaddr_t u
190 AWIN_CPUCFG_OFFSET + AWIN_CPUCFG_CPU1_STATUS_REG); 190 AWIN_CPUCFG_OFFSET + AWIN_CPUCFG_CPU1_STATUS_REG);
191 printf("%s: cpu status: 0=%#x 1=%#x\n", __func__, s0, s1); 191 printf("%s: cpu status: 0=%#x 1=%#x\n", __func__, s0, s1);
192#endif 192#endif
193 193
194#if !defined(MULTIPROCESSOR) && defined(VERBOSE_ARM_INIT) 194#if !defined(MULTIPROCESSOR) && defined(VERBOSE_ARM_INIT)
195 u_int arm_cpu_max; 195 u_int arm_cpu_max;
196#endif 196#endif
197#if defined(MULTIPROCESSOR) || defined(VERBOSE_ARM_INIT) 197#if defined(MULTIPROCESSOR) || defined(VERBOSE_ARM_INIT)
198 arm_cpu_max = 1 + __SHIFTOUT(armreg_l2ctrl_read(), L2CTRL_NUMCPU); 198 arm_cpu_max = 1 + __SHIFTOUT(armreg_l2ctrl_read(), L2CTRL_NUMCPU);
199#endif 199#endif
200#ifdef VERBOSE_INIT_ARM 200#ifdef VERBOSE_INIT_ARM
201 printf("%s: %d cpus present\n", __func__, arm_cpu_max); 201 printf("%s: %d cpus present\n", __func__, arm_cpu_max);
202#endif 202#endif
 203#if defined(MULTIPROCESSOR)
 204 for (size_t i = 1; i < arm_cpu_max; i++) {
 205 if ((arm_cpu_hatched & (1 << i)) == 0) {
 206 printf("%s: warning: cpu%zu failed to hatch\n",
 207 __func__, i);
 208 }
 209 }
 210#endif
203} 211}
204 212
205void 213void
206awin_dma_bootstrap(psize_t psize) 214awin_dma_bootstrap(psize_t psize)
207{ 215{
208 awin_coherent_dma_ranges[0].dr_len = psize; 216 awin_coherent_dma_ranges[0].dr_len = psize;
209} 217}
210 218
211#ifdef MULTIPROCESSOR 219#ifdef MULTIPROCESSOR
212void 220void
213awin_cpu_hatch(struct cpu_info *ci) 221awin_cpu_hatch(struct cpu_info *ci)
214{ 222{
215 gtmr_init_cpu_clock(ci); 223 gtmr_init_cpu_clock(ci);