mb/starlabs/{lite_adl,byte_adl}: Don't select MAINBOARD_HAS_TPM2
[coreboot2.git] / src / soc / intel / apollolake / acpi / northbridge.asl
bloba304331f1d3f0a28e36f2e02cee3ccdfaa85f821
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
4 Name (_HID, EisaId("PNP0A08"))  /* PCI Express Bus */
5 Name (_CID, EisaId("PNP0A03"))  /* PCI Bus */
7 Device (MCHC)
9         Name (_ADR, 0x00000000)         /* Device 0 Function 0 */
11         OperationRegion (MCHP, PCI_Config, 0x00, 0x100)
12         Field (MCHP, DWordAcc, NoLock, Preserve)
13         {
14                 Offset (0x60),  /* PCIEXBAR (0:0:0:60) */
15                 PXEN,   1,      /* Enable */
16                 PXSZ,   2,      /* PCI Express Size */
17                     ,   25,
18                 PXBR,   11,     /* PCI Express Base Address */
20                 Offset (0xbc),  /* TOLUD (0:0:0:bc) */
21                     ,   20,
22                 TLUD,   12,     /* Top of Lower Usable DRAM */
23         }
26 External (A4GS, IntObj)
27 External (A4GB, IntObj)
29 /* Current Resource Settings */
30 Method (_CRS, 0, Serialized)
32         Name (MCRS, ResourceTemplate ()
33         {
34                 /* Bus Numbers */
35                 WordBusNumber (ResourceProducer, MinFixed, MaxFixed, PosDecode,
36                                 0x0000, 0x0000, 0x00ff, 0x0000, 0x0100)
38                 /* IO Region 0: 0x0000 - 0x0cf7 */
39                 DWordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
40                                 0x0000, 0x0000, 0x0cf7, 0x0000, 0x0cf8)
42                 /* PCI Config Space */
43                 Io (Decode16, 0x0cf8, 0x0cf8, 0x0001, 0x0008)
45                 /* IO Region 1: 0x1000 - 0xffff */
46                 DWordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
47                                 0x0000, 0x01000, 0xffff, 0x0000, 0xf000)
49                 /*
50                  * Descriptor:  Legacy VGA video RAM
51                  * Start:       0xa0000
52                  * End:         0xbffff
53                  */
54                 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
55                                 Cacheable, ReadWrite,
56                                 0x00000000, 0x000a0000, 0x000bffff, 0x00000000,
57                                 0x00020000,,,)
59                 /*
60                  * PCI MMIO Region (TOLUD - PCI extended base MMCONF)
61                  * This assumes that MMCONF is placed after PCI config space,
62                  * and that no resources are allocated after the MMCONF region.
63                  * This works, since MMCONF is hardcoded to 0xe00000000.
64                  */
65                 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
66                                 NonCacheable, ReadWrite,
67                                 0x00000000, 0x00000000, 0x00000000, 0x00000000,
68                                 0x00000000,,, PM01)
70                 /*
71                  * PCI Memory Region above 4 GiB
72                  * (TOUUD - (TOUUD + ABOVE_4G_MMIO_SIZE))
73                  */
74                 QWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
75                                 NonCacheable, ReadWrite,
76                                 0x00000000, 0x00010000, 0x0001ffff, 0x00000000,
77                                 0x00010000,,, PM02)
78         })
80         /* Find PCI resource area in MCRS */
81         CreateDwordField (MCRS, PM01._MIN, PMIN)
82         CreateDwordField (MCRS, PM01._MAX, PMAX)
83         CreateDwordField (MCRS, PM01._LEN, PLEN)
85         /* Read C-Unit PCI CFG Reg. 0xBC for TOLUD (shadow from B-Unit) */
86         PMIN = ^MCHC.TLUD << 20
87         /* Use PCR base to ensure PMAX below GPIO controllers attached to _SB */
88         PMAX = CONFIG_PCR_BASE_ADDRESS & 0xF0000000
90         /* Calculate PCI MMIO Length */
91         PLEN = PMAX - PMIN + 1
93         /* Patch PM02 range based on Memory Size */
94         If (A4GS == 0) {
95                 CreateQwordField (MCRS, PM02._LEN, MSEN)
96                 MSEN = 0
97         } Else {
98                 CreateQwordField (MCRS, PM02._MIN, MMIN)
99                 CreateQwordField (MCRS, PM02._MAX, MMAX)
100                 CreateQwordField (MCRS, PM02._LEN, MLEN)
101                 /* Set 64bit MMIO resource base and length */
102                 MLEN = A4GS
103                 MMIN = A4GB
104                 MMAX = MMIN + MLEN - 1
105         }
107         Return (MCRS)
110 Device (PDRC)   /* PCI Device Resource Consumption */
112         Name (_HID, EisaId("PNP0C02"))
113         Name (_UID, 1)
115         Method (_CRS, 0, Serialized)
116         {
117                 Name (BUF0, ResourceTemplate ()
118                 {
119                         /* Local APIC range (0xfee0_0000 to 0xfeef_ffff) */
120                         Memory32Fixed (ReadOnly, 0x0fee00000, 0x00010000, LIOH)
121                 })
123                 Return (BUF0)
124         }
127 /* GFX 00:02.0 */
128 #include <drivers/intel/gma/acpi/gfx.asl>