blob: 41f67b7a8fa5969ca5f2f15f0833352d60a80acb [file] [log] [blame]
Masahiro Yamada3365b4e2015-07-21 14:04:22 +09001/*
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>
Masahiro Yamada94bd3692015-08-28 15:37:17 +090013
14#define UART_CLK 36864000
Masahiro Yamada3365b4e2015-07-21 14:04:22 +090015#include <mach/debug-uart.S>
16
17ENTRY(setup_lowlevel_debug)
18 ldr r0, =BCSCR5
19 ldr r1, =0x24440000
20 str r1, [r0]
21
22 ldr r0, =SC_CLKCTRL
23 ldr r1, [r0]
24 orr r1, r1, #SC_CLKCTRL_CEN_PERI
25 str r1, [r0]
26
27 init_debug_uart r0, r1, r2
28
29 set_pinsel 63, 0, r0, r1
30 set_pinsel 64, 1, r0, r1
31
32 mov pc, lr
33ENDPROC(setup_lowlevel_debug)