svn commit: r256647 - head/sys/arm/arm

Ian Lepore ian at FreeBSD.org
Wed Oct 16 19:06:45 UTC 2013


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)


More information about the svn-src-head mailing list