Rename gpio_is_reboot_warm() to system_is_reboot_warm()

BUG=chrome-os-partner:40788
TEST=make buildall -j
BRANCH=none

Change-Id: I4fb248da4656374e1218af98678cfb694f4c9176
Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/302674
Commit-Ready: Vijay P Hiremath <vijay.p.hiremath@intel.com>
Tested-by: Vijay P Hiremath <vijay.p.hiremath@intel.com>
Reviewed-by: Shawn N <shawnn@chromium.org>
This commit is contained in:
Vijay Hiremath
2015-09-28 10:56:46 -07:00
committed by chrome-bot
parent 447e543ef6
commit dbef9a6fed
13 changed files with 45 additions and 50 deletions

View File

@@ -381,7 +381,7 @@ int gpio_disable_interrupt(enum gpio_signal signal)
void gpio_pre_init(void)
{
const struct gpio_info *g = gpio_list;
int is_warm = gpio_is_reboot_warm();
int is_warm = system_is_reboot_warm();
int flags;
int i;

View File

@@ -64,7 +64,7 @@ static void check_reset_cause(void)
system_set_reset_flags(flags);
}
int gpio_is_reboot_warm(void)
int system_is_reboot_warm(void)
{
uint32_t reset_flags;
/*

View File

@@ -180,7 +180,7 @@ void gpio_pre_init(void)
{
int i;
int flags;
int is_warm = gpio_is_reboot_warm();
int is_warm = system_is_reboot_warm();
const struct gpio_info *g = gpio_list;

View File

@@ -56,8 +56,7 @@ static void check_reset_cause(void)
system_set_reset_flags(flags);
}
/* TODO(crbug.com/40789): Rename this function system_is_reboot_warm */
int gpio_is_reboot_warm(void)
int system_is_reboot_warm(void)
{
uint32_t reset_flags;
/*

View File

@@ -521,31 +521,11 @@ int gpio_disable_interrupt(enum gpio_signal signal)
return EC_SUCCESS;
}
int gpio_is_reboot_warm(void)
{
uint32_t reset_flags;
/*
* Check reset cause here,
* gpio_pre_init is executed faster than system_pre_init
*/
system_check_reset_cause();
reset_flags = system_get_reset_flags();
if ((reset_flags & RESET_FLAG_RESET_PIN) ||
(reset_flags & RESET_FLAG_POWER_ON) ||
(reset_flags & RESET_FLAG_WATCHDOG) ||
(reset_flags & RESET_FLAG_HARD) ||
(reset_flags & RESET_FLAG_SOFT))
return 0;
else
return 1;
}
void gpio_pre_init(void)
{
const struct gpio_info *g = gpio_list;
const struct gpio_wui_map *map;
int is_warm = gpio_is_reboot_warm();
int is_warm = system_is_reboot_warm();
int flags;
int i, j;

View File

@@ -601,6 +601,27 @@ uint32_t system_get_scratchpad(void)
return bbram_data_read(BBRM_DATA_INDEX_SCRATCHPAD);
}
int system_is_reboot_warm(void)
{
uint32_t reset_flags;
/*
* Check reset cause here,
* gpio_pre_init is executed faster than system_pre_init
*/
system_check_reset_cause();
reset_flags = system_get_reset_flags();
if ((reset_flags & RESET_FLAG_RESET_PIN) ||
(reset_flags & RESET_FLAG_POWER_ON) ||
(reset_flags & RESET_FLAG_WATCHDOG) ||
(reset_flags & RESET_FLAG_HARD) ||
(reset_flags & RESET_FLAG_SOFT))
return 0;
else
return 1;
}
/*****************************************************************************/
/* Console commands */

View File

@@ -13,11 +13,6 @@
#include "task.h"
#include "util.h"
int gpio_is_reboot_warm(void)
{
return ((STM32_RCC_AHBENR & 0x7e0000) == 0x7e0000);
}
void gpio_enable_clocks(void)
{
/*

View File

@@ -13,11 +13,6 @@
#include "task.h"
#include "util.h"
int gpio_is_reboot_warm(void)
{
return ((STM32_RCC_AHBENR & 0x7e0000) == 0x7e0000);
}
void gpio_enable_clocks(void)
{
/*

View File

@@ -13,11 +13,6 @@
#include "task.h"
#include "util.h"
int gpio_is_reboot_warm(void)
{
return ((STM32_RCC_AHBENR & 0x3f) == 0x3f);
}
void gpio_enable_clocks(void)
{
/*

View File

@@ -11,6 +11,7 @@
#include "gpio.h"
#include "hooks.h"
#include "registers.h"
#include "system.h"
#include "task.h"
#include "util.h"
@@ -22,7 +23,7 @@ static uint8_t exti_events[16];
void gpio_pre_init(void)
{
const struct gpio_info *g = gpio_list;
int is_warm = gpio_is_reboot_warm();
int is_warm = system_is_reboot_warm();
int i;
/* Required to configure external IRQ lines (SYSCFG_EXTICRn) */

View File

@@ -377,3 +377,12 @@ int system_get_console_force_enabled(void)
else
return 0;
}
int system_is_reboot_warm(void)
{
#if defined(CHIP_FAMILY_STM32F0) || defined(CHIP_FAMILY_STM32F3)
return ((STM32_RCC_AHBENR & 0x7e0000) == 0x7e0000);
#elif defined(CHIP_FAMILY_STM32L)
return ((STM32_RCC_AHBENR & 0x3f) == 0x3f);
#endif
}

View File

@@ -244,14 +244,6 @@ void gpio_set_flags_by_mask(uint32_t port, uint32_t mask, uint32_t flags);
*/
void gpio_set_alternate_function(uint32_t port, uint32_t mask, int func);
/**
* Return true if the EC is warm booting.
*
* This function is used by the GPIO implementation and should not be called
* outside of that context.
*/
int gpio_is_reboot_warm(void);
/**
* Enable GPIO peripheral clocks.
*

View File

@@ -411,4 +411,12 @@ enum system_image_copy_t system_get_shrspi_image_copy(void);
*/
uintptr_t system_get_fw_reset_vector(uintptr_t base);
#endif
/**
* Check if the EC is warm booting.
*
* @return true if the EC is warm booting.
*/
int system_is_reboot_warm(void);
#endif /* __CROS_EC_SYSTEM_H */