summaryrefslogtreecommitdiffstats
path: root/sys/arm
diff options
context:
space:
mode:
authorian <ian@FreeBSD.org>2013-12-13 17:02:09 +0000
committerian <ian@FreeBSD.org>2013-12-13 17:02:09 +0000
commitde1f089de574ddd52ec8d1117ea25962f38e2da9 (patch)
tree8e01969ee0182aaee4dd1a80b867b9bd419ec3c4 /sys/arm
parentbe8c9bf1f0808be3f768dfe7dd6876e09347e38a (diff)
downloadFreeBSD-src-de1f089de574ddd52ec8d1117ea25962f38e2da9.zip
FreeBSD-src-de1f089de574ddd52ec8d1117ea25962f38e2da9.tar.gz
MFC r256647:
Invalidate the entire L2 cache before enabling it. Say whether it has been enabled or disabled.
Diffstat (limited to 'sys/arm')
-rw-r--r--sys/arm/arm/pl310.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/arm/arm/pl310.c b/sys/arm/arm/pl310.c
index 758b5e5..11ea5c7 100644
--- a/sys/arm/arm/pl310.c
+++ b/sys/arm/arm/pl310.c
@@ -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)
OpenPOWER on IntegriCloud