arm64: dts: Revert "specify console via command line"
[linux/fpc-iii.git] / arch / unicore32 / kernel / early_printk.c
blobc00b6712b8f7f9549a8064624461dec4d6c47e90
1 // SPDX-License-Identifier: GPL-2.0-only
2 /*
3 * linux/arch/unicore32/kernel/early_printk.c
5 * Code specific to PKUnity SoC and UniCore ISA
7 * Copyright (C) 2001-2010 GUAN Xue-tao
8 */
9 #include <linux/console.h>
10 #include <linux/init.h>
11 #include <linux/string.h>
12 #include <mach/ocd.h>
14 /* On-Chip-Debugger functions */
16 static void early_ocd_write(struct console *con, const char *s, unsigned n)
18 while (*s && n-- > 0) {
19 if (*s == '\n')
20 ocd_putc((int)'\r');
21 ocd_putc((int)*s);
22 s++;
26 static struct console early_ocd_console = {
27 .name = "earlyocd",
28 .write = early_ocd_write,
29 .flags = CON_PRINTBUFFER,
30 .index = -1,
33 static int __init setup_early_printk(char *buf)
35 if (!buf || early_console)
36 return 0;
38 early_console = &early_ocd_console;
39 if (strstr(buf, "keep"))
40 early_console->flags &= ~CON_BOOT;
41 else
42 early_console->flags |= CON_BOOT;
43 register_console(early_console);
44 return 0;
46 early_param("earlyprintk", setup_early_printk);