summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2013-03-19 14:27:02 -0700
committerChromeBot <chrome-bot@google.com>2013-03-20 15:23:29 -0700
commit78b0e9863d7d05e9ee50e75d6cd845f1b54a5915 (patch)
tree72dcd6300b48454d41aff8339dce45e7eec7159f
parent34e17d4c05ccc4ad48b0a717aebcf278c97f1a79 (diff)
downloadchrome-ec-78b0e9863d7d05e9ee50e75d6cd845f1b54a5915.tar.gz
Use chipset_reset() interface instead of system_warm_reboot()
We have a common chipset interface for performing a warm reset of the AP, so move the implementation from system_warm_reboot() there. (It was never a system function anyway; system = EC+AP; chipset = AP) No functional change; just renaming functions. BUG=chrome-os-partner:18343 BRANCH=none TEST=build daisy,snow,spring,mccroskey Change-Id: Ibc2c5efced5660c4335cd1868470184397800acd Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/45891
-rw-r--r--board/mccroskey/board.c2
-rw-r--r--board/mccroskey/board.h2
-rw-r--r--chip/stm32/keyboard_scan.c4
-rw-r--r--common/gaia_power.c38
-rw-r--r--include/system.h5
5 files changed, 22 insertions, 29 deletions
diff --git a/board/mccroskey/board.c b/board/mccroskey/board.c
index 84503799ca..4635908ac3 100644
--- a/board/mccroskey/board.c
+++ b/board/mccroskey/board.c
@@ -156,7 +156,7 @@ void board_i2c_post_init(int port)
}
}
-void system_warm_reboot(void)
+void chipset_reset(int is_cold)
{
/* FIXME: this is just a stub for now... */
}
diff --git a/board/mccroskey/board.h b/board/mccroskey/board.h
index 239c6f9ba9..83acec968a 100644
--- a/board/mccroskey/board.h
+++ b/board/mccroskey/board.h
@@ -118,8 +118,6 @@ void configure_board(void);
/* FIXME: this should not be needed on mccroskey. */
void board_interrupt_host(int active);
-void system_warm_reboot(void);
-
#endif /* !__ASSEMBLER__ */
#endif /* __BOARD_H */
diff --git a/chip/stm32/keyboard_scan.c b/chip/stm32/keyboard_scan.c
index 6a9f6cd84c..b684514a62 100644
--- a/chip/stm32/keyboard_scan.c
+++ b/chip/stm32/keyboard_scan.c
@@ -14,7 +14,7 @@
*/
#include "atomic.h"
-#include "board.h"
+#include "chipset.h"
#include "console.h"
#include "gpio.h"
#include "host_command.h"
@@ -257,7 +257,7 @@ static int check_runtime_keys(const uint8_t *state)
(state[MASK_INDEX_RIGHT_ALT] == MASK_VALUE_RIGHT_ALT ||
state[MASK_INDEX_LEFT_ALT] == MASK_VALUE_LEFT_ALT)) {
keyboard_clear_state();
- system_warm_reboot();
+ chipset_reset(0);
return 1;
}
diff --git a/common/gaia_power.c b/common/gaia_power.c
index c795f2f615..da73b1d105 100644
--- a/common/gaia_power.c
+++ b/common/gaia_power.c
@@ -246,7 +246,7 @@ void gaia_lid_event(enum gpio_signal signal)
task_wake(TASK_ID_CHIPSET);
}
-int gaia_power_init(void)
+static int gaia_power_init(void)
{
/* Enable interrupts for our GPIOs */
gpio_enable_interrupt(GPIO_KB_PWR_ON_L);
@@ -299,6 +299,23 @@ void chipset_exit_hard_off(void)
/* TODO: implement, if/when we take the AP down to a hard-off state */
}
+void chipset_reset(int is_cold)
+{
+ /* TODO: implement cold reset. For now, all resets are warm resets. */
+ CPRINTF("[%T EC triggered warm reboot]\n");
+
+ /*
+ * This is a hack to do an AP warm reboot while still preserving RAM
+ * contents. This is useful for looking at kernel log message contents
+ * from previous boot in cases where the AP/OS is hard hung.
+ */
+ gpio_set_level(GPIO_EN_PP5000, 0);
+ gpio_set_level(GPIO_EN_PP3300, 0);
+
+ power_request = POWER_REQ_ON;
+ task_wake(TASK_ID_CHIPSET);
+}
+
/*****************************************************************************/
/**
@@ -608,26 +625,9 @@ DECLARE_CONSOLE_COMMAND(power, command_power,
"Turn AP power on/off",
NULL);
-void system_warm_reboot(void)
-{
- CPRINTF("[%T EC triggered warm reboot ]\n");
-
- /* This is a hack to do an AP warm reboot while still preserving
- * RAM contents. This is useful for looking at kernel log message
- * contents from previous boot in cases where the AP/OS is hard
- * hung. */
- gpio_set_level(GPIO_EN_PP5000, 0);
- gpio_set_level(GPIO_EN_PP3300, 0);
-
- power_request = POWER_REQ_ON;
- task_wake(TASK_ID_CHIPSET);
-
- return;
-}
-
static int command_warm_reboot(int argc, char **argv)
{
- system_warm_reboot();
+ chipset_reset(0);
return EC_SUCCESS;
}
DECLARE_CONSOLE_COMMAND(warm_reboot, command_warm_reboot,
diff --git a/include/system.h b/include/system.h
index 480b655974..174efa9388 100644
--- a/include/system.h
+++ b/include/system.h
@@ -208,11 +208,6 @@ const char *system_get_build_info(void);
void system_reset(int flags);
/**
- * System warm reboot while keeping the RAM alive.
- */
-void system_warm_reboot(void);
-
-/**
* Set a scratchpad register to the specified value.
*
* The scratchpad register must maintain its contents across a