board_inspector: collect descriptions of ACPI devices

_STR is another device identification object defined in ACPI spec that
describes a device. This patch collects this string (when available) into
board XML as well.

Tracked-On: #6287
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
This commit is contained in:
Junjie Mao 2021-06-22 11:16:51 +08:00 committed by wenlingz
parent 127e12a56a
commit b119a0b824

View File

@ -145,6 +145,11 @@ def fetch_device_info(devices_node, interpreter, namepath):
element.tag = "bus"
element.set("type", buses[hid])
# Description
if interpreter.context.has_symbol(f"{namepath}._STR"):
desc = interpreter.interpret_method_call(f"{namepath}._STR").get().decode(encoding="utf-16").strip("\00")
element.set("description", desc)
# Address
if interpreter.context.has_symbol(f"{namepath}._ADR"):
adr = interpreter.interpret_method_call(f"{namepath}._ADR").get()