aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/vt/hw
diff options
context:
space:
mode:
authorNathan Whitehorn <nwhitehorn@FreeBSD.org>2018-05-19 22:04:54 +0000
committerNathan Whitehorn <nwhitehorn@FreeBSD.org>2018-05-19 22:04:54 +0000
commit4f75b930073ea76db5cc9b51c996fc79e87342cb (patch)
tree27c43ce70f2871d5548c1d1a5529b638a5ba1bfb /sys/dev/vt/hw
parentba6ce3a34b268ffe40342dd6ad70cda223644952 (diff)
Notes
Diffstat (limited to 'sys/dev/vt/hw')
-rw-r--r--sys/dev/vt/hw/ofwfb/ofwfb.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/sys/dev/vt/hw/ofwfb/ofwfb.c b/sys/dev/vt/hw/ofwfb/ofwfb.c
index ab9c99d3fe3d..5d5f421ca9fb 100644
--- a/sys/dev/vt/hw/ofwfb/ofwfb.c
+++ b/sys/dev/vt/hw/ofwfb/ofwfb.c
@@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$");
#ifdef __sparc64__
#include <machine/bus_private.h>
#endif
+#include <machine/cpu.h>
#include <dev/ofw/openfirm.h>
#include <dev/ofw/ofw_bus.h>
@@ -138,6 +139,7 @@ ofwfb_bitblt_bitmap(struct vt_device *vd, const struct vt_window *vw,
if (pmap_bootstrapped) {
sc->fb_flags &= ~FB_FLAG_NOWRITE;
ofwfb_initialize(vd);
+ vd->vd_driver->vd_blank(vd, TC_BLACK);
} else {
return;
}
@@ -490,11 +492,6 @@ ofwfb_init(struct vt_device *vd)
OF_decode_addr(node, fb_phys, &sc->sc_memt, &sc->fb.fb_vbase,
NULL);
sc->fb.fb_pbase = sc->fb.fb_vbase & ~DMAP_BASE_ADDRESS;
- #ifdef __powerpc64__
- /* Real mode under a hypervisor probably doesn't cover FB */
- if (!(mfmsr() & (PSL_HV | PSL_DR)))
- sc->fb.fb_flags |= FB_FLAG_NOWRITE;
- #endif
#else
/* No ability to interpret assigned-addresses otherwise */
return (CN_DEAD);
@@ -502,6 +499,17 @@ ofwfb_init(struct vt_device *vd)
}
+ #if defined(__powerpc__)
+ /*
+ * If we are running on PowerPC in real mode (supported only on AIM
+ * CPUs), the frame buffer may be inaccessible (real mode does not
+ * necessarily cover all RAM) and may also be mapped with the wrong
+ * cache properties (all real mode accesses are assumed cacheable).
+ * Just don't write to it for the time being.
+ */
+ if (!(cpu_features & PPC_FEATURE_BOOKE) && !(mfmsr() & PSL_DR))
+ sc->fb.fb_flags |= FB_FLAG_NOWRITE;
+ #endif
ofwfb_initialize(vd);
vt_fb_init(vd);