timer: Add a test for timer_timebase_fallback
authorSean Anderson <seanga2@gmail.com>
Mon, 28 Sep 2020 14:52:23 +0000 (10:52 -0400)
committerAndes <uboot@andestech.com>
Wed, 30 Sep 2020 00:54:45 +0000 (08:54 +0800)
commit7616e3687e447b5a838f472afb5275fe6a841f5b
tree805ce147c29cffb9b0c4027a7151f596bc5960ff
parent3576121687965ffe580fc44f5dd1d8e9ab434c5b
timer: Add a test for timer_timebase_fallback

To test this function, sandbox CPU must set cpu_platdata.timebase_freq on
bind. It also needs to expose a method to set the current cpu. I also make
some most members of cpu_sandbox_ops static.

On the timer side, the device tree property
sandbox,timebase-frequency-fallback controls whether sandbox_timer_probe
falls back to time_timebase_fallback or to SANDBOX_TIMER_RATE.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
arch/sandbox/dts/test.dts
arch/sandbox/include/asm/cpu.h [new file with mode: 0644]
drivers/cpu/cpu_sandbox.c
drivers/timer/sandbox_timer.c
test/dm/timer.c