Beispiel #1
0
int v_setmodefixed(struct v_board_t *board)
{
    int iob=board->io_base;
    int tmp;

#ifdef SAVEVGA
    v_savetextmode(board);
#endif

    v1k_softreset(board);

    /* switching to native mode */
    v_out8(iob+MODEREG, NATIVE_MODE);

    /* flipping some bytes */
    v_out8(iob+MEMENDIAN, MEMENDIAN_HW);

    /* try programming 1024x768@70 in highcolor */
    tmp=v_in32(iob+DRAMCTL)&0xdfff;              /* reset bit 13 */
    v_out32(iob+DRAMCTL, tmp|DEFAULT_WREFRESH);

    /* program pixel clock */
    if (board->chip == V1000_DEVICE) {
        set_PLL(iob, combineNMP(21, 55, 0));
    } 
    else {
	tmp = (~0x1800) & v_in32(iob+DRAMCTL);
        v_out32(iob+DRAMCTL, tmp);
        v_out32(iob+PCLKPLL, v2kcombineNMP(2, 21, 2));
    }
    usleep(500);
  
    v_initdac(board, 16, 0);
  
    v_out32(iob+CRTCHORZ, HORZ(24, 136, 144, 1024));
    v_out32(iob+CRTCVERT, VERT(3, 6, 29, 768));

    board->mode.screenwidth=1024;
    board->mode.virtualwidth=1024;
    board->mode.bitsperpixel=16;
    board->mode.fifosize=128;

    board->init=1;
    v_setframebase(board, 0);

    v_out32(iob+CRTCCTL, CTL(0, 0, 0)
                         |V_PIXFMT_565 
                         |CRTCCTL_VIDEOFIFOSIZE128
                         |CRTCCTL_HSYNCENABLE
                         |CRTCCTL_VSYNCENABLE
                         |CRTCCTL_VIDEOENABLE);

  return 0;
}
int
verite_resetboard(ScrnInfoPtr pScreenInfo)
{
    renditionPtr pRendition = RENDITIONPTR(pScreenInfo);
    vu16 iob=pRendition->board.io_base; 
    vu8 memendian=verite_in8(iob+MEMENDIAN);
    vu32 crtcctl = verite_in32(iob+CRTCCTL);

    v1k_softreset(pScreenInfo);
    verite_out8(iob+MEMENDIAN, memendian);
    verite_out32(iob+CRTCCTL, crtcctl);

    return 0;
}