diff --git a/src/board/system76/darp5/power.c b/src/board/system76/darp5/power.c index 0b36c78..482d76f 100644 --- a/src/board/system76/darp5/power.c +++ b/src/board/system76/darp5/power.c @@ -8,6 +8,7 @@ #include #include #include +#include // Platform does not currently support Deep Sx #define DEEP_SX 0 @@ -256,6 +257,15 @@ void power_event(void) { // Always switch to ds5 if EC is running if (power_state == POWER_STATE_DEFAULT) { power_on_ds5(); + + // If power on key is not found + if (BRAM[0x76] != 0xEC) { + // Set the key + BRAM[0x76] = 0xEC; + + // Power on system + power_on_s5(); + } } // Check if the adapter line goes low diff --git a/src/board/system76/darp5/scratch.c b/src/board/system76/darp5/scratch.c index e3c4029..db4af0e 100644 --- a/src/board/system76/darp5/scratch.c +++ b/src/board/system76/darp5/scratch.c @@ -22,6 +22,9 @@ void scratch_trampoline(void) { //TODO: Clear keyboard presses + // Clear power on key + BRAM[0x76] = 0; + // Start watchdog timer smfi_watchdog(); diff --git a/src/board/system76/galp3-c/power.c b/src/board/system76/galp3-c/power.c index 03855bf..2ae4c5b 100644 --- a/src/board/system76/galp3-c/power.c +++ b/src/board/system76/galp3-c/power.c @@ -7,6 +7,7 @@ #include #include #include +#include // Platform does not currently support Deep Sx #define DEEP_SX 0 @@ -255,6 +256,15 @@ void power_event(void) { // Always switch to ds5 if EC is running if (power_state == POWER_STATE_DEFAULT) { power_on_ds5(); + + // If power on key is not found + if (BRAM[0x76] != 0xEC) { + // Set the key + BRAM[0x76] = 0xEC; + + // Power on system + power_on_s5(); + } } // Check if the adapter line goes low diff --git a/src/board/system76/galp3-c/scratch.c b/src/board/system76/galp3-c/scratch.c index e3c4029..db4af0e 100644 --- a/src/board/system76/galp3-c/scratch.c +++ b/src/board/system76/galp3-c/scratch.c @@ -22,6 +22,9 @@ void scratch_trampoline(void) { //TODO: Clear keyboard presses + // Clear power on key + BRAM[0x76] = 0; + // Start watchdog timer smfi_watchdog(); diff --git a/src/board/system76/lemp9/power.c b/src/board/system76/lemp9/power.c index c4393e7..7eba65d 100644 --- a/src/board/system76/lemp9/power.c +++ b/src/board/system76/lemp9/power.c @@ -7,6 +7,7 @@ #include #include #include +#include // Platform does not currently support Deep Sx #define DEEP_SX 0 @@ -255,6 +256,15 @@ void power_event(void) { // Always switch to ds5 if EC is running if (power_state == POWER_STATE_DEFAULT) { power_on_ds5(); + + // If power on key is not found + if (BRAM[0x76] != 0xEC) { + // Set the key + BRAM[0x76] = 0xEC; + + // Power on system + power_on_s5(); + } } // Check if the adapter line goes low diff --git a/src/board/system76/lemp9/scratch.c b/src/board/system76/lemp9/scratch.c index e14654d..3e78b4a 100644 --- a/src/board/system76/lemp9/scratch.c +++ b/src/board/system76/lemp9/scratch.c @@ -3,6 +3,7 @@ #include #include +#include #include // Include scratch ROM @@ -22,6 +23,9 @@ void scratch_trampoline(void) { //TODO: Clear keyboard presses + // Clear power on key + BRAM[0x76] = 0; + // Start watchdog timer smfi_watchdog(); diff --git a/src/ec/it5570e/include/ec/bram.h b/src/ec/it5570e/include/ec/bram.h new file mode 100644 index 0000000..7b9dc53 --- /dev/null +++ b/src/ec/it5570e/include/ec/bram.h @@ -0,0 +1,8 @@ +#ifndef _EC_BRAM_H +#define _EC_BRAM_H + +#include + +volatile uint8_t __xdata __at(0x2200) BRAM[192]; + +#endif // _EC_BRAM_H diff --git a/src/ec/it8587e/include/ec/bram.h b/src/ec/it8587e/include/ec/bram.h new file mode 100644 index 0000000..7b9dc53 --- /dev/null +++ b/src/ec/it8587e/include/ec/bram.h @@ -0,0 +1,8 @@ +#ifndef _EC_BRAM_H +#define _EC_BRAM_H + +#include + +volatile uint8_t __xdata __at(0x2200) BRAM[192]; + +#endif // _EC_BRAM_H