chip: it83xx: disable USB module's clock at default

The GPIOH.5/6 are reserved for USB module and the
clock is disabled before configuring it.

Signed-off-by: Dino Li <dino.li@ite.com.tw>

BRANCH=none
BUG=none
TEST=Clock is disabled at default.

Change-Id: If679ab3de13019f19a936b9a412b20973fb8989f
Reviewed-on: https://chromium-review.googlesource.com/338066
Commit-Ready: Dino Li <dino.li@ite.com.tw>
Tested-by: Dino Li <dino.li@ite.com.tw>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
This commit is contained in:
Dino Li
2016-04-08 16:33:43 +08:00
committed by chrome-bot
parent f3552a6863
commit 35e8490a63
2 changed files with 2 additions and 18 deletions

View File

@@ -181,23 +181,6 @@ static void board_init(void)
* use console command "sleepmask" to enable it if necessary.
*/
disable_sleep(SLEEP_MASK_FORCE_NO_DSLEEP);
/*
* The GPIOH.5/6 may be used for flashing purposes if WP pin
* is deasserted. The clock of this module needs to be enabled.
* So we disable the clock when WP pin is asserted,
* this can help to reduce power consumption.
*/
#ifdef CONFIG_WP_ACTIVE_HIGH
if (gpio_get_level(GPIO_WP))
clock_disable_peripheral(CGC_OFFSET_USB, 0, 0);
else
clock_enable_peripheral(CGC_OFFSET_USB, 0, 0);
#else
if (!gpio_get_level(GPIO_WP_L))
clock_disable_peripheral(CGC_OFFSET_USB, 0, 0);
else
clock_enable_peripheral(CGC_OFFSET_USB, 0, 0);
#endif
}
DECLARE_HOOK(HOOK_INIT, board_init, HOOK_PRIO_DEFAULT);

View File

@@ -61,7 +61,8 @@ static void clock_module_disable(void)
clock_disable_peripheral((CGC_OFFSET_SMBA | CGC_OFFSET_SMBB |
CGC_OFFSET_SMBC | CGC_OFFSET_SMBD | CGC_OFFSET_SMBE |
CGC_OFFSET_SMBF), 0, 0);
clock_disable_peripheral((CGC_OFFSET_SSPI | CGC_OFFSET_PECI), 0, 0);
clock_disable_peripheral((CGC_OFFSET_SSPI | CGC_OFFSET_PECI |
CGC_OFFSET_USB), 0, 0);
}
void clock_init(void)