Skip to content

Add support for EC_CMD_REBOOT_AP_ON_G3 #181

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 26, 2025
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
3 changes: 3 additions & 0 deletions framework_lib/src/chromium_ec/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ pub enum EcCommands {
/// Get information about PD controller power
UsbPdPowerInfo = 0x0103,
AdcRead = 0x0123,
ApReset = 0x0125,
LocateChip = 0x0126,
RebootApOnG3 = 0x0127,
RgbKbdSetColor = 0x013A,
RgbKbd = 0x013B,

Expand Down
36 changes: 36 additions & 0 deletions framework_lib/src/chromium_ec/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -879,6 +879,42 @@ impl EcRequest<EcResponseAdcRead> for EcRequestAdcRead {
}
}

#[repr(C)]
pub struct EcRequestApReset {}

impl EcRequest<()> for EcRequestApReset {
fn command_id() -> EcCommands {
EcCommands::ApReset
}
}

#[repr(C)]
pub struct EcRequestRebootApOnG3V0 {}

impl EcRequest<()> for EcRequestRebootApOnG3V0 {
fn command_id() -> EcCommands {
EcCommands::RebootApOnG3
}
fn command_version() -> u8 {
0
}
}

#[repr(C)]
pub struct EcRequestRebootApOnG3V1 {
/// Delay in seconds after entering G3 state
pub delay: u32,
}

impl EcRequest<()> for EcRequestRebootApOnG3V1 {
fn command_id() -> EcCommands {
EcCommands::RebootApOnG3
}
fn command_version() -> u8 {
1
}
}

// TODO: Actually 128, but if we go above ~80 EC returns REQUEST_TRUNCATED
// At least when I use the portio driver
pub const EC_RGBKBD_MAX_KEY_COUNT: usize = 64;
Expand Down
Loading