Acpi Impguide
Acpi Impguide
Intel
Microsoft
Toshiba
April 4, 1997
ACPI Implementers’ Guide Draft 04/04/97
Draft
Copyright © 1996, Intel Corporation, Microsoft Corporation, Toshiba Corp.
All rights reserved.
THIS DOCUMENT IS A DRAFT FOR COMMENT ONLY AND IS SUBJECT TO CHANGE WITHOUT
NOTICE. READERS SHOULD NOT DESIGN PRODUCTS BASED ON THIS DOCUMENT.
Microsoft, Win32, Windows, and Windows NT are registered trademarks of Microsoft Corporation.
I2C is a trademark of Phillips Semiconductors.
All other product names are trademarks, registered trademarks, or servicemarks of their respective owners.
Revisions
The Draft Revision 0.4 of the ACPI Implementers’ Guide (dated March 19, 1997) was the first release of the
Guide and is the baseline for all revisions documented in the following table.
Date posted on Revision Change Contributor
www.teleport.com number
4/2/97 0.41 In section 3.4.1, “Main File of Randall Scott, Intel
Desktop Concept Machine
Sample Code,” in the PX43
Device object code, deleted the
OperationRegion named CFG3
and added an instructive
comment to the Operation
Region named GPOB.
In section 3.4.2, “SuperIO ASL
Include File,” corrected the
Offset term values. This same
correction also had to be made
to section 3.3.4, “Operation
Region and Field Definitions for
a Super I/O Chip.”
4/2/97 0.41 Corrected ASL code examples to Mark Williams, Microsoft
correctly use ASL specification
naming convention that first
argument in argument list
received by a called control
method is named Arg0, second
argument in list (if any) is
named Arg1, and so on.
Contents
1. INTRODUCTION.................................................................................................................................. 1-7
1.1 STRUCTURE OF THE ACPI IMPLEMENTERS’ GUIDE ................................................................................ 1-7
1.2 DEFINITION OF TERMS ......................................................................................................................... 1-8
2. ACPI MOBILE CONCEPT MACHINE............................................................................................. 2-15
2.1 MOBILE CONCEPT MACHINE BLOCK DIAGRAM ................................................................................... 2-15
2.2 DEVICES USED ON THE MOBILE CONCEPT MACHINE ........................................................................... 2-17
2.3 DATA AND ADDRESS BUS STRUCTURE ................................................................................................ 2-17
2.3.1 Encoding the Data and Address Bus Structure in ASL ............................................................... 2-17
2.3.1.1 Filling in the Root PCI Bus Scope with Static Device Objects ..............................................................2-19
2.3.1.2 Filling in the ISA Scope with Static Device Objects .............................................................................2-21
2.3.1.3 Filling in the \_SB Scope with Static Device Objects............................................................................2-23
2.4 ADDING DYNAMIC EVENT HANDLING TO THE ACPI NAME SPACE ....................................................... 2-25
2.4.1 Use of an Embedded Controller on the Mobile Concept Machine .............................................. 2-25
2.4.1.1 Embedded Controller Operation Region and Fields ..............................................................................2-26
2.4.1.2 Handling Embedded Controller Lid Switch Events ...............................................................................2-28
2.4.2 Handling Device Swapping in the Bay ....................................................................................... 2-29
2.4.3 Handling Dock Events ............................................................................................................... 2-32
2.4.3.1 Handling Dock Events as General Purpose Events (GPEs)....................................................................2-32
2.4.3.2 ACPI Name Space Objects that Handle Dock Events ............................................................................2-33
2.4.3.3 Walking Through a Dock Event............................................................................................................2-35
2.4.4 Device Status Changes .............................................................................................................. 2-36
2.4.4.1 ACPI Name Space for the Joystick Device............................................................................................2-38
2.4.4.2 Sample ASL Code for the Joystick Device ............................................................................................2-39
2.4.5 Device Resource Setting Changes.............................................................................................. 2-40
2.5 COMPLETE MOBILE CONCEPT MACHINE ACPI NAME SPACE ............................................................... 2-41
2.6 COMPLETE LISTING IF THE MOBILE CONCEPT MACHINE ASL CODE .................................................... 2-44
3. ACPI DESKTOP CONCEPT MACHINE .......................................................................................... 3-57
3.1 DESKTOP CONCEPT MACHINE DESIGN OVERVIEW ............................................................................... 3-58
3.1.1 Hardware Devices ..................................................................................................................... 3-58
3.1.2 Desktop Block Diagram............................................................................................................. 3-59
3.2 DESKTOP CONCEPT MACHINE ACPI NAME SPACE .............................................................................. 3-59
3.2.1 Structure of the Data and Address Buses in ACPI Name Space.................................................. 3-60
3.2.2 All the Objects in the ACPI Name Space.................................................................................... 3-60
3.3 IMPLEMENTATION EXAMPLES FROM THE DESKTOP CONCEPT MACHINE................................................ 3-63
3.3.1 Power Resource Implementation................................................................................................ 3-63
3.3.2 Thermal Zone Implementation ................................................................................................... 3-64
3.3.2.1 Physical Components of Thermal Management.....................................................................................3-64
3.3.2.2 Defining a Thermal Policy for the Desktop Concept Machine ...............................................................3-65
3.3.2.3 Writing ASL Code that Carries Out the Thermal Policy........................................................................3-66
3.3.3 Power Button Support................................................................................................................ 3-73
3.3.3.1 Power Button Implementation on the Desktop Concept Machine ..........................................................3-73
3.3.3.2 Writing ASL Code that Supports the Desktop Power Button.................................................................3-73
3.3.4 Operation Region and Field Definitions for a Super I/O Chip ................................................... 3-74
3.4 DESKTOP SAMPLE ASL CODE ............................................................................................................ 3-75
3.4.1 Main File of Desktop Concept Machine Sample Code ............................................................... 3-76
3.4.2 Super IO ASL Include File......................................................................................................... 3-80
3.4.3 FDC ASL Include File ............................................................................................................... 3-81
3.4.4 UART1 ASL Include File ........................................................................................................... 3-83
3.4.5 UART2 ASL Include File ........................................................................................................... 3-86
3.4.6 Printer ASL Include File............................................................................................................ 3-91
3.4.7 PS2 Mouse and Keyboard Port Device ASL Include File ........................................................... 3-96
3.4.8 Include File ASL Code for the Single Configuration ISA Devices .............................................. 3-98
3.4.8.1 SMC Super I/O Device ASL Include File ...........................................................................................3-101
3.4.8.2 Floppy Disk Controller ASL Include File............................................................................................3-102
4. ACPI SERVER CONCEPT MACHINE ............................................................................................4-105
4.1 OVERVIEW OF THE SERVER CONCEPT MACHINE DESIGN .....................................................................4-105
4.2 SERVER BLOCK DIAGRAMS ...............................................................................................................4-107
4.2.1 Embedded Controller Details ...................................................................................................4-108
4.2.2 Removable Drive Details..........................................................................................................4-109
4.2.3 Hot Swap Interface Details .......................................................................................................4-110
4.3 IMPLEMENTATION EXAMPLES FROM THE SERVER CONCEPT MACHINE .................................................4-113
4.3.1 PCI Interrupt Routing...............................................................................................................4-113
4.3.2 Managing Multiple Removable Hard Drives.............................................................................4-114
4.3.3 Operation Region and Field Declarations for a Super I/O Chip................................................4-115
4.4 SERVER CONCEPT MACHINE SAMPLE ASL CODE ...............................................................................4-117
4.5 SERVER CONCEPT MACHINE ACPI NAME SPACE ...............................................................................4-118
4.6 SERVER SAMPLE ASL CODE .............................................................................................................4-121
4.6.1.1 National 307 Super I/O Chip Include File...........................................................................................4-128
4.6.1.2 Super I/O Chip PS2 Port Include File .................................................................................................4-131
4.6.1.3 Super I/O Chip Floppy Disk Controller Include File ...........................................................................4-133
4.6.1.4 Super I/O Chip LPT Port Include File.................................................................................................4-135
4.6.1.5 Super I/O Chip UART1 (UARA) Include File.....................................................................................4-140
4.6.1.6 Super I/O Chip UART2 (UARTB) Include File ..................................................................................4-144
4.6.1.7 Include File ASL Code for the Single Configuration ISA Devices .......................................................4-146
5. ACPI BIOS CASE STUDY.................................................................................................................5-151
5.1 TRAJAN ARCHITECTURE ...................................................................................................................5-151
5.1.1 Modeling the Trajan Motherboard with Objects in the ACPI Namespace..................................5-152
5.1.2 Trajan Interrupt Structure ........................................................................................................5-152
5.2 INITIALIZING THE ACPI BIOS DURING POST AND COLD BOOT SEQUENCE ........................................5-156
5.2.1 Building the ACPI Tables in Memory .......................................................................................5-157
5.2.2 Sizing Memory, Allocating Memory, Fixing Up Table Pointers, and Copying ACPI Tables into
Memory.............................................................................................................................................5-157
5.2.3 Initializing the Chipset Registers ..............................................................................................5-162
5.2.4 Saving the Chipset /Configuration Data ...................................................................................5-162
5.3 POWER MANAGEMENT USING ACPI ON THE TRAJAN MOTHERBOARD.................................................5-163
5.3.1 Device Power Management ......................................................................................................5-163
5.3.2 Processor Power Management..................................................................................................5-164
5.3.3 System Power Management ......................................................................................................5-164
5.3.3.1 The BIOS’s Role in Transitioning Out of the Working State (S0) .......................................................5-164
5.3.3.2 The BIOS’s Role in Waking from S1..................................................................................................5-164
5.3.3.3 The BIOS’s Role in Waking from S2..................................................................................................5-165
5.3.3.4 The BIOS’s Role in Waking from S3..................................................................................................5-165
5.3.3.5 The BIOS’s Role in Waking from S4..................................................................................................5-166
5.4 PLUG AND PLAY USING ACPI ON THE TRAJAN MOTHERBOARD ..........................................................5-166
5.4.1 Name Space Objects for Single-Configuration Devices.............................................................5-166
5.4.2 Name Space Objects for Multiple-Configuration Devices .........................................................5-167
5.4.3 Field Declarations....................................................................................................................5-167
5.4.4 Example _CRS, _SRS, _STA, and _DIS Methods for the FDC...................................................5-167
5.5 DOCKING USING ACPI ON THE TRAJAN MOTHERBOARD ....................................................................5-168
5.5.1 Field Declarations....................................................................................................................5-169
5.5.2 Example _ADR, _UID, _EJ0, and Device Objects for the Dock ................................................5-170
5.5.3 Example Synchronization and Notifications..............................................................................5-170
5.6 SWITCHING BETWEEN ACPI AND LEGACY MODES ON THE TRAJAN MOTHERBOARD............................5-170
1. Introduction
Note: This is the March 28, 1997, version of the ACPI Implementers’ Guide; the latest version of the Guide is
always available at www.teleport.com/~acpi.
The ACPI Implementers’ Guide is a practical guide for engineers that are working to get an ACPI-compatible
system design up and running. This Guide is designed to work with the ACPI Specification, Version 1.0, and
the ACPI Specification, Version 1.0, Errata publications; you need those other two publications nearby to
effectively use this Guide.
ASL:
ACPI control method Source Language. The programming language equivalent for AML. ASL is
compiled into AML images.
This processor power state has the lowest latency, The hardware latency on this state is required to be low
enough that the operating software does not consider the latency aspect of the state when deciding whether
to use it. Aside from putting the processor in a non-executing power state, this state has no other software-
visible effects.
Control Method:
A control method is a definition of how the OS can perform a simple hardware task. For example, the OS
invokes control methods to read the temperature of a thermal zone. Control methods are written in an
encoded language called AML that can be interpreted and executed by the ACPI-compatible OS. An
ACPI-compatible system must provide a minimal set of control methods in the ACPI tables. The OS
provides a set of well-defined control methods that ACPI table developers can reference in their control
methods. OEMs can support different revisions of chip sets with one BIOS by either including control
methods in the BIOS that test configurations and respond as needed or by including a different set of
control methods for each chip set revision.
CPU, or processor:
The central processor unit (CPU), or processor, is the part of a platform that executes the instructions that
do the work. An ACPI-compatible OS can balance processor performance against power consumption and
thermal states by manipulating the processor clock speed and cooling controls. The ACPI specification
defines a working state, labeled G0, in which the processor executes instructions. Processor low power
states, labeled C1 through C3, are also defined. In the low power states the processor executes no
instructions, thus reducing power consumption and, potentially, operating temperatures.
D0 - Fully-On:
This device power state is assumed to be the highest level of power consumption. The device is completely
active and responsive, and is expected to remember all relevant context continuously.
D1:
The meaning of the D1 device power state is defined by each class of device; it may not be defined by
many classes of devices. In general, D1 is expected to save less power and preserve more device context
than D2.
D2:
The meaning of the D2 device power state is defined by each class of device; it may not be defined by
many classes of devices. In general, D2 is expected to save more power and preserve less device context
than D1 or D0. Buses in D2 may cause the device to loose some context (i.e., by reducing power on the
bus, thus forcing the device to turn off some of its functions).
D3 - Off:
Power has been fully removed from the device. The device context is lost when this state is entered, so the
OS software will reinitialize the device when powering it back on. Since device context and power are
lost, devices in this state do not decode their addresses lines. Devices in this state have the longest restore
times. All classes of devices define this state.
Definition Block:
A definition block contains information about hardware implementation and configuration details in the
form of data and control methods, encoded in AML. An OEM can provide one or more definition blocks
in the ACPI Tables. One definition block must be provided: the Differentiated Definition Block, which
describes the base system. Upon loading the Differentiated Definition Block, the OS inserts the contents of
the Differentiated Definition Block into the ACPI Name Space. Other definition blocks, which the OS can
dynamically insert and remove from the active ACPI Name Space, can contain references to the
Differentiated Definition Block.
Device:
Hardware components outside the core chip set of a platform. Examples of devices are LCD panels, video
adapters, IDE CD-ROM and hard disk controllers, COM ports, etc. In the ACPI scheme of power
management, buses are devices.
Fixed Platform Features, Fixed Feature Registers, and Fixed Feature Events
Fixed platform features are a set of features offered by an ACPI interface. The ACPI specification places
restrictions on where and how the hardware programming model is generated. All fixed features, if used,
are implemented as described in this specification so that the ACPI driver can directly access the fixed
feature registers. The fixed feature registers are a set of hardware registers in fixed feature register space
at specific address locations in system IO address space. ACPI defines register blocks for fixed features
(each register block gets a separate pointer from the FACP ACPI table). Fixed feature events are a set of
events that occur at the ACPI interface when a paired set of status and event bits in the fixed feature
registers are set at the same time. While a fixed feature event occurs an SCI is raised. For ACPI fixed-
feature events, the ACPI driver (or an ACPI-aware driver) acts as the event handler.
G0 - Working:
A computer state where the system dispatches user mode (application) threads and they execute. In this
state, devices (peripherals) are dynamically having their power state changed. The user will be able to
select (through some user interface) various performance/power characteristics of the system to have the
software optimize for performance or battery life. The system responds to external events in real time. It is
not safe to disassemble the machine in this state.
G1 - Sleeping:
A computer state where the computer consumes a small amount of power, user mode threads are not being
executed, and the system “appears” to be off (from an end user’s perspective, the display is off, etc.).
Latency for returning to the Working state varies on the wakeup environment selected prior to entry of
this state (for example, should the system answer phone calls, etc.). Work can be resumed without
rebooting the OS because large elements of system context are saved by the hardware and the rest by
system software. It is not safe to disassemble the machine in this state.
G3 - Mechanical Off:
A computer state that is entered and left by a mechanical means (e.g. turning off the system’s power
through the movement of a large red switch). This operating mode is required by various government
agencies and countries. It is implied by the entry of this off state through a mechanical means that the no
electrical current is running through the circuitry and it can be worked on without damaging the hardware
or endangering the service personnel. The OS must be restarted to return to the Working state. No
hardware context is retained. Except for the real time clock, power consumption is zero.
Legacy state is a computer state where power management policy decisions are made by the platform
hardware/firmware shipped with the system. The legacy power management features found in today’s
systems are used to support power management in a system that uses a legacy OS that does not support the
OS-directed power management architecture. Legacy hardware is a computer system that has no ACPI or
OSPM power management support. A legacy OS is an operating system that is not aware of and does not
direct power management functions of the system. Included in this category are operating systems with
APM 1.x support.
Object:
The nodes of the ACPI Name Space are objects inserted in the tree by the OS using the information in the
system definition tables. These objects can be data objects, package objects, control method objects, etc.
Package objects refer to other objects. Objects also have type, size, and relative name.
Object name:
Object names are part of the ACPI Name Space. There is a set of rules for naming objects.
Package:
A set of objects.
Power Button:
A user push button that switches the system from the sleeping/soft off state to the working state, and
signals the OS to transition to a sleeping/soft off state from the working state.
Power Resources:
Power resources are resources (for example, power planes and clock sources) that a device requires to
operate in a given power state.
Power Sources:
The battery and AC adapter that supply power to a platform.
S1 Sleeping State:
The S1 sleeping state is a low wake-up latency sleeping state. In this state, no system context is lost (CPU
or chip set) and hardware maintains all system context.
S2 Sleeping State
The S2 sleeping state is a low wake-up latency sleeping state. This state is similar to the S1 sleeping state
except the CPU and system cache context is lost (the OS is responsible for maintaining the caches and
CPU context). Control starts from the processor’s reset vector after the wake-up event.
S3 Sleeping State:
The S3 sleeping state is a low wake-up latency sleeping state where all system context is lost except
system memory. CPU, cache, and chip set context are lost in this state. Hardware maintains memory
context and restores some CPU and L2 configuration context. Control starts from the processor’s reset
vector after the wake-up event.
S4 Sleeping State:
The S4 sleeping state is the lowest power, longest wake-up latency sleeping state supported by ACPI. In
order to reduce power to a minimum, it is assumed that the hardware platform has powered off all devices.
Platform context is maintained.
S4 - Non-Volatile Sleep:
S4 Non-Volatile Sleep (NVS) is a special global system state that allows system context to be saved and
restored (relatively slowly) when power is lost to the motherboard. If the system has been commanded to
enter S4, the OS will write all system context to a non-volatile storage file and leave appropriate context
markers. The machine will then enter the S4 state. When the system leaves the Soft Off or Mechanical Off
state, transitioning to Working (G0) and restarting the OS, a restore from a NVS file can occur. This will
only happen if a valid NVS data set is found, certain aspects of the configuration of the machine has not
changed, and the user has not manually aborted the restore. If all these conditions are met, as part of the
OS restarting it will reload the system context and activate it. The net effect for the user is what looks like
a resume from a Sleeping (G1) state (albeit slower). The aspects of the machine configuration that must
not change include, but are not limited to, disk layout and memory size. It might be possible for the user
to swap a PC Card or a Device Bay device, however.
Note that for the machine to transition directly from the Soft Off or Sleeping states to S4, the system
context must be written to non-volatile storage by the hardware; entering the Working state first so the OS
or BIOS can save the system context takes too long from the user’s point of view. The transition from
Mechanical Off to S4 is likely to be done when the user is not there to see it.
Because the S4 state relies only on non-volatile storage, a machine can save its system context for an
arbitrary period of time (on the order of many years).
Differentiated System Description Table is loaded into ACPI name space, each secondary description table
with a unique OEM Table ID is loaded. This allows the OEM to provide the base support in one table,
while adding smaller system options in other tables. Note: Additional tables can only add data, they
cannot overwrite data from previous tables.
Sleep Button:
A user push button that switches the system from a sleeping state to the working state, and signals the OS
to transition to a sleeping state from the working state.
Thermal States:
Thermal states represent different operating environment temperatures within thermal zones of a system.
A system can have one or more thermal zones; each thermal zone is the volume of space around a
particular temperature sensing device. The transitions from one thermal state to another are marked by
trip points, which are implemented to generate a System Control Interrupt (SCI) when the temperature in
a thermal zone moves above or below the trip point temperature.
• Has an embedded controller that monitors the CPU temperature every few degrees.
The mobile concept machine docking station has PCI slots plus a port for a joystick.
CPU/ D
CPU Memory/ R
A
PCI Bridge M
L
Therm 2
Sensor
Power Button
(On/Off/Overide)
System VRAM
cont.
LCD
PCI-ISA Graphics
LPT Bridge CRT
PIC,
PIT,
COM
DMA
RTC,
FDD FDC,
UART,
LPT
Indicator
Lights Primary
BM-IDE channel HDD
Mouse port cont. 0
Secondary channel
KB port
Eject Switch
ISA BUS
Keyboard
HDD
CD-ROM
Control
Method 2nd
I2C BUS I2C BUS
Battery Battery
I2C BUS
Swappable Bay
Sound
Docking Station
Eject
Mechanism
Docking Joystick port
PCI/PCI
Eject SW Bridge
Docking
Secondary PCI BUS
Controller
NVRAM
PCI Slots
Device Description
Modem Standard modem chip set. Ring Indicate pulled out separately
and fed to the RI# wake up input on the chip set.
2 IDE channel Primary for the internal HDD, secondary for the bay device.
CPU/ D
CPU Memory/ R
A
PCI Bridge M
L
2
System
cont.
PCI-ISA
Bridge
PIC,
PIT,
DMA
Docking Station
Docking
PCI/PCI
Bridge
Secondary PCI BUS
PCI Slots
2.3.1.1 Filling in the Root PCI Bus Scope with Static Device Objects
The following ACPI name space model shows the bare bones model with the device objects that hang off the
PCI root bus and their configuration objects added to the bare bones objects (the bare bones objects are bolded).
The only device hanging off the PCI root bus is video.
\_SB
PCI0 //PCI root bridge (Host PCI bridge)
_HID //PCI Bus ID (used on root bus only)
_ADR //address of PCI device
_CRS //report PCI bus number zero (used on root bus only)
IDE //BM-IDE Device(PCI)
_ADR //address of PCI device
PRIM //Primary Bus Master controller
_ADR //Primary channel
BAY //swappable bay for 2nd HDD and CD-ROM
_ADR //Secondary channel
_LCK //means ejectable
VID //VIDEO Device (PCI)
_ADR //address of PCI device
ISA //PCI-ISA Bridge
_ADR //Device address of PCI-ISA bridge on PCI bus
DOCK //PCI Bus 1 of DOCKING STATION (PCI-PCI bridge)
This name space model corresponds to the elements of the mobile concept machine block diagram shown in
the following illustration. An important thing to note is that if you match the following illustration with the
block diagram at the beginning of this section, the block diagram at the beginning of the section shows a
CardBus device attached to the PCI bus – yet that device is not represented by an object in the ACPI name
space. That is because PCI devices that do not have any value-added features from the OEM are not modeled
in ACPI name space; the CardBus device on the mobile concept machine is an example of this. The Card Bus
device is enumerated, configured, and power-managed by its native bus driver (the PCI bus driver).
In contrast, the VID device attached to the PCI bus is represented by an object in the ACPI name space is that
the OEM has added a value-added power saving feature to the graphics subsystem.
CPU/ D
CPU Memory/ R
A
PCI Bridge M
L
2
System VRAM
cont.
LCD
PCI-ISA Graphics
Bridge CRT
PIC,
PIT,
DMA
Primary
BM-IDE channel HDD
cont. 0
Secondary channel
ISA BUS
HDD
CD-ROM
Swappable Bay
Docking Station
Docking
PCI/PCI
Bridge
Secondary PCI BUS
PCI Slots
CPU/ D
CPU Memory/ R
A
PCI Bridge M
L
2
System VRAM
cont.
LCD
PCI-ISA Graphics
LPT Bridge CRT
PIC,
PIT,
COM
DMA
RTC,
FDD FDC,
UART,
LPT
Wake up
Modem RJ11
Embedded Controller
Primary
BM-IDE channel HDD
Mouse port cont. 0
Secondary channel
KB port
ISA BUS
Keyboard
HDD
CD-ROM
Swappable Bay
Sound
Docking Station
PCI Slots
\_SB
LID //LID
_HID //LID ID
BAT0 //Battery
_HID //Battery Device ID
AC //AC Adapter
PCI0 //PCI root bridge (Host PCI bridge)
_HID //PCI Bus ID (used on root bus only)
_ADR //address of PCI device
_CRS //report PCI bus number zero (used on root bus only)
IDE //BM-IDE Device(PCI)
_ADR //address of PCI device
PRIM //Primary Bus Master controller
_ADR //Primary channel
BAY //swappable bay for 2nd HDD and CD-ROM
_ADR //Secondary channel
_LCK //means ejectable
VID //VIDEO Device (PCI)
_ADR //address of PCI device
ISA //PCI-ISA Bridge
_ADR //Device address of PCI-ISA bridge on PCI bus
EC0 //Embedded controller device
_HID //ID for Embedded controller
FDC0 //Floppy Disk controller
_HID //Hardware Device ID
LPT //Standard Printer port
_HID //Hardware Device ID
ECP //ECP Printer
_HID //Hardware Device ID
COMA //Communication Device
_HID //Hardware Device ID
MDM0 //Communication Device (Modem)
_HID //Hardware Device ID
SND0 //Sound Device
_HID //Hardware Device ID
SND1 //Joystick (Game port)
_HID //Hardware Device ID
_EJD //dock dependent device
DOCK //PCI Bus 1 of DOCKING STATION (PCI-PCI bridge)
This name space corresponds to the following parts of the mobile concept machine block diagram.
CPU/ D
CPU Memory/ R
A
PCI Bridge M
L
2
System VRAM
cont.
LCD
PCI-ISA Graphics
LPT Bridge CRT
PIC,
PIT,
COM
DMA
RTC,
FDD FDC,
UART,
LPT
Wake up
LID Switch
Primary
BM-IDE channel HDD
Mouse port cont. 0
Secondary channel
KB port
ISA BUS
Keyboard
HDD
CD-ROM
Control
Method
I2C BUS
Battery
I2C BUS
Swappable Bay
Sound
Docking Station
PCI Slots
EC
GP_REG
AC _Q06 Block
_Q07 EC_STS
GP_STS.00
_Q08
EC_EN
Battery
_Q09
GP_EN.00 SCI
RI_STS
LID _Q0A
GP_STS.0E
RI_EN
DOCK GP_EN.0E
Other
SCI
sources
Note that in the preceding block diagram, a non-embedded controller event, the docking event, is shown tied
to GP_STS.0E; this is a general-purpose event. AC adapter, thermistor, battery, and lid events could all be
handled as general-purpose events, also. Using an embedded controller on a platform is totally optional. Some
advantages of using an embedded controller are:
• More flexible design.
• Enables use of I2C bus communication.
GP_REG
EC
LID SW Block
EC_STS
GP_STS.00
_Q0A EC_SCIRQ
EC_EN
GP_EN.0
0
The sequence of steps in handling a lid closing event are listed below:
1. The mobile platform user closes the lid.
2. An SCI fires (see block diagram above).
3. The OS detects GPE 00 and runs the _L00 event handler. ASL code for the _L00 event handler for the
mobile concept machine is shown below.
Method(_L00) { // GP event handle to GP_STS.00
Notify(\_SB.PCI0.ISA.EC0,0) // EC event notification
}
4. The _L00 event handler sends a “device check” notification to the OS, naming the device to check (the
fully-qualified name of the embedded controller in the hierarchical ACPI name space is
\_SB.PCI0.ISA.EC0).
5. The OS’s policy for device checking an embedded controller is to query the device using the standard
embedded controller query interface. Since this sequence started with the user closing the lid, the
embedded controller returns the value of 0A in response to the query (see Figure 5-2).
6. This causes the OS to run the _Q0A event handler. ASL code for the _Q0A event handler is shown below.
// Lid event - EC query value A
Method(_Q0A) {
Notify (\_SB.LID, 0x80) // notify LID status changed
}
7. The _Q0A event handler sends a “lid status change” notification to the OS, naming the device object
\_SB.LID.
8. The OS responds to this notification by running the _LID control method, which is defined in the ACPI
Specification, Revision 1.0, to always return the status of the lid. The ASL code for the _LID method for
the mobile concept machine is:
Method(_LID) {
Return( \_SB.PCI0.ISA.EC0.LIDS) // Status of the LID
}
9. “LIDS” is the name of a field in the embedded controller operation region which always contains the
status of the lid. In this scenario, since the lid is closed, the value returned to the OS by the _LID method
is zero.
10. The OS carries out its “closed lid” policy.
CPU/ D
CPU Memory/ R
A
PCI Bridge M
L
2
Power Button
(On/Off/Overide)
System
cont.
PCI-ISA
Bridge
PIC,
PIT,
DMA
RTC,
FDC,
UART,
LPT
Embedded Controller
Primary
BM-IDE channel HDD
cont. 0
Secondary channel
Eject Switch
ISA BUS
HDD
Swappable Bay
This can be shown more simply in the following logical block diagram.
Mobile System
Primary HDD
IDE
controller
Swappable Bay Area
Secondary
IDE 2nd HDD
controller
CD-ROM
When a second HDD device is inserted in the Bay, two IDE controllers and two IDE HDD devices are active.
Which IDE controller controls the primary channel and which IDE controller controls the secondary channel
is encoded in the _ADR object under each IDE controller’s Device object in the ACPI name space, using the
following convention:
Name(_ADR, 0) //Primary channel
Name(_ADR, 1) //Secondary channel
Name(_ADR, 2) //Third channel (if needed)
Name(_ADR, 3) //Fourth channel (if needed)
Which IDE device is the master and which is the slave is encoded in the _ADR object under each IDE HDD’s
Device object in the ACPI name space, using the following convention:
Name(_ADR, 0) //Master
Name(_ADR, 1) //Slave
These conventions are used in the following block of code from the mobile concept machine’s ASL code:
IDE //BusMaster IDE controller
_ADR //PCI address of BM-IDE
PRIM //Primary Bus Master controller
_ADR //Primary channel
BAY //swappable bay for 2nd HDD and CD-ROM
_ADR //Secondary channel
_LCK //means ejectable
GP_REG
Block
EC_STS
GP_STS.0E
DOCK
EC_EN
GP_EN.0E
The object named “DOCK” in the name space above is an ACPI Device object because the dock device is just a
bus bridge (typically, PCI bus #1 or greater). The block of ASL code that declares the Device object named
“DOCK” for the mobile concept machine is shown below. Notice the use of the embedded control fields in
lines 8, 11, 18, and 22 to save and report state information for the “DOCK” device.
1 //******************************
2 // Dock Objects (PCI-PCI Bridge)
3 //******************************
4 Device(DOCK) { // PCI-PCI bridge
4. In this example, where the user has docked the mobile computer, lines 14 through 17 in the _L0E method
are executed and the _L0E event handler sends a “device check” notification to the OS, naming the device
to check (the fully-qualified name of the dock in the hierarchical ACPI name space is \_SB.PCI0.DOCK).
CPU/ D
CPU Memory/ R
A
PCI Bridge M
L
2
Power Button
(On/Off/Overide)
System VRAM
cont.
LCD
PCI-ISA Graphics
Bridge CRT
PIC,
PIT,
DMA
RTC,
FDC,
UART,
LPT
ISA BUS
I2C BUS
Sound
Docking Station
Eject
Mechanism
Docking Joystick port
PCI/PCI
Eject SW Bridge
Docking
Secondary PCI BUS
Controller
NVRAM
PCI Slots
This relationship can be shown more simply with the following logical block diagram.
Docking
Mobile System Station
System BUS
Sound Joystick
port
//
// Sound Devices
//
Device(SND0) { // Sound Device
// (WSS+FM+etc)
Name(_HID,EISAID("SND0000")) // example ID for Sound
Method(_STA,0) { // Status of the sound
//When functioning
Return (0xF) // device is functioning
//When disabled by OS,
Return (0xD)
}
Method (_CRS) { // Current Resources
//Prepare the current resource of UART
//Name (BUFF, buffer(size){data})
Return (BUFF)
}
Method (_PRS) { // Possible Resources
//Prepare the possible resources of UART PORT
//Name (BUFF, buffer(size){data})
Return (BUFF)
}
Method (_SRS,1 ) { // Set Resources
// ARG0 = PnP Resource String to Set
//Control of setting resource is placed here
}
Method (_DIS,0 ) { // Disable Resources
//Control of setting resource is placed here
}
} // end SND0
//
// Joystick port is on the docking station.
// Joystick *must* only appear in UI when docked.
//
Device(SND1) { // Joystick (Game Port)
Name(_HID,EISAID("SND0001")) // example ID for Joystick
Name(_EJD,"\_SB.PCI0.DOCK") // means dock-dependent device
Method(_STA,0) { // Status of the Joystick
If (\_SB.PCI0.ISA.EC0.DSTS) { // docked and functioning
Return (0x0F) // return show UI
} Else { //When undocked and not shown in UI
Return (0x0B) //return remove UI
}
}
Method (_CRS) { // Current Resources
//Prepare the current resource of UART
//Name (BUFF, buffer(size){data})
Return (BUFF)
}
Method (_PRS) {
// Possible Resources
//Prepare the current resource of UART PORT
//Name (BUFF, buffer(size){data})
Return (BUFF)
}
Method (_SRS,1 ) { // Set Resources
// ARG0 = PnP Resource String to Set
//Control of setting resource is placed here
}
Method (_DIS,0 ) { // Disable Resources
//Control of setting resource is placed here
}
} // end SND1
\_PR
CPU0
\_S0 //Value for S0 to set the SLP_TYP
\_S2 //Value for S2 to set the SLP_TYP
\_S3 //Value for S3 to set the SLP_TYP
\_S5 //Value for S5 to set the SLP_TYP
\_PTS //Prepare to sleep control method
\_WAK //Wake
\_SI //System Indicator (ICON)
_MSG //Message waiting indicator
_SST //System status indicator
\_TZ //Thermal zone
THRM //Thermal zone
_TMP
_AC0
_AL0
_PSV
_PSL
_CRT
_SCP
_TC1
_TC2
_TSP
PFAN //FAN power resource
_STA
_ON
_OFF
FAN //FAN Device
_HID //
_PR0 //list of power resource
\GPE0 //General Purpose event
_L00 //EC control Method to handle GP_STS.00
_L0E //docking method to handle GP_STS.0E
_L0F //Ring wake method to handle GP_STS.0F
\_SB
LNKA //PCI Interrupt routing
LNKB //PCI Interrupt routing
LNKC //PCI Interrupt routing
LNKD //PCI Interrupt routing
LID //LID
_HID //LID ID
_PRW //define wake device
_LID //status of lid
_PSW //enable/disable lid wake
BAT0 //Battery
_HID //Battery Device ID
_PCL //Points to DEVS
_STA //Status of the battery
_BIF //Battery static Information
_BST //Battery present Status
_BTP //Battery Trip point
AC //AC Adapter
_STA //AC status
_PSR //Power Source type
_PCL //Power Class List (points to BAT0)
DefinitionBlock (
"MB_smpl.aml", //Output filename
"DSDT", //Signature
0x00, //DSDT Revision
"OEMXYZ", //OEMID
"mb_smpl", //TABLE ID
0x00 //OEM Revision
) {
//******************
// Processor Object
//******************
Scope(\_PR) {
Processor(
CPU0, // processor name
1, // unique number for this processor
0x110, // System IO address of Pblk Registers
0x06 // length in bytes of PBlk
) {}
}
//******************
// Sleep States
//******************
Name (\_S0, Package() {7, 7, 0})
// This mobile system does not support S1,S4 state
Name (\_S2, Package() {6, 6, 0})
Name (\_S3, Package() {4, 4, 0})
Name (\_S5, Package() {0, 0, 0})
Method(\_WAK, 1) { // Wake
// _WAK will be invoked by the OS after the system has awakened
// from a sleeping state. Arg0 means sleep state #.
// _WAK should returns the result code of waking up from a sleeping
// level whether it has been failed or succeed.
// If you need to notify the device insertion or removal after
// the sleep state, you can issue a device check notification.
//******************
// System Indicators
//******************
Scope(\_SI) {
Method(_MSG, 1) {
Store(ARG0,\_SB.PCI0.ISA.EC0.NMSG) //Set number of messages
} // end _MSG
Method(_SST, 1) {
// Control of System status indicator is placed here
// Arg0 means Working, waking and sleeping
If (LEqual(ARG0,0x0)){
Store(0x0, \_SB.PCI0.ISA.EC0.SLED) //Message light off
}
If (LEqual(ARG0,0x1)){
//******************
// Thermal Zone
//******************
Scope(\_TZ) {
PowerResource(PFAN, 0, 0) {
Method(_STA) {
if (\_SB.PCI0.ISA.EC0.FAN){ // check power state
Return (0x1) // Power is on
} else {
Return (0x0) // Power is off
}
}
Method(_ON) {Store (One, \_SB.PCI0.ISA.EC0.FAN)} // turn on fan
Method(_OFF) {Store (Zero,\_SB.PCI0.ISA.EC0.FAN)} // turn off fan
}
// Create FAN device object
Device (FAN) {
Name(_HID,EISAID("PNP0C0B")) // PNP ID for FAN
// list power resource for the fan
Name(_PR0, Package(){PFAN})
}
// create a thermal zone
ThermalZone (THRM) {
Method(_TMP) {Return (\_SB.PCI0.ISA.EC0.TMP )} // get current temp
Method(_AC0) {Return (\_SB.PCI0.ISA.EC0.AC0)} // active temp
Name(_AL0, Package(){FAN}) // fan is act cool dev
Method(_PSV) {Return (\_SB.PCI0.ISA.EC0.PSV)} // passive temp
Name(_PSL, Package(){\_PR.CPU0}) // cpu is passive dev
Method(_CRT) {Return (\_SB.PCI0.ISA.EC0.CRT)} // get critical temp
Method(_SCP, 1) {Store(Arg0,\_SB.PCI0.ISA.EC0.MODE)}// set cooling mode
Name(_TC1, 2) // thermal coefficient
Name(_TC2, 3) // thermal coefficient
Name(_TSP, 600) // sample every 60sec
} // end ThermalZone object THRM
} //end _TZ
// ***********************
// General Purpose Events
// ***********************
Scope (\_GPE) {
Method(_L00) { // GP event handle to GP_STS.00
Notify(\_SB.PCI0.ISA.EC0,0) // EC event notification
}
Method (_L0E) { // GP event handle to GP_STS.0E
IF (\_SB.PCI0.ISA.EC0.UDW) {
Notify (\_SB.PCI0.DOCK, 0) // Warm Undocked
Store (0, \_SB.PCI0.ISA.EC0.UDW)
}
IF (\_SB.PCI0.ISA.EC0.UDH) {
Notify (\_SB.PCI0.DOCK, 0) // Hot Undocked
Store (0, \_SB.PCI0.ISA.EC0.UDH)
}
IF (\_SB.PCI0.ISA.EC0.UDRS) {
Notify (\_SB.PCI0.DOCK, 1) // about to Hot undock
Store (0, \_SB.PCI0.ISA.EC0.UDRS)
}
IF (\_SB.PCI0.ISA.EC0.DCS) {
Notify (\_SB.PCI0.DOCK, 0) // Docked
Store (0, \_SB.PCI0.ISA.EC0.DCS)
}
} // end _L0E
Method(_L0F) { // GP event handle to GP_STS.0F
//When system is awakened from sleep state by modem ring
//this event will happen.
//******************
// System Bus
//******************
Scope(\_SB) {
Device(LNKB){
Name(_HID, EISAID("PNP0C0F")) // PCI interrupt link
Name(_UID, 2)
Method(_CRS, 0){
// when undock, return no IRQ is assigned
// when dock, return current IRQ link for LNKB
}
Method(_DIS, 0){
// Control of disabling the LNKB is placed here
}
Method(_PRS, 0){
// Return possible IRQ link for LNKB
}
Method(_SRS, 1){
//ARG0 = PNP Resource String to set for IRQ
//Control of setting resource to FDC is placed here
}
} // end LNKB
Device(LNKC){
Name(_HID, EISAID("PNP0C0F")) // PCI interrupt link
Name(_UID, 3)
Method(_CRS, 0){
// when undocked, return no IRQ is assigned
// when docked, return current IRQ link for LNKD
}
Method(_DIS, 0){
// Control of disabling the LNKC is placed here
}
Method(_PRS, 0){
// Return possible IRQ link for LNKC
}
Method(_SRS, 1){
//ARG0 = PNP Resource String to set for IRQ
//Control of setting resource to FDC is placed here
}
} // end LNKC
Device(LNKD){
Name(_HID, EISAID("PNP0C0F")) // PCI interrupt link
Name(_UID, 1)
Method(_CRS, 0){
// when undocked ,return no IRQ is assigned
Device (LID) {
Name(_HID, EISAID("PNP0C0D")) // ID for LID
// Wake device definition
Name(_PRW,
// package (argnum) {GPEbit, wakelevel}
Package(2) {0x00, 5} // GP_STS.25,
// lowest sleep state is S5
// no relative power resource
)
Method(_LID) {
Return( \_SB.PCI0.ISA.EC0.LIDS) // Status of the LID
}
Method(_PSW, 1) {
If (LEqual(ARG0,0x1)){
// if ARG0 =1 then enable the lid wake.
Store (0x1, \_SB.PCI0.ISA.EC0.LWKE)
} Else {
// if ARG0 !=1 then disable the lid wake.
Store (0x0, \_SB.PCI0.ISA.EC0.LWKE)
}
}
} // end LID
Device (BAT0) {
Name(_HID, EISAID("PNP0C0D")) // ID for BAT0
Name (PCL, Package(){\_SB} )
Method (_STA) {
If (\_SB.PCI0.ISA.EC0.BAT0){
Return (0xF) // Battery exist
} else {
Return (0x0) // Battery not exist
}
}
Method (_BIF) {
Return( Package() {
\_SB.PCI0.ISA.EC0.BPU0, // Power Unit
\_SB.PCI0.ISA.EC0.BDC0, // Designed Capacity
\_SB.PCI0.ISA.EC0.BFC0, // Last Full Charge Capacity
\_SB.PCI0.ISA.EC0.BTC0, // Battery Technology
\_SB.PCI0.ISA.EC0.BDV0, // Design Voltage
\_SB.PCI0.ISA.EC0.BCW0, // Design capacity of Warning
\_SB.PCI0.ISA.EC0.BCL0, // Design capacity of Low
\_SB.PCI0.ISA.EC0.BCG0, // capacity granularity 1
\_SB.PCI0.ISA.EC0.BG20, // capacity granularity 2
\_SB.PCI0.ISA.EC0.BMN0, // Model Number
\_SB.PCI0.ISA.EC0.BSN0, // Serial Number
\_SB.PCI0.ISA.EC0.BTY0, // Battery Type
\_SB.PCI0.ISA.EC0.BIF0 // OEM Information
})
}
Method (_BST) {
Return( Package() {
\_SB.PCI0.ISA.EC0.BST0, // Battery Status
\_SB.PCI0.ISA.EC0.BPR0, // Battery Present Rate
\_SB.PCI0.ISA.EC0.BRC1, // Battery Remaining Capacity
\_SB.PCI0.ISA.EC0.BPV0 // Battery Present Voltage
})
}
Method (_BTP,1) {
Store (arg0, \_SB.PCI0.ISA.EC0.BTP0) // Set Battery Trip point
}
} //end BAT0
//******************
// HOST PCI BUS
//******************
Device(PCI0) { // Root PCI Bus
Name(_HID, EISAID("PNP0A03")) // _HID for root PCI bus
Name(_ADR,0x0000000) // PCI Device#0, functoin#0
Method (_CRS,0) { // _CRS for PCI bus number
// PCI bus number as Zero by word address descriptor
// Return( WORDBusNumber(,,,,0,0,0,0) )
} // end _CRS
//**********************************************
// BusMaster IDE
//**********************************************
Device(IDE) { //BM-IDE in system
Name(_ADR, 0) //PCI address of BM-IDE
Method(_STA,0) { //Status of BM-IDE controller
// If BM-IDE is functioning
Return(0xF)
// If IDE channel0 is disabled
Return(0xD)
}
Device(PRIM) {
Name(_ADR,0) //Primary IDE channel
Method(_STA,0) { //Status of the primary channel
// If IDE is exist and functioning
Return(0xF)
// If IDE channel0 is removed
Return(0xD)
}
} // end PRIM
//**********************************************
//******************
// PCI-ISA Bridge
//******************
Device(ISA) {
Name(_HID, EISAID("PNP0A00")) //ID for ISA bus
Device(EC0) { //Embedded Controller
Name(_HID, EISAID("PNP0C09")) //ID for EC
Method(_STA,0) { //Status of the EC
Return(0xF) //EC is functioning
}
Method (_CRS ,0) {
// Store the Current Resource into Buff
// Name (BUFF, buffer(size){data})
Return(BUFF)
} // end _CRS
}
//create EC's region and field
OperationRegion(RAM, EmbeddedControl, 0, 0xFF)
Field(RAM, AnyAcc, Lock, Preserve) {
// Fields for System Indicators
NMSG, 8, // Number of Message appeared on Message indicator
SLED, 4, // System Status indicator
// bit 3: System is Working
// bit 2: System is waking up
// bit 1: System is sleeping (S1,S2 or S3)
// bit 0: System is sleeping with context saved (S4).
,4, // reserved
// Fields for FAN information placed here
MODE, 1, // thermal policy (quiet/perform)
FAN, 1, // fan power (on/off)
TME0, 1, // require notification with 0x80
TME1, 1, // require notification with 0x81
,2, // reserved
// Fields for Thermal information placed here
AC0, 8, // active cooling temp
PSV, 8, // passive cooling temp
CRT, 8, // critical temp
// Fields for LID and LCD information placed here
LIDS, 1, // LID status
LSW0, 1, // LCD power switch
// wake up enable, disable
LWKE, 1, // Enable wake up from LID
MWKE, 1, // Enable wake up from MODEM
,4, // reserved
// sleep type
SLPT, 8, // Set sleep type before system enter
// the sleep state. This field will
// used in the _PTS control method
// docking information is placed here
DCID, 32, // Docking unique ID
DSTS, 1, // Docking status
UDRS, 1, // UNDOCK_REQUEST_STS
DCS, 1, // DOCK_CHG_STS
UDW, 1, // UNDOCK_WARM
UDH, 1, // UNDOCK_HOT
DCCH, 1, // DOCKING STATUS has been changed
,1, // reserved
// SWAPPABLE BAY's information is placed here
SWEJ, 1, // SWAPPABLE BAY eject request
SWCH, 1, // condition of SWAPPABLE BAY was changed
,6, // Reserved
//
// AC and CMBatt information is placed here
//
ADP, 1, // AC Adapter 1:On-line, 0:Off-line
AFLT, 1, // AC Adapter Fault 1:Fault 0:Normal
BAT0, 1, // BAT0 1:present, 0:not present
,1, // reserved
BPU0, 32, // Power Unit
BDC0, 32, // Designed Capacity
BFC0, 32, // Last Full Charge Capacity
BTC0, 32, // Battery Technology
BDV0, 32, // Design Voltage
BST0, 32, // Battery State
BPR0, 32, // Battery Present Rate
// (Designed Capacity)x(%)/{(h)x100}
BRC0, 32, // Battery Remaining Capacity
// (Designed Capacity)‚˜(%)•^100
BPV0, 32, // Battery Present Voltage
BTP0, 32, // Trip Point
BCW0, 32, // Design capacity of Warning
BCL0, 32, // Design capacity of Low
BCG0, 32, // capacity granularity 1
BG20, 32, // capacity granularity 2
BIF0, 32, // OEM Information(00h)
BSN0, 32, // Battery Serial Number
BTY0, 64 // Battery Type (e.g., "Li-Ion")
} // end field
Method(_Q07) {
If (\_SB.PCI0.ISA.EC0.TME0) { // if thermal event
Notify (\_TZ.THRM,0x80) // notice thermal event
}
If (\_SB.PCI0.ISA.EC0.TME1) { // if _ACx/_PSV temp.
// has changed
Notify (\_TZ.THRM,0x81) // notice change
}
Store (0x0, \_SB.PCI0.ISA.EC0.TME0) // clear the bit
Store (0x0, \_SB.PCI0.ISA.EC0.TME1) // clear the bit
}
//
// LPT DEVICE is selected either LPT or ECP by the HW SETUP
// at boot time. Name space contain the all possible
// devices even though these device is not present now.
// If the device is not present, _STA control object under that
// device should return that this device is not present
// property.
//
Device(LPT) {
Name (_HID, EISAID("PNP0400")) // standard LPT
Method (_STA) { // Status for LPT
//When LPT is selected by HW setup,
//_STA should return the device is present
Return (0xF) // return LPT is present
//When LPT is selected by HW setup, but disabled by OS,
Return (0xD)
//When LPT is not selected by the HW setup,
//_STA should return the device is not present.
Return (0x0) // return LPT is not present
}
Method (_DIS ) { // Disable LPT
Device(ECP) {
Name (_HID, EISAID("PNP0401")) // PnP ID for ECP
Method (_STA) { // Status for ECP
//When ECP is selected by HW setup,
//_STA should return the device is present
Return (0xF) // return ECP is present
//When ECP is selected by HW setup, but disabled by OS,
Return (0xD)
//When ECP is not selected by the HW setup,
//_STA should return the device is not present.
Return (0x0) // return ECP is not present
}
Method (_DIS) { // Disable ECP
//Control of disabling the ECP is placed here
}
Method (_CRS) { // ECP Current Resources
//Prepare the current resource of ECP to Buff
//Name (BUFF, buffer(size){data})
Return (BUFF)
}
Method (_PRS,0) { // ECP Possible Resources
//Prepare the possible resource of ECP to Buff
//Name (BUFF, buffer(size){data})
Return (BUFF)
}
Method ( _SRS,1 ) { // Set Resources for ECP
// ARG0 = PnP Resource String to Set
//Control of setting resource is placed here
}
} // end ECP
//When functioning
Return (0xF) // device is functioning
//When disabled by OS,
Return (0xD)
}
Method (_CRS) { // Current Resources
//Prepare the current resource of UART
//Name (BUFF, buffer(size){data})
Return (BUFF)
}
Method (_PRS) { // Possible Resources
//Prepare the current resource of UART PORT
//Name (BUFF, buffer(size){data})
Return (BUFF)
}
Method (_SRS,1 ) { // Set Resources
// ARG0 = PnP Resource String to Set
//Control of setting resource is placed here
}
Method (_DIS,0 ) { // Disable Resources
//Control of setting resource is placed here
}
} // end SND0
//
// Joystick port is on the docking station.
// Joystick will only appear in UI when docked.
//
Device(SND1) { // Joystick (Game Port)
Name(_HID,EISAID("SND0001")) // example ID for Joystick
Name(_EJD,"\_SB.PCI0.DOCK") // means dock-dependent device
Method(_STA,0) { // Status of the Joystick
if (\_SB.PCI0.ISA.EC0.DSTS) { // docked and functioning
Return (0x0F) // return show UI
} else { //When undocked and not shown in UI
Return (0x0B) //return remove UI
}
}
Method (_CRS) { // Current Resources
//Prepare the current resource of UART
//Name (BUFF, buffer(size){data})
Return (BUFF)
}
Method (_PRS) { // Possible Resources
//Prepare the current resource of UART PORT
//Name (BUFF, buffer(size){data})
Return (BUFF)
}
Method (_SRS,1 ) { // Set Resources
// ARG0 = PnP Resource String to Set
//Control of setting resource is placed here
}
Method (_DIS,0 ) { // Disable Resources
//Control of setting resource is placed here
}
} // end SND1
} //end ISA
//******************************
// Dock Objects (PCI-PCI Bridge)
//******************************
Device(DOCK) { // PCI-PCI bridge
Name (_HID, EISAID("PNP0A03")) //_HID for PCI bus
Name (_ADR,0x0004FFFF) // PCI device#,func#
Method (_UID) { //Docking station unique ID
Return (\_SB.PCI0.ISA.EC0.DCID)
}
Method (_STA) { //Status of the DOCK
if (\_SB.PCI0.ISA.EC0.DSTS) { //if docked
Return(0x0F) //return functioning
} else { //if undocked
Return(0x00) //return not exist
}
}
Method (_EJ0, 1) { //supports S0 (hot) undock
Store(0x0, \_SB.PCI0.ISA.EC0.UDR)
Sleep(1000)
}
Method (_EJ3, 1) { //supports S3 undock
Store (0x01, \_SB.PCI0.ISA.EC0.UDW)
}
// PCI SLOT IRQ routing
Name(_PRT, Package(){
Package(){0x0001ffff, 0, LNKA, 0}, // Slot 1, INTA
Package(){0x0001ffff, 1, LNKB, 0}, // Slot 1, INTB
Package(){0x0001ffff, 2, LNKC, 0}, // Slot 1, INTC
Package(){0x0001ffff, 3, LNKD, 0}, // Slot 1, INTD
}
) //end _PRT
} // end DOCK
} //end PCI0
} //end \_SB
} //end DefinitionBlock
CPU/
CPU Memory/
PCI Bridge Audio
L2
PCI BUS
USB
PIC, PIT, LAN
IDE DMA, IDE, Graphics
ADD IN
Wake USB, RTC, Ring Indicate
ACPI HW
ISA BUS AUX Wake
Vcc
Floppy Serial Port 1
Mouse
Keyboard Super I/O Modem RJ11
Printer Serial/IR Port 2
Device Description
Chipset Intel
LAN Assumed a standard LAN card with a “Magic Packet” output. Magic
packet output routed to chip set to generate wake event.
Modem Standard modem chip set interfaced through one of the serial ports.
Ring Indicate wired direct to RI# wake up input on the chip set.
Sleep
Run
Message
VRAM
USB Port
PIC,
PIT, Graphics CRT
USB Port
DMA,
RTC
Batt
IDE,
USB, PCI Card Slots
L
HDD
0
RTC A
N
BM IDE
Wake
CD-ROM
RI# Vcc Aux
COM
IR ISA Bus
Flash
Module ACPI
ISA Bus
FDD BIOS
LPT
3.2.1 Structure of the Data and Address Buses in ACPI Name Space
The backbone of ACPI name space is the hierarchy of device objects for the data and address buses, which is
shown below. The desktop concept machine is a single-processor, single-root bridge machine and that shows
in the diagram below.
\_PR
\_S0
\_S1
\_S2
\_S4
\_S5
\_PTS
\_WAK
TP1H
TP1L
TP2H
TP2L
TPC
TVAR
\_TZ //Thermal Zone
TSAD
SBYT
WBYT
RBYT
RWRD
SCFG
STOS
STHY
RTMP
PFAN //Power Resource for processor fan
_STA //Status
_ON //Fan On
_OFF //Fan Off
FAN0
_HID //Hardware Device ID
_PR0 //Reference to power resource for D0
THM1
_AL0 //Active cooling device list (e.g. FAN)
_AC0 //
_PSL
_TSP
_TC1
_TC2
_PSV
_CRT //Critical Temp.
_TMP //Get Current temp
_SCP
STMP
\_SI //System Indicator
_MSG
_SST
\_GPE
_L00
\_SB
LNKA
LNKB
LNKC
LNKD
PCI0
_HID
_ADR //Device address on the PCI bus
_CRS //Current Resource (Bus number 0)
_PRT
PX40
_ADR
USB0
_ADR
_STA
_PRW
PX43
_ADR
ISA
PIC
_HID
_CRS
MEM
_HID
_CRS
DMA
_HID
_CRS
TMR
_HID
_CRS
RTC
_HID
_CRS
SPKR
_HID
_CRS
COPR
_HID
_CRS
ENFG
EXFG
JOY1
FDC0 //Floppy Disk controller
_HID //Hardware Device ID
_STA //Status of the Floppy disk controller
_DIS //Disable
_CRS //Current Resource
_PRS //Possible Resource
_SRS //Set Resource
UAR1 //Communication Device (Modem Port)
_HID //Hardware Device ID
_STA //Status of the Communication Device
_DIS //Disable
_CRS //Current Resource
_PRS //Possible Resource
_SRS //Set Resource
_PRW //Wake-up control method
IRDA //IRDA device
_HID //Hardware Device ID
_STA //Status of the COM device
_DIS //Disable
_CRS //Current Resource
_PRS //Possible Resource
_SRS //Set Resource
COMB
_HID //Hardware Device ID
_STA //Status of the COM device
_DIS //Disable
_CRS //Current Resource
_PRS //Possible Resource
_SRS //Set Resource
FIRA //Fast IR device
_HID //Hardware Device ID
_STA //Status of the COM device
_DIS //Disable
_CRS //Current Resource
_PRS //Possible Resource
_SRS //Set Resource
LPT //Standard Printer
_HID //Hardware Device ID
_STA //Status of the printer device
_DIS //Disable
_CRS //Current Resource
_PRS //Possible Resource
_SRS //Set Resource
ECP //Extended capabilities Port
_HID //Hardware Device ID
_STA //Status of the port device
_DIS //Disable
_CRS //Current Resource
_PRS //Possible Resource
_SRS //Set Resource
PS2M //PS2 Mouse Device
_HID
_STA
_CRS
PS2K
_HID
_CRS
_STA
// IDE, Video and Audio don’t appear as there is no value added hardware and
// system uses the standard PCI PnP and standard driver support power
// management
LAN0
_ADR
_PRW
CPU/
CPU Memory/
L2 PCI Bridge
SMB BUS
LM75 PCI BUS
90
85
80
75
60
Start CPU
55
50
Throttling
Turn On Fan 45
40
35
30
25
20
15
10
5
3.3.2.3 Writing ASL Code that Carries Out the Thermal Policy
The objects that define the thermal policy for a platform are placed under the \_TZ scope in the ACPI name
space hierarchy.
Object Description
_ACx Returns Active trip point in tenths Kelvin
_ALx List of pointers to active cooling device objects
_CRT Returns critical trip point in tenths Kelvin
_PSL List of pointers to passive cooling device objects
_PSV Returns Passive trip point in tenths Kelvin
_SCP Sets user cooling policy (Active or Passive)
_TC1 Thermal constant for Passive cooling
_TC2 Thermal constant for Passive cooling
_TMP Returns current temperature in tenths Kelvin
_TSP Thermal sampling period for Passive cooling in tenths of seconds
Following is the ASL code that maintains the state of the Thermal Zone. The buffer TVAR has three fields:
PLCY (set the 0 if the current user policy is Active and set to 1 if the current user policy is Passive), and
CTOS and CTHY (which hold the values for the two LM75 registers). Note the ASL coding technique of the
ASL CreateByteField and CreateWordField terms to create named fields (substrings) out of a string in a
Buffer.
//
// Thermal Zones
// Define thermal constants, flag and variables
Name(TP1H, 3332) // Trip point 1 high = 60.0c
Name(TP1L, 3282) // Trip point 1 low = 55.0c
Name(TP2H, 3432) // Trip point 2 high = 70.0c
Name(TP2L, 3382) // Trip point 2 low = 65.0c
Name(TPC, 3532) // Critical trip point = 80.0c
Name(TVAR, Buffer(){1, 32, 33, 82, 32}) // Thermal variables and flag
CreateByteField(TVAR, 0, PLCY) // Default policy to passive
CreateWordField(TVAR, 1, CTOS) // Current Tos = 40.0c
CreateWordField(TVAR, 3, CTHY) // Current Thyst = 35.0c
The ASL code that implements the thermal policy for the Desktop concept machine is shown below (line
numbers are artifacts to make it easier to refer to particular lines of code).
Lines 56 through 64 is a control method that sets one of the trip point registers in the LM75. This method,
named ‘STMP’, takes two arguments: which trip point register to set in the LM75 (high or low); the
temperature value to put into the register. The STMP method uses the STOS or STHY method to move the
new value into the appropriate LM75 register (the ASL code for the STOS and STHY methods is shown in a
later section; an SMBus interface is used by these methods to communicate with the LM75 and that is beyond
the scope of this discussion).
1 Scope(\_TZ)
2 {
3 // Start of _TZ
4 PowerResource(PFAN, 0, 0) { //Power Resource for Processor Fan
5 Method(_STA,0) {
6 Return(FANM) // get fan status
7 }
8 Method(_ON){ // Switch on the FAN
9 Store(1,FANM) // Bit 0 of GPOB is used to control the
10 // Fan Motor
11 } // End Of _ON
12 Method(_OFF){
13 Store(0,FANM) // reset bit0, turn off FAN
14 } // End of _OFF
15 } // End of Power Resource PFAN
16 Device(FAN0) {
17 Name(_HID, "PNP0C0B")
18 Name(_PR0, Package(1){PFAN})
19 }
20 ThermalZone(THM1) {
21 // Kelvin = Celsius + 273.2
22 // Active cooling objects _AL0 and _AC0
23 Name(_AL0, Package(1){FAN}) //Active cooling device list
24 Method(_AC0, 0) { //Returns active trip point
25 If(Or(PLCY, PLCY, Local7)) { //Passive policy is current
26 Return(TRP1)}
27 Else { //Active policy is current
28 Return(TRP2)}
29 } // Method(_AC0)
30 // Passive cooling objects
31 Name(_PSL, Package(1){\_PR.CPU0}) //Passive cooling device list
32 Name(_TSP, 30) //Returns passive cooling sampling period
33 Name(_TC1, 4) //Returns passive cooling thermal constant
34 Name(_TC2, 4) //Returns passive cooling thermal constant
35 Method(_PSV, 0) { //Returns passive trip point
36 If(Or(PLCY, PLCY, Local7)) { //Passive policy is current
37 Return(TRP2)}
38 Else { //Active policy is current
39 Return(TRP1)}
40 } // Method(_PSV)
41 Method(_CRT, 0) { //Returns critical trip point
42 Return(TRPC)
43 }
44 Method(_TMP, 0) {
45 Return(RTMP())
46 } // Method(_TMP) //Returns current temperature
47 Method(_SCP, 1) { //Sets current user policy
48 If(Arg0) { //Current policy is passive
49 Store(One, PLCY)}
50 Else { //Current policy is active
51 Store(Zero, PLCY)
52 }
53 Notify(\_TZ.THRM, 0x81) // Notify trip point change
54 } // Method(_SCP)
55 // Set temperature trip point
56 Method(STMP, 2) {
57 // Arg0 = trip point type (0 - high, 1 - low)
58 // Arg1 = temperature value word
59 Store(Arg1, DW00)
60 If(Arg0) { // Set trip point low
61 STHY(DB00, DB01)}
62 Else { // Set trip point high
63 STOS(DB00, DB01)}
64 } // Method(STMP)
65 } // ThermalZone(THRM)
66 } // Scope(\_TZ)
The ASL code in the following two Include files provides the communication with the LM75 over the SMBus.
// Multiply temperature by 10 to
// convert it to format xx.y (255 => 25.5c)
// After shift, DW01 has temperature*8 in Celsius
ShiftLeft(DW00, 2, DW01)
Add(DW01, DW00, DW00)
Return(DW00)
} // Method(RTMP)
3.3.3.2 Writing ASL Code that Supports the Desktop Power Button
As stated in the previous section, no ASL code is required to directly support the power button because the
desktop concept machine power button is a fixed power button. (If the power button on the concept machine
was a control method power button, ASL code would be required to declare a Power Button Device object.)
The block of ASL code that indirectly supports system sleeping and waking states (and the power button) for
the Desktop concept machine is shown below
3.3.4 Operation Region and Field Definitions for a Super I/O Chip
The SMC Super I/O chip registers are read and written through a level of indirection. A working register is
accessed by designating a particular register in an 8-bit Index register and reading or writing the working
register through an 8-bit Data register. The ASL language OperationRegion, Field, and IndexField terms
can be declared in combination to define this two-tier register arrangement, assigning field names to the
working registers of interest. Once this declaration is made, simple Store terms can be used to read from and
write to the field names and the ACPI run-time component built into the OS automatically takes care of all the
details of managing the Index and Data registers.
For example, the block of ASL code that declares field names for Super I/O chip working registers is shown
below (line numbers are artifacts to make it easier to refer to particular lines of code).
Scope(\_TZ)
{
Include ("lm75.asl")
// Start of _TZ
Method(_OFF){
Store(0,FANM) // reset bit0, turn off FAN
} // End of _OFF
Device(FAN0) {
Name(_HID, "PNP0C0B")
Name(_PR0, Package(1){PFAN})
}
ThermalZone(THM1) {
// Kelvin = Celsius + 273.2
// Active cooling
Name(_AL0, Package(1){FAN})
Method(_AC0, 0) {
If(Or(PLCY, PLCY, Local7)) { // Passive policy
Return(TRP1)}
Else { // Active policy
Return(TRP2)}
} // Method(_AC0)
// Passive cooling
Name(_PSL, Package(1){\_PR.CPU0})
Name(_TSP, 30) // Sampling period
Name(_TC1, 4)
Name(_TC2, 4)
Method(_PSV, 0) {
If(Or(PLCY, PLCY, Local7)) { // Passive policy
Return(TRP2)}
Else { // Active policy
Return(TRP1)}
} // Method(_PSV)
Method(_CRT, 0) {
Return(TRPC)}
Method(_TMP, 0) {
Return(RTMP())
} // Method(_TMP)
Method(_SCP, 1) {
If(Arg0) { // Passive policy
Store(One, PLCY)}
Else { // Active policy
Store(Zero, PLCY)}
//
// System Indicators
//
Scope(\_SI)
{ // Start of _SI
Method(_MSG, 1)
{
If (LEqual(ARG0,Zero))
{Store(Zero, MSG)} //Turn message light off if no messages
Else
{Store(One, MSG)} //Turn message light on if any messages
} // End of Method
Method(_SST, 1) {
If (LEqual(Arg0,Zero)) {
Store(Zero,IND0) //Turn both status indicators off
Store(Zero,IND1)
Return(0)}
If (LEqual(Arg0,One)) {
Store(One,IND0) //Turn on both indicators for working state
Store(One,IND1)
Return(0)}
If (LEqual(Arg0,2)) {
Store(Zero,IND0) //Turn on IND1 indicator for s1, s2 or s3 state
Store(One,IND1)
Return(0)}
If (LEqual(Arg0,3)) {
Store(One,IND0) //Turn on IND0 indicators for working state
Store(Zero,IND1)
Return(0)}
If (LEqual(Arg0,4)) {
Store(Zero,IND0) //Turn both indicators off for non-volatile sleep
Store(Zero,IND1)
Return(0)}
} // End of Method
} // End of _SI
//
// General Purpose Event Handlers
//
Scope(\_GPE){
Method (_L00){ //GP event for thermal
Notify(THM1,0)
}
} //end GPE
//
// System Bus
//
Scope(\_SB) { // Start of _SB
Device(LNKA){
Name(_HID, EISAID("PNP0C0F")) // PCI interrupt link
Name(_UID, 1)
// Name(_PRS, ResourceTemplate(){
// Interrupt(ResourceProducer,...) {10,11} // IRQs 10,11
// })
// Method(_DIS) {...}
// Method(_CRS) {...}
// Method(_SRS, 1) {...}
}
Device(LNKB){
Name(_HID, EISAID("PNP0C0F")) // PCI interrupt link
Name(_UID, 2)
// Name(_PRS, ResourceTemplate(){
// Interrupt(ResourceProducer,...) {11,12} // IRQs 11,12
// })
// Method(_DIS) {...}
// Method(_CRS) {...}
// Method(_SRS, 1) {...}
}
Device(LNKC){
Name(_HID, EISAID("PNP0C0F")) // PCI interrupt link
Name(_UID, 3)
// Name(_PRS, ResourceTemplate(){
// Interrupt(ResourceProducer,...) {12,13} // IRQs 12,13
// })
// Method(_DIS) {...}
// Method(_CRS) {...}
// Method(_SRS, 1) {...}
}
Device(LNKD){
Name(_HID, EISAID("PNP0C0F")) // PCI interrupt link
Name(_UID, 4)
// Name(_PRS, ResourceTemplate(){
// Interrupt(ResourceProducer,...) {13,14} // IRQs 13,14
// })
// Method(_DIS) {...}
// Method(_CRS) {...}
// Method(_SRS, 1) {...}
}
Name(_PRT, Package(){
Device(JOY1)
{
} //end of JOY1 device
// End of SMC device
}
)
CreateByteField (BUF0, 0x02, IOLO)//IO Port Low
CreateByteField (BUF0, 0x03, IOHI)//IO Port High
CreateByteField (BUF0, 0x04, IORL)//IO Port Low
CreateByteField (BUF0, 0x05, IORH)//IO Port High
CreateWordField (BUF0, 0x11, IRQL)//IRQ low
CreateByteField (BUF0, 0x14, DMAV) //DMA
ENFG()
Store(Zero,LDN) // Logical device number for floppy
// Write current settings into IO descriptor
Store(IOAL, IOLO)
Store(IOAL, IORL)
Store(IOAH, IOHI)
Store(IOAH, IORH)
// Write current settings into IRQ descriptor
Store(One,Local0)
ShiftLeft(Local0,INTR,IRQ)
Store(One, Local0)
ShiftLeft(Local0,DMCH,DMAV)
EXFG()
Return(BUF0) // Return Buf0
} // end _CRS method
Name(_PRS,Buffer(192) //24*8
{
0x47, //IO Port Descriptor
0x01, //16 bit decode
0xF2, //IO Port Range Minimum Base Low
0x03, //IO Port Range Minimum Base High
0xF2, //IO Port Range Maximum Base LOW
0x03, //IO Port Range Maximum Base High
0x02, //Base Alignment
0x04, //Length of contiguous IO Ports
ENFG()
//set Logical Device Number for Serial Port 1
Store(0x04, LDN)
//set base IO address
Store(IOLO, IOAL)
Store(IOHI, IOAH)
//set IRQ
FindSetRightBit(IRQ,INTR)
//Activate
Store(ONE, ACTR) //Set activate configuration register
EXFG()
}//End of _SRS Method
Method(_PRW,0){ //Wake-up control method
Return(10) //RI is wired to the chipset as a wake event
} // end of _PRW method
} // end of UART1 device
And(GP40,0x18,Local0)
If (LEqual(Local0,0x11))
{Return(0x3)} // FIR mode
Else
{Return(Zero)} // not FIR mode
}
}
Else
{Return(Zero)}
} // end _STA method
Method(_DIS,0){ //Disable
//set logical device number for Serial Port 2
ENFG() // Config Mode
Store(0x05,LDN)
//Disable DMA
Store(Zero,DMCH)
//disable interrupt
Store(Zero,INTR)
//Set Activate Register to zero
Store(Zero, ACTR)
EXFG() // Normal Mode
} // end _DIS method
Method(_CRS,0){ //Current Resource
Name(BUF4,Buffer()
{ //16*8
0x47, //IO Port Descriptor
0x01, //16 bit decode
0xF8, //IO Port Range Minimum Base Low
0x02, //IO Port Range Minimum Base High
0xF8, //IO Port Range Maximum Base LOW
0x02, //IO Port Range Maximum Base High
0x08, //Base Alignment
0x08, //Length of contiguous IO Ports
0x0,
// LPT DEVICE
Device(LPT) {
Name (_HID, EISAID("PNP0400")) // PnP ID for SMC LPT Port
Method (_STA, 0) { // LPT Device Status
ENFG() // Config Mode
And(OPT1,0x7,Local0) // Extract mode bits
If (LEqual(Local0, 0x4)){
If (ACTR)
{Return(3)} // Device present and active
Else
{Return(One)} // Not present
}//Present not active
Else
{Return(0) //Not present
}
EXFG()
} // end of _STA method
Method (_DIS) { // LPT Device Disable
ENFG()
Store (0x03,LDN) // Select PRN Device (LDN = 03)
Store (Zero, INTR) // disable INTR
Store (Zero, ACTR) // Set Activate Reg = 0
EXFG()
} // End of _DIS Method
// LPT _CRS METHOD
Method (_CRS) { // LPT Current Resources
Name(BUF5, Buffer ()
{ //13*8 Length of Buffer
0x47, // IO port descriptor
0x01, // 16 bit decode
0x78, // LPT1 @ 0x278h
0x02,
0x78,
0x02,
0x08, //alignment
0x08, //number of ports
0x03,
0x78,
0x03,
0x08, // alignment
0x04, // number of ports
0x08, // alignment
0x04, // number of ports
0x08, // alignment
0x04, // number of ports
0x08, // alignment
0x04, // number of ports
0x08, // alignment
0x04, // number of ports
0x08, // alignment
0x04, // number of ports
0x08, // alignment
0x04, // number of ports
3.4.7 PS2 Mouse and Keyboard Port Device ASL Include File
This section shows the contents of the Include file Smc_ps2.asl.
Note that the following ASL code is an example only, for illustrative purposes.
3.4.8 Include File ASL Code for the Single Configuration ISA Devices
For single-configuration devices, only two objects must be declared under the Device object in the name space:
• _HID, which reports the device Plug and Play ID
• _CRS, which reports the device’s single configuration.
Following is a list of the Device objects that represent single-configuration devices on the desktop concept
machine. On the desktop concept machine, all these devices are under the ISA bus. All other devices on the
desktop concept machine meet the requirement of having being relocatable (having more than one set of
possible resource settings) and having the capability of being disabled.
The ASL code that declares the Device object, Plug and Play device class ID, and the one and only
configuration for each of these six devices is listed below.
Device(MEM) { // Memory
Name(_HID, EISAID("PNP0C01")) // Hardware Device ID
Name(_CRS,Buffer()
{
0x86, // 32 Bit Fixed Descriptor
0x09, // Length
0x00,
0x13, // MD_FLAG_WRITABLE + MD_FLAG_CACHEABLE + MD_FLAG_WIDTH_8_16
0x00, // Base Address 0
0x00,
0x00,
0x00,
0x00, // Length 640K
0x00,
0x0A,
0x00,
0x86, // 32 Bit Fixed Descriptor
0x09, // Length
0x00,
0x12, // MD_FLAG_CACHEABLE + MD_FLAG_WIDTH_8_16
0x00, // Base Address 000E0000
0x00,
0x0E,
0x00,
0x00, // Length 128K
0x00,
0x02,
0x00,
0x79,
0x00
} // end Buffer
) // end Name
} // End MEM device
Device(TMR) { // Timer
Name(_HID,EISAID("PNP0100")) // Hardware Device ID
Name(_CRS,Buffer(){
0x47, // IO port descriptor
0x01, // 16 Bit Decode
0x40, // Range min. base low for timer
0x00, // Range min. base high for timer
0x40, // Range max. base low for timer
0x00, // Range max. base high for timer
0x01, // Alignment
0x04, // No. Contiguous ports
Device(SPKR) { // Speaker
Name(_HID,EISAID("PNP0800")) // Hardware Device ID
Name(_CRS,Buffer(){
0x47, // IO port descriptor
0x01, // 16 Bit Decode
0x61, // Range min. base low for Spkr
0x00, // Range min. base high for Spkr
0x61, // Range max. base low for Spkr
0x00, // Range max. base high for Spkr
0x01, // Alignment
0x01, // No. Contiguous ports
Device(JOY1)
{
} //end of JOY1 device
// End of SMC device
}
)
CreateByteField (BUF0, 0x02, IOLO)//IO Port Low
CreateByteField (BUF0, 0x03, IOHI)//IO Port High
CreateByteField (BUF0, 0x04, IORL)//IO Port Low
CreateByteField (BUF0, 0x05, IORH)//IO Port High
CreateWordField (BUF0, 0x11, IRQL)//IRQ low
CreateByteField (BUF0, 0x14, DMAV) //DMA
ENFG()
Store(Zero,LDN) // Logical device number for floppy
// Write current settings into IO descriptor
Store(IOAL, IOLO)
Store(IOAL, IORL)
Store(IOAH, IOHI)
Store(IOAH, IORH)
// Write current settings into IRQ descriptor
Store(One,Local0)
ShiftLeft(Local0,INTR,IRQ)
Store(One, Local0)
ShiftLeft(Local0,DMCH,DMAV)
EXFG()
Return(BUF0) // Return Buf0
} // end _CRS method
Name(_PRS,Buffer(192) //24*8
{
0x47, //IO Port Descriptor
0x01, //16 bit decode
0xF2, //IO Port Range Minimum Base Low
0x03, //IO Port Range Minimum Base High
0xF2, //IO Port Range Maximum Base LOW
0x03, //IO Port Range Maximum Base High
0x02, //Base Alignment
0x04, //Length of contiguous IO Ports
F
A
N Main System Fan Control
Override
A/D
SMBUS
CPU's
APIC
BUS
ECC Memory
Bus Controler Bus Controller
Controller
D D
R R
A A
M M
PCI Bus 1
PCI Bus 0
Wake
PCI Card Slots
L L L
LAN A A A
N N N
The prominent hardware components in the server concept machine design are described in the following
table.
Device Description
Device Description
Hard Drives Supported via SCSI on the motherboard. Two separate controllers are
used. One controller is used to support the internal drives. The
second controller supports drives in an external drive cabinet. Drives
are hot swappable. Locking mechanisms are used to control the hot
swap function.
Modem Standard modem chip set interfaced through one of the serial ports.
Ring Indicate wired direct to RI# wake up input on the chip set.
Embedded Controller Used for thermal management, voltage monitoring and tampering
alarm.
APIC Bus
IOAPIC
PCI BUS 0
PIT,
On/Off/Overide
DMA,
IDE,
USB,
Momentary
RTC,
ACPI HW
USB Port
USB Port
VRAM
RTC
Batt
Graphics CRT
BM IDE
CD-ROM
ISA Card Slots
RI#
ISA Bus
COM
ISA Bus
FDD
LPT
Embedded
Controller
Main System Fan Control
External Cabinet Fan Control
Drive 1 Eject Button
Drive 1 Present
Drive 1 Lock
...
Drive 8 Eject Button
ISA Bus Drive 8 Present
Drive 8 Lock
SMBUS
Run Sleep
Message
HDD HDD
1 2
HDD HDD
5 6
SMBUS A/D
remove a drive. A mechanical lock mechanism prevents removal of a drive until the OS acknowledges that it
is ready through the microcontroller. An indicator shows when the lock has been released.
Buffer
ID Switches
HDD 6
Lock
Control
DRIVE Present
Switch
DRIVE Remove
Request Switch
Interrupts
... APIC BUS
APIC Graphics
PCI BUS 0
USB
PIT,
IDE DMA, IDE,
Wake USB, RTC, Ring Indicate
ACPI HW
ISA BUS
The following example ASL code sketches an implementation of PCI interrupt routine on the server concept
machine. For a more developed block of ASL code that implements PCI interrupt routing, see section 6 of the
Guide.
4.3.3 Operation Region and Field Declarations for a Super I/O Chip
The National Super I/O chip registers are read and written through two levels of indirection. The ASL
language OperationRegion, Field, and BankField terms can be declared in combination to define this three-
tier register arrangement, assigning field names to the working registers of interest. Once this declaration is
made, simple Store terms can be used to read from and write to the field names and the ACPI run-time
component built into the OS automatically takes care of all the details of managing the levels of indirection.
For example, the block of ASL code that declares field names for the National Super I/O chip working
registers is shown below.
Offset(0x30),
KEN, 8, // Enable/Disable the keyboard
Offset(0x60),
KAD0, 8, // KBC data port (15-8)
KAD1, 8, // KBC data port (7-0)
KAD2, 8, // KBC command port (15-8)
KAD3, 8, // KBC command port (7-0)
Offset(0x70),
KIR0, 8, // IRQ Pin
KIR1, 8, // IRQ type
}
Offset(0x30),
FEN, 8, // FDC Enable
Offset(0x60),
\_PR
CPU0
CPU1
CPU2
CPU3
\_PTS
\_S0
\_S1
\_S4
\_S5
\_WAK
\_SI //System Indicator
_MSG
_SST
// IDE and Video don’t appear as there is no value added hardware and
// system uses the standard PCI PnP and standard driver support power
// management
// Note: The following name space objects do not have matching ASL code
// in this revision of the “ACPI Implementers Guide”
\PCI1
_HID //Hardware Device ID
_ADR //Device address
_CRS //Current Resource (Bus number 1)
SCS0 //SCSI controller
_ADR //Device address
HDD1 //SCSI Hard drive device
_STA //Status of device
_IRC //Inrush Current
_LCK //Lock control
HDD2 //SCSI Hard drive device
_STA //Status of device
_IRC //Inrush Current
_LCK //Lock control
HDD3 //SCSI Hard drive device
_STA //Status of device
_IRC //Inrush Current
_LCK //Lock control
HDD4 //SCSI Hard drive device
_STA //Status of device
_IRC //Inrush Current
_LCK //Lock control
SCS1 //SCSI controller
_ADR //Device address
Note that the following ASL code is an example only, for illustrative purposes.
DefinitionBlock (
"SRV_exa1.aml",
"DSDT",
0x10,
"OEMy",
"SRV_xmpl",
0x1000
)
{ //start of code block
// Processor Objects
Scope(\_PR) { //
Processor
( CPU0,
1, //processor number
0x0, //C2 and C3 not supported in this implementation
0
) {}
Processor
( CPU1,
2, //processor number
0x0,
0
) {}
Processor
( CPU2,
3, //processor number
0x0,
0
) {}
Processor
( CPU3,
4, //processor number
0x0,
0
) {}
} //end \_PR
// General methods
Method(\_PTS,1) //Prepare to sleep
{
//Arg0 gives sleep type number
}
Name(\_S0,Package(2){5,5}) //Value to be set in SLP_TYP register (S0)working state
//on this chip set
Name(\_S1,Package(2){4,4}) //Value to be set in SLP_TYP register for S1 state
//on this chip set
Name(\_S4,Package(2){Zero,Zero}) //Value to be set in SLP_TYP register for Soft Off
//on this chip set
Name(\_S5,Package(2){Zero,Zero}) //Value to be set in SLP_TYP register for Soft Off
// on this chip set
Method(\WAK,1) //Method which runs after wake up
{
//Arg 0 has SLP_TYP which has just ended
}
// System Indicators
Scope(\_SI)
{ //
Method(_MSG, 1)
{
If (LEqual(Arg0,Zero))
{Store(Zero, EC0.MSG)} //Turn message light off if no messages
Else
{Store(One, EC0.MSG)} //Turn message light on if any messages
}
Method(_SST, 1)
{
If (LEqual(Arg0,Zero))
{
Store(Zero,EC0.IND0) //Turn both status indicators off
Return(0)
}
If (LEqual(Arg0,One))
{
Store(3, EC0.IND0) //Turn on both indicators for working state
Return(0)
}
If (LEqual(Arg0,2))
{
Store(2,EC0.IND0) //Turn on one indicator for s1, s2 or s3 state
Return(0)
}
If (LEqual(Arg0,3))
{
Store(3,EC0.IND0) //Turn on both indicators for working state
Return(0)
}
If (LEqual(Arg0,4))
{
Store(Zero,EC0.IND0) //Turn both indicators off for non-volatile sleep
Return(0)
}
} // end _SST method
} //end system indicators
// Thermal Zones
Scope(\_TZ)
{
PowerResource(PFN0, 1, 0)
{ //Power resource for system fan
Method(_STA,0)
{
Return(EC0.FAN0) //get fan status
}
Method(_ON,0)
{
Store(One,EC0.FAN0) //turn fan on
}
Method(_OFF,0)
{
Store(Zero,EC0.FAN0) //turn fan off
}
} //end PFN0
PowerResource(PFN1, 1, 0)
{ //Power resource for drive cabinet fan
Method(_STA,0)
{
Return(EC0.FAN1) //get fan status
}
Method(_ON,0)
{
Store(One,EC0.FAN1) //turn fan on
}
Method(_OFF,0)
{
Store(Zero,EC0.FAN1) //turn fan off
}
} //end PFN1
Device(FAN0)
{
Name(_HID, "PNP0C0B")
Name(_PR0, Package(){PFN0})
}
Device(FAN1)
{
Name(_HID, "PNP0C0B")
Name(_PR0, Package(){PFN1})
}
ThermalZone(THM0)
{
Method(_TMP,0)
{
Return(EC0.TMPV) //Get current temp
}
Method(_AC0,0)
{
Return(EC0.AC0V) //active cooling trip point
}
Name(_AL0,Package(){FAN0}) //active cooling device list
Method(_CRT,0)
{
Scope(\_GPE){ //
Method(_L00) { //GP event handle to GP_STS.00
Notify(EC0,0) //EC event notification
}
} //end general purpose events
Scope(\_SB) { //
Device(LNKA){
Name(_HID, EISAID("PNP0C0F")) // PCI interrupt link
Name(_UID, 1)
// Name(_PRS, ResourceTemplate(){
// Interrupt(ResourceProducer,...) {10,11} // IRQs 10,11
// })
// Method(_DIS) {...}
// Method(_CRS) {...}
// Method(_SRS, 1) {...}
}
Device(LNKB){
Name(_HID, EISAID("PNP0C0F")) // PCI interrupt link
// Name(_UID, 2)
// Name(_PRS, ResourceTemplate(){
// Interrupt(ResourceProducer,...) {11,12} // IRQs 11,12
// })
// Method(_DIS) {...}
// Method(_CRS) {...}
// Method(_SRS, 1) {...}
}
Device(LNKC){
Name(_HID, EISAID("PNP0C0F")) // PCI interrupt link
// Name(_UID, 3)
// Name(_PRS, ResourceTemplate(){
// Interrupt(ResourceProducer,...) {12,13} // IRQs 12,13
// })
// Method(_DIS) {...}
// Method(_CRS) {...}
// Method(_SRS, 1) {...}
}
Device(LNKD){
Name(_HID, EISAID("PNP0C0F")) // PCI interrupt link
// Name(_UID, 4)
// Name(_PRS, ResourceTemplate(){
// Interrupt(ResourceProducer,...) {13,14} // IRQs 13,14
// })
// Method(_DIS) {...}
// Method(_CRS) {...}
// Method(_SRS, 1) {...}
}
Name(_PRT, Package(){
Package(){0x0004ffff, 0, LNKA, 0}, // Slot 1, INTA
Package(){0x0004ffff, 1, LNKB, 0}, // Slot 1, INTB
Package(){0x0004ffff, 2, LNKC, 0}, // Slot 1, INTC
Package(){0x0004ffff, 3, LNKD, 0}, // Slot 1, INTD
Package(){0x0005ffff, 0, LNKB, 0}, // Slot 2, INTA
Package(){0x0005ffff, 1, LNKC, 0}, // Slot 2, INTB
Package(){0x0005ffff, 2, LNKD, 0}, // Slot 2, INTC
Package(){0x0006ffff, 3, LNKA, 0}, // Slot 2, INTD
Package(){0x0006ffff, 0, LNKC, 0}, // Slot 3, INTA
Package(){0x0006ffff, 1, LNKD, 0}, // Slot 3, INTB
Package(){0x0006ffff, 2, LNKA, 0}, // Slot 3, INTC
Package(){0x0006ffff, 3, LNKB, 0}, // Slot 3, INTD
})
// }
// ACPI assumes RTC can wake system from S1-S5
} // end RTC device
Include("Coproc.asl")
Include("DMA.asl")
Include("INTR.asl")
Include("Memory.asl")
Include("Spkr.asl")
Include("Timer.asl")
Name(_PRT, Package(){
Package(){0x0004ffff, 0, LNKA, 0}, // Slot 1, INTA
Package(){0x0004ffff, 1, LNKB, 0}, // Slot 1, INTB
Package(){0x0004ffff, 2, LNKC, 0}, // Slot 1, INTC
Package(){0x0004ffff, 3, LNKD, 0}, // Slot 1, INTD
Package(){0x0005ffff, 0, LNKB, 0}, // Slot 2, INTA
Package(){0x0005ffff, 1, LNKC, 0}, // Slot 2, INTB
Package(){0x0005ffff, 2, LNKD, 0}, // Slot 2, INTC
Package(){0x0006ffff, 3, LNKA, 0}, // Slot 2, INTD
Package(){0x0006ffff, 0, LNKC, 0}, // Slot 3, INTA
Package(){0x0006ffff, 1, LNKD, 0}, // Slot 3, INTB
Package(){0x0006ffff, 2, LNKA, 0}, // Slot 3, INTC
Package(){0x0006ffff, 3, LNKB, 0}, // Slot 3, INTD
})
} //end SCS0
Scope(EIO){
// Defines the configuration programming model for the National 307
// Super I/O chip. Its assumed that BIOS initializes this chip to the
// Following addresses:
// Index port: 0x2E
// Data port: 0x2F
Offset(0x30),
KEN, 8, // Enable/Disable the keyboard
Offset(0x60),
KAD0, 8, // KBC data port (15-8)
KAD1, 8, // KBC data port (7-0)
KAD2, 8, // KBC command port (15-8)
KAD3, 8, // KBC command port (7-0)
Offset(0x70),
KIR0, 8, // IRQ Pin
KIR1, 8, // IRQ type
}
Offset(0x30),
FEN, 8, // FDC Enable
Offset(0x60),
NULL, 5,
UBEX, 1 // Enables the extended banks to be accessed
}
Include("307_PS2.asl")
Include("307_FDC.asl")
Include("307_PRT.asl")
Include("307_UAR1.asl")
Include("307_UAR2.asl")
}
ShiftLeft(Local0,KIR0,IRQ)
Return(BUF7) //Return Buf7
} //end _CRS
Method(_STA,0){ //Status of the PS2 Keyboard device
If (KEN)
{Return(3)}
Else
{Return(One)}
} //end _STA
}//end of PS2K
// LPT DEVICE
Device(LPT) {
Name (_HID, EISAID("PNP0400")) // PnP ID for LPT Port
Method (_STA, 0) { // LPT Device Status
If(LEqual(PMOD, 0x1)){
If (PEN)
{Return(3)} // Device present and active
Else
{Return(One)} // Present not active
}
Else
{Return(0)} // Not present
} // End of _STA Method
Method (_DIS) { // LPT Device Disable
Store (Zero, PIR0) // disable INTR
Store (Zero, PEN) // Set Activate Reg = 0
} // end of _DIS method
// LPT _CRS METHOD
Method (_CRS) { // LPT Current Resources
Name(BUF5, Buffer () //13*8 Length of Buffer
{
0x47, // IO port descriptor
0x01, // 16 bit decode
0x78, // LPT1 @ 0x0278h
0x02,
0x78,
0x02,
0x08, // alignment
0x08, // number of ports
// No DMA
0x38, // End Dependent Function
0x08, // alignment
0x04, // number of ports
0x08, // alignment
0x04, // number of ports
}
) // end _PRS
// Convert setbit position in IRQL:IRQH into 4bit field and write to PnP INTR reg
FindSetLeftBit(IRQW, PIR0) // Wr requested IRQ
0x08, //alignment
0x04, //number of ports
0x08, //alignment
0x04, //number of ports
0x08, // alignment
0x04, // number of ports
0x08, // alignment
0x04, // number of ports
//Activate
Store(ONE, UAEN) //Set activate configuration register
} //end of _SRS method
4.6.1.7 Include File ASL Code for the Single Configuration ISA Devices
For single-configuration devices, only two objects must be declared under the Device object in the name space:
• _HID, which reports the device Plug and Play ID
• _CRS, which reports the device’s single configuration.
The ASL code that declares the Device object, Plug and Play device class ID, and the one and only
configuration for each of the single-configuration devices on the server concept machine is listed below. All
other devices on the desktop concept machine meet the requirement of having being relocatable (having more
than one set of possible resource settings) and having the capability of being disabled.
Device(PIC) { // IOAPIC
Name(_HID,EISAID("_PNP_")) // Hardware Device ID
Name(_CRS,Buffer()
{
0x79, // End Tag
0x00
}
) // End of _CRS
} // End of PIC
Device(MEM) { // Memory
Name(_HID, EISAID("PNP0C01")) // Hardware Device ID
Name (_CRS,Buffer()
{
0x86, // 32 Bit Fixed Descriptor
0x09, // Length
0x00,
0x09, // Length
0x00,
0x79,
0x0
}
) //end _CRS
} //end Memory
Device(SPKR) { // Speaker
Name(_HID,EISAID("PNP0800")) // Hardware Device ID
Name(_CRS,Buffer()
{
0x47, // IO port descriptor
0x01, // 16 Bit Decode
0x61, // Range min. base low for Spkr
0x00, // Range min. base high for Spkr
0x61, // Range max. base low for Spkr
0x00, // Range max. base high for Spkr
0x01, // Alignment
0x01, // No. Contiguous ports
Device(TMR) { // Timer
Name(_HID,EISAID("PNP0100")) // Hardware Device ID
Name(_CRS,Buffer()
{
0x47, // IO port descriptor
0x01, // 16 Bit Decode
0x40, // Range min. base low for timer
0x00, // Range min. base high for timer
0x40, // Range max. base low for timer
0x00, // Range max. base high for timer
0x01, // Alignment
0x04, // No. Contiguous ports
• HDD Controllers
• PCI slots
• Chips & Technologies 65554 video controller
• A docking connector for the Proteus II (Moon II)
5.1.1 Modeling the Trajan Motherboard with Objects in the ACPI Namespace
An ACPI name space of device objects that models (at an abstract level) the Trajan motherboard is shown
below (the device object names shown below are used in ASL example code later in this section). Devices not
represented by objects in the name space below are
• The SMBus devices, particularly the ACPI EC interface-compatible embedded controller (EC) that
interfaces with the Smart Battery system of a charger and dual batteries.
• The temperature device (LM-75 accessed through PIIX-4 using ACPI control methods).
\_PR
CPU0
\PIDE //Power resource for IDE0
\PUA1 //Power resource for UART
\_TZ //Thermal control
PFAN //Power resource for Fan
FAN //FAN Device
THRM //Thermal zone
\GPE0 //General Purpose event
_L0B //Lid event
_L09 //Docking event
_L00 //Thermal event
\_SB
PCI0 //PCI root bridge
PX40 //PCI-ISA Bridge
EIO //EIO bus
SIO1 //SIO devices (Floppy, UART1, UART2, LPT)
MDEV //Motherboard devices (Keyboard, Mouse, . . .)
PX41 //PCI IDE Controller
PX42 //USB Host Controller
PX43 //Power Management Controller
MPCI //Docking PCI to PCI bridge
DIDE //Docking PCI IDE Controller
DCBC //Docking CardBus Controller
MISA //Docking PCI to ISA bus
ISA //Docking ISA bus
DBRD //Docking Board Devices
SIO2 //Docking SIO Devices (Floppy, UART2)
PIIX-4
Docking
Cardbus PCI Connectors Cardbus
Controller Slot Controller PCI Slots 1-3
IRQ PIRQ
USB
SCI
The interrupt structure to the left of the line labeled “Docking Connectors” in the diagram can be modeled as a
PCI interrupt routing table using ASL code as shown below.
Store(Local0, IRB1)}
}
Return(BUFB)
} // Method(_CRS)
Method(_SRS, 1) {
// ARG0 = PnP resource string to set
// (IRQ ordering assumed to be same as _PRS/_CRS)
CreateByteField(ARG0, 0x01, IRB1) // IRQ mask 1
CreateByteField(ARG0, 0x02, IRB2) // IRQ mask 2
If(LGreater(IRB2, Zero)) {
Add(IRB2, 8)}
Else {
Store(IRB1, IRB2)}
// Enable and set PIRQ routing
And(PIRB, 0xF0, Local0)
Or(Local0, 0x80, Local0)
Or(IRB2, Local0, PIRB)
}
} // Device(LNKB)
//
Device(LNKC) {
Name(_HID, EISAID("PNP0C0F"))
Name(_UID, 3)
Name(_PRS, Buffer(){
// IRQ descriptor, level, low, IRQ3-7,9-12,14,15
0x22, 0xF8, 0xDE, 0x18,
// End tag
0x79, 0})
Method(_DIS) {
// Disable PIRQ routing
And(PIRC, 0x7F, PIRC)
}
Method(_CRS) {
Name(BUFC, Buffer(){
// IRQ descriptor, level, low, IRQ3-7,9-12,14,15
0x22, 0x00, 0x00, 0x18,
// End tag
0x79, 0})
CreateByteField(BUFC, 0x01, IRC1) // IRQ mask 1
CreateByteField(BUFC, 0x02, IRC2) // IRQ mask 2
And(PIRC, 0x8F, Local0)
If(LGreater(Local0, 0x80)) { // Routing enable
And(Local0, 0x0F) // Mask off enable bit
If(LGreater(Local0, 0x07)) {
Subtract(Local0, 8)
Store(Local0, IRC2)}
Else {
Store(Local0, IRC1)}
}
Return(BUFC)
} // Method(_CRS)
Method(_SRS, 1) {
// ARG0 = PnP resource string to set
// (IRQ ordering assumed to be same as _PRS/_CRS)
CreateByteField(ARG0, 0x01, IRC1) // IRQ mask 1
CreateByteField(ARG0, 0x02, IRC2) // IRQ mask 2
If(LGreater(IRC2, Zero)) {
Add(IRC2, 8)}
Else {
Store(IRC1, IRC2)}
// Enable and set PIRQ routing
And(PIRC, 0xF0, Local0)
Or(Local0, 0x80, Local0)
Or(IRC2, Local0, PIRC)
}
} // Device(LNKC)
Device(LNKD) {
Name(_HID, EISAID("PNP0C0F"))
Name(_UID, 4)
Name(_PRS, Buffer(){
// IRQ descriptor, level, low, IRQ3-7,9-12,14,15
0x22, 0xF8, 0xDE, 0x18,
// End tag
0x79, 0})
Method(_DIS) {
5.2 Initializing the ACPI BIOS During POST and Cold Boot Sequence
Initializing the ACPI BIOS is one step in the cold boot sequence of the Trajan. The steps in the cold boot
sequence are shown below; initializing the ACPI BIOS is the next to the last step:
1. Memory testing and configuration.
2. BIOS shadow.
3. Minimal test of motherboard devices.
Top of Mem
Int 15 Func E820 return value 4: ACPI NVS Memory
Returns start and size of NVS FACS
Reserved
AML Code Chipset Reg Info
Cache Reg Info
ACPI Reclaim Ptr & Size
Int 15 Func E820 return value 3:
ACPI Reclaim
Returns start and size of Reclaim Name space
Somewhere Method code
Above 8 meg
OS Memory
Int 15 functions 88 & E801 At least 7 meg
Returns size from 0 to start of Contiguous
ACPI memory. 100000
CompatabilityArea
RSD PTR
Video BIOS
E0000
The annotations on the above illustration point out the DOS Int 15H functions the BIOS can use determine the
size and location of various types of memory:
DOS Int15H Description Comment
Function
Function 88 Reports up to 16 MB of memory, but not Prevents compatibility problems with old
ACPI Reserved memory. memory managers.
Function E801 Can report more than 16 MB of memory, Prevents compatibility problems with old
but not ACPI Reserved memory. memory managers.
Function E820 Reports memory maps and reserved Expanded to report ACPI reserved areas.
areas.
The logical structure of the loaded ACPI tables with the fixed up pointers is shown in the following figure:
Wake Vector
ACPI NVS Mem Below 1 meg
Global Lock
FACP Table
ACPI Header
Pointers to:
Reclaim
FACS Ptr
Mem DSD Table DSDT Table
PM1a_EVT_BLK
PM1b_EVT_BLK
PM1a_CNT_BLK
RSD Table PM1b_CNT_BLK
Header PM_TMP_BLK
FACP Ptr GP0_BLK
GP1_BLK AML-Code
SSDT Ptr (Differentiated
B/W E0000 & Cache info System
FFFFF PSDT Ptr RTC info Description
Int info Table)
RSD PTR APIC Ptr ACPI enable
Power Button
To H/W
The values in the FACP table for the Trajan with 16 MB of DRAM are shown in the following table.
Field Byte Trajan Value Comment
Length
Signature 4 ‘FACP’ Must be ‘FACP.’
Length 4 74h Length, in bytes, of the entire Fixed ACPI Description
Table.
Revision 1 0x01 For Revision 1.0 of the ACPI Specification, must be
0x01.
Checksum 1 0x96 Entire table must sum to zero.
OEMID 6 ‘Intel’
OEM Table ID 8 ‘Trajan’ Manufacturer model ID.
OEM Revision 4 0x1000 OEM DSDT revision.
Creator ID 4 0 Vendor ID of utility that created the table. For the
DSDT, RSDT, SSDT, and PSDT tables, this is the ID
for the ASL Compiler.
PIIX4 Power
GO01 PIDE
Power
GO02
GO06
GO07
Reset
IDE Drive 0
BM IDE
Reset
IDE Drive 1
The following ASL code creates a PowerResource object in ACPI name space for IDE Drive 1:
5.3.3.1 The BIOS’s Role in Transitioning Out of the Working State (S0)
The OS has direct access to all the registers it needs to initiate a system sleep state. The OS always runs a
\_PTS control method in the ACPI name space at the beginning of each transition to a system sleep state.
An example of one thing that could be done in such a \_PTS method in the Trajan ACPI BIOS would be to
save SMM data changed since POST.
Earlier, when the system switched from S0 to S1, no context was lost. So, at the start of the transition from S1
back to S0, the clocks are stopped and memory is in suspend refresh, but the chipset is on and the processor is
on.
After the OS starts running in the S0 state, it will always run the _WAK control method in the ACPI name
space (passing the value 1 as an argument). An example of what a Trajan BIOS _WAK method could do when
invoked and passed a value of 1, is:
• Notify the OS to do a “device check” for changes in the docking station (by using the following form of
the ASL Notify term: Notify(\_SB.PCI0.MPC1, 1).
• Notify the OS to check and set thermal control (by using the following form of the ASL Notify term:
Notify(\_TZ.THRM, 0x81).
• Notify the OS to do a “device check” for changes in the docking station (by using the following form of
the ASL Notify term: Notify(\_SB.PCI0.MPC1, 1).
• Notify the OS to check and set thermal control (by using the following form of the ASL Notify term:
Notify(\_TZ.THRM, 0x81).
5.4.4 Example _CRS, _SRS, _STA, and _DIS Methods for the FDC
The following sample ASL code illustrates this for the floppy disk controller on the example Trajan
motherboard:
5.5.2 Example _ADR, _UID, _EJ0, and Device Objects for the Dock
Device(MPCI) { //Docking station
Name(_ADR, 0x00110000) //Bridge is Dev 17 on PCI bus 0
Name(_UID, 1) //Unique ID is 1
Method(_EJ0, 1){ //Hot docking support
//Arg0: 0=insert, 1=eject
If(Arg0) { //Eject
Store(One, UDKP) //Start undock sequence
Wait(EJT0, 0xFFFF) //Wait for signal from OS
Return(0)
}
Else{}} //Insert, nothing to do
//Declare Device objects for all devices behind docking here
Device(MISA) {
.
.
.
} //End device MISA
Device(DIDE) {
.
.
.
} //End device DIDE
.
.
.
} //End device MPCI
5.6 Switching Between ACPI and Legacy Modes on the Trajan Motherboard
The OS switches a platform between ACPI and legacy modes by writing values to the SMI command
(SMI_CMD) port. The system port address of the SMI command port for a particular platform is in the
SMI_CMD field of the FACP table (for example, the SMI_CMD system port address for this example Trajan
platform is 0xB2; see section 5.2.2).
• On platforms that support both ACPI and legacy modes, as well as on platforms that support ACPI-only,
the OS writes the value ACPI_ENABLE to the SMI_CMD port address to switch to ACPI mode.
• On platforms that support both ACPI and legacy modes, the OS writes ACPI_DISABLE to the SMI_CMD
port address to switch to legacy mode.
The OS is attempting to set E32.3 (address 32h, embedded controller space, bit three). The embedded
controller notices that the system has detected a critical thermal event during the read/write process which
initiates an OS thermal notification process.
The host sends a read smart charger status command, which needs to generate the following SMBus
transaction:
• SMB_ADDR (BASE+2=0x42)=Charger Device=0x12
• SMB_CMD (BASE+3=0x43)=ChargerStatus=0x13
• SMB_PRTCL (BASE+0=0x40)=Read Word=0x07
7.1 Step 1: Static Checking of ACPI Tables, Namespace, and INT 15h
Functions
This step can be accomplished before you install an ACPI-compatible OS on your ACPI hardware platform.
7.1.2 Getting the Common Mistakes Out of ACPI Tables, ACPI Name Space,
and INT 15h Calls
For a list of common mistakes made in constructing ACPI tables and using objects in the ACPI name space,
see section 8 of this Guide. Tips for avoiding and correcting these mistakes are also in section 8 of the Guide.
• Table Checker validates your ACPI table structure, location, and specification compliance.
• NameSpace Checker identifies critical errors in your ACPI namespace.
These static HCTs run on a non-ACPI compatible OS (Windows NT 4.0).
The Memphis OS vendor also provides a Memory Check test program that ensures your ACPI tables are
loaded into an ACPI Reserved area at the top of memory which will not be written into by non-ACPI aware
programs.
What’s the trap? The value of the GPE1_BASE field of the FACP table is incorrect, causing the OS to not
recognize some events.
Tip: If the GPE1_BLK is used, the value of the GPE1_BASE field of the FACP table must be non-zero and
correct.
What’s the trap? The value of the SLP_BUTTON flag in the Flags field of the FACP table does not report
what the hardware does.
Tip: Setting the SLP_BUTTON bit to zero means a sleep button is available on your platform as a fixed
hardware feature. If your platform does not have a fixed feature sleep button, then set the SLP_BUTTON
feature to 1 (for example, SLP_BUTTON should be set to 1 on platforms using the Intel PIIX4 because the
PIIX4 does not have a fixed feature sleep button).
When the interpreter runs the Name term in the DEV3 scope, it has to find an object referred to by the name
FOO somewhere in the following name scope hierarchy:
\ //root of name space
.
.
.
DEV1
DEV2
FOO
DEV3
_PR0
The interpreter always searches the current name scope first for the named object. The interpreter does a
search in the current scope, then its parent scope, and then its grandparent scope, and so on until either the
object is found or the search is done in the root scope of the hierarchy and the name is still not found.
Applying this logic to the example, the interpreter does not find FOO in the current scope (the scope of the
DEV3 Device object), so it next searches the parent scope (the scope of the DEV1 Device object). FOO is not
found there, either. Lastly, the interpreter searches the scope of the name space root and FOO is not found
there either, so the interpreter issues an error: “Object FOO not found.”
Notice that the interpreter never searches the scope of the DEV2 Device object (the interpreter wants to walk
up the tree searching for a name, it never walks down a branch of the hierarchy looking for a named object.)
Tip: There are two ways to get the interpreter to find the object named FOO:
• Use a fully-qualified pathname in the reference to FOO when you write your ASL code; this enables you to
keep FOO as an object local to the DEV2 name scope. In this example, you would write
Put the FOO object in the root scope when you write your ASL code. For example,
What’s the trap? If you use the same object name more than once in a name scope, the interpreter doesn’t
know which one to use. To illustrate this, look at a variation of the previous example:
What’s the trap? Writing an ASL term that references an object before it is declared. This is done in the
DSDT code and when the DSDT code references objects that are declared (that is, created) in an SSDT.
Tip: Use the Scope term in your ASL code to work with “forward references.” The Scope term is used to get
around a strict one-to-one mapping of the hierarchy of objects in the ACPI name space and the hierarchy of
objects expressed in your ASL “code space.” The ACPI name space is created when the interpreter loads the
AML version of your ASL code space into memory. For example, if you need to do a forward reference, first
create an empty object in the appropriate place in the namespace and then use Scope to move declared objects
below it.
What’s the trap? Using decimal instead of hexadecimal numbers in _Lxx, _Exx, and _Qxx names in your
ASL code. When the number (xx) in the _Lxx, _Exx, or _Qxx event handler object name in the ASL code does
not match the number of the bit in the GPE register block (or match the number of the embedded controller
query number in the case of _Qxx), then the OS loses events. For more information about the relationship of
event handler object names and bits on the GPE register block, see section 5.6.2.2.
Tip: The xx in the event handler name is a hexadecimal number that corresponds to the GPE register bit or
EC query number the event is tied to. For example, the level-triggered event tied to bit 11 of the GPEx register
block must be named _L0B, not _L11.
Tip: Using the ASL OperationRegion term does not declare (that is, create) a named object. The name of the
operation region is specified for use only in a Field term, which does create one or more named objects. For
example,
OperationRegion(RGN, SystemIO, 0x123, 0x100)
Field(RGN, ByteAcc, NoLock, Preserve {
FLD1, 1
Store (0x01, FLD1)
What’s the trap? Using a Field term to specify a substring of the string contained in a Buffer data object is a
misuse of the Field term (it won’t work).
Tip: Use the CreateField, CreateByteField, CreateWordField, or CreateDwordField term to specify a
substring of a Buffer data object. That’s what these terms are for.
What’s the trap? Using the Scope term for things it isn’t specified to do. For example, naming an object in a
Scope term does not declare the object (that is, create the object in the name space).
Tip: In the variable-list part of a Scope term usage, only use the names of objects that have already been
declared in your ASL code (named objects are declare by the use of a Name, Device, Method, and the other
terms that declare/create objects).
What’s the trap? The value of the PBlockLength parameter of the Processor term is often incorrect (it
cannot be, for example, zero).
Tip: The correct value of the PBlockLength parameter is almost always 0x06.
use fully qualified pathnames to these objects (at least to get started). This ensures these objects are found
by the interpreter at namespace load time and by the ACPI driver at run-time.
• Put all thermal zone objects under the \_TZ scope. The objects that must be declared under the _TZ scope
depend on the level of support in your thermal zone:
• At a minimum, the following objects must be declared within the \_TZ scope: _TMP (which returns the
current temperature in the thermal zone), _TSP (returns the temperature sampling period), and _CRT
(returns the critical temperature trip-point).
• If active cooling (for example, a fan device) is supported in the thermal zone, then the following objects
must also be declared within the \_TZ scope: _ALx (returns a list of active cooling devices) and ACx
(returns the active cooling trip-point).
• If passive cooling (for example, processor throttling) is supported, then the following objects must also be
declared in within the \_TZ scope: _TC1 (returns a constant for use in the passive cooling equation),
_TC2, and _PSL (a list of passive cooling devices).
What’s the trap? If you implement passive cooling, using the wrong values for _TC1 and _TC2. For
example, some values for _TC1 and _TC2 cause the feedback equation to report the OS should run the
processor at >100% clock frequency or less than or equal to 0% clock frequency and this should be avoided.
Tip: Use experimentation and/or analysis to determine the _TC1 and _TC2 values for your platform. Don’t
just use numbers off the top of your head. For example, the values 1 and 2 do not work!!
8.6 Specifying Plug and Play Device IDs and Configuration Descriptors
What’s the trap? Listing PNPBIOS in your system name space causes the OS to load the PNPBIOS driver
and causes all device to be enumerated twice. Inconsistencies between these enumerations can cause the
system to crash.
Tip: ACPI completely supercedes PNPBIOS. On ACPI-compatible platforms, do not list PNPBIOS in your
ACPI namespace.
What’s the trap? Not including an End Tag descriptor at the end of a Resource Descriptor.
Tip: Make sure all your resource templates have an End Tag descriptor at the end.
What’s the trap? Using more than one End Dependent Function descriptor in a set of dependent functions.
Tip: Use only one End Dependent Function descriptors for an entire set of dependent functions. For example,
Start Dependent Function
.
.
.
Start Dependent Function
.
.
.
End Dependent Function