From owner-svn-src-all@freebsd.org Tue Dec 13 11:43:47 2016 Return-Path: Delivered-To: svn-src-all@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 F2919C75E4D; Tue, 13 Dec 2016 11:43:47 +0000 (UTC) (envelope-from ganbold@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 CCF5610D3; Tue, 13 Dec 2016 11:43:47 +0000 (UTC) (envelope-from ganbold@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBDBhlcc089933; Tue, 13 Dec 2016 11:43:47 GMT (envelope-from ganbold@FreeBSD.org) Received: (from ganbold@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBDBhk32089928; Tue, 13 Dec 2016 11:43:46 GMT (envelope-from ganbold@FreeBSD.org) Message-Id: <201612131143.uBDBhk32089928@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ganbold set sender to ganbold@FreeBSD.org using -f From: Ganbold Tsagaankhuu Date: Tue, 13 Dec 2016 11:43:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310019 - in head/sys: arm/conf arm/rockchip conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Dec 2016 11:43:48 -0000 Author: ganbold Date: Tue Dec 13 11:43:46 2016 New Revision: 310019 URL: https://svnweb.freebsd.org/changeset/base/310019 Log: Switch Rockchip RK3188 SoC to use the platform code. Reviewed by: andrew, manu Differential Revision: https://reviews.freebsd.org/D8769 Added: head/sys/arm/rockchip/rk30xx_mp.h (contents, props changed) Modified: head/sys/arm/conf/RK3188 head/sys/arm/rockchip/rk30xx_machdep.c head/sys/arm/rockchip/rk30xx_mp.c head/sys/conf/options.arm Modified: head/sys/arm/conf/RK3188 ============================================================================== --- head/sys/arm/conf/RK3188 Tue Dec 13 10:03:29 2016 (r310018) +++ head/sys/arm/conf/RK3188 Tue Dec 13 11:43:46 2016 (r310019) @@ -23,8 +23,13 @@ ident RK3188 include "std.armv6" include "../rockchip/std.rk30xx" +options SOC_ROCKCHIP_RK3188 + options SCHED_ULE # ULE scheduler options SMP # Enable multiple cores +options PLATFORM +options PLATFORM_SMP +options MULTIDELAY # Root mount from MMC/SD card options ROOTDEVNAME=\"ufs:/dev/mmcsd0\" Modified: head/sys/arm/rockchip/rk30xx_machdep.c ============================================================================== --- head/sys/arm/rockchip/rk30xx_machdep.c Tue Dec 13 10:03:29 2016 (r310018) +++ head/sys/arm/rockchip/rk30xx_machdep.c Tue Dec 13 11:43:46 2016 (r310019) @@ -42,33 +42,25 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include -#include +#include +#include #include +#include -vm_offset_t -platform_lastaddr(void) -{ +#include "platform_if.h" - return (devmap_lastaddr()); -} - -void -platform_probe_and_attach(void) +static vm_offset_t +rk30xx_lastaddr(platform_t plat) { + return (devmap_lastaddr()); } -void -platform_gpio_init(void) -{ -} - -void -platform_late_init(void) +static void +rk30xx_late_init(platform_t plat) { /* Enable cache */ @@ -79,8 +71,8 @@ platform_late_init(void) /* * Set up static device mappings. */ -int -platform_devmap_init(void) +static int +rk30xx_devmap_init(platform_t plat) { devmap_add_entry(0x10000000, 0x00200000); @@ -89,11 +81,27 @@ platform_devmap_init(void) return (0); } -void -cpu_reset() +static void +rk30xx_cpu_reset() { rk30_wd_watchdog_reset(); printf("Reset failed!\n"); while (1); } + +#if defined(SOC_ROCKCHIP_RK3188) +static platform_method_t rk30xx_methods[] = { + PLATFORMMETHOD(platform_lastaddr, rk30xx_lastaddr), + PLATFORMMETHOD(platform_devmap_init, rk30xx_devmap_init), + PLATFORMMETHOD(platform_late_init, rk30xx_late_init), + PLATFORMMETHOD(platform_cpu_reset, rk30xx_cpu_reset), + +#ifdef SMP + PLATFORMMETHOD(platform_mp_start_ap, rk30xx_mp_start_ap), + PLATFORMMETHOD(platform_mp_setmaxid, rk30xx_mp_setmaxid), +#endif + PLATFORMMETHOD_END, +}; +FDT_PLATFORM_DEF(rk30xx, "RK3188", 0, "rockchip,rk3188", 200); +#endif Modified: head/sys/arm/rockchip/rk30xx_mp.c ============================================================================== --- head/sys/arm/rockchip/rk30xx_mp.c Tue Dec 13 10:03:29 2016 (r310018) +++ head/sys/arm/rockchip/rk30xx_mp.c Tue Dec 13 11:43:46 2016 (r310019) @@ -37,9 +37,13 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include +#include + +#include #define SCU_PHYSBASE 0x1013c000 #define SCU_SIZE 0x100 @@ -80,7 +84,7 @@ rk30xx_boot2(void) } void -platform_mp_setmaxid(void) +rk30xx_mp_setmaxid(platform_t plat) { bus_space_handle_t scu; int ncpu; @@ -101,7 +105,7 @@ platform_mp_setmaxid(void) } void -platform_mp_start_ap(void) +rk30xx_mp_start_ap(platform_t plat) { bus_space_handle_t scu; bus_space_handle_t imem; Added: head/sys/arm/rockchip/rk30xx_mp.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/rockchip/rk30xx_mp.h Tue Dec 13 11:43:46 2016 (r310019) @@ -0,0 +1,38 @@ +/*- + * Copyright (C) 2016 Ganbold Tsagaankhuu + * 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 _RK30XX_MP_H_ +#define _RK30XX_MP_H_ + +void rk30xx_mp_setmaxid(platform_t plat); +void rk30xx_mp_start_ap(platform_t plat); + +#endif /* _RK30XX_MP_H_ */ Modified: head/sys/conf/options.arm ============================================================================== --- head/sys/conf/options.arm Tue Dec 13 10:03:29 2016 (r310018) +++ head/sys/conf/options.arm Tue Dec 13 11:43:46 2016 (r310019) @@ -64,6 +64,7 @@ SOC_MV_LOKIPLUS opt_global.h SOC_MV_ORION opt_global.h SOC_OMAP3 opt_global.h SOC_OMAP4 opt_global.h +SOC_ROCKCHIP_RK3188 opt_global.h SOC_TI_AM335X opt_global.h SOC_TEGRA2 opt_global.h XSCALE_CACHE_READ_WRITE_ALLOCATE opt_global.h