blob: fb4db39ac5330089333b269271bafad64b4d481e [file] [log] [blame]
Angel Ponsae593872020-04-04 18:50:57 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Michał Żygowski200d2132019-12-06 12:07:52 +01002
3#include <amdblocks/amd_pci_mmconf.h>
4#include <cpu/amd/msr.h>
5#include <cpu/x86/msr.h>
6#include <cpu/x86/mtrr.h>
7
8void enable_pci_mmconf(void)
9{
10 msr_t mmconf;
11
12 mmconf.hi = 0;
Shelley Chen4e9bb332021-10-20 15:43:45 -070013 mmconf.lo = CONFIG_ECAM_MMCONF_BASE_ADDRESS | MMIO_RANGE_EN
14 | fms(CONFIG_ECAM_MMCONF_BUS_NUMBER) << MMIO_BUS_RANGE_SHIFT;
Michał Żygowski200d2132019-12-06 12:07:52 +010015 wrmsr(MMIO_CONF_BASE, mmconf);
16}