qemu: make local ports in use configurable

Make it possible to set the local ports used for the non-secure
(QEMU_NW_PORT) and secure (QEMU_SW_PORT) terminal when running QEMU.

When you need to run multiple QEMU/OP-TEE instances (debugging,
multi-user etc.) on the same physical (non-containerized environment)
computer, this is useful because you can avoid port collisions (port
already in use message) by simply setting non-clashing port numbers
when running make and thereby also avoid making changes directly to the
makefile.

Signed-off-by: Joakim Bech <joakim.bech@linaro.org>
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Acked-by: Etienne Carriere <etienne.carriere@foss.st.com>
diff --git a/qemu_v8.mk b/qemu_v8.mk
index 2e5a869..702f157 100644
--- a/qemu_v8.mk
+++ b/qemu_v8.mk
@@ -475,12 +475,12 @@
 	ln -sf $(ROOT)/out-br/images/rootfs.cpio.gz $(BINARIES_PATH)/
 	$(call check-terminal)
 	$(call run-help)
-	$(call launch-terminal,54320,"Normal World")
-	$(call launch-terminal,54321,"Secure World")
-	$(call wait-for-ports,54320,54321)
+	$(call launch-terminal,$(QEMU_NW_PORT),"Normal World")
+	$(call launch-terminal,$(QEMU_SW_PORT),"Secure World")
+	$(call wait-for-ports,$(QEMU_NW_PORT),$(QEMU_SW_PORT))
 	cd $(BINARIES_PATH) && $(QEMU_BUILD)/aarch64-softmmu/qemu-system-aarch64 \
 		-nographic \
-		-serial tcp:127.0.0.1:54320 -serial tcp:127.0.0.1:54321 \
+		-serial tcp:127.0.0.1:$(QEMU_NW_PORT) -serial tcp:127.0.0.1:$(QEMU_SW_PORT) \
 		-smp $(QEMU_SMP) \
 		-s -S -machine virt,acpi=off,secure=on,mte=$(QEMU_MTE),gic-version=$(QEMU_GIC_VERSION),virtualization=$(QEMU_VIRT) \
 		-cpu $(QEMU_CPU) \