Subject: Re: New sgimips snapshot for INDY/Indigo 2, dated 20020409
To: Robert Boehne <rboehne@attbi.com>
From: Rafal Boni <rafal@attbi.com>
List: port-sgimips
Date: 04/17/2002 00:53:33
This is a multipart MIME message.
--==_Exmh_1729424365200
Content-Type: text/plain; charset=us-ascii
In message <20020417013730.QEOD1901.rwcrmhc52.attbi.com@[12.250.98.163]>, you w
rite:
-> Rafal:
->
-> Why don't you post them, that way if I loose the patches
-> then I'll know where I can find them. :)
-> It looks like I'll have a couple more Indys by week's end
-> which will be handy for this sort of work.
OK, I'm attaching them. Some caveats:
* I've only even built the source, not used it (though I may have
used the X clients a while back, can't recall). The last time
I played with this was a while back, so it may not even build
now 8-/
* There is no NetBSD probe for the newport, so I've forced the
driver to believe there's always one on NetBSD (yucky, but
will probably do the trick for testing 8-).
* There are no kernel keyboard/mouse drivers for the Indigo2/
Indy series of machines, so running an X server will be hard
without those 8-)
* I don't really know much about X nor the Newport cards, but if
someone's interested in working on this, I'll do my best to
help try and fill in stuff I *may* know about.
* I don't think I had to add any files to the build, but if so,
I may have missed them in the diff; if it looks like that's
the case, please yell..
That said, the diffs are attached... If anyone makes any progress with
this stuff, please drop me and/or the list a note!
--rafal
----
Rafal Boni rafal@attbi.com
We are all worms. But I do believe I am a glowworm. -- Winston Churchill
--==_Exmh_1729424365200
Content-Type: text/plain ; name="indy-xsrc-diffs"; charset=us-ascii
Content-Description: indy-xsrc-diffs
Content-Disposition: attachment; filename="indy-xsrc-diffs"
Index: xfree/xc/config/cf/Imake.cf
===================================================================
RCS file: /cvsroot/xsrc/xfree/xc/config/cf/Imake.cf,v
retrieving revision 1.6
diff -u -p -p -b -u -r1.6 Imake.cf
--- xfree/xc/config/cf/Imake.cf 2002/01/19 23:19:28 1.6
+++ xfree/xc/config/cf/Imake.cf 2002/04/17 04:29:50
@@ -182,7 +182,14 @@ XCOMM $XFree86: xc/config/cf/Imake.cf,v
# endif
# ifdef mips
# define MipsArchitecture
+# ifdef arc
# define ArcArchitecture
+# undef arc
+# endif
+# ifdef pmax
+# define PmaxArchitecture
+# undef pmax
+# endif
# undef mips
# endif
# ifdef __alpha__
Index: xfree/xc/config/cf/NetBSD.cf
===================================================================
RCS file: /cvsroot/xsrc/xfree/xc/config/cf/NetBSD.cf,v
retrieving revision 1.25
diff -u -p -p -b -u -r1.25 NetBSD.cf
--- xfree/xc/config/cf/NetBSD.cf 2002/03/28 14:38:10 1.25
+++ xfree/xc/config/cf/NetBSD.cf 2002/04/17 04:29:51
@@ -162,7 +162,7 @@ XCOMM operating system: OSName (OSMajor
*
* Disabled for NetBSD/vax until I figure out the scheme. --CS
*/
-#if (OSMajorVersion > 0) && defined(i386Architecture)
+#if (OSMajorVersion > 0) && (defined(i386Architecture) || defined(MipsAchitecture))
# ifndef DoLoadableServer
# define DoLoadableServer YES
# endif
@@ -198,7 +198,7 @@ XCOMM operating system: OSName (OSMajor
# define OptimizedCDebugFlags -O2
# if defined(SparcArchitecture)
# define ServerOSDefines -DDDXOSINIT
-# elif defined(AlphaArchitecture)
+# elif defined(AlphaArchitecture) || defined(MipsArchitecture)
# define ServerOSDefines XFree86ServerOSDefines
# elif defined(Arm32Architecture)
# define ServerOSDefines XFree86ServerOSDefines -DDDXTIME
@@ -248,6 +248,9 @@ XCOMM operating system: OSName (OSMajor
# ifndef XFree86ConsoleDefines
# define XFree86ConsoleDefines -DWSCONS_SUPPORT
# endif
+#elif defined(MipsArchitecture)
+# define XF86CardDrivers newport
+# define ServerExtraDefines GccGasOption XFree86ServerDefines
#else
# define ServerExtraDefines GccGasOption
#endif
@@ -537,7 +540,7 @@ InstallManPageAliasesBase(file,destdir,a
#include <bsdLib.rules>
#endif /* HasSharedLibraries */
-#if defined(i386Architecture) || defined(Arm32Architecture) || defined(AlphaArchitecture) || defined(PpcArchitecture)
+#if defined(i386Architecture) || defined(Arm32Architecture) || defined(AlphaArchitecture) || defined(PpcArchitecture) || defined(MipsArchitecture)
# include <xfree86.cf>
#endif
@@ -577,17 +580,6 @@ InstallManPageAliasesBase(file,destdir,a
#define BuildXF86DGA NO
#define BuildXInputExt NO
#include <xfree86.cf>
-#endif
-
-/*
- * Definition for compiling on MIPS machines
- */
-#ifdef MipsArchitecture
-#define PositionIndependentCFlags
-#define SharedLibraryLoadFlags -x -shared --whole-archive -soname `echo $@ |
-sed 's/\.[0-9]*$$//'`
-#define SharedXtReqs $(XLIBONLY) $(SMLIB) $(ICELIB)
-#define SharedXmuReqs $(LDPRELIB) $(XTOOLONLYLIB) $(XONLYLIB) $(EXTENSIONLIB)
#endif
/*
Index: xfree/xc/programs/Xserver/cfb/Imakefile
===================================================================
RCS file: /cvsroot/xsrc/xfree/xc/programs/Xserver/cfb/Imakefile,v
retrieving revision 1.1.1.3
diff -u -p -p -b -u -r1.1.1.3 Imakefile
--- xfree/xc/programs/Xserver/cfb/Imakefile 2001/06/09 15:01:56 1.1.1.3
+++ xfree/xc/programs/Xserver/cfb/Imakefile 2002/04/17 04:30:15
@@ -225,8 +225,11 @@ stipmipste.s: stipmips.s
clean::
$(RM) stipmipste.s
+stipmips.o: stipmips.s
+ $(CPP) stipmips.s AsmDefines | $(AS) -KPIC -o $@ -
+
stipmipste.o: stipmipste.s
- $(AS) -o $@ -DTETEXT stipmipste.s
+ $(CPP) -DTETEXT stipmipste.s AsmDefines | $(AS) -KPIC -o $@ -
#endif
#ifdef SparcArchitecture
Index: xfree/xc/programs/Xserver/hw/xfree86/drivers/newport/newport_driver.c
===================================================================
RCS file: /cvsroot/xsrc/xfree/xc/programs/Xserver/hw/xfree86/drivers/newport/newport_driver.c,v
retrieving revision 1.1.1.4
diff -u -p -p -b -u -r1.1.1.4 newport_driver.c
--- xfree/xc/programs/Xserver/hw/xfree86/drivers/newport/newport_driver.c 2002/01/19 15:10:05 1.1.1.4
+++ xfree/xc/programs/Xserver/hw/xfree86/drivers/newport/newport_driver.c 2002/04/17 04:30:20
@@ -732,6 +732,10 @@ NewportHWProbe(unsigned probedIDs[])
FILE* cpuinfo;
char line[80];
unsigned hasNewport = 0;
+
+#ifdef __NetBSD__
+ hasNewport = 1;
+#else
if ((cpuinfo = fopen("/proc/cpuinfo", "r"))) {
while(fgets(line, 80, cpuinfo) != NULL) {
if(strstr(line, "SGI Indy") != NULL) {
@@ -741,6 +745,7 @@ NewportHWProbe(unsigned probedIDs[])
}
fclose(cpuinfo);
}
+#endif
probedIDs[0] = 0;
return hasNewport;
Index: xfree/xc/programs/Xserver/hw/xfree86/os-support/Imakefile
===================================================================
RCS file: /cvsroot/xsrc/xfree/xc/programs/Xserver/hw/xfree86/os-support/Imakefile,v
retrieving revision 1.5
diff -u -p -p -b -u -r1.5 Imakefile
--- xfree/xc/programs/Xserver/hw/xfree86/os-support/Imakefile 2002/01/19 23:19:35 1.5
+++ xfree/xc/programs/Xserver/hw/xfree86/os-support/Imakefile 2002/04/17 04:30:24
@@ -14,6 +14,7 @@ XCOMM $XConsortium: Imakefile /main/9 19
(defined(SunArchitecture) && defined(SparcArchitecture)) || \
(defined(FreeBSDArchitecture) && defined(AlphaArchitecture)) || \
(defined(NetBSDArchitecture) && defined(AlphaArchitecture)) || \
+ (defined(NetBSDArchitecture) && defined(MipsArchitecture)) || \
(defined(NetBSDArchitecture) && defined(PpcArchitecture)) || \
(defined(NetBSDArchitecture) && defined(SparcArchitecture)) || \
(defined(OpenBSDArchitecture) && defined(PpcArchitecture)) || \
Index: xfree/xc/programs/Xserver/hw/xfree86/os-support/bsd/Imakefile
===================================================================
RCS file: /cvsroot/xsrc/xfree/xc/programs/Xserver/hw/xfree86/os-support/bsd/Imakefile,v
retrieving revision 1.8
diff -u -p -p -b -u -r1.8 Imakefile
--- xfree/xc/programs/Xserver/hw/xfree86/os-support/bsd/Imakefile 2002/03/28 14:38:11 1.8
+++ xfree/xc/programs/Xserver/hw/xfree86/os-support/bsd/Imakefile 2002/04/17 04:30:25
@@ -31,7 +31,7 @@ SHARED_CFLAGS = PositionIndependentCFlag
IOPERMDEFINES = -DUSE_ARC_MMAP
# elif defined(Arm32Architecture)
IOPERMDEFINES = -DUSE_ARM32_MMAP
-# elif defined(PpcArchitecture)
+# elif defined(PpcArchitecture) || defined(MipsArchitecture)
IOPERM_SRC = ioperm_noop.c
IOPERM_OBJ = ioperm_noop.o
# else
Index: xfree/xc/programs/Xserver/hw/xfree86/os-support/bsd/bsdResource.c
===================================================================
RCS file: /cvsroot/xsrc/xfree/xc/programs/Xserver/hw/xfree86/os-support/bsd/bsdResource.c,v
retrieving revision 1.4
diff -u -p -p -b -u -r1.4 bsdResource.c
--- xfree/xc/programs/Xserver/hw/xfree86/os-support/bsd/bsdResource.c 2001/06/09 17:56:50 1.4
+++ xfree/xc/programs/Xserver/hw/xfree86/os-support/bsd/bsdResource.c 2002/04/17 04:30:25
@@ -174,6 +174,77 @@ xf86AccResFromOS(resPtr ret)
return ret;
}
+#elif defined(__mips) || defined(__mips__)
+
+ /* XXX this isn't exactly correct but it will get the server working
+ * for now until we get something better.
+ */
+
+resRange PciAvoid[] = {_PCI_AVOID_PC_STYLE, _END};
+
+resPtr
+xf86BusAccWindowsFromOS(void)
+{
+ resPtr ret = NULL;
+ resRange range;
+
+ RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+
+ RANGE(range, 0x00000000, 0x0000ffff, ResExcIoBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+ return ret;
+}
+
+resPtr
+xf86PciBusAccWindowsFromOS(void)
+{
+ resPtr ret = NULL;
+ resRange range;
+
+ RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+
+ RANGE(range, 0x00000000, 0x0000ffff, ResExcIoBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+ return ret;
+}
+
+resPtr
+xf86IsaBusAccWindowsFromOS(void)
+{
+ resPtr ret = NULL;
+ resRange range;
+
+ RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+
+ RANGE(range, 0x00000000, 0x0000ffff, ResExcIoBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+ return ret;
+}
+
+resPtr
+xf86AccResFromOS(resPtr ret)
+{
+ resRange range;
+
+ /*
+ * At minimum, the top and bottom resources must be claimed, so that
+ * resources that are (or appear to be) unallocated can be relocated.
+ */
+ RANGE(range, 0x00000000, 0x00000000, ResExcMemBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+ RANGE(range, 0xffffffff, 0xffffffff, ResExcMemBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+ RANGE(range, 0x00000000, 0x00000000, ResExcIoBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+ RANGE(range, 0x0000ffff, 0x0000ffff, ResExcIoBlock);
+ ret = xf86AddResToList(ret, &range, -1);
+
+ return ret;
+}
+
#else
#error : Put your platform dependent code here!!
Index: xfree/xc/programs/Xserver/hw/xfree86/os-support/bus/Imakefile
===================================================================
RCS file: /cvsroot/xsrc/xfree/xc/programs/Xserver/hw/xfree86/os-support/bus/Imakefile,v
retrieving revision 1.5
diff -u -p -p -b -u -r1.5 Imakefile
--- xfree/xc/programs/Xserver/hw/xfree86/os-support/bus/Imakefile 2002/01/19 23:19:35 1.5
+++ xfree/xc/programs/Xserver/hw/xfree86/os-support/bus/Imakefile 2002/04/17 04:30:26
@@ -69,9 +69,11 @@ XCOMM generic FreeBSD PCI driver (using
PCIDRVRSRC = freebsdPci.c
PCIDRVROBJ = freebsdPci.o
-#elif defined(NetBSDArchitecture) && defined(AlphaArchitecture)
+#elif defined(NetBSDArchitecture) && \
+ (defined(AlphaArchitecture) || \
+ defined(MipsArchitecture))
-XCOMM Alpha (NetBSD) PCI driver
+XCOMM MIPS/Alpha (NetBSD) PCI driver
PCIDRVRSRC = netbsdPci.c
PCIDRVROBJ = netbsdPci.o
Index: xfree/xc/programs/Xserver/hw/xfree86/os-support/bus/Pci.h
===================================================================
RCS file: /cvsroot/xsrc/xfree/xc/programs/Xserver/hw/xfree86/os-support/bus/Pci.h,v
retrieving revision 1.5
diff -u -p -p -b -u -r1.5 Pci.h
--- xfree/xc/programs/Xserver/hw/xfree86/os-support/bus/Pci.h 2002/01/19 23:19:35 1.5
+++ xfree/xc/programs/Xserver/hw/xfree86/os-support/bus/Pci.h 2002/04/17 04:30:26
@@ -171,6 +171,9 @@
#elif defined(__alpha__) && defined(__NetBSD__)
# define ARCH_PCI_INIT netbsdPciInit
# define INCLUDE_XF86_MAP_PCI_MEM
+#elif defined(__mips__) && defined(__NetBSD__)
+# define ARCH_PCI_INIT netbsdPciInit
+# define INCLUDE_XF86_MAP_PCI_MEM
#else
# define ARCH_PCI_INIT ix86PciInit
# define INCLUDE_XF86_MAP_PCI_MEM
Index: xfree/xc/programs/Xserver/hw/xfree86/os-support/bus/netbsdPci.c
===================================================================
RCS file: /cvsroot/xsrc/xfree/xc/programs/Xserver/hw/xfree86/os-support/bus/netbsdPci.c,v
retrieving revision 1.3
diff -u -p -p -b -u -r1.3 netbsdPci.c
--- xfree/xc/programs/Xserver/hw/xfree86/os-support/bus/netbsdPci.c 2001/01/15 15:00:20 1.3
+++ xfree/xc/programs/Xserver/hw/xfree86/os-support/bus/netbsdPci.c 2002/04/17 04:30:26
@@ -94,7 +94,46 @@ netbsdPciCfgSetBits(PCITAG tag, int off,
val = (val & ~mask) | (bits & mask);
netbsdPciCfgWrite(tag, off, val);
}
-/* #elif defined(__something_else__) */
+#elif defined(__mips__)
+/*
+ * NetBSD/alpha platform specific PCI access functions.
+ * Needs NetBSD kernel version 1.5 or later.
+ */
+CARD32 netbsdPciCfgRead(PCITAG tag, int off);
+void netbsdPciCfgWrite(PCITAG, int off, CARD32 val);
+void netbsdPciCfgSetBits(PCITAG tag, int off, CARD32 mask, CARD32 bits);
+
+pciBusInfo_t netbsdPci0 = {
+ PCI_CFG_MECH_OTHER, 32, FALSE, 0, 0, 0,
+ { netbsdPciCfgRead, netbsdPciCfgWrite, netbsdPciCfgSetBits,
+ pciAddrNOOP, pciAddrNOOP},
+ NULL
+};
+
+void
+netbsdPciInit()
+{
+ pciNumBuses = 0;
+ pciBusInfo[0] = &netbsdPci0;
+ pciFindFirstFP = pciGenFindFirst;
+ pciFindNextFP = pciGenFindNext;
+}
+
+CARD32
+netbsdPciCfgRead(PCITAG tag, int off)
+{
+ return ~0;
+}
+
+void
+netbsdPciCfgWrite(PCITAG tag, int off, CARD32 val)
+{
+}
+
+void
+netbsdPciCfgSetBits(PCITAG tag, int off, CARD32 mask, CARD32 bits)
+{
+}
#else
# error architecture not supported
#endif
--==_Exmh_1729424365200--