1 /* SPDX-License-Identifier: GPL-2.0-or-later */
4 Name (_HID, EisaId("PNP0A08")) /* PCI Express Bus */
5 Name (_CID, EisaId("PNP0A03")) /* PCI Bus */
9 Name (_ADR, 0x00000000) /* Device 0 Function 0 */
11 OperationRegion (MCHP, PCI_Config, 0x00, 0x100)
12 Field (MCHP, DWordAcc, NoLock, Preserve)
14 Offset (0x60), /* PCIEXBAR (0:0:0:60) */
16 PXSZ, 2, /* PCI Express Size */
18 PXBR, 11, /* PCI Express Base Address */
20 Offset (0xbc), /* TOLUD (0:0:0:bc) */
22 TLUD, 12, /* Top of Lower Usable DRAM */
26 External (A4GS, IntObj)
27 External (A4GB, IntObj)
29 /* Current Resource Settings */
30 Method (_CRS, 0, Serialized)
32 Name (MCRS, ResourceTemplate ()
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)
50 * Descriptor: Legacy VGA video RAM
54 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
56 0x00000000, 0x000a0000, 0x000bffff, 0x00000000,
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.
65 DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
66 NonCacheable, ReadWrite,
67 0x00000000, 0x00000000, 0x00000000, 0x00000000,
71 * PCI Memory Region above 4 GiB
72 * (TOUUD - (TOUUD + ABOVE_4G_MMIO_SIZE))
74 QWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed,
75 NonCacheable, ReadWrite,
76 0x00000000, 0x00010000, 0x0001ffff, 0x00000000,
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 */
95 CreateQwordField (MCRS, PM02._LEN, MSEN)
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 */
104 MMAX = MMIN + MLEN - 1
110 Device (PDRC) /* PCI Device Resource Consumption */
112 Name (_HID, EisaId("PNP0C02"))
115 Method (_CRS, 0, Serialized)
117 Name (BUF0, ResourceTemplate ()
119 /* Local APIC range (0xfee0_0000 to 0xfeef_ffff) */
120 Memory32Fixed (ReadOnly, 0x0fee00000, 0x00010000, LIOH)
128 #include <drivers/intel/gma/acpi/gfx.asl>