[SeaBIOS] [PATCH] serial console conflicts with serial debugging

Stephen Douthit stephend at adiengineering.com
Thu Nov 2 15:41:50 CET 2017


On 11/02/2017 05:02 AM, Gerd Hoffmann wrote:
> Signed-off-by: Gerd Hoffmann <kraxel at redhat.com>
> ---
>   src/Kconfig | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/src/Kconfig b/src/Kconfig
> index 4870a3e7b7..985594c51b 100644
> --- a/src/Kconfig
> +++ b/src/Kconfig
> @@ -553,6 +553,7 @@ menu "Debugging"
>       config DEBUG_SERIAL
>           depends on DEBUG_LEVEL != 0
>           bool "Serial port debugging"
> +        depends on !SERCON
>           default n
>           help
>               Send debugging information to serial port.
> 

Could we instead add a config option to set the default to SERCON UART
address like we do for the debug UART address?

Some boards have different UARTs for debug and user console, so I don't
think we want these to be mutually exclusive.

How about something like this instead:

Signed-off-by: Stephen Douthit <stephend at adiengineering.com>

---
 src/Kconfig  | 6 ++++++
 src/sercon.c | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/Kconfig b/src/Kconfig
index 55a87cb..03b0310 100644
--- a/src/Kconfig
+++ b/src/Kconfig
@@ -311,6 +311,12 @@ menu "Hardware support"
         default y
         help
             Support redirecting vga output to the serial console.
+    config SERCON_PORT
+        hex "Serial console port base address"
+	default 0x3f8
+        help
+            Base port for serial console - generally 0x3f8, 0x2f8, 0x3e8,
+	    or 0x2e8.  Can be overridden via etc/sercon-port romfile.
     config LPT
         bool "Parallel port"
         default y
diff --git a/src/sercon.c b/src/sercon.c
index 5d27051..354ffd9 100644
--- a/src/sercon.c
+++ b/src/sercon.c
@@ -516,7 +516,7 @@ void sercon_setup(void)
     struct segoff_s seabios, vgabios;
     u16 addr;
 
-    addr = romfile_loadint("etc/sercon-port", 0);
+    addr = romfile_loadint("etc/sercon-port", CONFIG_SERCON_PORT);
     if (!addr)
         return;
     dprintf(1, "sercon: using ioport 0x%x\n", addr);
-- 
2.13.6




More information about the SeaBIOS mailing list