zbao | 246e84b | 2012-07-13 18:47:03 +0800 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright (C) 2010 Advanced Micro Devices, Inc. |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by |
| 8 | * the Free Software Foundation; version 2 of the License. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
zbao | 246e84b | 2012-07-13 18:47:03 +0800 | [diff] [blame] | 14 | */ |
| 15 | |
Kyösti Mälkki | ef84401 | 2013-06-25 23:17:43 +0300 | [diff] [blame] | 16 | // Use simple device model for this file even in ramstage |
| 17 | #define __SIMPLE_DEVICE__ |
| 18 | |
zbao | 246e84b | 2012-07-13 18:47:03 +0800 | [diff] [blame] | 19 | #include <arch/io.h> |
Nico Huber | f418105 | 2018-10-07 13:25:59 +0200 | [diff] [blame^] | 20 | #include <cf9_reset.h> |
Stefan Reinauer | 24d1d4b | 2013-03-21 11:51:41 -0700 | [diff] [blame] | 21 | #include <reset.h> |
zbao | 246e84b | 2012-07-13 18:47:03 +0800 | [diff] [blame] | 22 | |
Kyösti Mälkki | 8251fa0 | 2018-05-30 06:51:28 +0300 | [diff] [blame] | 23 | #define HT_INIT_CONTROL 0x6c |
| 24 | #define HTIC_ColdR_Detect (1<<4) |
| 25 | #define HTIC_BIOSR_Detect (1<<5) |
| 26 | #define HTIC_INIT_Detect (1<<6) |
| 27 | |
Nico Huber | f418105 | 2018-10-07 13:25:59 +0200 | [diff] [blame^] | 28 | void cf9_reset_prepare(void) |
Kyösti Mälkki | 8251fa0 | 2018-05-30 06:51:28 +0300 | [diff] [blame] | 29 | { |
| 30 | u32 htic; |
| 31 | htic = pci_io_read_config32(PCI_DEV(0, 0x18, 0), HT_INIT_CONTROL); |
| 32 | htic &= ~HTIC_BIOSR_Detect; |
| 33 | pci_io_write_config32(PCI_DEV(0, 0x18, 0), HT_INIT_CONTROL, htic); |
| 34 | } |
zbao | 246e84b | 2012-07-13 18:47:03 +0800 | [diff] [blame] | 35 | |
Nico Huber | f418105 | 2018-10-07 13:25:59 +0200 | [diff] [blame^] | 36 | void do_board_reset(void) |
zbao | 246e84b | 2012-07-13 18:47:03 +0800 | [diff] [blame] | 37 | { |
Nico Huber | f418105 | 2018-10-07 13:25:59 +0200 | [diff] [blame^] | 38 | system_reset(); |
zbao | 246e84b | 2012-07-13 18:47:03 +0800 | [diff] [blame] | 39 | } |