blob: fbb62c88fc20b0ec472b1336936b9572904ba183 [file] [log] [blame]
Angel Pons182dbde2020-04-02 23:49:05 +02001/* SPDX-License-Identifier: GPL-2.0-only */
zbao246e84b2012-07-13 18:47:03 +08002
Kyösti Mälkkief844012013-06-25 23:17:43 +03003// 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>
Stefan Reinauer24d1d4b2013-03-21 11:51:41 -07008#include <reset.h>
zbao246e84b2012-07-13 18:47:03 +08009
Elyes Haouas090fcec2022-02-11 22:19:41 +010010#define HT_INIT_CONTROL 0x6c
Elyes Haouas7d892642022-07-16 09:49:53 +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}
zbao246e84b2012-07-13 18:47:03 +080022
Nico Huberf4181052018-10-07 13:25:59 +020023void do_board_reset(void)
zbao246e84b2012-07-13 18:47:03 +080024{
Nico Huberf4181052018-10-07 13:25:59 +020025 system_reset();
zbao246e84b2012-07-13 18:47:03 +080026}