x86: pci: Allow binding of some devices before relocation

At present only bridge devices are bound before relocation, to save space
in pre-relocation memory. In some cases we do actually want to bind a
device, e.g. because it provides the console UART. Add a devicetree
binding to support this.

Use the PCI_VENDEV() macro to encode the cell value. This is present in
U-Boot but not used, so move it to the binding header-file.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
This commit is contained in:
Simon Glass 2021-06-27 17:50:57 -06:00 committed by Bin Meng
parent e58f3a7d9b
commit f5cbb5c7cd
4 changed files with 50 additions and 3 deletions

View file

@ -0,0 +1,12 @@
/* SPDX-License-Identifier: GPL-2.0+ */
/*
* This header provides common constants for PCI bindings.
*/
#ifndef _DT_BINDINGS_PCI_PCI_H
#define _DT_BINDINGS_PCI_PCI_H
/* Encode a vendor and device ID into a single cell */
#define PCI_VENDEV(v, d) (((v) << 16) | (d))
#endif /* _DT_BINDINGS_PCI_PCI_H */