Merge branch 'master' of git://git.denx.de/u-boot-arm
[oweals/u-boot.git] / include / asm-ppc / fsl_pci.h
index b2ff0e929afb15a4483b67b48e611a421d516392..db61e7e9cbfe135b87c8dee9c140b0fd3da4735f 100644 (file)
@@ -1,4 +1,5 @@
-/* (C) Copyright 2007 Freescale Semiconductor, Inc.
+/*
+ * Copyright 2007,2009 Freescale Semiconductor, Inc.
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
 #ifndef __FSL_PCI_H_
 #define __FSL_PCI_H_
 
+#include <asm/fsl_law.h>
+
+int is_fsl_pci_cfg(enum law_trgt_if trgt, u32 io_sel);
+
+int fsl_setup_hose(struct pci_controller *hose, unsigned long addr);
+int fsl_is_pci_agent(struct pci_controller *hose);
 void fsl_pci_init(struct pci_controller *hose, u32 cfg_addr, u32 cfg_data);
 void fsl_pci_config_unlock(struct pci_controller *hose);
 void ft_fsl_pci_setup(void *blob, const char *pci_alias,
@@ -154,4 +161,42 @@ typedef struct ccsr_pci {
        char    res24[252];
 } ccsr_fsl_pci_t;
 
+struct fsl_pci_info {
+       unsigned long   regs;
+       pci_addr_t      mem_bus;
+       phys_size_t     mem_phys;
+       pci_size_t      mem_size;
+       pci_addr_t      io_bus;
+       phys_size_t     io_phys;
+       pci_size_t      io_size;
+       int             pci_num;
+};
+
+int fsl_pci_init_port(struct fsl_pci_info *pci_info,
+                               struct pci_controller *hose, int busno);
+
+#define SET_STD_PCI_INFO(x, num) \
+{                      \
+       x.regs = CONFIG_SYS_PCI##num##_ADDR;    \
+       x.mem_bus = CONFIG_SYS_PCI##num##_MEM_BUS; \
+       x.mem_phys = CONFIG_SYS_PCI##num##_MEM_PHYS; \
+       x.mem_size = CONFIG_SYS_PCI##num##_MEM_SIZE; \
+       x.io_bus = CONFIG_SYS_PCI##num##_IO_BUS; \
+       x.io_phys = CONFIG_SYS_PCI##num##_IO_PHYS; \
+       x.io_size = CONFIG_SYS_PCI##num##_IO_SIZE; \
+       x.pci_num = num; \
+}
+
+#define SET_STD_PCIE_INFO(x, num) \
+{                      \
+       x.regs = CONFIG_SYS_PCIE##num##_ADDR;   \
+       x.mem_bus = CONFIG_SYS_PCIE##num##_MEM_BUS; \
+       x.mem_phys = CONFIG_SYS_PCIE##num##_MEM_PHYS; \
+       x.mem_size = CONFIG_SYS_PCIE##num##_MEM_SIZE; \
+       x.io_bus = CONFIG_SYS_PCIE##num##_IO_BUS; \
+       x.io_phys = CONFIG_SYS_PCIE##num##_IO_PHYS; \
+       x.io_size = CONFIG_SYS_PCIE##num##_IO_SIZE; \
+       x.pci_num = num; \
+}
+
 #endif