Ejemplo n.º 1
0
void
leinit()
{
	extern struct hp_hw sc_table[];
	struct hp_hw *hw;
	struct le_softc *sc;
	struct le_sel *sels;
	int i, n;
	char *cp;

	i = 0;

	for (hw = sc_table; i < NLE && hw < &sc_table[MAXCTLRS]; hw++) {
#ifdef LE_DEBUG
		if (le_debug)
			printf("found type %x\n", hw->hw_type);
#endif

#if 0
		if (!HW_ISDEV(hw, D_LAN))
			continue;
#endif

                sels = (struct le_sel *)le_ifs[i].dif_private;

		sc = &le_softc[i];
                sc->sc_r0 = (struct lereg0 *)(sels->le_id + (int)hw->hw_kva);

                if (sc->sc_r0->ler0_id != LEID)
                        continue;

                sc->sc_r1 = (struct lereg1 *)(sels->le_regs + (int)hw->hw_kva);
                sc->sc_mem = (struct lereg2 *)(sels->le_mem + (int)hw->hw_kva);

#ifdef LE_DEBUG
		if (le_debug)
			printf("le%d: DIO=%x regs=%x mem=%x\n",
				i, sc->sc_r0, sc->sc_r1, sc->sc_mem);
#endif

		/*
		 * Read the ethernet address off the board, one nibble at a time.
		 */
		cp = (char *)(sels->le_nvram + (int)hw->hw_kva);
		for (n = 0; n < sizeof(sc->sc_addr); n++) {
		    sc->sc_addr[n] = (*++cp & 0xF) << 4;
		    cp++;
		    sc->sc_addr[n] |= *++cp & 0xF;
		    cp++;
		}
#ifdef LE_DEBUG
		if (le_debug)
			printf("le%d at sc%d physical address %s\n",
				i, hw->hw_sc, ether_sprintf(sc->sc_addr));
#endif
		hw->hw_pa = (caddr_t) i;	/* XXX for autoconfig */
		i++;
	}
}
Ejemplo n.º 2
0
/*
 * Locate all bitmapped displays
 */
iteconfig()
{
	extern struct hp_hw sc_table[];
	int dtype, fboff, i;
	struct hp_hw *hw;
	struct grfreg *gr;
	struct ite_softc *ip;

	i = 0;
	for (hw = sc_table; hw < &sc_table[MAXCTLRS]; hw++) {
	        if (!HW_ISDEV(hw, D_BITMAP))
			continue;
		gr = (struct grfreg *) hw->hw_kva;
		/* XXX: redundent but safe */
		if (badaddr((caddr_t)gr) || gr->gr_id != GRFHWID)
			continue;
		for (dtype = 0; dtype < nitesw; dtype++)
			if (itesw[dtype].ite_hwid == gr->gr_id2)
				break;
		if (dtype == nitesw)
			continue;
		if (i >= NITE)
			break;
		ip = &ite_softc[i];
		ip->isw = &itesw[dtype];
		ip->regbase = (caddr_t) gr;
		fboff = (gr->gr_fbomsb << 8) | gr->gr_fbolsb;
		ip->fbbase = (caddr_t) (*((u_char *)ip->regbase+fboff) << 16);
		/* DIO II: FB offset is relative to select code space */
		if (ip->regbase >= (caddr_t)DIOIIBASE)
			ip->fbbase += (int)ip->regbase;
		ip->fbwidth  = gr->gr_fbwidth_h << 8 | gr->gr_fbwidth_l;
		ip->fbheight = gr->gr_fbheight_h << 8 | gr->gr_fbheight_l;
		ip->dwidth   = gr->gr_dwidth_h << 8 | gr->gr_dwidth_l;
		ip->dheight  = gr->gr_dheight_h << 8 | gr->gr_dheight_l;
		/*
		 * XXX some displays (e.g. the davinci) appear
		 * to return a display height greater than the
		 * returned FB height.  Guess we should go back
		 * to getting the display dimensions from the
		 * fontrom...
		 */
		if (ip->dwidth > ip->fbwidth)
			ip->dwidth = ip->fbwidth;
		if (ip->dheight > ip->fbheight)
			ip->dheight = ip->fbheight;
		ip->flags = ITE_ALIVE|ITE_CONSOLE;
		i++;
	}
}
Ejemplo n.º 3
0
/*
 * Locate all bitmapped displays
 */
