Skip to content

Commit 9964571

Browse files
andy-shevIngo Molnar
authored andcommitted
x86/early_printk: Use 'mmio32' for consistency, fix comments
First of all, using 'mmio' prevents proper implementation of 8-bit accessors. Second, it's simply inconsistent with uart8250 set of options. Rename it to 'mmio32'. While at it, remove rather misleading comment in the documentation. From now on mmio32 is self-explanatory and pciserial supports not only 32-bit MMIO accessors. Also, while at it, fix the comment for the "pciserial" case. The comment seems to be a copy'n'paste error when mentioning "serial" instead of "pciserial" (with double quotes). Fix this. With that, move it upper, so we don't calculate 'buf' twice. Fixes: 3181424 ("x86/early_printk: Add support for MMIO-based UARTs") Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Ingo Molnar <mingo@kernel.org> Reviewed-by: Denis Mukhin <dmukhin@ford.com> Link: https://lore.kernel.org/r/20250407172214.792745-1-andriy.shevchenko@linux.intel.com
1 parent 45c2e30 commit 9964571

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

Documentation/admin-guide/kernel-parameters.txt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1407,18 +1407,15 @@
14071407
earlyprintk=serial[,0x...[,baudrate]]
14081408
earlyprintk=ttySn[,baudrate]
14091409
earlyprintk=dbgp[debugController#]
1410+
earlyprintk=mmio32,membase[,{nocfg|baudrate}]
14101411
earlyprintk=pciserial[,force],bus:device.function[,{nocfg|baudrate}]
14111412
earlyprintk=xdbc[xhciController#]
14121413
earlyprintk=bios
1413-
earlyprintk=mmio,membase[,{nocfg|baudrate}]
14141414

14151415
earlyprintk is useful when the kernel crashes before
14161416
the normal console is initialized. It is not enabled by
14171417
default because it has some cosmetic problems.
14181418

1419-
Only 32-bit memory addresses are supported for "mmio"
1420-
and "pciserial" devices.
1421-
14221419
Use "nocfg" to skip UART configuration, assume
14231420
BIOS/firmware has configured UART correctly.
14241421

arch/x86/kernel/early_printk.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -389,10 +389,10 @@ static int __init setup_early_printk(char *buf)
389389
keep = (strstr(buf, "keep") != NULL);
390390

391391
while (*buf != '\0') {
392-
if (!strncmp(buf, "mmio", 4)) {
393-
early_mmio_serial_init(buf + 4);
392+
if (!strncmp(buf, "mmio32", 6)) {
393+
buf += 6;
394+
early_mmio_serial_init(buf);
394395
early_console_register(&early_serial_console, keep);
395-
buf += 4;
396396
}
397397
if (!strncmp(buf, "serial", 6)) {
398398
buf += 6;
@@ -407,9 +407,9 @@ static int __init setup_early_printk(char *buf)
407407
}
408408
#ifdef CONFIG_PCI
409409
if (!strncmp(buf, "pciserial", 9)) {
410-
early_pci_serial_init(buf + 9);
410+
buf += 9; /* Keep from match the above "pciserial" */
411+
early_pci_serial_init(buf);
411412
early_console_register(&early_serial_console, keep);
412-
buf += 9; /* Keep from match the above "serial" */
413413
}
414414
#endif
415415
if (!strncmp(buf, "vga", 3) &&

0 commit comments

Comments
 (0)