mb/starlabs/{lite_adl,byte_adl}: Don't select MAINBOARD_HAS_TPM2
[coreboot2.git] / src / soc / intel / alderlake / acpi / scs.asl
blobd39c66d83b91dfbc169c3a9e6fa908d17cbd9b9c
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <soc/pcr_ids.h>
5 #define PMCR_D0_MASK    0xFFFC
6 #define PMCR_D3_MASK    0x0003
8 Scope (\_SB.PCI0) {
10         /*
11          * Clear register 0x1C20/0x4820
12          * Arg0 - PCR Port ID
13          */
14         Method(SCSC, 1, Serialized)
15         {
16                 PCRA (Arg0, 0x1C20, 0x0)
17                 PCRA (Arg0, 0x4820, 0x0)
18         }
20         /* EMMC */
21         Device(EMMC) {
22                 Name(_ADR, 0x001A0000)
23                 Name (_DDN, "eMMC Controller")
24                 Name(TEMP, 0)
26                 OperationRegion(SCSR, PCI_Config, 0x00, 0x100)
27                 Field(SCSR, WordAcc, NoLock, Preserve) {
28                         Offset (0x84),  /* PMECTRLSTATUS */
29                         PMCR, 16,
30                         Offset (0xA2),  /* PG_CONFIG */
31                         , 2,
32                         PGEN, 1,        /* PG_ENABLE */
33                 }
35                 Method(_INI) {
36                         /*
37                          * Clear eMMC timeout registers. _PS0 is not called by kernel when
38                          * boot source is not eMMC, but OS still initializes eMMC. So disable
39                          * timeout registers when boot source is not eMMC. Ported from CB:25290.
40                          */
41                         SCSC (PID_EMMC)
42                 }
44                 Method(_PS0, 0, Serialized) {
45                         Stall (50)      /* Sleep 50 us */
47                         PGEN = 0        /* Disable PG */
49                         /* Clear register 0x1C20/0x4820 */
50                         SCSC (PID_EMMC)
52                         /* Set Power State to D0 */
53                         PMCR &= PMCR_D0_MASK
54                         /* Additional config read to eMMC controller. Ported from CB:23312 */
55                         TEMP = PMCR
56                 }
58                 Method(_PS3, 0, Serialized) {
59                         PGEN = 1        /* Enable PG */
61                         /* Set Power State to D3 */
62                         PMCR |= PMCR_D3_MASK
63                         /* Additional config read to eMMC controller. Ported from CB:23312 */
64                         TEMP = PMCR
65                 }
67                 Device (CARD)
68                 {
69                         Name (_ADR, 0x00000008)
70                         Method (_RMV, 0, NotSerialized)
71                         {
72                                 Return (0)
73                         }
74                 }
75         }