diff options
author | John Crispin <john@openwrt.org> | 2010-12-12 22:57:16 +0000 |
---|---|---|
committer | John Crispin <john@openwrt.org> | 2010-12-12 22:57:16 +0000 |
commit | 9f47e80bb30bed05ebcdfe671d4f2a9e9c7bfe55 (patch) | |
tree | 3d80c2524b0e73b5f7c9982eca4fe9301efdf75a /target/linux/lantiq/patches/106-early_printk.patch | |
parent | f590b304ef7d22242e08c86866cbb37927f0a404 (diff) | |
download | mtk-20170518-9f47e80bb30bed05ebcdfe671d4f2a9e9c7bfe55.zip mtk-20170518-9f47e80bb30bed05ebcdfe671d4f2a9e9c7bfe55.tar.gz mtk-20170518-9f47e80bb30bed05ebcdfe671d4f2a9e9c7bfe55.tar.bz2 |
adds new lantiq kernel. once the codebase is fully tested and know to be working on all the devices previously supported by ifxmips, we will drop ifxmips support.
SVN-Revision: 24526
Diffstat (limited to 'target/linux/lantiq/patches/106-early_printk.patch')
-rw-r--r-- | target/linux/lantiq/patches/106-early_printk.patch | 93 |
1 files changed, 93 insertions, 0 deletions
diff --git a/target/linux/lantiq/patches/106-early_printk.patch b/target/linux/lantiq/patches/106-early_printk.patch new file mode 100644 index 0000000..34e0bdf --- /dev/null +++ b/target/linux/lantiq/patches/106-early_printk.patch @@ -0,0 +1,93 @@ +--- a/arch/mips/lantiq/Kconfig ++++ b/arch/mips/lantiq/Kconfig +@@ -33,4 +33,19 @@ endchoice + source "arch/mips/lantiq/falcon/Kconfig" + source "arch/mips/lantiq/xway/Kconfig" + ++if EARLY_PRINTK ++choice ++ prompt "Early printk port" ++ default LANTIQ_PROM_ASC1 ++ help ++ Choose which serial port is used, until the console driver is loaded ++ ++config LANTIQ_PROM_ASC0 ++ bool "ASC0" ++ ++config LANTIQ_PROM_ASC1 ++ bool "ASC1" ++endchoice ++endif ++ + endif +--- /dev/null ++++ b/arch/mips/lantiq/early_printk.c +@@ -0,0 +1,68 @@ ++/* ++ * This program is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 as published ++ * by the Free Software Foundation. ++ * ++ * Copyright (C) 2010 John Crispin <blogic@openwrt.org> ++ */ ++ ++#include <linux/init.h> ++#include <linux/cpu.h> ++ ++#include <lantiq.h> ++ ++#ifdef CONFIG_SOC_LANTIQ_XWAY ++#include <xway.h> ++#ifdef CONFIG_LANTIQ_PROM_ASC0 ++#define LQ_ASC_BASE KSEG1ADDR(LQ_ASC0_BASE) ++#else ++#define LQ_ASC_BASE KSEG1ADDR(LQ_ASC1_BASE) ++#endif ++ ++#elif CONFIG_SOC_LANTIQ_FALCON ++#include <falcon/gpon_reg_base.h> ++#ifdef CONFIG_LANTIQ_PROM_ASC0 ++#define LQ_ASC_BASE GPON_ASC0_BASE ++#else ++#define LQ_ASC_BASE GPON_ASC1_BASE ++#endif ++ ++#endif ++ ++#define ASC_BUF 1024 ++#define LQ_ASC_FSTAT 0x0048 ++#define LQ_ASC_TBUF 0x0020 ++#define TXMASK 0x3F00 ++#define TXOFFSET 8 ++ ++static char buf[ASC_BUF]; ++ ++void ++prom_putchar(char c) ++{ ++ unsigned long flags; ++ ++ local_irq_save(flags); ++ while ((lq_r32((u32 *)(LQ_ASC_BASE + LQ_ASC_FSTAT)) & TXMASK) >> TXOFFSET); ++ ++ if (c == '\n') ++ lq_w32('\r', (u32 *)(LQ_ASC_BASE + LQ_ASC_TBUF)); ++ lq_w32(c, (u32 *)(LQ_ASC_BASE + LQ_ASC_TBUF)); ++ local_irq_restore(flags); ++} ++ ++void ++early_printf(const char *fmt, ...) ++{ ++ va_list args; ++ int l; ++ char *p, *buf_end; ++ ++ va_start(args, fmt); ++ l = vsnprintf(buf, ASC_BUF, fmt, args); ++ va_end(args); ++ buf_end = buf + l; ++ ++ for (p = buf; p < buf_end; p++) ++ prom_putchar(*p); ++} |