On Thu, Dec 06, 2012 at 06:07:20PM +0100, Gerd Hoffmann wrote:
If I could figure out how to write a reliable _STA method for the SMC, that would detect whether or not it was supplied as "-device applesmc" on the qemu command line, I think we might be on to something...
I've tried something simliar, but simply using the _STA method of the hpet. That somehow hints our hpet _STA method isn't working reliable on windows xp. I'll go to digg, but that has to wait until tomorrow.
Meanwhile, here's more iteration/datapoint: In the patch below, I'm checking for the *existence* of the SMC rather than attempting to evaluate its _STA. If it exists, we're on a "mac" and therefore should have IRQNoFlags. Otherwise, leave it out and make everyone else happy.
Although having a permanent SMC node and using its _STA method would be much nicer, if I ever figure out fw_cfg per Alex's sugestion :)
Thanks, --Gabriel
diff --git a/src/acpi-dsdt-hpet.dsl b/src/acpi-dsdt-hpet.dsl index d5aa3f1..9022027 100644 --- a/src/acpi-dsdt-hpet.dsl +++ b/src/acpi-dsdt-hpet.dsl @@ -23,12 +23,23 @@ Scope(_SB) { } Return (0x0F) } - Name(_CRS, ResourceTemplate() { - IRQNoFlags() {2, 8} + Name(RESP, ResourceTemplate() { Memory32Fixed(ReadOnly, 0xFED00000, // Address Base 0x00000400, // Address Length ) }) + Name(RESI, ResourceTemplate() { + IRQNoFlags() {0, 8} + }) + Method(_CRS, 0) { + If (CondRefOf(_SB.PCI0.ISA.SMC, Local0)) { + /* AppleSMC present, add IRQ resource */ + ConcatenateResTemplate(RESP, RESI, Local1) + Return (Local1) + } else { + Return (RESP) + } + } } } diff --git a/src/acpi-dsdt-isa.dsl b/src/acpi-dsdt-isa.dsl index 23761db..581edde 100644 --- a/src/acpi-dsdt-isa.dsl +++ b/src/acpi-dsdt-isa.dsl @@ -1,6 +1,17 @@ /* Common legacy ISA style devices. */ Scope(_SB.PCI0.ISA) {
+// Device (SMC) { +// Name(_HID, EisaId("APP0001")) +// Method(_STA, 0) { +// Return (0x0B) +// } +// Name (_CRS, ResourceTemplate () { +// IO (Decode16, 0x0300, 0x0300, 0x01, 0x20) +// IRQNoFlags() { 6 } +// }) +// } + Device(RTC) { Name(_HID, EisaId("PNP0B00")) Name(_CRS, ResourceTemplate() {