From 0960989f8f276d6b166d550b2dfa400279884281 Mon Sep 17 00:00:00 2001 From: Andrew Turner Date: Fri, 17 Mar 2017 12:34:56 +0000 Subject: [PATCH] Move the IMX6 kernels to use PLATFORM_SMP. This is the last SMP config to be migrated to this and will allow the removal of this option. Reviewed by: ian Sponsored by: ABT Systems Ltd Differential Revision: https://reviews.freebsd.org/D9907 --- sys/arm/conf/IMX6 | 1 + sys/arm/freescale/imx/imx6_machdep.c | 7 ++++++ sys/arm/freescale/imx/imx6_mp.c | 10 +++++--- sys/arm/freescale/imx/imx6_mp.h | 35 ++++++++++++++++++++++++++++ 4 files changed, 50 insertions(+), 3 deletions(-) create mode 100644 sys/arm/freescale/imx/imx6_mp.h diff --git a/sys/arm/conf/IMX6 b/sys/arm/conf/IMX6 index f8340334f39..2bf9d181172 100644 --- a/sys/arm/conf/IMX6 +++ b/sys/arm/conf/IMX6 @@ -30,6 +30,7 @@ options SCHED_ULE # ULE scheduler #options NFSD # Network Filesystem Server options INCLUDE_CONFIG_FILE # Include this file in kernel options PLATFORM +options PLATFORM_SMP options SMP # Enable multiple cores # NFS root from boopt/dhcp diff --git a/sys/arm/freescale/imx/imx6_machdep.c b/sys/arm/freescale/imx/imx6_machdep.c index 25f6c1f7200..8d9513d7f15 100644 --- a/sys/arm/freescale/imx/imx6_machdep.c +++ b/sys/arm/freescale/imx/imx6_machdep.c @@ -50,6 +50,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include "platform_if.h" static uint32_t gpio1_node; @@ -346,6 +348,11 @@ static platform_method_t imx6_methods[] = { PLATFORMMETHOD(platform_late_init, imx6_late_init), PLATFORMMETHOD(platform_cpu_reset, imx6_cpu_reset), +#ifdef SMP + PLATFORMMETHOD(platform_mp_start_ap, imx6_mp_start_ap), + PLATFORMMETHOD(platform_mp_setmaxid, imx6_mp_setmaxid), +#endif + PLATFORMMETHOD_END, }; diff --git a/sys/arm/freescale/imx/imx6_mp.c b/sys/arm/freescale/imx/imx6_mp.c index 4010c3625e7..d26daab91f5 100644 --- a/sys/arm/freescale/imx/imx6_mp.c +++ b/sys/arm/freescale/imx/imx6_mp.c @@ -41,6 +41,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include + +#include #define SCU_PHYSBASE 0x00a00000 #define SCU_SIZE 0x00001000 @@ -67,7 +71,7 @@ __FBSDID("$FreeBSD$"); #define SRC_GPR1_C1ARG 0x24 /* Register for Core 1 entry arg */ void -platform_mp_setmaxid(void) +imx6_mp_setmaxid(platform_t plat) { bus_space_handle_t scu; int hwcpu, ncpu; @@ -92,8 +96,8 @@ platform_mp_setmaxid(void) mp_maxid = ncpu - 1; } -void -platform_mp_start_ap(void) +void +imx6_mp_start_ap(platform_t plat) { bus_space_handle_t scu; bus_space_handle_t src; diff --git a/sys/arm/freescale/imx/imx6_mp.h b/sys/arm/freescale/imx/imx6_mp.h new file mode 100644 index 00000000000..617ab8a0af2 --- /dev/null +++ b/sys/arm/freescale/imx/imx6_mp.h @@ -0,0 +1,35 @@ +/*- + * Copyright (c) 2017 Andrew Turner + * 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 + * 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 IMX6_MP_H +#define IMX6_MP_H + +void imx6_mp_start_ap(platform_t); +void imx6_mp_setmaxid(platform_t); + +#endif /* IMX6_MP_H */ -- 2.45.2