Ejemplo n.º 1
0
int
glxpcib_search(struct device *parent, void *gcf, void *args)
{
	struct glxpcib_softc *sc = (struct glxpcib_softc *)parent;
	struct cfdata *cf = (struct cfdata *)gcf;
	struct pci_attach_args *pa = (struct pci_attach_args *)args;
	struct glxpcib_attach_args gaa;

	gaa.gaa_name = cf->cf_driver->cd_name;
	gaa.gaa_pa = pa;
	gaa.gaa_iot = sc->sc_iot;
	gaa.gaa_ioh = sc->sc_ioh;

	/*
	 * These devices are attached directly, either from
	 * glxpcib_attach() or later in time from pcib_callback().
	 */
	if (strcmp(cf->cf_driver->cd_name, "gpio") == 0 ||
	    strcmp(cf->cf_driver->cd_name, "iic") == 0 ||
	    strcmp(cf->cf_driver->cd_name, "isa") == 0)
		return 0;

	if (cf->cf_attach->ca_match(parent, cf, &gaa) == 0)
		return 0;

	config_attach(parent, cf, &gaa, glxpcib_print);
	return 1;
}
Ejemplo n.º 2
0
static int
nor_search(device_t parent, cfdata_t cf, const int *ldesc, void *aux)
{
	struct nor_softc * const sc = device_private(parent);
	struct nor_chip * const chip = &sc->sc_chip;
	struct flash_attach_args faa;

	faa.partinfo.part_offset = cf->cf_loc[FLASHBUSCF_OFFSET];

	if (cf->cf_loc[FLASHBUSCF_SIZE] == 0) {
		faa.partinfo.part_size =
		    chip->nc_size - faa.partinfo.part_offset;
	} else {
		faa.partinfo.part_size = cf->cf_loc[FLASHBUSCF_SIZE];
	}

	if (cf->cf_loc[FLASHBUSCF_READONLY])
		faa.partinfo.part_flags = FLASH_PART_READONLY;
	else
		faa.partinfo.part_flags = 0;

	faa.flash_if = &sc->sc_flash_if;

	if (config_match(parent, cf, &faa)) {
		if (config_attach(parent, cf, &faa, nor_print) != NULL) {
			return 0;
		} else {
			return 1;
		}
	}

	return 1;
}
Ejemplo n.º 3
0
static int
ocp_search(struct device *parent, struct cfdata *cf,
	     const int *ldesc, void *aux)
{
	struct ocp_softc *sc = (struct ocp_softc *)parent;
	struct ocp_attach_args aa;

	switch (cf->cf_loc[OCPCF_MULT]) {
	case 1:
		aa.ocp_iot = &omap_bs_tag;
		break;
	case 2:
		aa.ocp_iot = &omap_a2x_bs_tag;
		break;
	case 4:
		aa.ocp_iot = &omap_a4x_bs_tag;
		break;
	default:
		panic("Unsupported OCP multiplier.");
		break;
	}
	aa.ocp_dmac = sc->sc_dmac;
	aa.ocp_addr = cf->cf_loc[OCPCF_ADDR];
	aa.ocp_size = cf->cf_loc[OCPCF_SIZE];
	aa.ocp_intr = cf->cf_loc[OCPCF_INTR];

	if (config_match(parent, cf, &aa))
		config_attach(parent, cf, &aa, ocp_print);

	return 0;
}
Ejemplo n.º 4
0
static int
uda1341_search(device_t parent, cfdata_t cf, const int *ldesc, void *aux)
{
	if (config_match(parent, cf, NULL) > 0)
		config_attach(parent, cf, NULL, uda1341_print);
	return 0;
}
Ejemplo n.º 5
0
int
gio_search(struct device *parent, void *vcf, void *aux)
{
	struct gio_softc *sc = (struct gio_softc *)parent;
	struct cfdata *cf = (struct cfdata *)vcf;
	struct gio_attach_args ga;

	/* Handled by direct configuration, so skip here */
	if (cf->cf_loc[1 /*GIOCF_ADDR*/] == -1)
		return 0;

	ga.ga_addr = (uint64_t)cf->cf_loc[1 /*GIOCF_ADDR*/];
	ga.ga_iot = sc->sc_iot;
	ga.ga_ioh = PHYS_TO_XKPHYS(ga.ga_addr, CCA_NC);
	ga.ga_dmat = sc->sc_dmat;
	ga.ga_slot = cf->cf_loc[0 /*GIOCF_SLOT*/];
	ga.ga_product = -1;
	ga.ga_descr = NULL;

	if ((*cf->cf_attach->ca_match)(parent, cf, &ga) == 0)
		return 0;

	config_attach(parent, cf, &ga, gio_print);

	return 1;
}
Ejemplo n.º 6
0
static int
mfp_search(device_t parent, cfdata_t cf, const int *loc, void *aux)
{
	if (config_match(parent, cf, __UNCONST(cf->cf_name)) > 0)
		config_attach(parent, cf, __UNCONST(cf->cf_name), NULL);
	return 0;
}
Ejemplo n.º 7
0
int
lrcscan(struct device *parent, void *self, void *aux)
{
	struct cfdata *cf = self;
	struct lrcsoftc *sc = (struct lrcsoftc *)parent;
	struct confargs *ca = aux;
	struct confargs oca;

	bzero(&oca, sizeof oca);
	oca.ca_iot = ca->ca_iot;
	oca.ca_dmat = ca->ca_dmat;
	oca.ca_offset = cf->cf_loc[0];
	oca.ca_ipl = cf->cf_loc[1];
	if (oca.ca_offset != -1 && ISIIOVA(sc->sc_vaddr + oca.ca_offset)) {
		oca.ca_vaddr = sc->sc_vaddr + oca.ca_offset;
		oca.ca_paddr = sc->sc_paddr + oca.ca_offset;
	} else {
		oca.ca_vaddr = (vaddr_t)-1;
		oca.ca_paddr = (paddr_t)-1;
	}	
	oca.ca_bustype = BUS_LRC;
	oca.ca_name = cf->cf_driver->cd_name;

	if ((*cf->cf_attach->ca_match)(parent, cf, &oca) == 0)
		return (0);

	config_attach(parent, cf, &oca, lrcprint);

	return (1);
}
Ejemplo n.º 8
0
int
voyager_search(struct device *parent, void *vcf, void *args)
{
	struct voyager_softc *sc = (struct voyager_softc *)parent;
	struct cfdata *cf = (struct cfdata *)vcf;
	struct pci_attach_args *pa = (struct pci_attach_args *)args;
	struct voyager_attach_args vaa;

	/*
	 * Caller should have attached gpio already. If it didn't, bail
	 * out here.
	 */
	if (strcmp(cf->cf_driver->cd_name, "gpio") == 0)
		return 0;

	vaa.vaa_name = cf->cf_driver->cd_name;
	vaa.vaa_pa = pa;
	vaa.vaa_fbt = sc->sc_fbt;
	vaa.vaa_fbh = sc->sc_fbh;
	vaa.vaa_mmiot = sc->sc_mmiot;
	vaa.vaa_mmioh = sc->sc_mmioh;

	if (cf->cf_attach->ca_match(parent, cf, &vaa) == 0)
		return 0;

	config_attach(parent, cf, &vaa, voyager_print);
	return 1;
}
static void
obio_attach_critical(struct obio_softc *sc)
{
	struct obio_attach_args oa;
	cfdata_t cf;
	size_t i;

	for (i = 0; i < __arraycount(critical_devs); i++) {
		oa.obio_iot = sc->sc_iot;
		oa.obio_dmat = sc->sc_dmat;

		oa.obio_addr = critical_devs[i].addr;
		oa.obio_size = OBIOCF_SIZE_DEFAULT;
		oa.obio_intr = OBIOCF_INTR_DEFAULT;
		oa.obio_intrbase = OBIOCF_INTRBASE_DEFAULT;

#if 0
		if (oa.obio_addr != OBIOCF_ADDR_DEFAULT
		    && (oa.obio_addr < sc->sc_base 
		        || oa.obio_addr >= sc->sc_base + sc->sc_size))
			continue;
#endif

		cf = config_search_ia(obio_find, sc->sc_dev, "obio", &oa);
		if (cf == NULL && critical_devs[i].required)
			panic("obio_attach_critical: failed to find %s!",
			    critical_devs[i].name);

		oa.obio_addr = cf->cf_loc[OBIOCF_ADDR];
		oa.obio_size = cf->cf_loc[OBIOCF_SIZE];
		oa.obio_intr = cf->cf_loc[OBIOCF_INTR];
		oa.obio_intrbase = cf->cf_loc[OBIOCF_INTRBASE];
		config_attach(sc->sc_dev, cf, &oa, obio_print);
	}
}
Ejemplo n.º 10
0
static int
mainbus_search(struct device *parent, struct cfdata *cf,
	       const int *ldesc, void *aux)
{
	if (config_match(parent, cf, aux) > 0)
		config_attach(parent, cf, aux, NULL);
	return 0;
}
Ejemplo n.º 11
0
static int
mainbussearch(device_t parent, cfdata_t cf, const int *ldesc, void *aux)
{

	if (config_match(parent, cf, NULL) > 0)
		config_attach(parent, cf, NULL, NULL);
	return 0;
}
Ejemplo n.º 12
0
int
g2bussearch(device_t parent, cfdata_t cf, const int *ldesc, void *aux)
{

	if (config_match(parent, cf, aux) > 0)
		config_attach(parent, cf, aux, g2busprint);

	return 0;
}
Ejemplo n.º 13
0
static int
obio_search(device_t parent, cfdata_t cf, const int *ldesc, void *aux)
{
	struct obio_softc * const sc = device_private(parent);
	struct obio_attach_args oa;

	/* Set up the attach args. */
	if (cf->cf_loc[OBIOCF_NOBYTEACC] == 1) {
		if (cf->cf_loc[OBIOCF_MULT] == 1)
			oa.obio_iot = &nobyteacc_bs_tag;
		else
			panic("nobyteacc specified for device with "
				"non-byte multiplier\n");
	} else {
		switch (cf->cf_loc[OBIOCF_MULT]) {
		case 1:
			oa.obio_iot = &omap_bs_tag;
			break;
		case 2:
			oa.obio_iot = &omap_a2x_bs_tag;
			break;
		case 4:
			oa.obio_iot = &omap_a4x_bs_tag;
			break;
		default:
			panic("Unsupported EMIFS multiplier.");
			break;
		}
	}

	oa.obio_dmat = sc->sc_dmat;
	oa.obio_addr = cf->cf_loc[OBIOCF_ADDR];
	oa.obio_size = cf->cf_loc[OBIOCF_SIZE];
	oa.obio_intr = cf->cf_loc[OBIOCF_INTR];
	oa.obio_intrbase = cf->cf_loc[OBIOCF_INTRBASE];
	oa.obio_edmabase = cf->cf_loc[OBIOCF_EDMABASE];

#if defined(OMAP2)
	if ((oa.obio_addr >= sc->sc_base)
	&&  (oa.obio_addr < (sc->sc_base + sc->sc_size))) {
		/* XXX
		 * if size was specified, then check it too
		 * otherwise just assume it is OK
		 */
		if ((oa.obio_size != OBIOCF_SIZE_DEFAULT)
		&&  ((oa.obio_addr + oa.obio_size)
			>= (sc->sc_base + sc->sc_size)))
				return 1;		/* NG */
		if (config_match(parent, cf, &oa)) {
			config_attach(parent, cf, &oa, obio_print);
			return 0;			/* love it */
		}
	}
#endif

	return UNCONF;	/* NG */
}
Ejemplo n.º 14
0
Archivo: shb.c Proyecto: MarginC/kame
int
shb_search(struct device *parent, struct cfdata *cf, void *aux)
{

	if ((*cf->cf_attach->ca_match)(parent, cf, NULL) > 0)
		config_attach(parent, cf, NULL, shb_print);

	return (0);
}
Ejemplo n.º 15
0
static int
L3i_search(device_t parent, cfdata_t cf,
	     const int *ldesc, void *aux)
{
	struct L3i_softc *sc = device_private(parent);
	struct L3i_attach_args aa;

	/* Set up the attach args. */
	if (cf->cf_loc[L3iCF_NOBYTEACC] == 1) {
		if (cf->cf_loc[L3iCF_MULT] == 1)
			aa.L3i_iot = &nobyteacc_bs_tag;
		else
			panic("nobyteacc specified for device with "
				"non-byte multiplier\n");
	} else {
		switch (cf->cf_loc[L3iCF_MULT]) {
		case 1:
			aa.L3i_iot = &omap_bs_tag;
			break;
		case 2:
			aa.L3i_iot = &omap_a2x_bs_tag;
			break;
		case 4:
			aa.L3i_iot = &omap_a4x_bs_tag;
			break;
		default:
			panic("Unsupported EMIFS multiplier.");
			break;
		}
	}

	aa.L3i_dmac = sc->sc_dmac;
	aa.L3i_addr = cf->cf_loc[L3iCF_ADDR];
	aa.L3i_size = cf->cf_loc[L3iCF_SIZE];
	aa.L3i_intr = cf->cf_loc[L3iCF_INTR];

#if defined(OMAP2)
	if ((aa.L3i_addr >= OMAP2_L3i_BASE)
	&&  (aa.L3i_addr < (OMAP2_L4_CORE_BASE + OMAP2_L3i_SIZE))) {
		/* XXX
		 * if size was specified, then check it too
		 * otherwise just assume it is OK
		 */
		if ((aa.L3i_size != L3iCF_SIZE_DEFAULT)
		&&  ((aa.L3i_addr + aa.L3i_size)
			>= (OMAP2_L4_CORE_BASE + OMAP2_L3i_SIZE)))
				return 1;		/* NG */
		if (config_match(parent, cf, &aa)) {
			config_attach(parent, cf, &aa, L3i_print);
			return 0;			/* love it */
		}
	}
#endif

	return 1;	/* NG */
}
Ejemplo n.º 16
0
Archivo: sbus.c Proyecto: MarginC/kame
int
sbus_search(struct device *parent, struct cfdata *cf, void *aux)
{
	struct sbus_attach_args sa;

	if ((*cf->cf_attach->ca_match)(parent, cf, &sa))
		config_attach(parent, cf, &sa, sbus_print);
	
	return (0);
}
Ejemplo n.º 17
0
int
cs80bussearch(device_t parent, cfdata_t cf, const int *ldesc, void *aux)
{
	struct cs80bus_softc *sc = device_private(parent);
	struct cs80bus_attach_args *ca = aux;

	/*
	 * Set punit if operator specified one in the kernel
	 * configuration file.
	 */
	if (cf->cs80buscf_punit != CS80BUSCF_PUNIT_DEFAULT &&
	    cf->cs80buscf_punit < CS80BUS_NPUNITS)
		ca->ca_punit = cf->cs80buscf_punit;
	else
		/* default punit */
		ca->ca_punit = 0;

	DPRINTF(DBG_FOLLOW, ("cs80bussearch: id=0x%x slave=%d punit=%d\n",
	    ca->ca_id, ca->ca_slave, ca->ca_punit));

	if (config_match(parent, cf, ca) > 0) {

		DPRINTF(DBG_FOLLOW,
		    ("cs80bussearch: got id=0x%x slave=%d punit %d\n",
		    ca->ca_id, ca->ca_slave, ca->ca_punit));

		/*
		 * The device probe has succeeded, and filled in
		 * the punit information.  Make sure the configuration
		 * allows for this slave/punit combination.
		 */
		if (cf->cs80buscf_slave != CS80BUSCF_SLAVE_DEFAULT &&
		    cf->cs80buscf_slave != ca->ca_slave)
			goto out;
		if (cf->cs80buscf_punit != CS80BUSCF_PUNIT_DEFAULT &&
		    cf->cs80buscf_punit != ca->ca_punit)
			goto out;

		/*
		 * Allocate the device's address from the bus's
		 * resource map.
		 */
		if (cs80bus_alloc(sc, ca->ca_slave, ca->ca_punit))
			goto out;

		/*
		 * This device is allowed; attach it.
		 */
		config_attach(parent, cf, ca, cs80busprint);
	}
out:
	return (0);
}
Ejemplo n.º 18
0
int
ubasearch(device_t parent, cfdata_t cf, const int *ldesc, void *aux)
{
	struct	uba_softc *sc = device_private(parent);
	struct	uba_attach_args ua;
	int	i, csr, vec, br;

	csr = cf->cf_loc[UBACF_CSR];
	if (sc->uh_used[ubdevreg(csr)])
		return 0; /* something are already at this address */

	ua.ua_ioh = ubdevreg(csr) + sc->uh_ioh;
	ua.ua_iot = sc->uh_iot;
	ua.ua_dmat = sc->uh_dmat;

	if (badaddr((void *)ua.ua_ioh, 2) ||
	    (sc->uh_errchk ? (*sc->uh_errchk)(sc):0))
		goto forgetit;

	scb_vecref(0, 0); /* Clear vector ref */
	i = config_match(parent, cf, &ua);

	if (sc->uh_errchk)
		if ((*sc->uh_errchk)(sc))
			goto forgetit;
	if (i == 0)
		goto forgetit;

	i = scb_vecref(&vec, &br);
	if (i == 0)
		goto fail;
	if (vec == 0)
		goto fail;

	ua.ua_br = br;
	ua.ua_cvec = vec;
	ua.ua_iaddr = csr;
	ua.ua_evcnt = NULL;

	sc->uh_used[ubdevreg(csr)] = 1;

	config_attach(parent, cf, &ua, ubaprint);
	return 0;

fail:
	printf("%s%d at %s csr %o %s\n",
	    cf->cf_name, cf->cf_unit, device_xname(parent),
	    csr, (i ? "zero vector" : "didn't interrupt"));

forgetit:
	return 0;
}
static int
s3c2440_i2s_search(device_t parent, cfdata_t cf, const int *ldesc, void *aux)
{
	struct s3c2440_i2s_attach_args ia;
	DPRINTF(("%s\n", __func__));

	ia.i2sa_handle = device_private(parent);

	if (config_match(parent, cf, &ia))
		config_attach(parent, cf, &ia, s3c2440_i2s_print);

	return 1;
}
Ejemplo n.º 20
0
int
at91bus_search(device_t parent, cfdata_t cf, const int *ldesc, void *aux)
{
	struct at91bus_attach_args *sa = aux;

	sa->sa_addr = cf->cf_loc[AT91BUSCF_ADDR];
	sa->sa_size = cf->cf_loc[AT91BUSCF_SIZE];
	sa->sa_pid  = cf->cf_loc[AT91BUSCF_PID];

	if (config_match(parent, cf, aux) > 0)
		config_attach(parent, cf, aux, at91bus_print);

	return (0);
}
Ejemplo n.º 21
0
static int
wbsio_search(device_t parent, cfdata_t cf, const int *slocs, void *aux)
{
	struct wbsio_softc *sc = device_private(parent);
	uint16_t iobase;
	uint8_t reg0, reg1, devid;

	/* Enter configuration mode */
	wbsio_conf_enable(sc->sc_iot, sc->sc_ioh);

	/* Select HM logical device */
	wbsio_conf_write(sc->sc_iot, sc->sc_ioh, WBSIO_LDN, WBSIO_LDN_HM);

	/*
	 * The address should be 8-byte aligned, but it seems some
	 * BIOSes ignore this.  They get away with it, because
	 * Apparently the hardware simply ignores the lower three
	 * bits.  We do the same here.
	 */
	reg0 = wbsio_conf_read(sc->sc_iot, sc->sc_ioh, WBSIO_HM_ADDR_LSB);
	reg1 = wbsio_conf_read(sc->sc_iot, sc->sc_ioh, WBSIO_HM_ADDR_MSB);

	/* Escape from configuration mode */
	wbsio_conf_disable(sc->sc_iot, sc->sc_ioh);

	iobase = (reg1 << 8) | (reg0 & ~0x7);

	if (iobase == 0)
		return -1;

	/* Enter configuration mode */
	wbsio_conf_enable(sc->sc_iot, sc->sc_ioh);
	/* Read device ID */
	devid = wbsio_conf_read(sc->sc_iot, sc->sc_ioh, WBSIO_ID);
	/* Escape from configuration mode */
	wbsio_conf_disable(sc->sc_iot, sc->sc_ioh);

	sc->sc_ia.ia_nio = 1;
	sc->sc_ia.ia_io = &sc->sc_io;
	sc->sc_ia.ia_io[0].ir_addr = iobase;
	sc->sc_ia.ia_io[0].ir_size = 8;
	sc->sc_ia.ia_niomem = 0;
	sc->sc_ia.ia_nirq = 0;
	sc->sc_ia.ia_ndrq = 0;
	/* Store device-id to ia_aux */
	sc->sc_ia.ia_aux = (void *)(uintptr_t)devid;
	sc->sc_lm_dev = config_attach(parent, cf, &sc->sc_ia, wbsio_print);

	return 0;
}
Ejemplo n.º 22
0
/*
 * config_search_ia() callback function.
 */
