added touchscreen support, detect all known PCI chips in the Neomagic line.

We'll not bother with ISA for now.
This commit is contained in:
Brent Cook 2004-04-03 22:26:37 +00:00
parent 962b898868
commit 530371ceaf
3 changed files with 66 additions and 6 deletions

View File

@ -27,10 +27,33 @@
#include "neomagic.h"
#include <sys/io.h>
struct NeoChipInfo neoChips[] = {
{NEO_VENDOR, 0x0001, CAP_NM2070, "MagicGraph 128 (NM2070)",
896, 65000, 2048, 0x100, 1024, 1024, 1024},
{NEO_VENDOR, 0x0002, CAP_NM2090, "MagicGraph 128V (NM2090)",
1152, 80000, 2048, 0x100, 2048, 1024, 1024},
{NEO_VENDOR, 0x0003, CAP_NM2090, "MagicGraph 128ZV (NM2093)",
1152, 80000, 2048, 0x100, 2048, 1024, 1024},
{NEO_VENDOR, 0x0083, CAP_NM2097, "MagicGraph 128ZV+ (NM2097)",
1152, 80000, 1024, 0x100, 2048, 1024, 1024},
{NEO_VENDOR, 0x0004, CAP_NM2097, "MagicGraph 128XD (NM2160)",
2048, 90000, 1024, 0x100, 2048, 1024, 1024},
{NEO_VENDOR, 0x0005, CAP_NM2200, "MagicGraph 256AV (NM2200)",
2560, 110000, 1024, 0x1000, 4096, 1280, 1024},
{NEO_VENDOR, 0x0025, CAP_NM2200, "MagicGraph 256AV+ (NM2230)",
3008, 110000, 1024, 0x1000, 4096, 1280, 1024},
{NEO_VENDOR, 0x0006, CAP_NM2200, "MagicGraph 256ZX (NM2360)",
4096, 110000, 1024, 0x1000, 4096, 1280, 1024},
{NEO_VENDOR, 0x0016, CAP_NM2200, "MagicGraph 256XL+ (NM2380)",
6144, 110000, 1024, 0x1000, 8192, 1280, 1024},
{0, 0, 0, NULL},
};
static Bool
neoCardInit (KdCardInfo *card)
{
NeoCardInfo *neoc;
struct NeoChipInfo *chip;
neoc = (NeoCardInfo *) xalloc (sizeof (NeoCardInfo));
if (!neoc)
@ -42,6 +65,15 @@ neoCardInit (KdCardInfo *card)
return FALSE;
}
for (chip = neoChips; chip->name != NULL; ++chip) {
if (chip->device == card->attr.deviceID) {
neoc->chip = chip;
break;
}
}
ErrorF("Using Neomagic card: %s\n", neoc->chip->name);
iopl (3);
neoMapReg (card, neoc);

View File

@ -38,8 +38,11 @@
#define ENTER() DBGOUT("Enter %s\n", __FUNCTION__)
#define LEAVE() DBGOUT("Leave %s\n", __FUNCTION__)
#define NEOMAGIC_VENDOR 0x10c8
#define NEOMAGIC_NM2230 0x0025
#define NEO_VENDOR 0x10c8
#define CAP_NM2070 0x01 /* If it's a NM2070 series */
#define CAP_NM2090 0x02 /* If it's a NM2090 series */
#define CAP_NM2097 0x03 /* If it's a NM2097 series */
#define CAP_NM2200 0x04 /* If it's a NM2200 series */
#define NEO_BS0_BLT_BUSY 0x00000001
#define NEO_BS0_FIFO_AVAIL 0x00000002
@ -106,7 +109,6 @@ typedef volatile struct {
CARD32 dataPtr;
} NeoMMIO;
typedef struct _neoCardInfo {
VesaCardPrivRec vesa;
CARD32 reg_base;
@ -118,10 +120,26 @@ typedef struct _neoCardInfo {
int srcOrg;
int srcPitch;
int srcPixelWidth;
struct NeoChipInfo *chip;
CARD32 bltCntl;
} NeoCardInfo;
struct NeoChipInfo {
CARD16 vendor;
CARD16 device;
CARD8 caps;
char *name;
int videoRam;
int maxClock;
int cursorMem;
int cursorOff;
int linearSize;
int maxWidth;
int maxHeight;
};
#define getNeoCardInfo(kd) ((NeoCardInfo *) ((kd)->card->driver))
#define neoCardInfo(kd) NeoCardInfo *neoc = getNeoCardInfo(kd)

View File

@ -26,13 +26,20 @@
#endif
#include "neomagic.h"
extern struct NeoChipInfo neoChips[];
void
InitCard (char *name)
{
KdCardAttr attr;
// NM2230 MagicGraph 256AV+ the only card I have for testing
if (LinuxFindPci (NEOMAGIC_VENDOR, NEOMAGIC_NM2230, 0, &attr))
KdCardInfoAdd (&neoFuncs, &attr, 0);
struct NeoChipInfo *chip;
for (chip = neoChips; chip->name != NULL; ++chip) {
int j = 0;
while (LinuxFindPci(chip->vendor, chip->device, j++, &attr)) {
KdCardInfoAdd(&neoFuncs, &attr, 0);
}
}
}
void
@ -45,6 +52,9 @@ void
InitInput (int argc, char **argv)
{
KdInitInput (&LinuxMouseFuncs, &LinuxKeyboardFuncs);
#ifdef TOUCHSCREEN
KdInitTouchScreen (&TsFuncs);
#endif
}
void