payloads/edk2: Disable the CPU Timer Lib unless supported
[coreboot.git] / src / superio / winbond / w83667hg-a / ps2_controller.asl
blob172a63c4c6a84091d9f9832cc03fa52cac837aeb
1 /* SPDX-License-Identifier: GPL-2.0-only */
3         /* SuperIO control port */
4         Name (SPIO, 0x2E)
6         /* SuperIO control map */
7         OperationRegion (SPIM, SystemIO, SPIO, 0x02)
8                 Field (SPIM, ByteAcc, NoLock, Preserve) {
9                 SIOI, 8,
10                 SIOD, 8
11         }
13         /* SuperIO control registers */
14         IndexField (SIOI, SIOD, ByteAcc, NoLock, Preserve) {
15                 Offset (0x2A),
16                 CR2A, 8,                /* Pin function selection */
17         }
19         Device (PS2K)           // Keyboard
20         {
21                 Name(_HID, EISAID("PNP0303"))
22                 Name(_CID, EISAID("PNP030B"))
24                 Name(_CRS, ResourceTemplate()
25                 {
26                         IO (Decode16, 0x60, 0x60, 0x01, 0x01)
27                         IO (Decode16, 0x64, 0x64, 0x01, 0x01)
28                         IRQ (Edge, ActiveHigh, Exclusive) { 0x01 } // IRQ 1
29                 })
31                 Method (_STA, 0)
32                 {
33                         Return (0xf)
34                 }
35         }
37         Device (PS2M)           // Mouse
38         {
39                 Name(_HID, EISAID("PNP0F13"))
40                 Name(_CRS, ResourceTemplate()
41                 {
42                         IRQ (Edge, ActiveHigh, Exclusive) { 0x0c } // IRQ 12
43                 })
45                 Method(_STA, 0)
46                 {
47                         /* Access SuperIO ACPI device */
48                         Store(0x87, SIOI)
49                         Store(0x87, SIOI)
51                         /* Read Pin56 function select */
52                         And(CR2A, 0x2, Local0)
54                         /* Restore default SuperIO access */
55                         Store(0xAA, SIOI)
57                         if (Local0 == 0) {
58                                 /* Mouse function selected */
59                                 Return (0xf)
60                         }
61                         Return (0x0)
62                 }
63         }