From owner-svn-src-stable-10@FreeBSD.ORG Fri Feb 13 20:21:15 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 06C5ECBD; Fri, 13 Feb 2015 20:21:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 CC368642; Fri, 13 Feb 2015 20:21:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1DKLE2e072690; Fri, 13 Feb 2015 20:21:14 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1DKLEot072689; Fri, 13 Feb 2015 20:21:14 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201502132021.t1DKLEot072689@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Fri, 13 Feb 2015 20:21:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r278701 - stable/10/sys/arm/xilinx X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Feb 2015 20:21:15 -0000 Author: ian Date: Fri Feb 13 20:21:13 2015 New Revision: 278701 URL: https://svnweb.freebsd.org/changeset/base/278701 Log: MFC r277265: Enable the snoop control unit during MP startup Modified: stable/10/sys/arm/xilinx/zy7_mp.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/xilinx/zy7_mp.c ============================================================================== --- stable/10/sys/arm/xilinx/zy7_mp.c Fri Feb 13 20:18:29 2015 (r278700) +++ stable/10/sys/arm/xilinx/zy7_mp.c Fri Feb 13 20:21:13 2015 (r278701) @@ -39,6 +39,9 @@ __FBSDID("$FreeBSD$"); #define ZYNQ7_CPU1_ENTRY 0xfffffff0 +#define SCU_CONTROL_REG 0xf8f00000 +#define SCU_CONTROL_ENABLE (1 << 0) + void platform_mp_init_secondary(void) { @@ -64,7 +67,21 @@ platform_mp_probe(void) void platform_mp_start_ap(void) { + bus_space_handle_t scu_handle; bus_space_handle_t ocm_handle; + uint32_t scu_ctrl; + + /* Map in SCU control register. */ + if (bus_space_map(fdtbus_bs_tag, SCU_CONTROL_REG, 4, + 0, &scu_handle) != 0) + panic("platform_mp_start_ap: Couldn't map SCU config reg\n"); + + /* Set SCU enable bit. */ + scu_ctrl = bus_space_read_4(fdtbus_bs_tag, scu_handle, 0); + scu_ctrl |= SCU_CONTROL_ENABLE; + bus_space_write_4(fdtbus_bs_tag, scu_handle, 0, scu_ctrl); + + bus_space_unmap(fdtbus_bs_tag, scu_handle, 4); /* Map in magic location to give entry address to CPU1. */ if (bus_space_map(fdtbus_bs_tag, ZYNQ7_CPU1_ENTRY, 4, @@ -75,8 +92,10 @@ platform_mp_start_ap(void) bus_space_write_4(fdtbus_bs_tag, ocm_handle, 0, pmap_kextract((vm_offset_t)mpentry)); + bus_space_unmap(fdtbus_bs_tag, ocm_handle, 4); + /* - * The SCU is enabled by the BOOTROM but I think the second CPU doesn't + * The SCU is enabled above but I think the second CPU doesn't * turn on filtering until after the wake-up below. I think that's why * things don't work if I don't put these cache ops here. Also, the * magic location, 0xfffffff0, isn't in the SCU's filtering range so it @@ -87,8 +106,6 @@ platform_mp_start_ap(void) /* Wake up CPU1. */ armv7_sev(); - - bus_space_unmap(fdtbus_bs_tag, ocm_handle, 4); } void