blob: fbb62c88fc20b0ec472b1336936b9572904ba183 [file] [log] [blame]
Angel Pons182dbde2020-04-02 23:49:05 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Kyösti Mälkkie8b4da22014-10-21 18:22:32 +03002
3// Use simple device model for this file even in ramstage
4#define __SIMPLE_DEVICE__
5
Kyösti Mälkkif1b58b72019-03-01 13:43:02 +02006#include <device/pci_ops.h>
Nico Huberf4181052018-10-07 13:25:59 +02007#include <cf9_reset.h>
Kyösti Mälkkie8b4da22014-10-21 18:22:32 +03008#include <reset.h>
9
Elyes Haouas090fcec2022-02-11 22:19:41 +010010#define HT_INIT_CONTROL 0x6c
Elyes Haouas4c152112022-07-16 09:51:03 +020011#define HTIC_ColdR_Detect (1 << 4)
12#define HTIC_BIOSR_Detect (1 << 5)
13#define HTIC_INIT_Detect (1 << 6)
Kyösti Mälkki8251fa02018-05-30 06:51:28 +030014
Nico Huberf4181052018-10-07 13:25:59 +020015void cf9_reset_prepare(void)
Kyösti Mälkki8251fa02018-05-30 06:51:28 +030016{
17 u32 htic;
Kyösti Mälkkib915fae2019-12-09 08:08:58 +020018 htic = pci_s_read_config32(PCI_DEV(0, 0x18, 0), HT_INIT_CONTROL);
Kyösti Mälkki8251fa02018-05-30 06:51:28 +030019 htic &= ~HTIC_BIOSR_Detect;
Kyösti Mälkkib915fae2019-12-09 08:08:58 +020020 pci_s_write_config32(PCI_DEV(0, 0x18, 0), HT_INIT_CONTROL, htic);
Kyösti Mälkki8251fa02018-05-30 06:51:28 +030021}
22
Nico Huberf4181052018-10-07 13:25:59 +020023void do_board_reset(void)
Kyösti Mälkkie8b4da22014-10-21 18:22:32 +030024{
Nico Huberf4181052018-10-07 13:25:59 +020025 system_reset();
Kyösti Mälkkie8b4da22014-10-21 18:22:32 +030026}