Source-Changes-HG archive

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

[src/trunk]: src/sys/arch Add support pci_intr_setattr.



details:   https://anonhg.NetBSD.org/src/rev/26a3ec009cf3
branches:  trunk
changeset: 766439:26a3ec009cf3
user:      matt <matt%NetBSD.org@localhost>
date:      Wed Jun 22 18:06:32 2011 +0000

description:
Add support pci_intr_setattr.
Export non-inline version of pci api for modules (_MODULE is defined).
Fix definition of pc_conf_hook and pc_conf_interrupt.
Switch to using inlines instead of macros.
Switch ibm4xx to use <powerpc/pci_machdep.h>

diffstat:

 sys/arch/bebox/conf/files.bebox               |    5 +-
 sys/arch/bebox/include/pci_machdep.h          |    4 +-
 sys/arch/bebox/pci/pci_machdep.c              |    9 +-
 sys/arch/evbppc/conf/files.ev64260            |    3 +-
 sys/arch/evbppc/conf/files.mpc85xx            |    3 +-
 sys/arch/evbppc/conf/files.pmppc              |    3 +-
 sys/arch/evbppc/conf/std.obs405               |    4 +-
 sys/arch/evbppc/conf/std.walnut               |    4 +-
 sys/arch/evbppc/obs405/obs200_machdep.c       |   13 +-
 sys/arch/evbppc/obs405/obs266_machdep.c       |   23 +-
 sys/arch/evbppc/obs405/rbus_machdep.c         |   28 +--
 sys/arch/evbppc/pmppc/dev/mainbus.h           |    4 +-
 sys/arch/evbppc/pmppc/pci/pci_machdep.c       |   20 +-
 sys/arch/evbppc/walnut/machdep.c              |   20 +-
 sys/arch/evbppc/walnut/pci/pchb.c             |    5 +-
 sys/arch/ibmnws/conf/files.ibmnws             |    3 +-
 sys/arch/ibmnws/include/pci_machdep.h         |    5 +-
 sys/arch/ibmnws/pci/pci_machdep.c             |    5 +-
 sys/arch/macppc/conf/files.macppc             |    3 +-
 sys/arch/mvmeppc/conf/files.mvmeppc           |    3 +-
 sys/arch/mvmeppc/include/pci_machdep.h        |    4 +-
 sys/arch/mvmeppc/pci/pci_machdep.c            |    7 +-
 sys/arch/ofppc/conf/files.ofppc               |    3 +-
 sys/arch/powerpc/booke/pci/pq3pci.c           |   14 +-
 sys/arch/powerpc/conf/files.ibm4xx            |    4 +-
 sys/arch/powerpc/ibm4xx/dev/ibm405gp.c        |   59 ++++++-
 sys/arch/powerpc/ibm4xx/pci/pchb.c            |   46 ++---
 sys/arch/powerpc/ibm4xx/pci/pci_machdep.c     |   61 +------
 sys/arch/powerpc/include/ibm4xx/pci_machdep.h |   54 ++----
 sys/arch/powerpc/include/pci_machdep.h        |  196 ++++++++++++++++++++-----
 sys/arch/powerpc/marvell/pci_machdep.c        |   72 ++++----
 sys/arch/powerpc/pci/pci_machdep_common.c     |   34 +++-
 sys/arch/powerpc/pci/pci_machdep_ofw.c        |    8 +-
 sys/arch/prep/conf/files.prep                 |    3 +-
 sys/arch/prep/include/pci_machdep.h           |    4 +-
 sys/arch/prep/pci/pci_machdep.c               |   17 +-
 36 files changed, 433 insertions(+), 320 deletions(-)

diffs (truncated from 1830 to 300 lines):

diff -r 389dc716e07b -r 26a3ec009cf3 sys/arch/bebox/conf/files.bebox
--- a/sys/arch/bebox/conf/files.bebox   Wed Jun 22 18:03:30 2011 +0000
+++ b/sys/arch/bebox/conf/files.bebox   Wed Jun 22 18:06:32 2011 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.bebox,v 1.55 2010/10/16 05:59:35 kiyohara Exp $
+#      $NetBSD: files.bebox,v 1.56 2011/06/22 18:06:32 matt Exp $
 #
 # First try for bebox specific configuration info
 #
@@ -62,8 +62,9 @@
 #
 
 include "dev/pci/files.pci"
-file   arch/bebox/pci/pci_machdep.c    pci
+file   arch/bebox/pci/pci_machdep.c            pci
 file    arch/powerpc/pci/pci_machdep_common.c   pci