iteconfig()
{
	extern struct hp_hw sc_table[];
	int dtype, fboff, i;
	struct hp_hw *hw;
	struct grfreg *gr;
	struct ite_softc *ip;

	i = 0;
	for (hw = sc_table; hw < &sc_table[MAXCTLRS]; hw++) {
	        if (!HW_ISDEV(hw, D_BITMAP))
			continue;
		gr = (struct grfreg *) hw->hw_kva;
		/* XXX: redundent but safe */
		if (badaddr((caddr_t)gr) || gr->gr_id != GRFHWID)
			continue;
		for (dtype = 0; dtype < nitesw; dtype++)
			if (itesw[dtype].ite_hwid == gr->gr_id2)
				break;
		if (dtype == nitesw)
			continue;
		if (i >= NITE)
			break;
		ip = &ite_softc[i];
		ip->isw = &itesw[dtype];
		ip->regbase = (caddr_t) gr;
		fboff = (gr->gr_fbomsb << 8) | gr->gr_fbolsb;
		ip->fbbase = (caddr_t) (*((u_char *)ip->regbase+fboff) << 16);
		/* DIO II: FB offset is relative to select code space */
		if (ip->regbase >= (caddr_t)DIOIIBASE)
			ip->fbbase += (int)ip->regbase;
		ip->fbwidth  = gr->gr_fbwidth_h << 8 | gr->gr_fbwidth_l;
		ip->fbheight = gr->gr_fbheight_h << 8 | gr->gr_fbheight_l;
		ip->dwidth   = gr->gr_dwidth_h << 8 | gr->gr_dwidth_l;
		ip->dheight  = gr->gr_dheight_h << 8 | gr->gr_dheight_l;
		ip->flags = ITE_ALIVE|ITE_CONSOLE;
		i++;
	}
}
Ejemplo n.º 4
0
/*
 * Locate all bitmapped displays
 */
void
iteconfig()
{
    extern struct hp_hw sc_table[];
    int dtype, fboff, slotno, i;
    u_int8_t *va;
    struct hp_hw *hw;
    struct grfreg *gr;
    struct ite_data *ip;

    i = 0;
    for (hw = sc_table; hw < &sc_table[MAXCTLRS]; hw++) {
        if (!HW_ISDEV(hw, D_BITMAP))
            continue;
        gr = (struct grfreg *) hw->hw_kva;
        /* XXX: redundent but safe */
        if (badaddr((caddr_t)gr) || gr->gr_id != GRFHWID)
            continue;
        for (dtype = 0; dtype < nitesw; dtype++)
            if (itesw[dtype].ite_hwid == gr->gr_id2)
                break;
        if (dtype == nitesw)
            continue;
        if (i >= NITE)
            break;
        ip = &ite_data[i];
        ip->isw = &itesw[dtype];
        ip->regbase = (caddr_t) gr;
        fboff = (gr->gr_fbomsb << 8) | gr->gr_fbolsb;
        ip->fbbase = (caddr_t) (*((u_char *)ip->regbase+fboff) << 16);
        /* DIO II: FB offset is relative to select code space */
        if (ip->regbase >= (caddr_t)DIOIIBASE)
            ip->fbbase += (int)ip->regbase;
        ip->fbwidth  = gr->gr_fbwidth_h << 8 | gr->gr_fbwidth_l;
        ip->fbheight = gr->gr_fbheight_h << 8 | gr->gr_fbheight_l;
        ip->dwidth   = gr->gr_dwidth_h << 8 | gr->gr_dwidth_l;
        ip->dheight  = gr->gr_dheight_h << 8 | gr->gr_dheight_l;
        /*
         * XXX some displays (e.g. the davinci) appear
         * to return a display height greater than the
         * returned FB height.  Guess we should go back
         * to getting the display dimensions from the
         * fontrom...
         */
        if (ip->dwidth > ip->fbwidth)
            ip->dwidth = ip->fbwidth;
        if (ip->dheight > ip->fbheight)
            ip->dheight = ip->fbheight;
        ip->alive = 1;
        i++;
    }

    /*
     * Now probe for SGC frame buffers.
     * Note that we do not tell 360 from 362 in the bootblocks.
     */
    switch (machineid) {
    case HP_360:
    case HP_382:
    case HP_400:
    case HP_425:
    case HP_433:
        break;
    default:
        return;
    }

    for (dtype = 0; dtype < nitesw; dtype++)
        if (itesw[dtype].ite_hwid == GID_STI)
            break;
    if (dtype == nitesw)
        return;

    for (slotno = 0; slotno < SGC_NSLOTS; slotno++) {
        va = (u_int8_t *)IIOV(SGC_BASE + (slotno * SGC_DEVSIZE));

        /* Check to see if hardware exists. */
        if (badaddr(va) != 0)
            continue;

        /* Check hardware. */
        if (va[3] == STI_DEVTYPE1) {
            if (i >= NITE)
                break;
            ip = &ite_data[i];
            ip->isw = &itesw[dtype];
            ip->regbase = (caddr_t)GRFIADDR; /* to get CN_MIDPRI */
            ip->fbbase = (caddr_t)slotno;
            ip->alive = 1;
            i++;
            /* we only support one SGC frame buffer at the moment */
            break;
        }
    }
}
Ejemplo n.º 5
0
/*
 * Locate all bitmapped displays
 */
