blob: 73f0f63eba5b0528e867d4bf31ea73ca173d9b8c [file] [log] [blame]
Masahiro Yamadab4ad44b2015-01-06 14:28:16 +09001/*
2 * On-chip UART initializaion for low-level debugging
3 *
4 * Copyright (C) 2014 Panasonic Corporation
5 * Author: Masahiro Yamada <yamada.m@jp.panasonic.com>
6 *
7 * SPDX-License-Identifier: GPL-2.0+
8 */
9
10#include <linux/linkage.h>
Masahiro Yamadaa86ac952015-02-27 02:26:44 +090011#include <mach/sg-regs.h>
Masahiro Yamadab4ad44b2015-01-06 14:28:16 +090012
13#define UART_CLK 80000000
Masahiro Yamadaa86ac952015-02-27 02:26:44 +090014#include <mach/debug-uart.S>
Masahiro Yamadab4ad44b2015-01-06 14:28:16 +090015
16ENTRY(setup_lowlevel_debug)
17 init_debug_uart r0, r1, r2
18
19 /* UART Port 0 */
20 set_pinsel 70, 3, r0, r1
21 set_pinsel 71, 3, r0, r1
22
23 ldr r0, =SG_IECTRL
24 ldr r1, [r0]
25 orr r1, r1, #1
26 str r1, [r0]
27
28 mov pc, lr
29ENDPROC(setup_lowlevel_debug)