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
16
void
cf9_reset_prepare
(
void
)
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);
26
htic =
pci_read_config32
(dev,
HT_INIT_CONTROL
);
27
htic &= ~
HTIC_BIOSR_Detect
;
28
pci_write_config32
(dev,
HT_INIT_CONTROL
, htic);
29
}
30
}
31
32
void
do_board_reset
(
void
)
33
{
34
system_reset
();
35
}
system_reset
void system_reset(void)
Definition:
cf9_reset.c:37
cf9_reset.h
pci_ops.h
pci_write_config32
static __always_inline void pci_write_config32(const struct device *dev, u16 reg, u32 val)
Definition:
pci_ops.h:76
pci_read_config32
static __always_inline u32 pci_read_config32(const struct device *dev, u16 reg)
Definition:
pci_ops.h:58
do_board_reset
void do_board_reset(void)
Definition:
reset.c:8
PCI_DEV
#define PCI_DEV(SEGBUS, DEV, FN)
Definition:
pci_type.h:14
pci_devfn_t
u32 pci_devfn_t
Definition:
pci_type.h:8
cf9_reset_prepare
void cf9_reset_prepare(void)
Definition:
reset.c:20
NODE_PCI
#define NODE_PCI(x, fn)
Definition:
reset.c:14
HT_INIT_CONTROL
#define HT_INIT_CONTROL
Definition:
reset.c:10
DEV_CDB
#define DEV_CDB
Definition:
reset.c:13
HTIC_BIOSR_Detect
#define HTIC_BIOSR_Detect
Definition:
reset.c:11
u32
uint32_t u32
Definition:
stdint.h:51
src
southbridge
amd
cimx
sb800
reset.c
Generated by
1.9.1