qemu: make check: add timeout parameter, defaults to 480s

The Expect timeout can be passed via make as, for instance:
  make check TIMEOUT=60

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Joakim Bech <joakim.bech@linaro.org>
diff --git a/qemu.mk b/qemu.mk
index 8bba29f..62da0f6 100644
--- a/qemu.mk
+++ b/qemu.mk
@@ -217,9 +217,13 @@
 CHECK_DEPS := all
 endif
 
+check-args := --bios $(ROOT)/out/bios-qemu/bios.bin
+ifneq ($(TIMEOUT),)
+check-args += --timeout $(TIMEOUT)
+endif
+
 check: $(CHECK_DEPS)
-	expect qemu-check.exp -- \
-		--bios $(ROOT)/out/bios-qemu/bios.bin || \
+	expect qemu-check.exp -- $(check-args) || \
 		(if [ "$(DUMP_LOGS_ON_ERROR)" ]; then \
 			echo "== $$PWD/serial0.log:"; \
 			cat serial0.log; \