]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - drivers/pci_indirect.c
Add support for Siemens SX1 mobile phone;
[karo-tx-uboot.git] / drivers / pci_indirect.c
index fdf4d130a5fe4ebbcb793109e42b3eeefffbf98f..0368681351ab57bd2a9556a9f6e260bbdd1a9901 100644 (file)
@@ -21,7 +21,7 @@
 #define cfg_read(val, addr, type, op)  *val = op((type)(addr))
 #define cfg_write(val, addr, type, op) op((type *)(addr), (val))
 
-#if defined(CONFIG_PM826) || defined(CONFIG_ATC)
+#if defined(CONFIG_MPC8260)
 #define INDIRECT_PCI_OP(rw, size, type, op, mask)                       \
 static int                                                              \
 indirect_##rw##_config_##size(struct pci_controller *hose,              \
@@ -32,6 +32,30 @@ indirect_##rw##_config_##size(struct pci_controller *hose,            \
        cfg_##rw(val, hose->cfg_data + (offset & mask), type, op);       \
        return 0;                                                        \
 }
+#elif defined(CONFIG_E500)
+#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)       \
+{                                                                        \
+       *(hose->cfg_addr) = dev | (offset & 0xfc) | 0x80000000;          \
+       sync();                                                          \
+       cfg_##rw(val, hose->cfg_data + (offset & mask), type, op);       \
+       return 0;                                                        \
+}
+#elif defined(CONFIG_440_GX)
+#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)       \
+{                                                                       \
+       if (PCI_BUS(dev) > 0)                                            \
+               out_le32(hose->cfg_addr, dev | (offset & 0xfc) | 0x80000001); \
+       else                                                             \
+               out_le32(hose->cfg_addr, dev | (offset & 0xfc) | 0x80000000); \
+       cfg_##rw(val, hose->cfg_data + (offset & mask), type, op);       \
+       return 0;                                                        \
+}
 #else
 #define INDIRECT_PCI_OP(rw, size, type, op, mask)                       \
 static int                                                              \