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> |
| 13 | #include <mach/debug-uart.S> |
| 14 | |
| 15 | ENTRY(setup_lowlevel_debug) |
| 16 | ldr r0, =BCSCR5 |
| 17 | ldr r1, =0x24440000 |
| 18 | str r1, [r0] |
| 19 | |
| 20 | ldr r0, =SC_CLKCTRL |
| 21 | ldr r1, [r0] |
| 22 | orr r1, r1, #SC_CLKCTRL_CEN_PERI |
| 23 | str r1, [r0] |
| 24 | |
| 25 | init_debug_uart r0, r1, r2 |
| 26 | |
| 27 | set_pinsel 63, 0, r0, r1 |
| 28 | set_pinsel 64, 1, r0, r1 |
| 29 | |
| 30 | mov pc, lr |
| 31 | ENDPROC(setup_lowlevel_debug) |