代码
将#define SB_PCI_BUS_NUM 0xb 修改为
#define SB_PCI_BUS_NUM 0xa
void cm6130_extend_pcislots()
{
/*******************************************
*S1 S2 S3 S4 S5
*| | | | |
*master AD31 AD30 AD29 AD28
********************************************/
#define SB_PCI_BUS_NUM 0xa
#define SB_PCIBUS_INTA 0
#define SB_PCIBUS_INTB 1
#define SB_PCIBUS_INTC 2
#define SB_PCIBUS_INTD 3
/*******************************************
INTE#(SB_PCIBUS_INTA#) 5
INTF#(SB_PCIBUS_INTB#) 3
INTG#(SB_PCIBUS_INTC#) 3
INTH#(SB_PCIBUS_INTD#) 7
********************************************/
unsigned char interline[]={5,3,3,7};
unsigned char deviceIDint[]={0,0,0,SB_PCIBUS_INTA/*COMEJ2 3*/,SB_PCIBUS_INTB/*COMEJ3 4*/,0,0,0,0,0,0,0,SB_PCIBUS_INTA/*c*/,SB_PCIBUS_INTB/*d*/,SB_PCIBUS_INTC/*e*/,SB_PCIBUS_INTD/*f*/};
int func,dev,bus;
device_t pci_dev;
pcitag_t tag;
pcireg_t misc;
pcireg_t id;
bus = SB_PCI_BUS_NUM ;
for(dev = 0x0;dev <= 0xf;dev++)
{
tag= _pci_make_tag(bus , dev, 0);
misc = _pci_conf_read(tag, PCI_BHLC_REG);
if (PCI_HDRTYPE_MULTIFN(misc)) {
for(func = 0;func < 8; func++)
{
pci_dev = _pci_make_tag(bus , dev, func);
id = _pci_conf_read(pci_dev, PCI_ID_REG);
if (id == 0 || id == 0xffffffff) {
continue;
}
pci_write_config8(pci_dev,0x3c,interline[(deviceIDint[dev]+func)%4]);
fixup_interrupt_printf("fix interrupt line reg %d.%d.%d-ID(%x):%d\n",bus,dev,func,id,pci_read_config8(pci_dev,0x3c));
}
}
else
{
func = 0;
pci_dev = _pci_make_tag(bus, dev, func);
id = _pci_conf_read(pci_dev, PCI_ID_REG);
if (id == 0 || id == 0xffffffff) {
continue;
}
pci_write_config8(pci_dev,0x3c,interline[(deviceIDint[dev]+func)%4]);
fixup_interrupt_printf("fix interrupt line reg %d.%d.%d-ID(%x):%d\n",bus,dev,func,id,pci_read_config8(pci_dev,0x3c));
}
}
}