sandbox: Add a way to reset sandbox state for tests
authorSimon Glass <sjg@chromium.org>
Fri, 19 May 2017 02:09:13 +0000 (20:09 -0600)
committerSimon Glass <sjg@chromium.org>
Thu, 1 Jun 2017 13:03:09 +0000 (07:03 -0600)
commit34b744beb866c9ae660f2851f9776f80e165d421
tree33aef867d123887f4171a8fd2baa3432a7b1a1dd
parenta40cc8e12352ee35d095d29125fedd2eb2821228
sandbox: Add a way to reset sandbox state for tests

Running a new test should reset the sandbox state to avoid tests
interferring with each other. Move the existing state-reset code into a
function so it can be used from tests.

Also update the code to reset the SPI devices and adjust the test code to
call it.

Signed-off-by: Simon Glass <sjg@chromium.org>
arch/sandbox/cpu/state.c
arch/sandbox/include/asm/state.h
test/dm/test-main.c