on RPI2, fix compile failure without options MULTIPROCESSOR.

This commit is contained in:
ryo 2017-11-07 09:05:05 +00:00
parent 3ac55b05ee
commit 98f360edf4
2 changed files with 28 additions and 16 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: bcm2835_intr.c,v 1.13 2017/10/15 09:33:25 skrll Exp $ */
/* $NetBSD: bcm2835_intr.c,v 1.14 2017/11/07 09:05:05 ryo Exp $ */
/*-
* Copyright (c) 2012, 2015 The NetBSD Foundation, Inc.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: bcm2835_intr.c,v 1.13 2017/10/15 09:33:25 skrll Exp $");
__KERNEL_RCSID(0, "$NetBSD: bcm2835_intr.c,v 1.14 2017/11/07 09:05:05 ryo Exp $");
#define _INTR_PRIVATE
@ -204,10 +204,11 @@ bcm2835_icu_attach(device_t parent, device_t self, void *aux)
#if defined(BCM2836)
#if defined(MULTIPROCESSOR)
aprint_normal(": Multiprocessor");
#endif
bcm2836mp_intr_init(curcpu());
#else
pic_add(&bcm2836mp_pic[0], BCM2836_INT_BASECPUN(0));
#endif
#endif /* BCM2836 */
pic_add(sc->sc_pic, BCM2835_INT_BASE);
aprint_normal("\n");

View File

@ -1,4 +1,4 @@
/* $NetBSD: rpi_machdep.c,v 1.81 2017/11/04 14:47:06 jmcneill Exp $ */
/* $NetBSD: rpi_machdep.c,v 1.82 2017/11/07 09:05:05 ryo Exp $ */
/*-
* Copyright (c) 2012 The NetBSD Foundation, Inc.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: rpi_machdep.c,v 1.81 2017/11/04 14:47:06 jmcneill Exp $");
__KERNEL_RCSID(0, "$NetBSD: rpi_machdep.c,v 1.82 2017/11/07 09:05:05 ryo Exp $");
#include "opt_arm_debug.h"
#include "opt_bcm283x.h"
@ -38,6 +38,7 @@ __KERNEL_RCSID(0, "$NetBSD: rpi_machdep.c,v 1.81 2017/11/04 14:47:06 jmcneill Ex
#include "opt_ddb.h"
#include "opt_evbarm_boardtype.h"
#include "opt_kgdb.h"
#include "opt_multiprocessor.h"
#include "opt_rpi.h"
#include "opt_vcprop.h"
@ -448,7 +449,7 @@ static uint8_t cursor_mask[8 * 64], cursor_bitmap[8 * 64];
/*
* Return true if this model Raspberry Pi has Bluetooth/Wi-Fi support
*/
*/
static bool
rpi_rev_has_btwifi(uint32_t rev)
{
@ -584,7 +585,7 @@ rpi_bootparams(void)
size_t n = vcprop_tag_resplen(&vptp_mem->tag) /
sizeof(struct vcprop_memory);
bootconfig.dramblocks = 0;
bootconfig.dramblocks = 0;
for (int i = 0; i < n && i < DRAM_BLOCKS; i++) {
bootconfig.dram[i].address = vptp_mem->mem[i].base;
@ -626,22 +627,30 @@ rpi_bootparams(void)
static void
rpi_bootstrap(void)
{
#if defined(BCM2836)
arm_cpu_max = 4;
#ifdef BCM2836
#define RPI_CPU_MAX 4
#ifdef MULTIPROCESSOR
extern int cortex_mmuinfo;
arm_cpu_max = RPI_CPU_MAX;
cortex_mmuinfo = armreg_ttbr_read();
#ifdef VERBOSE_INIT_ARM
printf("%s: %d cpus present\n", __func__, arm_cpu_max);
#endif
cortex_mmuinfo = armreg_ttbr_read();
#ifdef VERBOSE_INIT_ARM
printf("%s: cortex_mmuinfo %x\n", __func__, cortex_mmuinfo);
#endif
#endif /* MULTIPROCESSOR */
/*
* Even if no options MULTIPROCESSOR,
* It is need to initialize the secondary CPU,
* and go into wfi loop (cortex_mpstart),
* otherwise system would be freeze...
*/
extern void cortex_mpstart(void);
for (size_t i = 1; i < arm_cpu_max; i++) {
for (size_t i = 1; i < RPI_CPU_MAX; i++) {
bus_space_tag_t iot = &bcm2835_bs_tag;
bus_space_handle_t ioh = BCM2836_ARM_LOCAL_VBASE;
@ -659,7 +668,9 @@ rpi_bootstrap(void)
break;
}
}
#endif /* BCM2836 */
#ifdef MULTIPROCESSOR
/* Wake up APs in case firmware has placed them in WFE state */
__asm __volatile("sev");
@ -675,7 +686,7 @@ rpi_bootstrap(void)
__func__, i);
}
}
#endif
#endif /* MULTIPROCESSOR */
}
/*