aboutsummaryrefslogtreecommitdiff
path: root/src/acpi-dsdt.dsl
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2010-08-03 21:30:03 -0400
committerKevin O'Connor <kevin@koconnor.net>2010-08-03 21:30:03 -0400
commite2074bf6ec2956e1d803e62dcb052b7c88c214f0 (patch)
tree7a504fc9fd0ec6c8f454b14f56e23ea40a7bebd6 /src/acpi-dsdt.dsl
parenteb6dc785475e4676de728f99a0fcd638d81c5b68 (diff)
downloadseabios-hppa-e2074bf6ec2956e1d803e62dcb052b7c88c214f0.zip
seabios-hppa-e2074bf6ec2956e1d803e62dcb052b7c88c214f0.tar.gz
seabios-hppa-e2074bf6ec2956e1d803e62dcb052b7c88c214f0.tar.bz2
Add ACPI SSDT/DSDT support for CPU hotplug.
Move the SSDT defined processors from _PR to _SB namespace. Extend the dynamically generated SSDT to include per cpu hotplug methods. These methods just call methods defined in the DSDT. Also dynamically generate a NTFY method and a CPON array of the online/available CPUs. Add file src/ssdt-proc.dsl with directions for generating the per-cpu processor object AML code. Extend the DSDT to include methods for handling cpu hotplug notifications and methods for handling cpu status requests originating from the SSDT methods.
Diffstat (limited to 'src/acpi-dsdt.dsl')
-rw-r--r--src/acpi-dsdt.dsl75
1 files changed, 74 insertions, 1 deletions
diff --git a/src/acpi-dsdt.dsl b/src/acpi-dsdt.dsl
index cc31112..640716c 100644
--- a/src/acpi-dsdt.dsl
+++ b/src/acpi-dsdt.dsl
@@ -648,6 +648,78 @@ DefinitionBlock (
Zero /* reserved */
})
+ /* CPU hotplug */
+ Scope(\_SB) {
+ /* Objects filled in by run-time generated SSDT */
+ External(NTFY, MethodObj)
+ External(CPON, PkgObj)
+
+ /* Methods called by run-time generated SSDT Processor objects */
+ Method (CPMA, 1, NotSerialized) {
+ // _MAT method - create an madt apic buffer
+ // Local0 = CPON flag for this cpu
+ Store(DerefOf(Index(CPON, Arg0)), Local0)
+ // Local1 = Buffer (in madt apic form) to return
+ Store(Buffer(8) {0x00, 0x08, 0x00, 0x00, 0x00, 0, 0, 0}, Local1)
+ // Update the processor id, lapic id, and enable/disable status
+ Store(Arg0, Index(Local1, 2))
+ Store(Arg0, Index(Local1, 3))
+ Store(Local0, Index(Local1, 4))
+ Return (Local1)
+ }
+ Method (CPST, 1, NotSerialized) {
+ // _STA method - return ON status of cpu
+ // Local0 = CPON flag for this cpu
+ Store(DerefOf(Index(CPON, Arg0)), Local0)
+ If (Local0) { Return(0xF) } Else { Return(0x0) }
+ }
+ Method (CPEJ, 2, NotSerialized) {
+ // _EJ0 method - eject callback
+ Sleep(200)
+ }
+
+ /* CPU hotplug notify method */
+ OperationRegion(PRST, SystemIO, 0xaf00, 32)
+ Field (PRST, ByteAcc, NoLock, Preserve)
+ {
+ PRS, 256
+ }
+ Method(PRSC, 0) {
+ // Local5 = active cpu bitmap
+ Store (PRS, Local5)
+ // Local2 = last read byte from bitmap
+ Store (Zero, Local2)
+ // Local0 = cpuid iterator
+ Store (Zero, Local0)
+ While (LLess(Local0, SizeOf(CPON))) {
+ // Local1 = CPON flag for this cpu
+ Store(DerefOf(Index(CPON, Local0)), Local1)
+ If (And(Local0, 0x07)) {
+ // Shift down previously read bitmap byte
+ ShiftRight(Local2, 1, Local2)
+ } Else {
+ // Read next byte from cpu bitmap
+ Store(DerefOf(Index(Local5, ShiftRight(Local0, 3))), Local2)
+ }
+ // Local3 = active state for this cpu
+ Store(And(Local2, 1), Local3)
+
+ If (LNotEqual(Local1, Local3)) {
+ // State change - update CPON with new state
+ Store(Local3, Index(CPON, Local0))
+ // Do CPU notify
+ If (LEqual(Local3, 1)) {
+ NTFY(Local0, 1)
+ } Else {
+ NTFY(Local0, 3)
+ }
+ }
+ Increment(Local0)
+ }
+ Return(One)
+ }
+ }
+
Scope (\_GPE)
{
Name(_HID, "ACPI0006")
@@ -701,7 +773,8 @@ DefinitionBlock (
}
Method(_L02) {
- Return(0x01)
+ // CPU hotplug event
+ Return(\_SB.PRSC())
}
Method(_L03) {
Return(0x01)