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>
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();
27 
28  if (CONFIG(BOOTBLOCK_CONSOLE))
30 }
31 
32 static void bootblock_southbridge_init(void)
33 {
35 
36  /* Enable RCBA */
37  pci_write_config32(PCI_DEV(0, 0x1f, 0), RCBA,
38  CONFIG_FIXED_RCBA_MMIO_BASE | 1);
39 }
40 
42 {
45 }
void bootblock_soc_init(void)
Definition: bootblock.c:27
@ CONFIG
Definition: dsi_common.h:201
static void enable_spi_prefetching_and_caching(void)
Definition: early_spi.h:8
static __always_inline void pci_write_config32(const struct device *dev, u16 reg, u32 val)
Definition: pci_ops.h:76
static void bootblock_southbridge_init(void)
Definition: bootblock.c:32
static void bootblock_northbridge_init(void)
Definition: bootblock.c:10
void mainboard_machine_check(void)
Definition: memmap.c:31
uint32_t make_pciexbar(void)
Definition: memmap.c:25
static __always_inline void pci_io_write_config32(pci_devfn_t dev, uint16_t reg, uint32_t value)
Definition: pci_io_cfg.h:65
#define PCI_DEV(SEGBUS, DEV, FN)
Definition: pci_type.h:14
#define D0F0_PCIEXBAR_HI
Definition: q35.h:12
#define D0F0_PCIEXBAR_LO
Definition: q35.h:11
#define RCBA
Definition: lpc.h:17
@ HOST_BRIDGE
Definition: reg_access.h:23
unsigned int uint32_t
Definition: stdint.h:14