| * Copyright (C) 2016 Socionext Inc. |
| * Author: Masahiro Yamada <yamada.masahiro@socionext.com> |
| * SPDX-License-Identifier: GPL-2.0+ |
| #include <linux/serial_reg.h> |
| #define DEBUG_UART_BASE 0x54006800 |
| #define UNIPHIER_UART_TX 0 |
| #define UNIPHIER_UART_LSR (5 * 4) |
| /* All functions are inline so that they can be called from .secure section. */ |
| static inline void debug_putc(int c) |
| void __iomem *base = (void __iomem *)DEBUG_UART_BASE; |
| while (!(readl(base + UNIPHIER_UART_LSR) & UART_LSR_THRE)) |
| writel(c, base + UNIPHIER_UART_TX); |
| static inline void debug_puts(const char *s) |
| static inline void debug_puth(unsigned long val) |
| c = ((val >> (i * 4)) & 0xf); |
| c += (c >= 10) ? 'a' - 10 : '0'; |
| static inline void debug_putc(int c) |
| static inline void debug_puts(const char *s) |
| static inline void debug_puth(unsigned long val) |