linux/arch/arm/include/asm/mach/pci.h
<<
>>
Prefs
   1/*
   2 *  arch/arm/include/asm/mach/pci.h
   3 *
   4 *  Copyright (C) 2000 Russell King
   5 *
   6 * This program is free software; you can redistribute it and/or modify
   7 * it under the terms of the GNU General Public License version 2 as
   8 * published by the Free Software Foundation.
   9 */
  10
  11#ifndef __ASM_MACH_PCI_H
  12#define __ASM_MACH_PCI_H
  13
  14#include <linux/ioport.h>
  15
  16struct pci_sys_data;
  17struct pci_ops;
  18struct pci_bus;
  19
  20struct hw_pci {
  21#ifdef CONFIG_PCI_DOMAINS
  22        int             domain;
  23#endif
  24        struct pci_ops  *ops;
  25        int             nr_controllers;
  26        int             (*setup)(int nr, struct pci_sys_data *);
  27        struct pci_bus *(*scan)(int nr, struct pci_sys_data *);
  28        void            (*preinit)(void);
  29        void            (*postinit)(void);
  30        u8              (*swizzle)(struct pci_dev *dev, u8 *pin);
  31        int             (*map_irq)(const struct pci_dev *dev, u8 slot, u8 pin);
  32};
  33
  34/*
  35 * Per-controller structure
  36 */
  37struct pci_sys_data {
  38#ifdef CONFIG_PCI_DOMAINS
  39        int             domain;
  40#endif
  41        struct list_head node;
  42        int             busnr;          /* primary bus number                   */
  43        u64             mem_offset;     /* bus->cpu memory mapping offset       */
  44        unsigned long   io_offset;      /* bus->cpu IO mapping offset           */
  45        struct pci_bus  *bus;           /* PCI bus                              */
  46        struct list_head resources;     /* root bus resources (apertures)       */
  47        struct resource io_res;
  48        char            io_res_name[12];
  49                                        /* Bridge swizzling                     */
  50        u8              (*swizzle)(struct pci_dev *, u8 *);
  51                                        /* IRQ mapping                          */
  52        int             (*map_irq)(const struct pci_dev *, u8, u8);
  53        void            *private_data;  /* platform controller private data     */
  54};
  55
  56/*
  57 * Call this with your hw_pci struct to initialise the PCI system.
  58 */
  59void pci_common_init(struct hw_pci *);
  60
  61/*
  62 * Setup early fixed I/O mapping.
  63 */
  64#if defined(CONFIG_PCI)
  65extern void pci_map_io_early(unsigned long pfn);
  66#else
  67static inline void pci_map_io_early(unsigned long pfn) {}
  68#endif
  69
  70/*
  71 * PCI controllers
  72 */
  73extern struct pci_ops iop3xx_ops;
  74extern int iop3xx_pci_setup(int nr, struct pci_sys_data *);
  75extern void iop3xx_pci_preinit(void);
  76extern void iop3xx_pci_preinit_cond(void);
  77
  78extern struct pci_ops dc21285_ops;
  79extern int dc21285_setup(int nr, struct pci_sys_data *);
  80extern void dc21285_preinit(void);
  81extern void dc21285_postinit(void);
  82
  83extern struct pci_ops via82c505_ops;
  84extern int via82c505_setup(int nr, struct pci_sys_data *);
  85extern void via82c505_init(void *sysdata);
  86
  87extern struct pci_ops pci_v3_ops;
  88extern int pci_v3_setup(int nr, struct pci_sys_data *);
  89extern void pci_v3_preinit(void);
  90extern void pci_v3_postinit(void);
  91
  92#endif /* __ASM_MACH_PCI_H */
  93