Invalidate the entire L2 cache before enabling it. Say whether it

has been enabled or disabled.
This commit is contained in:
Ian Lepore 2013-10-16 19:06:44 +00:00
parent cd1ab2280c
commit 78a60b7f95

View File

@ -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)