aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/loongson/common/uart_base.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/loongson/common/uart_base.c')
-rw-r--r--arch/mips/loongson/common/uart_base.c41
1 files changed, 25 insertions, 16 deletions
diff --git a/arch/mips/loongson/common/uart_base.c b/arch/mips/loongson/common/uart_base.c
index 1d636f4f7505..78ff66ae749e 100644
--- a/arch/mips/loongson/common/uart_base.c
+++ b/arch/mips/loongson/common/uart_base.c
@@ -13,24 +13,33 @@
13 13
14#include <loongson.h> 14#include <loongson.h>
15 15
16unsigned long __maybe_unused _loongson_uart_base; 16/* ioremapped */
17unsigned long _loongson_uart_base;
17EXPORT_SYMBOL(_loongson_uart_base); 18EXPORT_SYMBOL(_loongson_uart_base);
19/* raw */
20unsigned long loongson_uart_base;
21EXPORT_SYMBOL(loongson_uart_base);
18 22
19unsigned long __maybe_unused uart8250_base[] = { 23void prom_init_loongson_uart_base(void)
20 [MACH_LOONGSON_UNKNOWN] 0,
21 [MACH_LEMOTE_FL2E] (LOONGSON_PCIIO_BASE + 0x3f8),
22 [MACH_LEMOTE_FL2F] (LOONGSON_PCIIO_BASE + 0x2f8),
23 [MACH_LEMOTE_ML2F7] (LOONGSON_LIO1_BASE + 0x3f8),
24 [MACH_LEMOTE_YL2F89] (LOONGSON_LIO1_BASE + 0x3f8),
25 [MACH_DEXXON_GDIUM2F10] (LOONGSON_LIO1_BASE + 0x3f8),
26 [MACH_LEMOTE_NAS] (LOONGSON_LIO1_BASE + 0x3f8),
27 [MACH_LEMOTE_LL2F] (LOONGSON_PCIIO_BASE + 0x2f8),
28 [MACH_LOONGSON_END] 0,
29};
30EXPORT_SYMBOL(uart8250_base);
31
32void __maybe_unused prom_init_uart_base(void)
33{ 24{
25 switch (mips_machtype) {
26 case MACH_LEMOTE_FL2E:
27 loongson_uart_base = LOONGSON_PCIIO_BASE + 0x3f8;
28 break;
29 case MACH_LEMOTE_FL2F:
30 case MACH_LEMOTE_LL2F:
31 loongson_uart_base = LOONGSON_PCIIO_BASE + 0x2f8;
32 break;
33 case MACH_LEMOTE_ML2F7:
34 case MACH_LEMOTE_YL2F89:
35 case MACH_DEXXON_GDIUM2F10:
36 case MACH_LEMOTE_NAS:
37 default:
38 /* The CPU provided serial port */
39 loongson_uart_base = LOONGSON_LIO1_BASE + 0x3f8;
40 break;
41 }
42
34 _loongson_uart_base = 43 _loongson_uart_base =
35 (unsigned long)ioremap_nocache(uart8250_base[mips_machtype], 8); 44 (unsigned long)ioremap_nocache(loongson_uart_base, 8);
36} 45}