coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
amd_pci_mmconf.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
4 #include <cpu/amd/msr.h>
5 #include <cpu/x86/msr.h>
6 #include <cpu/x86/mtrr.h>
7 
8 void enable_pci_mmconf(void)
9 {
10  msr_t mmconf;
11 
12  mmconf.hi = 0;
13  mmconf.lo = CONFIG_ECAM_MMCONF_BASE_ADDRESS | MMIO_RANGE_EN
14  | fms(CONFIG_ECAM_MMCONF_BUS_NUMBER) << MMIO_BUS_RANGE_SHIFT;
15  wrmsr(MMIO_CONF_BASE, mmconf);
16 }
void enable_pci_mmconf(void)
Definition: amd_pci_mmconf.c:8
#define MMIO_RANGE_EN
Definition: msr.h:25
#define MMIO_CONF_BASE
Definition: msr.h:24
#define MMIO_BUS_RANGE_SHIFT
Definition: msr.h:26
static __always_inline void wrmsr(unsigned int index, msr_t msr)
Definition: msr.h:157
unsigned int hi
Definition: msr.h:112
unsigned int lo
Definition: msr.h:111
static unsigned int fms(unsigned int x)
Definition: mtrr.h:156