void
iteconfig()
{
	extern struct hp_hw sc_table[];
	int dtype, fboff, slotno, i;
	u_int8_t *va;
	struct hp_hw *hw;
	struct diofbreg *fb;
	struct ite_data *ip;

	i = 0;
	for (hw = sc_table; hw < &sc_table[MAXCTLRS]; hw++) {
	        if (!HW_ISDEV(hw, D_BITMAP))
			continue;
		fb = (struct diofbreg *)hw->hw_kva;
		/* XXX: redundent but safe */
		if (badaddr((caddr_t)fb) || fb->id != GRFHWID)
			continue;
		for (dtype = 0; dtype < nitems(itesw); dtype++)
			if (itesw[dtype].ite_hwid == fb->fbid)
				break;
		if (dtype == nitems(itesw))
			continue;
		if (i >= NITE)
			break;
		ip = &ite_data[i];
		ip->scode = hw->hw_sc;
		ip->isw = &itesw[dtype];
		ip->regbase = (caddr_t)fb;
		fboff = (fb->fbomsb << 8) | fb->fbolsb;
		ip->fbbase = (caddr_t) (*((u_char *)ip->regbase+fboff) << 16);
		/* DIO II: FB offset is relative to select code space */
		if (DIO_ISDIOII(ip->scode))
			ip->fbbase += (int)ip->regbase;
		ip->fbwidth  = fb->fbwmsb << 8 | fb->fbwlsb;
		ip->fbheight = fb->fbhmsb << 8 | fb->fbhlsb;
		ip->dwidth   = fb->dwmsb << 8 | fb->dwlsb;
		ip->dheight  = fb->dhmsb << 8 | fb->dhlsb;
		/*
		 * XXX some displays (e.g. the davinci) appear
		 * to return a display height greater than the
		 * returned FB height.  Guess we should go back
		 * to getting the display dimensions from the
		 * fontrom...
		 */
		if (ip->dwidth > ip->fbwidth)
			ip->dwidth = ip->fbwidth;
		if (ip->dheight > ip->fbheight)
			ip->dheight = ip->fbheight;
		/* confirm hardware is what we think it is */
		if (itesw[dtype].ite_probe != NULL &&
		    (*itesw[dtype].ite_probe)(ip) != 0)
			continue;
		ip->alive = 1;
		i++;
	}

	/*
	 * Now probe for SGC frame buffers.
	 */
	switch (machineid) {
	case HP_400:
	case HP_425:
	case HP_433:
		break;
	default:
		return;
	}

	/* SGC frame buffers can only be STI... */
	for (dtype = 0; dtype < nitems(itesw); dtype++)
		if (itesw[dtype].ite_hwid == GID_STI)
			break;
	if (dtype == nitems(itesw))
		return;

	for (slotno = 0; slotno < SGC_NSLOTS; slotno++) {
		va = (u_int8_t *)IIOV(SGC_BASE + (slotno * SGC_DEVSIZE));

		/* Check to see if hardware exists. */
		if (badaddr(va) != 0)
			continue;

		/* Check hardware. */
		if (va[3] == STI_DEVTYPE1) {
			if (i >= NITE)
				break;
			ip = &ite_data[i];
			ip->scode = slotno;
			ip->isw = &itesw[dtype];
			ip->regbase = (caddr_t)GRFIADDR; /* to get CN_MIDPRI */
			/* ...and do not need an ite_probe() check */
			ip->alive = 1;
			i++;
			/* we only support one SGC frame buffer at the moment */
			break;
		}
	}
}