Patent Publication Number: US-6986014-B2

Title: System and method for using a vendor-long descriptor in ACPI for the chipset registers

Description:
CROSS REFERENCE TO RELATED APPLICATION(S) 
   This is a continuation of application Ser. No. 10/212,691 filed on Aug. 7, 2002 now U.S. Pat. No. 6,792,520, which is hereby incorporated by reference herein. 

   BACKGROUND 
   Advanced Configuration and Power Interface (ACPI) is a specification that makes hardware status information available to an operating system in computers, including laptops, desktop, servers, etc. More information about ACPI may be found in the 500 page “Advanced Configuration and Power Interface Specification,” Revision 2.0a, Mar. 31, 2002, cooperatively defined by Compaq Computer Corporation, Intel Corporation, Microsoft Corporation, Phoenix Technologies Ltd., and Toshiba Corporation. The ACPI specification was developed to establish industry common interfaces enabling robust operating system (OS)-directed motherboard device configuration and power management of both devices and entire systems. ACPI is the key element in operating system-directed configuration and power management (OSPM). 
   ACPI is used in personal computers (PCs) running a variety of operating systems, such as Windows™, available from Microsoft® Corporation, Linux, available as open source form a variety of vendors, and HP-UX, available from Hewlett-Packard Company. ACPI also allows hardware resources to be manipulated. For example, ACPI assists in power management by allowing a computer system&#39;s peripherals to be powered on and off for improved power management. ACPI also allows the computer system to be turned on and off by external devices. For example, the touch of a mouse or the press of a key may wake up the computer system using ACPI. 
   Traditionally ACPI has been difficult to work with for a variety of reasons. First, ACPI is not written in the native assembly language of any computer system platform. Instead, ACPI has its own source and machine languages, i.e., ACPI Source Language (ASL) and ACPI Machine Language (AML), respectively. Because of its highly specialized use, there are relatively few ASL programmers; ASL has relatively few constructs because of its limited use. Furthermore, ACPI code is conventionally monolithic in its design. Consequently, this makes it difficult to port the ACPI code to other platforms or even to different configurations of the same platform. Thus, new ASL code needs to be written to work with newly-engineered platforms. The limited number of ASL programmers makes writing new code all the more problematic and costly. 
   ACPI is composed of both static and interpretable tables. At boot-up time, the system firmware (typically the BIOS, or Basic Input/Output System) constructs the static tables, which are consumed by the operating system. The interpretable tables are composed of AML, which is compiled and then merged into the system firmware. The operating system reads the AML from the interpretable tables and executes the architected interfaces, using an ACPI interpreter. In this fashion, the operating system manipulates hardware resources. Because the interpretable tables are merged into the system firmware, this conventional method lacks flexibility, and scalability, and requires considerable time to re-program to accommodate divergent system configurations. 
   For example, conventionally, ASL developers write ACPI code to specify a particular configuration of a platform or its variance. Unfortunately, if even a minor hardware change is performed, the design has to be modified. This requires that new AML code be written and new tables be merged into the system firmware. Thus, the conventional design is not portable or re-usable. 
   Furthermore, ACPI has conventionally required that a different system firmware ROM (Read Only Memory) or BIOS be used if there is a variance of the platform or if it supports more than one ACPI-aware OS system, where the OS systems have mutually exclusive ACPI requirements. A different system firmware ROM also had to be used if the same system is to support multiple operating systems. For instance, current art in personal computers uses the IA-32 instruction set. ACPI was primarily used by the Microsoft® family of operating systems, especially in systems with the IA-32 instruction set. 
   ACPI has been accepted by the various operating systems as the standard interface. A new instruction set architecture, IA-64, is being developed, but its advantages cannot be fully utilized with legacy ACPI code, or methods. The new Itanium® Processor Family, available from Intel® Corporation, uses the IA-64 instruction set. The ASL for each new processor in this family will need to be uniquely rewritten if current practices are utilized. Further, if multiple operating systems must run on a given processor, the ASL would need to be unique for each OS, as well. 
   The ACPI namespace is a hierarchical tree structure in OS-controlled memory that contains named objects. These objects may be data objects, control method objects, bus/device package objects, and so on. The OS dynamically changes the contents of the namespace at run-time by loading and/or unloading definition blocks from the ACPI Tables that reside in the ACPI BIOS. All the information in the ACPI namespace comes from the differentiated system description table (DSDT), which contains the differentiated definition block, and one or more other definition blocks. In the current art, an OEM (original equipment manufacturer) must supply a DSDT to an ACPI-compatible OS, which supplies the implementation and configuration information about the base system. The OS always inserts the DSDT information into the ACPI namespace at system boot time and never removes it. 
   Another ACPI construct is the secondary system description table (SSDT). SSDTs are a continuation of the DSDT. Multiple SSDTs can be used as part of a platform description. After the DSDT is loaded into the ACPI Namespace, 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. Additional tables can only add data; they cannot overwrite data from previous tables. 
   Computer systems of the prior art, which use IA-32 and ACPI, typically use I/O port address space to manage the register memory maps for the various I/O devices in the computer system. While this method can be used for IA-64, it has serious drawbacks given that a server can have 500 or more devices and resources. 
   SUMMARY 
   A system and method for using memory mapped I/O (MMIO) to manage system devices is provided. A parent device in the ACPI namespace, for instance, a local bus adapter, uses (MMIO) to identify the memory addresses of its children devices. An existing, but unused, construct of ACPI is used to pass the MMIO information through the operating system (OS) to the device drivers, enabling memory to be reserved by a device, and also remain hidden to the OS. The vendor defined resource data type for long information, also known as the “vendor-long” descriptor, is used to pass the appropriate information through the OS. This method enables the memory information to be passed to the OS without the risk that the OS will mistake the addresses as being available, and reassigning them in error. 

   
     DESCRIPTION OF THE DRAWINGS 
     The detailed description will refer to the following drawings, wherein like numerals refer to like elements, and wherein: 
       FIG. 1  shows a block diagram depicting the interaction between the OS and the ACPI interpreter and ACPI tables; 
       FIG. 2  shows an exemplary and simplified ACPI namespace definition; 
       FIG. 3  is a block diagram of an exemplary system bus adapter, SBAO; 
       FIG. 4  shows an exemplary memory block used with MMIIO; and 
       FIG. 5  shows an expansion of the memory space of  FIG. 4 , at region  7 . 
   

   DETAILED DESCRIPTION 
   ACPI is an IA-32 instruction set concept that is still used for the new IA-64 instruction set. ACPI is a way for abstracting hardware manipulation and configuration data to define the configuration of the hardware for operating system (OS) and firmware interaction. ACPI is a specification industry standard. Currently, the major three commercial personal computer (PC) operating systems, i.e., Linux, HP/UX and Windows™, use ACPI in IA-32 space and will run using ACPI in the new IA-64 space. Upon system boot, the firmware powers up and determines the system configuration. The system is initialized, if it needs to be, and then the operation is handed over to the OS, i.e., boots up the OS. When a system is booted up, it must have knowledge of the different platform configurations. ACPI is a specification for the hardware configuration that has interface objects and a namespace in order to define the divergent platform configurations. 
   The ACPI namespace describes the hierarchy of a computer system in a logical way. For example, when the OS consumes the namespace, it gets a picture of what the hardware looks like underneath. Thus, if the OS needs to get a resource for a given hardware component, or if it needs to know how to access a component, it looks to the namespace. For example, if the OS needs to put the machine to sleep, there is an object that will identify how to put a device to sleep. The OS uses the interfaces or objects defined in the namespace to manipulate the hardware. This is the function of ACPI. 
   The present system and method takes advantage of the IA-64 instruction set architecture rather than merely using legacy code left over from IA-32 platforms. Specifically, today&#39;s computer systems can have well over 500 devices and resources to control. Traditional use of I/O port space for defining resource addresses is insufficient. The present system and method utilizes an existing construct of ACPI, the vendor-long field, to pass appropriate memory mapped I/O information corresponding to requested resources. 
   Referring now to the drawings, and in particular to  FIG. 1 , there is shown a block diagram depicting the interaction between the OS and the ACPI interpreter and ACPI tables. During normal system operation, the OS  101  needs to access or operate some hardware function. To do this, it must have information about how the hardware operates. Upon boot-up, the system firmware  103  creates the ACPI namespace, and populates ACPI tables  109  with the system component information. When the OS  101  attempts to access or operate the hardware, it runs ACPI AML code  107  through the ACPI interpreter  105  to retrieve the system information. In systems of the prior art, the AML would be hard coded for a specific operating system. 
   When the system firmware  103  is booting up, it prepares its corresponding AML  107 . It also sets up architected static tables  109 . When the OS takes control, it automatically knows how to find the ACPI tables  109 , retrieves them, and consumes them. For a given boot, the static ACPI tables  109  will stay as they are, without changing. 
   The ACPI tables define the namespace of the loaded system components. Referring now to  FIG. 2 , there is shown an exemplary and simplified ACPI namespace definition. The namespace may include packages  201 , processor objects  203 , power resource objects  205 , bus/device objects  207 , data objects  209  and control methods, or AML code,  211 . The Root (package)  221  has a corresponding processor tree, \ — PR,  223  and a corresponding system bus tree, \ — SB,  225 . The system bus tree has a corresponding System bus adapter,  — SBA 0   226 , tree, as well. 
   The PCI bus (bus/device object), PCI 0 ,  227  is a child of  — SBA 0   226 , and has a corresponding bus/device tree. The general purpose event package, \ — GPE,  229  is a child of the Root  221 . In this exemplary namespace, the system bus adapter  — SBA 0   226  and the PCI bus PCI 0   227  both have device identifiers,  — HID,  231  and  228 ; and current resource status data objects,  — CRS,  233  and  230 . The PCI bus  227  also has an IDE 0  device bus/device object  235 . 
   Referring now to  FIG. 3 , there is shown an exemplary system bus adapter SBA 0   300 . SBA 0   300  has a system bus adapter SBA  301  with a chipset register  303 . System bus adapter SBA  301  is connected to three local bus adapters (LBAs)  305 ,  309  and  313 . The LBAs  305 ,  309  and  313  have register blocks  307 ,  311  and  315 , respectively. Each LBA also has a PCI bus  317 ,  319  and  321 . PCI bus  319  is connected to an external device  323 . 
   Any given chipset will have an I/O controller (IOC). The chipset may also have a memory management controller (MMC). Aside from these controllers, the OS often interacts with something external. The chipset register does not have an internal register for these external devices. The chipset has its own registers to regulate some functions and also to regulate how it interacts with the external devices. In the technology of personal computers (PCs), IA-32 instruction set architecture is giving way to IA-64 instruction set architecture. In IA-32, the registers were typically mapped into a certain address region called I/O port space. A memory mapped I/O (MMIO) scheme can map an address into a firmware component, a physical addresses of the device, an ACPI device address, or an I/O port space. When the address is used, any response originates with the device to which the address is mapped. 
   If the OS is limited in understanding of the device that is consuming memory, then exposing it in the ACPI namespace might mislead the OS into thinking that a memory region is not being consumed when it really is. If the OS reassigns this region, then there will be a conflict. This scenario is true for the register map. MMIO is used to map the registers, as well as other memory areas. 
   When the ACPI resources are described, some are identified as producers and some as consumers. If a memory access is received by the chipset, the chipset must determine how to respond. The chipset may respond that it owns the memory range, and then pass along the data to a child resource that actually owns the address range. Thus, the chipset is the producer. A producer simply reflects a memory access to a child device. If that child device directly owns the memory being accessed, it is the consumer of the transaction. Referring again to  FIG. 2 , the system bus adapter  — SBA 0   226  knows about the address range used for its child PCI 0  device  227 .  — SBA 0  is a producer and likewise PCI 0  is a producer of the address range. The PCI 0  device  227  would respond to its address, as the consumer. 
   Referring now to  FIG. 4 , there is shown an exemplary memory block used with MMIO. In this exemplary MMIO, memory region  0 - 5 , as indicated by reference numeral  401 , is RAM. System bus adapter SBA has memory  5 - 9 , as indicated by reference numeral  403 . Thus, all transactions that go through addresses  5 - 9  are owned by SBA. Suppose that memory area  7  is the register map. The OS understands that  5 - 9  is actually memory that is mapped to devices, because, technically, SBA is a device. A new device is connected and needs a unit of memory. Without the present method, the OS sees the register map area ( 7 ) and sees it as an allocable section of memory. In the prior art, there was no way to indicate that this memory region has already been dedicated to another use. Therefore the OS could not see that a PCI bus needed to consume some of that memory, and so it was not available to other resources. 
   Systems of the prior art allocated regions of memory, as needed. For instance, suppose memory region  4  ( 405 ) is consumed by PCI 0  and memory region  1 - 2  is consumed by PCI 2  ( 407 ). Suppose a new device D is installed and memory region  1 - 5  appears as available. Regions  1 - 2  and  4 - 4  are used by PCI 0  and PCI 2 . Device D needs one unit of memory. The OS looks at region  0 - 5  and determines that region  3 - 3  appears to be available. The OS will allocate region  3 - 3  for device D. If D needed two units, then the OS would have to re-map one of the other devices to create a contiguous region with two memory units. 
   In ACPI there are attributes to memory that indicate that it is being consumed, but legacy code written for IA-32 can only accommodate I/O port space and not MMIO. There is no standard way to put the register map into a MMIO construct. If more memory must be allocated to a child device, or resource, the parent takes control of the region and assigns it. The register map must be exposed to the tools and device drivers so that they are not forced to interact directly with the hardware. Thus, the driver application or tool must use ACPI to interact with hardware, or to get resources. 
   The present system and method takes advantage of the  — CRS (current resource settings) data object of ACPI to hide the MMIO address information from the OS so that it will not reallocate memory regions in error. When a resource is required, the event requiring the resource returns the current resource settings in the  — CRS data object. The  — CRS object evaluates to a byte stream that describes the system resources currently allocated to a device. Additionally, a bus device must supply the resources that it decodes and can assign to its children devices. 
   For instance, using MMIO techniques of the present method, SBA uses memory region  7 - 8  for its PCI buses. Memory region  7 - 8  ( 411 ) must be hidden from the OS when it requests a  — CRS so that it will not attempt to reallocate this region. When the OS needs to determine the current resources for SBA, the resource status  — CRS data object will return  5 - 6  and  8 - 9 . Region  7 - 8  is identified in a byte stream called vendor-long, instead of being exposed in the  — CRS. The OS ignores the contents of this string, but passes it along to the original requestor or device driver, when appropriate. Thus, the OS sees memory regions  0 - 6  and  8 - 10  but not  7 - 8 . Memory location  7  remains hidden. The OS knows that  0 - 5  is RAM and  5 - 6  and  8 - 9  are owned by SBA. 
   The PCI bus can also return a status.  FIG. 5  shows an expansion of the memory space at region  7 - 8 . The register map for SBA 0  is  7  to  7 . 5  (reference  501 ). PCI 1  owns  7 . 5  to  7 . 8  (reference  503 ). PCI 2  owns  7 . 8  to  7 . 85  (reference  505 ). PCI 3  owns  7 . 85  to  8  (reference  507 ). However, when the  — CRS data is returned from a query about the SBA resources, the memory area for region  7 - 8  is returned only in the vendor-long byte stream. Since ACPI ignores this data, this memory area is effectively hidden. 
   Suppose that the OS requests the current resources for PCI 1 . PCI 1  owns the memory map from  7 . 5  to  7 . 8 . PCI 1  also will have a memory in the normal map, as well as the hidden register map. For instance, in this example it has memory  8  to  8 . 5  ( FIG. 4 , reference  413 ). When the  — CRS data is returned for a query about the PCI 1  resources, the OS will see only  8  to  8 . 5  and the  7 . 5  to  7 . 8  region will remain hidden. This hidden information is sent in the vendor-long byte stream and is used only by tools that are developed to understand this object. 
   One goal is to prevent the OS from giving another PCI device or another add-in device the register memory that is already owned. This is necessary for items like local bus adapters or other devices that are not visible to the customer/user. They are OS visible, but not customer visible. It may also be desirable to tweak the performance of a device driver for a video card, a network card, or other device. This can be done by tweaking register settings. A driver that knows it has access to the hidden chipset register addresses can modify settings in the chipset. For instance, a certain network card might perform better underneath a certain bus. 
   In contrast, in systems of the prior art, a driver could not be made optimal because the register addresses were exposed to potential misuse. If the register maps of the prior art were exposed to the OS, they could automatically get consumed by mistake by the OS for some other function. 
   For example, the register map maps into a PCI device. When the system processor accesses an address, the address comes through the chipset. When the address comes through the chipset, it is identified as being owned by the PCI device. The ACPI tools could not access the register based on the information returned in the  — CRS, because of the hidden register map. Thus, the vendor-long descriptor (0×4) is used to pass the appropriate memory address information to the tools or device drivers which need it. Thus, when an OS or other application looks at that region of memory, all that is seen is the first part ( — CRS data object) and the OS literally just ignore anything that&#39;s marked as vendor long. 
   The vendor-long byte stream is now defined for MMIO use as follows. One byte indicated the resource type. Another byte indicates the start of the resource type data stream and a third byte indicates the end of the data stream for that resource. For instance, the first two bytes are the start address or size of the address. The last address is the ending address. It will be apparent to one skilled in the art that various formats can be defined. In this way, the vendor-long data object can now pass useful information to tools needing access to devices and resources. 
   An example template for a vendor long is shown below for illustrative purposes. 
   
     
       
         
             
             
           
             
                 
                 
             
           
          
             
                 
               VendorLong(CCSR) 
             
          
         
         
             
             
          
             
                 
               { 
             
          
         
         
             
             
             
          
             
                 
               0x02, 
               // GUID Specific Desc sub type 
             
             
                 
               0xf9, 
               // GUID 
             
             
                 
               0xad, 
             
             
                 
               0xe9, 
             
             
                 
               0x69, 
             
             
                 
               0x4f, 
             
             
                 
               0x92, 
             
             
                 
               0x5f, 
             
             
                 
               0xab, 
             
             
                 
               0xf6, 
             
             
                 
               0x4a, 
             
             
                 
               0x24, 
             
             
                 
               0xd2, 
             
             
                 
               0x01, 
             
             
                 
               0x37, 
             
             
                 
               0x0e, 
             
             
                 
               0xad, 
             
             
                 
               0x00, 
               // CEC CSR Base Address 
             
             
                 
               0x00, 
             
             
                 
               0x00, 
             
             
                 
               0x00, 
             
             
                 
               0x00, 
             
             
                 
               0x00, 
             
             
                 
               0x00, 
             
             
                 
               0x00, 
             
             
                 
               0x00, 
               // CEC CSR Range Length 
             
             
                 
               0x00, 
             
             
                 
               0x00, 
             
             
                 
               0x00, 
             
             
                 
               0x00, 
             
             
                 
               0x00, 
             
             
                 
               0x00, 
             
             
                 
               0x00, 
             
          
         
         
             
             
          
             
                 
               } // VendorLong CCSR 
             
             
                 
                 
             
          
         
       
     
   
   Having described preferred embodiments of a novel method to for populating and using an existing ACPI variable with MMIO information, (which are intended to be illustrative and not limiting), it is noted that modifications and variations can be made by persons skilled in the art in light of the above teachings. It is therefore to be understood that changes may be made in the particular embodiments of the invention disclosed which are within the scope and spirit of the invention as defined by the appended claims.