public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 0/6] x86/boot: Enable earlyprintk on MMIO (8-bit)
@ 2025-05-02 12:29 Andy Shevchenko
  2025-05-02 12:29 ` [PATCH v1 1/6] x86/boot: Convert early_serial_base to unsigned long Andy Shevchenko
                   ` (7 more replies)
  0 siblings, 8 replies; 17+ messages in thread
From: Andy Shevchenko @ 2025-05-02 12:29 UTC (permalink / raw)
  To: Andy Shevchenko, Ashish Kalra, Kirill A. Shutemov, linux-kernel
  Cc: Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, x86,
	H. Peter Anvin, David Woodhouse, Denis Mukhin

Some of the platforms may have no legacy COM ports and only provide
an MMIO accessible UART. Add support for such to earlyprintk for the
boot phase of the kernel.

Andy Shevchenko (6):
  x86/boot: Convert early_serial_base to unsigned long
  x86/boot: Introduce helpers for serial I/O
  x86/boot: Split out parse_serial_port() helper for earlyprintk
  x86/boot: Allow longer parameter list for earlyprintk
  x86/boot: Also share MMIO accessors
  x86/boot: Introduce MMIO accessors and their support in earlyprintk

 arch/x86/boot/boot.h                          |   4 +-
 .../boot/compressed/early_serial_console.c    |   5 +-
 arch/x86/boot/compressed/misc.c               |   4 +-
 arch/x86/boot/compressed/misc.h               |   8 +-
 arch/x86/boot/early_serial_console.c          | 114 ++++++++++++++----
 arch/x86/boot/tty.c                           |   9 +-
 arch/x86/include/asm/io.h                     |  65 ----------
 arch/x86/include/asm/shared/io.h              |  68 +++++++++++
 8 files changed, 177 insertions(+), 100 deletions(-)

-- 
2.47.2


