]> git.sur5r.net Git - u-boot/blobdiff - lib_i386/pci_type1.c
Blackfin: TWI/I2C: implement bus speed get/set functions
[u-boot] / lib_i386 / pci_type1.c
index 8d35716eed094f0848ce56992cbb76802cfc1a2b..225ae4a990923b3dfa127ac34e34e41b0f70cf81 100644 (file)
  */
 
 #include <common.h>
-
-#ifdef CONFIG_PCI
-
 #include <asm/io.h>
 #include <pci.h>
 
-#define cfg_read(val, addr, type, op)  *val = op((type)(addr))
-#define cfg_write(val, addr, type, op) op((val), (type *)(addr))
-
-#define TYPE1_PCI_OP(rw, size, type, op, mask)                  \
-static int                                                              \
-type1_##rw##_config_##size(struct pci_controller *hose,                 \
-                             pci_dev_t dev, int offset, type val)       \
-{                                                                       \
-       outl(dev | (offset & 0xfc) | 0x80000000, hose->cfg_addr);        \
-       cfg_##rw(val, hose->cfg_data + (offset & mask), type, op);       \
-       return 0;                                                        \
+#define cfg_read(val, addr, op)        *val = op((int)(addr))
+#define cfg_write(val, addr, op)       op((val), (int)(addr))
+
+#define TYPE1_PCI_OP(rw, size, type, op, mask)                         \
+static int                                                             \
+type1_##rw##_config_##size(struct pci_controller *hose,                        \
+                             pci_dev_t dev, int offset, type val)      \
+{                                                                      \
+       outl(dev | (offset & 0xfc) | 0x80000000, (int)hose->cfg_addr);  \
+       cfg_##rw(val, hose->cfg_data + (offset & mask), op);            \
+       return 0;                                                       \
 }
 
 
@@ -52,5 +49,3 @@ void pci_setup_type1(struct pci_controller* hose, u32 cfg_addr, u32 cfg_data)
        hose->cfg_addr = (unsigned int *) cfg_addr;
        hose->cfg_data = (unsigned char *) cfg_data;
 }
-
-#endif