File tree Expand file tree Collapse file tree 2 files changed +23
-3
lines changed Expand file tree Collapse file tree 2 files changed +23
-3
lines changed Original file line number Diff line number Diff line change @@ -59,8 +59,7 @@ use crate::touchpad::print_touchpad_fw_ver;
59
59
use crate :: touchscreen;
60
60
#[ cfg( feature = "uefi" ) ]
61
61
use crate :: uefi:: enable_page_break;
62
- use crate :: util;
63
- use crate :: util:: { Config , Platform , PlatformFamily } ;
62
+ use crate :: util:: { self , Config , Platform , PlatformFamily } ;
64
63
#[ cfg( feature = "hidapi" ) ]
65
64
use hidapi:: HidApi ;
66
65
use sha2:: { Digest , Sha256 , Sha384 , Sha512 } ;
@@ -557,7 +556,7 @@ fn print_versions(ec: &CrosEc) {
557
556
}
558
557
559
558
#[ cfg( target_os = "linux" ) ]
560
- {
559
+ if smbios :: get_platform ( ) . and_then ( Platform :: which_cpu_vendor ) != Some ( util :: CpuVendor :: Amd ) {
561
560
println ! ( "CSME" ) ;
562
561
if let Ok ( csme) = csme:: csme_from_sysfs ( ) {
563
562
info ! ( " Enabled: {}" , csme. enabled) ;
Original file line number Diff line number Diff line change @@ -49,7 +49,28 @@ pub enum PlatformFamily {
49
49
FrameworkDesktop ,
50
50
}
51
51
52
+ #[ derive( Debug , PartialEq , Clone , Copy ) ]
53
+ pub enum CpuVendor {
54
+ Intel ,
55
+ Amd ,
56
+ }
57
+
52
58
impl Platform {
59
+ pub fn which_cpu_vendor ( self ) -> Option < CpuVendor > {
60
+ match self {
61
+ Platform :: Framework12IntelGen13
62
+ | Platform :: IntelGen11
63
+ | Platform :: IntelGen12
64
+ | Platform :: IntelGen13
65
+ | Platform :: IntelCoreUltra1 => Some ( CpuVendor :: Intel ) ,
66
+ Platform :: Framework13Amd7080
67
+ | Platform :: Framework13AmdAi300
68
+ | Platform :: Framework16Amd7080
69
+ | Platform :: FrameworkDesktopAmdAiMax300 => Some ( CpuVendor :: Amd ) ,
70
+ Platform :: GenericFramework ( ..) => None ,
71
+ Platform :: UnknownSystem => None ,
72
+ }
73
+ }
53
74
pub fn which_family ( self ) -> Option < PlatformFamily > {
54
75
match self {
55
76
Platform :: Framework12IntelGen13 => Some ( PlatformFamily :: Framework12 ) ,
You can’t perform that action at this time.
0 commit comments