Pass the interrupt swizzle down to the platforms' fixup functions.

N.B. Only using it on the ulmb60xa for now.
This commit is contained in:
kleink 2005-01-13 23:57:04 +00:00
parent 4880e83638
commit db5b1f2fa2
9 changed files with 52 additions and 51 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: platform.h,v 1.8 2004/06/26 21:51:04 kleink Exp $ */
/* $NetBSD: platform.h,v 1.9 2005/01/13 23:57:04 kleink Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -48,7 +48,7 @@ struct platform {
const char *model;
int (*match)(struct platform *);
void (*pci_get_chipset_tag)(pci_chipset_tag_t);
void (*pci_intr_fixup)(int, int, int *);
void (*pci_intr_fixup)(int, int, int, int *);
void (*init_intr)(void);
void (*cpu_setup)(struct device *);
void (*reset)(void);
@ -65,7 +65,7 @@ extern const char *obiodevs_nodev[];
int ident_platform(void);
int platform_generic_match(struct platform *);
void pci_intr_nofixup(int, int, int *);
void pci_intr_nofixup(int, int, int, int *);
void cpu_setup_unknown(struct device *);
void reset_unknown(void);
void reset_prep_generic(void);

View File

@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: pci_machdep.c,v 1.18 2003/07/15 02:54:51 lukem Exp $");
__KERNEL_RCSID(0, "$NetBSD: pci_machdep.c,v 1.19 2005/01/13 23:57:04 kleink Exp $");
#include <sys/types.h>
#include <sys/param.h>
@ -192,7 +192,7 @@ prep_pci_conf_interrupt(void *v, int bus, int dev, int pin,
int swiz, int *iline)
{
(*platform->pci_intr_fixup)(bus, dev, iline);
(*platform->pci_intr_fixup)(bus, dev, swiz, iline);
}
int

View File

@ -1,4 +1,4 @@
/* $NetBSD: ibm_6015.c,v 1.1 2004/06/26 21:51:04 kleink Exp $ */
/* $NetBSD: ibm_6015.c,v 1.2 2005/01/13 23:57:04 kleink Exp $ */
/*-
* Copyright (c) 2004 The NetBSD Foundation, Inc.
@ -41,7 +41,7 @@
#include <machine/intr.h>
#include <machine/platform.h>
void pci_intr_fixup_ibm_6015(int, int, int *);
void pci_intr_fixup_ibm_6015(int, int, int, int *);
struct platform platform_ibm_6015 = {
"IBM PPS Model 6015", /* model */
@ -55,7 +55,7 @@ struct platform platform_ibm_6015 = {
};
void
pci_intr_fixup_ibm_6015(int bus, int dev, int *line)
pci_intr_fixup_ibm_6015(int bus, int dev, int swiz, int *line)
{
if (bus != 0)
return;

View File

@ -1,4 +1,4 @@
/* $NetBSD: ibm_6040.c,v 1.3 2003/07/15 02:54:52 lukem Exp $ */
/* $NetBSD: ibm_6040.c,v 1.4 2005/01/13 23:57:04 kleink Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ibm_6040.c,v 1.3 2003/07/15 02:54:52 lukem Exp $");
__KERNEL_RCSID(0, "$NetBSD: ibm_6040.c,v 1.4 2005/01/13 23:57:04 kleink Exp $");
#include <sys/param.h>
@ -45,7 +45,7 @@ __KERNEL_RCSID(0, "$NetBSD: ibm_6040.c,v 1.3 2003/07/15 02:54:52 lukem Exp $");
#include <machine/platform.h>
/*
static void pci_intr_fixup_ibm_6040(int, int, int *);
static void pci_intr_fixup_ibm_6040(int, int, int, int *);
*/
static const char *obiodevs_ibm_6040[] = {
@ -56,7 +56,7 @@ struct platform platform_ibm_6040 = {
"IBM PPS Model 6040 (E)", /* model */
platform_generic_match, /* match */
prep_pci_get_chipset_tag_indirect, /* pci_get_chipset_tag */
pci_intr_nofixup, /* pci_intr_fixup */
pci_intr_nofixup, /* pci_intr_fixup */
init_intr_ivr, /* init_intr */
cpu_setup_ibm_generic, /* cpu_setup */
reset_prep_generic, /* reset */

View File

@ -1,4 +1,4 @@
/* $NetBSD: ibm_6050.c,v 1.7 2003/07/15 02:54:52 lukem Exp $ */
/* $NetBSD: ibm_6050.c,v 1.8 2005/01/13 23:57:04 kleink Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -37,14 +37,14 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ibm_6050.c,v 1.7 2003/07/15 02:54:52 lukem Exp $");
__KERNEL_RCSID(0, "$NetBSD: ibm_6050.c,v 1.8 2005/01/13 23:57:04 kleink Exp $");
#include <sys/param.h>
#include <machine/intr.h>
#include <machine/platform.h>
static void pci_intr_fixup_ibm_6050(int, int, int *);
static void pci_intr_fixup_ibm_6050(int, int, int, int *);
static const char *obiodevs_ibm_6050[] = {
"wdc",
@ -63,7 +63,7 @@ struct platform platform_ibm_6050 = {
};
static void
pci_intr_fixup_ibm_6050(int bus, int dev, int *line)
pci_intr_fixup_ibm_6050(int bus, int dev, int swiz, int *line)
{
if (bus != 0)
return;

View File

@ -1,4 +1,4 @@
/* $NetBSD: ibm_7043_140.c,v 1.2 2003/07/15 02:54:52 lukem Exp $ */
/* $NetBSD: ibm_7043_140.c,v 1.3 2005/01/13 23:57:04 kleink Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ibm_7043_140.c,v 1.2 2003/07/15 02:54:52 lukem Exp $");
__KERNEL_RCSID(0, "$NetBSD: ibm_7043_140.c,v 1.3 2005/01/13 23:57:04 kleink Exp $");
#include "opt_openpic.h"
#if !defined(OPENPIC)
@ -58,7 +58,7 @@ __KERNEL_RCSID(0, "$NetBSD: ibm_7043_140.c,v 1.2 2003/07/15 02:54:52 lukem Exp $
#include <dev/pci/pcireg.h>
#include <dev/pci/pcidevs.h>
void pci_intr_fixup_ibm_7043_140(int, int, int *);
void pci_intr_fixup_ibm_7043_140(int, int, int, int *);
void init_intr_mpic(void);
struct platform platform_ibm_7043_140 = {
@ -73,7 +73,7 @@ struct platform platform_ibm_7043_140 = {
};
void
pci_intr_fixup_ibm_7043_140(int bus, int dev, int *line)
pci_intr_fixup_ibm_7043_140(int bus, int dev, int swiz, int *line)
{
if (*line >= 1 && *line < OPENPIC_INTR_NUM - 3)

View File

@ -1,4 +1,4 @@
/* $NetBSD: ibm_7248.c,v 1.7 2003/07/15 02:54:52 lukem Exp $ */
/* $NetBSD: ibm_7248.c,v 1.8 2005/01/13 23:57:04 kleink Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -37,14 +37,14 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ibm_7248.c,v 1.7 2003/07/15 02:54:52 lukem Exp $");
__KERNEL_RCSID(0, "$NetBSD: ibm_7248.c,v 1.8 2005/01/13 23:57:04 kleink Exp $");
#include <sys/param.h>
#include <machine/intr.h>
#include <machine/platform.h>
static void pci_intr_fixup_ibm_7248(int, int, int *);
static void pci_intr_fixup_ibm_7248(int, int, int, int *);
struct platform platform_ibm_7248 = {
"IBM PPS Model 7248 (E)", /* model */
@ -58,7 +58,7 @@ struct platform platform_ibm_7248 = {
};
static void
pci_intr_fixup_ibm_7248(int bus, int dev, int *line)
pci_intr_fixup_ibm_7248(int bus, int dev, int swiz, int *line)
{
if (bus != 0)
return;

View File

@ -1,7 +1,7 @@
/* $NetBSD: mot_ulmb60xa.c,v 1.7 2003/07/15 02:54:52 lukem Exp $ */
/* $NetBSD: mot_ulmb60xa.c,v 1.8 2005/01/13 23:57:04 kleink Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
* Copyright (c) 2002, 2005 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: mot_ulmb60xa.c,v 1.7 2003/07/15 02:54:52 lukem Exp $");
__KERNEL_RCSID(0, "$NetBSD: mot_ulmb60xa.c,v 1.8 2005/01/13 23:57:04 kleink Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -75,7 +75,7 @@ __KERNEL_RCSID(0, "$NetBSD: mot_ulmb60xa.c,v 1.7 2003/07/15 02:54:52 lukem Exp $
static int mot_ulmb60xa_match(struct platform *);
static void pci_intr_fixup_mot_ulmb60xa(int, int, int *);
static void pci_intr_fixup_mot_ulmb60xa(int, int, int, int *);
struct platform platform_mot_ulmb60xa = {
"BULL ESTRELLA (e0) (e0)", /* model */ /* XXX */
@ -107,27 +107,28 @@ mot_ulmb60xa_match(struct platform *p)
}
static void
pci_intr_fixup_mot_ulmb60xa(int bus, int dev, int *line)
pci_intr_fixup_mot_ulmb60xa(int bus, int dev, int swiz, int *line)
{
if (bus != 0)
return;
switch (dev) {
case 12: /* NCR 53c810 */
*line = 11;
break;
case 14: /* DEC 21440 */
*line = 9;
break;
case 16: /* Slot #1 */
*line = 9;
break;
case 17: /* Slot #2 */
*line = 9;
break;
case 18: /* Slot #3 */
*line = 11;
break;
if (bus == 0) {
switch (dev) {
case 12: /* NCR 53c810 */
*line = 11;
break;
case 14: /* DEC 21440 */
*line = 9;
break;
case 16: /* Slot #1 */
*line = 9;
break;
case 17: /* Slot #2 */
*line = 9;
break;
case 18: /* Slot #3 */
*line = 11;
break;
}
} else {
*line = 9 + ((swiz + dev + 0) & 2);
}
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: platform.c,v 1.9 2003/07/15 02:54:53 lukem Exp $ */
/* $NetBSD: platform.c,v 1.10 2005/01/13 23:57:04 kleink Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: platform.c,v 1.9 2003/07/15 02:54:53 lukem Exp $");
__KERNEL_RCSID(0, "$NetBSD: platform.c,v 1.10 2005/01/13 23:57:04 kleink Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -114,7 +114,7 @@ platform_generic_match(struct platform *p)
/* ARGUSED */
void
pci_intr_nofixup(int busno, int device, int *intr)
pci_intr_nofixup(int busno, int device, int swiz, int *intr)
{
}