diff -uNra 2.6.37.orig/arch/mips/loongson/common/serial.c linux-loongson-community/arch/mips/loongson/common//serial.c --- 2.6.37.orig/arch/mips/loongson/common/serial.c 2011-01-11 04:38:08.000000000 +0800 +++ linux-loongson-community/arch/mips/loongson/common/serial.c 2011-01-20 02:59:33.273574599 +0800 @@ -19,58 +19,40 @@ #include #include -#define PORT(int) \ +#define PORT(int, base_baud, io_type,port) \ { \ .irq = int, \ - .uartclk = 1843200, \ - .iotype = UPIO_PORT, \ + .uartclk = base_baud, \ + .iotype = io_type, \ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, \ .regshift = 0, \ + .iobase = port, \ } -#define PORT_M(int) \ -{ \ - .irq = MIPS_CPU_IRQ_BASE + (int), \ - .uartclk = 3686400, \ - .iotype = UPIO_MEM, \ - .membase = (void __iomem *)NULL, \ - .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, \ - .regshift = 0, \ -} - -static struct plat_serial8250_port uart8250_data[][2] = { - [MACH_LOONGSON_UNKNOWN] {}, - [MACH_LEMOTE_FL2E] {PORT(4), {} }, - [MACH_LEMOTE_FL2F] {PORT(3), {} }, - [MACH_LEMOTE_ML2F7] {PORT_M(3), {} }, - [MACH_LEMOTE_YL2F89] {PORT_M(3), {} }, - [MACH_DEXXON_GDIUM2F10] {PORT_M(3), {} }, - [MACH_LEMOTE_NAS] {PORT_M(3), {} }, - [MACH_LEMOTE_LL2F] {PORT(3), {} }, - [MACH_LOONGSON_END] {}, +static struct plat_serial8250_port uart8250_data[] = { + PORT((MIPS_CPU_IRQ_BASE + 3), 3686400, UPIO_MEM,0x3f8), /* ttyS0: cpu_uart0 yeeloong, gdim,unas,... */ + PORT(4, 1843200, UPIO_PORT,0x3f8), /* ttyS1: sb_uart1 2E */ + PORT(3, 1843200, UPIO_PORT,0x2f8), /* ttyS2: sb_uart2 fuloong2f */ + {}, }; static struct platform_device uart8250_device = { .name = "serial8250", .id = PLAT8250_DEV_PLATFORM, + .dev = { + .platform_data = uart8250_data, + }, }; static int __init serial_init(void) { - unsigned char iotype; - - iotype = uart8250_data[mips_machtype][0].iotype; - - if (UPIO_MEM == iotype) - uart8250_data[mips_machtype][0].membase = - (void __iomem *)_loongson_uart_base; - else if (UPIO_PORT == iotype) - uart8250_data[mips_machtype][0].iobase = - loongson_uart_base - LOONGSON_PCIIO_BASE; - - uart8250_device.dev.platform_data = uart8250_data[mips_machtype]; + uart8250_data[0].membase = (void __iomem *)ioremap_nocache( LOONGSON_LIO1_BASE + uart8250_data[0].iobase, 8); - return platform_device_register(&uart8250_device); + platform_device_register(&uart8250_device); + return 0; } device_initcall(serial_init); +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("liu shiwei "); +MODULE_DESCRIPTION("loongson serial"); diff -uNra 2.6.37.orig/arch/mips/loongson/common/uart_base.c linux-loongson-community/arch/mips/loongson/common/uart_base.c --- 2.6.37.orig/arch/mips/loongson/common/uart_base.c 2011-01-11 04:38:08.000000000 +0800 +++ linux-loongson-community/arch/mips/loongson/common/uart_base.c 2011-01-20 00:08:05.061572355 +0800 @@ -14,8 +14,6 @@ #include /* ioremapped */ -unsigned long _loongson_uart_base; -EXPORT_SYMBOL(_loongson_uart_base); /* raw */ unsigned long loongson_uart_base; EXPORT_SYMBOL(loongson_uart_base); @@ -40,6 +38,4 @@ break; } - _loongson_uart_base = - (unsigned long)ioremap_nocache(loongson_uart_base, 8); } diff -uNra 2.6.37.orig/arch/mips/loongson/common//uart_base.o linux-loongson-community/arch/mips/loongson/common//uart_base.o \ 文件尾没有 newline 字符 diff -uNra 2.6.37.orig/arch/mips/loongson/common//.uart_base.o.cmd linux-loongson-community/arch/mips/loongson/common//.uart_base.o.cmd --- 2.6.37.orig/arch/mips/configs/lemote2f_defconfig 2011-01-11 04:38:08.000000000 +0800 +++ linux-loongson-community/arch/mips/configs/lemote2f_defconfig 2011-01-20 17:40:24.744429001 +0800 @@ -426,7 +426,7 @@ CONFIG_SATA_MV=m CONFIG_SATA_NV=m CONFIG_SATA_PROMISE=m -CONFIG_SATA_SIL=m +CONFIG_SATA_SIL=y CONFIG_SATA_SIS=m CONFIG_SATA_SVW=m CONFIG_SATA_ULI=m