diff --git a/romimages/RON_VT5259A/Makefile b/romimages/RON_VT5259A/Makefile index 289c43286f..c7e75e09eb 100644 --- a/romimages/RON_VT5259A/Makefile +++ b/romimages/RON_VT5259A/Makefile @@ -15,8 +15,9 @@ CPUFLAGS += -DRAMTEST CPUFLAGS += -DCMD_LINE='"ro root=/dev/hda1 console=ttyS0,115200 single "' TOP=../.. -INCLUDES=-I $(TOP)/src/include -CFLAGS=$(INCLUDES) -O2 $(CPUFLAGS) -Ilinux/include -Wall +INCLUDES=-nostdinc -I $(TOP)/src/include +NOOPT_CFLAGS=$(INCLUDES) $(CPUFLAGS) -Wall +CFLAGS=$(NOOPT_CFLAGS) -O2 OBJECTS=crt0.o hardwaremain.o linuxbiosmain.o OBJECTS += mainboard.o mtrr.o subr.o fill_inbuf.o params.o @@ -123,16 +124,16 @@ microcode.o: $(TOP)/src/cpu/p6/microcode.c serial_subr.o: $(TOP)/chip/intel/serial_subr.c cc $(CFLAGS) -c $< -printk.o: $(TOP)/lib/printk.c +printk.o: $(TOP)/src/lib/printk.c cc $(CFLAGS) -c $< -vsprintf.o: $(TOP)/lib/vsprintf.c +vsprintf.o: $(TOP)/src/lib/vsprintf.c cc $(CFLAGS) -c $< -newpci.o: $(TOP)/lib/newpci.c +newpci.o: $(TOP)/src/lib/newpci.c cc $(CFLAGS) -c $< -linuxpci.o: $(TOP)/lib/linuxpci.c +linuxpci.o: $(TOP)/src/lib/linuxpci.c cc $(CFLAGS) -c $< vmlinux.bin.gz.block: vmlinux.bin.gz diff --git a/src/include/subr.h b/src/include/subr.h index 3019259dee..8295d0eb4f 100644 --- a/src/include/subr.h +++ b/src/include/subr.h @@ -35,7 +35,7 @@ void intel_set_mtrr(unsigned long rambase, unsigned long ramsizeK); #ifdef NEWPCI /* IRQ routing stuff */ -#include +#include #include #define PIRQ_SIGNATURE (('$' << 0) + ('P' << 8) + ('I' << 16) + ('R' << 24)) diff --git a/src/lib/linuxpci.c b/src/lib/linuxpci.c index 3c9828a77b..44026f4083 100644 --- a/src/lib/linuxpci.c +++ b/src/lib/linuxpci.c @@ -14,7 +14,8 @@ * RGM */ #include -#include +#include +#include extern void intel_post(unsigned char value); #define DEBUG @@ -205,14 +206,22 @@ unsigned int pci_scan_bus(struct pci_bus *bus) /* probe all devices on this bus with some optimization for non-existance and single funcion devices */ for (devfn = 0; devfn < 0xff; devfn++) { - u32 id, class, addr; + u32 id, class, addr; u8 cmd, tmp, hdr_type; - if (pcibios_read_config_dword(bus->number, devfn, PCI_VENDOR_ID, &id)) - continue; + // gcc just went to hell. Don't test -- this always + // returns 0 anyway. +#if GCC_WORKS_ON_O2 + if (pcibios_read_config_dword(bus->number, devfn, PCI_VENDOR_ID, &id)) { + DBG("PCI: devfn 0x%x, read_config_dword fails\n", devfn); + continue; + } +#endif + pcibios_read_config_dword(bus->number, devfn, PCI_VENDOR_ID, &id); /* some broken boards return 0 if a slot is empty: */ if (id == 0xffffffff || id == 0x00000000 || id == 0x0000ffff || id == 0xffff0000) { + DBG("PCI: devfn 0x%x, bad id 0x%x\n", devfn, id); if (PCI_FUNC(devfn) == 0x00) { /* if this is a function 0 device and it is not present, skip to next device */ @@ -222,11 +231,15 @@ unsigned int pci_scan_bus(struct pci_bus *bus) continue; } - if (pcibios_read_config_byte(bus->number, devfn, PCI_HEADER_TYPE, &hdr_type)) - continue; + if (pcibios_read_config_byte(bus->number, devfn, PCI_HEADER_TYPE, &hdr_type)){ + DBG("PCI: devfn 0x%x, header type read fails\n", devfn); + continue; + } - if (pcibios_read_config_dword(bus->number, devfn, PCI_CLASS_REVISION, &class)) + if (pcibios_read_config_dword(bus->number, devfn, PCI_CLASS_REVISION, &class)) { + DBG("PCI: devfn 0x%x, class read fails\n", devfn); continue; + } if ((dev = kmalloc(sizeof(*dev), GFP_ATOMIC)) == NULL) { printk("PCI: out of memory.\n"); @@ -332,9 +345,9 @@ unsigned int pci_scan_bus(struct pci_bus *bus) * this bus number as a peer bus, don't also scan it * as a child bus */ - if (((dev->vendor == PCI_VENDOR_ID_RCC) && - ((dev->device == PCI_DEVICE_ID_RCC_HE) || - (dev->device == PCI_DEVICE_ID_RCC_LE))) || + if (((dev->vendor == PCI_VENDOR_ID_SERVERWORKS) && + ((dev->device == PCI_DEVICE_ID_SERVERWORKS_HE) || + (dev->device == PCI_DEVICE_ID_SERVERWORKS_LE))) || ((dev->vendor == PCI_VENDOR_ID_COMPAQ) && (dev->device == PCI_DEVICE_ID_COMPAQ_6010)) || ((dev->vendor == PCI_VENDOR_ID_INTEL) && @@ -449,6 +462,7 @@ unsigned int pci_scan_bus(struct pci_bus *bus) * scan it. * @param bus The bus number supported by the peer bridge * @return Pointer to the bus struct for this bus number. + */ struct pci_bus *pci_scan_peer_bridge(int bus) { struct pci_bus *b; diff --git a/src/lib/subr.c b/src/lib/subr.c index 73aeb907ca..7511579f07 100644 --- a/src/lib/subr.c +++ b/src/lib/subr.c @@ -12,7 +12,7 @@ static char rcsid[] = "$Id$"; #include #include -#include +#include #include #ifdef SERIAL_CONSOLE @@ -119,28 +119,6 @@ void intel_post(char value) outb(value, 0x80); } -/* - * Write the special configuration registers on the INTEL - */ -void intel_conf_writeb(unsigned long port, unsigned char value) -{ - unsigned char whichbyte = port & 3; - port &= (~3); - outl(port, PCI_CONF_REG_INDEX); - outb(value, PCI_CONF_REG_DATA + whichbyte); -} - -/* - * Read the special configuration registers on the INTEL - */ -unsigned char intel_conf_readb(unsigned long port) -{ - unsigned char whichbyte = port & 3; - port &= (~3); - outl(port, PCI_CONF_REG_INDEX); - return inb(PCI_CONF_REG_DATA + whichbyte); -} - void intel_cache_on(unsigned long base, unsigned long totalram) { intel_post(0x60); diff --git a/src/southbridge/via/vt82c686/southbridge.c b/src/southbridge/via/vt82c686/southbridge.c index 1ffc29f7f3..85cd3300d5 100644 --- a/src/southbridge/via/vt82c686/southbridge.c +++ b/src/southbridge/via/vt82c686/southbridge.c @@ -1,4 +1,4 @@ -#include +#include #include #include