Skip to content
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

gimlet-seq-server: start driving fault pin. #1556

Merged
merged 1 commit into from
Nov 3, 2023
Merged
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
16 changes: 16 additions & 0 deletions drv/gimlet-seq-server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,16 @@ fn main() -> ! {
let jefe = Jefe::from(JEFE.get_task_id());
let hf = hf_api::HostFlash::from(HF.get_task_id());

// Ensure the SP fault pin is configured as an open-drain output, and pull
// it low to make the sequencer restart externally visible.
sys.gpio_configure_output(
FAULT_PIN_L,
sys_api::OutputType::OpenDrain,
sys_api::Speed::Low,
sys_api::Pull::None,
);
sys.gpio_reset(FAULT_PIN_L);

// Turn off the chassis LED, in case this is a task restart (and not a
// full chip restart, which would leave the GPIO unconfigured).
sys.gpio_configure_output(
Expand Down Expand Up @@ -403,6 +413,10 @@ fn main() -> ! {
sys_api::Pull::None,
);

// Clear the external fault now that we're about to start serving messages
// and fewer things can go wrong.
sys.gpio_set(FAULT_PIN_L);

loop {
idol_runtime::dispatch_n(&mut buffer, &mut server);
}
Expand Down Expand Up @@ -1135,6 +1149,8 @@ cfg_if::cfg_if! {

// SP_STATUS_LED
const CHASSIS_LED: sys_api::PinSet = sys_api::Port::A.pin(3);
// SP_TO_IGNIT_FAULT_L
const FAULT_PIN_L: sys_api::PinSet = sys_api::Port::A.pin(15);

// Gimlet provides external pullups.
const PGS_PULL: sys_api::Pull = sys_api::Pull::None;
Expand Down