2013-07-24 19:56:02 +04:00
|
|
|
/*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program; if not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
ACPI_EXTRACT_ALL_CODE ssdp_pcihp_aml
|
|
|
|
|
|
|
|
DefinitionBlock ("ssdt-pcihp.aml", "SSDT", 0x01, "BXPC", "BXSSDTPCIHP", 0x1)
|
|
|
|
{
|
|
|
|
|
|
|
|
/****************************************************************
|
|
|
|
* PCI hotplug
|
|
|
|
****************************************************************/
|
|
|
|
|
|
|
|
/* Objects supplied by DSDT */
|
|
|
|
External(\_SB.PCI0, DeviceObj)
|
|
|
|
External(\_SB.PCI0.PCEJ, MethodObj)
|
2013-10-14 19:01:29 +04:00
|
|
|
External(BSEL, IntObj)
|
2013-07-24 19:56:02 +04:00
|
|
|
|
|
|
|
Scope(\_SB.PCI0) {
|
|
|
|
|
|
|
|
/* Bulk generated PCI hotplug devices */
|
|
|
|
ACPI_EXTRACT_DEVICE_START ssdt_pcihp_start
|
|
|
|
ACPI_EXTRACT_DEVICE_END ssdt_pcihp_end
|
|
|
|
ACPI_EXTRACT_DEVICE_STRING ssdt_pcihp_name
|
|
|
|
|
2013-10-14 19:01:29 +04:00
|
|
|
// Extract the offsets of the device name, address dword and the slot
|
|
|
|
// name byte - we fill them in for each device.
|
2013-07-24 19:56:02 +04:00
|
|
|
Device(SAA) {
|
|
|
|
ACPI_EXTRACT_NAME_BYTE_CONST ssdt_pcihp_id
|
|
|
|
Name(_SUN, 0xAA)
|
|
|
|
ACPI_EXTRACT_NAME_DWORD_CONST ssdt_pcihp_adr
|
|
|
|
Name(_ADR, 0xAA0000)
|
|
|
|
Method(_EJ0, 1) {
|
2013-10-14 19:01:29 +04:00
|
|
|
PCEJ(BSEL, _SUN)
|
2013-07-24 19:56:02 +04:00
|
|
|
}
|
|
|
|
}
|
2013-10-14 19:01:29 +04:00
|
|
|
|
acpi-build: append description for non-hotplug
As reported in
http://article.gmane.org/gmane.comp.emulators.qemu/253987
Mac OSX actually requires describing all occupied slots
in ACPI - even if hotplug isn't enabled.
I didn't expect this so I dropped description of all
non hotpluggable slots from ACPI.
As a result: before
commit 99fd437dee468609de8218f0eb3b16621fb6a9c9 (enable
hotplug for pci bridges), PCI cards show up in the "device tree" of OS X
(System Information). E.g., on MountainLion users have:
Hardware -> PCI Cards:
Card Type Driver Installed Slot
*ethernet Ethernet Controller Yes PCI Slot 2
pci8086,2934 USB UHC Yes PCI Slot 29
ethernet:
Type: Ethernet Controller
Driver Installed: Yes
MSI: No
Bus: PCI
Slot PCI Slot 2
Vendor ID: 0x8086
Device ID: 0x100e
Subsystem Vendor ID: 0x1af4
Subsystem ID: 0x1100
Revision ID: 0x0003
Hardware -> Ethernet Cards
ethernet:
Type: Ethernet Controller
Bus: PCI
Slot PCI Slot 2
Vendor ID: 0x8086
Device ID: 0x100e
Subsystem Vendor ID: 0x1af4
Subsystem ID: 0x1100
Revision ID: 0x0003
BSD name: en0
Kext name: AppleIntel8254XEthernet.kext
Location: /System/Library/Extensions/...
Version: 3.1.1b1
After commit 99fd437dee468609de8218f0eb3b16621fb6a9c9, users get:
Hardware -> PCI Cards:
This computer doesn't contain any PCI cards. If you installed PCI
cards, make sure they're properly installed.
Hardware -> Ethernet Cards
ethernet:
Type: Ethernet Controller
Bus: PCI
Vendor ID: 0x8086
Device ID: 0x100e
Subsystem Vendor ID: 0x1af4
Subsystem ID: 0x1100
Revision ID: 0x0003
BSD name: en0
Kext name: AppleIntel8254XEthernet.kext
Location: /System/Library/Extensions/...
Version: 3.1.1b1
Ethernet still works, but it's not showing up on the PCI bus, and it
no longer thinks it's plugged in to slot #2, as it used to before the
change.
To fix, append description for all occupied non hotpluggable PCI slots.
One need to be careful when doing this: VGA devices
are now described in SSDT, so we need to drop description from DSDT.
And ISA devices are used in DSDT so drop them from SSDT.
Reported-by: Gabriel L. Somlo <gsomlo@gmail.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Also update generated dsdt and pcihp hex dump files.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2014-02-04 19:43:47 +04:00
|
|
|
ACPI_EXTRACT_DEVICE_START ssdt_pcinohp_start
|
|
|
|
ACPI_EXTRACT_DEVICE_END ssdt_pcinohp_end
|
|
|
|
ACPI_EXTRACT_DEVICE_STRING ssdt_pcinohp_name
|
|
|
|
|
|
|
|
// Extract the offsets of the device name, address dword and the slot
|
|
|
|
// name byte - we fill them in for each device.
|
|
|
|
Device(SBB) {
|
|
|
|
ACPI_EXTRACT_NAME_DWORD_CONST ssdt_pcinohp_adr
|
|
|
|
Name(_ADR, 0xAA0000)
|
|
|
|
}
|
|
|
|
|
|
|
|
ACPI_EXTRACT_DEVICE_START ssdt_pcivga_start
|
|
|
|
ACPI_EXTRACT_DEVICE_END ssdt_pcivga_end
|
|
|
|
ACPI_EXTRACT_DEVICE_STRING ssdt_pcivga_name
|
|
|
|
|
|
|
|
// Extract the offsets of the device name, address dword and the slot
|
|
|
|
// name byte - we fill them in for each device.
|
|
|
|
Device(SCC) {
|
|
|
|
ACPI_EXTRACT_NAME_DWORD_CONST ssdt_pcivga_adr
|
|
|
|
Name(_ADR, 0xAA0000)
|
|
|
|
Method(_S1D, 0, NotSerialized) {
|
|
|
|
Return (0x00)
|
|
|
|
}
|
|
|
|
Method(_S2D, 0, NotSerialized) {
|
|
|
|
Return (0x00)
|
|
|
|
}
|
|
|
|
Method(_S3D, 0, NotSerialized) {
|
|
|
|
Return (0x00)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ACPI_EXTRACT_DEVICE_START ssdt_pciqxl_start
|
|
|
|
ACPI_EXTRACT_DEVICE_END ssdt_pciqxl_end
|
|
|
|
ACPI_EXTRACT_DEVICE_STRING ssdt_pciqxl_name
|
|
|
|
|
|
|
|
// Extract the offsets of the device name, address dword and the slot
|
|
|
|
// name byte - we fill them in for each device.
|
|
|
|
Device(SDD) {
|
|
|
|
ACPI_EXTRACT_NAME_DWORD_CONST ssdt_pciqxl_adr
|
|
|
|
Name(_ADR, 0xAA0000)
|
|
|
|
Method(_S1D, 0, NotSerialized) {
|
|
|
|
Return (0x00)
|
|
|
|
}
|
|
|
|
Method(_S2D, 0, NotSerialized) {
|
|
|
|
Return (0x00)
|
|
|
|
}
|
|
|
|
Method(_S3D, 0, NotSerialized) {
|
|
|
|
Return (0x03) // QXL
|
|
|
|
}
|
|
|
|
}
|
2013-07-24 19:56:02 +04:00
|
|
|
}
|
|
|
|
}
|