util/sconfig: Remove unused ioapic and irq keywords
[coreboot.git] / src / southbridge / intel / lynxpoint / acpi / gpio.asl
bloba673b256048483ed454ac71d1aa660475bbcdc73
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 Device (GPIO)
5         // GPIO Controller
6         Name (_HID, "INT33C7")
7         Name (_CID, "INT33C7")
8         Name (_UID, 1)
10         Name (RBUF, ResourceTemplate ()
11         {
12                 DWordIo (ResourceProducer,
13                         MinFixed,    // IsMinFixed
14                         MaxFixed,    // IsMaxFixed
15                         PosDecode,   // Decode
16                         EntireRange, // ISARanges
17                         0x00000000,  // AddressGranularity
18                         0x00000000,  // AddressMinimum
19                         0x00000000,  // AddressMaximum
20                         0x00000000,  // AddressTranslation
21                         0x00000000,  // RangeLength
22                         ,            // ResourceSourceIndex
23                         ,            // ResourceSource
24                         BAR0)
25                 // Disabled due to IRQ storm: http://crosbug.com/p/29548
26                 //Interrupt (ResourceConsumer,
27                 //      Level, ActiveHigh, Shared, , , ) {14}
28         })
30         Method (_CRS, 0, NotSerialized)
31         {
32                 CreateDwordField (^RBUF, ^BAR0._MIN, BMIN)
33                 CreateDwordField (^RBUF, ^BAR0._MAX, BMAX)
34                 CreateDwordField (^RBUF, ^BAR0._LEN, BLEN)
36                 BLEN = DEFAULT_GPIOSIZE
37                 BMIN = DEFAULT_GPIOBASE
38                 BMAX = DEFAULT_GPIOBASE + DEFAULT_GPIOSIZE - 1
40                 Return (RBUF)
41         }
43         Method (_STA, 0, NotSerialized)
44         {
45                 Return (0xF)
46         }
48         // GWAK: Setup GPIO as ACPI GPE for Wake
49         // Arg0: GPIO Number
50         Method (GWAK, 1, Serialized)
51         {
52                 // Local0 = GPIO Base Address
53                 Local0 = GPBS & ~1
55                 // Local1 = BANK, Local2 = OFFSET
56                 Local2 = Arg0 % 32
57                 Local1 = Arg0 / 32
59                 //
60                 // Set OWNER to ACPI
61                 //
63                 // Local3 = GPIOBASE + GPIO_OWN(BANK)
64                 Local3 = Local0 + Local1 * 4
66                 // GPIO_OWN(BANK)
67                 OperationRegion (IOWN, SystemIO, Local3, 4)
68                 Field (IOWN, AnyAcc, NoLock, Preserve) {
69                         GOWN, 32,
70                 }
72                 // GPIO_OWN[GPIO] = 0 (ACPI)
73                 GOWN &= ~(1 << Local2)
75                 //
76                 // Set ROUTE to SCI
77                 //
79                 // Local3 = GPIOBASE + GPIO_ROUTE(BANK)
80                 Local3 = Local0 + 0x30 + Local1 * 4
82                 // GPIO_ROUTE(BANK)
83                 OperationRegion (IROU, SystemIO, Local3, 4)
84                 Field (IROU, AnyAcc, NoLock, Preserve) {
85                         GROU, 32,
86                 }
88                 // GPIO_ROUTE[GPIO] = 0 (SCI)
89                 GROU &= ~(1 << Local2)
91                 //
92                 // Set GPnCONFIG to GPIO|INPUT|INVERT
93                 //
95                 // Local3 = GPIOBASE + GPnCONFIG0(GPIO)
96                 Local3  = Local0 + 0x100 + Arg0 * 8
98                 // GPnCONFIG(GPIO)
99                 OperationRegion (GPNC, SystemIO, Local3, 8)
100                 Field (GPNC, AnyAcc, NoLock, Preserve) {
101                         GMOD, 1,  // MODE:   0=NATIVE 1=GPIO
102                         , 1,
103                         GIOS, 1,  // IO_SEL: 0=OUTPUT 1=INPUT
104                         GINV, 1,  // INVERT: 0=NORMAL 1=INVERT
105                         GLES, 1,  // LxEB:   0=EDGE 1=LEVEL
106                         , 24,
107                         ILVL, 1,  // INPUT:  0=LOW 1=HIGH
108                         OLVL, 1,  // OUTPUT: 0=LOW 1=HIGH
109                         GPWP, 2,  // PULLUP: 00=NONE 01=DOWN 10=UP 11=INVALID
110                         ISEN, 1,  // SENSE:  0=ENABLE 1=DISABLE
111                 }
113                 GMOD = 1 // GPIO
114                 GIOS = 1 // INPUT
115                 GINV = 1 // INVERT
116         }