Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/macppc/pci special-case bus 0, now we find AGP devi...



details:   https://anonhg.NetBSD.org/src/rev/0029032e34f7
branches:  trunk
changeset: 321454:0029032e34f7
user:      macallan <macallan%NetBSD.org@localhost>
date:      Fri Mar 16 22:15:07 2018 +0000

description:
special-case bus 0, now we find AGP devices on G5

diffstat:

 sys/arch/macppc/pci/uninorth.c |  19 ++++++++++++++-----
 1 files changed, 14 insertions(+), 5 deletions(-)

diffs (55 lines):

diff -r f1279d82d7f1 -r 0029032e34f7 sys/arch/macppc/pci/uninorth.c
--- a/sys/arch/macppc/pci/uninorth.c    Fri Mar 16 22:11:53 2018 +0000
+++ b/sys/arch/macppc/pci/uninorth.c    Fri Mar 16 22:15:07 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uninorth.c,v 1.18 2015/10/02 05:22:51 msaitoh Exp $    */
+/*     $NetBSD: uninorth.c,v 1.19 2018/03/16 22:15:07 macallan Exp $   */
 
 /*-
  * Copyright (c) 2000 Tsubai Masanari.  All rights reserved.
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uninorth.c,v 1.18 2015/10/02 05:22:51 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uninorth.c,v 1.19 2018/03/16 22:15:07 macallan Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
@@ -287,7 +287,11 @@
 
        pci_decompose_tag(pc, tag, &bus, &dev, &func);
 
-       x = (bus << 16) | (dev << 11) | (func << 8) | (reg & 0xfc) | 1;
+       if (bus == 0) {
+               if (dev < 11) return 0xffffffff;
+               x = (1 << dev) | (func << 8) | reg;
+       } else
+               x = (bus << 16) | (dev << 11) | (func << 8) | (reg & 0xfc) | 1;
        /* Set extended register bits */
        x |= (reg >> 8) << 28;
 
@@ -296,8 +300,9 @@
        out32rb(pc->pc_addr, x);
        in32rb(pc->pc_addr);
        data = 0xffffffff;
-       if (!badaddr(daddr, 4))
+       if (!badaddr(daddr, 4)) {
                data = in32rb(daddr);
+       }
        out32rb(pc->pc_addr, 0);
        in32rb(pc->pc_addr);
        splx(s);
@@ -322,7 +327,11 @@
 
        pci_decompose_tag(pc, tag, &bus, &dev, &func);
 
-       x = (bus << 16) | (dev << 11) | (func << 8) | (reg & 0xfc) | 1;
+       if (bus == 0) {
+               if (dev < 11) return;
+               x = (1 << dev) | (func << 8) | reg;
+       } else
+               x = (bus << 16) | (dev << 11) | (func << 8) | (reg & 0xfc) | 1;
        /* Set extended register bits */
        x |= (reg >> 8) << 28;
 



Home | Main Index | Thread Index | Old Index