aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips')
-rw-r--r--arch/mips/loongson/lemote-2f/reset.c21
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
24static void reset_cpu(void) 25static 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
92void ml2f_reboot(void) 79void 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