Masahiro Yamada | b4ad44b | 2015-01-06 14:28:16 +0900 | [diff] [blame] | 1 | /* |
| 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 Yamada | a86ac95 | 2015-02-27 02:26:44 +0900 | [diff] [blame] | 11 | #include <mach/sg-regs.h> |
Masahiro Yamada | b4ad44b | 2015-01-06 14:28:16 +0900 | [diff] [blame] | 12 | |
| 13 | #define UART_CLK 80000000 |
Masahiro Yamada | a86ac95 | 2015-02-27 02:26:44 +0900 | [diff] [blame] | 14 | #include <mach/debug-uart.S> |
Masahiro Yamada | b4ad44b | 2015-01-06 14:28:16 +0900 | [diff] [blame] | 15 | |
| 16 | ENTRY(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 |
| 29 | ENDPROC(setup_lowlevel_debug) |