1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright (C) 2016 Masahiro Yamada <yamada.masahiro@socionext.com>
7 #include <linux/kernel.h>
10 #include "../sc-regs.h"
11 #include "../sg-regs.h"
12 #include "debug-uart.h"
14 #define UNIPHIER_PRO4_UART_CLK 73728000
16 unsigned int uniphier_pro4_debug_uart_init(void)
21 sg_set_pinsel(128, 0, 4, 8); /* TXD0 -> TXD0 */
23 writel(1, sg_base + SG_LOADPINCTRL);
25 tmp = readl(sc_base + SC_CLKCTRL);
26 tmp |= SC_CLKCTRL_CEN_PERI;
27 writel(tmp, sc_base + SC_CLKCTRL);
29 return DIV_ROUND_CLOSEST(UNIPHIER_PRO4_UART_CLK, 16 * CONFIG_BAUDRATE);