blob: ff77eb87d38194bf114286eedc13d5d1b4da6380 [file] [log] [blame]
zbao246e84b2012-07-13 18:47:03 +08001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2010 Advanced Micro Devices, Inc.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
zbao246e84b2012-07-13 18:47:03 +080014 */
15
Kyösti Mälkkief844012013-06-25 23:17:43 +030016// Use simple device model for this file even in ramstage
17#define __SIMPLE_DEVICE__
18
Kyösti Mälkkif1b58b72019-03-01 13:43:02 +020019#include <device/pci_ops.h>
Nico Huberf4181052018-10-07 13:25:59 +020020#include <cf9_reset.h>
Stefan Reinauer24d1d4b2013-03-21 11:51:41 -070021#include <reset.h>
zbao246e84b2012-07-13 18:47:03 +080022
Kyösti Mälkki8251fa02018-05-30 06:51:28 +030023#define HT_INIT_CONTROL 0x6c
24#define HTIC_ColdR_Detect (1<<4)
25#define HTIC_BIOSR_Detect (1<<5)
26#define HTIC_INIT_Detect (1<<6)
27
Nico Huberf4181052018-10-07 13:25:59 +020028void cf9_reset_prepare(void)
Kyösti Mälkki8251fa02018-05-30 06:51:28 +030029{
30 u32 htic;
Kyösti Mälkkib915fae2019-12-09 08:08:58 +020031 htic = pci_s_read_config32(PCI_DEV(0, 0x18, 0), HT_INIT_CONTROL);
Kyösti Mälkki8251fa02018-05-30 06:51:28 +030032 htic &= ~HTIC_BIOSR_Detect;
Kyösti Mälkkib915fae2019-12-09 08:08:58 +020033 pci_s_write_config32(PCI_DEV(0, 0x18, 0), HT_INIT_CONTROL, htic);
Kyösti Mälkki8251fa02018-05-30 06:51:28 +030034}
zbao246e84b2012-07-13 18:47:03 +080035
Nico Huberf4181052018-10-07 13:25:59 +020036void do_board_reset(void)
zbao246e84b2012-07-13 18:47:03 +080037{
Nico Huberf4181052018-10-07 13:25:59 +020038 system_reset();
zbao246e84b2012-07-13 18:47:03 +080039}