mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-12-29 09:16:33 +00:00
359fb3f870
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>
29 lines
704 B
C
29 lines
704 B
C
// 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);
|