Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/pmax/ibus Check presence of VFB01/VFB02 frame buffe...



details:   https://anonhg.NetBSD.org/src/rev/bcfea9ae1a1f
branches:  trunk
changeset: 358517:bcfea9ae1a1f
user:      flxd <flxd%NetBSD.org@localhost>
date:      Fri Jan 05 13:11:32 2018 +0000

description:
Check presence of VFB01/VFB02 frame buffer option on DEC(station|system) 3100.

diffstat:

 sys/arch/pmax/ibus/pm.c |  29 +++++++++++++++++++++++++++--
 1 files changed, 27 insertions(+), 2 deletions(-)

diffs (64 lines):

diff -r 55bbf6a6e549 -r bcfea9ae1a1f sys/arch/pmax/ibus/pm.c
--- a/sys/arch/pmax/ibus/pm.c   Fri Jan 05 10:04:13 2018 +0000
+++ b/sys/arch/pmax/ibus/pm.c   Fri Jan 05 13:11:32 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pm.c,v 1.13 2017/06/13 19:13:55 spz Exp $      */
+/*     $NetBSD: pm.c,v 1.14 2018/01/05 13:11:32 flxd Exp $     */
 
 /*-
  * Copyright (c) 2002, 2003 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pm.c,v 1.13 2017/06/13 19:13:55 spz Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pm.c,v 1.14 2018/01/05 13:11:32 flxd Exp $");
 
 #include <sys/param.h>
 #include <sys/buf.h>
@@ -90,6 +90,7 @@
 
 int    pm_match(device_t, cfdata_t, void *);
 void   pm_attach(device_t, device_t, void *);
+int    pm_check_vfb(void);
 int    pm_ioctl(void *, void *, u_long, void *, int, struct lwp *);
 paddr_t        pm_mmap(void *, void *, off_t, int);
 int    pm_alloc_screen(void *, const struct wsscreen_descr *,
@@ -174,6 +175,9 @@
        if (console) {
                sc->sc_nscreens = 1;
                ri->ri_flg &= ~RI_NO_AUTO;
+       } else if (!pm_check_vfb()) {
+               printf(": VFB01/VFB02 frame buffer option not found\n");
+               return;
        } else
                pm_common_init();
 
@@ -192,6 +196,27 @@
        config_found(self, &waa, wsemuldisplaydevprint);
 }
 
+int
+pm_check_vfb(void)
+{
+       int *mem;
+       const int magic = 0xcafebabe;
+
+       mem = (void *)MIPS_PHYS_TO_KSEG1(KN01_PHYS_FBUF_START);
+
+       *mem = magic;
+       wbflush();
+       if (*mem != magic)
+               return 0;
+
+       *mem = ~magic;
+       wbflush();
+       if (*mem != ~magic)
+               return 0;
+
+       return 1;
+}
+
 void
 pm_init_cmap(struct pm_softc *sc)
 {



Home | Main Index | Thread Index | Old Index