Angel Pons | ae59387 | 2020-04-04 18:50:57 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Michał Żygowski | 200d213 | 2019-12-06 12:07:52 +0100 | [diff] [blame] | 2 | |
| 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 | |
| 8 | void enable_pci_mmconf(void) |
| 9 | { |
| 10 | msr_t mmconf; |
| 11 | |
| 12 | mmconf.hi = 0; |
Shelley Chen | 4e9bb33 | 2021-10-20 15:43:45 -0700 | [diff] [blame] | 13 | mmconf.lo = CONFIG_ECAM_MMCONF_BASE_ADDRESS | MMIO_RANGE_EN |
| 14 | | fms(CONFIG_ECAM_MMCONF_BUS_NUMBER) << MMIO_BUS_RANGE_SHIFT; |
Michał Żygowski | 200d213 | 2019-12-06 12:07:52 +0100 | [diff] [blame] | 15 | wrmsr(MMIO_CONF_BASE, mmconf); |
| 16 | } |