api: added reboot into FEL mode
[bmcd] / src / app / bmc_application.rs
index 40c4247a5a75aa476e80e75cc3e41ea5f3c7015d..f84aa9e283b2afcb7c17e2212557db335c82c32c 100644 (file)
@@ -290,7 +290,12 @@ impl BmcApplication {
             .context("error clearing usbboot")
     }
 
-    pub async fn reboot() -> anyhow::Result<()> {
+    pub async fn reboot(fel: bool) -> anyhow::Result<()> {
+        if fel {
+            peekpoke::write(0x0709_0108, 0x5AA5_A55A);
+            log::warn!("system reboot into FEL");
+        }
+
         tokio::fs::write("/sys/class/leds/fp:reset/brightness", b"1").await?;
         Command::new("shutdown").args(["-r", "now"]).spawn()?;
         Ok(())