diff --git a/README.md b/README.md index eb44489e..033a86d8 100644 --- a/README.md +++ b/README.md @@ -65,6 +65,7 @@ On UEFI and FreeBSD raw port I/O is used - on Linux this can also be used as a f | AMD Ryzen AI 300 | Yes | [6.12](https://github.com/torvalds/linux/commit/62be134abf4250474a7a694837064bc783d2b291) | Yes | | Framework 16 | | | | | AMD Ryzen 7040 | Yes | [6.10](https://github.com/torvalds/linux/commit/c8f460d991df93d87de01a96b783cad5a2da9616) | BIOS 3.06+ | +| AMD Ryzen AI 300 | Yes | [6.10](https://github.com/torvalds/linux/commit/c8f460d991df93d87de01a96b783cad5a2da9616) | Yes | | Framework Desktop | | | | | AMD Ryzen AI Max | Yes | [6.15](https://github.com/torvalds/linux/commit/d83c45aeec9b223fe6db4175e9d1c4f5699cc37a) | Yes | @@ -129,6 +130,7 @@ All of these need EC communication support in order to work. - [x] Framework Laptop 13 (AMD Ryzen 7080) - [x] Framework Laptop 13 (AMD Ryzen AI 300) - [x] Framework Laptop 16 (AMD Ryzen 7080) +- [x] Framework Laptop 16 (AMD Ryzen AI 300) - [x] Framework Desktop (AMD Ryzen AI Max 300) - [x] Port I/O communication on Linux - [x] Port I/O communication in UEFI diff --git a/framework_lib/src/ccgx/device.rs b/framework_lib/src/ccgx/device.rs index bd13f6df..4e25b883 100644 --- a/framework_lib/src/ccgx/device.rs +++ b/framework_lib/src/ccgx/device.rs @@ -65,16 +65,18 @@ impl PdPort { ( Platform::Framework13Amd7080 | Platform::Framework13AmdAi300 - | Platform::Framework16Amd7080, + | Platform::Framework16Amd7080 + | Platform::Framework16AmdAi300, PdPort::Right01, ) => 0x42, ( Platform::Framework13Amd7080 | Platform::Framework13AmdAi300 - | Platform::Framework16Amd7080, + | Platform::Framework16Amd7080 + | Platform::Framework16AmdAi300, PdPort::Left23, ) => 0x40, - (Platform::Framework16Amd7080, PdPort::Back) => 0x42, + (Platform::Framework16Amd7080 | Platform::Framework16AmdAi300, PdPort::Back) => 0x42, (Platform::FrameworkDesktopAmdAiMax300, PdPort::Back) => 0x08, (Platform::FrameworkDesktopAmdAiMax300, _) => unsupported?, // Framework Intel Platforms (CCG5 and CCG6) @@ -120,6 +122,7 @@ impl PdPort { ( Platform::Framework13Amd7080 | Platform::Framework16Amd7080 + | Platform::Framework16AmdAi300 | Platform::IntelCoreUltra1 | Platform::Framework13AmdAi300 | Platform::Framework12IntelGen13, @@ -128,12 +131,13 @@ impl PdPort { ( Platform::Framework13Amd7080 | Platform::Framework16Amd7080 + | Platform::Framework16AmdAi300 | Platform::IntelCoreUltra1 | Platform::Framework13AmdAi300 | Platform::Framework12IntelGen13, PdPort::Left23, ) => 2, - (Platform::Framework16Amd7080, PdPort::Back) => 5, + (Platform::Framework16Amd7080 | Platform::Framework16AmdAi300, PdPort::Back) => 5, (Platform::FrameworkDesktopAmdAiMax300, PdPort::Back) => 1, (Platform::FrameworkDesktopAmdAiMax300, _) => unsupported?, (Platform::UnknownSystem, _) => { diff --git a/framework_lib/src/esrt/mod.rs b/framework_lib/src/esrt/mod.rs index 77ecbf74..5d43ecf0 100644 --- a/framework_lib/src/esrt/mod.rs +++ b/framework_lib/src/esrt/mod.rs @@ -119,6 +119,12 @@ pub const FL16_BIOS_GUID: GUID = GUID::build_from_components( 0x5d64, &[0x8e, 0x18, 0x65, 0x8d, 0x20, 0x5a, 0xcf, 0x34], ); +pub const AMD16_AI300_BIOS_GUID: GUID = GUID::build_from_components( + 0x820436ee, + 0x8208, + 0x463b, + &[0x92, 0xb8, 0x82, 0x77, 0xd6, 0x38, 0x4d, 0x93], +); pub const AMD13_RYZEN7040_BIOS_GUID: GUID = GUID::build_from_components( 0xb5f7dcc1, 0x568c, @@ -186,6 +192,7 @@ pub enum FrameworkGuidKind { RplUCsme, MtlCsme, Fl16Bios, + Amd16Ai300Bios, Amd13Ryzen7040Bios, Amd13Ai300Bios, DesktopAmdAi300Bios, @@ -201,6 +208,7 @@ pub fn match_guid_kind(guid: &CGuid) -> FrameworkGuidKind { MTL_BIOS_GUID => FrameworkGuidKind::MtlBios, FW12_RPL_BIOS_GUID => FrameworkGuidKind::Fw12RplBios, FL16_BIOS_GUID => FrameworkGuidKind::Fl16Bios, + AMD16_AI300_BIOS_GUID => FrameworkGuidKind::Amd16Ai300Bios, AMD13_RYZEN7040_BIOS_GUID => FrameworkGuidKind::Amd13Ryzen7040Bios, AMD13_AI300_BIOS_GUID => FrameworkGuidKind::Amd13Ai300Bios, DESKTOP_AMD_AI300_BIOS_GUID => FrameworkGuidKind::DesktopAmdAi300Bios, diff --git a/framework_lib/src/power.rs b/framework_lib/src/power.rs index 91f87bda..3ae05cb5 100644 --- a/framework_lib/src/power.rs +++ b/framework_lib/src/power.rs @@ -14,7 +14,6 @@ use crate::chromium_ec::command::EcRequestRaw; use crate::chromium_ec::commands::*; use crate::chromium_ec::*; use crate::smbios; -use crate::smbios::get_platform; use crate::util::{Platform, PlatformFamily}; /// Maximum length of strings in memmap @@ -358,6 +357,7 @@ pub fn print_thermal(ec: &CrosEc) { let fans = ec.read_memory(EC_MEMMAP_FAN, 0x08).unwrap(); let platform = smbios::get_platform(); + let family = smbios::get_family(); let remaining_sensors = match platform { Some(Platform::IntelGen11) | Some(Platform::IntelGen12) | Some(Platform::IntelGen13) => { println!(" F75303_Local: {:>4}", TempSensor::from(temps[0])); @@ -396,13 +396,14 @@ pub fn print_thermal(ec: &CrosEc) { Some( Platform::Framework13Amd7080 | Platform::Framework13AmdAi300 - | Platform::Framework16Amd7080, + | Platform::Framework16Amd7080 + | Platform::Framework16AmdAi300, ) => { println!(" F75303_Local: {:>4}", TempSensor::from(temps[0])); println!(" F75303_CPU: {:>4}", TempSensor::from(temps[1])); println!(" F75303_DDR: {:>4}", TempSensor::from(temps[2])); println!(" APU: {:>4}", TempSensor::from(temps[3])); - if matches!(platform, Some(Platform::Framework16Amd7080)) { + if family == Some(PlatformFamily::Framework16) { println!(" dGPU VR: {:>4}", TempSensor::from(temps[4])); println!(" dGPU VRAM: {:>4}", TempSensor::from(temps[5])); println!(" dGPU AMB: {:>4}", TempSensor::from(temps[6])); @@ -721,7 +722,7 @@ pub fn get_pd_info(ec: &CrosEc, ports: u8) -> Vec> { } pub fn get_and_print_pd_info(ec: &CrosEc) { - let fl16 = Some(crate::util::Platform::Framework16Amd7080) == get_platform(); + let fl16 = Some(PlatformFamily::Framework16) == smbios::get_family(); let ports = 4; // All our platforms have 4 PD ports so far let infos = get_pd_info(ec, ports); for (port, info) in infos.iter().enumerate().take(ports.into()) { diff --git a/framework_lib/src/smbios.rs b/framework_lib/src/smbios.rs index 144ad210..a55b8eff 100644 --- a/framework_lib/src/smbios.rs +++ b/framework_lib/src/smbios.rs @@ -310,6 +310,7 @@ pub fn get_platform() -> Option { "Laptop 12 (13th Gen Intel Core)" => Some(Platform::Framework12IntelGen13), "Laptop 13 (Intel Core Ultra Series 1)" => Some(Platform::IntelCoreUltra1), "Laptop 16 (AMD Ryzen 7040 Series)" => Some(Platform::Framework16Amd7080), + "Laptop 16 (AMD Ryzen AI 300 Series)" => Some(Platform::Framework16AmdAi300), "Desktop (AMD Ryzen AI Max 300 Series)" => Some(Platform::FrameworkDesktopAmdAiMax300), _ => Some(Platform::UnknownSystem), }; diff --git a/framework_lib/src/util.rs b/framework_lib/src/util.rs index 1716ed65..ae966209 100644 --- a/framework_lib/src/util.rs +++ b/framework_lib/src/util.rs @@ -33,6 +33,8 @@ pub enum Platform { Framework13AmdAi300, /// Framework 16 - AMD Ryzen 7080 Series Framework16Amd7080, + /// Framework 16 - AMD Ryzen AI 300 Series + Framework16AmdAi300, /// Framework Desktop - AMD Ryzen AI Max 300 FrameworkDesktopAmdAiMax300, /// Generic Framework device @@ -66,6 +68,7 @@ impl Platform { Platform::Framework13Amd7080 | Platform::Framework13AmdAi300 | Platform::Framework16Amd7080 + | Platform::Framework16AmdAi300 | Platform::FrameworkDesktopAmdAiMax300 => Some(CpuVendor::Amd), Platform::GenericFramework(..) => None, Platform::UnknownSystem => None, @@ -81,6 +84,7 @@ impl Platform { | Platform::Framework13Amd7080 | Platform::Framework13AmdAi300 => Some(PlatformFamily::Framework13), Platform::Framework16Amd7080 => Some(PlatformFamily::Framework16), + Platform::Framework16AmdAi300 => Some(PlatformFamily::Framework16), Platform::FrameworkDesktopAmdAiMax300 => Some(PlatformFamily::FrameworkDesktop), Platform::GenericFramework(..) => None, Platform::UnknownSystem => None,