Beispiel #1
0
void
sticninit()
{
	extern struct hp300_bus_space_tag hp300_mem_tag;
	bus_space_tag_t iot;
	bus_addr_t base;
	int i;

	/*
	 * We are not interested by the *first* console pass.
	 */
	if (consolepass == 0)
		return;

	iot = &hp300_mem_tag;
	base = (bus_addr_t)sgc_slottopa(CONSCODE_TO_SGC_SLOT(conscode));

	/* stifb_cn_bases[0] will be fixed in sti_cnattach() */
	for (i = 0; i < STI_REGION_MAX; i++)
		stifb_cn_bases[i] = base;

	sti_cnattach(&stifb_cn, iot, stifb_cn_bases, STI_CODEBASE_M68K);
	sti_clear(&stifb_cn);

	/*
	 * Since the copyright notice could not be displayed before,
	 * display it again now.
	 */
	printf("%s\n", copyright);
}
Beispiel #2
0
static void sticon_clear(struct vc_data *conp, int sy, int sx, int height,
			 int width)
{
    if (!height || !width)
	return;

    sti_clear(sticon_sti, sy, sx, height, width, conp->vc_video_erase_char);
}
Beispiel #3
0
static int sticon_blank(struct vc_data *c, int blank, int mode_switch)
{
    if (blank == 0) {
	if (mode_switch)
	    vga_is_gfx = 0;
	return 1;
    }
    sticon_set_origin(c);
    sti_clear(sticon_sti, 0,0, c->vc_rows, c->vc_cols, BLANK);
    if (mode_switch)
	vga_is_gfx = 1;
    return 1;
}
Beispiel #4
0
static int sticon_scroll(struct vc_data *conp, int t, int b, int dir, int count)
{
    struct sti_struct *sti = sticon_sti;

    if (vga_is_gfx)
        return 0;

    sticon_cursor(conp, CM_ERASE);

    switch (dir) {
    case SM_UP:
	sti_bmove(sti, t + count, 0, t, 0, b - t - count, conp->vc_cols);
	sti_clear(sti, b - count, 0, count, conp->vc_cols, conp->vc_video_erase_char);
	break;

    case SM_DOWN:
	sti_bmove(sti, t, 0, t + count, 0, b - t - count, conp->vc_cols);
	sti_clear(sti, t, 0, count, conp->vc_cols, conp->vc_video_erase_char);
	break;
    }

    return 0;
}
Beispiel #5
0
/*
 * Initialize the sti device for ite's needs.
 * We don't bother to check for failures since
 * - we are in tight space already
 * - since romputchar() does not work with sti devices, there is no way we
 *   can report errors (although we could switch to serial...)
 */
void
sti_iteinit(struct ite_data *ip)
{
	int slotno, i;
	size_t codesize, memsize;
	u_int8_t *va, *code;
	u_int addr, eaddr, reglist, tmp;
	struct sti_inqconfout cfg;
	struct sti_einqconfout ecfg;

	bzero(&sti, sizeof sti);
	slotno = (int)ip->fbbase;
	ip->fbbase = va = (u_int8_t *)IIOV(SGC_BASE + (slotno * SGC_DEVSIZE));

	/*
	 * Read the microcode.
	 */

	for (i = 0; i < STI_CODECNT; i++)
		sti.codeptr[i] =
		    parseword1(va, (STI_CODEBASE_M68K << 2) + i * 0x10);

	for (i = STI_END; sti.codeptr[i] == 0; i--);
	codesize = sti.codeptr[i] - sti.codeptr[STI_BEGIN];
	codesize = (codesize + 3) / 4;

	sti.code = (u_int8_t *)alloc(codesize);
	code = sti.code;
	addr = (u_int)va + sti.codeptr[STI_BEGIN];
	eaddr = addr + codesize * 4;
	for (; addr < eaddr; addr += 4)
		*code++ = *(u_int8_t *)addr;

	for (i = STI_CODECNT - 1; i != 0; i--)
		if (sti.codeptr[i] != 0) {
			sti.codeptr[i] -= sti.codeptr[0];
			sti.codeptr[i] /= 4;
		}

	sti.codeptr[0] = 0;
	for (i = STI_END; sti.codeptr[i] == 0; i--);
	sti.codeptr[i] = 0;

	/*
	 * Read the regions list.
	 */

	reglist = parseword1(va, 0x60);
	for (i = 0; i < STI_REGION_MAX; i++) {
		tmp = parseword1(va, (reglist & ~3) + i * 0x10);
		sti.cfg.regions[i] = (u_int)va + ((tmp >> 18) << 12);
		if (tmp & 0x4000)
			break;
	}

	/*
	 * Allocate scratch memory for the microcode if it needs it.
	 */

	sti.cfg.ext_cfg = &sti.ecfg;
	memsize = parseword1(va, 0xa0);
	if (memsize != 0)
		sti.ecfg.addr = alloc(memsize);

	/*
	 * Initialize the display, and get geometry information.
	 */

	sti_init(0);

	bzero(&cfg, sizeof cfg);
	bzero(&ecfg, sizeof ecfg);
	cfg.ext = &ecfg;
	sti_inqcfg(&cfg);

	if (cfg.owidth == cfg.width && cfg.oheight == cfg.height) {
		sti.cfg.oscr_width = cfg.owidth = cfg.fbwidth - cfg.width;
		sti.cfg.oscr_height = cfg.oheight = cfg.fbheight - cfg.height;
	}

	ip->dheight = cfg.height;
	ip->dwidth = cfg.width;
	ip->fbheight = cfg.fbheight;
	ip->fbwidth = cfg.fbwidth;

	/*
	 * Get ready for ite operation!
	 */

	sti_init(1);
	sti_fontinfo(ip);
	sti_clear(ip, 0, 0, ip->rows, ip->cols);	/* necessary? */
}