Hi Peter,
On 2/19/21 3:46 PM, Peter Maydell wrote:
> Add a simple qtest to exercise the new system counter and
> system timer device in the SSE-300.
>
> Signed-off-by: Peter Maydell <[email protected]>
> ---
> tests/qtest/sse-timer-test.c | 240 +++++++++++++++++++++++++++++++++++
> MAINTAINERS | 1 +
> tests/qtest/meson.build | 1 +
> 3 files changed, 242 insertions(+)
> create mode 100644 tests/qtest/sse-timer-test.c
> +static void reset_counter_and_timer(void)
> +{
> + /*
> + * Reset the system counter and the timer between tests. This
> + * isn't a full reset, but it's sufficient for what the tests check.
> + */
> + writel(COUNTER_BASE + CNTCR, 0);
> + writel(TIMER_BASE + CNTP_CTL, 0);
> + writel(TIMER_BASE + CNTP_AIVAL_CTL, 0);
> + writel(COUNTER_BASE + CNTCV_LO, 0);
> + writel(COUNTER_BASE + CNTCV_HI, 0);
> +}
> +
> +static void test_timer(void)
> +{
> + /* Basic timer functionality test */
Minor comment, I'd move the timer mode test *after* the counter mode
ones, which are easier to review. Eventually consider adding this
single timer test as a separate patch to ease review, as it is quite
complex.
Having this patch preferably split (no need to repost):
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Tested-by: Philippe Mathieu-Daudé <[email protected]>
Regards,
Phil.