Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 16 Oct 2013 19:06:45 +0000 (UTC)
From:      Ian Lepore <ian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r256647 - head/sys/arm/arm
Message-ID:  <201310161906.r9GJ6jRx011405@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ian
Date: Wed Oct 16 19:06:44 2013
New Revision: 256647
URL: http://svnweb.freebsd.org/changeset/base/256647

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

Modified:
  head/sys/arm/arm/pl310.c

Modified: head/sys/arm/arm/pl310.c
==============================================================================
--- head/sys/arm/arm/pl310.c	Wed Oct 16 18:36:53 2013	(r256646)
+++ head/sys/arm/arm/pl310.c	Wed Oct 16 19:06:44 2013	(r256647)
@@ -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?201310161906.r9GJ6jRx011405>