Difference between revisions of "Express"

From LinuxMIPS
Jump to: navigation, search
(Add some ZX information)
 
m (Patch/Kernel)
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
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.
+
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
 +
* Drawing characters work
 +
* Copying rectangles "work" but the board gets stuck
  
==Current headers==
+
=Locations=
Current development extreme.h looks like this:
+
These are the possible locations where the XZ board can be found.
  
typedef volatile unsigned int exreg_t;
+
* 0x1f000000
 +
* 0x1f400000
 +
* 0x1f600000
  
struct hq2 {
+
=Commands=
        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;
+
  
};
+
Known commands locations into the engine FIFO are:
  
  struct ge {
+
  #define GR2_FIFO_INIT          0x191
         volatile unsigned int ram0[256];
+
#define GR2_FIFO_COLOR          0x192
  };
+
#define GR2_FIFO_FINISH         0x193
 +
#define GR2_FIFO_PNT2I          0x194
 +
#define GR2_FIFO_RECTI2D        0x195
 +
#define GR2_FIFO_CMOV2I        0x196
 +
#define GR2_FIFO_LINE2I        0x197
 +
#define GR2_FIFO_DRAWCHAR      0x198
 +
#define GR2_FIFO_RECTCOPY      0x199
 +
  #define GR2_FIFO_DATA          0x1df
  
  struct clock {
+
Most commands seems to work like this:
        volatile unsigned char write;
+
  "LOCATION"=param0
        unsigned char pad0[31];
+
DATA=param1
  };
+
DATA=param2
 +
....
 +
  DATA=paramX
  
