• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* ASB2305 Arch-specific PCI declarations
2  *
3  * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
4  * Written by David Howells (dhowells@redhat.com)
5  * Derived from: arch/i386/kernel/pci-i386.h: (c) 1999 Martin Mares <mj@ucw.cz>
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public Licence
9  * as published by the Free Software Foundation; either version
10  * 2 of the Licence, or (at your option) any later version.
11  */
12 #ifndef _PCI_ASB2305_H
13 #define _PCI_ASB2305_H
14 
15 #undef DEBUG
16 
17 #ifdef DEBUG
18 #define DBG(x...) printk(x)
19 #else
20 #define DBG(x...)
21 #endif
22 
23 #define PCI_PROBE_BIOS 1
24 #define PCI_PROBE_CONF1 2
25 #define PCI_PROBE_CONF2 4
26 #define PCI_NO_CHECKS 0x400
27 #define PCI_ASSIGN_ROMS 0x1000
28 #define PCI_BIOS_IRQ_SCAN 0x2000
29 
30 extern unsigned int pci_probe;
31 
32 /* pci-asb2305.c */
33 
34 extern unsigned int pcibios_max_latency;
35 
36 extern void pcibios_resource_survey(void);
37 extern int pcibios_enable_resources(struct pci_dev *dev, int mask);
38 
39 /* pci.c */
40 
41 extern int pcibios_last_bus;
42 extern struct pci_bus *pci_root_bus;
43 extern struct pci_ops *pci_root_ops;
44 
45 extern struct irq_routing_table *pcibios_get_irq_routing_table(void);
46 extern int pcibios_set_irq_routing(struct pci_dev *dev, int pin, int irq);
47 
48 /* pci-irq.c */
49 
50 struct irq_info {
51 	u8 bus, devfn;			/* Bus, device and function */
52 	struct {
53 		u8 link;		/* IRQ line ID, chipset dependent,
54 					 * 0=not routed */
55 		u16 bitmap;		/* Available IRQs */
56 	} __attribute__((packed)) irq[4];
57 	u8 slot;			/* Slot number, 0=onboard */
58 	u8 rfu;
59 } __attribute__((packed));
60 
61 struct irq_routing_table {
62 	u32 signature;			/* PIRQ_SIGNATURE should be here */
63 	u16 version;			/* PIRQ_VERSION */
64 	u16 size;			/* Table size in bytes */
65 	u8 rtr_bus, rtr_devfn;		/* Where the interrupt router lies */
66 	u16 exclusive_irqs;		/* IRQs devoted exclusively to PCI usage */
67 	u16 rtr_vendor, rtr_device;	/* Vendor and device ID of interrupt router */
68 	u32 miniport_data;		/* Crap */
69 	u8 rfu[11];
70 	u8 checksum;			/* Modulo 256 checksum must give zero */
71 	struct irq_info slots[0];
72 } __attribute__((packed));
73 
74 extern unsigned int pcibios_irq_mask;
75 
76 extern void pcibios_irq_init(void);
77 extern void pcibios_fixup_irqs(void);
78 extern void pcibios_enable_irq(struct pci_dev *dev);
79 
80 #endif /* PCI_ASB2305_H */
81