From owner-svn-src-head@freebsd.org Sat Jun 3 19:11:34 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E7B9BF784E; Sat, 3 Jun 2017 19:11:34 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0D7C27AF1D; Sat, 3 Jun 2017 19:11:33 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v53JBWsi075825; Sat, 3 Jun 2017 19:11:32 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v53JBWo0075807; Sat, 3 Jun 2017 19:11:32 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201706031911.v53JBWo0075807@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sat, 3 Jun 2017 19:11:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319552 - in head/sys/arm: conf xilinx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Jun 2017 19:11:34 -0000 Author: andrew Date: Sat Jun 3 19:11:32 2017 New Revision: 319552 URL: https://svnweb.freebsd.org/changeset/base/319552 Log: Port the Xilinx code to use PLATFORM and PLATFORM_SMP. This will help move it to be part of the armv6 GENERIC kernel. Added: head/sys/arm/xilinx/zy7_mp.h (contents, props changed) Modified: head/sys/arm/conf/ZEDBOARD head/sys/arm/xilinx/zy7_machdep.c head/sys/arm/xilinx/zy7_mp.c Modified: head/sys/arm/conf/ZEDBOARD ============================================================================== --- head/sys/arm/conf/ZEDBOARD Sat Jun 3 18:29:18 2017 (r319551) +++ head/sys/arm/conf/ZEDBOARD Sat Jun 3 19:11:32 2017 (r319552) @@ -27,6 +27,8 @@ include "../xilinx/std.zynq7" makeoptions MODULES_EXTRA="dtb/zynq" options SCHED_ULE # ULE scheduler +options PLATFORM # Platform based SoC +options PLATFORM_SMP #options NFSSD # Network Filesystem Server options SMP # Enable multiple cores Modified: head/sys/arm/xilinx/zy7_machdep.c ============================================================================== --- head/sys/arm/xilinx/zy7_machdep.c Sat Jun 3 18:29:18 2017 (r319551) +++ head/sys/arm/xilinx/zy7_machdep.c Sat Jun 3 19:11:32 2017 (r319552) @@ -33,6 +33,8 @@ * (v1.4) November 16, 2012. Xilinx doc UG585. */ +#include "opt_platform.h" + #include __FBSDID("$FreeBSD$"); @@ -47,41 +49,22 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include +#include "platform_if.h" + void (*zynq7_cpu_reset)(void); -vm_offset_t -platform_lastaddr(void) -{ - - return (devmap_lastaddr()); -} - -void -platform_probe_and_attach(void) -{ - -} - -void -platform_gpio_init(void) -{ -} - -void -platform_late_init(void) -{ -} - /* * Set up static device mappings. Not strictly necessary -- simplebus will * dynamically establish mappings as needed -- but doing it this way gets us * nice efficient 1MB section mappings. */ -int -platform_devmap_init(void) +static int +zynq7_devmap_init(platform_t plat) { devmap_add_entry(ZYNQ7_PSIO_HWBASE, ZYNQ7_PSIO_SIZE); @@ -90,8 +73,8 @@ platform_devmap_init(void) return (0); } -void -cpu_reset(void) +static void +zynq7_do_cpu_reset(platform_t plat) { if (zynq7_cpu_reset != NULL) (*zynq7_cpu_reset)(); @@ -100,3 +83,17 @@ cpu_reset(void) for (;;) ; } + +static platform_method_t zynq7_methods[] = { + PLATFORMMETHOD(platform_devmap_init, zynq7_devmap_init), + PLATFORMMETHOD(platform_cpu_reset, zynq7_do_cpu_reset), + +#ifdef SMP + PLATFORMMETHOD(platform_mp_setmaxid, zynq7_mp_setmaxid), + PLATFORMMETHOD(platform_mp_start_ap, zynq7_mp_start_ap), +#endif + + PLATFORMMETHOD_END, +}; + +FDT_PLATFORM_DEF(zynq7, "zynq7", 0, "xlnx,zynq-7000", 0); Modified: head/sys/arm/xilinx/zy7_mp.c ============================================================================== --- head/sys/arm/xilinx/zy7_mp.c Sat Jun 3 18:29:18 2017 (r319551) +++ head/sys/arm/xilinx/zy7_mp.c Sat Jun 3 19:11:32 2017 (r319552) @@ -22,6 +22,8 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include "opt_platform.h" + #include __FBSDID("$FreeBSD$"); #include @@ -38,7 +40,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #define ZYNQ7_CPU1_ENTRY 0xfffffff0 @@ -47,7 +51,7 @@ __FBSDID("$FreeBSD$"); #define SCU_CONTROL_ENABLE (1 << 0) void -platform_mp_setmaxid(void) +zynq7_mp_setmaxid(platform_t plat) { mp_maxid = 1; @@ -55,7 +59,7 @@ platform_mp_setmaxid(void) } void -platform_mp_start_ap(void) +zynq7_mp_start_ap(platform_t plat) { bus_space_handle_t scu_handle; bus_space_handle_t ocm_handle; Added: head/sys/arm/xilinx/zy7_mp.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/xilinx/zy7_mp.h Sat Jun 3 19:11:32 2017 (r319552) @@ -0,0 +1,34 @@ +/*- + * 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 ``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 _ZY7_MP_H_ +#define _ZY7_MP_H_ + +void zynq7_mp_setmaxid(platform_t); +void zynq7_mp_start_ap(platform_t); + +#endif /* _ZY7_MP_H_ */