blob: 10f25a1ef89b907118d7ea34cc2aebafa8679ac4 [file] [log] [blame]
Angel Pons182dbde2020-04-02 23:49:05 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Kyösti Mälkkie8b4da22014-10-21 18:22:32 +03002
Martin Rothec23f042017-11-22 19:21:55 -07003/* System Bus */
Kyösti Mälkkie8b4da22014-10-21 18:22:32 +03004/* _SB.PCI0 */
5
6/* Operating System Capabilities Method */
7Method(_OSC,4)
8{
Kyösti Mälkkie8b4da22014-10-21 18:22:32 +03009 /* Check for proper PCI/PCIe UUID */
Elyes HAOUASb5a237d2020-09-30 13:03:26 +020010 If (Arg0 == ToUUID("33DB4D5B-1FF7-401C-9657-7441C03DD766"))
Kyösti Mälkkie8b4da22014-10-21 18:22:32 +030011 {
12 /* Let OS control everything */
13 Return (Arg3)
14 } Else {
Marc Jones1faa11e2018-08-15 22:17:45 -060015 CreateDWordField(Arg3,0,CDW1)
Elyes HAOUASb5a237d2020-09-30 13:03:26 +020016 CDW1 |= 4 // Unrecognized UUID
17 Return (Arg3)
Kyösti Mälkkie8b4da22014-10-21 18:22:32 +030018 }
19}
20
21/* Describe the Southbridge devices */
22
23/* 0:11.0 - SATA */
24Device(STCR) {
25 Name(_ADR, 0x00110000)
Kyösti Mälkkie8b4da22014-10-21 18:22:32 +030026} /* end STCR */
27
28/* 0:14.0 - SMBUS */
29Device(SBUS) {
30 Name(_ADR, 0x00140000)
31} /* end SBUS */
32
33#include "usb.asl"
34
35/* 0:14.2 - HD Audio */
Julius Wernercd49cce2019-03-05 16:53:33 -080036#if !CONFIG(SOUTHBRIDGE_AMD_PI_KERN)
Kyösti Mälkkie8b4da22014-10-21 18:22:32 +030037#include "audio.asl"
Marshall Dawson65804082016-10-31 14:17:46 -040038#endif
Kyösti Mälkkie8b4da22014-10-21 18:22:32 +030039
40/* 0:14.3 - LPC */
41#include "lpc.asl"
42
43/* 0:14.7 - SD Controller */
44Device(SDCN) {
45 Name(_ADR, 0x00140007)
46} /* end SDCN */
47
48Name(CRES, ResourceTemplate() {
49 /* Set the Bus number and Secondary Bus number for the PCI0 device
50 * The Secondary bus range for PCI0 lets the system
51 * know what bus values are allowed on the downstream
52 * side of this PCI bus if there is a PCI-PCI bridge.
Martin Roth26f97f92021-10-01 14:53:22 -060053 * PCI buses can have 256 secondary buses which
Kyösti Mälkkie8b4da22014-10-21 18:22:32 +030054 * range from [0-0xFF] but they do not need to be
55 * sequential.
56 */
57 WordBusNumber (ResourceProducer, MinFixed, MaxFixed, PosDecode,
58 0x0000, /* address granularity */
59 0x0000, /* range minimum */
60 0x00FF, /* range maximum */
61 0x0000, /* translation */
62 0x0100, /* length */
63 ,, PSB0) /* ResourceSourceIndex, ResourceSource, DescriptorName */
64
65 IO(Decode16, 0x0CF8, 0x0CF8, 1, 8)
66
67 WORDIO(ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
68 0x0000, /* address granularity */
69 0x0000, /* range minimum */
70 0x0CF7, /* range maximum */
71 0x0000, /* translation */
72 0x0CF8 /* length */
73 )
74 WORDIO(ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
75 0x0000, /* address granularity */
76 0x03B0, /* range minimum */
77 0x03DF, /* range maximum */
78 0x0000, /* translation */
79 0x0030 /* length */
80 )
81
82 WORDIO(ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
83 0x0000, /* address granularity */
84 0x0D00, /* range minimum */
85 0xFFFF, /* range maximum */
86 0x0000, /* translation */
87 0xF300 /* length */
88 )
89
90 Memory32Fixed(READONLY, 0x000A0000, 0x00020000, VGAM) /* VGA memory space */
91 Memory32Fixed(READONLY, 0x000C0000, 0x00020000, EMM1) /* Assume C0000-E0000 empty */
92
93 /* memory space for PCI BARs below 4GB */
94 Memory32Fixed(ReadOnly, 0x00000000, 0x00000000, MMIO)
95}) /* End Name(_SB.PCI0.CRES) */
96
97Method(_CRS, 0) {
98 /* DBGO("\\_SB\\PCI0\\_CRS\n") */
99 CreateDWordField(CRES, ^MMIO._BAS, MM1B)
100 CreateDWordField(CRES, ^MMIO._LEN, MM1L)
101
102 /*
103 * Declare memory between TOM1 and 4GB as available
104 * for PCI MMIO.
105 * Use ShiftLeft to avoid 64bit constant (for XP).
106 * This will work even if the OS does 32bit arithmetic, as
107 * 32bit (0x00000000 - TOM1) will wrap and give the same
108 * result as 64bit (0x100000000 - TOM1).
109 */
Elyes HAOUASb5a237d2020-09-30 13:03:26 +0200110 MM1B = TOM1
111 Local0 = 0x10000000 << 4
112 Local0 -= TOM1
113 MM1L = Local0
Kyösti Mälkkie8b4da22014-10-21 18:22:32 +0300114
Elyes HAOUASb5a237d2020-09-30 13:03:26 +0200115 Return (CRES) /* note to change the Name buffer */
Kyösti Mälkkie8b4da22014-10-21 18:22:32 +0300116} /* end of Method(_SB.PCI0._CRS) */
117
Julius Wernercd49cce2019-03-05 16:53:33 -0800118#if CONFIG(HUDSON_IMC_FWM)
Elyes HAOUAS99850602019-02-21 16:38:43 +0100119 /* TODO: It is unstable.
120 * might be fixed by restructuring
121 */
122 #include "acpi/AmdImc.asl" /* Hudson IMC function */
123#endif
124
Kyösti Mälkkie8b4da22014-10-21 18:22:32 +0300125/*
126 *
127 * FIRST METHOD CALLED UPON BOOT
128 *
129 * 1. If debugging, print current OS and ACPI interpreter.
130 * 2. Get PCI Interrupt routing from ACPI VSM, this
131 * value is based on user choice in BIOS setup.
132 */
133Method(_INI, 0) {
134 /* DBGO("\\_SB\\_INI\n") */
135 /* DBGO(" DSDT.ASL code from ") */
136 /* DBGO(__DATE__) */
137 /* DBGO(" ") */
138 /* DBGO(__TIME__) */
139 /* DBGO("\n Sleep states supported: ") */
140 /* DBGO("\n") */
141 /* DBGO(" \\_OS=") */
142 /* DBGO(\_OS) */
143 /* DBGO("\n \\_REV=") */
144 /* DBGO(\_REV) */
145 /* DBGO("\n") */
146
Kyösti Mälkkie8b4da22014-10-21 18:22:32 +0300147} /* End Method(_SB._INI) */