Date: Fri, 13 Feb 2015 20:21:14 +0000 (UTC) From: Ian Lepore <ian@FreeBSD.org> 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 Message-ID: <201502132021.t1DKLEot072689@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201502132021.t1DKLEot072689>