+file    arch/powerpc/pci/pci_module.c          pci & modular
 file    arch/powerpc/pci/pciconf_indirect.c     pci
 
 include "dev/pci/files.agp"
diff -r 389dc716e07b -r 26a3ec009cf3 sys/arch/bebox/include/pci_machdep.h
--- a/sys/arch/bebox/include/pci_machdep.h      Wed Jun 22 18:03:30 2011 +0000
+++ b/sys/arch/bebox/include/pci_machdep.h      Wed Jun 22 18:06:32 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pci_machdep.h,v 1.14 2008/04/28 20:23:15 martin Exp $  */
+/*     $NetBSD: pci_machdep.h,v 1.15 2011/06/22 18:06:32 matt Exp $    */
 
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -41,7 +41,7 @@
  * NOT TO BE USED DIRECTLY BY MACHINE INDEPENDENT CODE.
  */
 
-void bebox_pci_conf_interrupt(pci_chipset_tag_t, int, int, int, int, int *);
+void bebox_pci_conf_interrupt(void *, int, int, int, int, int *);
 void bebox_pci_get_chipset_tag(pci_chipset_tag_t);
 
 extern struct powerpc_bus_dma_tag pci_bus_dma_tag;
diff -r 389dc716e07b -r 26a3ec009cf3 sys/arch/bebox/pci/pci_machdep.c
--- a/sys/arch/bebox/pci/pci_machdep.c  Wed Jun 22 18:03:30 2011 +0000
+++ b/sys/arch/bebox/pci/pci_machdep.c  Wed Jun 22 18:06:32 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pci_machdep.c,v 1.18 2010/11/03 05:23:11 kiyohara Exp $        */
+/*     $NetBSD: pci_machdep.c,v 1.19 2011/06/22 18:06:32 matt Exp $    */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All rights reserved.
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pci_machdep.c,v 1.18 2010/11/03 05:23:11 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_machdep.c,v 1.19 2011/06/22 18:06:32 matt Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -86,6 +86,7 @@
        pc->pc_intr_evcnt = genppc_pci_intr_evcnt;
        pc->pc_intr_establish = genppc_pci_intr_establish;
        pc->pc_intr_disestablish = genppc_pci_intr_disestablish;
+       pc->pc_intr_setattr = genppc_pci_intr_setattr;
 
        pc->pc_conf_interrupt = bebox_pci_conf_interrupt;
        pc->pc_decompose_tag = genppc_pci_indirect_decompose_tag;
@@ -100,8 +101,8 @@
 }
 
 void
