adm5120: move early-printk support into a separate file
authorGabor Juhos <juhosg@openwrt.org>
Sat, 2 Jan 2010 15:07:34 +0000 (15:07 +0000)
committerGabor Juhos <juhosg@openwrt.org>
Sat, 2 Jan 2010 15:07:34 +0000 (15:07 +0000)
SVN-Revision: 19000

target/linux/adm5120/files/arch/mips/adm5120/common/Makefile
target/linux/adm5120/files/arch/mips/adm5120/common/early-printk.c [new file with mode: 0644]
target/linux/adm5120/files/arch/mips/adm5120/common/prom.c

index d24aa07889f5a1cb786a608e20998b40dc8536bb..8d302c59317e49c7e9313e388f417c4146e37a43 100644 (file)
@@ -4,3 +4,5 @@
 
 obj-y  := adm5120.o setup.o prom.o irq.o memory.o clock.o \
           gpio.o platform.o
+
+obj-$(CONFIG_EARLY_PRINTK)     += early-printk.o
diff --git a/target/linux/adm5120/files/arch/mips/adm5120/common/early-printk.c b/target/linux/adm5120/files/arch/mips/adm5120/common/early-printk.c
new file mode 100644 (file)
index 0000000..6aff147
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ *  ADM5120 specific early printk support
+ *
+ *  Copyright (C) 2007-2008 Gabor Juhos <juhosg@openwrt.org>
+ *
+ *  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.
+ *
+ */
+
+#include <linux/init.h>
+#include <linux/io.h>
+
+#include <asm/addrspace.h>
+#include <asm/mach-adm5120/adm5120_defs.h>
+#include <asm/mach-adm5120/adm5120_uart.h>
+
+#define UART_READ(r) \
+       __raw_readl((void __iomem *)(KSEG1ADDR(ADM5120_UART0_BASE)+(r)))
+#define UART_WRITE(r, v) \
+       __raw_writel((v), (void __iomem *)(KSEG1ADDR(ADM5120_UART0_BASE)+(r)))
+
+void __init prom_putchar(char ch)
+{
+       while ((UART_READ(UART_REG_FLAG) & UART_FLAG_TXFE) == 0);
+       UART_WRITE(UART_REG_DATA, ch);
+       while ((UART_READ(UART_REG_FLAG) & UART_FLAG_TXFE) == 0);
+}
index 5b2e45defec77827bc0920f33c9e429cba80578d..adc9e8c71a3e3c734e3afb7ec818995feeb7e272 100644 (file)
 #include <linux/kernel.h>
 #include <linux/string.h>
 #include <linux/mm.h>
-#include <linux/io.h>
 
-#include <asm/addrspace.h>
 #include <asm/bootinfo.h>
 #include <asm/mips_machine.h>
 
 #include <asm/mach-adm5120/adm5120_info.h>
-#include <asm/mach-adm5120/adm5120_defs.h>
-#include <asm/mach-adm5120/adm5120_uart.h>
 
 #include <prom/cfe.h>
 #include <prom/generic.h>
@@ -254,18 +250,6 @@ static void __init prom_init_cmdline(void)
 static void inline prom_init_cmdline(void) {}
 #endif /* CONFIG_IMAGE_CMDLINE_HACK */
 
-#define UART_READ(r) \
-       __raw_readl((void __iomem *)(KSEG1ADDR(ADM5120_UART0_BASE)+(r)))
-#define UART_WRITE(r, v) \
-       __raw_writel((v), (void __iomem *)(KSEG1ADDR(ADM5120_UART0_BASE)+(r)))
-
-void __init prom_putchar(char ch)
-{
-       while ((UART_READ(UART_REG_FLAG) & UART_FLAG_TXFE) == 0);
-       UART_WRITE(UART_REG_DATA, ch);
-       while ((UART_READ(UART_REG_FLAG) & UART_FLAG_TXFE) == 0);
-}
-
 void __init prom_init(void)
 {
        prom_detect_machtype();