Skip to content

Commit 7598759

Browse files
palitrini
authored andcommitted
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>
1 parent 7fabaa5 commit 7598759

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/x86/cpu/pci.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
int pci_x86_read_config(pci_dev_t bdf, uint offset, ulong *valuep,
2121
enum pci_size_t size)
2222
{
23-
outl(bdf | (offset & 0xfc) | PCI_CFG_EN, PCI_REG_ADDR);
23+
outl(PCI_CONF1_ADDRESS(PCI_BUS(bdf), PCI_DEV(bdf), PCI_FUNC(bdf), offset), PCI_REG_ADDR);
2424
switch (size) {
2525
case PCI_SIZE_8:
2626
*valuep = inb(PCI_REG_DATA + (offset & 3));
@@ -39,7 +39,7 @@ int pci_x86_read_config(pci_dev_t bdf, uint offset, ulong *valuep,
3939
int pci_x86_write_config(pci_dev_t bdf, uint offset, ulong value,
4040
enum pci_size_t size)
4141
{
42-
outl(bdf | (offset & 0xfc) | PCI_CFG_EN, PCI_REG_ADDR);
42+
outl(PCI_CONF1_ADDRESS(PCI_BUS(bdf), PCI_DEV(bdf), PCI_FUNC(bdf), offset), PCI_REG_ADDR);
4343
switch (size) {
4444
case PCI_SIZE_8:
4545
outb(value, PCI_REG_DATA + (offset & 3));

0 commit comments

Comments
 (0)