Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion framework_lib/src/commandline/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ use crate::chromium_ec::{EcError, EcResult};
#[cfg(target_os = "linux")]
use crate::csme;
use crate::ec_binary;
use crate::esrt;
use crate::esrt::{self, ResourceType};
#[cfg(feature = "rusb")]
use crate::inputmodule::check_inputmodule_version;
#[cfg(target_os = "linux")]
Expand Down Expand Up @@ -708,6 +708,23 @@ fn print_versions(ec: &CrosEc) {
// This means there's a bug, we should've found one but didn't
println!(" Unknown");
}
} else {
// If we don't know the GUID, print all the device firmwares in ESRT
println!("Intel Retimers (Potential)");
if let Some(esrt) = esrt::get_esrt() {
for entry in esrt.entries.iter() {
if ResourceType::from_int(entry.fw_type) != ResourceType::DeviceFirmware {
continue;
}
println!(" GUID: {}", entry.fw_class);
println!(
" Version: 0x{:X} ({})",
entry.fw_version, entry.fw_version
);
}
} else {
println!("Could not find and parse ESRT table.");
}
}
match parade_retimer::get_version(ec) {
// Does not exist
Expand Down
4 changes: 2 additions & 2 deletions framework_lib/src/esrt/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ pub struct Esrt {
// Current Entry Version
pub const ESRT_FIRMWARE_RESOURCE_VERSION: u64 = 1;

#[derive(Debug)]
#[derive(Debug, PartialEq)]
pub enum ResourceType {
Unknown = 0,
SystemFirmware = 1,
Expand All @@ -262,7 +262,7 @@ pub enum ResourceType {
}

impl ResourceType {
fn from_int(i: u32) -> Self {
pub fn from_int(i: u32) -> Self {
match i {
1 => Self::SystemFirmware,
2 => Self::DeviceFirmware,
Expand Down