Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/coreboot/+/35585 )
Change subject: soc/intel/fsp_broadwell_de: move get_busno1() into vtd.c ......................................................................
soc/intel/fsp_broadwell_de: move get_busno1() into vtd.c
TEST=just build it
Change-Id: I34aee507b8c322c816f92cfcae177c069c749ed7 Signed-off-by: Andrey Petrov anpetrov@fb.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/35585 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Werner Zeh werner.zeh@siemens.com --- M src/soc/intel/fsp_broadwell_de/Makefile.inc M src/soc/intel/fsp_broadwell_de/include/soc/vtd.h M src/soc/intel/fsp_broadwell_de/vtd.c 3 files changed, 15 insertions(+), 8 deletions(-)
Approvals: build bot (Jenkins): Verified Werner Zeh: Looks good to me, approved
diff --git a/src/soc/intel/fsp_broadwell_de/Makefile.inc b/src/soc/intel/fsp_broadwell_de/Makefile.inc index 7b8a788..f0944da 100644 --- a/src/soc/intel/fsp_broadwell_de/Makefile.inc +++ b/src/soc/intel/fsp_broadwell_de/Makefile.inc @@ -16,6 +16,7 @@ romstage-y += tsc_freq.c romstage-y += smbus-imc.c romstage-y += ubox.c +romstage-y += vtd.c
postcar-y += tsc_freq.c
diff --git a/src/soc/intel/fsp_broadwell_de/include/soc/vtd.h b/src/soc/intel/fsp_broadwell_de/include/soc/vtd.h index 814cba0..f1087d1 100644 --- a/src/soc/intel/fsp_broadwell_de/include/soc/vtd.h +++ b/src/soc/intel/fsp_broadwell_de/include/soc/vtd.h @@ -30,13 +30,6 @@ #define VTD_DFX1_RANGE_3F8_DISABLE (1u << 29) #define VTD_DFX1_RANGE_2F8_DISABLE (1u << 30)
-static inline uint8_t get_busno1(void) -{ - uint32_t reg32; - - /* Figure out what bus number is assigned for CPUBUSNO(1) */ - reg32 = pci_mmio_read_config32(VTD_PCI_DEV, VTD_CPUBUSNO); - return ((reg32 >> VTD_CPUBUSNO_BUS1_SHIFT) & VTD_CPUBUSNO_BUS1_MASK); -} +uint8_t get_busno1(void);
#endif diff --git a/src/soc/intel/fsp_broadwell_de/vtd.c b/src/soc/intel/fsp_broadwell_de/vtd.c index 318927a..9e03e9b 100644 --- a/src/soc/intel/fsp_broadwell_de/vtd.c +++ b/src/soc/intel/fsp_broadwell_de/vtd.c @@ -18,8 +18,10 @@ #include <device/pci_ids.h> #include <soc/pci_devs.h> #include <soc/acpi.h> +#include <soc/vtd.h> #include <soc/broadwell_de.h>
+#if ENV_RAMSTAGE
static void vtd_read_resources(struct device *dev) { @@ -44,3 +46,14 @@ .vendor = PCI_VENDOR_ID_INTEL, .device = VTD_DEVID, }; + +#endif + +uint8_t get_busno1(void) +{ + uint32_t reg32; + + /* Figure out what bus number is assigned for CPUBUSNO(1) */ + reg32 = pci_mmio_read_config32(VTD_PCI_DEV, VTD_CPUBUSNO); + return ((reg32 >> VTD_CPUBUSNO_BUS1_SHIFT) & VTD_CPUBUSNO_BUS1_MASK); +}