Angel Pons | 182dbde | 2020-04-02 23:49:05 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
zbao | 246e84b | 2012-07-13 18:47:03 +0800 | [diff] [blame] | 2 | |
Kyösti Mälkki | ef84401 | 2013-06-25 23:17:43 +0300 | [diff] [blame] | 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> |
Stefan Reinauer | 24d1d4b | 2013-03-21 11:51:41 -0700 | [diff] [blame] | 8 | #include <reset.h> |
zbao | 246e84b | 2012-07-13 18:47:03 +0800 | [diff] [blame] | 9 | |
Elyes Haouas | 090fcec | 2022-02-11 22:19:41 +0100 | [diff] [blame] | 10 | #define HT_INIT_CONTROL 0x6c |
Elyes Haouas | 7d89264 | 2022-07-16 09:49:53 +0200 | [diff] [blame^] | 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 | } |
zbao | 246e84b | 2012-07-13 18:47:03 +0800 | [diff] [blame] | 22 | |
Nico Huber | f418105 | 2018-10-07 13:25:59 +0200 | [diff] [blame] | 23 | void do_board_reset(void) |
zbao | 246e84b | 2012-07-13 18:47:03 +0800 | [diff] [blame] | 24 | { |
Nico Huber | f418105 | 2018-10-07 13:25:59 +0200 | [diff] [blame] | 25 | system_reset(); |
zbao | 246e84b | 2012-07-13 18:47:03 +0800 | [diff] [blame] | 26 | } |