2017-11-06 18:11:51 +01:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
2014-04-18 17:19:58 -05:00
|
|
|
/*
|
|
|
|
* 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>
|
2022-12-09 23:04:35 +08:00
|
|
|
#include <asm/semihost.h>
|
2014-04-18 17:19:58 -05:00
|
|
|
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
|
2016-09-01 19:43:31 +08:00
|
|
|
static int
|
|
|
|
__init early_smh_setup(struct earlycon_device *device, const char *opt)
|
2014-04-18 17:19:58 -05:00
|
|
|
{
|
|
|
|
device->con->write = smh_write;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
EARLYCON_DECLARE(smh, early_smh_setup);
|