changeset 3967:a33b3408d502

arch/efm32: enable LFRCO when CONFIG_DEVICE_CLOCK is not used
author Alexandre Becoulet <alexandre.becoulet@free.fr>
date Tue, 19 Jun 2018 11:00:47 +0200
parents 7811f7196101
children e294bcd04f2a
files arch/efm32/arch_init.c
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/arch/efm32/arch_init.c	Tue Jun 19 11:02:19 2018 +0200
+++ b/arch/efm32/arch_init.c	Tue Jun 19 11:00:47 2018 +0200
@@ -61,6 +61,10 @@
   cpu_mem_write_32(b + EFM32_CMU_LFACLKEN0_ADDR, EFM32_CMU_LFACLKEN0_MASK);
   cpu_mem_write_32(b + EFM32_CMU_LFBCLKEN0_ADDR, EFM32_CMU_LFBCLKEN0_MASK);
 
+  /* Enable LFRCO */
+  cpu_mem_write_32(EFM32_CMU_ADDR + EFM32_CMU_OSCENCMD_ADDR, EFM32_CMU_OSCENCMD_LFRCOEN);
+  while (!(cpu_mem_read_32(EFM32_CMU_ADDR + EFM32_CMU_STATUS_ADDR) & EFM32_CMU_STATUS_LFRCORDY))
+    ;
 }
 
 #endif