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 #endif +#include #include #include @@ -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);