diff options
author | Antony Pavlov <antonynpavlov@gmail.com> | 2014-12-27 02:56:24 +0300 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2015-01-05 12:33:53 +0100 |
commit | be7bbf30dc6e51e09422ba71154e6f64add2f9bb (patch) | |
tree | 0122517d284b8c1353898effe8a8618fea9c4541 /arch/arm | |
parent | c79d68bd169113600ed0b3edc3b78700995a73f5 (diff) | |
download | barebox-be7bbf30dc6e51e09422ba71154e6f64add2f9bb.tar.gz barebox-be7bbf30dc6e51e09422ba71154e6f64add2f9bb.tar.xz |
ARM: introduce debug_ll_pl011.h
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/include/asm/debug_ll_pl011.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/arch/arm/include/asm/debug_ll_pl011.h b/arch/arm/include/asm/debug_ll_pl011.h new file mode 100644 index 0000000000..db015a373b --- /dev/null +++ b/arch/arm/include/asm/debug_ll_pl011.h @@ -0,0 +1,25 @@ +#ifndef __INCLUDE_ARM_ASM_DEBUG_LL_PL011_H__ +#define __INCLUDE_ARM_ASM_DEBUG_LL_PL011_H__ + +#ifndef DEBUG_LL_UART_ADDR +#error DEBUG_LL_UART_ADDR is undefined! +#endif + +#include <io.h> +#include <linux/amba/serial.h> + +static inline void PUTC_LL(char c) +{ + /* Wait until there is space in the FIFO */ + while (readl(DEBUG_LL_UART_ADDR + UART01x_FR) & UART01x_FR_TXFF) + ; + + /* Send the character */ + writel(c, DEBUG_LL_UART_ADDR + UART01x_DR); + + /* Wait to make sure it hits the line, in case we die too soon. */ + while (readl(DEBUG_LL_UART_ADDR + UART01x_FR) & UART01x_FR_TXFF) + ; +} + +#endif /* __INCLUDE_ARM_ASM_DEBUG_LL_PL011_H__ */ |