Skip to content

Commit

Permalink
plat-stm32mp1: calibration: don't panic if freqency is out of range
Browse files Browse the repository at this point in the history
After calibration just display message if frequency of LSI or HSI is still
out of range.

Signed-off-by: Gabriel Fernandez <[email protected]>
Change-Id: I979f5483029b9022e22a538ca6d2e1fa9466127f
Reviewed-on: https://gerrit.st.com/c/mpu/oe/optee/optee_os/+/321220
ACI: CITOOLS <[email protected]>
ACI: CIBUILD <[email protected]>
Reviewed-by: Gatien CHEVALLIER <[email protected]>
Domain-Review: Gatien CHEVALLIER <[email protected]>
  • Loading branch information
Gabriel-Fernandz authored and GseoC committed Aug 3, 2023
1 parent 9cd4872 commit cc55eba
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions core/arch/arm/plat-stm32mp1/drivers/stm32mp1_calib.c
Original file line number Diff line number Diff line change
Expand Up @@ -292,19 +292,22 @@ static void osc_calibration(struct stm32mp1_clk_cal *clk_cal)
trim = new_trim;
}

if (timeout_elapsed(timeout_ref))
if (timeout_elapsed(timeout_ref)) {
EMSG("%s Timeout: %lu , trim %i\n",
clk_cal->name, freq, trim);
break;
}

} while (conv == min_conv);

DMSG("Calibration : Freq %lu , trim %i\n", freq, trim);

clk_cal->set_trim(trim, clk_cal->cal_ref);
freq = get_freq(clk_cal);
if (freq < min || freq > max) {
EMSG("Calibration failed: Freq %lu , trim %i\n", freq, trim);
panic();
}
if (freq < min || freq > max)
EMSG("%s Freq out of range: %lu , trim %i\n", clk_cal->name,
freq, trim);

}

static void save_trim(struct stm32mp1_clk_cal *clk_cal,
Expand Down

0 comments on commit cc55eba

Please sign in to comment.