RPI2: Add support for PLATFORM_SMP so we can later add it to GENERIC.

Reviewed by:	andrew
Differential Revision:	https://reviews.freebsd.org/D8063
This commit is contained in:
Emmanuel Vadot 2016-09-29 06:54:02 +00:00
parent 0c051204d7
commit 10912ba837
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=306437
4 changed files with 50 additions and 2 deletions

View File

@ -58,6 +58,7 @@ __FBSDID("$FreeBSD$");
#include <dev/fdt/fdt_common.h>
#include <arm/broadcom/bcm2835/bcm2835_wdog.h>
#include <arm/broadcom/bcm2835/bcm2836_mp.h>
#include "platform_if.h"
@ -139,6 +140,11 @@ static platform_method_t bcm2836_methods[] = {
PLATFORMMETHOD(platform_late_init, bcm2835_late_init),
PLATFORMMETHOD(platform_cpu_reset, bcm2835_cpu_reset),
#ifdef SMP
PLATFORMMETHOD(platform_mp_start_ap, bcm2836_mp_start_ap),
PLATFORMMETHOD(platform_mp_setmaxid, bcm2836_mp_setmaxid),
#endif
PLATFORMMETHOD_END,
};
FDT_PLATFORM_DEF(bcm2836, "bcm2836", 0, "brcm,bcm2709", 0);

View File

@ -45,6 +45,9 @@ __FBSDID("$FreeBSD$");
#include <machine/bus.h>
#include <machine/fdt.h>
#include <machine/intr.h>
#include <machine/platformvar.h>
#include <arm/broadcom/bcm2835/bcm2836_mp.h>
#ifdef DEBUG
#define DPRINTF(fmt, ...) do { \
@ -77,7 +80,7 @@ static bus_space_handle_t bs_periph;
bus_space_write_4(fdtbus_bs_tag, bs_periph, (addr), (val))
void
platform_mp_setmaxid(void)
bcm2836_mp_setmaxid(platform_t plat)
{
DPRINTF("platform_mp_setmaxid\n");
@ -90,7 +93,7 @@ platform_mp_setmaxid(void)
}
void
platform_mp_start_ap(void)
bcm2836_mp_start_ap(platform_t plat)
{
uint32_t val;
int i, retry;

View File

@ -0,0 +1,38 @@
/*-
* Copyright (C) 2016 Emmanuel Vadot <manu@freebsd.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $FreeBSD$
*/
#ifndef _BCM2836_MP_H_
#define _BCM2836_MP_H_
void bcm2836_mp_setmaxid(platform_t plat);
void bcm2836_mp_start_ap(platform_t plat);
#endif /* _BCM2836_MP_H_ */

View File

@ -29,6 +29,7 @@ options INTRNG
options SCHED_ULE # ULE scheduler
options SMP # Enable multiple cores
options PLATFORM
options PLATFORM_SMP
# NFS root from boopt/dhcp
#options BOOTP