diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/npu2.h | 2 | ||||
-rw-r--r-- | include/pci.h | 8 | ||||
-rw-r--r-- | include/skiboot.h | 1 |
3 files changed, 6 insertions, 5 deletions
diff --git a/include/npu2.h b/include/npu2.h index 372d1be..282ee8b 100644 --- a/include/npu2.h +++ b/include/npu2.h @@ -19,7 +19,7 @@ #define NPU2DEVLOG(l, p, fmt, a...) prlog(l, "NPU%d:%d:%d.%d " fmt, \ (p)->npu->phb_nvlink.opal_id, \ PCI_BUS_NUM((p)->bdfn), \ - ((p)->bdfn >> 3) & 0x1f, \ + PCI_DEV((p)->bdfn), \ (p)->bdfn & 0x7, ##a) #define NPU2DEVDBG(p, fmt, a...) NPU2DEVLOG(PR_DEBUG, p, fmt, ##a) #define NPU2DEVINF(p, fmt, a...) NPU2DEVLOG(PR_INFO, p, fmt, ##a) diff --git a/include/pci.h b/include/pci.h index cb33063..f837e0f 100644 --- a/include/pci.h +++ b/include/pci.h @@ -14,22 +14,22 @@ prlog(PR_TRACE, "PHB#%04x:%02x:%02x.%x " fmt, \ (_p)->opal_id, \ PCI_BUS_NUM(_bdfn), \ - ((_bdfn) >> 3) & 0x1f, (_bdfn) & 0x7, ## a) + PCI_DEV(_bdfn), (_bdfn) & 0x7, ## a) #define PCIDBG(_p, _bdfn, fmt, a...) \ prlog(PR_DEBUG, "PHB#%04x:%02x:%02x.%x " fmt, \ (_p)->opal_id, \ PCI_BUS_NUM(_bdfn), \ - ((_bdfn) >> 3) & 0x1f, (_bdfn) & 0x7, ## a) + PCI_DEV(_bdfn), (_bdfn) & 0x7, ## a) #define PCINOTICE(_p, _bdfn, fmt, a...) \ prlog(PR_NOTICE, "PHB#%04x:%02x:%02x.%x " fmt, \ (_p)->opal_id, \ PCI_BUS_NUM(_bdfn), \ - ((_bdfn) >> 3) & 0x1f, (_bdfn) & 0x7, ## a) + PCI_DEV(_bdfn), (_bdfn) & 0x7, ## a) #define PCIERR(_p, _bdfn, fmt, a...) \ prlog(PR_ERR, "PHB#%04x:%02x:%02x.%x " fmt, \ (_p)->opal_id, \ PCI_BUS_NUM(_bdfn), \ - ((_bdfn) >> 3) & 0x1f, (_bdfn) & 0x7, ## a) + PCI_DEV(_bdfn), (_bdfn) & 0x7, ## a) struct pci_device; struct pci_cfg_reg_filter; diff --git a/include/skiboot.h b/include/skiboot.h index 4db265f..7ea17bf 100644 --- a/include/skiboot.h +++ b/include/skiboot.h @@ -139,6 +139,7 @@ static inline bool is_pow2(unsigned long val) /* PCI Geographical Addressing */ #define PCI_BUS_NUM(bdfn) (((bdfn) >> 8) & 0xff) +#define PCI_DEV(bdfn) (((bdfn) >> 3) & 0x1f) /* Clean the stray high bit which the FSP inserts: we only have 52 bits real */ static inline u64 cleanup_addr(u64 addr) |