diff options
author | Wu Zhangjin <wuzhangjin@gmail.com> | 2009-11-21 06:05:25 -0500 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2009-12-16 20:57:29 -0500 |
commit | 70ab711df44ada438973ceba0213121afeb8e8b3 (patch) | |
tree | 0d25197c630868059de35e3840aeffbc9715333d /arch/mips/loongson | |
parent | cb1ed9e117098269de3c0dfff816dff453dd4b59 (diff) |
MIPS: Yeeloong 2F: Cleanup reset logic using the new ec_write function
Signed-off-by: Wu Zhangjin <wuzhangjin@gmail.com>
Cc: linux-mips@linux-mips.org
Patchwork: http://patchwork.linux-mips.org/patch/683/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/loongson')
-rw-r--r-- | arch/mips/loongson/lemote-2f/reset.c | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/arch/mips/loongson/lemote-2f/reset.c b/arch/mips/loongson/lemote-2f/reset.c index 44bb984d58dd..51d1a60d5349 100644 --- a/arch/mips/loongson/lemote-2f/reset.c +++ b/arch/mips/loongson/lemote-2f/reset.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <loongson.h> | 20 | #include <loongson.h> |
21 | 21 | ||
22 | #include <cs5536/cs5536.h> | 22 | #include <cs5536/cs5536.h> |
23 | #include "ec_kb3310b.h" | ||
23 | 24 | ||
24 | static void reset_cpu(void) | 25 | static void reset_cpu(void) |
25 | { | 26 | { |
@@ -75,30 +76,12 @@ static void fl2f_shutdown(void) | |||
75 | 76 | ||
76 | /* reset support for yeeloong2f and mengloong2f notebook */ | 77 | /* reset support for yeeloong2f and mengloong2f notebook */ |
77 | 78 | ||
78 | /* | ||
79 | * The following registers are determined by the EC index configuration. | ||
80 | * 1. fill the PORT_HIGH as EC register high part. | ||
81 | * 2. fill the PORT_LOW as EC register low part. | ||
82 | * 3. fill the PORT_DATA as EC register write data or get the data from it. | ||
83 | */ | ||
84 | |||
85 | #define EC_IO_PORT_HIGH 0x0381 | ||
86 | #define EC_IO_PORT_LOW 0x0382 | ||
87 | #define EC_IO_PORT_DATA 0x0383 | ||
88 | #define REG_RESET_HIGH 0xF4 /* reset the machine auto-clear : rd/wr */ | ||
89 | #define REG_RESET_LOW 0xEC | ||
90 | #define BIT_RESET_ON (1 << 0) | ||
91 | |||
92 | void ml2f_reboot(void) | 79 | void ml2f_reboot(void) |
93 | { | 80 | { |
94 | reset_cpu(); | 81 | reset_cpu(); |
95 | 82 | ||
96 | /* sending an reset signal to EC(embedded controller) */ | 83 | /* sending an reset signal to EC(embedded controller) */ |
97 | outb(REG_RESET_HIGH, EC_IO_PORT_HIGH); | 84 | ec_write(REG_RESET, BIT_RESET_ON); |
98 | outb(REG_RESET_LOW, EC_IO_PORT_LOW); | ||
99 | mmiowb(); | ||
100 | outb(BIT_RESET_ON, EC_IO_PORT_DATA); | ||
101 | mmiowb(); | ||
102 | } | 85 | } |
103 | 86 | ||
104 | #define yl2f89_reboot ml2f_reboot | 87 | #define yl2f89_reboot ml2f_reboot |