From 9007ffd3d1b7c079c791e90ec52243eac385979f Mon Sep 17 00:00:00 2001 From: Werner Zeh Date: Wed, 6 Jul 2016 08:47:56 +0200 Subject: PCI: Use PCI_DEVFN macro instead of DEV_FUNC There are several different macros available to convert a PCI device and function to a single 8 bit value. One is PCI_DEVFN and is defined in device/pci_def.h. The other is DEV_FUNC and is defined in several intel fsp based chipset implementations. In fsp_broadwell_de DEV_FUNC is even used without being defined at all. This patch unifies the situation so that only PCI_DEVFN is used. Change-Id: Ia1c6d7f3683badc66d15053846936d88aa836632 Signed-off-by: Werner Zeh Reviewed-on: https://review.coreboot.org/15546 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel Reviewed-by: Stefan Reinauer --- src/southbridge/intel/fsp_rangeley/pci_devs.h | 39 ++++++++++++++------------- 1 file changed, 20 insertions(+), 19 deletions(-) (limited to 'src/southbridge') diff --git a/src/southbridge/intel/fsp_rangeley/pci_devs.h b/src/southbridge/intel/fsp_rangeley/pci_devs.h index 3eacf0d2da..29f9085a7b 100644 --- a/src/southbridge/intel/fsp_rangeley/pci_devs.h +++ b/src/southbridge/intel/fsp_rangeley/pci_devs.h @@ -17,58 +17,59 @@ #ifndef _RANGELEY_PCI_DEVS_H_ #define _RANGELEY_PCI_DEVS_H_ +#include + #define BUS0 0 /* All these devices live on bus 0 with the associated device and function */ -#define DEV_FUNC(x,y) ((x<<3) | y) /* Host Bridge */ #define SOC_DEV 0x0 #define SOC_FUNC 0 # define SOC_DEVID 0x1f08 -# define SOC_DEV_FUNC DEV_FUNC(SOC_DEV,SOC_FUNC) +# define SOC_DEV_FUNC PCI_DEVFN(SOC_DEV,SOC_FUNC) /* PCIE Port 1 */ #define PCIE_PORT1_DEV 0x1 #define PCIE_PORT1_FUNC 0 # define PCIE_PORT1_DEVID 0x1f10 -# define PCIE_PORT1_DEV_FUNC DEV_FUNC(PCIE_PORT1_DEV,PCIE_PORT1_FUNC) +# define PCIE_PORT1_DEV_FUNC PCI_DEVFN(PCIE_PORT1_DEV,PCIE_PORT1_FUNC) /* PCIE Port 2 */ #define PCIE_PORT2_DEV 0x2 #define PCIE_PORT2_FUNC 0 # define PCIE_PORT2_DEVID 0x1f11 -# define PCIE_PORT2_DEV_FUNC DEV_FUNC(PCIE_PORT2_DEV,PCIE_PORT2_FUNC) +# define PCIE_PORT2_DEV_FUNC PCI_DEVFN(PCIE_PORT2_DEV,PCIE_PORT2_FUNC) /* PCIE Port 3 */ #define PCIE_PORT3_DEV 0x3 #define PCIE_PORT3_FUNC 0 # define PCIE_PORT3_DEVID 0x1f12 -# define PCIE_PORT3_DEV_FUNC DEV_FUNC(PCIE_PORT3_DEV,PCIE_PORT3_FUNC) +# define PCIE_PORT3_DEV_FUNC PCI_DEVFN(PCIE_PORT3_DEV,PCIE_PORT3_FUNC) /* PCIE Port 4 */ #define PCIE_PORT4_DEV 0x4 #define PCIE_PORT4_FUNC 0 # define PCIE_PORT4_DEVID 0x1f13 -# define PCIE_PORT4_DEV_FUNC DEV_FUNC(PCIE_PORT4_DEV,PCIE_PORT4_FUNC) +# define PCIE_PORT4_DEV_FUNC PCI_DEVFN(PCIE_PORT4_DEV,PCIE_PORT4_FUNC) /* Host Bridge, Fabric, and RAS Registers */ #define HOST_BRIDGE_DEV 0xe #define HOST_BRIDGE_FUNC 0 # define HOST_BRIDGE_DEVID 0x1f14 -# define HOST_BRIDGE_DEV_FUNC DEV_FUNC(HOST_BRIDGE_DEV,HOST_BRIDGE_FUNC) +# define HOST_BRIDGE_DEV_FUNC PCI_DEVFN(HOST_BRIDGE_DEV,HOST_BRIDGE_FUNC) /* Root Complex Event Collector (RCEC) */ #define RCEC_DEV 0xf #define RCEC_FUNC 0 # define RCEC_DEVID 0x1f16 -# define RCEC_DEV_FUNC DEV_FUNC(RCEC_DEV,RCEC_FUNC) +# define RCEC_DEV_FUNC PCI_DEVFN(RCEC_DEV,RCEC_FUNC) /* SMBus 2.0 1 */ #define SMBUS1_DEV 0x13 #define SMBUS1_FUNC 0 # define SMBUS1_DEVID 0x1f15 -# define SMBUS1_DEV_FUNC DEV_FUNC(SMBUS1_DEV,SMBUS1_FUNC) +# define SMBUS1_DEV_FUNC PCI_DEVFN(SMBUS1_DEV,SMBUS1_FUNC) /* Gigabit Ethernet (GbE) */ #define GBE_DEV 0x14 @@ -76,37 +77,37 @@ #define GBE1_DEV GBE_DEV #define GBE1_FUNC 0 # define GBE1_DEVID GBE_DEVID -# define GBE1_DEV_FUNC DEV_FUNC(GBE1_DEV,GBE1_FUNC) +# define GBE1_DEV_FUNC PCI_DEVFN(GBE1_DEV,GBE1_FUNC) #define GBE2_DEV GBE_DEV #define GBE2_FUNC 1 # define GBE2_DEVID GBE_DEVID -# define GBE2_DEV_FUNC DEV_FUNC(GBE2_DEV,GBE2_FUNC) +# define GBE2_DEV_FUNC PCI_DEVFN(GBE2_DEV,GBE2_FUNC) #define GBE3_DEV GBE_DEV #define GBE3_FUNC 2 # define GBE3_DEVID GBE_DEVID -# define GBE3_DEV_FUNC DEV_FUNC(GBE3_DEV,GBE3_FUNC) +# define GBE3_DEV_FUNC PCI_DEVFN(GBE3_DEV,GBE3_FUNC) #define GBE4_DEV GBE_DEV #define GBE4_FUNC 3 # define GBE4_DEVID GBE_DEVID -# define GBE4_DEV_FUNC DEV_FUNC(GBE4_DEV,GBE4_FUNC) +# define GBE4_DEV_FUNC PCI_DEVFN(GBE4_DEV,GBE4_FUNC) /* USB 2.0 */ #define USB2_DEV 0x16 #define USB2_FUNC 0 # define USB2_DEVID 0x1f2c -# define USB2_DEV_FUNC DEV_FUNC(USB2_DEV,USB2_FUNC) +# define USB2_DEV_FUNC PCI_DEVFN(USB2_DEV,USB2_FUNC) /* SATA Gen 2 */ #define SATA2_DEV 0x17 #define SATA2_FUNC 0 # define SATA2_DEVID 0x1f22 -# define SATA2_DEV_FUNC DEV_FUNC(SATA2_DEV,SATA2_FUNC) +# define SATA2_DEV_FUNC PCI_DEVFN(SATA2_DEV,SATA2_FUNC) /* SATA Gen 3 */ #define SATA3_DEV 0x18 #define SATA3_FUNC 0 # define SATA3_DEVID 0x1f32 -# define SATA3_DEV_FUNC DEV_FUNC(SATA3_DEV,SATA3_FUNC) +# define SATA3_DEV_FUNC PCI_DEVFN(SATA3_DEV,SATA3_FUNC) /* Platform Control Unit (PCU) */ #define PCU_DEV 0x1f @@ -115,19 +116,19 @@ #define LPC_DEV PCU_DEV #define LPC_FUNC 0 # define LPC_DEVID 0x1f38 -# define LPC_DEV_FUNC DEV_FUNC(LPC_DEV,LPC_FUNC) +# define LPC_DEV_FUNC PCI_DEVFN(LPC_DEV,LPC_FUNC) # define LPC_BDF PCI_DEV(BUS0, LPC_DEV, LPC_FUNC) /* SMBus 2.0 0 */ #define SMBUS0_DEV PCU_DEV #define SMBUS0_FUNC 3 # define SMBUS0_DEVID 0x1f3c -# define SMBUS0_DEV_FUNC DEV_FUNC(SMBUS0_DEV,SMBUS0_FUNC) +# define SMBUS0_DEV_FUNC PCI_DEVFN(SMBUS0_DEV,SMBUS0_FUNC) /* Intel QuickAssist Integrated Accelerator (IQIA) */ #define IQAT_DEV 0xb #define IQAT_FUNC 0 # define IQAT_DEVID 0x1f18 -# define IQAT_DEV_FUNC DEV_FUNC(IQAT_DEV,IQAT_FUNC) +# define IQAT_DEV_FUNC PCI_DEVFN(IQAT_DEV,IQAT_FUNC) #endif /* _RANGELEY_PCI_DEVS_H_ */ -- cgit v1.2.3