Esempio n. 1
0
extern int
isic_attach_s0163(struct device *parent, struct device *self, struct isa_attach_args *ia)
{
    u_char irq;
    struct isic_softc *sc = (struct isic_softc *)self;
    int unit = sc->sc_dev.dv_unit;

    /* Commit the probed attachement values */

    if (set_softc(sc, ia, unit) == 0)
        panic("isic_attach_s0163: set_softc");

    if (((unsigned)sc->sc_unit) >= NISIC)
        panic("attach isic%d; NISIC=%d", sc->sc_unit, NISIC);
    l1_sc[sc->sc_unit] = sc;
    irq = intr_no[ffs(sc->sc_irq) - 1];
    /* configure IRQ */

    DELAY(SEC_DELAY / 10);
    outb(sc->sc_port + 4, irq);

    DELAY(SEC_DELAY / 10);
    outb(sc->sc_port + 4, irq | 0x01);

    return 1;
}
Esempio n. 2
0
int
isic_attach_Dyn(struct device *parent, struct device *self,
		struct isa_attach_args *ia)
{
	struct isic_softc *sc = (struct isic_softc *)self;
	int unit = sc->sc_dev.dv_unit;

	/* Commit the probed attachment values */
	if (set_softc(sc, ia, unit) == 0)
		panic("isic_attach_Dyn: set_softc");

	outb((ia->ia_iobase)+ADDR, RESET);
	DELAY(SEC_DELAY / 10);
	outb((ia->ia_iobase)+ADDR, 0);
	DELAY(SEC_DELAY / 10);
	return(1);
}
Esempio n. 3
0
int
isapnp_match_dynalink(struct device *parent, struct cfdata *cf,
		struct isa_attach_args *ia)
{
	struct isic_softc dummysc, *sc = &dummysc;
	pnp_resource_t res;
	char *ids[] = {"ASU1688", NULL};
	bzero(&res, sizeof res);
	res.res_irq[0].irq_level = ia->ia_irq;
	res.res_port[0].prt_base = ia->ia_iobase;
	res.res_port[0].prt_length = 4;

	if (!pnp_assigndev(ids, isiccd.cd_name, &res))
		return (0);

	ia->ia_irq = res.res_irq[0].irq_level;
	ia->ia_iobase = res.res_port[0].prt_base;
	ia->ia_iosize = res.res_port[0].prt_length;

	if (set_softc(sc, ia, cf->cf_unit) == 0)
		return 0;

	/* Read HSCX A/B VSTR.  Expected value is 0x05 (V2.1). */
	if( ((HSCX_READ(0, H_VSTR) & 0xf) != 0x5) ||
	    ((HSCX_READ(1, H_VSTR) & 0xf) != 0x5) )
	{
		printf("isic%d: HSCX VSTR test failed for Dynalink\n",
			cf->cf_unit);
		printf("isic%d: HSC0: VSTR: %#x\n",
			cf->cf_unit, HSCX_READ(0, H_VSTR));
		printf("isic%d: HSC1: VSTR: %#x\n",
			cf->cf_unit, HSCX_READ(1, H_VSTR));
		return (0);
	}

	cf->cf_flags = FLAG_DYNALINK;
	return (1);
}
Esempio n. 4
0
int
isic_probe_s0163(struct device *dev, struct cfdata *cf,
                 struct isa_attach_args *ia)
{
    u_char byte;
    struct isic_softc dummysc, *sc = &dummysc;

    if((intr_no[ffs(ia->ia_irq) - 1]) == 1)
    {
        printf("isic%d: Error, invalid IRQ [%d] specified for Teles S0/16.3!\n",
               cf->cf_unit, ffs(ia->ia_irq)-1);
        return(0);
    }

    /* check if memory addr specified */

    if(ia->ia_maddr)
    {
        printf("isic%d: Error, mem addr 0x%lx specified for Teles S0/16.3!\n",
               cf->cf_unit, (u_long)ia->ia_maddr);
        return 0;
    }

    /* Set up a temporary softc for the probe */

    if (set_softc(sc, ia, cf->cf_unit) == 0)
        return 0;

    if((byte = inb(sc->sc_port)) != 0x51)
    {
        printf("isic%d: Error, signature 1 0x%x != 0x51 for Teles S0/16.3!\n",
               cf->cf_unit, byte);
        return(0);
    }

    if((byte = inb(sc->sc_port + 1)) != 0x93)
    {
        printf("isic%d: Error, signature 2 0x%x != 0x93 for Teles S0/16.3!\n",
               cf->cf_unit, byte);
        return(0);
    }

    if(((byte = inb(sc->sc_port + 2)) != 0x1c) && (byte != 0x1f))
    {
        printf("isic%d: Error, signature 3 0x%x != (0x1c||0x1f) for Teles S0/16.3!\n",
               cf->cf_unit, byte);
        return(0);
    }

    /*
     * Read HSCX A/B VSTR.  Expected value for the S0/16.3 card is
     * 0x05 or 0x04 (for older 16.3's) in the least significant bits.
     */

    if( (((HSCX_READ(0, H_VSTR) & 0xf) != 0x5) &&
            ((HSCX_READ(0, H_VSTR) & 0xf) != 0x4))	||
            (((HSCX_READ(1, H_VSTR) & 0xf) != 0x5) &&
             ((HSCX_READ(1, H_VSTR) & 0xf) != 0x4)) )
    {
        printf("isic%d: HSCX VSTR test failed for Teles S0/16.3\n",
               cf->cf_unit);
        printf("isic%d: HSC0: VSTR: %#x\n",
               cf->cf_unit, HSCX_READ(0, H_VSTR));
        printf("isic%d: HSC1: VSTR: %#x\n",
               cf->cf_unit, HSCX_READ(1, H_VSTR));
        return (0);
    }

    return (1);
}