diff options
author | Kevin K Wong <kevin.k.wong@intel.com> | 2014-07-01 15:38:39 -0700 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2014-12-29 19:04:38 +0000 |
commit | 850ef52982b92afbcb3eacb2f69a597731303ed3 (patch) | |
tree | 53a1f8eae8f30501e7af9842f4656182739be1c3 | |
parent | 8bd44bf4d5616bd6d476cbea99829059fe11dc68 (diff) | |
download | chrome-ec-850ef52982b92afbcb3eacb2f69a597731303ed3.tar.gz |
mec1322: Added support to use crystal vs oscillator based on board's clock circuitry.
BUG=None
TEST=make -j buildall
BRANCH=None
Change-Id: I88fa219cd9e573c1544400d24d00c4fdec93840f
Signed-off-by: Kevin K Wong <kevin.k.wong@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/237272
Reviewed-by: Vic Yang <victoryang@chromium.org>
-rw-r--r-- | board/strago/board.h | 1 | ||||
-rw-r--r-- | chip/mec1322/clock.c | 13 | ||||
-rw-r--r-- | include/config.h | 7 |
3 files changed, 20 insertions, 1 deletions
diff --git a/board/strago/board.h b/board/strago/board.h index 4e965b791f..b67d2d2886 100644 --- a/board/strago/board.h +++ b/board/strago/board.h @@ -12,6 +12,7 @@ /* Optional features */ #define CONFIG_SYSTEM_UNLOCKED /* Allow dangerous commands */ #define CONFIG_WATCHDOG_HELP +#define CONFIG_CLOCK_CRYSTAL #define CONFIG_CHIPSET_BRASWELL #define CONFIG_KEYBOARD_PROTOCOL_8042 #define CONFIG_KEYBOARD_IRQ_GPIO GPIO_KBD_IRQ_L diff --git a/chip/mec1322/clock.c b/chip/mec1322/clock.c index 512627b184..f838dd0197 100644 --- a/chip/mec1322/clock.c +++ b/chip/mec1322/clock.c @@ -30,9 +30,20 @@ int clock_get_freq(void) void clock_init(void) { - /* XOSEL = Single ended clock source */ +#ifdef CONFIG_CLOCK_CRYSTAL + /* XOSEL: 0 = Parallel resonant crystal */ + MEC1322_VBAT_CE &= ~0x1; +#else + /* XOSEL: 1 = Single ended clock source */ MEC1322_VBAT_CE |= 0x1; +#endif /* 32K clock enable */ MEC1322_VBAT_CE |= 0x2; + +#ifdef CONFIG_CLOCK_CRYSTAL + /* Wait for crystal to stabilize (OSC_LOCK == 1) */ + while (!(MEC1322_PCR_CHIP_OSC_ID & 0x100)) + ; +#endif } diff --git a/include/config.h b/include/config.h index 5013901fee..7013a7db0a 100644 --- a/include/config.h +++ b/include/config.h @@ -300,6 +300,13 @@ #define CONFIG_CHIPSET_HAS_PP5000 /*****************************************************************************/ +/* + * Chip config for clock circuitry + * define = crystal / undef = oscillator + */ +#undef CONFIG_CLOCK_CRYSTAL + +/*****************************************************************************/ /* PMIC config */ /* Support firmware long press power-off timer */ |