feat(st-clock): check HSE configuration in serial boot

In case of programmer mode, the bootrom manages to auto-detect
HSE clock configuration. In order to detect a bad device tree
setting in BL2, it will crash during programming if the configuration
is not aligned with the auto-detection.

Signed-off-by: Lionel Debieve <lionel.debieve@st.com>
Change-Id: I230697695745d6282d14b1ebfa6e4c4caa0cd8e2
This commit is contained in:
Lionel Debieve 2019-07-02 18:03:34 +02:00 committed by Yann Gautier
parent bcccdacc7e
commit 31e9750bc1
1 changed files with 7 additions and 0 deletions

View File

@ -1350,6 +1350,13 @@ static void stm32mp1_hse_enable(bool bypass, bool digbyp, bool css)
if (css) {
mmio_write_32(rcc_base + RCC_OCENSETR, RCC_OCENR_HSECSSON);
}
#if STM32MP_UART_PROGRAMMER || STM32MP_USB_PROGRAMMER
if ((mmio_read_32(rcc_base + RCC_OCENSETR) & RCC_OCENR_HSEBYP) &&
(!(digbyp || bypass))) {
panic();
}
#endif
}
static void stm32mp1_csi_set(bool enable)