mb/google/nissa/var/rull: Configure Acoustic noise mitigation
[coreboot2.git] / src / ec / google / chromeec / acpi / cros_ec.asl
blob9cf1f66fb27038497d333be40abd75a4233d3208
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #if CONFIG(EC_GOOGLE_CHROMEEC_LPC_GENERIC_MEMORY_RANGE)
4 #define LPC_GMR_SIZE 0x10000
5 #endif
7 Device (CREC)
9         Name (_HID, "GOOG0004")
10         Name (_UID, 1)
11         Name (_DDN, "EC Command Device")
12 #ifdef EC_ENABLE_WAKE_PIN
13 #ifndef EC_ENABLE_SYNC_IRQ_GPIO
14         Name (_PRW, Package () { EC_ENABLE_WAKE_PIN, 0x5 })
15 #else
16 #define EC_SYNC_IRQ_WAKE_CAPABLE
17 #endif
18 #endif
20 #ifdef EC_SYNC_IRQ_WAKE_CAPABLE
21         #define EC_SYNC_SHARE_TYPE ExclusiveAndWake
22 #else
23         #define EC_SYNC_SHARE_TYPE Exclusive
24 #endif
26 #if defined(EC_ENABLE_SYNC_IRQ) || defined(EC_ENABLE_SYNC_IRQ_GPIO)
27         Method (_CRS, 0x0, NotSerialized)
28         {
29                 Name (RBUF, ResourceTemplate()
30                 {
31 #ifdef EC_ENABLE_SYNC_IRQ
32                         Interrupt (ResourceConsumer, Level, ActiveLow, EC_SYNC_SHARE_TYPE) { EC_SYNC_IRQ }
33 #endif
35 #ifdef EC_ENABLE_SYNC_IRQ_GPIO
36                         GpioInt (Level, ActiveLow, EC_SYNC_SHARE_TYPE, PullDefault,
37                                  0x0000, "\\_SB.GPIO", 0x00, ResourceConsumer, ,)
38                         {
39                                 EC_SYNC_IRQ
40                         }
41 #endif
43 #if CONFIG(EC_GOOGLE_CHROMEEC_LPC_GENERIC_MEMORY_RANGE)
44                 Memory32Fixed (ReadWrite, 0, 0, MADR)
45 #endif
46                 })
48 #if CONFIG(EC_GOOGLE_CHROMEEC_LPC_GENERIC_MEMORY_RANGE)
49                 CreateDWordField (RBUF, MADR._BAS, BAS0)
50                 CreateDWordField (RBUF, MADR._LEN, LEN0)
51                 BAS0 = \_SB.PCI0.LPCB.GLGM()
52                 LEN0 = LPC_GMR_SIZE
53 #endif
54                 Return (RBUF)
55         }
56 #endif
58 #ifdef EC_ENABLE_MKBP_DEVICE
59         Device (CKSC)
60         {
61                 Name (_HID, "GOOG0007")
62                 Name (_UID, 1)
63                 Name (_DDN, "EC MKBP Device")
64         }
65 #endif
67 #ifdef EC_ENABLE_CBAS_DEVICE
68         Device (CBAS)
69         {
70                 Name (_HID, "GOOG000B")
71                 Name (_UID, 1)
72                 Name (_DDN, "EC Base Switch Device")
73         }
74 #endif
76 #ifdef EC_ENABLE_PD_MCU_DEVICE
77         #include "pd.asl"
78 #endif
80 #ifdef EC_ENABLE_TBMC_DEVICE
81         #include "tbmc.asl"
82 #endif
84         Method(_STA, 0)
85         {
86                 Return (0xF)
87         }
89 #if CONFIG(DRIVERS_ACPI_THERMAL_ZONE)
90         Method(TMP, 1)
91         {
92                 Return(^^TSRD(Arg0))
93         }
94 #endif