diff options
author | Andrey Petrov <anpetrov@fb.com> | 2019-09-10 20:24:06 -0700 |
---|---|---|
committer | Martin Roth <martinroth@google.com> | 2019-09-21 20:38:10 +0000 |
commit | 3dd6867ea9374e442e8af000bada73c17631abb8 (patch) | |
tree | 2e5a5ac7ba08608a18f695ae0650a0516233ac03 /src/soc/intel/fsp_broadwell_de/include | |
parent | b18946a557b43f77904287187534d496c4b165a2 (diff) |
soc/fsp_broadwell_de: Move function to get CPUBUSNO(1) into common file
Change-Id: I189eb8ffce2f0735ad9ba603b1d96786aa00fafb
Signed-off-by: Andrey Petrov <anpetrov@fb.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/35320
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: David Hendricks <david.hendricks@gmail.com>
Diffstat (limited to 'src/soc/intel/fsp_broadwell_de/include')
-rw-r--r-- | src/soc/intel/fsp_broadwell_de/include/soc/pci_devs.h | 1 | ||||
-rw-r--r-- | src/soc/intel/fsp_broadwell_de/include/soc/vtd.h | 13 |
2 files changed, 14 insertions, 0 deletions
diff --git a/src/soc/intel/fsp_broadwell_de/include/soc/pci_devs.h b/src/soc/intel/fsp_broadwell_de/include/soc/pci_devs.h index 973f55983b..58591dcda0 100644 --- a/src/soc/intel/fsp_broadwell_de/include/soc/pci_devs.h +++ b/src/soc/intel/fsp_broadwell_de/include/soc/pci_devs.h @@ -32,6 +32,7 @@ #define VTD_FUNC 0 #define VTD_DEVID 0x6f28 #define VTD_DEV_FUNC PCI_DEVFN(VTD_DEV, VTD_FUNC) +#define VTD_PCI_DEV PCI_DEV(BUS0, VTD_DEV, VTD_FUNC) #define LPC_DEV 31 #define LPC_FUNC 0 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 43da267dce..814cba02cd 100644 --- a/src/soc/intel/fsp_broadwell_de/include/soc/vtd.h +++ b/src/soc/intel/fsp_broadwell_de/include/soc/vtd.h @@ -16,6 +16,9 @@ #ifndef _BROADWELL_VTD_H_ #define _BROADWELL_VTD_H_ +#include <device/pci_ops.h> +#include <soc/pci_devs.h> + #define VTD_CPUBUSNO 0x108 #define VTD_CPUBUSNO_BUS0_MASK 0xff #define VTD_CPUBUSNO_BUS0_SHIFT 0 @@ -26,4 +29,14 @@ #define VTD_DFX1 0x804 #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); +} + #endif |