2005-04-17 06:20:36 +08:00
|
|
|
#ifndef __ASM_SH_PCI_H
|
|
|
|
#define __ASM_SH_PCI_H
|
|
|
|
|
|
|
|
#ifdef __KERNEL__
|
|
|
|
|
|
|
|
/* Can be used to override the logic in pci_scan_bus for skipping
|
|
|
|
already-configured bus numbers - to be used for buggy BIOSes
|
|
|
|
or architectures with incomplete PCI setup by the loader */
|
|
|
|
|
|
|
|
#define pcibios_assign_all_busses() 1
|
|
|
|
|
|
|
|
/*
|
|
|
|
* A board can define one or more PCI channels that represent built-in (or
|
|
|
|
* external) PCI controllers.
|
|
|
|
*/
|
|
|
|
struct pci_channel {
|
2009-04-20 17:29:22 +08:00
|
|
|
struct pci_channel *next;
|
2010-01-29 21:38:13 +08:00
|
|
|
struct pci_bus *bus;
|
2009-04-20 17:29:22 +08:00
|
|
|
|
|
|
|
struct pci_ops *pci_ops;
|
2010-02-01 19:01:50 +08:00
|
|
|
|
|
|
|
struct resource *resources;
|
|
|
|
unsigned int nr_resources;
|
2009-04-20 17:29:22 +08:00
|
|
|
|
2009-04-20 17:42:00 +08:00
|
|
|
unsigned long io_offset;
|
|
|
|
unsigned long mem_offset;
|
|
|
|
|
2009-04-20 17:29:22 +08:00
|
|
|
unsigned long reg_base;
|
|
|
|
unsigned long io_map_base;
|
2010-01-29 21:38:13 +08:00
|
|
|
|
|
|
|
unsigned int index;
|
|
|
|
unsigned int need_domain_info;
|
2010-02-01 15:39:46 +08:00
|
|
|
|
|
|
|
/* Optional error handling */
|
|
|
|
struct timer_list err_timer, serr_timer;
|
|
|
|
unsigned int err_irq, serr_irq;
|
2005-04-17 06:20:36 +08:00
|
|
|
};
|
|
|
|
|
2010-02-01 15:39:46 +08:00
|
|
|
/* arch/sh/drivers/pci/pci.c */
|
2010-09-20 17:56:13 +08:00
|
|
|
extern raw_spinlock_t pci_config_lock;
|
|
|
|
|
2010-02-01 12:11:25 +08:00
|
|
|
extern int register_pci_controller(struct pci_channel *hose);
|
2010-02-01 15:39:46 +08:00
|
|
|
extern void pcibios_report_status(unsigned int status_mask, int warn);
|
|
|
|
|
|
|
|
/* arch/sh/drivers/pci/common.c */
|
2010-02-03 15:46:20 +08:00
|
|
|
extern int early_read_config_byte(struct pci_channel *hose, int top_bus,
|
|
|
|
int bus, int devfn, int offset, u8 *value);
|
|
|
|
extern int early_read_config_word(struct pci_channel *hose, int top_bus,
|
|
|
|
int bus, int devfn, int offset, u16 *value);
|
|
|
|
extern int early_read_config_dword(struct pci_channel *hose, int top_bus,
|
|
|
|
int bus, int devfn, int offset, u32 *value);
|
|
|
|
extern int early_write_config_byte(struct pci_channel *hose, int top_bus,
|
|
|
|
int bus, int devfn, int offset, u8 value);
|
|
|
|
extern int early_write_config_word(struct pci_channel *hose, int top_bus,
|
|
|
|
int bus, int devfn, int offset, u16 value);
|
|
|
|
extern int early_write_config_dword(struct pci_channel *hose, int top_bus,
|
|
|
|
int bus, int devfn, int offset, u32 value);
|
2010-02-01 15:39:46 +08:00
|
|
|
extern void pcibios_enable_timers(struct pci_channel *hose);
|
|
|
|
extern unsigned int pcibios_handle_status_errors(unsigned long addr,
|
|
|
|
unsigned int status, struct pci_channel *hose);
|
2010-02-01 12:01:42 +08:00
|
|
|
extern int pci_is_66mhz_capable(struct pci_channel *hose,
|
|
|
|
int top_bus, int current_bus);
|
2009-04-20 17:29:22 +08:00
|
|
|
|
2009-04-20 15:14:29 +08:00
|
|
|
extern unsigned long PCIBIOS_MIN_IO, PCIBIOS_MIN_MEM;
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
struct pci_dev;
|
|
|
|
|
2009-04-20 14:51:45 +08:00
|
|
|
#define HAVE_PCI_MMAP
|
2017-04-12 20:26:05 +08:00
|
|
|
#define ARCH_GENERIC_PCI_MMAP_RESOURCE
|
2017-04-12 20:25:55 +08:00
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
extern void pcibios_set_master(struct pci_dev *dev);
|
|
|
|
|
|
|
|
/* Dynamic DMA mapping stuff.
|
|
|
|
* SuperH has everything mapped statically like x86.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* The PCI address space does equal the physical memory
|
|
|
|
* address space. The networking and block device layers use
|
|
|
|
* this boolean for bounce buffer decisions.
|
|
|
|
*/
|
2009-10-20 11:55:56 +08:00
|
|
|
#define PCI_DMA_BUS_IS_PHYS (dma_ops->is_phys)
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2009-04-24 14:39:39 +08:00
|
|
|
#ifdef CONFIG_PCI
|
2009-05-26 22:13:13 +08:00
|
|
|
/*
|
|
|
|
* None of the SH PCI controllers support MWI, it is always treated as a
|
|
|
|
* direct memory write.
|
|
|
|
*/
|
|
|
|
#define PCI_DISABLE_MWI
|
2009-04-24 14:39:39 +08:00
|
|
|
#endif
|
2008-02-19 20:35:22 +08:00
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
/* Board-specific fixup routines. */
|
2011-06-10 22:30:21 +08:00
|
|
|
int pcibios_map_platform_irq(const struct pci_dev *dev, u8 slot, u8 pin);
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2010-01-29 21:38:13 +08:00
|
|
|
#define pci_domain_nr(bus) ((struct pci_channel *)(bus)->sysdata)->index
|
|
|
|
|
|
|
|
static inline int pci_proc_domain(struct pci_bus *bus)
|
|
|
|
{
|
|
|
|
struct pci_channel *hose = bus->sysdata;
|
|
|
|
return hose->need_domain_info;
|
|
|
|
}
|
|
|
|
|
2009-04-20 14:38:25 +08:00
|
|
|
/* Chances are this interrupt is wired PC-style ... */
|
|
|
|
static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)
|
|
|
|
{
|
|
|
|
return channel ? 15 : 14;
|
|
|
|
}
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2009-04-20 14:38:25 +08:00
|
|
|
#endif /* __KERNEL__ */
|
2005-04-17 06:20:36 +08:00
|
|
|
#endif /* __ASM_SH_PCI_H */
|
|
|
|
|