diff --git a/misc/config_tools/board_inspector/extractors/50-acpi.py b/misc/config_tools/board_inspector/extractors/50-acpi.py index 7a917ca5c..cd7bd7b7f 100644 --- a/misc/config_tools/board_inspector/extractors/50-acpi.py +++ b/misc/config_tools/board_inspector/extractors/50-acpi.py @@ -142,11 +142,32 @@ def fetch_device_info(devices_node, interpreter, namepath): else: hid = "" + # Compatible ID + cids = [] + if interpreter.context.has_symbol(f"{namepath}._CID"): + cid_object = interpreter.interpret_method_call(f"{namepath}._CID") + if isinstance(cid_object, (datatypes.String, datatypes.Integer)): + cid_data = [cid_object] + elif isinstance(cid_object, datatypes.Package): + cid_data = cid_object.elements + + for cid_datum in cid_data: + if isinstance(cid_datum, datatypes.Integer): + eisa_id = parse_eisa_id(cid_datum.get()) + if eisa_id: + cids.append(eisa_id) + else: + cids.append(hex(cid_datum.get())) + elif isinstance(cid_datum, datatypes.String): + cids.append(cid_datum.get()) + # Create the XML element for the device and create its ancestors if necessary element = get_device_element(devices_node, namepath, hid) if hid in buses.keys(): element.tag = "bus" element.set("type", buses[hid]) + for cid in cids: + add_child(element, "compatible_id", cid) # Description if interpreter.context.has_symbol(f"{namepath}._STR"): diff --git a/misc/config_tools/board_inspector/extractors/90-sorting.py b/misc/config_tools/board_inspector/extractors/90-sorting.py index 9a8b448ce..82d485fc2 100644 --- a/misc/config_tools/board_inspector/extractors/90-sorting.py +++ b/misc/config_tools/board_inspector/extractors/90-sorting.py @@ -23,7 +23,7 @@ def getkey(child): return 0xFFFFFFFF tags = ["vendor", "identifier", "subsystem_vendor", "subsystem_identifier", "class", - "acpi_object", "status", + "acpi_object", "compatible_id", "status", "resource", "capability", "interrupt_pin_routing", "bus", "device"] if child.tag == "resource":