Author: ian
Date: Fri Jan 16 19:49:10 2015
New Revision: 277265
URL: https://svnweb.freebsd.org/changeset/base/277265

Log:
  Enable the snoop control unit during MP startup, rather than relying on
  the bootloader to have done so.
  
  Submitted by: Thomas Skibo <thomassk...@sbcglobal.net>

Modified:
  head/sys/arm/xilinx/zy7_mp.c

Modified: head/sys/arm/xilinx/zy7_mp.c
==============================================================================
--- head/sys/arm/xilinx/zy7_mp.c        Fri Jan 16 19:38:24 2015        
(r277264)
+++ head/sys/arm/xilinx/zy7_mp.c        Fri Jan 16 19:49:10 2015        
(r277265)
@@ -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
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to