When probing a PCIe device, it will assign INTx to it.
1 | pci_device_probe |
If we use GICv3:
1 | gic_acpi_init |
We can get GICD domain like above.
dev->pin had been set in below flow:
1 | pci_setup_device |
We can add INTx configure in ACPI DSDT as described in 6.2.13.1 in ACPI spec 6.1.
1 | Name(_PRT, Package{ |
If interrup_controller field is 0, we will use “global interrupt pool” mentioned
in ACPI spec. In ARM world, this “global interrupt pool” will be GICD which is
defined in above gic_acpi_init
If our hardware topology is like this:
1 | system bus |
We can configure the INTx _RPT as:
1 | Name(_PRT, Package{ |
NOTE:
把dts下INTx中断的解析也放到这个文档里吧,不想另外起文档了。调用链大致是:
1 | pci_device_add() |
可见,PCI的核心代码pci_device_add()会扫面dts中的信息,然后给对应的中断分配
中断号资源。分配好中断号(virq)会写到pci_dev->irq中,供pci设备驱动注册中断handler
的时候使用。各个pci设备中注册的中断handler有时会共享一个INTx中短线(e.g. INTa)。
这时一旦一个INTx中断被触发,不同设备上的中断handler都会被调用到。可见注册的时候,
这些中断handler都应该是shareable的。