From 00d9be2d5feb97bf2d38af580a78604d2007284b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Nohlg=C3=A5rd?= Date: Sat, 10 Jun 2017 07:02:33 +0200 Subject: [PATCH] squash kw41z/cpu.c cleanup --- cpu/kw41z/cpu.c | 27 ++++++--------------------- 1 file changed, 6 insertions(+), 21 deletions(-) diff --git a/cpu/kw41z/cpu.c b/cpu/kw41z/cpu.c index 997b2cb606d71..be78d939ecaa3 100644 --- a/cpu/kw41z/cpu.c +++ b/cpu/kw41z/cpu.c @@ -23,8 +23,6 @@ #include "cpu_conf.h" #include "periph/init.h" -static void cpu_clock_init(void); - /** * @brief Initialize the CPU, set IRQ priorities */ @@ -32,25 +30,12 @@ void cpu_init(void) { /* initialize the Cortex-M core */ cortexm_init(); - /* initialize the clock system */ - cpu_clock_init(); + /* Clear LLS protection */ + /* Clear VLPS, VLPW, VLPR protection */ + /* Note: This register can only be written once after each reset, so we must + * enable all power modes that we wish to use. */ + SMC->PMPROT |= SMC_PMPROT_ALLS_MASK | SMC_PMPROT_AVLP_MASK; + /* trigger static peripheral initialization */ periph_init(); } - -/** - * @brief Configure the clock prescalers - * - * | Clock name | Run mode frequency (max) | VLPR mode frequency (max) | - * - * | Core | 48 MHz | 4 MHz | - * | System | 48 MHz | 4 MHz | - * | Bus | 24 MHz | 1 MHz or 800 KHz | - * | Flash | 24 MHz | 1 MHz or 800 KHz | - */ -static void cpu_clock_init(void) -{ - /* setup system prescalers */ - /* TODO: Make this configurable */ - SIM->CLKDIV1 = (uint32_t)SIM_CLKDIV1_OUTDIV4(1); -}