]> git.ipfire.org Git - people/ms/u-boot.git/blob - arch/arm/mach-uniphier/ph1-sld3/lowlevel_debug.S
ARM: uniphier: fix glitch signal problem for low-level debug
[people/ms/u-boot.git] / arch / arm / mach-uniphier / ph1-sld3 / lowlevel_debug.S
1 /*
2 * On-chip UART initializaion for low-level debugging
3 *
4 * Copyright (C) 2014-2015 Masahiro Yamada <yamada.masahiro@socionext.com>
5 *
6 * SPDX-License-Identifier: GPL-2.0+
7 */
8
9 #include <linux/linkage.h>
10 #include <mach/bcu-regs.h>
11 #include <mach/sc-regs.h>
12 #include <mach/sg-regs.h>
13
14 #define UART_CLK 36864000
15 #include <mach/debug-uart.S>
16
17 ENTRY(setup_lowlevel_debug)
18 sg_set_pinsel 63, 0, 4, 4, r0, r1
19 sg_set_pinsel 64, 1, 4, 4, r0, r1
20
21 ldr r0, =BCSCR5
22 ldr r1, =0x24440000
23 str r1, [r0]
24
25 ldr r0, =SC_CLKCTRL
26 ldr r1, [r0]
27 orr r1, r1, #SC_CLKCTRL_CEN_PERI
28 str r1, [r0]
29
30 init_debug_uart r0, r1, r2
31
32 mov pc, lr
33 ENDPROC(setup_lowlevel_debug)