Angel Pons | 182dbde | 2020-04-02 23:49:05 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Kyösti Mälkki | e8b4da2 | 2014-10-21 18:22:32 +0300 | [diff] [blame] | 2 | |
| 3 | // Use simple device model for this file even in ramstage |
| 4 | #define __SIMPLE_DEVICE__ |
| 5 | |
Kyösti Mälkki | f1b58b7 | 2019-03-01 13:43:02 +0200 | [diff] [blame] | 6 | #include <device/pci_ops.h> |
Nico Huber | f418105 | 2018-10-07 13:25:59 +0200 | [diff] [blame] | 7 | #include <cf9_reset.h> |
Kyösti Mälkki | e8b4da2 | 2014-10-21 18:22:32 +0300 | [diff] [blame] | 8 | #include <reset.h> |
| 9 | |
Elyes Haouas | 090fcec | 2022-02-11 22:19:41 +0100 | [diff] [blame] | 10 | #define HT_INIT_CONTROL 0x6c |
| 11 | #define HTIC_ColdR_Detect (1<<4) |
| 12 | #define HTIC_BIOSR_Detect (1<<5) |
| 13 | #define HTIC_INIT_Detect (1<<6) |
Kyösti Mälkki | 8251fa0 | 2018-05-30 06:51:28 +0300 | [diff] [blame] | 14 | |
Nico Huber | f418105 | 2018-10-07 13:25:59 +0200 | [diff] [blame] | 15 | void cf9_reset_prepare(void) |
Kyösti Mälkki | 8251fa0 | 2018-05-30 06:51:28 +0300 | [diff] [blame] | 16 | { |
| 17 | u32 htic; |
Kyösti Mälkki | b915fae | 2019-12-09 08:08:58 +0200 | [diff] [blame] | 18 | 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] | 19 | htic &= ~HTIC_BIOSR_Detect; |
Kyösti Mälkki | b915fae | 2019-12-09 08:08:58 +0200 | [diff] [blame] | 20 | 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] | 21 | } |
| 22 | |
Nico Huber | f418105 | 2018-10-07 13:25:59 +0200 | [diff] [blame] | 23 | void do_board_reset(void) |
Kyösti Mälkki | e8b4da2 | 2014-10-21 18:22:32 +0300 | [diff] [blame] | 24 | { |
Nico Huber | f418105 | 2018-10-07 13:25:59 +0200 | [diff] [blame] | 25 | system_reset(); |
Kyösti Mälkki | e8b4da2 | 2014-10-21 18:22:32 +0300 | [diff] [blame] | 26 | } |