serial: Rename earlycon semihost driver
authorBin Meng <bmeng@tinylab.org>
Fri, 9 Dec 2022 15:04:37 +0000 (23:04 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 19 Jan 2023 13:58:19 +0000 (14:58 +0100)
Now that earlycon semihost driver works on RISC-V too, let's use a
much more generic name for the driver.

Signed-off-by: Bin Meng <bmeng@tinylab.org>
Tested-by: Sergey Matyukevich <sergey.matyukevich@syntacore.com>
Acked-by: Palmer Dabbelt <palmer@rivosinc.com>
Link: https://lore.kernel.org/r/20221209150437.795918-4-bmeng@tinylab.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/Kconfig
drivers/tty/serial/Makefile
drivers/tty/serial/earlycon-arm-semihost.c [deleted file]
drivers/tty/serial/earlycon-semihost.c [new file with mode: 0644]

index 5a2cf9686b207ddcedb3bbe3363359b17b0aa13c..fc99bb09e04525a82d29c6ae049f5795ed245a23 100644 (file)
@@ -73,17 +73,17 @@ config SERIAL_AMBA_PL011_CONSOLE
          your boot loader (lilo or loadlin) about how to pass options to the
          kernel at boot time.)
 
-config SERIAL_EARLYCON_ARM_SEMIHOST
-       bool "Early console using ARM semihosting"
+config SERIAL_EARLYCON_SEMIHOST
+       bool "Early console using Arm compatible semihosting"
        depends on ARM64 || ARM || RISCV
        select SERIAL_CORE
        select SERIAL_CORE_CONSOLE
        select SERIAL_EARLYCON
        help
-         Support for early debug console using ARM semihosting. This enables
-         the console before standard serial driver is probed. This is enabled
-         with "earlycon=smh" on the kernel command line. The console is
-         enabled when early_param is processed.
+         Support for early debug console using Arm compatible semihosting.
+         This enables the console before standard serial driver is probed.
+         This is enabled with "earlycon=smh" on the kernel command line.
+         The console is enabled when early_param is processed.
 
 config SERIAL_EARLYCON_RISCV_SBI
        bool "Early console using RISC-V SBI"
index 238a9557b4872e19e50989b4e5c51f0afbe6ad41..cd9afd9e3018f65e7255e3220d179351375863af 100644 (file)
@@ -6,7 +6,7 @@
 obj-$(CONFIG_SERIAL_CORE) += serial_core.o
 
 obj-$(CONFIG_SERIAL_EARLYCON) += earlycon.o
-obj-$(CONFIG_SERIAL_EARLYCON_ARM_SEMIHOST) += earlycon-arm-semihost.o
+obj-$(CONFIG_SERIAL_EARLYCON_SEMIHOST) += earlycon-semihost.o
 obj-$(CONFIG_SERIAL_EARLYCON_RISCV_SBI) += earlycon-riscv-sbi.o
 
 # These Sparc drivers have to appear before others such as 8250
diff --git a/drivers/tty/serial/earlycon-arm-semihost.c b/drivers/tty/serial/earlycon-arm-semihost.c
deleted file mode 100644 (file)
index e4692a8..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * Copyright (C) 2012 ARM Ltd.
- * Author: Marc Zyngier <marc.zyngier@arm.com>
- *
- * Adapted for ARM and earlycon:
- * Copyright (C) 2014 Linaro Ltd.
- * Author: Rob Herring <robh@kernel.org>
- */
-#include <linux/kernel.h>
-#include <linux/console.h>
-#include <linux/init.h>
-#include <linux/serial_core.h>
-#include <asm/semihost.h>
-
-static void smh_write(struct console *con, const char *s, unsigned n)
-{
-       struct earlycon_device *dev = con->data;
-       uart_console_write(&dev->port, s, n, smh_putc);
-}
-
-static int
-__init early_smh_setup(struct earlycon_device *device, const char *opt)
-{
-       device->con->write = smh_write;
-       return 0;
-}
-EARLYCON_DECLARE(smh, early_smh_setup);
diff --git a/drivers/tty/serial/earlycon-semihost.c b/drivers/tty/serial/earlycon-semihost.c
new file mode 100644 (file)
index 0000000..e4692a8
--- /dev/null
@@ -0,0 +1,28 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (C) 2012 ARM Ltd.
+ * Author: Marc Zyngier <marc.zyngier@arm.com>
+ *
+ * Adapted for ARM and earlycon:
+ * Copyright (C) 2014 Linaro Ltd.
+ * Author: Rob Herring <robh@kernel.org>
+ */
+#include <linux/kernel.h>
+#include <linux/console.h>
+#include <linux/init.h>
+#include <linux/serial_core.h>
+#include <asm/semihost.h>
+
+static void smh_write(struct console *con, const char *s, unsigned n)
+{
+       struct earlycon_device *dev = con->data;
+       uart_console_write(&dev->port, s, n, smh_putc);
+}
+
+static int
+__init early_smh_setup(struct earlycon_device *device, const char *opt)
+{
+       device->con->write = smh_write;
+       return 0;
+}
+EARLYCON_DECLARE(smh, early_smh_setup);