Convert the omap4 code to use PLATFORM_SMP.

This commit is contained in:
Olivier Houchard 2016-11-18 22:58:47 +00:00
parent 5f6bf12a3d
commit 44f0c15c6c
4 changed files with 45 additions and 2 deletions

View File

@ -34,6 +34,7 @@ makeoptions MODULES_EXTRA=dtb/omap4
options SCHED_ULE # ULE scheduler
options PLATFORM
options PLATFORM_SMP
options SMP # Enable multiple cores
# NFS root from boopt/dhcp

View File

@ -38,20 +38,24 @@ __FBSDID("$FreeBSD$");
#include <machine/smp.h>
#include <machine/fdt.h>
#include <machine/intr.h>
#include <machine/platformvar.h>
#include <arm/ti/ti_smc.h>
#include <arm/ti/omap4/omap4_smc.h>
#include <arm/ti/omap4/omap4_mp.h>
void
platform_mp_setmaxid(void)
omap4_mp_setmaxid(platform_t plat)
{
if (mp_ncpus != 0)
return;
mp_maxid = 1;
mp_ncpus = 2;
}
void
platform_mp_start_ap(void)
omap4_mp_start_ap(platform_t plat)
{
bus_addr_t scu_addr;

View File

@ -0,0 +1,33 @@
/*-
* Copyright (c) 2016 Olivier Houchard <cognet@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 ``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 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 _OMAP4_MP_H_
#define _OMAP4_MP_H_
void omap4_mp_setmaxid(platform_t plat);
void omap4_mp_start_ap(platform_t plat);
#endif /* _OMAP4_MP_H_ */

View File

@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$");
#include <machine/platformvar.h>
#include <arm/ti/omap4/omap4_reg.h>
#include <arm/ti/omap4/omap4_mp.h>
#include "platform_if.h"
@ -110,6 +111,10 @@ static platform_method_t omap4_methods[] = {
PLATFORMMETHOD(platform_lastaddr, ti_lastaddr),
PLATFORMMETHOD(platform_cpu_reset, ti_plat_cpu_reset),
#ifdef SMP
PLATFORMMETHOD(platform_mp_start_ap, omap4_mp_start_ap),
PLATFORMMETHOD(platform_mp_setmaxid, omap4_mp_setmaxid),
#endif
PLATFORMMETHOD_END,
};
FDT_PLATFORM_DEF(omap4, "omap4", 0, "ti,omap4430", 0);