hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/arch/mips/kernel/cps-vec-ns16550.S
....@@ -1,11 +1,7 @@
1
+/* SPDX-License-Identifier: GPL-2.0-or-later */
12 /*
23 * Copyright (C) 2015 Imagination Technologies
34 * Author: Paul Burton <paul.burton@mips.com>
4
- *
5
- * This program is free software; you can redistribute it and/or modify it
6
- * under the terms of the GNU General Public License as published by the
7
- * Free Software Foundation; either version 2 of the License, or (at your
8
- * option) any later version.
95 */
106
117 #include <asm/addrspace.h>
....@@ -18,16 +14,30 @@
1814 #define UART_TX_OFS (UART_TX << CONFIG_MIPS_CPS_NS16550_SHIFT)
1915 #define UART_LSR_OFS (UART_LSR << CONFIG_MIPS_CPS_NS16550_SHIFT)
2016
17
+#if CONFIG_MIPS_CPS_NS16550_WIDTH == 1
18
+# define UART_L lb
19
+# define UART_S sb
20
+#elif CONFIG_MIPS_CPS_NS16550_WIDTH == 2
21
+# define UART_L lh
22
+# define UART_S sh
23
+#elif CONFIG_MIPS_CPS_NS16550_WIDTH == 4
24
+# define UART_L lw
25
+# define UART_S sw
26
+#else
27
+# define UART_L lb
28
+# define UART_S sb
29
+#endif
30
+
2131 /**
2232 * _mips_cps_putc() - write a character to the UART
2333 * @a0: ASCII character to write
2434 * @t9: UART base address
2535 */
2636 LEAF(_mips_cps_putc)
27
-1: lw t0, UART_LSR_OFS(t9)
37
+1: UART_L t0, UART_LSR_OFS(t9)
2838 andi t0, t0, UART_LSR_TEMT
2939 beqz t0, 1b
30
- sb a0, UART_TX_OFS(t9)
40
+ UART_S a0, UART_TX_OFS(t9)
3141 jr ra
3242 END(_mips_cps_putc)
3343