Skip to content

Commit

Permalink
framework_lib: Add Meteorlake definitions
Browse files Browse the repository at this point in the history
Allow customizing platform if not matched

- [x] ESRT GUIDs
  - [x] Retimer
  - [x] CSME
  - [x] BIOS
- [x] PD I2C Port an Address
- [x] `has_mec()`
- [x] SMBIOS Name

Signed-off-by: Daniel Schaefer <dhs@frame.work>
  • Loading branch information
JohnAZoidberg committed May 12, 2024
1 parent 72e0acb commit cee3f70
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 5 deletions.
10 changes: 8 additions & 2 deletions framework_lib/src/ccgx/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,14 @@ impl PdPort {
(Platform::IntelGen11, _) => 6,
(Platform::IntelGen12 | Platform::IntelGen13, PdPort::Left01) => 6,
(Platform::IntelGen12 | Platform::IntelGen13, PdPort::Right23) => 7,
(Platform::Framework13Amd | Platform::Framework16, PdPort::Left01) => 1,
(Platform::Framework13Amd | Platform::Framework16, PdPort::Right23) => 2,
(
Platform::Framework13Amd | Platform::Framework16 | Platform::IntelCoreUltra,
PdPort::Left01,
) => 1,
(
Platform::Framework13Amd | Platform::Framework16 | Platform::IntelCoreUltra,
PdPort::Right23,
) => 2,
// (_, _) => Err(EcError::DeviceError(format!(
// "Unsupported platform: {:?} {:?}",
// platform, self
Expand Down
2 changes: 1 addition & 1 deletion framework_lib/src/chromium_ec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ pub fn has_mec() -> bool {

!matches!(
smbios::get_platform().unwrap(),
Platform::Framework13Amd | Platform::Framework16
Platform::Framework13Amd | Platform::Framework16 | Platform::IntelCoreUltra
)
}

Expand Down
16 changes: 14 additions & 2 deletions framework_lib/src/esrt/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,21 @@ pub fn guid_from_str(string: &str) -> Option<Guid> {
pub const TGL_BIOS_GUID: Guid = guid!("b3bdb2e4-c5cb-5c1b-bdc3-e6fc132462ff");
pub const ADL_BIOS_GUID: Guid = guid!("a30a8cf3-847f-5e59-bd59-f9ec145c1a8c");
pub const RPL_BIOS_GUID: Guid = guid!("13fd4ed2-cba9-50ba-bb91-aece0acb4cc3");
pub const MTL_BIOS_GUID: Guid = guid!("1d981e5f-ecf9-4c73-b6ac-6502e6e03012");

pub const TGL_RETIMER01_GUID: Guid = guid!("832af090-2ef9-7c47-8f6d-b405c8c7f156");
pub const TGL_RETIMER23_GUID: Guid = guid!("20ef4108-6c64-d049-b6de-11ee35980b8f");
pub const ADL_RETIMER01_GUID: Guid = guid!("a9c91b0c-c0b8-463d-a7da-a5d6ec646333");
pub const ADL_RETIMER23_GUID: Guid = guid!("ba2e4e6e-3b0c-4f25-8a59-4c553fc86ea2");
pub const RPL_RETIMER01_GUID: Guid = guid!("0c42b824-818f-428f-8687-5efcaf059bea");
pub const RPL_RETIMER23_GUID: Guid = guid!("268ccbde-e087-420b-bf82-2212bd3f9bfc");
pub const MTL_RETIMER01_GUID: Guid = guid!("c57fd615-2ac9-4154-bf34-4dc715344408");
pub const MTL_RETIMER23_GUID: Guid = guid!("bdffce36-809c-4fa6-aecc-54536922f0e0");

pub const FL16_BIOS_GUID: Guid = guid!("6ae76af1-c002-5d64-8e18-658d205acf34");
pub const AMD13_BIOS_GUID: Guid = guid!("b5f7dcc1-568c-50f8-a4dd-e39d1f93fda1");
pub const RPL_CSME_GUID: Guid = guid!("865d322c-6ac7-4734-b43e-55db5a557d63");
pub const MTL_CSME_GUID: Guid = guid!("32d8d677-eebc-4947-8f8a-0693a45240e5");

// In EDK2
// Handled by MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c
Expand All @@ -91,13 +97,15 @@ pub enum FrameworkGuidKind {
TglBios,
AdlBios,
RplBios,
MtlBios,
TglRetimer01,
TglRetimer23,
AdlRetimer01,
AdlRetimer23,
RplRetimer01,
RplRetimer23,
RplCsme,
MtlCsme,
Fl16Bios,
Amd13Bios,
WinUx,
Expand All @@ -109,15 +117,19 @@ pub fn match_guid_kind(guid: &Guid) -> FrameworkGuidKind {
TGL_BIOS_GUID => FrameworkGuidKind::TglBios,
ADL_BIOS_GUID => FrameworkGuidKind::AdlBios,
RPL_BIOS_GUID => FrameworkGuidKind::RplBios,
MTL_BIOS_GUID => FrameworkGuidKind::MtlBios,
FL16_BIOS_GUID => FrameworkGuidKind::Fl16Bios,
AMD13_BIOS_GUID => FrameworkGuidKind::Amd13Bios,
TGL_RETIMER01_GUID => FrameworkGuidKind::TglRetimer01,
TGL_RETIMER23_GUID => FrameworkGuidKind::TglRetimer23,
ADL_RETIMER01_GUID => FrameworkGuidKind::AdlRetimer01,
ADL_RETIMER23_GUID => FrameworkGuidKind::AdlRetimer23,
RPL_RETIMER01_GUID => FrameworkGuidKind::RplRetimer01,
RPL_RETIMER23_GUID => FrameworkGuidKind::RplRetimer23,
MTL_RETIMER01_GUID => FrameworkGuidKind::RplRetimer01,
MTL_RETIMER23_GUID => FrameworkGuidKind::RplRetimer23,
RPL_CSME_GUID => FrameworkGuidKind::RplCsme,
FL16_BIOS_GUID => FrameworkGuidKind::Fl16Bios,
AMD13_BIOS_GUID => FrameworkGuidKind::Amd13Bios,
MTL_CSME_GUID => FrameworkGuidKind::MtlCsme,
WINUX_GUID => FrameworkGuidKind::WinUx,
_ => FrameworkGuidKind::Unknown,
}
Expand Down
1 change: 1 addition & 0 deletions framework_lib/src/smbios.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ pub fn get_platform() -> Option<Platform> {
"Laptop (13th Gen Intel Core)" => return Some(Platform::IntelGen13),
"Laptop 13 (AMD Ryzen 7040Series)" => return Some(Platform::Framework13Amd),
"Laptop 13 (AMD Ryzen 7040 Series)" => return Some(Platform::Framework13Amd),
"Laptop 13 (Intel Core Ultra)" => return Some(Platform::IntelCoreUltra),
"Laptop 16 (AMD Ryzen 7040 Series)" => return Some(Platform::Framework16),
_ => {}
}
Expand Down
2 changes: 2 additions & 0 deletions framework_lib/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ pub enum Platform {
IntelGen12,
/// Framework 13 - Intel 13th Gen, Codenamed RaptorLake
IntelGen13,
/// Framework 13 - Intel Core Ultra, Codenamed MeteorLake
IntelCoreUltra,
/// Framework 13 - AMD Ryzen
Framework13Amd,
/// Framework 16
Expand Down

0 comments on commit cee3f70

Please sign in to comment.