--- trunk/src/devices/bus_pci.c 2007/10/08 16:19:37 22 +++ trunk/src/devices/bus_pci.c 2007/10/08 16:19:56 24 @@ -25,7 +25,7 @@ * SUCH DAMAGE. * * - * $Id: bus_pci.c,v 1.62 2006/02/18 21:03:12 debug Exp $ + * $Id: bus_pci.c,v 1.65 2006/05/10 03:32:32 debug Exp $ * * Generic PCI bus framework. This is not a normal "device", but is used by * individual PCI controllers and devices. @@ -60,7 +60,9 @@ extern int verbose; -/* #define debug fatal */ +#ifdef UNSTABLE_DEVEL +#define debug fatal +#endif /* @@ -164,9 +166,9 @@ pci_data->last_was_write_ffffffff = 0; debug("[ bus_pci: read from PCI DATA, bus %i, device " - "%i, function %i (%s) register 0x%02x: 0x%08lx ]\n", (long) - pci_data->cur_bus, pci_data->cur_device, - pci_data->cur_func, dev->name, pci_data->cur_reg, (long)*data); + "%i, function %i (%s) register 0x%02x: (len=%i) 0x%08lx ]\n", + pci_data->cur_bus, pci_data->cur_device, pci_data->cur_func, + dev->name, pci_data->cur_reg, len, (long)*data); } @@ -286,7 +288,7 @@ PCI_SET_DATA(PCI_MAPREG_START + pd->cur_mapreg_offset, port | PCI_MAPREG_TYPE_IO); PCI_SET_DATA_SIZE(PCI_MAPREG_START + pd->cur_mapreg_offset, - portsize - 1); + ((portsize - 1) & ~0xf) | 0xd); pd->cur_mapreg_offset += sizeof(uint32_t); } @@ -297,7 +299,7 @@ pd->pcibus->cur_pci_membase = mem; PCI_SET_DATA(PCI_MAPREG_START + pd->cur_mapreg_offset, mem); PCI_SET_DATA_SIZE(PCI_MAPREG_START + pd->cur_mapreg_offset, - memsize - 1); + ((memsize - 1) & ~0xf) | 0x0); pd->cur_mapreg_offset += sizeof(uint32_t); } @@ -644,6 +646,7 @@ PCIINIT(i31244) { uint64_t port, memaddr; + int irq = 0; PCI_SET_DATA(PCI_ID_REG, PCI_ID_CODE(PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_31244)); @@ -653,17 +656,18 @@ switch (machine->machine_type) { case MACHINE_IQ80321: - /* S-PCI-X slot uses PCI IRQ A */ + /* S-PCI-X slot uses PCI IRQ A, int 29 */ + irq = (1 << 8) + 29; break; default:fatal("i31244 in non-implemented machine type %i\n", machine->machine_type); exit(1); } - PCI_SET_DATA(PCI_INTERRUPT_REG, 0x28140100); + PCI_SET_DATA(PCI_INTERRUPT_REG, 0x01100000 | irq); - allocate_device_space(pd, 0x400, 0, &port, &memaddr); - allocate_device_space(pd, 0x400, 0, &port, &memaddr); + allocate_device_space(pd, 0x1000, 0, &port, &memaddr); + allocate_device_space(pd, 0x1000, 0, &port, &memaddr); /* PCI IDE using dev_wdc: */ if (diskimage_exist(machine, 0, DISKIMAGE_IDE) ||