| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Joshua Henderson <joshua.henderson@microchip.com> |
|---|
| 3 | 4 | * Copyright (C) 2015 Microchip Technology Inc. All rights reserved. |
|---|
| 4 | | - * |
|---|
| 5 | | - * This program is free software; you can distribute it and/or modify it |
|---|
| 6 | | - * under the terms of the GNU General Public License (Version 2) as |
|---|
| 7 | | - * published by the Free Software Foundation. |
|---|
| 8 | | - * |
|---|
| 9 | | - * This program is distributed in the hope it will be useful, but WITHOUT |
|---|
| 10 | | - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|---|
| 11 | | - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|---|
| 12 | | - * for more details. |
|---|
| 13 | 5 | */ |
|---|
| 14 | 6 | #include <asm/mach-pic32/pic32.h> |
|---|
| 15 | 7 | #include <asm/fw/fw.h> |
|---|
| .. | .. |
|---|
| 35 | 27 | #define U_BRG(x) (UART_BASE(x) + 0x40) |
|---|
| 36 | 28 | |
|---|
| 37 | 29 | static void __iomem *uart_base; |
|---|
| 38 | | -static char console_port = -1; |
|---|
| 30 | +static int console_port = -1; |
|---|
| 39 | 31 | |
|---|
| 40 | 32 | static int __init configure_uart_pins(int port) |
|---|
| 41 | 33 | { |
|---|
| .. | .. |
|---|
| 55 | 47 | return 0; |
|---|
| 56 | 48 | } |
|---|
| 57 | 49 | |
|---|
| 58 | | -static void __init configure_uart(char port, int baud) |
|---|
| 50 | +static void __init configure_uart(int port, int baud) |
|---|
| 59 | 51 | { |
|---|
| 60 | 52 | u32 pbclk; |
|---|
| 61 | 53 | |
|---|
| .. | .. |
|---|
| 68 | 60 | uart_base + PIC32_SET(U_STA(port))); |
|---|
| 69 | 61 | } |
|---|
| 70 | 62 | |
|---|
| 71 | | -static void __init setup_early_console(char port, int baud) |
|---|
| 63 | +static void __init setup_early_console(int port, int baud) |
|---|
| 72 | 64 | { |
|---|
| 73 | 65 | if (configure_uart_pins(port)) |
|---|
| 74 | 66 | return; |
|---|
| .. | .. |
|---|
| 138 | 130 | return baud; |
|---|
| 139 | 131 | } |
|---|
| 140 | 132 | |
|---|
| 141 | | -void __init fw_init_early_console(char port) |
|---|
| 133 | +void __init fw_init_early_console(void) |
|---|
| 142 | 134 | { |
|---|
| 143 | 135 | char *arch_cmdline = pic32_getcmdline(); |
|---|
| 144 | | - int baud = -1; |
|---|
| 136 | + int baud, port; |
|---|
| 145 | 137 | |
|---|
| 146 | | - uart_base = ioremap_nocache(PIC32_BASE_UART, 0xc00); |
|---|
| 138 | + uart_base = ioremap(PIC32_BASE_UART, 0xc00); |
|---|
| 147 | 139 | |
|---|
| 148 | 140 | baud = get_baud_from_cmdline(arch_cmdline); |
|---|
| 149 | | - if (port == -1) |
|---|
| 150 | | - port = get_port_from_cmdline(arch_cmdline); |
|---|
| 141 | + port = get_port_from_cmdline(arch_cmdline); |
|---|
| 151 | 142 | |
|---|
| 152 | 143 | if (port == -1) |
|---|
| 153 | 144 | port = EARLY_CONSOLE_PORT; |
|---|