blob: 9b10d47378f621bb6f8af2a9953d00f239386a20 [file] [log] [blame]
Duncan Lauriec88c54c2014-04-30 16:36:13 -07001/*
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 Lauriec88c54c2014-04-30 16:36:13 -070015 */
16
Duncan Lauriec88c54c2014-04-30 16:36:13 -070017#include <arch/io.h>
Patrick Georgibd79c5e2014-11-28 22:35:36 +010018#include <halt.h>
Duncan Lauriec88c54c2014-04-30 16:36:13 -070019#include <reset.h>
Julius Werner4ee4bd52014-10-20 13:46:39 -070020#include <soc/reset.h>
Duncan Lauriec88c54c2014-04-30 16:36:13 -070021
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
31void soft_reset(void)
32{
33 outb(0x04, 0xcf9);
34}
35
36void hard_reset(void)
37{
38 outb(0x06, 0xcf9);
39}
40
41void reset_system(void)
42{
43 hard_reset();
Patrick Georgibd79c5e2014-11-28 22:35:36 +010044 halt();
Duncan Lauriec88c54c2014-04-30 16:36:13 -070045}