Index: programs/Xserver/hw/xfree86/os-support/bus/460gxPCI.c =================================================================== RCS file: /home/eich/cvs/xc/programs/Xserver/hw/xfree86/os-support/bus/460gxPCI.c,v retrieving revision 1.1.1.7 diff -u -r1.1.1.7 460gxPCI.c --- programs/Xserver/hw/xfree86/os-support/bus/460gxPCI.c 6 Jul 2004 15:12:47 -0000 1.1.1.7 +++ programs/Xserver/hw/xfree86/os-support/bus/460gxPCI.c 25 Aug 2004 13:11:33 -0000 @@ -201,32 +201,46 @@ * the chipset scan is to be stopped, or FALSE if the scan is to move on to the * next chipset. */ + Bool -xf86PreScan460GX(void) +xorgProbe460GX(scanpciWrapperOpt flags) { pciBusInfo_t *pBusInfo; PCITAG tag; - CARD32 tmp; - int i, devno; /* Bus zero should already be set up */ if (!(pBusInfo = pciBusInfo[0])) { cbn_460gx = -1; return FALSE; } - /* First look for a 460GX's primary host bridge */ tag = PCI_MAKE_TAG(0, 0x10, 0); - if (pciReadLong(tag, PCI_ID_REG) != DEVID(VENDOR_INTEL, CHIP_460GX_SAC)) { - cbn_460gx = -1; - return FALSE; + if (pciReadLong(tag, PCI_ID_REG) == DEVID(VENDOR_INTEL, CHIP_460GX_SAC)) { + return TRUE; } + cbn_460gx = -1; + + return FALSE; +} + +void +xf86PreScan460GX(void) +{ + pciBusInfo_t *pBusInfo; + PCITAG tag; + CARD32 tmp; + int i, devno; + + if (!(pBusInfo = pciBusInfo[0])) + return; + /* Get CBN (Chipset bus number) */ + tag = PCI_MAKE_TAG(0, 0x10, 0); if (!(cbn_460gx = (unsigned int)pciReadByte(tag, CBN))) { /* Sanity check failed */ cbn_460gx = -1; - return TRUE; + return; } if (pciNumBuses <= cbn_460gx) @@ -242,7 +256,7 @@ if (pciReadLong(tag, PCI_ID_REG) != DEVID(VENDOR_INTEL, CHIP_460GX_SAC)) { /* Sanity check failed */ cbn_460gx = -1; - return TRUE; + return; } /* @@ -257,7 +271,7 @@ DEVID(VENDOR_INTEL, CHIP_460GX_SAC)) { /* Sanity check failed */ cbn_460gx = -1; - return TRUE; + return; } if (devno == 0x10) @@ -278,7 +292,7 @@ if (cbdevs_460gx & (1 << devno)) { /* Sanity check failed */ cbn_460gx = -1; - return TRUE; + return; } /* @@ -294,7 +308,7 @@ if (cbdevs_460gx & (1 << devno)) { /* Sanity check failed */ cbn_460gx = -1; - return TRUE; + return; } /* @@ -310,7 +324,7 @@ break; /* Sanity check failed */ cbn_460gx = -1; - return TRUE; + return; } } @@ -337,7 +351,7 @@ break; } - return TRUE; + return; } /* This does some 460GX-related processing after the PCI bus scan */ Index: programs/Xserver/hw/xfree86/os-support/bus/460gxPCI.h =================================================================== RCS file: /home/eich/cvs/xc/programs/Xserver/hw/xfree86/os-support/bus/460gxPCI.h,v retrieving revision 1.1.1.3 diff -u -r1.1.1.3 460gxPCI.h --- programs/Xserver/hw/xfree86/os-support/bus/460gxPCI.h 6 Jul 2004 15:12:47 -0000 1.1.1.3 +++ programs/Xserver/hw/xfree86/os-support/bus/460gxPCI.h 25 Aug 2004 13:11:33 -0000 @@ -29,8 +29,10 @@ #define PCI_460GX_H 1 #include +#include -Bool xf86PreScan460GX(void); +Bool xorgProbe460GX(scanpciWrapperOpt flags); +void xf86PreScan460GX(void); void xf86PostScan460GX(void); #endif Index: programs/Xserver/hw/xfree86/os-support/bus/Imakefile =================================================================== RCS file: /home/eich/cvs/xc/programs/Xserver/hw/xfree86/os-support/bus/Imakefile,v retrieving revision 1.1.1.23 diff -u -r1.1.1.23 Imakefile --- programs/Xserver/hw/xfree86/os-support/bus/Imakefile 6 Jul 2004 15:12:47 -0000 1.1.1.23 +++ programs/Xserver/hw/xfree86/os-support/bus/Imakefile 25 Aug 2004 13:11:33 -0000 @@ -125,8 +125,8 @@ PCIARCHOBJ = sparcPci.o # endif #elif defined(ia64Architecture) -PCIARCHSRC = ia64Pci.c 460gxPCI.c e8870PCI.c zx1PCI.c -PCIARCHOBJ = ia64Pci.o 460gxPCI.o e8870PCI.o zx1PCI.o +PCIARCHSRC = 460gxPCI.c e8870PCI.c zx1PCI.c +PCIARCHOBJ = 460gxPCI.o e8870PCI.o zx1PCI.o #endif SRCS = Pci.c $(PCIDRVRSRC) $(SBUSDRVSRC) $(PCIARCHSRC) Index: programs/Xserver/hw/xfree86/os-support/bus/e8870PCI.c =================================================================== RCS file: /home/eich/cvs/xc/programs/Xserver/hw/xfree86/os-support/bus/e8870PCI.c,v retrieving revision 1.1.1.6 diff -u -r1.1.1.6 e8870PCI.c --- programs/Xserver/hw/xfree86/os-support/bus/e8870PCI.c 6 Jul 2004 15:12:47 -0000 1.1.1.6 +++ programs/Xserver/hw/xfree86/os-support/bus/e8870PCI.c 25 Aug 2004 13:11:33 -0000 @@ -34,17 +34,23 @@ #include "Pci.h" Bool -xf86PreScanE8870(void) +xorgProbeE8870(scanpciWrapperOpt flags) { PCITAG tag; /* Look for an E8870's Hub interface */ tag = PCI_MAKE_TAG(0, 0x1E, 0); - if (pciReadLong(tag, PCI_ID_REG) != DEVID(VENDOR_INTEL, CHIP_82801_P2P)) - return FALSE; + if (pciReadLong(tag, PCI_ID_REG) == DEVID(VENDOR_INTEL, CHIP_82801_P2P)) + return TRUE; + + return FALSE; +} +void +xf86PreScanE8870(void) +{ /* XXX Fill me in... */ - return TRUE; + return; } void Index: programs/Xserver/hw/xfree86/os-support/bus/e8870PCI.h =================================================================== RCS file: /home/eich/cvs/xc/programs/Xserver/hw/xfree86/os-support/bus/e8870PCI.h,v retrieving revision 1.1.1.4 diff -u -r1.1.1.4 e8870PCI.h --- programs/Xserver/hw/xfree86/os-support/bus/e8870PCI.h 6 Jul 2004 15:12:47 -0000 1.1.1.4 +++ programs/Xserver/hw/xfree86/os-support/bus/e8870PCI.h 25 Aug 2004 13:11:33 -0000 @@ -29,8 +29,10 @@ #define PCI_E8870_H 1 #include +#include -Bool xf86PreScanE8870(void); +Bool xorgProbeE8870(scanpciWrapperOpt flags); +void xf86PreScanE8870(void); void xf86PostScanE8870(void); #endif Index: programs/Xserver/hw/xfree86/os-support/bus/ia64Pci.c =================================================================== RCS file: programs/Xserver/hw/xfree86/os-support/bus/ia64Pci.c diff -N programs/Xserver/hw/xfree86/os-support/bus/ia64Pci.c --- programs/Xserver/hw/xfree86/os-support/bus/ia64Pci.c 6 Jul 2004 15:12:47 -0000 1.1.1.6 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,61 +0,0 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/ia64Pci.c,v 1.3 2003/02/23 20:26:49 tsi Exp $ */ -/* - * Copyright (C) 2002-2003 The XFree86 Project, Inc. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name of the XFree86 Project shall - * not be used in advertising or otherwise to promote the sale, use or other - * dealings in this Software without prior written authorization from the - * XFree86 Project. - */ - -/* - * This file contains the glue needed to support various IA-64 chipsets. - */ - -#include "460gxPCI.h" -#include "e8870PCI.h" -#include "zx1PCI.h" -#include "Pci.h" - -void -ia64ScanPCIWrapper(scanpciWrapperOpt flags) -{ - - if (flags == SCANPCI_INIT) { - - /* PCI configuration space probes should be done first */ - if (xf86PreScan460GX()) - return; - if (xf86PreScanE8870()) - return; -#if 0 - if (xf86PreScanZX1()) - return; -#endif - } else /* if (flags == SCANPCI_TERM) */ { - - xf86PostScan460GX(); - xf86PostScanE8870(); -#if 0 - xf86PostScanZX1(); -#endif - } - -} Index: programs/Xserver/hw/xfree86/os-support/bus/zx1PCI.c =================================================================== RCS file: /home/eich/cvs/xc/programs/Xserver/hw/xfree86/os-support/bus/zx1PCI.c,v retrieving revision 1.1.1.10 diff -u -r1.1.1.10 zx1PCI.c --- programs/Xserver/hw/xfree86/os-support/bus/zx1PCI.c 6 Jul 2004 15:12:47 -0000 1.1.1.10 +++ programs/Xserver/hw/xfree86/os-support/bus/zx1PCI.c 25 Aug 2004 13:11:33 -0000 @@ -465,13 +465,7 @@ NULL, /* bridge -- dynamically set */ }; -/* - * This checks for, and validates, the presence of the ZX1 chipset, and sets - * pZX1mio to a non-NULL pointer accordingly. This function is called before - * the server's PCI bus scan and returns TRUE if the chipset scan is to be - * stopped, or FALSE if the scan is to move on to the next chipset. - */ -Bool +void xf86PreScanZX1(void) { resRange range; @@ -491,7 +485,7 @@ mapSize = MIO_SIZE; if (!(pZX1mio = xf86MapVidMem(-1, VIDMEM_MMIO, MIO_BASE, mapSize))) - return FALSE; + return; /* Look for ZX1's SBA and IOC */ /* XXX What about Dino? */ if ((MIO_LONG(MIO_FUNCTION0 + PCI_ID_REG) != @@ -500,7 +494,7 @@ DEVID(VENDOR_HP, CHIP_ZX1_IOC))) { xf86UnMapVidMem(-1, pZX1mio, mapSize); pZX1mio = NULL; - return FALSE; + return; } /* Map rope configuration space */ @@ -510,7 +504,7 @@ !(pZX1ioa = xf86MapVidMem(-1, VIDMEM_MMIO, ioaaddr, IOA_SIZE))) { xf86UnMapVidMem(-1, pZX1mio, mapSize); pZX1mio = NULL; - return TRUE; + return; } for (i = 0; i < 8; i++) { @@ -924,7 +918,7 @@ nRange = 0; - return TRUE; + return; } /* This is called to finalise the results of a PCI bus scan */ Index: programs/Xserver/hw/xfree86/os-support/bus/zx1PCI.h =================================================================== RCS file: /home/eich/cvs/xc/programs/Xserver/hw/xfree86/os-support/bus/zx1PCI.h,v retrieving revision 1.1.1.4 diff -u -r1.1.1.4 zx1PCI.h --- programs/Xserver/hw/xfree86/os-support/bus/zx1PCI.h 6 Jul 2004 15:12:47 -0000 1.1.1.4 +++ programs/Xserver/hw/xfree86/os-support/bus/zx1PCI.h 25 Aug 2004 13:11:33 -0000 @@ -30,7 +30,7 @@ #include -Bool xf86PreScanZX1(void); +void xf86PreScanZX1(void); void xf86PostScanZX1(void); #endif Index: programs/Xserver/hw/xfree86/os-support/linux/Imakefile =================================================================== RCS file: /home/eich/cvs/xc/programs/Xserver/hw/xfree86/os-support/linux/Imakefile,v retrieving revision 1.1.1.15 diff -u -r1.1.1.15 Imakefile --- programs/Xserver/hw/xfree86/os-support/linux/Imakefile 6 Jul 2004 15:12:49 -0000 1.1.1.15 +++ programs/Xserver/hw/xfree86/os-support/linux/Imakefile 25 Aug 2004 13:11:33 -0000 @@ -38,27 +38,32 @@ #endif #if defined(AlphaArchitecture) -AXP_SRC=lnx_ev56.c xf86Axp.c lnx_axp.c -AXP_OBJ=lnx_ev56.o xf86Axp.o lnx_axp.o +PLATFORM_SRC=lnx_ev56.c xf86Axp.c lnx_axp.c +PLATFORM_OBJ=lnx_ev56.o xf86Axp.o lnx_axp.o +#endif +#if defined (ia64Architecture) +PLATFORM_SRC=ia64Pci.c lnx_ia64.c +PLATFORM_OBJ=ia64Pci.o lnx_ia64.o +PLATFORM_DEFINES=-DOS_PROBE_PCI_CHIPSET=lnxProbePciChipset #endif SRCS = lnx_init.c lnx_video.c lnx_io.c libc_wrapper.c bios_mmap.c \ VTsw_usl.c std_kbdEv.c posix_tty.c $(MOUSESRC) \ lnx_pci.c vidmem.c lnx_apm.c $(JOYSTICK_SRC) $(DRI_SRC) $(RES_SRCS) \ - $(AXP_SRC) lnx_kmod.c lnx_agp.c $(KBDSRC) /*wcHelper.c*/ + $(PLATFORM_SRC) lnx_kmod.c lnx_agp.c $(KBDSRC) /*wcHelper.c*/ OBJS = lnx_init.o lnx_video.o lnx_io.o libc_wrapper.o bios_mmap.o \ VTsw_usl.o std_kbdEv.o posix_tty.o $(MOUSEOBJ) \ lnx_pci.o vidmem.o lnx_apm.o $(JOYSTICK_OBJ) $(DRI_OBJ) $(RES_OBJS) \ - $(AXP_OBJ) lnx_kmod.o lnx_agp.o $(KBDOBJ) /*wcHelper.o*/ + $(PLATFORM_OBJ) lnx_kmod.o lnx_agp.o $(KBDOBJ) /*wcHelper.o*/ INCLUDES = -I$(XF86COMSRC) -I$(XF86OSSRC) -I. -I$(SERVERSRC)/include \ -I$(XINCLUDESRC) -I$(EXTINCSRC) -I$(XF86OSSRC)/shared \ - -I$(DRMSRCDIR)/shared + -I$(XF86OSSRC)/bus -I$(DRMSRCDIR)/shared RESDEFINES = -DUSESTDRES -DEFINES = $(MTRRDEFINES) $(RESDEFINES) -DHAVE_SYSV_IPC +DEFINES = $(MTRRDEFINES) $(RESDEFINES) $(PLATFORM_DEFINES) -DHAVE_SYSV_IPC #if defined(AlphaArchitecture) SpecialObjectRule(lnx_ev56.o, lnx_ev56.c, -mcpu=ev56) @@ -113,6 +118,9 @@ #endif #if defined(AlphaArchitecture) LinkSourceFile(xf86Axp.c,../shared) +#endif +#if defined(ia64Architecture) +LinkSourceFile(ia64Pci.c,../shared) #endif DependTarget() Index: programs/Xserver/hw/xfree86/os-support/linux/lnx_ia64.c =================================================================== RCS file: programs/Xserver/hw/xfree86/os-support/linux/lnx_ia64.c diff -N programs/Xserver/hw/xfree86/os-support/linux/lnx_ia64.c @@ -0,0 +1,45 @@ +/* + * Copyright 2004, Egbert Eich + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * EGBERT EICH BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CON- + * NECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the name of Egbert Eich shall not + * be used in advertising or otherwise to promote the sale, use or other deal- + *ings in this Software without prior written authorization from Egbert Eich. + * + */ + +#include +#include +#include + +#include "ia64Pci.h" +#include "Pci.h" + +#if defined OS_PROBE_PCI_CHIPSET +IA64Chipset OS_PROBE_PCI_CHIPSET(scanpciWrapperOpt flags) +{ + struct stat unused; + + if (!stat("/proc/bus/mckinley/zx1",&unused) + || !stat("/proc/bus/mckinley/zx2",&unused)) + return ZX1_CHIPSET; + + return NONE_CHIPSET; +} +#endif Index: programs/Xserver/hw/xfree86/os-support/shared/ia64Pci.c =================================================================== RCS file: programs/Xserver/hw/xfree86/os-support/shared/ia64Pci.c diff -N programs/Xserver/hw/xfree86/os-support/shared/ia64Pci.c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ programs/Xserver/hw/xfree86/os-support/shared/ia64Pci.c 25 Aug 2004 13:11:33 -0000 @@ -0,0 +1,81 @@ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/ia64Pci.c,v 1.3 2003/02/23 20:26:49 tsi Exp $ */ +/* + * Copyright (C) 2002-2003 The XFree86 Project, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the name of the XFree86 Project shall + * not be used in advertising or otherwise to promote the sale, use or other + * dealings in this Software without prior written authorization from the + * XFree86 Project. + */ + +/* + * This file contains the glue needed to support various IA-64 chipsets. + */ + +#include "460gxPCI.h" +#include "e8870PCI.h" +#include "zx1PCI.h" +#include "Pci.h" +#include "ia64Pci.h" + +void +ia64ScanPCIWrapper(scanpciWrapperOpt flags) +{ + static IA64Chipset chipset = NONE_CHIPSET; + + if (flags == SCANPCI_INIT) { + + /* PCI configuration space probes should be done first */ + if (xorgProbe460GX(flags)) { + chipset = I460GX_CHIPSET; + xf86PreScan460GX(); + return; + } else if (xorgProbeE8870(flags)) { + chipset = E8870_CHIPSET; + xf86PreScanE8870(); + return; + } +#ifdef OS_PROBE_PCI_CHIPSET + chipset = OS_PROBE_PCI_CHIPSET(flags); + switch (chipset) { + case ZX1_CHIPSET: + xf86PreScanZX1(); + return; + default: + return; + } +#endif + } else /* if (flags == SCANPCI_TERM) */ { + + switch (chipset) { + case I460GX_CHIPSET: + xf86PostScan460GX(); + return; + case E8870_CHIPSET: + xf86PostScanE8870(); + return; + case ZX1_CHIPSET: + xf86PostScanZX1(); + return; + default: + return; + } + } +} Index: programs/Xserver/hw/xfree86/os-support/shared/ia64Pci.h =================================================================== RCS file: programs/Xserver/hw/xfree86/os-support/shared/ia64Pci.h diff -N programs/Xserver/hw/xfree86/os-support/shared/ia64Pci.h --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ programs/Xserver/hw/xfree86/os-support/shared/ia64Pci.h 25 Aug 2004 13:11:33 -0000 @@ -0,0 +1,41 @@ +/* + * Copyright 2004, Egbert Eich + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * EGBERT EICH BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CON- + * NECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the name of Egbert Eich shall not + * be used in advertising or otherwise to promote the sale, use or other deal- + *ings in this Software without prior written authorization from Egbert Eich. + * + */ +#ifndef _IA64_PCI_H +# define _IA64_PCI_H + +#include "Pci.h" + +typedef enum { + NONE_CHIPSET, + I460GX_CHIPSET, + E8870_CHIPSET, + ZX1_CHIPSET +} IA64Chipset; + +# ifdef OS_PROBE_PCI_CHIPSET +extern IA64Chipset OS_PROBE_PCI_CHIPSET(scanpciWrapperOpt flags); +# endif +#endif