From e98ea27cc1e6ea8f439d3648578153321a943a5f Mon Sep 17 00:00:00 2001 From: Jose Alberto Meza Date: Wed, 7 Aug 2019 16:37:11 -0700 Subject: [PATCH] soc: mchp: Perform OTP override for 32KHz internal oscillator Perform OTP override when selecting 32Khz internal oscillator to ensure 32KHz is enabled. Signed-off-by: Jose Alberto Meza --- soc/arm/microchip_mec/mec1501/soc.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/soc/arm/microchip_mec/mec1501/soc.c b/soc/arm/microchip_mec/mec1501/soc.c index 0dc65254d62..22168cbe5c3 100644 --- a/soc/arm/microchip_mec/mec1501/soc.c +++ b/soc/arm/microchip_mec/mec1501/soc.c @@ -84,7 +84,12 @@ static int soc_clk32_init(void) new_clk32 = MCHP_VBATR_USE_32KIN_PIN; #endif #else - /* Use internal 32KHz +/-2% silicon oscillator */ + /* Use internal 32KHz +/-2% silicon oscillator + * if required performed OTP value override + */ + if (MCHP_REVISION_ID() == MCHP_GCFG_REV_B0) { + VBATR_REGS->CKK32_TRIM = 0x06; + } new_clk32 = MCHP_VBATR_USE_SIL_OSC; #endif clk32_change(new_clk32);