x86: pci: Use PCI_CONF1_ADDRESS() macro

x86 platform uses standard format of Config Address for PCI Configuration
Mechanism #1. So use new U-Boot macro PCI_CONF1_ADDRESS().

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Pali Rohár 2021-11-26 11:42:50 +01:00 committed by Tom Rini
parent 7fabaa5313
commit 7598759d19

View File

@ -20,7 +20,7 @@
int pci_x86_read_config(pci_dev_t bdf, uint offset, ulong *valuep, int pci_x86_read_config(pci_dev_t bdf, uint offset, ulong *valuep,
enum pci_size_t size) enum pci_size_t size)
{ {
outl(bdf | (offset & 0xfc) | PCI_CFG_EN, PCI_REG_ADDR); outl(PCI_CONF1_ADDRESS(PCI_BUS(bdf), PCI_DEV(bdf), PCI_FUNC(bdf), offset), PCI_REG_ADDR);
switch (size) { switch (size) {
case PCI_SIZE_8: case PCI_SIZE_8:
*valuep = inb(PCI_REG_DATA + (offset & 3)); *valuep = inb(PCI_REG_DATA + (offset & 3));
@ -39,7 +39,7 @@ int pci_x86_read_config(pci_dev_t bdf, uint offset, ulong *valuep,
int pci_x86_write_config(pci_dev_t bdf, uint offset, ulong value, int pci_x86_write_config(pci_dev_t bdf, uint offset, ulong value,
enum pci_size_t size) enum pci_size_t size)
{ {
outl(bdf | (offset & 0xfc) | PCI_CFG_EN, PCI_REG_ADDR); outl(PCI_CONF1_ADDRESS(PCI_BUS(bdf), PCI_DEV(bdf), PCI_FUNC(bdf), offset), PCI_REG_ADDR);
switch (size) { switch (size) {
case PCI_SIZE_8: case PCI_SIZE_8:
outb(value, PCI_REG_DATA + (offset & 3)); outb(value, PCI_REG_DATA + (offset & 3));