Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci Add VGA 16bit decode bit into the PCI bridge con...



details:   https://anonhg.NetBSD.org/src/rev/80c6357dc43a
branches:  trunk
changeset: 828525:80c6357dc43a
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Mon Dec 18 04:48:28 2017 +0000

description:
Add VGA 16bit decode bit into the PCI bridge control register. This bit is
defined in PCI-to-PCI Bridge Architecture Specification Revision 1.2. This
bit has meaning if the VGA enable bit or the VGA Palette Snoop Enable bit is
set.

 NOTE: sys/arch/x86/pci/pci_ranges.c::mmio_range_extend_by_vga_enable() and/or
some other functions should be modified.

diffstat:

 sys/dev/pci/pci_subr.c |  16 ++++++++++++----
 sys/dev/pci/pcireg.h   |   4 ++--
 sys/dev/pci/ppbreg.h   |   3 ++-
 3 files changed, 16 insertions(+), 7 deletions(-)

diffs (86 lines):

diff -r cf92350428b5 -r 80c6357dc43a sys/dev/pci/pci_subr.c
--- a/sys/dev/pci/pci_subr.c    Mon Dec 18 04:11:46 2017 +0000
+++ b/sys/dev/pci/pci_subr.c    Mon Dec 18 04:48:28 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pci_subr.c,v 1.196 2017/10/25 08:21:41 msaitoh Exp $   */
+/*     $NetBSD: pci_subr.c,v 1.197 2017/12/18 04:48:28 msaitoh Exp $   */
 
 /*
  * Copyright (c) 1997 Zubin D. Dittia.  All rights reserved.
@@ -40,7 +40,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pci_subr.c,v 1.196 2017/10/25 08:21:41 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_subr.c,v 1.197 2017/12/18 04:48:28 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_pci.h"
@@ -4290,7 +4290,7 @@
     const pcireg_t *regs)
 {
        int off, width;
-       pcireg_t rval;
+       pcireg_t rval, csreg;
        uint32_t base, limit;
        uint32_t base_h, limit_h;
        uint64_t pbase, plimit;
@@ -4407,7 +4407,8 @@
        } else
                printf("      range: not set\n");
 
-       if (regs[o2i(PCI_COMMAND_STATUS_REG)] & PCI_STATUS_CAPLIST_SUPPORT)
+       csreg = regs[o2i(PCI_COMMAND_STATUS_REG)];
+       if (csreg & PCI_STATUS_CAPLIST_SUPPORT)
                printf("    Capability list pointer: 0x%02x\n",
                    PCI_CAPLIST_PTR(regs[o2i(PCI_CAPLISTPTR_REG)]));
        else
@@ -4449,6 +4450,13 @@
        onoff("Secondary SERR forwarding", rval, PCI_BRIDGE_CONTROL_SERR);
        onoff("ISA enable", rval, PCI_BRIDGE_CONTROL_ISA);
        onoff("VGA enable", rval, PCI_BRIDGE_CONTROL_VGA);
+       /*
+        * VGA 16bit decode bit has meaning if the VGA enable bit or the
+        * VGA Palette Snoop Enable bit is set.
+        */
+       if (((rval & PCI_BRIDGE_CONTROL_VGA) != 0)
+           || ((csreg & PCI_COMMAND_PALETTE_ENABLE) != 0))
+               onoff("VGA 16bit enable", rval, PCI_BRIDGE_CONTROL_VGA16);
        onoff("Master abort reporting", rval, PCI_BRIDGE_CONTROL_MABRT);
        onoff("Secondary bus reset", rval, PCI_BRIDGE_CONTROL_SECBR);
        onoff("Fast back-to-back capable", rval,PCI_BRIDGE_CONTROL_SECFASTB2B);
diff -r cf92350428b5 -r 80c6357dc43a sys/dev/pci/pcireg.h
--- a/sys/dev/pci/pcireg.h      Mon Dec 18 04:11:46 2017 +0000
+++ b/sys/dev/pci/pcireg.h      Mon Dec 18 04:48:28 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pcireg.h,v 1.135 2017/10/19 05:52:57 msaitoh Exp $     */
+/*     $NetBSD: pcireg.h,v 1.136 2017/12/18 04:48:28 msaitoh Exp $     */
 
 /*
  * Copyright (c) 1995, 1996, 1999, 2000
@@ -1327,7 +1327,7 @@
 #define   PCI_BRIDGE_CONTROL_SERR              (1 <<  1)
 #define   PCI_BRIDGE_CONTROL_ISA               (1 <<  2)
 #define   PCI_BRIDGE_CONTROL_VGA               (1 <<  3)
-/* Reserved                                    (1 <<  4) */
+#define   PCI_BRIDGE_CONTROL_VGA16             (1 <<  3)
 #define   PCI_BRIDGE_CONTROL_MABRT             (1 <<  5)
 #define   PCI_BRIDGE_CONTROL_SECBR             (1 <<  6)
 #define   PCI_BRIDGE_CONTROL_SECFASTB2B                (1 <<  7)
diff -r cf92350428b5 -r 80c6357dc43a sys/dev/pci/ppbreg.h
--- a/sys/dev/pci/ppbreg.h      Mon Dec 18 04:11:46 2017 +0000
+++ b/sys/dev/pci/ppbreg.h      Mon Dec 18 04:48:28 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ppbreg.h,v 1.7 2017/05/10 03:24:31 msaitoh Exp $       */
+/*     $NetBSD: ppbreg.h,v 1.8 2017/12/18 04:48:28 msaitoh Exp $       */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All rights reserved.
@@ -100,6 +100,7 @@
 #define PPB_BC_SERR_ENABLE                 (1U << (1 + PPB_BC_BITBASE))
 #define PPB_BC_ISA_ENABLE                  (1U << (2 + PPB_BC_BITBASE))
 #define PPB_BC_VGA_ENABLE                  (1U << (3 + PPB_BC_BITBASE))
+#define PPB_BC_VGA16_ENABLE                (1U << (3 + PPB_BC_BITBASE))
 #define PPB_BC_MASTER_ABORT_MODE           (1U << (5 + PPB_BC_BITBASE))
 #define PPB_BC_SECONDARY_RESET             (1U << (6 + PPB_BC_BITBASE))
 #define        PPB_BC_FAST_B2B_ENABLE             (1U << (7 + PPB_BC_BITBASE))



Home | Main Index | Thread Index | Old Index