coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
bootblock.c
Go to the documentation of this file.
1
/* SPDX-License-Identifier: GPL-2.0-only */
2
3
#include <
device/pci_ops.h
>
4
#include <
bootblock_common.h
>
5
#include <
southbridge/intel/common/early_spi.h
>
6
#include <
southbridge/intel/i82801ix/i82801ix.h
>
7
8
#include "
q35.h
"
9
10
static
void
bootblock_northbridge_init
(
void
)
11
{
12
/*
13
* The "io" variant of the config access is explicitly used to
14
* setup the PCIEXBAR because CONFIG(ECAM_MMCONF_SUPPORT) is set to
15
* to true. That way all subsequent non-explicit config accesses use
16
* MCFG. This code also assumes that bootblock_northbridge_init() is
17
* the first thing called in the non-asm boot block code. The final
18
* assumption is that no assembly code is using the
19
* CONFIG(ECAM_MMCONF_SUPPORT) option to do PCI config accesses.
20
*
21
* The PCIEXBAR is assumed to live in the memory mapped IO space under
22
* 4GiB.
23
*/
24
const
uint32_t
pciexbar =
make_pciexbar
();
25
pci_io_write_config32
(
HOST_BRIDGE
,
D0F0_PCIEXBAR_HI
, 0);
26
pci_io_write_config32
(
HOST_BRIDGE
,
D0F0_PCIEXBAR_LO
, pciexbar);
27
28
if
(
CONFIG
(BOOTBLOCK_CONSOLE))
29
mainboard_machine_check
();
30
}
31
32
static
void
bootblock_southbridge_init
(
void
)
33
{
34
enable_spi_prefetching_and_caching
();
35
36
/* Enable RCBA */
37
pci_write_config32
(
PCI_DEV
(0, 0x1f, 0),
RCBA
,
38
CONFIG_FIXED_RCBA_MMIO_BASE | 1);
39
}
40
41
void
bootblock_soc_init
(
void
)
42
{
43
bootblock_northbridge_init
();
44
bootblock_southbridge_init
();
45
}
bootblock_common.h
bootblock_soc_init
void bootblock_soc_init(void)
Definition:
bootblock.c:27
CONFIG
@ CONFIG
Definition:
dsi_common.h:201
early_spi.h
enable_spi_prefetching_and_caching
static void enable_spi_prefetching_and_caching(void)
Definition:
early_spi.h:8
i82801ix.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
bootblock_southbridge_init
static void bootblock_southbridge_init(void)
Definition:
bootblock.c:32
bootblock_northbridge_init
static void bootblock_northbridge_init(void)
Definition:
bootblock.c:10
mainboard_machine_check
void mainboard_machine_check(void)
Definition:
memmap.c:31
make_pciexbar
uint32_t make_pciexbar(void)
Definition:
memmap.c:25
pci_io_write_config32
static __always_inline void pci_io_write_config32(pci_devfn_t dev, uint16_t reg, uint32_t value)
Definition:
pci_io_cfg.h:65
PCI_DEV
#define PCI_DEV(SEGBUS, DEV, FN)
Definition:
pci_type.h:14
q35.h
D0F0_PCIEXBAR_HI
#define D0F0_PCIEXBAR_HI
Definition:
q35.h:12
D0F0_PCIEXBAR_LO
#define D0F0_PCIEXBAR_LO
Definition:
q35.h:11
RCBA
#define RCBA
Definition:
lpc.h:17
HOST_BRIDGE
@ HOST_BRIDGE
Definition:
reg_access.h:23
uint32_t
unsigned int uint32_t
Definition:
stdint.h:14
src
mainboard
emulation
qemu-q35
bootblock.c
Generated by
1.9.1