2 * Copyright (C) 2016 Masahiro Yamada <yamada.masahiro@socionext.com>
4 * SPDX-License-Identifier: GPL-2.0+
8 #include <linux/kernel.h>
11 #include "../sc-regs.h"
12 #include "../sg-regs.h"
13 #include "debug-uart.h"
15 #define UNIPHIER_PRO5_UART_CLK 73728000
17 unsigned int uniphier_pro5_debug_uart_init(void)
22 sg_set_pinsel(47, 0, 4, 8); /* TXD0 -> TXD0 */
23 sg_set_pinsel(49, 0, 4, 8); /* TXD1 -> TXD1 */
24 sg_set_pinsel(51, 0, 4, 8); /* TXD2 -> TXD2 */
25 sg_set_pinsel(53, 0, 4, 8); /* TXD3 -> TXD3 */
27 writel(1, SG_LOADPINCTRL);
29 tmp = readl(SC_CLKCTRL);
30 tmp |= SC_CLKCTRL_CEN_PERI;
31 writel(tmp, SC_CLKCTRL);
33 return DIV_ROUND_CLOSEST(UNIPHIER_PRO5_UART_CLK, 16 * CONFIG_BAUDRATE);