2 * Copyright (C) 2009 Lemote Inc.
3 * Author: Wu Zhangjin, wuzhangjin@gmail.com
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.
11 #include <linux/module.h>
12 #include <asm/bootinfo.h>
17 unsigned long _loongson_uart_base
;
18 EXPORT_SYMBOL(_loongson_uart_base
);
20 unsigned long loongson_uart_base
;
21 EXPORT_SYMBOL(loongson_uart_base
);
23 void prom_init_loongson_uart_base(void)
25 switch (mips_machtype
) {
26 case MACH_LEMOTE_FL2E
:
27 loongson_uart_base
= LOONGSON_PCIIO_BASE
+ 0x3f8;
29 case MACH_LEMOTE_FL2F
:
30 case MACH_LEMOTE_LL2F
:
31 loongson_uart_base
= LOONGSON_PCIIO_BASE
+ 0x2f8;
33 case MACH_LEMOTE_ML2F7
:
34 case MACH_LEMOTE_YL2F89
:
35 case MACH_DEXXON_GDIUM2F10
:
38 /* The CPU provided serial port (LPC) */
39 loongson_uart_base
= LOONGSON_LIO1_BASE
+ 0x3f8;
41 case MACH_LEMOTE_A1004
:
42 case MACH_LEMOTE_A1101
:
43 case MACH_LEMOTE_A1201
:
44 case MACH_LEMOTE_A1205
:
45 /* The CPU provided serial port (CPU) */
46 loongson_uart_base
= LOONGSON_REG_BASE
+ 0x1e0;
51 (unsigned long)ioremap_nocache(loongson_uart_base
, 8);