^ permalink raw reply	[flat|nested] 17+ messages in thread
* [PATCH v1 1/6] x86/boot: Convert early_serial_base to unsigned long
@ 2018-01-14 14:32 Andy Shevchenko
  2018-01-14 14:32 ` [PATCH v1 2/6] x86/boot: Introduce helpers for serial I/O Andy Shevchenko
  0 siblings, 1 reply; 17+ messages in thread
From: Andy Shevchenko @ 2018-01-14 14:32 UTC (permalink / raw)
  To: H. Peter Anvin, Thomas Gleixner, Ingo Molnar, x86, linux-kernel
  Cc: Andy Shevchenko

As a preparatory of adding flexible serial I/O accessors, convert
early_serial_base to unsigned long to cover all possible bus addresses
on the system.

No functional change intended.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 arch/x86/boot/boot.h                            | 2 +-
 arch/x86/boot/compressed/early_serial_console.c | 2 +-
 arch/x86/boot/compressed/misc.h                 | 4 ++--
 arch/x86/boot/early_serial_console.c            | 6 +++---
 arch/x86/boot/tty.c                             | 2 +-
 5 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/arch/x86/boot/boot.h b/arch/x86/boot/boot.h
index ef5a9cc66fb8..d9f8279774f6 100644
--- a/arch/x86/boot/boot.h
+++ b/arch/x86/boot/boot.h
@@ -299,7 +299,7 @@ int check_knl_erratum(void);
 int validate_cpu(void);
 
 /* early_serial_console.c */
-extern int early_serial_base;
+extern unsigned long early_serial_base;
 void console_init(void);
 
 /* edd.c */
diff --git a/arch/x86/boot/compressed/early_serial_console.c b/arch/x86/boot/compressed/early_serial_console.c
index 261e81fb9582..5e3a66478754 100644
--- a/arch/x86/boot/compressed/early_serial_console.c
+++ b/arch/x86/boot/compressed/early_serial_console.c
@@ -1,5 +1,5 @@
 #include "misc.h"
 
-int early_serial_base;
+unsigned long early_serial_base;
 
 #include "../early_serial_console.c"
diff --git a/arch/x86/boot/compressed/misc.h b/arch/x86/boot/compressed/misc.h
index 9d323dc6b159..d36d4398a6b0 100644
--- a/arch/x86/boot/compressed/misc.h
+++ b/arch/x86/boot/compressed/misc.h
@@ -101,10 +101,10 @@ static inline void finalize_identity_maps(void)
 
 #ifdef CONFIG_EARLY_PRINTK
 /* early_serial_console.c */
-extern int early_serial_base;
+extern unsigned long early_serial_base;
 void console_init(void);
 #else
-static const int early_serial_base;
+static const unsigned long early_serial_base;
 static inline void console_init(void)
 { }
 #endif
diff --git a/arch/x86/boot/early_serial_console.c b/arch/x86/boot/early_serial_console.c
index b25c53527a94..a5aec142c91a 100644
--- a/arch/x86/boot/early_serial_console.c
+++ b/arch/x86/boot/early_serial_console.c
@@ -23,7 +23,7 @@
 
 #define DEFAULT_BAUD 9600
 
-static void early_serial_init(int port, int baud)
+static void early_serial_init(unsigned long port, int baud)
 {
 	unsigned char c;
 	unsigned divisor;
@@ -48,7 +48,7 @@ static void parse_earlyprintk(void)
 	int baud = DEFAULT_BAUD;
 	char arg[32];
 	int pos = 0;
-	int port = 0;
+	unsigned long port = 0;
 
 	if (cmdline_find_option("earlyprintk", arg, sizeof arg) > 0) {
 		char *e;
@@ -118,7 +118,7 @@ static void parse_console_uart8250(void)
 {
 	char optstr[64], *options;
 	int baud = DEFAULT_BAUD;
-	int port = 0;
+	unsigned long port = 0;
 
 	/*
 	 * console=uart8250,io,0x3f8,115200n8
diff --git a/arch/x86/boot/tty.c b/arch/x86/boot/tty.c
index def2451f46ae..d1d34c6ca153 100644
--- a/arch/x86/boot/tty.c
+++ b/arch/x86/boot/tty.c
@@ -15,7 +15,7 @@
 
 #include "boot.h"
 
-int early_serial_base;
+unsigned long early_serial_base;
 
 #define XMTRDY          0x20
 
-- 
2.15.1

^ permalink raw reply related	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2025-05-07 13:54 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-02 12:29 [PATCH v1 0/6] x86/boot: Enable earlyprintk on MMIO (8-bit) Andy Shevchenko
2025-05-02 12:29 ` [PATCH v1 1/6] x86/boot: Convert early_serial_base to unsigned long Andy Shevchenko
2025-05-02 12:29 ` [PATCH v1 2/6] x86/boot: Introduce helpers for serial I/O Andy Shevchenko
2025-05-02 12:29 ` [PATCH v1 3/6] x86/boot: Split out parse_serial_port() helper for earlyprintk Andy Shevchenko
2025-05-02 12:29 ` [PATCH v1 4/6] x86/boot: Allow longer parameter list " Andy Shevchenko
2025-05-02 12:29 ` [PATCH v1 5/6] x86/boot: Also share MMIO accessors Andy Shevchenko
2025-05-02 12:29 ` [PATCH v1 6/6] x86/boot: Introduce MMIO accessors and their support in earlyprintk Andy Shevchenko
2025-05-02 17:33 ` [PATCH v1 0/6] x86/boot: Enable earlyprintk on MMIO (8-bit) David Woodhouse
2025-05-05 14:05   ` Andy Shevchenko
2025-05-05 14:35     ` David Woodhouse
2025-05-05 14:59       ` Andy Shevchenko
2025-05-05 15:01         ` Andy Shevchenko
2025-05-05 23:32           ` David Woodhouse
2025-05-06  3:19             ` David Woodhouse
2025-05-06 19:38 ` David Woodhouse
2025-05-07 13:54   ` Andy Shevchenko
  -- strict thread matches above, loose matches on Subject: below --
2018-01-14 14:32 [PATCH v1 1/6] x86/boot: Convert early_serial_base to unsigned long Andy Shevchenko
2018-01-14 14:32 ` [PATCH v1 2/6] x86/boot: Introduce helpers for serial I/O Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox