提交 f0597038 编写于 作者: S Simon Glass 提交者: Tom Rini

pci: Add a macro to convert BDF from linux to U-Boot

U-Boot's BDF format has its bits in the same position as the device tree
PCI definition.

Some x86 devices use linux format in their register format and it is
useful to be able to convert to U-Boot format. Add a macro for this.
Signed-off-by: NSimon Glass <sjg@chromium.org>
上级 2c2ca207
...@@ -543,6 +543,9 @@ typedef int pci_dev_t; ...@@ -543,6 +543,9 @@ typedef int pci_dev_t;
#define PCI_VENDEV(v, d) (((v) << 16) | (d)) #define PCI_VENDEV(v, d) (((v) << 16) | (d))
#define PCI_ANY_ID (~0) #define PCI_ANY_ID (~0)
/* Convert from Linux format to U-Boot format */
#define PCI_TO_BDF(val) ((val) << 8)
struct pci_device_id { struct pci_device_id {
unsigned int vendor, device; /* Vendor and device ID or PCI_ANY_ID */ unsigned int vendor, device; /* Vendor and device ID or PCI_ANY_ID */
unsigned int subvendor, subdevice; /* Subsystem ID's or PCI_ANY_ID */ unsigned int subvendor, subdevice; /* Subsystem ID's or PCI_ANY_ID */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册