Merge tag 'trace-printf-v6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/trace...
[drm/drm-misc.git] / drivers / tty / serial / earlycon-semihost.c
blobe4692a8433f9bd046a8ae8b73b014963dac98fc8
1 // SPDX-License-Identifier: GPL-2.0
2 /*
3 * Copyright (C) 2012 ARM Ltd.
4 * Author: Marc Zyngier <marc.zyngier@arm.com>
6 * Adapted for ARM and earlycon:
7 * Copyright (C) 2014 Linaro Ltd.
8 * Author: Rob Herring <robh@kernel.org>
9 */
10 #include <linux/kernel.h>
11 #include <linux/console.h>
12 #include <linux/init.h>
13 #include <linux/serial_core.h>
14 #include <asm/semihost.h>
16 static void smh_write(struct console *con, const char *s, unsigned n)
18 struct earlycon_device *dev = con->data;
19 uart_console_write(&dev->port, s, n, smh_putc);
22 static int
23 __init early_smh_setup(struct earlycon_device *device, const char *opt)
25 device->con->write = smh_write;
26 return 0;
28 EARLYCON_DECLARE(smh, early_smh_setup);