Project

General

Profile

Statistics
| Revision:

root / lab4 / .minix-src / include / i386 / pci_intel.h @ 13

History | View | Annotate | Download (1.9 KB)

1 13 up20180614
/*
2
pci_intel.h
3

4
Created:        Jan 2000 by Philip Homburg <philip@cs.vu.nl>
5
*/
6
7
#define PCII_CONFADD        0xCF8
8
#define                PCIIC_CODE                0x80000000
9
#define                PCIIC_BUSNUM_MASK          0xff0000
10
#define                PCIIC_BUSNUM_SHIFT                16
11
#define                PCIIC_DEVNUM_MASK            0xf800
12
#define                PCIIC_DEVNUM_SHIFT                11
13
#define                PCIIC_FUNCNUM_MASK             0x700
14
#define                PCIIC_FUNCNUM_SHIFT                 8
15
#define                PCIIC_REGNUM_MASK              0xfc
16
#define                PCIIC_REGNUM_SHIFT                 2
17
#define PCII_CONFDATA        0xCFC
18
19
#define PCII_SELREG_(bus, dev, func, reg) \
20
        (PCIIC_CODE | \
21
            (((bus) << PCIIC_BUSNUM_SHIFT) & PCIIC_BUSNUM_MASK) | \
22
            (((dev) << PCIIC_DEVNUM_SHIFT) & PCIIC_DEVNUM_MASK) | \
23
            (((func) << PCIIC_FUNCNUM_SHIFT) & PCIIC_FUNCNUM_MASK) | \
24
            ((((reg)/4) << PCIIC_REGNUM_SHIFT) & PCIIC_REGNUM_MASK))
25
#define PCII_UNSEL         (0)
26
27
#define PCII_RREG8_(bus, dev, func, reg) \
28
        (pci_outl(PCII_CONFADD, PCII_SELREG_(bus, dev, func, reg)), \
29
        pci_inb(PCII_CONFDATA+((reg)&3)))
30
#define PCII_RREG16_(bus, dev, func, reg) \
31
        (pci_outl(PCII_CONFADD, PCII_SELREG_(bus, dev, func, reg)), \
32
        pci_inw(PCII_CONFDATA+((reg)&2)))
33
#define PCII_RREG32_(bus, dev, func, reg) \
34
        (pci_outl(PCII_CONFADD, PCII_SELREG_(bus, dev, func, reg)), \
35
        pci_inl(PCII_CONFDATA))
36
37
#define PCII_WREG8_(bus, dev, func, reg, val) \
38
        (pci_outl(PCII_CONFADD, PCII_SELREG_(bus, dev, func, reg)), \
39
        pci_outb(PCII_CONFDATA+((reg)&3), (val)))
40
#define PCII_WREG16_(bus, dev, func, reg, val) \
41
        (pci_outl(PCII_CONFADD, PCII_SELREG_(bus, dev, func, reg)), \
42
        pci_outw(PCII_CONFDATA+((reg)&2), (val)))
43
#define PCII_WREG32_(bus, dev, func, reg, val) \
44
        (pci_outl(PCII_CONFADD, PCII_SELREG_(bus, dev, func, reg)), \
45
        pci_outl(PCII_CONFDATA, (val)))
46
47
/* PIIX configuration registers */
48
#define PIIX_PIRQRCA        0x60
49
#define         PIIX_IRQ_DI        0x80
50
#define         PIIX_IRQ_MASK        0x0F
51
52
/* PIIX extensions to the PIC */
53
#define PIIX_ELCR1        0x4D0
54
#define PIIX_ELCR2        0x4D1
55
56
/*
57
 * $PchId: pci_intel.h,v 1.1 2000/08/12 11:20:17 philip Exp $
58
 */