@@ -2,7 +2,7 @@
config EARLY_PRINTK
bool "Early printk" if EXPERT
- depends on SYS_HAS_EARLY_PRINTK
+ depends on SYS_HAS_EARLY_PRINTK || DEBUG_LL
default y
help
This option enables special console drivers which allow the kernel
@@ -14,6 +14,24 @@
#include <asm/setup.h>
+#ifdef CONFIG_DEBUG_LL
+extern void printascii(const char *);
+
+static void early_console_write(struct console *con, const char *s, unsigned n)
+{
+ char buf[128];
+
+ while (n) {
+ unsigned int l = min(n, sizeof(buf)-1);
+
+ memcpy(buf, s, l);
+ buf[l] = 0;
+ s += l;
+ n -= l;
+ printascii(buf);
+ }
+}
+#else
static void early_console_write(struct console *con, const char *s, unsigned n)
{
while (n-- && *s) {
@@ -23,6 +41,7 @@ static void early_console_write(struct console *con, const char *s, unsigned n)
s++;
}
}
+#endif
static struct console early_console_prom = {
.name = "early",
Output earlyprintk to low-level debug functions when it's available. DEBUG_LL takes priority over platform earlyprintk because people must know what are they doing when they are trying to enable DEBUG_LL. Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com> --- arch/mips/Kconfig.debug | 2 +- arch/mips/kernel/early_printk.c | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-)