780l修改中断路由的代码

代码

将#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));

                }

        }


}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值