Add power on after reset flag
This commit is contained in:
parent
4303f0753e
commit
1194472b8f
@ -8,6 +8,7 @@
|
|||||||
#include <board/pmc.h>
|
#include <board/pmc.h>
|
||||||
#include <board/pnp.h>
|
#include <board/pnp.h>
|
||||||
#include <common/debug.h>
|
#include <common/debug.h>
|
||||||
|
#include <ec/bram.h>
|
||||||
|
|
||||||
// Platform does not currently support Deep Sx
|
// Platform does not currently support Deep Sx
|
||||||
#define DEEP_SX 0
|
#define DEEP_SX 0
|
||||||
@ -256,6 +257,15 @@ void power_event(void) {
|
|||||||
// Always switch to ds5 if EC is running
|
// Always switch to ds5 if EC is running
|
||||||
if (power_state == POWER_STATE_DEFAULT) {
|
if (power_state == POWER_STATE_DEFAULT) {
|
||||||
power_on_ds5();
|
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
|
// Check if the adapter line goes low
|
||||||
|
@ -22,6 +22,9 @@ void scratch_trampoline(void) {
|
|||||||
|
|
||||||
//TODO: Clear keyboard presses
|
//TODO: Clear keyboard presses
|
||||||
|
|
||||||
|
// Clear power on key
|
||||||
|
BRAM[0x76] = 0;
|
||||||
|
|
||||||
// Start watchdog timer
|
// Start watchdog timer
|
||||||
smfi_watchdog();
|
smfi_watchdog();
|
||||||
|
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
#include <board/pmc.h>
|
#include <board/pmc.h>
|
||||||
#include <board/pnp.h>
|
#include <board/pnp.h>
|
||||||
#include <common/debug.h>
|
#include <common/debug.h>
|
||||||
|
#include <ec/bram.h>
|
||||||
|
|
||||||
// Platform does not currently support Deep Sx
|
// Platform does not currently support Deep Sx
|
||||||
#define DEEP_SX 0
|
#define DEEP_SX 0
|
||||||
@ -255,6 +256,15 @@ void power_event(void) {
|
|||||||
// Always switch to ds5 if EC is running
|
// Always switch to ds5 if EC is running
|
||||||
if (power_state == POWER_STATE_DEFAULT) {
|
if (power_state == POWER_STATE_DEFAULT) {
|
||||||
power_on_ds5();
|
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
|
// Check if the adapter line goes low
|
||||||
|
@ -22,6 +22,9 @@ void scratch_trampoline(void) {
|
|||||||
|
|
||||||
//TODO: Clear keyboard presses
|
//TODO: Clear keyboard presses
|
||||||
|
|
||||||
|
// Clear power on key
|
||||||
|
BRAM[0x76] = 0;
|
||||||
|
|
||||||
// Start watchdog timer
|
// Start watchdog timer
|
||||||
smfi_watchdog();
|
smfi_watchdog();
|
||||||
|
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
#include <board/pmc.h>
|
#include <board/pmc.h>
|
||||||
#include <board/pnp.h>
|
#include <board/pnp.h>
|
||||||
#include <common/debug.h>
|
#include <common/debug.h>
|
||||||
|
#include <ec/bram.h>
|
||||||
|
|
||||||
// Platform does not currently support Deep Sx
|
// Platform does not currently support Deep Sx
|
||||||
#define DEEP_SX 0
|
#define DEEP_SX 0
|
||||||
@ -255,6 +256,15 @@ void power_event(void) {
|
|||||||
// Always switch to ds5 if EC is running
|
// Always switch to ds5 if EC is running
|
||||||
if (power_state == POWER_STATE_DEFAULT) {
|
if (power_state == POWER_STATE_DEFAULT) {
|
||||||
power_on_ds5();
|
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
|
// Check if the adapter line goes low
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
#include <board/smfi.h>
|
#include <board/smfi.h>
|
||||||
#include <common/macro.h>
|
#include <common/macro.h>
|
||||||
|
#include <ec/bram.h>
|
||||||
#include <ec/pwm.h>
|
#include <ec/pwm.h>
|
||||||
|
|
||||||
// Include scratch ROM
|
// Include scratch ROM
|
||||||
@ -22,6 +23,9 @@ void scratch_trampoline(void) {
|
|||||||
|
|
||||||
//TODO: Clear keyboard presses
|
//TODO: Clear keyboard presses
|
||||||
|
|
||||||
|
// Clear power on key
|
||||||
|
BRAM[0x76] = 0;
|
||||||
|
|
||||||
// Start watchdog timer
|
// Start watchdog timer
|
||||||
smfi_watchdog();
|
smfi_watchdog();
|
||||||
|
|
||||||
|
8
src/ec/it5570e/include/ec/bram.h
Normal file
8
src/ec/it5570e/include/ec/bram.h
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
#ifndef _EC_BRAM_H
|
||||||
|
#define _EC_BRAM_H
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
volatile uint8_t __xdata __at(0x2200) BRAM[192];
|
||||||
|
|
||||||
|
#endif // _EC_BRAM_H
|
8
src/ec/it8587e/include/ec/bram.h
Normal file
8
src/ec/it8587e/include/ec/bram.h
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
#ifndef _EC_BRAM_H
|
||||||
|
#define _EC_BRAM_H
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
volatile uint8_t __xdata __at(0x2200) BRAM[192];
|
||||||
|
|
||||||
|
#endif // _EC_BRAM_H
|
Loading…
x
Reference in New Issue
Block a user