coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
reset.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 // Use simple device model for this file even in ramstage
4 #define __SIMPLE_DEVICE__
5 
6 #include <device/pci_ops.h>
7 #include <cf9_reset.h>
8 #include <reset.h>
9 
10 #define HT_INIT_CONTROL 0x6c
11 #define HTIC_BIOSR_Detect (1<<5)
12 
13 #define DEV_CDB 0x18
14 #define NODE_PCI(x, fn) (((DEV_CDB+x)<32)?(PCI_DEV(0,(DEV_CDB+x),fn)):(PCI_DEV((0-1),(DEV_CDB+x-32),fn)))
15 
17 {
18  u32 nodes;
19  u32 htic;
20  pci_devfn_t dev;
21  int i;
22 
23  nodes = ((pci_read_config32(PCI_DEV(0, DEV_CDB, 0), 0x60) >> 4) & 7) + 1;
24  for (i = 0; i < nodes; i++) {
25  dev = NODE_PCI(i, 0);
27  htic &= ~HTIC_BIOSR_Detect;
29  }
30 }
31 
32 void do_board_reset(void)
33 {
34  system_reset();
35 }
void system_reset(void)
Definition: cf9_reset.c:37
static __always_inline void pci_write_config32(const struct device *dev, u16 reg, u32 val)
Definition: pci_ops.h:76
static __always_inline u32 pci_read_config32(const struct device *dev, u16 reg)
Definition: pci_ops.h:58
void do_board_reset(void)
Definition: reset.c:8
#define PCI_DEV(SEGBUS, DEV, FN)
Definition: pci_type.h:14
u32 pci_devfn_t
Definition: pci_type.h:8
void cf9_reset_prepare(void)
Definition: reset.c:20
#define NODE_PCI(x, fn)
Definition: reset.c:14
#define HT_INIT_CONTROL
Definition: reset.c:10
#define DEV_CDB
Definition: reset.c:13
#define HTIC_BIOSR_Detect
Definition: reset.c:11
uint32_t u32
Definition: stdint.h:51