summaryrefslogtreecommitdiff
path: root/cpu/mpc83xx/pcie.c
diff options
context:
space:
mode:
authorWolfgang Denk <wd@denx.de>2009-02-24 22:52:16 +0100
committerWolfgang Denk <wd@denx.de>2009-02-24 22:52:16 +0100
commit89e372cd3d520ed20fab543f2cbba2dbb9490cf8 (patch)
tree38ae9f69a9e091ace6ae531cd71830662eccc2e6 /cpu/mpc83xx/pcie.c
parentbd76729bcbfd64b5d016a9b936f058931fc06eaf (diff)
parent7e91558032a0c1932dd7f4f562f9c7cc55efc496 (diff)
downloadu-boot-imx-89e372cd3d520ed20fab543f2cbba2dbb9490cf8.zip
u-boot-imx-89e372cd3d520ed20fab543f2cbba2dbb9490cf8.tar.gz
u-boot-imx-89e372cd3d520ed20fab543f2cbba2dbb9490cf8.tar.bz2
Merge branch 'master' of git://git.denx.de/u-boot-mpc83xx
Diffstat (limited to 'cpu/mpc83xx/pcie.c')
-rw-r--r--cpu/mpc83xx/pcie.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/cpu/mpc83xx/pcie.c b/cpu/mpc83xx/pcie.c
index 12b5f69..77f8906 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; \
}
@@ -86,7 +91,6 @@ static void mpc83xx_pcie_register_hose(int bus, struct pci_region *reg,
{
extern void disable_addr_trans(void); /* start.S */
static struct pci_controller pcie_hose[PCIE_MAX_BUSES];
- static int max_bus;
struct pci_controller *hose = &pcie_hose[bus];
int i;
@@ -117,7 +121,7 @@ static void mpc83xx_pcie_register_hose(int bus, struct pci_region *reg,
hose->regions[i].size = 0x100000;
hose->regions[i].flags = PCI_REGION_MEM | PCI_REGION_SYS_MEMORY;
- hose->first_busno = max_bus;
+ hose->first_busno = pci_last_busno() + 1;
hose->last_busno = 0xff;
if (bus == 0)
@@ -145,7 +149,6 @@ static void mpc83xx_pcie_register_hose(int bus, struct pci_region *reg,
* Hose scan.
*/
hose->last_busno = pci_hose_scan(hose);
- max_bus = hose->last_busno + 1;
}
#else