forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-08 01573e231f18eb2d99162747186f59511f56b64d
kernel/arch/mips/pic32/pic32mzda/early_console.c
....@@ -1,15 +1,7 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Joshua Henderson <joshua.henderson@microchip.com>
34 * 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.
135 */
146 #include <asm/mach-pic32/pic32.h>
157 #include <asm/fw/fw.h>
....@@ -35,7 +27,7 @@
3527 #define U_BRG(x) (UART_BASE(x) + 0x40)
3628
3729 static void __iomem *uart_base;
38
-static char console_port = -1;
30
+static int console_port = -1;
3931
4032 static int __init configure_uart_pins(int port)
4133 {
....@@ -55,7 +47,7 @@
5547 return 0;
5648 }
5749
58
-static void __init configure_uart(char port, int baud)
50
+static void __init configure_uart(int port, int baud)
5951 {
6052 u32 pbclk;
6153
....@@ -68,7 +60,7 @@
6860 uart_base + PIC32_SET(U_STA(port)));
6961 }
7062
71
-static void __init setup_early_console(char port, int baud)
63
+static void __init setup_early_console(int port, int baud)
7264 {
7365 if (configure_uart_pins(port))
7466 return;
....@@ -138,16 +130,15 @@
138130 return baud;
139131 }
140132
141
-void __init fw_init_early_console(char port)
133
+void __init fw_init_early_console(void)
142134 {
143135 char *arch_cmdline = pic32_getcmdline();
144
- int baud = -1;
136
+ int baud, port;
145137
146
- uart_base = ioremap_nocache(PIC32_BASE_UART, 0xc00);
138
+ uart_base = ioremap(PIC32_BASE_UART, 0xc00);
147139
148140 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);
151142
152143 if (port == -1)
153144 port = EARLY_CONSOLE_PORT;