diff options
-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 */ |