X-Git-Url: https://git.kernelconcepts.de/?a=blobdiff_plain;f=drivers%2Fpci_indirect.c;h=0368681351ab57bd2a9556a9f6e260bbdd1a9901;hb=232c150a250bb2fcb894b15d67c65df2458e271f;hp=fdf4d130a5fe4ebbcb793109e42b3eeefffbf98f;hpb=66fd3d1ce732d9168d6a056986231ada8dfa500e;p=karo-tx-uboot.git diff --git a/drivers/pci_indirect.c b/drivers/pci_indirect.c index fdf4d130a5..0368681351 100644 --- a/drivers/pci_indirect.c +++ b/drivers/pci_indirect.c @@ -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 \