Angel Pons has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/57046 )
Change subject: [RFC] PCI: Introduce `enable_mmconf()` function ......................................................................
[RFC] PCI: Introduce `enable_mmconf()` function
On platforms with PCI MMCONF support, MMCONF needs to be configured as per the CONFIG_MMCONF_BASE_ADDRESS and CONFIG_MMCONF_BUS_NUMBER Kconfig symbols. This is usually done as early as possible because the default PCI config space functions rely on MMCONF being enabled.
TBD: Figure out a common place to enable MMCONF from.
Change-Id: I3f573f1c0d9a4cc3c25fe907d12778cd5d93241d Signed-off-by: Angel Pons th3fanbus@gmail.com --- M src/device/Makefile.inc A src/device/pci_mmio_cfg.c M src/include/device/pci_mmio_cfg.h M src/lib/bootblock.c 4 files changed, 17 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/46/57046/1
diff --git a/src/device/Makefile.inc b/src/device/Makefile.inc index 70013c9..f18c048 100644 --- a/src/device/Makefile.inc +++ b/src/device/Makefile.inc @@ -35,6 +35,8 @@ ramstage-y += pci_ops.c smm-y += pci_ops.c
+bootblock-$(CONFIG_MMCONF_SUPPORT) += pci_mmio_cfg.c + ramstage-$(CONFIG_PCIX_PLUGIN_SUPPORT) += pcix_device.c ramstage-$(CONFIG_PCIEXP_PLUGIN_SUPPORT) += pciexp_device.c ramstage-$(CONFIG_CARDBUS_PLUGIN_SUPPORT) += cardbus_device.c diff --git a/src/device/pci_mmio_cfg.c b/src/device/pci_mmio_cfg.c new file mode 100644 index 0000000..8394e57 --- /dev/null +++ b/src/device/pci_mmio_cfg.c @@ -0,0 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include <device/pci_ops.h> + +/* TODO: Remove once all platforms have been updated */ +__weak void enable_mmconf(void) +{ +} diff --git a/src/include/device/pci_mmio_cfg.h b/src/include/device/pci_mmio_cfg.h index 8798405..b4faa73 100644 --- a/src/include/device/pci_mmio_cfg.h +++ b/src/include/device/pci_mmio_cfg.h @@ -105,6 +105,9 @@ #error "CONFIG_MMCONF_LENGTH does not correspond with CONFIG_MMCONF_BUS_NUMBER!" #endif
+/* Defined in chipset code */ +void enable_mmconf(void); + /* Avoid name collisions as different stages have different signature * for these functions. The _s_ stands for simple, fundamental IO or * MMIO variant. diff --git a/src/lib/bootblock.c b/src/lib/bootblock.c index 5989964..1e08e70 100644 --- a/src/lib/bootblock.c +++ b/src/lib/bootblock.c @@ -5,6 +5,7 @@ #include <bootblock_common.h> #include <console/console.h> #include <delay.h> +#include <device/pci_ops.h> #include <metadata_hash.h> #include <option.h> #include <post.h> @@ -41,6 +42,9 @@
timestamp_add_now(TS_START_BOOTBLOCK);
+ if (CONFIG(MMCONF_SUPPORT)) + enable_mmconf(); + bootblock_soc_early_init(); bootblock_mainboard_early_init();