1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 #include <intelblocks/pcr.h>
4 #include <soc/pcr_ids.h>
11 Name (_HID, GPIO_COMM_NAME)
12 Name (_CID, GPIO_COMM_NAME)
13 Name (_DDN, GPIO_COMM_0_DESC)
16 Name (RBUF, ResourceTemplate ()
18 Memory32Fixed (ReadWrite, 0, 0x4000, RMEM)
19 Interrupt (ResourceConsumer, Level, ActiveLow, Shared, , , )
25 Method (_CRS, 0x0, NotSerialized)
27 CreateDwordField (^RBUF, ^RMEM._BAS, RBAS)
28 Local0 = GPIO_COMM0_PID << PCR_PORTID_SHIFT
29 RBAS = CONFIG_PCR_BASE_ADDRESS | Local0
33 Method (_STA, 0x0, NotSerialized)
41 Name (_HID, GPIO_COMM_NAME)
42 Name (_CID, GPIO_COMM_NAME)
43 Name (_DDN, GPIO_COMM_1_DESC)
46 Name (RBUF, ResourceTemplate ()
48 Memory32Fixed (ReadWrite, 0, 0x4000, RMEM)
49 Interrupt (ResourceConsumer, Level, ActiveLow, Shared, , , )
55 Method (_CRS, 0x0, NotSerialized)
57 CreateDwordField (^RBUF, ^RMEM._BAS, RBAS)
58 Local0 = GPIO_COMM1_PID << PCR_PORTID_SHIFT
59 RBAS = CONFIG_PCR_BASE_ADDRESS | Local0
63 Method (_STA, 0x0, NotSerialized)
71 Name (_HID, GPIO_COMM_NAME)
72 Name (_CID, GPIO_COMM_NAME)
73 Name (_DDN, GPIO_COMM_2_DESC)
76 Name (RBUF, ResourceTemplate ()
78 Memory32Fixed (ReadWrite, 0, 0x4000, RMEM)
79 Interrupt (ResourceConsumer, Level, ActiveLow, Shared, , , )
85 Method (_CRS, 0x0, NotSerialized)
87 CreateDwordField (^RBUF, ^RMEM._BAS, RBAS)
88 Local0 = GPIO_COMM2_PID << PCR_PORTID_SHIFT
89 RBAS = CONFIG_PCR_BASE_ADDRESS | Local0
93 Method (_STA, 0x0, NotSerialized)
101 Name (_HID, GPIO_COMM_NAME)
102 Name (_CID, GPIO_COMM_NAME)
103 Name (_DDN, GPIO_COMM_3_DESC)
106 Name (RBUF, ResourceTemplate ()
108 Memory32Fixed (ReadWrite, 0, 0x4000, RMEM)
109 Interrupt (ResourceConsumer, Level, ActiveLow, Shared, , , )
115 Method (_CRS, 0x0, NotSerialized)
117 CreateDwordField (^RBUF, ^RMEM._BAS, RBAS)
118 Local0 = GPIO_COMM3_PID << PCR_PORTID_SHIFT
119 RBAS = CONFIG_PCR_BASE_ADDRESS | Local0
123 Method (_STA, 0x0, NotSerialized)
131 * Note: PERST is Active High
133 Method (PRAS, 0x1, Serialized)
137 * local1 - to toggle Tx pin of Dw0
138 * local2 - Address of PERST
141 Local1 = \_SB.GPC0 (Local2)
142 Local1 |= PAD_CFG0_TX_STATE
143 \_SB.SPC0 (Local2, Local1)
146 /* PERST DE-Assertion */
147 Method (PRDA, 0x1, Serialized)
151 * local1 - to toggle Tx pin of Dw0
152 * local2 - Address of PERST
155 Local1 = \_SB.GPC0 (Local2)
156 Local1 &= ~PAD_CFG0_TX_STATE
157 \_SB.SPC0 (Local2, Local1)
162 * Sleep button device ASL code. We are using this device to
163 * add the _PRW method for a dummy wake event to kernel so that
164 * before going to sleep kernel does not clear bit 15 in ACPI
165 * gpe0a enable register which is actually the GPIO_TIER1_SCI_EN bit.
169 Name (_HID, EisaId ("PNP0C0E"))
171 Name (_PRW, Package() { GPE0A_GPIO_TIER1_SCI_STS, 0x3 })
178 * Dummy method for the Tier 1 GPIO SCI enable bit. When kernel reads
179 * _L0F in scope GPE it sets bit for gpio_tier1_sci_en in ACPI enable
180 * register at 0x430. For APL ACPI enable register DW0 i.e., ACPI
181 * GPE0a_EN at 0x430 is reserved.