hwd: decode some ACPI IDs
This commit is contained in:
+29
-4
@@ -16,7 +16,15 @@ fn acpi() -> Result<(), Box<dyn Error>> {
|
||||
let vendor_1 = (((vendor_rev >> 10) & 0x1f) as u8 + 64) as char;
|
||||
let vendor_2 = (((vendor_rev >> 5) & 0x1f) as u8 + 64) as char;
|
||||
let vendor_3 = (((vendor_rev >> 0) & 0x1f) as u8 + 64) as char;
|
||||
format!("{}{}{}{:04X}", vendor_1, vendor_2, vendor_3, device)
|
||||
//TODO: simplify this nibble swap
|
||||
let device_1 = (device >> 4) & 0xF;
|
||||
let device_2 = (device >> 0) & 0xF;
|
||||
let device_3 = (device >> 12) & 0xF;
|
||||
let device_4 = (device >> 8) & 0xF;
|
||||
format!(
|
||||
"{}{}{}{:01X}{:01X}{:01X}{:01X}",
|
||||
vendor_1, vendor_2, vendor_3, device_1, device_2, device_3, device_4
|
||||
)
|
||||
}
|
||||
AmlSerdeValue::String(string) => string,
|
||||
_ => {
|
||||
@@ -24,7 +32,24 @@ fn acpi() -> Result<(), Box<dyn Error>> {
|
||||
continue;
|
||||
}
|
||||
};
|
||||
log::debug!("{}: {}", name, id);
|
||||
let what = match id.as_str() {
|
||||
// https://uefi.org/specs/ACPI/6.5/05_ACPI_Software_Programming_Model.html
|
||||
"ACPI0006" => "GPE block device",
|
||||
"ACPI0010" => "Processor control device",
|
||||
// https://uefi.org/sites/default/files/resources/devids%20%285%29.txt
|
||||
"PNP0103" => "HPET",
|
||||
"PNP0303" => "IBM Enhanced (101/102-key, PS/2 mouse support)",
|
||||
"PNP0400" => "Standard LPT printer port",
|
||||
"PNP0501" => "16550A-compatible COM port",
|
||||
"PNP0A03" => "PCI bus",
|
||||
"PNP0A05" => "Generic ACPI bus",
|
||||
"PNP0A06" => "Generic ACPI Extended-IO bus (EIO bus)",
|
||||
"PNP0B00" => "AT real-time clock",
|
||||
"PNP0C0F" => "PCI interrupt link device",
|
||||
"PNP0F13" => "PS/2 port for PS/2-style mouse",
|
||||
_ => "?",
|
||||
};
|
||||
log::debug!("{}: {} ({})", name, id, what);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -36,8 +61,8 @@ fn main() {
|
||||
"misc",
|
||||
"hwd",
|
||||
"hwd",
|
||||
log::LevelFilter::Info,
|
||||
log::LevelFilter::Info,
|
||||
log::LevelFilter::Debug,
|
||||
log::LevelFilter::Debug,
|
||||
);
|
||||
|
||||
//TODO: HWD is meant to locate PCI/XHCI/etc devices in ACPI and DeviceTree definitions and start their drivers
|
||||
|
||||
Reference in New Issue
Block a user