-bebox_pci_conf_interrupt(pci_chipset_tag_t pc, int bus, int dev, int pin,
-    int swiz, int *iline)
+bebox_pci_conf_interrupt(void *v, int bus, int dev, int pin, int swiz,
+    int *iline)
 {
 
        if (bus == 0) {
diff -r 389dc716e07b -r 26a3ec009cf3 sys/arch/evbppc/conf/files.ev64260
--- a/sys/arch/evbppc/conf/files.ev64260        Wed Jun 22 18:03:30 2011 +0000
+++ b/sys/arch/evbppc/conf/files.ev64260        Wed Jun 22 18:06:32 2011 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.ev64260,v 1.13 2010/04/28 13:51:56 kiyohara Exp $
+#      $NetBSD: files.ev64260,v 1.14 2011/06/22 18:06:32 matt Exp $
 #
 # Marvell (Galileo) "EV64260" evaluation board's specific configuration info
 #
@@ -52,6 +52,7 @@
 
 file   arch/powerpc/marvell/pci_machdep.c      pci
 file   arch/powerpc/pci/pci_machdep_common.c   pci
+file    arch/powerpc/pci/pci_module.c          pci & modular
 
 device pchb: pcibus
 attach pchb at pci
diff -r 389dc716e07b -r 26a3ec009cf3 sys/arch/evbppc/conf/files.mpc85xx
--- a/sys/arch/evbppc/conf/files.mpc85xx        Wed Jun 22 18:03:30 2011 +0000
+++ b/sys/arch/evbppc/conf/files.mpc85xx        Wed Jun 22 18:06:32 2011 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.mpc85xx,v 1.4 2011/05/02 01:45:26 matt Exp $
+#      $NetBSD: files.mpc85xx,v 1.5 2011/06/22 18:06:32 matt Exp $
 #
 # mpc85xx-specific configuration info
 
@@ -45,6 +45,7 @@
 attach pq3pci at cpunode with pq3pci_cpunode
 attach pq3pcie at cpunode with pq3pcie_cpunode
 file   arch/powerpc/booke/pci/pq3pci.c         pq3pci_cpunode | pq3pcie_cpunode
+file   arch/powerpc/pci/pci_module.c           pci & modular
 
 device mkclock: mk48txx
 attach mkclock at obio with ds1553rtc
diff -r 389dc716e07b -r 26a3ec009cf3 sys/arch/evbppc/conf/files.pmppc
--- a/sys/arch/evbppc/conf/files.pmppc  Wed Jun 22 18:03:30 2011 +0000
+++ b/sys/arch/evbppc/conf/files.pmppc  Wed Jun 22 18:06:32 2011 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.pmppc,v 1.5 2011/03/02 08:25:08 ahoka Exp $
+#      $NetBSD: files.pmppc,v 1.6 2011/06/22 18:06:32 matt Exp $
 #
 #
 maxpartitions 16
@@ -57,6 +57,7 @@
 include "dev/pci/files.pci"
 include "dev/pci/files.agp"
 file   arch/powerpc/pci/pci_machdep_common.c           pci
+file   arch/powerpc/pci/pci_module.c                   pci & modular
 file   arch/powerpc/pci/pciconf_indirect.c             pci
 file   arch/evbppc/pmppc/pci/pci_machdep.c             pci
 
diff -r 389dc716e07b -r 26a3ec009cf3 sys/arch/evbppc/conf/std.obs405
--- a/sys/arch/evbppc/conf/std.obs405   Wed Jun 22 18:03:30 2011 +0000
+++ b/sys/arch/evbppc/conf/std.obs405   Wed Jun 22 18:06:32 2011 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: std.obs405,v 1.5 2011/06/20 17:44:33 matt Exp $
+#      $NetBSD: std.obs405,v 1.6 2011/06/22 18:06:32 matt Exp $
 #
 # Standard/required options for NetBSD/obs405.
 
@@ -17,7 +17,7 @@
 makeoptions    PPCDIR="ibm4xx"
 
 options        PPC_INTR_IMPL="<powerpc/intr.h>"
-options        PPC_PCI_MACHDEP_IMPL="<powerpc/ibm4xx/pci_machdep.h>"
+options        PPC_PCI_MACHDEP_IMPL="<powerpc/pci_machdep.h>"
 
 options        INTSTK=16384
 options        SPILLSTK=1024
diff -r 389dc716e07b -r 26a3ec009cf3 sys/arch/evbppc/conf/std.walnut
--- a/sys/arch/evbppc/conf/std.walnut   Wed Jun 22 18:03:30 2011 +0000
+++ b/sys/arch/evbppc/conf/std.walnut   Wed Jun 22 18:06:32 2011 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: std.walnut,v 1.7 2011/06/20 17:44:33 matt Exp $
+#      $NetBSD: std.walnut,v 1.8 2011/06/22 18:06:32 matt Exp $
 #
 # Standard/required options for NetBSD/walnut.
 
@@ -18,7 +18,7 @@
 makeoptions    PPCDIR="ibm4xx"
 
 options        PPC_INTR_IMPL="<powerpc/intr.h>"
-options        PPC_PCI_MACHDEP_IMPL="<powerpc/ibm4xx/pci_machdep.h>"
+options        PPC_PCI_MACHDEP_IMPL="<powerpc/pci_machdep.h>"
 options        KERNBASE=0x25000
 
 options        INTSTK=16384
diff -r 389dc716e07b -r 26a3ec009cf3 sys/arch/evbppc/obs405/obs200_machdep.c
--- a/sys/arch/evbppc/obs405/obs200_machdep.c   Wed Jun 22 18:03:30 2011 +0000
+++ b/sys/arch/evbppc/obs405/obs200_machdep.c   Wed Jun 22 18:06:32 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: obs200_machdep.c,v 1.18 2011/06/20 17:44:33 matt Exp $ */
+/*     $NetBSD: obs200_machdep.c,v 1.19 2011/06/22 18:06:32 matt Exp $ */
 /*     Original: machdep.c,v 1.3 2005/01/17 17:24:09 shige Exp */
 
 /*
@@ -68,7 +68,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: obs200_machdep.c,v 1.18 2011/06/20 17:44:33 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: obs200_machdep.c,v 1.19 2011/06/22 18:06:32 matt Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_ddb.h"
@@ -96,6 +96,7 @@
 #include <powerpc/ibm4xx/cpu.h>
 #include <powerpc/ibm4xx/dcr4xx.h>
 #include <powerpc/ibm4xx/ibm405gp.h>
+#include <powerpc/ibm4xx/pci_machdep.h>
 #include <powerpc/ibm4xx/dev/comopbvar.h>
 
 #include <dev/ic/comreg.h>
@@ -304,7 +305,7 @@
 }
 
 int
-pci_bus_maxdevs(pci_chipset_tag_t pc, int busno)
+ibm4xx_pci_bus_maxdevs(void *v, int busno)
 {
 
        /*
@@ -315,7 +316,7 @@
 }
 
 int
-pci_intr_map(const struct pci_attach_args *pa, pci_intr_handle_t *ihp)
+ibm4xx_pci_intr_map(const struct pci_attach_args *pa, pci_intr_handle_t *ihp)
 {
        /*
         * We need to map the interrupt pin to the interrupt bit
@@ -377,8 +378,8 @@
 }
 
 void
-pci_conf_interrupt(pci_chipset_tag_t pc, int bus, int dev, int pin,
-                       int swiz, int *iline)
+ibm4xx_pci_conf_interrupt(void *v, int bus, int dev, int pin, int swiz,
+    int *iline)
 {
        static const int ilinemap[15/*device*/] = {
                -1, -1, -1, -1,         /* device  1 -  4 */
diff -r 389dc716e07b -r 26a3ec009cf3 sys/arch/evbppc/obs405/obs266_machdep.c
--- a/sys/arch/evbppc/obs405/obs266_machdep.c   Wed Jun 22 18:03:30 2011 +0000
+++ b/sys/arch/evbppc/obs405/obs266_machdep.c   Wed Jun 22 18:06:32 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: obs266_machdep.c,v 1.19 2011/06/20 17:44:33 matt Exp $ */
+/*     $NetBSD: obs266_machdep.c,v 1.20 2011/06/22 18:06:32 matt Exp $ */
 /*     Original: md_machdep.c,v 1.3 2005/01/24 18:47:37 shige Exp $    */
 
 /*
@@ -68,7 +68,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: obs266_machdep.c,v 1.19 2011/06/20 17:44:33 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: obs266_machdep.c,v 1.20 2011/06/22 18:06:32 matt Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_ddb.h"
@@ -91,9 +91,10 @@
 
 #include <powerpc/ibm4xx/dcr4xx.h>
 #include <powerpc/ibm4xx/cpu.h>
+#include <powerpc/ibm4xx/ibm405gp.h>
+#include <powerpc/ibm4xx/pci_machdep.h>
+#include <powerpc/ibm4xx/openbios.h>
 #include <powerpc/ibm4xx/dev/comopbvar.h>
-#include <powerpc/ibm4xx/ibm405gp.h>
-#include <powerpc/ibm4xx/openbios.h>
 
 #include <powerpc/spr.h>
 #include <powerpc/ibm4xx/spr.h>
@@ -295,7 +296,7 @@
 }
 
 int
-pci_bus_maxdevs(pci_chipset_tag_t pc, int busno)
+ibm4xx_pci_bus_maxdevs(void *v, int busno)
 {
 
        /*
@@ -306,7 +307,7 @@
 }
 
 int
-pci_intr_map(const struct pci_attach_args *pa, pci_intr_handle_t *ihp)
+ibm4xx_pci_intr_map(const struct pci_attach_args *pa, pci_intr_handle_t *ihp)
 {
        /*
         * We need to map the interrupt pin to the interrupt bit
@@ -359,18 +360,18 @@
 }
 
 void
-pci_conf_interrupt(pci_chipset_tag_t pc, int bus, int dev, int pin,
-                       int swiz, int *iline)
+ibm4xx_pci_conf_interrupt(void *v, int bus, int dev, int pin, int swiz,
+    int *iline)
 {
 
        static const int ilinemap[4/*device*/] = {
-               3, 4, 5 ,6
+               28, 29, 30, 31
        };
 
        if ((dev < 1) || (dev > 4)) {
-               printf("pci_intr_map: bad device %d\n", dev);
+               printf("%s: bad device %d\n", __func__, dev);
                *iline = 0;
                return;
        }
-       *iline = ilinemap[dev - 1] + 25;
+       *iline = ilinemap[dev - 1];
 }
diff -r 389dc716e07b -r 26a3ec009cf3 sys/arch/evbppc/obs405/rbus_machdep.c
--- a/sys/arch/evbppc/obs405/rbus_machdep.c     Wed Jun 22 18:03:30 2011 +0000
+++ b/sys/arch/evbppc/obs405/rbus_machdep.c     Wed Jun 22 18:06:32 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rbus_machdep.c,v 1.7 2011/06/18 06:44:26 matt Exp $    */
+/*     $NetBSD: rbus_machdep.c,v 1.8 2011/06/22 18:06:32 matt Exp $    */
 
 /*
  * Copyright (c) 2003
@@ -79,27 +79,17 @@



Home | Main Index | Thread Index | Old Index