board_inspector: add index info to INTx pins from device objects

INTx routing can be specified in ACPI PRT (PCI Routing Table) in two ways:

    1. By an absolute interrupt line from the global interrupt pool.
    2. By a device object and an index to its interrupt resource.

The board inspector today only encodes the source object of an interrupt
pin routing in XML device resource descriptors, which is incomplete if the
source is a device object (i.e. case 2 above).

This patch adds the index from PRT to device resource nodes as well.

Tracked-On: #7058
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
This commit is contained in:
Junjie Mao 2022-01-25 21:13:05 +08:00 committed by acrnsi-robot
parent b32c56c540
commit ed06539aae

View File

@ -148,6 +148,8 @@ def parse_device(bus_node, device_path):
mapping = device_node.xpath(f"../interrupt_pin_routing/routing[@address='{prt_address}']/mapping[@pin='{pin_name}']")
if len(mapping) > 0:
res_node.set("source", mapping[0].get("source"))
if "index" in mapping[0].keys():
res_node.set("index", mapping[0].get("index"))
# Secondary bus
if cfg.header.header_type == 1: