Angel Pons | 182dbde | 2020-04-02 23:49:05 +0200 | [diff] [blame^] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
2 | /* This file is part of the coreboot project. */ | ||||
zbao | 246e84b | 2012-07-13 18:47:03 +0800 | [diff] [blame] | 3 | |
Kyösti Mälkki | ef84401 | 2013-06-25 23:17:43 +0300 | [diff] [blame] | 4 | // Use simple device model for this file even in ramstage |
5 | #define __SIMPLE_DEVICE__ | ||||
6 | |||||
Kyösti Mälkki | f1b58b7 | 2019-03-01 13:43:02 +0200 | [diff] [blame] | 7 | #include <device/pci_ops.h> |
Nico Huber | f418105 | 2018-10-07 13:25:59 +0200 | [diff] [blame] | 8 | #include <cf9_reset.h> |
Stefan Reinauer | 24d1d4b | 2013-03-21 11:51:41 -0700 | [diff] [blame] | 9 | #include <reset.h> |
zbao | 246e84b | 2012-07-13 18:47:03 +0800 | [diff] [blame] | 10 | |
Kyösti Mälkki | 8251fa0 | 2018-05-30 06:51:28 +0300 | [diff] [blame] | 11 | #define HT_INIT_CONTROL 0x6c |
12 | #define HTIC_ColdR_Detect (1<<4) | ||||
13 | #define HTIC_BIOSR_Detect (1<<5) | ||||
14 | #define HTIC_INIT_Detect (1<<6) | ||||
15 | |||||
Nico Huber | f418105 | 2018-10-07 13:25:59 +0200 | [diff] [blame] | 16 | void cf9_reset_prepare(void) |
Kyösti Mälkki | 8251fa0 | 2018-05-30 06:51:28 +0300 | [diff] [blame] | 17 | { |
18 | u32 htic; | ||||
Kyösti Mälkki | b915fae | 2019-12-09 08:08:58 +0200 | [diff] [blame] | 19 | htic = pci_s_read_config32(PCI_DEV(0, 0x18, 0), HT_INIT_CONTROL); |
Kyösti Mälkki | 8251fa0 | 2018-05-30 06:51:28 +0300 | [diff] [blame] | 20 | htic &= ~HTIC_BIOSR_Detect; |
Kyösti Mälkki | b915fae | 2019-12-09 08:08:58 +0200 | [diff] [blame] | 21 | pci_s_write_config32(PCI_DEV(0, 0x18, 0), HT_INIT_CONTROL, htic); |
Kyösti Mälkki | 8251fa0 | 2018-05-30 06:51:28 +0300 | [diff] [blame] | 22 | } |
zbao | 246e84b | 2012-07-13 18:47:03 +0800 | [diff] [blame] | 23 | |
Nico Huber | f418105 | 2018-10-07 13:25:59 +0200 | [diff] [blame] | 24 | void do_board_reset(void) |
zbao | 246e84b | 2012-07-13 18:47:03 +0800 | [diff] [blame] | 25 | { |
Nico Huber | f418105 | 2018-10-07 13:25:59 +0200 | [diff] [blame] | 26 | system_reset(); |
zbao | 246e84b | 2012-07-13 18:47:03 +0800 | [diff] [blame] | 27 | } |