aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Vorontsov <avorontsov@ru.mvista.com>2009-02-19 18:20:44 +0300
committerKim Phillips <kim.phillips@freescale.com>2009-02-23 15:51:59 -0600
commitb24a99f6666ac278ec9f9c1334518af828833d19 (patch)
treea69d7be8df4133cf8cad2f2aca285ce81ce867f7
parente2d72ba543c7b6924b5b5d393dcd80b2b9c3a022 (diff)
mpc83xx: PCIe: Fix CONFIG_PCI_SCAN_SHOW reporting bogus values
This patch fixes an issue in config space read accessors: we should fill-in the value even if we fail (e.g. skipping devices), otherwise CONFIG_PCI_SCAN_SHOW reports bogus values during boot up. Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com> Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
-rw-r--r--cpu/mpc83xx/pcie.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/cpu/mpc83xx/pcie.c b/cpu/mpc83xx/pcie.c
index 1a3b2be94..77f8906b9 100644
--- a/cpu/mpc83xx/pcie.c
+++ b/cpu/mpc83xx/pcie.c
@@ -60,6 +60,9 @@ static int mpc83xx_pcie_remap_cfg(struct pci_controller *hose, pci_dev_t dev)
#define cfg_write(val, addr, type, op) \
do { op((type *)(addr), (val)); } while (0)
+#define cfg_read_err(val) do { *val = -1; } while (0)
+#define cfg_write_err(val) do { } while (0)
+
#define PCIE_OP(rw, size, type, op) \
static int pcie_##rw##_config_##size(struct pci_controller *hose, \
pci_dev_t dev, int offset, \
@@ -68,8 +71,10 @@ static int pcie_##rw##_config_##size(struct pci_controller *hose, \
int ret; \
\
ret = mpc83xx_pcie_remap_cfg(hose, dev); \
- if (ret) \
- return ret; \
+ if (ret) { \
+ cfg_##rw##_err(val); \
+ return ret; \
+ } \
cfg_##rw(val, (void *)hose->cfg_addr + offset, type, op); \
return 0; \
}