static int
apbh_search_cb(device_t parent, cfdata_t cf, const int *locs, void *aux)
{
	struct apb_attach_args *aa = aux;

	aa->aa_name = cf->cf_name;
	aa->aa_addr = cf->cf_loc[APBHCF_ADDR];
	aa->aa_size = cf->cf_loc[APBHCF_SIZE];
	aa->aa_irq = cf->cf_loc[APBHCF_IRQ];

	if (config_match(parent, cf, aux) > 0)
		config_attach(parent, cf, aux, apbh_print);

	return 0;
}
Ejemplo n.º 23
0
Archivo: i2c.c Proyecto: MarginC/kame
static int
iic_search(struct device *parent, struct cfdata *cf, void *aux)
{
	struct iic_softc *sc = (void *) parent;
	struct i2c_attach_args ia;

	ia.ia_tag = sc->sc_tag;
	ia.ia_addr = cf->cf_loc[IICCF_ADDR];
	ia.ia_size = cf->cf_loc[IICCF_SIZE];

	if (config_match(parent, cf, &ia) > 0)
		config_attach(parent, cf, &ia, iic_print);

	return (0);
}
Ejemplo n.º 24
0
int
mainbussearch(struct device *parent, void *vcf, void *aux)
{
	struct mainbus_attach_args ma;
	struct cfdata *cf = vcf;

	ma.ma_name = cf->cf_driver->cd_name;

	/* allow for devices to be disabled in UKC */
	if ((*cf->cf_attach->ca_match)(parent, cf, &ma) == 0)
		return 0;

	config_attach(parent, cf, &ma, mainbusprint);
	return 1;
}
Ejemplo n.º 25
0
static int
rsbus_search(device_t parent, cfdata_t cf, const int *ldesc, void *aux)
{
	struct rsbus_softc *sc = device_private(parent);
	struct rsbus_attach_args sa;

	sa.sa_iot = sc->sc_iot;
	sa.sa_addr = cf->cf_loc[RSBUSCF_ADDR];
	sa.sa_size = cf->cf_loc[RSBUSCF_SIZE];
	sa.sa_intr = cf->cf_loc[RSBUSCF_IRQ];

	if (config_match(parent, cf, &sa) > 0)
		config_attach(parent, cf, &sa, rsbus_print);

	return (0);
}
Ejemplo n.º 26
0
int
pvbus_search(struct device *parent, void *arg, void *aux)
{
	struct pvbus_softc *sc = (struct pvbus_softc *)aux;
	struct cfdata		*cf = arg;
	struct pv_attach_args	 pva;

	pva.pva_busname = cf->cf_driver->cd_name;
	pva.pva_hv = sc->pvbus_hv;
	pva.pva_dmat = &pvbus_dma_tag;

	if (cf->cf_attach->ca_match(parent, cf, &pva) > 0)
		config_attach(parent, cf, &pva, pvbus_print);

	return (0);
}
Ejemplo n.º 27
0
int
ixpsip_search(device_t parent, cfdata_t cf, const int *ldesc, void *aux)
{
	struct ixpsip_softc *sc = device_private(parent);
	struct ixpsip_attach_args sa;

	sa.sa_iot = sc->sc_iot;
	sa.sa_addr = cf->cf_loc[IXPSIPCF_ADDR];
	sa.sa_size = cf->cf_loc[IXPSIPCF_SIZE];
	sa.sa_intr = cf->cf_loc[IXPSIPCF_INTR];

	if (config_match(parent, cf, &sa) > 0)
		config_attach(parent, cf, &sa, ixpsip_print);

	return (0);
}
static int
obio_search(device_t parent, cfdata_t cf, const int *ldesc, void *aux)
{
	struct obio_softc * const sc = device_private(parent);
	struct obio_attach_args oa;

	/* Set up the attach args. */
	if (cf->cf_loc[OBIOCF_NOBYTEACC] == 1) {
#if 0
		if (cf->cf_loc[OBIOCF_MULT] == 1)
			oa.obio_iot = &nobyteacc_bs_tag;
		else
#endif
			panic("nobyteacc specified for device with "
				"non-byte multiplier\n");
	} else {
		switch (cf->cf_loc[OBIOCF_MULT]) {
		case 1:
			oa.obio_iot = &gemini_bs_tag;
			break;
#if 0
		case 2:
			oa.obio_iot = &gemini_a2x_bs_tag;
			break;
#endif
		case 4:
			oa.obio_iot = &gemini_a4x_bs_tag;
			break;
		default:
			panic("Unsupported obio bus multiplier.");
			break;
		}
	}

	oa.obio_dmat = sc->sc_dmat;
	oa.obio_addr = cf->cf_loc[OBIOCF_ADDR];
	oa.obio_size = cf->cf_loc[OBIOCF_SIZE];
	oa.obio_intr = cf->cf_loc[OBIOCF_INTR];
	oa.obio_intrbase = cf->cf_loc[OBIOCF_INTRBASE];

	if (config_match(parent, cf, &oa)) {
		config_attach(parent, cf, &oa, obio_print);
		return 0;			/* love it */
	}

	return UNCONF;	/* NG */
}
Ejemplo n.º 29
0
int
ixpsip_search(struct device *parent, struct cfdata *cf, void *aux)
{
	struct ixpsip_softc *sc = (struct ixpsip_softc *)parent;
	struct ixpsip_attach_args sa;

	sa.sa_iot = sc->sc_iot;
	sa.sa_addr = cf->cf_loc[IXPSIPCF_ADDR];
	sa.sa_size = cf->cf_loc[IXPSIPCF_SIZE];
	sa.sa_index = cf->cf_loc[IXPSIPCF_INDEX];
	sa.sa_intr = cf->cf_loc[IXPSIPCF_INTR];

	if (config_match(parent, cf, &sa) > 0)
		config_attach(parent, cf, &sa, ixpsip_print);

	return (0);
}
Ejemplo n.º 30
0
int
mainbus_scan(struct device *parent, void *child, void *args)
{
	struct cfdata *cf = child;
	struct confargs oca;

	oca.ca_iot = &mainbus_bustag;
	oca.ca_paddr = (paddr_t)cf->cf_loc[0];
	oca.ca_offset = (paddr_t)-1;
	oca.ca_ipl = (u_int)-1;

	if ((*cf->cf_attach->ca_match)(parent, cf, &oca) == 0)
		return (0);

	config_attach(parent, cf, &oca, mainbus_print);
	return (1);
}