File: ftv-pci.c

package info (click to toggle)
kernel-source-2.4.14 2.4.14-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 139,160 kB
  • ctags: 428,423
  • sloc: ansic: 2,435,554; asm: 141,119; makefile: 8,258; sh: 3,099; perl: 2,561; yacc: 1,177; cpp: 755; tcl: 577; lex: 352; awk: 251; lisp: 218; sed: 72
file content (51 lines) | stat: -rw-r--r-- 1,311 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*
 *  linux/arch/arm/kernel/ftv-pci.c
 *
 *  PCI bios-type initialisation for PCI machines
 *
 *  Bits taken from various places.
 */
#include <linux/kernel.h>
#include <linux/pci.h>
#include <linux/init.h>

#include <asm/irq.h>
#include <asm/mach/pci.h>

/*
 * Owing to a PCB cockup, issue A backplanes are wired thus:
 *
 * Slot 1    2    3    4    5   Bridge   S1    S2    S3    S4
 * IRQ  D    C    B    A    A            C     B     A     D
 *      A    D    C    B    B            D     C     B     A
 *      B    A    D    C    C            A     D     C     B
 *      C    B    A    D    D            B     A     D     C
 *
 * ID A31  A30  A29  A28  A27   A26      DEV4  DEV5  DEV6  DEV7
 *
 * Actually, this isn't too bad, because with the processor card
 * in slot 5 on the primary bus, the IRQs rotate on both sides
 * as you'd expect.
 */

static int irqmap_ftv[] __initdata = { IRQ_PCI_D, IRQ_PCI_C, IRQ_PCI_B, IRQ_PCI_A };

static int __init ftv_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
{
	if (slot > 0x10)
		slot--;
	return irqmap_ftv[(slot - pin) & 3];
}

static u8 __init ftv_swizzle(struct pci_dev *dev, u8 *pin)
{
	return PCI_SLOT(dev->devfn);
}

/* ftv host-specific stuff */
struct hw_pci ftv_pci __initdata = {
	init:		plx90x0_init,
	swizzle:	ftv_swizzle,
	map_irq:	ftv_map_irq,
};