Masahiro Yamada | fa71441 | 2015-07-21 14:04:22 +0900 | [diff] [blame] | 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> |
Masahiro Yamada | 579a9f6 | 2015-08-28 15:37:17 +0900 | [diff] [blame^] | 13 | |
| 14 | #define UART_CLK 36864000 |
Masahiro Yamada | fa71441 | 2015-07-21 14:04:22 +0900 | [diff] [blame] | 15 | #include <mach/debug-uart.S> |
| 16 | |
| 17 | ENTRY(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 |
| 33 | ENDPROC(setup_lowlevel_debug) |