]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - drivers/pci_indirect.c
Add PCI support for MPC8250 Boards (PM825 module)
[karo-tx-uboot.git] / drivers / pci_indirect.c
index 08be082e31e9413c799e2a4a021e777ced3ca5fb..f7b442245199775f87defaae437610d7b7f5a634 100644 (file)
 #define cfg_read(val, addr, type, op)  *val = op((type)(addr))
 #define cfg_write(val, addr, type, op) op((type *)(addr), (val))
 
+#ifdef CONFIG_PM826
 #define INDIRECT_PCI_OP(rw, size, type, op, mask)                       \
 static int                                                              \
 indirect_##rw##_config_##size(struct pci_controller *hose,              \
                              pci_dev_t dev, int offset, type val)       \
 {                                                                       \
        out_le32(hose->cfg_addr, dev | (offset & 0xfc) | 0x80000000);    \
+       sync();                                                          \
        cfg_##rw(val, hose->cfg_data + (offset & mask), type, op);       \
        return 0;                                                        \
 }
+#else
+#define INDIRECT_PCI_OP(rw, size, type, op, mask)                       \
+static int                                                              \
+indirect_##rw##_config_##size(struct pci_controller *hose,              \
+                             pci_dev_t dev, int offset, type val)       \
+{                                                                       \
+       out_le32(hose->cfg_addr, dev | (offset & 0xfc) | 0x80000000);    \
+       cfg_##rw(val, hose->cfg_data + (offset & mask), type, op);       \
+       return 0;                                                        \
+}
+#endif
 
 #define INDIRECT_PCI_OP_ERRATA6(rw, size, type, op, mask)               \
 static int                                                              \