diff options
author | Daniel Hellstrom <daniel@gaisler.com> | 2014-02-05 17:17:53 +0100 |
---|---|---|
committer | Daniel Hellstrom <daniel@gaisler.com> | 2014-03-07 12:23:21 +0100 |
commit | 58e3d87ed013c7baf5b91825cd2695a01f9288f9 (patch) | |
tree | f94d4b45323fa784a135e4c6b0257f3a8942af08 | |
parent | a8793940dc738410c82a99363ad42be9b8ab7804 (diff) |
LEON PCI: fix for PCI host bridge driver CFG space access
-rw-r--r-- | c/src/lib/libbsp/sparc/shared/pci/grpci.c | 4 | ||||
-rw-r--r-- | c/src/lib/libbsp/sparc/shared/pci/grpci2.c | 2 | ||||
-rw-r--r-- | c/src/lib/libbsp/sparc/shared/pci/pcif.c | 4 |
3 files changed, 5 insertions, 5 deletions
diff --git a/c/src/lib/libbsp/sparc/shared/pci/grpci.c b/c/src/lib/libbsp/sparc/shared/pci/grpci.c index 6eb5dd81e0..57631bb264 100644 --- a/c/src/lib/libbsp/sparc/shared/pci/grpci.c +++ b/c/src/lib/libbsp/sparc/shared/pci/grpci.c @@ -191,7 +191,7 @@ int grpci_cfg_r32(pci_dev_t dev, int ofs, uint32_t *val) */ if (dev == HOST_TGT) bus = devfn = 0; - if (bus == 0) + else if (bus == 0) devfn = PCI_DEV_DEVFUNC(dev) + PCI_DEV(0, 6, 0); else devfn = PCI_DEV_DEVFUNC(dev); @@ -264,7 +264,7 @@ int grpci_cfg_w32(pci_dev_t dev, int ofs, uint32_t val) */ if (dev == HOST_TGT) bus = devfn = 0; - if (bus == 0) + else if (bus == 0) devfn = PCI_DEV_DEVFUNC(dev) + PCI_DEV(0, 6, 0); else devfn = PCI_DEV_DEVFUNC(dev); diff --git a/c/src/lib/libbsp/sparc/shared/pci/grpci2.c b/c/src/lib/libbsp/sparc/shared/pci/grpci2.c index ee643773e1..7203833cbf 100644 --- a/c/src/lib/libbsp/sparc/shared/pci/grpci2.c +++ b/c/src/lib/libbsp/sparc/shared/pci/grpci2.c @@ -409,7 +409,7 @@ int grpci2_cfg_w32(pci_dev_t dev, int ofs, uint32_t val) */ if (dev == HOST_TGT) bus = devfn = 0; - if (bus == 0) + else if (bus == 0) devfn = PCI_DEV_DEVFUNC(dev) + PCI_DEV(0, 6, 0); else devfn = PCI_DEV_DEVFUNC(dev); diff --git a/c/src/lib/libbsp/sparc/shared/pci/pcif.c b/c/src/lib/libbsp/sparc/shared/pci/pcif.c index d2b1bdaa59..74f3d72cc4 100644 --- a/c/src/lib/libbsp/sparc/shared/pci/pcif.c +++ b/c/src/lib/libbsp/sparc/shared/pci/pcif.c @@ -178,7 +178,7 @@ int pcif_cfg_r32(pci_dev_t dev, int ofs, uint32_t *val) */ if (dev == HOST_TGT) bus = devfn = 0; - if (bus == 0) + else if (bus == 0) devfn = PCI_DEV_DEVFUNC(dev) + PCI_DEV(0, 6, 0); else devfn = PCI_DEV_DEVFUNC(dev); @@ -245,7 +245,7 @@ int pcif_cfg_w32(pci_dev_t dev, int ofs, uint32_t val) */ if (dev == HOST_TGT) bus = devfn = 0; - if (bus == 0) + else if (bus == 0) devfn = PCI_DEV_DEVFUNC(dev) + PCI_DEV(0, 6, 0); else devfn = PCI_DEV_DEVFUNC(dev); |