Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright (C) 2008-2009 coresystems GmbH |
| 5 | * Copyright (C) 2014 Google Inc. |
| 6 | * |
| 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 |
| 9 | * the Free Software Foundation; version 2 of the License. |
| 10 | * |
| 11 | * This program is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | * GNU General Public License for more details. |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 15 | */ |
| 16 | |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 17 | #include <arch/io.h> |
Patrick Georgi | bd79c5e | 2014-11-28 22:35:36 +0100 | [diff] [blame] | 18 | #include <halt.h> |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 19 | #include <reset.h> |
Julius Werner | 4ee4bd5 | 2014-10-20 13:46:39 -0700 | [diff] [blame] | 20 | #include <soc/reset.h> |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 21 | |
| 22 | /* |
| 23 | * Soft reset (INIT# to cpu) - write 0x1 to I/O 0x92 |
| 24 | * Soft reset (INIT# to cpu)- write 0x4 to I/0 0xcf9 |
| 25 | * Cold reset (S0->S5->S0) - write 0xe to I/0 0xcf9 |
| 26 | * Warm reset (PLTRST# assertion) - write 0x6 to I/O 0xcf9 |
| 27 | * Global reset (S0->S5->S0 with ME reset) - write 0x6 or 0xe to 0xcf9 but |
| 28 | * with ETR[20] set. |
| 29 | */ |
| 30 | |
| 31 | void soft_reset(void) |
| 32 | { |
| 33 | outb(0x04, 0xcf9); |
| 34 | } |
| 35 | |
| 36 | void hard_reset(void) |
| 37 | { |
| 38 | outb(0x06, 0xcf9); |
| 39 | } |
| 40 | |
| 41 | void reset_system(void) |
| 42 | { |
| 43 | hard_reset(); |
Patrick Georgi | bd79c5e | 2014-11-28 22:35:36 +0100 | [diff] [blame] | 44 | halt(); |
Duncan Laurie | c88c54c | 2014-04-30 16:36:13 -0700 | [diff] [blame] | 45 | } |