diff options
author | Vic Yang <victoryang@chromium.org> | 2014-05-20 14:21:58 -0700 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2014-05-21 04:07:57 +0000 |
commit | 7dd3ee4db371fb70c19a5b709985cd6b67f04906 (patch) | |
tree | a8a89c670af5504bf4d661886157998597e288f6 /board | |
parent | 724cfbc6c4fcec3608db9ec2ef9ad946b7d7e201 (diff) | |
download | chrome-ec-7dd3ee4db371fb70c19a5b709985cd6b67f04906.tar.gz |
Keyborg: Switch to HSE
We have a 16MHz oscillator input, so let's use it to save HSI power.
BUG=None
TEST=Build and boot
BRANCH=None
Change-Id: Ia2d97cfc8b97b7f8661112ebbd84952e41b955f2
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/200650
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'board')
-rw-r--r-- | board/keyborg/hardware.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/board/keyborg/hardware.c b/board/keyborg/hardware.c index d1648b0737..3bc04ae653 100644 --- a/board/keyborg/hardware.c +++ b/board/keyborg/hardware.c @@ -14,17 +14,17 @@ static void clock_init(void) { - /* Ensure that HSI is ON */ - if (!(STM32_RCC_CR & (1 << 1))) { - /* Enable HSI */ - STM32_RCC_CR |= 1 << 0; - /* Wait for HSI to be ready */ - while (!(STM32_RCC_CR & (1 << 1))) + /* Turn on HSE */ + if (!(STM32_RCC_CR & (1 << 17))) { + /* Enable HSE */ + STM32_RCC_CR |= (1 << 18) | (1 << 16); + /* Wait for HSE to be ready */ + while (!(STM32_RCC_CR & (1 << 17))) ; } - /* PLLSRC = HSI/2, PLLMUL = x12 (x HSI/2) = 48MHz */ - STM32_RCC_CFGR = 0x00684000; + /* PLLSRC = HSE/2 = 8MHz, PLLMUL = x6 = 48MHz */ + STM32_RCC_CFGR = 0x00534000; /* Enable PLL */ STM32_RCC_CR |= 1 << 24; /* Wait for PLL to be ready */ @@ -32,7 +32,7 @@ static void clock_init(void) ; /* switch SYSCLK to PLL */ - STM32_RCC_CFGR = 0x00684002; + STM32_RCC_CFGR = 0x00534002; /* wait until the PLL is the clock source */ while ((STM32_RCC_CFGR & 0xc) != 0x8) ; |