blob: 12555e23eb2c6460fb3a351d106a91b599f55984 [file] [log] [blame]
Michael S. Tsirkinc9737882011-11-20 19:56:59 +02001ACPI_EXTRACT_ALL_CODE ssdp_pcihp_aml
2
3DefinitionBlock ("ssdt-pcihp.aml", "SSDT", 0x01, "BXPC", "BXSSDTPCIHP", 0x1)
4{
5
6/****************************************************************
7 * PCI hotplug
8 ****************************************************************/
9
10 /* Objects supplied by DSDT */
11 External (\_SB.PCI0, DeviceObj)
Michael S. Tsirkinc9737882011-11-20 19:56:59 +020012 External (\_SB.PCI0.PCEJ, MethodObj)
13
14 Scope(\_SB.PCI0) {
Michael S. Tsirkinc9737882011-11-20 19:56:59 +020015 /* Bulk generated PCI hotplug devices */
Michael S. Tsirkin5a73f3b2011-11-20 19:57:05 +020016 // Method _EJ0 can be patched by BIOS to EJ0_
17 // at runtime, if the slot is detected to not support hotplug.
18 // Extract the offset of the address dword and the
19 // _EJ0 name to allow this patching.
Michael S. Tsirkinc9737882011-11-20 19:56:59 +020020#define hotplug_slot(slot) \
21 Device (S##slot) { \
Michael S. Tsirkin5a73f3b2011-11-20 19:57:05 +020022 ACPI_EXTRACT_NAME_DWORD_CONST aml_adr_dword \
Michael S. Tsirkinc9737882011-11-20 19:56:59 +020023 Name (_ADR, 0x##slot##0000) \
Michael S. Tsirkin5a73f3b2011-11-20 19:57:05 +020024 ACPI_EXTRACT_METHOD_STRING aml_ej0_name \
Michael S. Tsirkinc9737882011-11-20 19:56:59 +020025 Method (_EJ0, 1) { Return(PCEJ(0x##slot)) } \
26 Name (_SUN, 0x##slot) \
27 }
28
29 hotplug_slot(01)
30 hotplug_slot(02)
31 hotplug_slot(03)
32 hotplug_slot(04)
33 hotplug_slot(05)
34 hotplug_slot(06)
35 hotplug_slot(07)
36 hotplug_slot(08)
37 hotplug_slot(09)
38 hotplug_slot(0a)
39 hotplug_slot(0b)
40 hotplug_slot(0c)
41 hotplug_slot(0d)
42 hotplug_slot(0e)
43 hotplug_slot(0f)
44 hotplug_slot(10)
45 hotplug_slot(11)
46 hotplug_slot(12)
47 hotplug_slot(13)
48 hotplug_slot(14)
49 hotplug_slot(15)
50 hotplug_slot(16)
51 hotplug_slot(17)
52 hotplug_slot(18)
53 hotplug_slot(19)
54 hotplug_slot(1a)
55 hotplug_slot(1b)
56 hotplug_slot(1c)
57 hotplug_slot(1d)
58 hotplug_slot(1e)
59 hotplug_slot(1f)
60
61#define gen_pci_hotplug(slot) \
62 If (LEqual(Arg0, 0x##slot)) { Notify(S##slot, Arg1) }
63
64 Method(PCNT, 2) {
65 gen_pci_hotplug(01)
66 gen_pci_hotplug(02)
67 gen_pci_hotplug(03)
68 gen_pci_hotplug(04)
69 gen_pci_hotplug(05)
70 gen_pci_hotplug(06)
71 gen_pci_hotplug(07)
72 gen_pci_hotplug(08)
73 gen_pci_hotplug(09)
74 gen_pci_hotplug(0a)
75 gen_pci_hotplug(0b)
76 gen_pci_hotplug(0c)
77 gen_pci_hotplug(0d)
78 gen_pci_hotplug(0e)
79 gen_pci_hotplug(0f)
80 gen_pci_hotplug(10)
81 gen_pci_hotplug(11)
82 gen_pci_hotplug(12)
83 gen_pci_hotplug(13)
84 gen_pci_hotplug(14)
85 gen_pci_hotplug(15)
86 gen_pci_hotplug(16)
87 gen_pci_hotplug(17)
88 gen_pci_hotplug(18)
89 gen_pci_hotplug(19)
90 gen_pci_hotplug(1a)
91 gen_pci_hotplug(1b)
92 gen_pci_hotplug(1c)
93 gen_pci_hotplug(1d)
94 gen_pci_hotplug(1e)
95 gen_pci_hotplug(1f)
96 }
97 }
Gleb Natapovd51c4a02012-05-20 12:03:40 +030098
99 Scope(\) {
100/****************************************************************
101 * Suspend
102 ****************************************************************/
103
104 /*
105 * S3 (suspend-to-ram), S4 (suspend-to-disk) and S5 (power-off) type codes:
106 * must match piix4 emulation.
107 */
108
109 ACPI_EXTRACT_NAME_STRING acpi_s3_name
110 Name (_S3, Package (0x04)
111 {
112 One, /* PM1a_CNT.SLP_TYP */
113 One, /* PM1b_CNT.SLP_TYP */
114 Zero, /* reserved */
115 Zero /* reserved */
116 })
117 ACPI_EXTRACT_NAME_STRING acpi_s4_name
118 ACPI_EXTRACT_PKG_START acpi_s4_pkg
119 Name (_S4, Package (0x04)
120 {
121 0x2, /* PM1a_CNT.SLP_TYP */
122 0x2, /* PM1b_CNT.SLP_TYP */
123 Zero, /* reserved */
124 Zero /* reserved */
125 })
126 Name (_S5, Package (0x04)
127 {
128 Zero, /* PM1a_CNT.SLP_TYP */
129 Zero, /* PM1b_CNT.SLP_TYP */
130 Zero, /* reserved */
131 Zero /* reserved */
132 })
133 }
Michael S. Tsirkinc9737882011-11-20 19:56:59 +0200134}