Express

From LinuxMIPS
Revision as of 21:36, 9 February 2005 by Onion (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Thanks to NetBSDs GR2 driver we have out that HQ2.1 is a kind of successor of the HQ2 found in the Indigo(IP12), and at least partialy compatible. Version information can be read in the same way and tests have shown that drawing colored rectangles work just like on GR2.

Current headers

Current development extreme.h looks like this:

typedef volatile unsigned int exreg_t;
struct hq2 {
       exreg_t attrjmp[16];
       exreg_t version;
       exreg_t numge;
       exreg_t fin1;
       exreg_t fin2;
       exreg_t dmasync;
       exreg_t fifo_full_timeout;
       exreg_t fifo_empty_timeout;
       exreg_t fifo_full;
       exreg_t fifo_empty;
       exreg_t ge_loaducode;
       exreg_t gedma;
       exreg_t hq_gepc;
       exreg_t gepc;
       exreg_t intr;
       exreg_t unstall;
       exreg_t mystery;
       exreg_t refresh;
       volatile unsigned char pad[3964];
       exreg_t fin3;
};
struct ge {
       volatile unsigned int ram0[256];
};
struct clock {
       volatile unsigned char write;
       unsigned char pad0[31];
};
struct vc1 {
       volatile unsigned short cmd0;
       unsigned char pad0[2];
       volatile unsigned char xmapmode;
       unsigned char pad1[3];
       volatile unsigned short sram;
       unsigned char pad2[2];
       volatile unsigned char testreg;
       unsigned char pad3[3];
       volatile unsigned char addrlo;
       unsigned char pad4[3];
       volatile unsigned char addrhi;
       unsigned char pad5[3];
       volatile unsigned char sysctl;
       unsigned char pad6[7];
};
struct bdversion {
       volatile unsigned char rd0;
       unsigned char pad0[3];
       volatile unsigned char rd1;
       unsigned char pad1[3];
       volatile unsigned char rd2;
       unsigned char pad2[3];
       volatile unsigned char rd3;
       unsigned char pad3[19];
};
struct extreme_regs {
       volatile unsigned int shram[32768];
       unsigned char padding[131072];
       volatile unsigned int fifo[32768];
       volatile unsigned int ucode[8192];
       struct ge ge[8];
       struct hq2 hq;
       unsigned char pad0[4092];
       struct bdversion bdversion;
       struct clock clock;
       struct vc1 vc1;
};
#define HQ2_FIN1 0x04;
#define HQ2_FIN2 0x02;
#define HQ2_FIN3 0x01;
#define HQ2_FAST_SHRAM_CNT 0x10;
#define HQ2_FIFO_MAX 63;
#define HQ2_FIFO_HI 40;
#define HQ2_FIFO_LO 35;
#define GR2_FIFO_INIT                   0x644/4
#define GR2_FIFO_COLOR          0x648/4
#define GR2_FIFO_FINISH                 0x64c/4
#define GR2_FIFO_PNT2I                  0x650/4
#define GR2_FIFO_RECTI2D                0x654/4
#define GR2_FIFO_CMOV2I                 0x658/4
#define GR2_FIFO_LINE2I                 0x65c/4
#define GR2_FIFO_DRAWCHAR               0x660/4
#define GR2_FIFO_RECTCOPY               0x664/4
#define GR2_FIFO_DATA                   0x77c/4
#define HQ2_VERSION_MASK                0xff000000
#define HQ2_VERSION_SHIFT               23
#define GE7_REVISION_MASK               0xf0
#define GR2_REVISION_RD1_BACKEND_REV    0x03
#define GR2_REVISION_RD1_ZBUFFER        0x0c
#define GR2_REVISION_RD0_VERSION_MASK   0x0f
#define GR2_REVISION4_RD0_MONITOR_MASK  0xf0
#define GR2_REVISION_RD2_BACKEND_REV    0x000c
#define GR_PHYS_BASE1 0x1f000000
#define GR_PHYS_BASE2 0x1f400000
#define GR_PHYS_BASE3 0x1f600000


Operations

Currently know operations that work are the following:

Reading version

rev0=ex_regs->bdversion.rd0 & GR2_REVISION_RD0_VERSION_MASK;
rev1=ex_regs->bdversion.rd1 & 0x03;
hqv=(ex_regs->hq.version & HQ2_VERSION_MASK) >> HQ2_VERSION_SHIFT;

Setting color

You probably need to set the color to draw with before doing any actual drawing.

ex_regs->fifo[GR2_FIFO_COLOR]=color;

Drawing a rectangle

First you must set the color and then:

ex_regs->fifo[GR2_FIFO_RECTI2D]=x1;
ex_regs->fifo[GR2_FIFO_DATA]=y1;
ex_regs->fifo[GR2_FIFO_DATA]=x2;
ex_regs->fifo[GR2_FIFO_DATA]=y2;

NetBSD GR2 drivers says that 0,0 is lower left corner.

Other

Other operations will be added when we figure them out.