Skip to content

Commit 378356a

Browse files
committed
Add GetGpuPcie host command
Signed-off-by: Daniel Schaefer <[email protected]>
1 parent c8138ab commit 378356a

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

framework_lib/src/chromium_ec/command.rs

+1
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ pub enum EcCommands {
9797
GetHwDiag = 0x3E1C,
9898
/// Get gpu bay serial
9999
GetGpuSerial = 0x3E1D,
100+
GetGpuPcie = 0x3E1E,
100101
/// Set gpu bay serial and program structure
101102
ProgramGpuEeprom = 0x3E1F,
102103
}

framework_lib/src/chromium_ec/commands.rs

+34
Original file line numberDiff line numberDiff line change
@@ -1140,6 +1140,40 @@ impl EcRequest<EcResponseGetGpuSerial> for EcRequestGetGpuSerial {
11401140
}
11411141
}
11421142

1143+
#[repr(C, packed)]
1144+
pub struct EcRequestGetGpuPcie {}
1145+
1146+
#[repr(u8)]
1147+
#[derive(Debug, FromPrimitive)]
1148+
pub enum GpuPcieConfig {
1149+
/// PCIe 8x1
1150+
Pcie8x1 = 0,
1151+
/// PCIe 4x1
1152+
Pcie4x1 = 1,
1153+
/// PCIe 4x2
1154+
Pcie4x2 = 2,
1155+
}
1156+
1157+
#[repr(u8)]
1158+
#[derive(Debug, FromPrimitive)]
1159+
pub enum GpuVendor {
1160+
GpuAmdR23M = 0x01,
1161+
GpuPcieAccessory = 0xFF,
1162+
}
1163+
1164+
#[repr(C, packed)]
1165+
#[derive(Clone, Copy, PartialEq, Eq, Debug)]
1166+
pub struct EcResponseGetGpuPcie {
1167+
pub gpu_pcie_config: u8,
1168+
pub gpu_vendor: u8,
1169+
}
1170+
1171+
impl EcRequest<EcResponseGetGpuPcie> for EcRequestGetGpuPcie {
1172+
fn command_id() -> EcCommands {
1173+
EcCommands::GetGpuPcie
1174+
}
1175+
}
1176+
11431177
#[repr(u8)]
11441178
pub enum SetGpuSerialMagic {
11451179
/// 7700S config magic value

0 commit comments

Comments
 (0)