1 // SPDX-License-Identifier: GPL-2.0-only
3 * linux/arch/arm/kernel/early_printk.c
5 * Copyright (C) 2009 Sascha Hauer <s.hauer@pengutronix.de>
8 #include <linux/kernel.h>
9 #include <linux/console.h>
10 #include <linux/init.h>
11 #include <linux/string.h>
13 extern void printascii(const char *);
15 static void early_write(const char *s
, unsigned n
)
19 unsigned l
= min(n
, sizeof(buf
)-1);
28 static void early_console_write(struct console
*con
, const char *s
, unsigned n
)
33 static struct console early_console_dev
= {
35 .write
= early_console_write
,
36 .flags
= CON_PRINTBUFFER
| CON_BOOT
,
40 static int __init
setup_early_printk(char *buf
)
42 early_console
= &early_console_dev
;
43 register_console(&early_console_dev
);
47 early_param("earlyprintk", setup_early_printk
);