Add support for attaching IOP built-in sub-devices (aau, dma, ssp,
watchdog, etc.)
This commit is contained in:
parent
c92ad565ad
commit
2367c7fff8
@ -1,4 +1,4 @@
|
||||
# $NetBSD: files.i80321,v 1.3 2002/07/25 15:00:48 thorpej Exp $
|
||||
# $NetBSD: files.i80321,v 1.4 2002/07/29 17:37:14 thorpej Exp $
|
||||
#
|
||||
# Configuration info for Intel i80321 XScale I/O Processor support
|
||||
#
|
||||
@ -8,7 +8,7 @@ file arch/arm/xscale/i80321_irq.S
|
||||
file arch/arm/xscale/i80321_mcu.c
|
||||
file arch/arm/xscale/i80321_timer.c
|
||||
|
||||
device iopxs: pcibus, bus_space_generic
|
||||
device iopxs {}: pcibus, bus_space_generic
|
||||
# Board-specific front-end provides attachment.
|
||||
file arch/arm/xscale/i80321.c iopxs
|
||||
file arch/arm/xscale/i80321_pci.c iopxs
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: i80321.c,v 1.3 2002/07/25 15:00:48 thorpej Exp $ */
|
||||
/* $NetBSD: i80321.c,v 1.4 2002/07/29 17:37:14 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2002 Wasabi Systems, Inc.
|
||||
@ -61,8 +61,22 @@ struct bus_space i80321_bs_tag;
|
||||
*/
|
||||
struct i80321_softc *i80321_softc;
|
||||
|
||||
int i80321_iopxs_print(void *, const char *);
|
||||
int i80321_pcibus_print(void *, const char *);
|
||||
|
||||
/* Built-in devices. */
|
||||
static const struct iopxs_device {
|
||||
const char *id_name;
|
||||
bus_addr_t id_offset;
|
||||
bus_size_t id_size;
|
||||
} iopxs_devices[] = {
|
||||
{ "iopaau", VERDE_AAU_BASE, VERDE_AAU_SIZE },
|
||||
{ "iopdma", VERDE_DMA_BASE, VERDE_DMA_SIZE },
|
||||
{ "iopssp", VERDE_SSP_BASE, VERDE_SSP_SIZE },
|
||||
{ "iopwdog", 0, 0 },
|
||||
{ NULL, 0, 0 }
|
||||
};
|
||||
|
||||
/*
|
||||
* i80321_attach:
|
||||
*
|
||||
@ -72,6 +86,8 @@ void
|
||||
i80321_attach(struct i80321_softc *sc)
|
||||
{
|
||||
struct pcibus_attach_args pba;
|
||||
const struct iopxs_device *id;
|
||||
struct iopxs_attach_args ia;
|
||||
pcireg_t preg;
|
||||
|
||||
i80321_softc = sc;
|
||||
@ -189,6 +205,20 @@ i80321_attach(struct i80321_softc *sc)
|
||||
i80321_pci_init(&sc->sc_pci_chipset, sc);
|
||||
i80321_local_dma_init(&sc->sc_local_dmat, sc);
|
||||
|
||||
/*
|
||||
* Attach all the IOP built-ins.
|
||||
*/
|
||||
for (id = iopxs_devices; id->id_name != NULL; id++) {
|
||||
ia.ia_name = id->id_name;
|
||||
ia.ia_st = sc->sc_st;
|
||||
ia.ia_sh = sc->sc_sh;
|
||||
ia.ia_dmat = &sc->sc_local_dmat;
|
||||
ia.ia_offset = id->id_offset;
|
||||
ia.ia_size = id->id_size;
|
||||
|
||||
(void) config_found(&sc->sc_dev, &ia, i80321_iopxs_print);
|
||||
}
|
||||
|
||||
/*
|
||||
* Attach the PCI bus.
|
||||
*/
|
||||
@ -210,6 +240,19 @@ i80321_attach(struct i80321_softc *sc)
|
||||
(void) config_found(&sc->sc_dev, &pba, i80321_pcibus_print);
|
||||
}
|
||||
|
||||
/*
|
||||
* i80321_iopxs_print:
|
||||
*
|
||||
* Autoconfiguration cfprint routine when attaching
|
||||
* to the "iopxs" device.
|
||||
*/
|
||||
int
|
||||
i80321_iopxs_print(void *aux, const char *pnp)
|
||||
{
|
||||
|
||||
return (QUIET);
|
||||
}
|
||||
|
||||
/*
|
||||
* i80321_pcibus_print:
|
||||
*
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: i80321var.h,v 1.2 2002/07/25 15:00:49 thorpej Exp $ */
|
||||
/* $NetBSD: i80321var.h,v 1.3 2002/07/29 17:37:15 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2002 Wasabi Systems, Inc.
|
||||
@ -137,6 +137,18 @@ struct i80321_softc {
|
||||
struct arm32_bus_dma_tag sc_local_dmat;
|
||||
};
|
||||
|
||||
/*
|
||||
* Arguments used to attach IOP built-ins.
|
||||
*/
|
||||
struct iopxs_attach_args {
|
||||
const char *ia_name; /* name of device */
|
||||
bus_space_tag_t ia_st; /* space tag */
|
||||
bus_space_handle_t ia_sh;/* handle of IOP base */
|
||||
bus_dma_tag_t ia_dmat; /* DMA tag */
|
||||
bus_addr_t ia_offset; /* offset of device from IOP base */
|
||||
bus_size_t ia_size; /* size of sub-device */
|
||||
};
|
||||
|
||||
extern struct bus_space i80321_bs_tag;
|
||||
extern struct i80321_softc *i80321_softc;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user