Move ms-IIep PCIC driver into mspcic0 at msiiep0. msiiep0 now serves
as a stub bus that knows how to attach drivers for various functions of PCIC. This change is a follow up to timer0 at msiiep0 change, since all children must share same attach arguments and so we no longer can attach pci0 directly under msiiep0.
This commit is contained in:
parent
2e2ba05d0d
commit
788d7bdd8f
|
@ -1,4 +1,4 @@
|
|||
# $NetBSD: KRUPS,v 1.4 2002/03/28 11:55:25 pk Exp $
|
||||
# $NetBSD: KRUPS,v 1.5 2002/03/28 19:50:20 uwe Exp $
|
||||
# From: NetBSD: GENERIC,v 1.131 2002/02/10 17:37:02 wiz Exp
|
||||
#
|
||||
# Krups (JavaStation 10, aka JavaStation NC) machine description file
|
||||
|
@ -8,7 +8,7 @@
|
|||
|
||||
include "arch/sparc/conf/std.sparc"
|
||||
|
||||
#ident "KRUPS-$Revision: 1.4 $"
|
||||
#ident "KRUPS-$Revision: 1.5 $"
|
||||
|
||||
maxusers 32
|
||||
|
||||
|
@ -97,7 +97,7 @@ options DDB_ONPANIC=1 # see also sysctl(8): `ddb.onpanic'
|
|||
## such that gdb(1) can be used on a kernel coredump.
|
||||
|
||||
#makeoptions DEBUG="-g"
|
||||
makeoptions COPTS="-pipe -mv8 -O2"
|
||||
makeoptions COPTS="-pipe -mcpu=supersparc -O2"
|
||||
|
||||
|
||||
## Adds code to the kernel that does internal consistency checks, and will
|
||||
|
@ -199,7 +199,8 @@ cpu0 at mainbus0
|
|||
|
||||
msiiep0 at mainbus0 # microSPARC-IIep PCIC, timer, ...
|
||||
|
||||
pci0 at msiiep0
|
||||
mspcic0 at msiiep0 # PCI tree
|
||||
pci0 at mspcic0
|
||||
options PCIVERBOSE
|
||||
#options PCI_CONFIG_DUMP # hangs reading IGA1682 config past offset 64
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# $NetBSD: files.sparc,v 1.109 2002/03/28 11:54:16 pk Exp $
|
||||
# $NetBSD: files.sparc,v 1.110 2002/03/28 19:50:20 uwe Exp $
|
||||
|
||||
# @(#)files.sparc 8.1 (Berkeley) 7/19/93
|
||||
# sparc-specific configuration info
|
||||
|
@ -18,12 +18,15 @@ maxusers 2 8 1024
|
|||
device mainbus {}
|
||||
attach mainbus at root
|
||||
|
||||
device msiiep {}
|
||||
attach msiiep at mainbus
|
||||
|
||||
include "dev/i2o/files.i2o"
|
||||
include "dev/pci/files.pci"
|
||||
device msiiep {}: pcibus
|
||||
attach msiiep at mainbus
|
||||
file arch/sparc/sparc/msiiep.c msiiep
|
||||
file arch/sparc/sparc/pci_machdep.c msiiep
|
||||
device mspcic {}: pcibus
|
||||
attach mspcic at msiiep
|
||||
file arch/sparc/sparc/msiiep.c msiiep | mspcic
|
||||
file arch/sparc/sparc/pci_machdep.c msiiep | mspcic
|
||||
|
||||
device ebus {[addr = -1]}: pcibus
|
||||
attach ebus at pci
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: autoconf.c,v 1.166 2002/03/28 16:03:41 pk Exp $ */
|
||||
/* $NetBSD: autoconf.c,v 1.167 2002/03/28 19:50:21 uwe Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1996
|
||||
|
@ -1631,7 +1631,7 @@ static struct {
|
|||
{ "xdc", BUSCLASS_XDC },
|
||||
{ "xyc", BUSCLASS_XYC },
|
||||
{ "fdc", BUSCLASS_FDC },
|
||||
{ "msiiep", BUSCLASS_PCIC },
|
||||
{ "mspcic", BUSCLASS_PCIC },
|
||||
{ "pci", BUSCLASS_PCI },
|
||||
};
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: msiiep.c,v 1.5 2002/03/28 11:59:56 pk Exp $ */
|
||||
/* $NetBSD: msiiep.c,v 1.6 2002/03/28 19:50:21 uwe Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2001 Valeriy E. Ushakov
|
||||
|
@ -51,7 +51,7 @@
|
|||
/**
|
||||
* ms-IIep PCIC registers are mapped at fixed VA
|
||||
*/
|
||||
#define msiiep ((volatile struct msiiep_pcic_reg *)MSIIEP_PCIC_VA)
|
||||
#define mspcic ((volatile struct msiiep_pcic_reg *)MSIIEP_PCIC_VA)
|
||||
|
||||
|
||||
/**
|
||||
|
@ -62,17 +62,17 @@
|
|||
/*
|
||||
* PCI chipset tag
|
||||
*/
|
||||
static struct sparc_pci_chipset msiiep_pc_tag = { NULL };
|
||||
static struct sparc_pci_chipset mspcic_pc_tag = { NULL };
|
||||
|
||||
|
||||
/*
|
||||
* Bus space tags for memory and i/o.
|
||||
*/
|
||||
|
||||
static void *msiiep_intr_establish(bus_space_tag_t, int, int, int,
|
||||
static void *mspcic_intr_establish(bus_space_tag_t, int, int, int,
|
||||
int (*)(void *), void *);
|
||||
|
||||
static struct sparc_bus_space_tag msiiep_io_tag = {
|
||||
static struct sparc_bus_space_tag mspcic_io_tag = {
|
||||
NULL, /* cookie */
|
||||
NULL, /* parent bus tag */
|
||||
NULL, /* bus_space_map */
|
||||
|
@ -80,10 +80,10 @@ static struct sparc_bus_space_tag msiiep_io_tag = {
|
|||
NULL, /* bus_space_subregion */
|
||||
NULL, /* bus_space_barrier */
|
||||
NULL, /* bus_space_mmap */
|
||||
msiiep_intr_establish /* bus_intr_establish */
|
||||
mspcic_intr_establish /* bus_intr_establish */
|
||||
};
|
||||
|
||||
static struct sparc_bus_space_tag msiiep_mem_tag = {
|
||||
static struct sparc_bus_space_tag mspcic_mem_tag = {
|
||||
NULL, /* cookie */
|
||||
NULL, /* parent bus tag */
|
||||
NULL, /* bus_space_map */
|
||||
|
@ -91,52 +91,74 @@ static struct sparc_bus_space_tag msiiep_mem_tag = {
|
|||
NULL, /* bus_space_subregion */
|
||||
NULL, /* bus_space_barrier */
|
||||
NULL, /* bus_space_mmap */
|
||||
msiiep_intr_establish /* bus_intr_establish */
|
||||
mspcic_intr_establish /* bus_intr_establish */
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* DMA tag
|
||||
*/
|
||||
static int msiiep_dmamap_load(bus_dma_tag_t, bus_dmamap_t,
|
||||
static int mspcic_dmamap_load(bus_dma_tag_t, bus_dmamap_t,
|
||||
void *, bus_size_t, struct proc *, int);
|
||||
static void msiiep_dmamap_unload(bus_dma_tag_t, bus_dmamap_t);
|
||||
static int msiiep_dmamem_map(bus_dma_tag_t, bus_dma_segment_t *,
|
||||
static void mspcic_dmamap_unload(bus_dma_tag_t, bus_dmamap_t);
|
||||
static int mspcic_dmamem_map(bus_dma_tag_t, bus_dma_segment_t *,
|
||||
int, size_t, caddr_t *, int);
|
||||
|
||||
static struct sparc_bus_dma_tag msiiep_dma_tag = {
|
||||
static struct sparc_bus_dma_tag mspcic_dma_tag = {
|
||||
NULL, /* _cookie */
|
||||
|
||||
_bus_dmamap_create,
|
||||
_bus_dmamap_destroy,
|
||||
msiiep_dmamap_load,
|
||||
mspcic_dmamap_load,
|
||||
_bus_dmamap_load_mbuf,
|
||||
_bus_dmamap_load_uio,
|
||||
_bus_dmamap_load_raw,
|
||||
msiiep_dmamap_unload,
|
||||
mspcic_dmamap_unload,
|
||||
_bus_dmamap_sync,
|
||||
|
||||
_bus_dmamem_alloc,
|
||||
_bus_dmamem_free,
|
||||
msiiep_dmamem_map,
|
||||
mspcic_dmamem_map,
|
||||
_bus_dmamem_unmap,
|
||||
_bus_dmamem_mmap
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* Autoconfiguration
|
||||
* Autoconfiguration.
|
||||
*
|
||||
* Normally, sparc autoconfiguration is driven by PROM device tree,
|
||||
* however PROMs in ms-IIep machines usually don't have nodes for
|
||||
* various important registers that are part of ms-IIep PCI controller.
|
||||
* We work around by inserting a dummy device that acts as a parent
|
||||
* for device drivers that deal with various functions of PCIC. The
|
||||
* other option is to hack mainbus_attach() to treat ms-IIep specially,
|
||||
* but I'd rather insulate the rest of the source from ms-IIep quirks.
|
||||
*/
|
||||
|
||||
/* parent "stub" device that knows how to attach various functions */
|
||||
static int msiiep_match(struct device *, struct cfdata *, void *);
|
||||
static void msiiep_attach(struct device *, struct device *, void *);
|
||||
static int msiiep_print(void *, const char *);
|
||||
/* static int msiiep_print(void *, const char *); */
|
||||
|
||||
struct cfattach msiiep_ca = {
|
||||
sizeof(struct msiiep_softc), msiiep_match, msiiep_attach
|
||||
sizeof(struct device), msiiep_match, msiiep_attach
|
||||
};
|
||||
|
||||
|
||||
/* Auxiliary functions */
|
||||
/*
|
||||
* The real thing.
|
||||
*/
|
||||
static int mspcic_match(struct device *, struct cfdata *, void *);
|
||||
static void mspcic_attach(struct device *, struct device *, void *);
|
||||
static int mspcic_print(void *, const char *);
|
||||
|
||||
struct cfattach mspcic_ca = {
|
||||
sizeof(struct mspcic_softc), mspcic_match, mspcic_attach
|
||||
};
|
||||
|
||||
|
||||
static struct idprom msiiep_idprom_store;
|
||||
static void msiiep_getidprom(void);
|
||||
|
||||
|
||||
|
@ -160,7 +182,7 @@ msiiep_match(parent, cf, aux)
|
|||
* bootstrap code maps them at a fixed va, MSIIEP_PCIC_VA, and
|
||||
* switches the endian-swapping mode on.
|
||||
*/
|
||||
id = msiiep->pcic_id;
|
||||
id = mspcic->pcic_id;
|
||||
if (PCI_VENDOR(id) != PCI_VENDOR_SUN
|
||||
&& PCI_PRODUCT(id) != PCI_PRODUCT_SUN_MS_IIep)
|
||||
panic("msiiep_match: id %08x", id);
|
||||
|
@ -168,16 +190,110 @@ msiiep_match(parent, cf, aux)
|
|||
return (1);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
msiiep_attach(parent, self, aux)
|
||||
struct device *parent;
|
||||
struct device *self;
|
||||
void *aux;
|
||||
{
|
||||
extern void timerattach_msiiep(void); /* clock.c */
|
||||
|
||||
struct msiiep_softc *sc = (struct msiiep_softc *)self;
|
||||
struct mainbus_attach_args *ma = aux;
|
||||
struct msiiep_attach_args msa;
|
||||
|
||||
/*
|
||||
* Ok, we know that we are on ms-IIep and the easy way to get
|
||||
* idprom is to read it from root property (try this at prom:
|
||||
* "see idprom@ seeprom see ee-read" if you don't believe me ;-).
|
||||
*/
|
||||
msiiep_getidprom();
|
||||
|
||||
/* pass on real mainbus_attach_args */
|
||||
msa.msa_ma = ma;
|
||||
|
||||
/* config timer/counter part of PCIC */
|
||||
msa.msa_name = "timer";
|
||||
config_found(self, &msa, NULL);
|
||||
|
||||
/* config PCI tree */
|
||||
msa.msa_name = "pcic";
|
||||
config_found(self, &msa, NULL);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* idprom is in /pci/ebus/gpio but it's a pain to access.
|
||||
* fortunately the PROM sets "idprom" property on the root node.
|
||||
* XXX: the idprom stuff badly needs to be factored out....
|
||||
*/
|
||||
static void
|
||||
msiiep_getidprom()
|
||||
{
|
||||
extern void establish_hostid(struct idprom *); /* clock.c */
|
||||
struct idprom *idp;
|
||||
int nitems;
|
||||
|
||||
idp = &msiiep_idprom_store;
|
||||
nitems = 1;
|
||||
if (PROM_getprop(prom_findroot(), "idprom",
|
||||
sizeof(struct idprom), &nitems,
|
||||
(void **)&idp) != 0)
|
||||
panic("unable to get \"idprom\" property from root node");
|
||||
establish_hostid(idp);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Turn PCIC endian swapping on/off. The kernel runs with endian
|
||||
* swapping turned on early in bootstrap(), but we need to turn it off
|
||||
* before we pass control to PROM's repl (e.g. in OF_enter and OF_exit).
|
||||
* PROM expects PCIC to be in little endian mode and would wedge if we
|
||||
* didn't turn endian swapping off.
|
||||
*/
|
||||
void
|
||||
msiiep_swap_endian(on)
|
||||
int on;
|
||||
{
|
||||
u_int8_t pioctl;
|
||||
|
||||
pioctl = mspcic->pcic_pio_ctrl;
|
||||
if (on)
|
||||
pioctl |= MSIIEP_PIO_CTRL_BIG_ENDIAN;
|
||||
else
|
||||
pioctl &= ~MSIIEP_PIO_CTRL_BIG_ENDIAN;
|
||||
mspcic->pcic_pio_ctrl = pioctl;
|
||||
|
||||
/* read it back to make sure transaction completed */
|
||||
pioctl = mspcic->pcic_pio_ctrl;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* ======================================================================
|
||||
*
|
||||
* Real ms-IIep PCIC driver.
|
||||
*/
|
||||
|
||||
static int
|
||||
mspcic_match(parent, cf, aux)
|
||||
struct device *parent;
|
||||
struct cfdata *cf;
|
||||
void *aux;
|
||||
{
|
||||
struct msiiep_attach_args *msa = aux;
|
||||
|
||||
return (strcmp(msa->msa_name, "pcic") == 0);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
mspcic_attach(parent, self, aux)
|
||||
struct device *parent;
|
||||
struct device *self;
|
||||
void *aux;
|
||||
{
|
||||
struct mspcic_softc *sc = (struct mspcic_softc *)self;
|
||||
struct msiiep_attach_args *msa = aux;
|
||||
struct mainbus_attach_args *ma = msa->msa_ma;
|
||||
int node = ma->ma_node;
|
||||
char devinfo[256];
|
||||
|
||||
|
@ -196,41 +312,22 @@ msiiep_attach(parent, self, aux)
|
|||
*/
|
||||
sc->sc_bh = (bus_space_handle_t)MSIIEP_PCIC_VA;
|
||||
|
||||
/*
|
||||
* Ok, we know that we are on ms-IIep and the easy way to get
|
||||
* idprom is to read it from root property (try this at prom:
|
||||
* "see idprom@ seeprom see ee-read" if you don't believe me ;-).
|
||||
*/
|
||||
msiiep_getidprom();
|
||||
|
||||
/* print our PCI device info and bus clock frequency */
|
||||
pci_devinfo(msiiep->pcic_id, msiiep->pcic_class, 0, devinfo);
|
||||
printf("%s: %s: clock = %s MHz\n",
|
||||
self->dv_xname, devinfo, clockfreq(sc->sc_clockfreq));
|
||||
pci_devinfo(mspcic->pcic_id, mspcic->pcic_class, 0, devinfo);
|
||||
printf(": %s: clock = %s MHz\n", devinfo, clockfreq(sc->sc_clockfreq));
|
||||
|
||||
/* timers are PCIC registers */
|
||||
printf("%s: configuring timer:", self->dv_xname);
|
||||
config_found(self, "timer", NULL);
|
||||
/* init cookies/parents in our statically allocated tags */
|
||||
mspcic_pc_tag.cookie = sc;
|
||||
mspcic_io_tag.cookie = sc;
|
||||
mspcic_io_tag.parent = sc->sc_bustag;
|
||||
mspcic_mem_tag.cookie = sc;
|
||||
mspcic_mem_tag.parent = sc->sc_bustag;
|
||||
mspcic_dma_tag._cookie = sc;
|
||||
|
||||
/* chipset tag */
|
||||
msiiep_pc_tag.cookie = sc;
|
||||
|
||||
/* I/O tag */
|
||||
msiiep_io_tag.cookie = sc;
|
||||
msiiep_io_tag.parent = sc->sc_bustag;
|
||||
|
||||
/* memory tag */
|
||||
msiiep_mem_tag.cookie = sc;
|
||||
msiiep_mem_tag.parent = sc->sc_bustag;
|
||||
|
||||
/* DMA tag */
|
||||
msiiep_dma_tag._cookie = sc;
|
||||
|
||||
/* link them up to softc */
|
||||
sc->sc_pct = &msiiep_pc_tag;
|
||||
sc->sc_iot = &msiiep_io_tag;
|
||||
sc->sc_memt = &msiiep_mem_tag;
|
||||
sc->sc_dmat = &msiiep_dma_tag;
|
||||
/* save bus tags in softc */
|
||||
sc->sc_iot = &mspcic_io_tag;
|
||||
sc->sc_memt = &mspcic_mem_tag;
|
||||
sc->sc_dmat = &mspcic_dma_tag;
|
||||
|
||||
/*
|
||||
* Attach the PCI bus.
|
||||
|
@ -240,15 +337,15 @@ msiiep_attach(parent, self, aux)
|
|||
pba.pba_iot = sc->sc_iot;
|
||||
pba.pba_memt = sc->sc_memt;
|
||||
pba.pba_dmat = sc->sc_dmat;
|
||||
pba.pba_pc = sc->sc_pct;
|
||||
pba.pba_pc = &mspcic_pc_tag;
|
||||
pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED;
|
||||
|
||||
config_found(self, &pba, msiiep_print);
|
||||
config_found(self, &pba, mspcic_print);
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
msiiep_print(args, busname)
|
||||
mspcic_print(args, busname)
|
||||
void *args;
|
||||
const char *busname;
|
||||
{
|
||||
|
@ -259,36 +356,11 @@ msiiep_print(args, busname)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
* Turn PCIC endian swapping on/off. The kernel runs with endian
|
||||
* swapping turned on early in bootstrap(), but we need to turn it off
|
||||
* before we pass control to PROM's repl (e.g. in OF_enter and OF_exit).
|
||||
* PROM expects PCIC to be in little endian mode and would wedge if we
|
||||
* didn't turn endian swapping off.
|
||||
*/
|
||||
void
|
||||
msiiep_swap_endian(on)
|
||||
int on;
|
||||
{
|
||||
u_int8_t pioctl;
|
||||
|
||||
pioctl = msiiep->pcic_pio_ctrl;
|
||||
if (on)
|
||||
pioctl |= MSIIEP_PIO_CTRL_BIG_ENDIAN;
|
||||
else
|
||||
pioctl &= ~MSIIEP_PIO_CTRL_BIG_ENDIAN;
|
||||
msiiep->pcic_pio_ctrl = pioctl;
|
||||
|
||||
/* read it back to make sure transaction completed */
|
||||
pioctl = msiiep->pcic_pio_ctrl;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Get the PIL currently assigned for this interrupt input line.
|
||||
*/
|
||||
int
|
||||
msiiep_assigned_interrupt(line)
|
||||
mspcic_assigned_interrupt(line)
|
||||
int line;
|
||||
{
|
||||
unsigned int intrmap;
|
||||
|
@ -297,38 +369,14 @@ msiiep_assigned_interrupt(line)
|
|||
return (-1);
|
||||
|
||||
if (line < 4) {
|
||||
intrmap = msiiep->pcic_intr_asgn_sel;
|
||||
intrmap = mspcic->pcic_intr_asgn_sel;
|
||||
} else {
|
||||
intrmap = msiiep->pcic_intr_asgn_sel_hi;
|
||||
intrmap = mspcic->pcic_intr_asgn_sel_hi;
|
||||
line -= 4;
|
||||
}
|
||||
return ((intrmap >> (line * 4)) & 0xf);
|
||||
}
|
||||
|
||||
/*
|
||||
* idprom is in /pci/ebus/gpio but it's a pain to access.
|
||||
* fortunately the PROM sets "idprom" property on the root node.
|
||||
* XXX: the idprom stuff badly needs to be factored out....
|
||||
*/
|
||||
struct idprom msiiep_idprom_store;
|
||||
|
||||
static void
|
||||
msiiep_getidprom()
|
||||
{
|
||||
extern void establish_hostid(struct idprom *); /* clock.c */
|
||||
struct idprom *idp;
|
||||
int nitems;
|
||||
|
||||
idp = &msiiep_idprom_store;
|
||||
nitems = 1;
|
||||
if (PROM_getprop(prom_findroot(), "idprom",
|
||||
sizeof(struct idprom), &nitems,
|
||||
(void **)&idp) != 0)
|
||||
panic("unable to get \"idprom\" property from root node");
|
||||
establish_hostid(idp);
|
||||
}
|
||||
|
||||
|
||||
/* ======================================================================
|
||||
*
|
||||
* BUS space methods
|
||||
|
@ -342,7 +390,7 @@ msiiep_getidprom()
|
|||
* assignment select registers (but we use existing assignments).
|
||||
*/
|
||||
static void *
|
||||
msiiep_intr_establish(t, line, ipl, flags, handler, arg)
|
||||
mspcic_intr_establish(t, line, ipl, flags, handler, arg)
|
||||
bus_space_tag_t t;
|
||||
int line;
|
||||
int ipl;
|
||||
|
@ -359,9 +407,9 @@ msiiep_intr_establish(t, line, ipl, flags, handler, arg)
|
|||
return (NULL);
|
||||
|
||||
/* use pil set-up by prom */
|
||||
pil = msiiep_assigned_interrupt(line);
|
||||
pil = mspcic_assigned_interrupt(line);
|
||||
if (pil == -1)
|
||||
panic("msiiep_intr_establish: line %d", line);
|
||||
panic("mspcic_intr_establish: line %d", line);
|
||||
|
||||
ih->ih_fun = handler;
|
||||
ih->ih_arg = arg;
|
||||
|
@ -377,7 +425,7 @@ msiiep_intr_establish(t, line, ipl, flags, handler, arg)
|
|||
*/
|
||||
|
||||
static int
|
||||
msiiep_dmamap_load(t, map, buf, buflen, p, flags)
|
||||
mspcic_dmamap_load(t, map, buf, buflen, p, flags)
|
||||
bus_dma_tag_t t;
|
||||
bus_dmamap_t map;
|
||||
void *buf;
|
||||
|
@ -394,7 +442,7 @@ msiiep_dmamap_load(t, map, buf, buflen, p, flags)
|
|||
pmap = pmap_kernel();
|
||||
|
||||
if (!pmap_extract(pmap, (vaddr_t)buf, &pa))
|
||||
panic("msiiep_dmamap_load: dma memory not mapped");
|
||||
panic("mspcic_dmamap_load: dma memory not mapped");
|
||||
|
||||
/* we always use just one segment */
|
||||
map->dm_nsegs = 1;
|
||||
|
@ -406,17 +454,17 @@ msiiep_dmamap_load(t, map, buf, buflen, p, flags)
|
|||
}
|
||||
|
||||
static void
|
||||
msiiep_dmamap_unload(t, dmam)
|
||||
mspcic_dmamap_unload(t, dmam)
|
||||
bus_dma_tag_t t;
|
||||
bus_dmamap_t dmam;
|
||||
{
|
||||
|
||||
panic("msiiep_dmamap_unload: not implemented");
|
||||
panic("mspcic_dmamap_unload: not implemented");
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
msiiep_dmamem_map(tag, segs, nsegs, size, kvap, flags)
|
||||
mspcic_dmamem_map(tag, segs, nsegs, size, kvap, flags)
|
||||
bus_dma_tag_t tag;
|
||||
bus_dma_segment_t *segs;
|
||||
int nsegs;
|
||||
|
@ -430,7 +478,7 @@ msiiep_dmamem_map(tag, segs, nsegs, size, kvap, flags)
|
|||
int pagesz = PAGE_SIZE;
|
||||
|
||||
if (nsegs != 1)
|
||||
panic("msiiep_dmamem_map: nsegs = %d", nsegs);
|
||||
panic("mspcic_dmamem_map: nsegs = %d", nsegs);
|
||||
|
||||
size = round_page(size);
|
||||
|
||||
|
@ -450,7 +498,7 @@ msiiep_dmamem_map(tag, segs, nsegs, size, kvap, flags)
|
|||
paddr_t pa;
|
||||
|
||||
if (size == 0)
|
||||
panic("msiiep_dmamem_map: size botch");
|
||||
panic("mspcic_dmamem_map: size botch");
|
||||
|
||||
pa = VM_PAGE_TO_PHYS(m);
|
||||
pmap_kenter_pa(va, pa | PMAP_NC, VM_PROT_READ | VM_PROT_WRITE);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: msiiepvar.h,v 1.2 2002/03/28 11:59:56 pk Exp $ */
|
||||
/* $NetBSD: msiiepvar.h,v 1.3 2002/03/28 19:50:21 uwe Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2001 Valeriy E. Ushakov
|
||||
|
@ -30,7 +30,12 @@
|
|||
#ifndef _SPARC_MSIIEP_VAR_H_
|
||||
#define _SPARC_MSIIEP_VAR_H_
|
||||
|
||||
struct msiiep_softc {
|
||||
struct msiiep_attach_args {
|
||||
char *msa_name;
|
||||
struct mainbus_attach_args *msa_ma;
|
||||
};
|
||||
|
||||
struct mspcic_softc {
|
||||
struct device sc_dev;
|
||||
|
||||
/* parent (mainbus) tags */
|
||||
|
@ -47,13 +52,11 @@ struct msiiep_softc {
|
|||
int sc_clockfreq; /* in Hz */
|
||||
|
||||
/* our tags */
|
||||
pci_chipset_tag_t sc_pct;
|
||||
bus_space_tag_t sc_memt;
|
||||
bus_space_tag_t sc_iot;
|
||||
bus_dma_tag_t sc_dmat;
|
||||
};
|
||||
|
||||
|
||||
extern int msiiep_assigned_interrupt(int line);
|
||||
extern int mspcic_assigned_interrupt(int line);
|
||||
|
||||
#endif /* _SPARC_MSIIEP_VAR_H_ */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: pci_machdep.c,v 1.3 2002/03/28 11:59:56 pk Exp $ */
|
||||
/* $NetBSD: pci_machdep.c,v 1.4 2002/03/28 19:50:21 uwe Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1999, 2000 Matthew R. Green
|
||||
|
@ -98,35 +98,35 @@ int sparc_pci_debug = 0;
|
|||
*/
|
||||
|
||||
|
||||
struct msiiep_pci_intr_wiring {
|
||||
struct mspcic_pci_intr_wiring {
|
||||
u_int mpiw_bus;
|
||||
u_int mpiw_device;
|
||||
u_int mpiw_function;
|
||||
pci_intr_line_t mpiw_line;
|
||||
};
|
||||
|
||||
static struct msiiep_pci_intr_wiring krups_pci_intr_wiring[] = {
|
||||
static struct mspcic_pci_intr_wiring krups_pci_intr_wiring[] = {
|
||||
{ 0, 0, 1, 1 }, /* ethernet */
|
||||
{ 0, 1, 0, 2 }, /* vga */
|
||||
};
|
||||
|
||||
|
||||
struct msiiep_known_model {
|
||||
struct mspcic_known_model {
|
||||
const char *model;
|
||||
struct msiiep_pci_intr_wiring *map;
|
||||
struct mspcic_pci_intr_wiring *map;
|
||||
int mapsize;
|
||||
};
|
||||
|
||||
#define MSIIEP_MODEL_WIRING(name,map) \
|
||||
#define MSPCIC_MODEL_WIRING(name,map) \
|
||||
{ name, map, sizeof(map)/sizeof(map[0]) }
|
||||
|
||||
static struct msiiep_known_model msiiep_known_models[] = {
|
||||
MSIIEP_MODEL_WIRING("SUNW,501-4267", krups_pci_intr_wiring),
|
||||
static struct mspcic_known_model mspcic_known_models[] = {
|
||||
MSPCIC_MODEL_WIRING("SUNW,501-4267", krups_pci_intr_wiring),
|
||||
{ NULL, NULL, 0}
|
||||
};
|
||||
|
||||
|
||||
static struct msiiep_pci_intr_wiring *wiring_map;
|
||||
static struct mspcic_pci_intr_wiring *wiring_map;
|
||||
static int wiring_map_size;
|
||||
|
||||
|
||||
|
@ -136,7 +136,7 @@ pci_attach_hook(parent, self, pba)
|
|||
struct device *self;
|
||||
struct pcibus_attach_args *pba;
|
||||
{
|
||||
struct msiiep_known_model *p;
|
||||
struct mspcic_known_model *p;
|
||||
char buf[32];
|
||||
char *model;
|
||||
|
||||
|
@ -147,7 +147,7 @@ pci_attach_hook(parent, self, pba)
|
|||
|
||||
printf(": model %s", model);
|
||||
|
||||
for (p = msiiep_known_models; p->model != NULL; ++p)
|
||||
for (p = mspcic_known_models; p->model != NULL; ++p)
|
||||
if (strcmp(model, p->model) == 0) {
|
||||
printf(": interrupt wiring known");
|
||||
wiring_map = p->map;
|
||||
|
@ -178,7 +178,7 @@ pci_make_tag(pc, b, d, f)
|
|||
int d;
|
||||
int f;
|
||||
{
|
||||
struct msiiep_softc *sc = (struct msiiep_softc *)pc->cookie;
|
||||
struct mspcic_softc *sc = (struct mspcic_softc *)pc->cookie;
|
||||
pcitag_t tag;
|
||||
int node, len;
|
||||
#ifdef SPARC_PCI_DEBUG
|
||||
|
@ -386,7 +386,7 @@ pci_intr_map(pa, ihp)
|
|||
pa->pa_bus, pa->pa_device, pa->pa_function));
|
||||
|
||||
for (i = 0; i < wiring_map_size; ++i) {
|
||||
struct msiiep_pci_intr_wiring *w = &wiring_map[i];
|
||||
struct mspcic_pci_intr_wiring *w = &wiring_map[i];
|
||||
|
||||
if (pa->pa_bus == w->mpiw_bus
|
||||
&& pa->pa_device == w->mpiw_device
|
||||
|
@ -411,7 +411,7 @@ pci_intr_string(pc, ih)
|
|||
static char str[16];
|
||||
int pil;
|
||||
|
||||
pil = msiiep_assigned_interrupt(ih);
|
||||
pil = mspcic_assigned_interrupt(ih);
|
||||
sprintf(str, "line %d (pil %d)", ih, pil);
|
||||
return (str);
|
||||
}
|
||||
|
@ -436,7 +436,7 @@ pci_intr_establish(pc, ih, level, func, arg)
|
|||
int (*func)(void *);
|
||||
void *arg;
|
||||
{
|
||||
struct msiiep_softc *sc = (struct msiiep_softc *)pc->cookie;
|
||||
struct mspcic_softc *sc = (struct mspcic_softc *)pc->cookie;
|
||||
void *cookie = NULL;
|
||||
|
||||
DPRINTF(SPDB_INTR,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: timer.c,v 1.1 2002/03/28 11:54:17 pk Exp $ */
|
||||
/* $NetBSD: timer.c,v 1.2 2002/03/28 19:50:21 uwe Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1992, 1993
|
||||
|
@ -79,6 +79,7 @@
|
|||
|
||||
#if defined(MSIIEP)
|
||||
#include <sparc/sparc/msiiepreg.h>
|
||||
#include <sparc/sparc/msiiepvar.h>
|
||||
#endif
|
||||
|
||||
static struct intrhand level10;
|
||||
|
@ -209,9 +210,9 @@ timermatch_msiiep(parent, cf, aux)
|
|||
struct cfdata *cf;
|
||||
void *aux;
|
||||
{
|
||||
char *name = aux;
|
||||
struct msiiep_attach_args *msa = aux;
|
||||
|
||||
return (strcmp("timer", name) == 0);
|
||||
return (strcmp(msa->msa_name, "timer") == 0);
|
||||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
|
@ -552,7 +553,8 @@ clockintr_msiiep(cap)
|
|||
}
|
||||
#endif /* MSIIEP */
|
||||
|
||||
static __inline u_long new_interval(void)
|
||||
static __inline__ u_long
|
||||
new_interval(void)
|
||||
{
|
||||
u_long newint, r, var;
|
||||
|
||||
|
|
Loading…
Reference in New Issue