Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 13 Dec 2013 17:02:09 +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: r259313 - stable/10/sys/arm/arm
Message-ID:  <201312131702.rBDH29UB034208@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ian
Date: Fri Dec 13 17:02:09 2013
New Revision: 259313
URL: http://svnweb.freebsd.org/changeset/base/259313

Log:
  MFC r256647:
  
    Invalidate the entire L2 cache before enabling it.  Say whether it
    has been enabled or disabled.

Modified:
  stable/10/sys/arm/arm/pl310.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/arm/arm/pl310.c
==============================================================================
--- stable/10/sys/arm/arm/pl310.c	Fri Dec 13 17:00:25 2013	(r259312)
+++ stable/10/sys/arm/arm/pl310.c	Fri Dec 13 17:02:09 2013	(r259313)
@@ -341,8 +341,13 @@ pl310_attach(device_t dev)
 	ctrl_value = pl310_read4(sc, PL310_CTRL);
 
 	if (sc->sc_enabled && !(ctrl_value & CTRL_ENABLED)) {
+		/* invalidate current content */
+		pl310_write4(pl310_softc, PL310_INV_WAY, 0xffff);
+		pl310_wait_background_op(PL310_INV_WAY, 0xffff);
+
 		/* Enable the L2 cache if disabled */
 		platform_pl310_write_ctrl(sc, CTRL_ENABLED);
+		device_printf(dev, "L2 Cache enabled\n");
 	} 
 
 	if (!sc->sc_enabled && (ctrl_value & CTRL_ENABLED)) {
@@ -375,6 +380,7 @@ pl310_attach(device_t dev)
 		    EVENT_COUNTER_CTRL_C0_RESET | 
 		    EVENT_COUNTER_CTRL_C1_RESET);
 
+		device_printf(dev, "L2 Cache disabled\n");
 	}
 
 	if (sc->sc_enabled)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201312131702.rBDH29UB034208>