On Thu, 3 Oct 2024 at 09:11, Inès Varhol <ines.var...@telecom-paris.fr> wrote: > > For USART, GPIO and SYSCFG devices, check that clock frequency before > and after enabling the peripheral clock in RCC is correct. > > Signed-off-by: Inès Varhol <ines.var...@telecom-paris.fr> > Reviewed-by: Peter Maydell <peter.mayd...@linaro.org> > Reviewed-by: Luc Michel <l...@lmichel.fr>
> +static void test_clock_enable(void) > +{ > + /* > + * For each USART device, enable its clock in RCC > + * and check that its clock frequency is SYSCLK_PERIOD > + */ > + QTestState *qts = qtest_init("-M b-l475e-iot01a"); > + > + check_clock(qts, "machine/soc/usart[0]/clk", RCC_APB2ENR, 14); > + check_clock(qts, "machine/soc/usart[1]/clk", RCC_APB1ENR1, 17); > + check_clock(qts, "machine/soc/usart[2]/clk", RCC_APB1ENR1, 18); > + check_clock(qts, "machine/soc/uart[0]/clk", RCC_APB1ENR1, 19); > + check_clock(qts, "machine/soc/uart[1]/clk", RCC_APB1ENR1, 20); > + check_clock(qts, "machine/soc/lpuart1/clk", RCC_APB1ENR2, 0); > +} This new test is missing the qtest_quit(qts) call at the end, which makes it hang when run on OpenBSD. (I fixed this up in the pullrequest.) thanks -- PMM