aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/loongson
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/loongson')
-rw-r--r--arch/mips/loongson/common/cmdline.c9
-rw-r--r--arch/mips/loongson/common/cs5536/cs5536_acc.c2
-rw-r--r--arch/mips/loongson/common/cs5536/cs5536_ehci.c2
-rw-r--r--arch/mips/loongson/common/cs5536/cs5536_ide.c2
-rw-r--r--arch/mips/loongson/common/cs5536/cs5536_isa.c2
-rw-r--r--arch/mips/loongson/common/cs5536/cs5536_mfgpt.c2
-rw-r--r--arch/mips/loongson/common/cs5536/cs5536_ohci.c2
-rw-r--r--arch/mips/loongson/common/cs5536/cs5536_pci.c2
-rw-r--r--arch/mips/loongson/common/early_printk.c2
-rw-r--r--arch/mips/loongson/common/env.c29
-rw-r--r--arch/mips/loongson/common/init.c2
-rw-r--r--arch/mips/loongson/common/machtype.c12
-rw-r--r--arch/mips/loongson/common/mem.c7
-rw-r--r--arch/mips/loongson/common/platform.c2
-rw-r--r--arch/mips/loongson/common/pm.c2
-rw-r--r--arch/mips/loongson/common/reset.c20
-rw-r--r--arch/mips/loongson/common/serial.c2
-rw-r--r--arch/mips/loongson/common/time.c4
-rw-r--r--arch/mips/loongson/common/uart_base.c2
-rw-r--r--arch/mips/loongson/fuloong-2e/reset.c4
-rw-r--r--arch/mips/loongson/lemote-2f/Makefile2
-rw-r--r--arch/mips/loongson/lemote-2f/ec_kb3310b.c4
-rw-r--r--arch/mips/loongson/lemote-2f/irq.c4
-rw-r--r--arch/mips/loongson/lemote-2f/machtype.c45
-rw-r--r--arch/mips/loongson/lemote-2f/pm.c2
-rw-r--r--arch/mips/loongson/lemote-2f/reset.c2
26 files changed, 123 insertions, 47 deletions
diff --git a/arch/mips/loongson/common/cmdline.c b/arch/mips/loongson/common/cmdline.c
index 7ad47f22747..1a06defc4f7 100644
--- a/arch/mips/loongson/common/cmdline.c
+++ b/arch/mips/loongson/common/cmdline.c
@@ -10,7 +10,7 @@
10 * Author: Fuxin Zhang, zhangfx@lemote.com 10 * Author: Fuxin Zhang, zhangfx@lemote.com
11 * 11 *
12 * Copyright (C) 2009 Lemote Inc. 12 * Copyright (C) 2009 Lemote Inc.
13 * Author: Wu Zhangjin, wuzj@lemote.com 13 * Author: Wu Zhangjin, wuzhangjin@gmail.com
14 * 14 *
15 * This program is free software; you can redistribute it and/or modify it 15 * This program is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by the 16 * under the terms of the GNU General Public License as published by the
@@ -21,12 +21,11 @@
21 21
22#include <loongson.h> 22#include <loongson.h>
23 23
24int prom_argc;
25/* pmon passes arguments in 32bit pointers */
26int *_prom_argv;
27
28void __init prom_init_cmdline(void) 24void __init prom_init_cmdline(void)
29{ 25{
26 int prom_argc;
27 /* pmon passes arguments in 32bit pointers */
28 int *_prom_argv;
30 int i; 29 int i;
31 long l; 30 long l;
32 31
diff --git a/arch/mips/loongson/common/cs5536/cs5536_acc.c b/arch/mips/loongson/common/cs5536/cs5536_acc.c
index b49485f187e..b3fd5eab654 100644
--- a/arch/mips/loongson/common/cs5536/cs5536_acc.c
+++ b/arch/mips/loongson/common/cs5536/cs5536_acc.c
@@ -5,7 +5,7 @@
5 * Author : jlliu, liujl@lemote.com 5 * Author : jlliu, liujl@lemote.com
6 * 6 *
7 * Copyright (C) 2009 Lemote, Inc. 7 * Copyright (C) 2009 Lemote, Inc.
8 * Author: Wu Zhangjin, wuzj@lemote.com 8 * Author: Wu Zhangjin, wuzhangjin@gmail.com
9 * 9 *
10 * This program is free software; you can redistribute it and/or modify it 10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by the 11 * under the terms of the GNU General Public License as published by the
diff --git a/arch/mips/loongson/common/cs5536/cs5536_ehci.c b/arch/mips/loongson/common/cs5536/cs5536_ehci.c
index 74f9c59d36a..eaf8b86e331 100644
--- a/arch/mips/loongson/common/cs5536/cs5536_ehci.c
+++ b/arch/mips/loongson/common/cs5536/cs5536_ehci.c
@@ -5,7 +5,7 @@
5 * Author : jlliu, liujl@lemote.com 5 * Author : jlliu, liujl@lemote.com
6 * 6 *
7 * Copyright (C) 2009 Lemote, Inc. 7 * Copyright (C) 2009 Lemote, Inc.
8 * Author: Wu Zhangjin, wuzj@lemote.com 8 * Author: Wu Zhangjin, wuzhangjin@gmail.com
9 * 9 *
10 * This program is free software; you can redistribute it and/or modify it 10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by the 11 * under the terms of the GNU General Public License as published by the
diff --git a/arch/mips/loongson/common/cs5536/cs5536_ide.c b/arch/mips/loongson/common/cs5536/cs5536_ide.c
index 3f61594b388..9a96b5664c7 100644
--- a/arch/mips/loongson/common/cs5536/cs5536_ide.c
+++ b/arch/mips/loongson/common/cs5536/cs5536_ide.c
@@ -5,7 +5,7 @@
5 * Author : jlliu, liujl@lemote.com 5 * Author : jlliu, liujl@lemote.com
6 * 6 *
7 * Copyright (C) 2009 Lemote, Inc. 7 * Copyright (C) 2009 Lemote, Inc.
8 * Author: Wu Zhangjin, wuzj@lemote.com 8 * Author: Wu Zhangjin, wuzhangjin@gmail.com
9 * 9 *
10 * This program is free software; you can redistribute it and/or modify it 10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by the 11 * under the terms of the GNU General Public License as published by the
diff --git a/arch/mips/loongson/common/cs5536/cs5536_isa.c b/arch/mips/loongson/common/cs5536/cs5536_isa.c
index b6f17f538e4..f5c0818831b 100644
--- a/arch/mips/loongson/common/cs5536/cs5536_isa.c
+++ b/arch/mips/loongson/common/cs5536/cs5536_isa.c
@@ -5,7 +5,7 @@
5 * Author : jlliu, liujl@lemote.com 5 * Author : jlliu, liujl@lemote.com
6 * 6 *
7 * Copyright (C) 2009 Lemote, Inc. 7 * Copyright (C) 2009 Lemote, Inc.
8 * Author: Wu Zhangjin, wuzj@lemote.com 8 * Author: Wu Zhangjin, wuzhangjin@gmail.com
9 * 9 *
10 * This program is free software; you can redistribute it and/or modify it 10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by the 11 * under the terms of the GNU General Public License as published by the
diff --git a/arch/mips/loongson/common/cs5536/cs5536_mfgpt.c b/arch/mips/loongson/common/cs5536/cs5536_mfgpt.c
index 6cb44dbaeec..8c807c96519 100644
--- a/arch/mips/loongson/common/cs5536/cs5536_mfgpt.c
+++ b/arch/mips/loongson/common/cs5536/cs5536_mfgpt.c
@@ -5,7 +5,7 @@
5 * Author: Yanhua, yanh@lemote.com 5 * Author: Yanhua, yanh@lemote.com
6 * 6 *
7 * Copyright (C) 2009 Lemote Inc. 7 * Copyright (C) 2009 Lemote Inc.
8 * Author: Wu zhangjin, wuzj@lemote.com 8 * Author: Wu zhangjin, wuzhangjin@gmail.com
9 * 9 *
10 * Reference: AMD Geode(TM) CS5536 Companion Device Data Book 10 * Reference: AMD Geode(TM) CS5536 Companion Device Data Book
11 * 11 *
diff --git a/arch/mips/loongson/common/cs5536/cs5536_ohci.c b/arch/mips/loongson/common/cs5536/cs5536_ohci.c
index 8fdb02b6e90..db5900aadd6 100644
--- a/arch/mips/loongson/common/cs5536/cs5536_ohci.c
+++ b/arch/mips/loongson/common/cs5536/cs5536_ohci.c
@@ -5,7 +5,7 @@
5 * Author : jlliu, liujl@lemote.com 5 * Author : jlliu, liujl@lemote.com
6 * 6 *
7 * Copyright (C) 2009 Lemote, Inc. 7 * Copyright (C) 2009 Lemote, Inc.
8 * Author: Wu Zhangjin, wuzj@lemote.com 8 * Author: Wu Zhangjin, wuzhangjin@gmail.com
9 * 9 *
10 * This program is free software; you can redistribute it and/or modify it 10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by the 11 * under the terms of the GNU General Public License as published by the
diff --git a/arch/mips/loongson/common/cs5536/cs5536_pci.c b/arch/mips/loongson/common/cs5536/cs5536_pci.c
index e23f3d7d2c1..6dfeab11af0 100644
--- a/arch/mips/loongson/common/cs5536/cs5536_pci.c
+++ b/arch/mips/loongson/common/cs5536/cs5536_pci.c
@@ -5,7 +5,7 @@
5 * Author : jlliu, liujl@lemote.com 5 * Author : jlliu, liujl@lemote.com
6 * 6 *
7 * Copyright (C) 2009 Lemote, Inc. 7 * Copyright (C) 2009 Lemote, Inc.
8 * Author: Wu Zhangjin, wuzj@lemote.com 8 * Author: Wu Zhangjin, wuzhangjin@gmail.com
9 * 9 *
10 * This program is free software; you can redistribute it and/or modify it 10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by the 11 * under the terms of the GNU General Public License as published by the
diff --git a/arch/mips/loongson/common/early_printk.c b/arch/mips/loongson/common/early_printk.c
index 23e7a8f8897..a71736f0044 100644
--- a/arch/mips/loongson/common/early_printk.c
+++ b/arch/mips/loongson/common/early_printk.c
@@ -2,7 +2,7 @@
2 * 2 *
3 * Copyright (c) 2009 Philippe Vachon <philippe@cowpig.ca> 3 * Copyright (c) 2009 Philippe Vachon <philippe@cowpig.ca>
4 * Copyright (c) 2009 Lemote Inc. 4 * Copyright (c) 2009 Lemote Inc.
5 * Author: Wu Zhangjin, wuzj@lemote.com 5 * Author: Wu Zhangjin, wuzhangjin@gmail.com
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify it 7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the 8 * under the terms of the GNU General Public License as published by the
diff --git a/arch/mips/loongson/common/env.c b/arch/mips/loongson/common/env.c
index 196d947d929..ae4cff97a56 100644
--- a/arch/mips/loongson/common/env.c
+++ b/arch/mips/loongson/common/env.c
@@ -9,8 +9,8 @@
9 * Copyright (C) 2007 Lemote Inc. & Insititute of Computing Technology 9 * Copyright (C) 2007 Lemote Inc. & Insititute of Computing Technology
10 * Author: Fuxin Zhang, zhangfx@lemote.com 10 * Author: Fuxin Zhang, zhangfx@lemote.com
11 * 11 *
12 * Copyright (C) 2009 Lemote Inc. & Insititute of Computing Technology 12 * Copyright (C) 2009 Lemote Inc.
13 * Author: Wu Zhangjin, wuzj@lemote.com 13 * Author: Wu Zhangjin, wuzhangjin@gmail.com
14 * 14 *
15 * This program is free software; you can redistribute it and/or modify it 15 * This program is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by the 16 * under the terms of the GNU General Public License as published by the
@@ -23,13 +23,10 @@
23 23
24#include <loongson.h> 24#include <loongson.h>
25 25
26unsigned long bus_clock, cpu_clock_freq; 26unsigned long cpu_clock_freq;
27EXPORT_SYMBOL(cpu_clock_freq); 27EXPORT_SYMBOL(cpu_clock_freq);
28unsigned long memsize, highmemsize; 28unsigned long memsize, highmemsize;
29 29
30/* pmon passes arguments in 32bit pointers */
31int *_prom_envp;
32
33#define parse_even_earlier(res, option, p) \ 30#define parse_even_earlier(res, option, p) \
34do { \ 31do { \
35 if (strncmp(option, (char *)p, strlen(option)) == 0) \ 32 if (strncmp(option, (char *)p, strlen(option)) == 0) \
@@ -39,6 +36,10 @@ do { \
39 36
40void __init prom_init_env(void) 37void __init prom_init_env(void)
41{ 38{
39 /* pmon passes arguments in 32bit pointers */
40 int *_prom_envp;
41 unsigned long bus_clock;
42 unsigned int processor_id;
42 long l; 43 long l;
43 44
44 /* firmware arguments are initialized in head.S */ 45 /* firmware arguments are initialized in head.S */
@@ -55,6 +56,22 @@ void __init prom_init_env(void)
55 } 56 }
56 if (memsize == 0) 57 if (memsize == 0)
57 memsize = 256; 58 memsize = 256;
59 if (bus_clock == 0)
60 bus_clock = 66000000;
61 if (cpu_clock_freq == 0) {
62 processor_id = (&current_cpu_data)->processor_id;
63 switch (processor_id & PRID_REV_MASK) {
64 case PRID_REV_LOONGSON2E:
65 cpu_clock_freq = 533080000;
66 break;
67 case PRID_REV_LOONGSON2F:
68 cpu_clock_freq = 797000000;
69 break;
70 default:
71 cpu_clock_freq = 100000000;
72 break;
73 }
74 }
58 75
59 pr_info("busclock=%ld, cpuclock=%ld, memsize=%ld, highmemsize=%ld\n", 76 pr_info("busclock=%ld, cpuclock=%ld, memsize=%ld, highmemsize=%ld\n",
60 bus_clock, cpu_clock_freq, memsize, highmemsize); 77 bus_clock, cpu_clock_freq, memsize, highmemsize);
diff --git a/arch/mips/loongson/common/init.c b/arch/mips/loongson/common/init.c
index a2abd935573..19d34159125 100644
--- a/arch/mips/loongson/common/init.c
+++ b/arch/mips/loongson/common/init.c
@@ -1,6 +1,6 @@
1/* 1/*
2 * Copyright (C) 2009 Lemote Inc. 2 * Copyright (C) 2009 Lemote Inc.
3 * Author: Wu Zhangjin, wuzj@lemote.com 3 * Author: Wu Zhangjin, wuzhangjin@gmail.com
4 * 4 *
5 * This program is free software; you can redistribute it and/or modify it 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 6 * under the terms of the GNU General Public License as published by the
diff --git a/arch/mips/loongson/common/machtype.c b/arch/mips/loongson/common/machtype.c
index 0ed52b3f531..853f184b793 100644
--- a/arch/mips/loongson/common/machtype.c
+++ b/arch/mips/loongson/common/machtype.c
@@ -1,6 +1,6 @@
1/* 1/*
2 * Copyright (C) 2009 Lemote Inc. & Insititute of Computing Technology 2 * Copyright (C) 2009 Lemote Inc.
3 * Author: Wu Zhangjin, wuzj@lemote.com 3 * Author: Wu Zhangjin, wuzhangjin@gmail.com
4 * 4 *
5 * Copyright (c) 2009 Zhang Le <r0bertz@gentoo.org> 5 * Copyright (c) 2009 Zhang Le <r0bertz@gentoo.org>
6 * 6 *
@@ -35,6 +35,10 @@ const char *get_system_type(void)
35 return system_types[mips_machtype]; 35 return system_types[mips_machtype];
36} 36}
37 37
38void __weak __init mach_prom_init_machtype(void)
39{
40}
41
38void __init prom_init_machtype(void) 42void __init prom_init_machtype(void)
39{ 43{
40 char *p, str[MACHTYPE_LEN]; 44 char *p, str[MACHTYPE_LEN];
@@ -43,8 +47,10 @@ void __init prom_init_machtype(void)
43 mips_machtype = LOONGSON_MACHTYPE; 47 mips_machtype = LOONGSON_MACHTYPE;
44 48
45 p = strstr(arcs_cmdline, "machtype="); 49 p = strstr(arcs_cmdline, "machtype=");
46 if (!p) 50 if (!p) {
51 mach_prom_init_machtype();
47 return; 52 return;
53 }
48 p += strlen("machtype="); 54 p += strlen("machtype=");
49 strncpy(str, p, MACHTYPE_LEN); 55 strncpy(str, p, MACHTYPE_LEN);
50 p = strstr(str, " "); 56 p = strstr(str, " ");
diff --git a/arch/mips/loongson/common/mem.c b/arch/mips/loongson/common/mem.c
index ceacd092b44..ec2f7964a0b 100644
--- a/arch/mips/loongson/common/mem.c
+++ b/arch/mips/loongson/common/mem.c
@@ -16,10 +16,11 @@
16 16
17void __init prom_init_memory(void) 17void __init prom_init_memory(void)
18{ 18{
19 add_memory_region(0x0, (memsize << 20), BOOT_MEM_RAM); 19 add_memory_region(0x0, (memsize << 20), BOOT_MEM_RAM);
20
21 add_memory_region(memsize << 20, LOONGSON_PCI_MEM_START - (memsize <<
22 20), BOOT_MEM_RESERVED);
20 23
21 add_memory_region(memsize << 20, LOONGSON_PCI_MEM_START - (memsize <<
22 20), BOOT_MEM_RESERVED);
23#ifdef CONFIG_CPU_SUPPORTS_ADDRWINCFG 24#ifdef CONFIG_CPU_SUPPORTS_ADDRWINCFG
24 { 25 {
25 int bit; 26 int bit;
diff --git a/arch/mips/loongson/common/platform.c b/arch/mips/loongson/common/platform.c
index be81777eb94..ed007a2e0e1 100644
--- a/arch/mips/loongson/common/platform.c
+++ b/arch/mips/loongson/common/platform.c
@@ -1,6 +1,6 @@
1/* 1/*
2 * Copyright (C) 2009 Lemote Inc. 2 * Copyright (C) 2009 Lemote Inc.
3 * Author: Wu Zhangjin, wuzj@lemote.com 3 * Author: Wu Zhangjin, wuzhangjin@gmail.com
4 * 4 *
5 * This program is free software; you can redistribute it and/or modify it 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 6 * under the terms of the GNU General Public License as published by the
diff --git a/arch/mips/loongson/common/pm.c b/arch/mips/loongson/common/pm.c
index b625fec8a4d..6c1fd900171 100644
--- a/arch/mips/loongson/common/pm.c
+++ b/arch/mips/loongson/common/pm.c
@@ -2,7 +2,7 @@
2 * loongson-specific suspend support 2 * loongson-specific suspend support
3 * 3 *
4 * Copyright (C) 2009 Lemote Inc. 4 * Copyright (C) 2009 Lemote Inc.
5 * Author: Wu Zhangjin <wuzj@lemote.com> 5 * Author: Wu Zhangjin <wuzhangjin@gmail.com>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
diff --git a/arch/mips/loongson/common/reset.c b/arch/mips/loongson/common/reset.c
index d57f1719da9..4bd9c18b07a 100644
--- a/arch/mips/loongson/common/reset.c
+++ b/arch/mips/loongson/common/reset.c
@@ -6,8 +6,8 @@
6 * 6 *
7 * Copyright (C) 2007 Lemote, Inc. & Institute of Computing Technology 7 * Copyright (C) 2007 Lemote, Inc. & Institute of Computing Technology
8 * Author: Fuxin Zhang, zhangfx@lemote.com 8 * Author: Fuxin Zhang, zhangfx@lemote.com
9 * Copyright (C) 2009 Lemote, Inc. & Institute of Computing Technology 9 * Copyright (C) 2009 Lemote, Inc.
10 * Author: Zhangjin Wu, wuzj@lemote.com 10 * Author: Zhangjin Wu, wuzhangjin@gmail.com
11 */ 11 */
12#include <linux/init.h> 12#include <linux/init.h>
13#include <linux/pm.h> 13#include <linux/pm.h>
@@ -25,18 +25,26 @@ static void loongson_restart(char *command)
25 ((void (*)(void))ioremap_nocache(LOONGSON_BOOT_BASE, 4)) (); 25 ((void (*)(void))ioremap_nocache(LOONGSON_BOOT_BASE, 4)) ();
26} 26}
27 27
28static void loongson_halt(void) 28static void loongson_poweroff(void)
29{ 29{
30 mach_prepare_shutdown(); 30 mach_prepare_shutdown();
31 while (1) 31 unreachable();
32 ; 32}
33
34static void loongson_halt(void)
35{
36 pr_notice("\n\n** You can safely turn off the power now **\n\n");
37 while (1) {
38 if (cpu_wait)
39 cpu_wait();
40 }
33} 41}
34 42
35static int __init mips_reboot_setup(void) 43static int __init mips_reboot_setup(void)
36{ 44{
37 _machine_restart = loongson_restart; 45 _machine_restart = loongson_restart;
38 _machine_halt = loongson_halt; 46 _machine_halt = loongson_halt;
39 pm_power_off = loongson_halt; 47 pm_power_off = loongson_poweroff;
40 48
41 return 0; 49 return 0;
42} 50}
diff --git a/arch/mips/loongson/common/serial.c b/arch/mips/loongson/common/serial.c
index 23b66a5f88c..7580873143c 100644
--- a/arch/mips/loongson/common/serial.c
+++ b/arch/mips/loongson/common/serial.c
@@ -7,7 +7,7 @@
7 * 7 *
8 * Copyright (C) 2009 Lemote, Inc. 8 * Copyright (C) 2009 Lemote, Inc.
9 * Author: Yan hua (yanhua@lemote.com) 9 * Author: Yan hua (yanhua@lemote.com)
10 * Author: Wu Zhangjin (wuzj@lemote.com) 10 * Author: Wu Zhangjin (wuzhangjin@gmail.com)
11 */ 11 */
12 12
13#include <linux/io.h> 13#include <linux/io.h>
diff --git a/arch/mips/loongson/common/time.c b/arch/mips/loongson/common/time.c
index 35f0b66a94f..9fdd01f6c56 100644
--- a/arch/mips/loongson/common/time.c
+++ b/arch/mips/loongson/common/time.c
@@ -2,8 +2,8 @@
2 * Copyright (C) 2007 Lemote, Inc. & Institute of Computing Technology 2 * Copyright (C) 2007 Lemote, Inc. & Institute of Computing Technology
3 * Author: Fuxin Zhang, zhangfx@lemote.com 3 * Author: Fuxin Zhang, zhangfx@lemote.com
4 * 4 *
5 * Copyright (C) 2009 Lemote Inc. & Insititute of Computing Technology 5 * Copyright (C) 2009 Lemote Inc.
6 * Author: Wu Zhangjin, wuzj@lemote.com 6 * Author: Wu Zhangjin, wuzhangjin@gmail.com
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify it 8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the 9 * under the terms of the GNU General Public License as published by the
diff --git a/arch/mips/loongson/common/uart_base.c b/arch/mips/loongson/common/uart_base.c
index 78ff66ae749..d69ea54bc3d 100644
--- a/arch/mips/loongson/common/uart_base.c
+++ b/arch/mips/loongson/common/uart_base.c
@@ -1,6 +1,6 @@
1/* 1/*
2 * Copyright (C) 2009 Lemote Inc. 2 * Copyright (C) 2009 Lemote Inc.
3 * Author: Wu Zhangjin, wuzj@lemote.com 3 * Author: Wu Zhangjin, wuzhangjin@gmail.com
4 * 4 *
5 * This program is free software; you can redistribute it and/or modify it 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 6 * under the terms of the GNU General Public License as published by the
diff --git a/arch/mips/loongson/fuloong-2e/reset.c b/arch/mips/loongson/fuloong-2e/reset.c
index fc16c677d47..bc39ec62c8c 100644
--- a/arch/mips/loongson/fuloong-2e/reset.c
+++ b/arch/mips/loongson/fuloong-2e/reset.c
@@ -1,8 +1,8 @@
1/* Board-specific reboot/shutdown routines 1/* Board-specific reboot/shutdown routines
2 * Copyright (c) 2009 Philippe Vachon <philippe@cowpig.ca> 2 * Copyright (c) 2009 Philippe Vachon <philippe@cowpig.ca>
3 * 3 *
4 * Copyright (C) 2009 Lemote Inc. & Insititute of Computing Technology 4 * Copyright (C) 2009 Lemote Inc.
5 * Author: Wu Zhangjin, wuzj@lemote.com 5 * Author: Wu Zhangjin, wuzhangjin@gmail.com
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify it 7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the 8 * under the terms of the GNU General Public License as published by the
diff --git a/arch/mips/loongson/lemote-2f/Makefile b/arch/mips/loongson/lemote-2f/Makefile
index 4d84b27dc41..8699a53f047 100644
--- a/arch/mips/loongson/lemote-2f/Makefile
+++ b/arch/mips/loongson/lemote-2f/Makefile
@@ -2,7 +2,7 @@
2# Makefile for lemote loongson2f family machines 2# Makefile for lemote loongson2f family machines
3# 3#
4 4
5obj-y += irq.o reset.o ec_kb3310b.o 5obj-y += machtype.o irq.o reset.o ec_kb3310b.o
6 6
7# 7#
8# Suspend Support 8# Suspend Support
diff --git a/arch/mips/loongson/lemote-2f/ec_kb3310b.c b/arch/mips/loongson/lemote-2f/ec_kb3310b.c
index 4d84111a2cd..64057244eec 100644
--- a/arch/mips/loongson/lemote-2f/ec_kb3310b.c
+++ b/arch/mips/loongson/lemote-2f/ec_kb3310b.c
@@ -75,6 +75,8 @@ int ec_query_seq(unsigned char cmd)
75 udelay(EC_REG_DELAY); 75 udelay(EC_REG_DELAY);
76 } 76 }
77 77
78 spin_unlock_irqrestore(&port_access_lock, flags);
79
78 if (timeout <= 0) { 80 if (timeout <= 0) {
79 printk(KERN_ERR "%s: deadable error : timeout...\n", __func__); 81 printk(KERN_ERR "%s: deadable error : timeout...\n", __func__);
80 ret = -EINVAL; 82 ret = -EINVAL;
@@ -83,8 +85,6 @@ int ec_query_seq(unsigned char cmd)
83 "(%x/%d)ec issued command %d status : 0x%x\n", 85 "(%x/%d)ec issued command %d status : 0x%x\n",
84 timeout, EC_CMD_TIMEOUT - timeout, cmd, status); 86 timeout, EC_CMD_TIMEOUT - timeout, cmd, status);
85 87
86 spin_unlock_irqrestore(&port_access_lock, flags);
87
88 return ret; 88 return ret;
89} 89}
90EXPORT_SYMBOL_GPL(ec_query_seq); 90EXPORT_SYMBOL_GPL(ec_query_seq);
diff --git a/arch/mips/loongson/lemote-2f/irq.c b/arch/mips/loongson/lemote-2f/irq.c
index 77d32f9cf31..882dfcd42c0 100644
--- a/arch/mips/loongson/lemote-2f/irq.c
+++ b/arch/mips/loongson/lemote-2f/irq.c
@@ -38,7 +38,7 @@ int mach_i8259_irq(void)
38 irq = -1; 38 irq = -1;
39 39
40 if ((LOONGSON_INTISR & LOONGSON_INTEN) & LOONGSON_INT_BIT_INT0) { 40 if ((LOONGSON_INTISR & LOONGSON_INTEN) & LOONGSON_INT_BIT_INT0) {
41 spin_lock(&i8259A_lock); 41 raw_spin_lock(&i8259A_lock);
42 isr = inb(PIC_MASTER_CMD) & 42 isr = inb(PIC_MASTER_CMD) &
43 ~inb(PIC_MASTER_IMR) & ~(1 << PIC_CASCADE_IR); 43 ~inb(PIC_MASTER_IMR) & ~(1 << PIC_CASCADE_IR);
44 if (!isr) 44 if (!isr)
@@ -56,7 +56,7 @@ int mach_i8259_irq(void)
56 if (~inb(PIC_MASTER_ISR) & 0x80) 56 if (~inb(PIC_MASTER_ISR) & 0x80)
57 irq = -1; 57 irq = -1;
58 } 58 }
59 spin_unlock(&i8259A_lock); 59 raw_spin_unlock(&i8259A_lock);
60 } 60 }
61 61
62 return irq; 62 return irq;
diff --git a/arch/mips/loongson/lemote-2f/machtype.c b/arch/mips/loongson/lemote-2f/machtype.c
new file mode 100644
index 00000000000..e860a2705c2
--- /dev/null
+++ b/arch/mips/loongson/lemote-2f/machtype.c
@@ -0,0 +1,45 @@
1/*
2 * Copyright (C) 2009 Lemote Inc.
3 * Author: Wu Zhangjin, wuzhangjin@gmail.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.
9 */
10#include <asm/bootinfo.h>
11
12#include <loongson.h>
13
14void __init mach_prom_init_machtype(void)
15{
16 /* We share the same kernel image file among Lemote 2F family
17 * of machines, and provide the machtype= kernel command line
18 * to users to indicate their machine, this command line will
19 * be passed by the latest PMON automatically. and fortunately,
20 * up to now, we can get the machine type from the PMON_VER=
21 * commandline directly except the NAS machine, In the old
22 * machines, this will help the users a lot.
23 *
24 * If no "machtype=" passed, get machine type from "PMON_VER=".
25 * PMON_VER=LM8089 Lemote 8.9'' netbook
26 * LM8101 Lemote 10.1'' netbook
27 * (The above two netbooks have the same kernel support)
28 * LM6XXX Lemote FuLoong(2F) box series
29 * LM9XXX Lemote LynLoong PC series
30 */
31 if (strstr(arcs_cmdline, "PMON_VER=LM")) {
32 if (strstr(arcs_cmdline, "PMON_VER=LM8"))
33 mips_machtype = MACH_LEMOTE_YL2F89;
34 else if (strstr(arcs_cmdline, "PMON_VER=LM6"))
35 mips_machtype = MACH_LEMOTE_FL2F;
36 else if (strstr(arcs_cmdline, "PMON_VER=LM9"))
37 mips_machtype = MACH_LEMOTE_LL2F;
38 else
39 mips_machtype = MACH_LEMOTE_NAS;
40
41 strcat(arcs_cmdline, " machtype=");
42 strcat(arcs_cmdline, get_system_type());
43 strcat(arcs_cmdline, " ");
44 }
45}
diff --git a/arch/mips/loongson/lemote-2f/pm.c b/arch/mips/loongson/lemote-2f/pm.c
index d7af2e61659..cac4d382ea7 100644
--- a/arch/mips/loongson/lemote-2f/pm.c
+++ b/arch/mips/loongson/lemote-2f/pm.c
@@ -2,7 +2,7 @@
2 * Lemote loongson2f family machines' specific suspend support 2 * Lemote loongson2f family machines' specific suspend support
3 * 3 *
4 * Copyright (C) 2009 Lemote Inc. 4 * Copyright (C) 2009 Lemote Inc.
5 * Author: Wu Zhangjin <wuzj@lemote.com> 5 * Author: Wu Zhangjin <wuzhangjin@gmail.com>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
diff --git a/arch/mips/loongson/lemote-2f/reset.c b/arch/mips/loongson/lemote-2f/reset.c
index 51d1a60d534..36020a07e18 100644
--- a/arch/mips/loongson/lemote-2f/reset.c
+++ b/arch/mips/loongson/lemote-2f/reset.c
@@ -3,7 +3,7 @@
3 * Copyright (c) 2009 Philippe Vachon <philippe@cowpig.ca> 3 * Copyright (c) 2009 Philippe Vachon <philippe@cowpig.ca>
4 * 4 *
5 * Copyright (C) 2009 Lemote Inc. 5 * Copyright (C) 2009 Lemote Inc.
6 * Author: Wu Zhangjin, wuzj@lemote.com 6 * Author: Wu Zhangjin, wuzhangjin@gmail.com
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify it 8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the 9 * under the terms of the GNU General Public License as published by the