payloads/external/SeaBIOS: add support for sercon port

Change-Id: Id2d2ed0fa97f2cef5818a8508bb8ee3ddba73647
Signed-off-by: Piotr Król <piotr.krol@3mdeb.com>
Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
Reviewed-on: https://review.coreboot.org/26060
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Rudolph <siro@das-labor.org>
diff --git a/Makefile.inc b/Makefile.inc
index aa93222..7ce2360 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -1023,6 +1023,10 @@
 endif
 endif
 endif
+ifeq ($(CONFIG_SEABIOS_ADD_SERCON_PORT_FILE),y)
+	@printf "    SeaBIOS    Add sercon-port file\n"
+	$(CBFSTOOL) $@.tmp add-int -i $(CONFIG_SEABIOS_SERCON_PORT_ADDR) -n etc/sercon-port
+endif
 ifeq ($(CONFIG_CPU_INTEL_FIRMWARE_INTERFACE_TABLE),y)
 ifeq ($(CONFIG_CPU_MICROCODE_CBFS_EXTERNAL_HEADER),y)
 	@printf "    UPDATE-FIT\n"
diff --git a/payloads/external/SeaBIOS/Kconfig b/payloads/external/SeaBIOS/Kconfig
index 52dc738..fb9f32b 100644
--- a/payloads/external/SeaBIOS/Kconfig
+++ b/payloads/external/SeaBIOS/Kconfig
@@ -86,6 +86,24 @@
 	  If used, a typical value would be:
 	    $(top)/src/mainboard/$(MAINBOARDDIR)/bootorder
 
+config SEABIOS_ADD_SERCON_PORT_FILE
+	prompt "Add SeaBIOS sercon-port file to CBFS"
+	default n
+	bool
+	help
+	  Select this option to enable SeaBIOS' VGA adapter emulation
+	  on serial port.
+
+config SEABIOS_SERCON_PORT_ADDR
+	hex "SeaBIOS sercon-port base address"
+	depends on SEABIOS_ADD_SERCON_PORT_FILE
+	default TTYS0_BASE
+	help
+	  Set this field to the IO address of a serial port for SeaBIOS' VGA
+	  adapter emulation.
+
+	  By default primary console UART defined by TTYS0_BASE is used.
+
 config PAYLOAD_FILE
 	default "payloads/external/SeaBIOS/seabios/out/bios.bin.elf"