struct vc1 {
+
=Operations=
        volatile unsigned short cmd0;
+
Currently know operations that work are the following:
        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 {
+
==Reading version==
        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 {
+
  rev0=ex_regs->bdversion.rd0 & GR2_REVISION_RD0_VERSION_MASK;
        volatile unsigned int shram[32768];
+
rev1=ex_regs->bdversion.rd1 & 0x03;
        unsigned char padding[131072];
+
hqv=(ex_regs->hq.version & HQ2_VERSION_MASK) >> HQ2_VERSION_SHIFT;
        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;
+
  
};
+
==Setting color==
  
#define HQ2_FIN1 0x04;
+
All drawing operations need a color that it should use:
#define HQ2_FIN2 0x02;
+
#define HQ2_FIN3 0x01;
+
  
  #define HQ2_FAST_SHRAM_CNT 0x10;
+
  [GR2_FIFO_COLOR]=color;
  
#define HQ2_FIFO_MAX 63;
+
=== Palette ===
#define HQ2_FIFO_HI 40;
+
Unknown.
#define HQ2_FIFO_LO 35;
+
  
#define GR2_FIFO_INIT                  0x644/4
+
==Drawing a rectangle==
#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
+
First you must set the color and then:
#define HQ2_VERSION_SHIFT              23
+
  
  #define GE7_REVISION_MASK              0xf0
+
  [GR2_FIFO_RECTI2D]=x1;
 +
[GR2_FIFO_DATA]=y1;
 +
[GR2_FIFO_DATA]=x2;
 +
[GR2_FIFO_DATA]=y2;
  
#define GR2_REVISION_RD1_BACKEND_REV    0x03
+
Y needs to be flipped as 0,0 is lower left corner.
#define GR2_REVISION_RD1_ZBUFFER        0x0c
+
  
#define GR2_REVISION_RD0_VERSION_MASK  0x0f
+
==Character drawing==
#define GR2_REVISION4_RD0_MONITOR_MASK  0xf0
+
  
#define GR2_REVISION_RD2_BACKEND_REV    0x000c
+
Set color, then:
  
#define GR_PHYS_BASE1 0x1f000000
+
First move character draw location to x,y
  #define GR_PHYS_BASE2 0x1f400000
+
  [GR2_FIFO_CMOV2I]=x
  #define GR_PHYS_BASE3 0x1f600000
+
  [GR2_FIFO_DATA]=y
  
 +
Then set width and height of character:
  
==Operations==
+
[GR2_FIFO_DRAWCHAR]=8
Currently know operations that work are the following:
+
[GR2_FIFO_DATA]=16
  
===Reading version===
+
Some magic:
  
  rev0=ex_regs->bdversion.rd0 & GR2_REVISION_RD0_VERSION_MASK;
+
  [GR2_FIFO_DATA]=2;
  rev1=ex_regs->bdversion.rd1 & 0x03;
+
  [GR2_FIFO_DATA]=0;  
  hqv=(ex_regs->hq.version & HQ2_VERSION_MASK) >> HQ2_VERSION_SHIFT;
+
  [GR2_FIFO_DATA]=0;
 +
[GR2_FIFO_DATA]=0;
 +
[GR2_FIFO_DATA]=0;
 +
[GR2_FIFO_DATA]=0;
  
===Setting color===
+
Then plot the character, bottom first:
  
You probably need to set the color to draw with before doing any actual drawing.
+
loop for font height:
 +
  [GR2_FIFO_DATA]=pattern
 +
 +
Be sure to padd up to 18, probably the max font height.
  
ex_regs->fifo[GR2_FIFO_COLOR]=color;
+
==Moving blocks==
  
===Drawing a rectangle===
+
This is giving a headache right now as all of the above seems to work just fine.
  
First you must set the color and then:
+
==Other==
 +
Other operations will be added when we figure them out.
  
ex_regs->fifo[GR2_FIFO_RECTI2D]=x1;
+
=Patch/Kernel=
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.
+
No patches just yet. Kernel with sort-of-maybe-working-console can be found from time to time at [http://home.tal.org/~milang/o2/kernels/ onion's kernels page.]
  
===Other===
+
[[Category:SGI]]
Other operations will be added when we figure them out.
+

Latest revision as of 06:59, 8 October 2010

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
  • Drawing characters work
  • Copying rectangles "work" but the board gets stuck

Locations

These are the possible locations where the XZ board can be found.

  • 0x1f000000
  • 0x1f400000
  • 0x1f600000

Commands

Known commands locations into the engine FIFO are:

#define GR2_FIFO_INIT           0x191
#define GR2_FIFO_COLOR          0x192
#define GR2_FIFO_FINISH         0x193
#define GR2_FIFO_PNT2I          0x194
#define GR2_FIFO_RECTI2D        0x195
#define GR2_FIFO_CMOV2I         0x196
#define GR2_FIFO_LINE2I         0x197
#define GR2_FIFO_DRAWCHAR       0x198
#define GR2_FIFO_RECTCOPY       0x199
#define GR2_FIFO_DATA           0x1df

Most commands seems to work like this:

"LOCATION"=param0
DATA=param1
DATA=param2
....
DATA=paramX

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

All drawing operations need a color that it should use:

[GR2_FIFO_COLOR]=color;

Palette

Unknown.

Drawing a rectangle

First you must set the color and then:

[GR2_FIFO_RECTI2D]=x1;
[GR2_FIFO_DATA]=y1;
[GR2_FIFO_DATA]=x2;
[GR2_FIFO_DATA]=y2;

Y needs to be flipped as 0,0 is lower left corner.

Character drawing

Set color, then:

First move character draw location to x,y

[GR2_FIFO_CMOV2I]=x
[GR2_FIFO_DATA]=y

Then set width and height of character:

[GR2_FIFO_DRAWCHAR]=8
[GR2_FIFO_DATA]=16

Some magic:

[GR2_FIFO_DATA]=2;
[GR2_FIFO_DATA]=0; 
[GR2_FIFO_DATA]=0;
[GR2_FIFO_DATA]=0;
[GR2_FIFO_DATA]=0;
[GR2_FIFO_DATA]=0;

Then plot the character, bottom first:

loop for font height:
 [GR2_FIFO_DATA]=pattern

Be sure to padd up to 18, probably the max font height.

Moving blocks

This is giving a headache right now as all of the above seems to work just fine.

Other

Other operations will be added when we figure them out.

Patch/Kernel

No patches just yet. Kernel with sort-of-maybe-working-console can be found from time to time at onion's kernels page.