summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorAntony Pavlov <antonynpavlov@gmail.com>2013-06-03 14:53:25 +0400
committerSascha Hauer <s.hauer@pengutronix.de>2013-06-04 07:18:42 +0200
commitbf26aa0002f0476d3e37a57285dac60437292c06 (patch)
tree7d21c6e4547580dace761c1895dd037b7305470d /arch
parente79e9467237bd7c78d59d4ea6322b20bb7ce3b39 (diff)
downloadbarebox-bf26aa0002f0476d3e37a57285dac60437292c06.tar.gz
barebox-bf26aa0002f0476d3e37a57285dac60437292c06.tar.xz
MIPS: unify ns16550 debug_ll support code
This commit moves the C debug_ll code from the MIPS <debug_ll_ns16550.h> header file to the MIPS <asm/debug_ll_ns16550.h> header file, so the C code and the asm code can use the same register address macros. Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch')
-rw-r--r--arch/mips/include/asm/debug_ll_ns16550.h15
-rw-r--r--arch/mips/include/debug_ll_ns16550.h37
-rw-r--r--arch/mips/mach-malta/include/mach/debug_ll.h2
-rw-r--r--arch/mips/mach-xburst/include/mach/debug_ll.h2
4 files changed, 17 insertions, 39 deletions
diff --git a/arch/mips/include/asm/debug_ll_ns16550.h b/arch/mips/include/asm/debug_ll_ns16550.h
index 5dd1b39041..f00f348ec5 100644
--- a/arch/mips/include/asm/debug_ll_ns16550.h
+++ b/arch/mips/include/asm/debug_ll_ns16550.h
@@ -48,6 +48,20 @@
#define UART_LSR_THRE 0x20 /* Xmit holding register empty */
+#ifndef __ASSEMBLY__
+/*
+ * C macros
+ */
+
+#include <asm/io.h>
+
+static __inline__ void PUTC_LL(char ch)
+{
+ while (!(__raw_readb((u8 *)DEBUG_LL_UART_ADDR + UART_LSR) & UART_LSR_THRE))
+ ;
+ __raw_writeb(ch, (u8 *)DEBUG_LL_UART_ADDR + UART_THR);
+}
+#else /* __ASSEMBLY__ */
/*
* Macros for use in assembly language code
*/
@@ -96,5 +110,6 @@
debug_ll_ns16550_outc '\n'
#endif /* CONFIG_DEBUG_LL */
.endm
+#endif /* __ASSEMBLY__ */
#endif /* __INCLUDE_MIPS_ASM_DEBUG_LL_NS16550_H__ */
diff --git a/arch/mips/include/debug_ll_ns16550.h b/arch/mips/include/debug_ll_ns16550.h
deleted file mode 100644
index e9c7ecf98e..0000000000
--- a/arch/mips/include/debug_ll_ns16550.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2012 Antony Pavlov <antonynpavlov@gmail.com>
- *
- * This file is part of barebox.
- * See file CREDITS for list of people who contributed to this project.
- *
- * 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.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- */
-
-/** @file
- * This file contains declaration for early output support
- */
-#ifndef __INCLUDE_ARCH_DEBUG_LL_NS16550_H__
-#define __INCLUDE_ARCH_DEBUG_LL_NS16550_H__
-
-#include <asm/io.h>
-
-#define rbr (0 << DEBUG_LL_UART_SHIFT)
-#define lsr (5 << DEBUG_LL_UART_SHIFT)
-
-#define LSR_THRE 0x20 /* Xmit holding register empty */
-
-static __inline__ void PUTC_LL(char ch)
-{
- while (!(__raw_readb((u8 *)DEBUG_LL_UART_ADDR + lsr) & LSR_THRE));
- __raw_writeb(ch, (u8 *)DEBUG_LL_UART_ADDR + rbr);
-}
-
-#endif /* __INCLUDE_ARCH_DEBUG_LL_NS16550_H__ */
diff --git a/arch/mips/mach-malta/include/mach/debug_ll.h b/arch/mips/mach-malta/include/mach/debug_ll.h
index 3a91c9343f..3e8b01b6a9 100644
--- a/arch/mips/mach-malta/include/mach/debug_ll.h
+++ b/arch/mips/mach-malta/include/mach/debug_ll.h
@@ -23,6 +23,6 @@
#include <mach/hardware.h>
-#include <debug_ll_ns16550.h>
+#include <asm/debug_ll_ns16550.h>
#endif /* __INCLUDE_ARCH_DEBUG_LL_H__ */
diff --git a/arch/mips/mach-xburst/include/mach/debug_ll.h b/arch/mips/mach-xburst/include/mach/debug_ll.h
index f260e6581e..6c3c9804b5 100644
--- a/arch/mips/mach-xburst/include/mach/debug_ll.h
+++ b/arch/mips/mach-xburst/include/mach/debug_ll.h
@@ -22,6 +22,6 @@
* This File contains declaration for early output support
*/
#include <board/debug_ll.h>
-#include <debug_ll_ns16550.h>
+#include <asm/debug_ll_ns16550.h>
#endif /* __MACH_XBURST_DEBUG_LL__ */