On 1/21/21 8:06 PM, Peter Maydell wrote:
> Now that the CMSDK APB watchdog uses its Clock input, it will
> correctly respond when the system clock frequency is changed using
> the RCC register on in the Stellaris board system registers. Test
> that when the RCC register is written it causes the watchdog timer to
> change speed.
>
> Signed-off-by: Peter Maydell <[email protected]>
> ---
> tests/qtest/cmsdk-apb-watchdog-test.c | 52 +++++++++++++++++++++++++++
> 1 file changed, 52 insertions(+)
...
> +static void test_clock_change(void)
> +{
> + uint32_t rcc;
> +
> + /*
> + * Test that writing to the stellaris board's RCC register to
> + * change the system clock frequency causes the watchdog
> + * to change the speed it counts at.
> + */
> + g_assert_cmpuint(readl(WDOG_BASE + WDOGRIS), ==, 0);
> +
> + writel(WDOG_BASE + WDOGCONTROL, 1);
> + writel(WDOG_BASE + WDOGLOAD, 1000);
> +
> + /* Step to just past the 500th tick */
> + clock_step(80 * 500 + 1);
I was wondering about asking you to change that 40000 in patch #3.
Since you use that clearer form here, it would be nice to have it
in #3 too.
Otherwise,
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>