direct-io.hg

changeset 5614:bc8bb3a26ccc

bitkeeper revision 1.1779 (42c3a8b3kGpPBNwXb3dn_b8FcmVPgQ)

[PATCH] ACPI support for guest firmware.

ACPI support for guest firmware.

Signed-off-by: Ke Yu <ke.yu@intel.com>
Signed-off-by: Arun Sharma <arun.sharma@intel.com>
author arun.sharma@intel.com[kaf24]
date Thu Jun 30 08:09:23 2005 +0000 (2005-06-30)
parents 332eb7887996
children 4669354bba9a
files .rootkeys tools/firmware/Makefile tools/firmware/acpi/Makefile tools/firmware/acpi/README tools/firmware/acpi/acpi2_0.h tools/firmware/acpi/acpi_build.c tools/firmware/acpi/acpi_dsdt.asl tools/firmware/acpi/acpi_dsdt.c tools/firmware/acpi/acpi_facs.c tools/firmware/acpi/acpi_facs.h tools/firmware/acpi/acpi_fadt.c tools/firmware/acpi/acpi_fadt.h tools/firmware/acpi/acpi_gen.c tools/firmware/acpi/acpi_madt.c tools/firmware/acpi/acpi_madt.h tools/firmware/acpi/acpi_rsdt.c tools/firmware/vmxassist/Makefile tools/firmware/vmxassist/vmxloader.c
line diff
     1.1 --- a/.rootkeys	Thu Jun 30 08:09:03 2005 +0000
     1.2 +++ b/.rootkeys	Thu Jun 30 08:09:23 2005 +0000
     1.3 @@ -592,6 +592,20 @@ 40cf2937oKlROYOJTN8GWwWM5AmjBg tools/exa
     1.4  41fc0c18_k4iL81hu4pMIWQu9dKpKA tools/examples/xmexample3
     1.5  42a6b4b7KssGzTDVN-XG2FM1gCEnnw tools/firmware/Makefile
     1.6  42a6b4b7qP95OSsEL8XWKKZ1p1myjQ tools/firmware/README
     1.7 +42c3a8aasHaruuXW5eNaF3-Q3iJqxA tools/firmware/acpi/Makefile
     1.8 +42c3a8aa2r5f9x1E8l23Dj9DYi0nRg tools/firmware/acpi/README
     1.9 +42c3a8aayb825lgitjA4O817LDpJPw tools/firmware/acpi/acpi2_0.h
    1.10 +42c3a8aal-s682lGz6x7zbQcVdEJ2g tools/firmware/acpi/acpi_build.c
    1.11 +42c3a8aamRqrfrBqioo8YYXVMl5jeg tools/firmware/acpi/acpi_dsdt.asl
    1.12 +42c3a8aaFqGZdCjEpXBmtY1LalixwQ tools/firmware/acpi/acpi_dsdt.c
    1.13 +42c3a8aa4ujzPi0lLwnMmU0tDtKSzA tools/firmware/acpi/acpi_facs.c
    1.14 +42c3a8aaA9f6wfWWQA2R1y7lhjY3bw tools/firmware/acpi/acpi_facs.h
    1.15 +42c3a8aaWjUKeGAaqtGnpkIYLOWRfA tools/firmware/acpi/acpi_fadt.c
    1.16 +42c3a8aaMa-vFeyOVxMEM1tWkZGLdQ tools/firmware/acpi/acpi_fadt.h
    1.17 +42c3a8aaokyiLvJ5q9BNNTH8ndZ4bA tools/firmware/acpi/acpi_gen.c
    1.18 +42c3a8aanXHjc2BoQyntSiCDDNxYQA tools/firmware/acpi/acpi_madt.c
    1.19 +42c3a8aaDHlMc-XEzJOmv57llVt3eA tools/firmware/acpi/acpi_madt.h
    1.20 +42c3a8aanzri6r9l_Tnye7i3JSf1jg tools/firmware/acpi/acpi_rsdt.c
    1.21  42a6b4b78PWdYzKYvLt_EHhvQCl9ig tools/firmware/rombios/Makefile
    1.22  42a6b4b75sz5KF9Lry2EGnPMhOdnUA tools/firmware/rombios/apmbios.S
    1.23  42a6b4b7YwP9rl3AJRTmZbBoal_c6Q tools/firmware/rombios/biossums.c
     2.1 --- a/tools/firmware/Makefile	Thu Jun 30 08:09:03 2005 +0000
     2.2 +++ b/tools/firmware/Makefile	Thu Jun 30 08:09:23 2005 +0000
     2.3 @@ -7,6 +7,7 @@ INSTALL_DIR := $(DESTDIR)/usr/lib/xen/bo
     2.4  SUBDIRS :=
     2.5  SUBDIRS += rombios
     2.6  SUBDIRS += vgabios
     2.7 +SUBDIRS += acpi
     2.8  SUBDIRS += vmxassist
     2.9  
    2.10  .PHONY: all install clean
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/tools/firmware/acpi/Makefile	Thu Jun 30 08:09:23 2005 +0000
     3.3 @@ -0,0 +1,68 @@
     3.4 +#/*
     3.5 +# * Copyright (c) 2004, Intel Corporation.
     3.6 +# *
     3.7 +# * This program is free software; you can redistribute it and/or modify it
     3.8 +# * under the terms and conditions of the GNU General Public License,
     3.9 +# * version 2, as published by the Free Software Foundation.
    3.10 +# *
    3.11 +# * This program is distributed in the hope it will be useful, but WITHOUT
    3.12 +# * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    3.13 +# * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
    3.14 +# * more details.
    3.15 +# *
    3.16 +# * You should have received a copy of the GNU General Public License along with
    3.17 +# * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
    3.18 +# * Place - Suite 330, Boston, MA 02111-1307 USA.
    3.19 +# *
    3.20 +# */
    3.21 +#
    3.22 +# Compiler flag
    3.23 +CFLAG=-I. -I../../libxc
    3.24 +	
    3.25 +# Compiler tool	
    3.26 +CC=gcc
    3.27 +
    3.28 +# TARGET
    3.29 +C_SRC=$(shell ls *.c)
    3.30 +H_SRC=$(shell ls *.h)
    3.31 +ACPI_GEN=acpigen
    3.32 +ACPI_BIN=acpi.bin
    3.33 +
    3.34 +IASL_VER=acpica-unix-20050513
    3.35 +IASL_URL=http://developer.intel.com/technology/iapc/acpi/downloads/$(IASL_VER).tar.gz
    3.36 +
    3.37 +vpath iasl $(PATH)
    3.38 +all:$(ACPI_BIN)
    3.39 +	
    3.40 +acpi_dsdt.c:acpi_dsdt.asl
    3.41 +	$(MAKE) iasl
    3.42 +	iasl -oa -tc acpi_dsdt.asl
    3.43 +	mv acpi_dsdt.hex acpi_dsdt.c
    3.44 +	echo "int DsdtLen=sizeof(AmlCode);" >> acpi_dsdt.c
    3.45 +	rm *.aml
    3.46 +
    3.47 +iasl:
    3.48 +	@echo
    3.49 +	@echo "ACPI ASL compiler(iasl) is needed"
    3.50 +	@echo "Download Intel ACPI CA"
    3.51 +	@echo "If wget failed, please download and compile manually from"
    3.52 +	@echo "http://developer.intel.com/technology/iapc/acpi/downloads.htm"
    3.53 +	@echo 
    3.54 +	wget $(IASL_URL)
    3.55 +	tar xzf $(IASL_VER).tar.gz
    3.56 +	make -C $(IASL_VER)/compiler
    3.57 +	install $(IASL_VER)/compiler/iasl /usr/bin/iasl
    3.58 +
    3.59 +$(ACPI_GEN):$(C_SRC) $(H_SRC) acpi_dsdt.c
    3.60 +	$(CC) -o $(ACPI_GEN) $(CFLAG) $(shell ls *.c)
    3.61 +
    3.62 +$(ACPI_BIN):$(ACPI_GEN)
    3.63 +	./$(ACPI_GEN) $(ACPI_BIN)
    3.64 +	
    3.65 +clean:
    3.66 +	rm -rf *.o $(ACPI_GEN) $(ACPI_BIN) $(IASL_VER) 
    3.67 +#   rm -f acpi_dsdt.c
    3.68 +	rm -rf  $(IASL_VER).tar.gz
    3.69 +install:all
    3.70 +		
    3.71 +	
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/tools/firmware/acpi/README	Thu Jun 30 08:09:23 2005 +0000
     4.3 @@ -0,0 +1,24 @@
     4.4 +ACPI Table for domain firmware
     4.5 +
     4.6 +
     4.7 +INSTALL
     4.8 +-----------------
     4.9 +Simply make is OK.
    4.10 +# make 
    4.11 +
    4.12 +
    4.13 +Note on DSDT Table
    4.14 +------------------
    4.15 +DSDT table source code is acpi_dsdt.asl
    4.16 +It is already compiled and the output is acpi_dsdt.c
    4.17 +Usually, user is not expected to change the acpi_dsdt.asl.
    4.18 +In case that the acpi_dsdt.asl need to be updated, please 
    4.19 +Follow the instruction:
    4.20 +
    4.21 +# make acpi_dsdt.c
    4.22 +
    4.23 +Note:
    4.24 +DSDT compiler "iasl" is needed. By default, it will be downloaded 
    4.25 +using wget in Makefile. if it failed, please download manually from 
    4.26 +http://developer.intel.com/technology/iapc/acpi/downloads.htm. 
    4.27 +then compile and install iasl
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/tools/firmware/acpi/acpi2_0.h	Thu Jun 30 08:09:23 2005 +0000
     5.3 @@ -0,0 +1,317 @@
     5.4 +/*
     5.5 + * Copyright (c) 2004, Intel Corporation.
     5.6 + *
     5.7 + * This program is free software; you can redistribute it and/or modify it
     5.8 + * under the terms and conditions of the GNU General Public License,
     5.9 + * version 2, as published by the Free Software Foundation.
    5.10 + *
    5.11 + * This program is distributed in the hope it will be useful, but WITHOUT
    5.12 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    5.13 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
    5.14 + * more details.
    5.15 + *
    5.16 + * You should have received a copy of the GNU General Public License along with
    5.17 + * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
    5.18 + * Place - Suite 330, Boston, MA 02111-1307 USA.
    5.19 + *
    5.20 + */
    5.21 +#ifndef _ACPI_2_0_H_
    5.22 +#define _ACPI_2_0_H_
    5.23 +
    5.24 +#include "xc.h"  // for u8, u16, u32, u64 definition
    5.25 +
    5.26 +#pragma pack (1)
    5.27 +
    5.28 +//
    5.29 +// common ACPI header.  
    5.30 +//
    5.31 +
    5.32 +typedef struct {
    5.33 +		u32			Signature;
    5.34 +		u32     	Length;
    5.35 +		u8			Revision;
    5.36 +		u8			Checksum;
    5.37 +		u8			OemId[6];
    5.38 +		u64			OemTableId;
    5.39 +		u32			OemRevision;
    5.40 +		u32			CreatorId;
    5.41 +		u32			CreatorRevision;
    5.42 +} ACPI_TABLE_HEADER;
    5.43 +
    5.44 +
    5.45 +#define ACPI_OEM_ID 			{'I','N','T','E','L',' '}
    5.46 +#define ACPI_OEM_TABLE_ID 		0x544244 		// "TBD"
    5.47 +#define ACPI_OEM_REVISION 		0x00000002
    5.48 +#define ACPI_CREATOR_ID 		0x00 			// TBD 
    5.49 +#define ACPI_CREATOR_REVISION 	0x00000002 		
    5.50 +
    5.51 +//
    5.52 +// ACPI 2.0 Generic Address Space definition
    5.53 +//
    5.54 +typedef struct {
    5.55 +		u8                            AddressSpaceId;
    5.56 +		u8                            RegisterBitWidth;
    5.57 +		u8                            RegisterBitOffset;
    5.58 +		u8                            Reserved;
    5.59 +		u64                           Address;
    5.60 +} ACPI_GENERIC_ADDRESS_STRUCTURE;
    5.61 +
    5.62 +//
    5.63 +// Generic Address Space Address IDs
    5.64 +//
    5.65 +#define ACPI_SYSTEM_MEMORY 0
    5.66 +#define ACPI_SYSTEM_IO 1
    5.67 +#define ACPI_PCI_CONFIGURATION_SPACE 2
    5.68 +#define ACPI_EMBEDDED_CONTROLLER 3
    5.69 +#define ACPI_SMBUS 4
    5.70 +#define ACPI_FUNCTIONAL_FIXED_HARDWARE 0x7F
    5.71 +
    5.72 +//
    5.73 +// Root System Description Pointer Structure in ACPI 1.0
    5.74 +//
    5.75 +typedef struct {
    5.76 +		u64                           Signature;
    5.77 +		u8                            Checksum;
    5.78 +		u8                            OemId[6];
    5.79 +		u8                            Reserved;
    5.80 +		u32                           RsdtAddress;
    5.81 +} ACPI_1_0_RSDP;
    5.82 +
    5.83 +
    5.84 +//
    5.85 +// Root System Description Pointer Structure
    5.86 +//
    5.87 +typedef struct {
    5.88 +		u64                           Signature;
    5.89 +		u8                            Checksum;
    5.90 +		u8                            OemId[6];
    5.91 +		u8                            Revision;
    5.92 +		u32                           RsdtAddress;
    5.93 +		u32                           Length;
    5.94 +		u64                           XsdtAddress;
    5.95 +		u8                            ExtendedChecksum;
    5.96 +		u8                            Reserved[3];
    5.97 +} ACPI_2_0_RSDP;
    5.98 +
    5.99 +
   5.100 +//
   5.101 +// The maximum number of entrys in RSDT or XSDT
   5.102 +//
   5.103 +#define ACPI_MAX_NUM_TABLES 2
   5.104 +
   5.105 +//
   5.106 +// Root System Description Table (RSDT)
   5.107 +//
   5.108 +
   5.109 +typedef struct {
   5.110 +		ACPI_TABLE_HEADER Header;
   5.111 +		u32 Entry[ACPI_MAX_NUM_TABLES];
   5.112 +}ACPI_2_0_RSDT;
   5.113 +
   5.114 +//
   5.115 +// RSDT Revision (as defined in ACPI 2.0 spec.)
   5.116 +//
   5.117 +
   5.118 +#define ACPI_2_0_RSDT_REVISION 0x01
   5.119 +
   5.120 +//
   5.121 +// Extended System Description Table (XSDT)
   5.122 +//
   5.123 +
   5.124 +typedef struct _ACPI_2_0_XSDT{
   5.125 +		ACPI_TABLE_HEADER Header;
   5.126 +		u64 Entry[ACPI_MAX_NUM_TABLES];
   5.127 +}ACPI_2_0_XSDT;
   5.128 +#define ACPI_2_0_XSDT_REVISION 0x01
   5.129 +
   5.130 +//
   5.131 +// Fixed ACPI Description Table Structure (FADT)
   5.132 +// 
   5.133 +
   5.134 +typedef struct  {
   5.135 +		ACPI_TABLE_HEADER               Header;
   5.136 +		u32                                    FirmwareCtrl;
   5.137 +		u32                                    Dsdt;
   5.138 +		u8                                     Reserved0;
   5.139 +		u8                                     PreferredPmProfile;
   5.140 +		u16                                    SciInt;
   5.141 +		u32                                    SmiCmd;
   5.142 +		u8                                     AcpiEnable;
   5.143 +		u8                                     AcpiDisable;
   5.144 +		u8                                     S4BiosReq;
   5.145 +		u8                                     PstateCnt;
   5.146 +		u32                                    Pm1aEvtBlk;
   5.147 +		u32                                    Pm1bEvtBlk;
   5.148 +		u32                                    Pm1aCntBlk;
   5.149 +		u32                                    Pm1bCntBlk;
   5.150 +		u32                                    Pm2CntBlk;
   5.151 +		u32                                    PmTmrBlk;
   5.152 +		u32                                    Gpe0Blk;
   5.153 +		u32                                    Gpe1Blk;
   5.154 +		u8                                     Pm1EvtLen;
   5.155 +		u8                                     Pm1CntLen;
   5.156 +		u8                                     Pm2CntLen;
   5.157 +		u8                                     PmTmrLen;
   5.158 +		u8                                     Gpe0BlkLen;
   5.159 +		u8                                     Gpe1BlkLen;
   5.160 +		u8                                     Gpe1Base;
   5.161 +		u8                                     CstCnt;
   5.162 +		u16                                    PLvl2Lat;
   5.163 +		u16                                    PLvl3Lat;
   5.164 +		u16                                    FlushSize;
   5.165 +		u16                                    FlushStride;
   5.166 +		u8                                     DutyOffset;
   5.167 +		u8                                     DutyWidth;
   5.168 +		u8                                     DayAlrm;
   5.169 +		u8                                     MonAlrm;
   5.170 +		u8                                     Century;
   5.171 +		u16                                    IaPcBootArch;
   5.172 +		u8                                     Reserved1;
   5.173 +		u32                                    Flags;
   5.174 +		ACPI_GENERIC_ADDRESS_STRUCTURE    ResetReg;
   5.175 +		u8                                     ResetValue;
   5.176 +		u8                                     Reserved2[3];
   5.177 +		u64                                    XFirmwareCtrl;
   5.178 +		u64                                    XDsdt;
   5.179 +		ACPI_GENERIC_ADDRESS_STRUCTURE    XPm1aEvtBlk;
   5.180 +		ACPI_GENERIC_ADDRESS_STRUCTURE    XPm1bEvtBlk;
   5.181 +		ACPI_GENERIC_ADDRESS_STRUCTURE    XPm1aCntBlk;
   5.182 +		ACPI_GENERIC_ADDRESS_STRUCTURE    XPm1bCntBlk;
   5.183 +		ACPI_GENERIC_ADDRESS_STRUCTURE    XPm2CntBlk;
   5.184 +		ACPI_GENERIC_ADDRESS_STRUCTURE    XPmTmrBlk;
   5.185 +		ACPI_GENERIC_ADDRESS_STRUCTURE    XGpe0Blk;
   5.186 +		ACPI_GENERIC_ADDRESS_STRUCTURE    XGpe1Blk;
   5.187 +} ACPI_2_0_FADT;
   5.188 +#define ACPI_2_0_FADT_REVISION 0x03
   5.189 +
   5.190 +//
   5.191 +// FADT Boot Architecture Flags
   5.192 +//
   5.193 +#define ACPI_LEGACY_DEVICES (1 << 0)
   5.194 +#define ACPI_8042           (1 << 1)
   5.195 +
   5.196 +//
   5.197 +// FADT Fixed Feature Flags
   5.198 +//
   5.199 +#define ACPI_WBINVD         (1 << 0)
   5.200 +#define ACPI_WBINVD_FLUSH   (1 << 1)
   5.201 +#define ACPI_PROC_C1        (1 << 2)
   5.202 +#define ACPI_P_LVL2_UP      (1 << 3)
   5.203 +#define ACPI_PWR_BUTTON     (1 << 4)
   5.204 +#define ACPI_SLP_BUTTON     (1 << 5)
   5.205 +#define ACPI_FIX_RTC        (1 << 6)
   5.206 +#define ACPI_RTC_S4         (1 << 7)
   5.207 +#define ACPI_TMR_VAL_EXT    (1 << 8)
   5.208 +#define ACPI_DCK_CAP        (1 << 9)
   5.209 +#define ACPI_RESET_REG_SUP  (1 << 10)
   5.210 +#define ACPI_SEALED_CASE    (1 << 11)
   5.211 +#define ACPI_HEADLESS       (1 << 12)
   5.212 +#define ACPI_CPU_SW_SLP     (1 << 13)
   5.213 +
   5.214 +//
   5.215 +// Firmware ACPI Control Structure (FACS)
   5.216 +//
   5.217 +typedef struct {
   5.218 +		u32                               Signature;
   5.219 +		u32                               Length;
   5.220 +		u32                               HardwareSignature;
   5.221 +		u32                               FirmwareWakingVector;
   5.222 +		u32                               GlobalLock;
   5.223 +		u32                               Flags;
   5.224 +		u64                               XFirmwareWakingVector;
   5.225 +		u8                                Version;
   5.226 +		u8                                Reserved[31];
   5.227 +} ACPI_2_0_FACS;
   5.228 +
   5.229 +#define ACPI_2_0_FACS_VERSION 0x01
   5.230 +
   5.231 +//
   5.232 +// Multiple APIC Description Table header definition (MADT)
   5.233 +//
   5.234 +typedef struct {
   5.235 +		ACPI_TABLE_HEADER                       Header;
   5.236 +		u32                                     LocalApicAddress;
   5.237 +		u32                                     Flags;
   5.238 +} ACPI_2_0_MADT;
   5.239 +
   5.240 +#define ACPI_2_0_MADT_REVISION 0x01
   5.241 +
   5.242 +//
   5.243 +// Multiple APIC Flags
   5.244 +//
   5.245 +#define ACPI_PCAT_COMPAT (1 << 0)
   5.246 +
   5.247 +//
   5.248 +// Multiple APIC Description Table APIC structure types
   5.249 +//
   5.250 +#define ACPI_PROCESSOR_LOCAL_APIC           0x00
   5.251 +#define ACPI_IO_APIC                        0x01
   5.252 +#define ACPI_INTERRUPT_SOURCE_OVERRIDE      0x02
   5.253 +#define ACPI_NON_MASKABLE_INTERRUPT_SOURCE  0x03
   5.254 +#define ACPI_LOCAL_APIC_NMI                 0x04
   5.255 +#define ACPI_LOCAL_APIC_ADDRESS_OVERRIDE    0x05
   5.256 +#define ACPI_IO_SAPIC                       0x06
   5.257 +#define ACPI_PROCESSOR_LOCAL_SAPIC          0x07
   5.258 +#define ACPI_PLATFORM_INTERRUPT_SOURCES     0x08
   5.259 +
   5.260 +//
   5.261 +// APIC Structure Definitions
   5.262 +//
   5.263 +
   5.264 +//
   5.265 +// Processor Local APIC Structure Definition
   5.266 +//
   5.267 +
   5.268 +typedef struct {
   5.269 +		u8                                             Type;
   5.270 +		u8                                             Length;
   5.271 +		u8                                             AcpiProcessorId;
   5.272 +		u8                                             ApicId;
   5.273 +		u32                                            Flags;
   5.274 +} ACPI_LOCAL_APIC_STRUCTURE;
   5.275 +
   5.276 +//
   5.277 +// Local APIC Flags.  All other bits are reserved and must be 0.
   5.278 +//
   5.279 +
   5.280 +#define ACPI_LOCAL_APIC_ENABLED (1 << 0)
   5.281 +
   5.282 +//
   5.283 +// IO APIC Structure
   5.284 +//
   5.285 +
   5.286 +typedef struct {
   5.287 +		u8                                             Type;
   5.288 +		u8                                             Length;
   5.289 +		u8                                             IoApicId;
   5.290 +		u8                                             Reserved;
   5.291 +		u32                                            IoApicAddress;
   5.292 +		u32                                            GlobalSystemInterruptBase;
   5.293 +} ACPI_IO_APIC_STRUCTURE;
   5.294 +
   5.295 +// Tabel Signature
   5.296 +#define ACPI_2_0_RSDP_SIGNATURE 0x2052545020445352LL  // "RSD PTR "
   5.297 +
   5.298 +#define ACPI_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE 0x54445344  //"DSDT"
   5.299 +
   5.300 +#define ACPI_2_0_FACS_SIGNATURE 0x53434146 // "FACS"
   5.301 +
   5.302 +#define ACPI_2_0_FADT_SIGNATURE 0x50434146 // "FADT"
   5.303 +
   5.304 +#define ACPI_MULTIPLE_APIC_DESCRIPTION_TABLE_SIGNATURE 0x43495041  // "APIC"
   5.305 +
   5.306 +#define ACPI_2_0_RSDT_SIGNATURE 0x54445352  // "RSDT"
   5.307 +
   5.308 +#define ACPI_2_0_XSDT_SIGNATURE 0x54445358  // "XSDT"
   5.309 +
   5.310 +#pragma pack ()
   5.311 +
   5.312 +// The physical that acpi table reside in the guest BIOS
   5.313 +//#define ACPI_PHYSICAL_ADDRESS 0xE2000
   5.314 +#define ACPI_PHYSICAL_ADDRESS 0xEA000
   5.315 +#define ACPI_TABLE_SIZE (2*1024)  //Currently 2K is enough
   5.316 +
   5.317 +void
   5.318 +AcpiBuildTable(u8* buf);
   5.319 +
   5.320 +#endif
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/tools/firmware/acpi/acpi_build.c	Thu Jun 30 08:09:23 2005 +0000
     6.3 @@ -0,0 +1,232 @@
     6.4 +/*
     6.5 + * Copyright (c) 2004, Intel Corporation.
     6.6 + *
     6.7 + * This program is free software; you can redistribute it and/or modify it
     6.8 + * under the terms and conditions of the GNU General Public License,
     6.9 + * version 2, as published by the Free Software Foundation.
    6.10 + *
    6.11 + * This program is distributed in the hope it will be useful, but WITHOUT
    6.12 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    6.13 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
    6.14 + * more details.
    6.15 + *
    6.16 + * You should have received a copy of the GNU General Public License along with
    6.17 + * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
    6.18 + * Place - Suite 330, Boston, MA 02111-1307 USA.
    6.19 + *
    6.20 + */
    6.21 +
    6.22 +#include "acpi2_0.h"
    6.23 +#include "acpi_madt.h"
    6.24 +
    6.25 +extern ACPI_2_0_RSDP Rsdp;
    6.26 +extern ACPI_2_0_RSDT Rsdt;
    6.27 +extern ACPI_2_0_XSDT Xsdt;
    6.28 +extern ACPI_2_0_FADT Fadt;
    6.29 +extern ACPI_MULTIPLE_APIC_DESCRIPTION_TABLE Madt;
    6.30 +extern ACPI_2_0_FACS Facs;
    6.31 +extern unsigned char *AmlCode;
    6.32 +extern int DsdtLen;
    6.33 +
    6.34 +
    6.35 +typedef struct _ACPI_TABLE_ALL{
    6.36 +		ACPI_2_0_RSDP *Rsdp;
    6.37 +		ACPI_2_0_RSDT *Rsdt;
    6.38 +		ACPI_2_0_XSDT *Xsdt;
    6.39 +		ACPI_2_0_FADT *Fadt;
    6.40 +		ACPI_MULTIPLE_APIC_DESCRIPTION_TABLE *Madt;
    6.41 +		ACPI_2_0_FACS *Facs;
    6.42 +		unsigned char* Dsdt;
    6.43 +		u32 RsdpOffset;
    6.44 +		u32 RsdtOffset;
    6.45 +		u32 XsdtOffset;
    6.46 +		u32 FadtOffset;
    6.47 +		u32 MadtOffset;
    6.48 +		u32 FacsOffset;
    6.49 +		u32 DsdtOffset;
    6.50 +}ACPI_TABLE_ALL;
    6.51 +
    6.52 +static 
    6.53 +void
    6.54 +MemCopy(void* src, void* dst, int len){
    6.55 +
    6.56 +	u8* src0=src;
    6.57 +   	u8* dst0=dst;	
    6.58 +
    6.59 +	while(len--){
    6.60 +		*(dst0++)=*(src0++);
    6.61 +	}
    6.62 +}
    6.63 +
    6.64 +static
    6.65 +void
    6.66 +SetCheckSum(
    6.67 +  void*  Table, 
    6.68 +  u32 ChecksumOffset,
    6.69 +  u32 Length
    6.70 +)
    6.71 +/*
    6.72 + * Routine Description:
    6.73 + *      Calculate Checksum and store the result in the checksum 
    6.74 + * 	filed of the table	
    6.75 + *
    6.76 + * INPUT:
    6.77 + * 	Table:          Start pointer of table
    6.78 + * 	ChecksumOffset: Offset of checksum field in the table
    6.79 + * 	Length:         Length of Table
    6.80 + */
    6.81 +{
    6.82 +	u8 Sum = 0;  
    6.83 +	u8 *Ptr;
    6.84 +
    6.85 +	Ptr=Table;
    6.86 +	Ptr[ChecksumOffset]=0;
    6.87 +	while (Length--) {    
    6.88 +		Sum = (u8)(Sum + (*Ptr++));
    6.89 +	}
    6.90 +	
    6.91 +	Ptr = Table;
    6.92 +	Ptr[ChecksumOffset] = (u8) (0xff - Sum + 1);
    6.93 +}
    6.94 +
    6.95 +//
    6.96 +//  FIELD_OFFSET - returns the byte offset to a field within a structure
    6.97 +//
    6.98 +#define FIELD_OFFSET(TYPE,Field) ((u32)(&(((TYPE *) 0)->Field)))
    6.99 +
   6.100 +static
   6.101 +void
   6.102 +UpdateTable(
   6.103 +	ACPI_TABLE_ALL *table
   6.104 +)
   6.105 +/*
   6.106 + * Update the ACPI table:
   6.107 + * 		fill in the actuall physical address of RSDT, XSDT, FADT, MADT, FACS
   6.108 + * 		Caculate the checksum
   6.109 + */
   6.110 +{    
   6.111 +	// RSDP Update	
   6.112 +	table->Rsdp->RsdtAddress = (u32)(ACPI_PHYSICAL_ADDRESS+
   6.113 +					table->RsdtOffset);
   6.114 +	table->Rsdp->XsdtAddress = (u64)(ACPI_PHYSICAL_ADDRESS+
   6.115 +					table->XsdtOffset);
   6.116 +	SetCheckSum(table->Rsdp,
   6.117 +					FIELD_OFFSET(ACPI_1_0_RSDP, Checksum),
   6.118 +					sizeof(ACPI_1_0_RSDP)
   6.119 +			   );
   6.120 +	SetCheckSum(table->Rsdp,
   6.121 +					FIELD_OFFSET(ACPI_2_0_RSDP,
   6.122 +							ExtendedChecksum),
   6.123 +					sizeof(ACPI_2_0_RSDP)
   6.124 +			   );
   6.125 +
   6.126 +	
   6.127 +	//RSDT Update
   6.128 +	table->Rsdt->Entry[0] = (u32)(ACPI_PHYSICAL_ADDRESS + 
   6.129 +					table->FadtOffset);	
   6.130 +	table->Rsdt->Entry[1] = (u32)(ACPI_PHYSICAL_ADDRESS + 
   6.131 +					table->MadtOffset);
   6.132 +	table->Rsdt->Header.Length = sizeof (ACPI_TABLE_HEADER) +
   6.133 +		   			2*sizeof(u32);
   6.134 +	SetCheckSum(table->Rsdt,
   6.135 +					FIELD_OFFSET(ACPI_TABLE_HEADER, Checksum),
   6.136 +					table->Rsdt->Header.Length
   6.137 +			   );	
   6.138 +	
   6.139 +	//XSDT	Update
   6.140 +	table->Xsdt->Entry[0] = (u64)(ACPI_PHYSICAL_ADDRESS +
   6.141 +					table->FadtOffset);
   6.142 +	table->Xsdt->Entry[1] = (u64)(ACPI_PHYSICAL_ADDRESS + 
   6.143 +					table->MadtOffset);	
   6.144 +	table->Xsdt->Header.Length = sizeof (ACPI_TABLE_HEADER) + 
   6.145 +					2*sizeof(u64);
   6.146 +	SetCheckSum(table->Xsdt,
   6.147 +					FIELD_OFFSET(ACPI_TABLE_HEADER, Checksum),
   6.148 +					table->Xsdt->Header.Length
   6.149 +			   );
   6.150 +
   6.151 +	// FADT Update
   6.152 +	table->Fadt->Dsdt = (u32)(ACPI_PHYSICAL_ADDRESS + 
   6.153 +					table->DsdtOffset);	
   6.154 +	table->Fadt->XDsdt = (u64)(ACPI_PHYSICAL_ADDRESS + 
   6.155 +				   table->DsdtOffset);
   6.156 +	table->Fadt->FirmwareCtrl = (u32)(ACPI_PHYSICAL_ADDRESS +
   6.157 +					table->FacsOffset);
   6.158 +	table->Fadt->XFirmwareCtrl = (u64)(ACPI_PHYSICAL_ADDRESS + 
   6.159 +					table->FacsOffset);	
   6.160 +	SetCheckSum(table->Fadt,
   6.161 +					FIELD_OFFSET(ACPI_TABLE_HEADER, Checksum),
   6.162 +					sizeof(ACPI_2_0_FADT)
   6.163 +			   );
   6.164 +	
   6.165 +	// MADT update
   6.166 +	SetCheckSum(table->Madt,
   6.167 +					FIELD_OFFSET(ACPI_TABLE_HEADER, Checksum),
   6.168 +					sizeof(ACPI_MULTIPLE_APIC_DESCRIPTION_TABLE)
   6.169 +			   );
   6.170 +}
   6.171 +
   6.172 +void
   6.173 +AcpiBuildTable(u8* buf)
   6.174 +/*
   6.175 + * Copy all the ACPI table to buffer
   6.176 + * Buffer Layout:
   6.177 + * 		FACS
   6.178 + * 		RSDP
   6.179 + * 		RSDT
   6.180 + * 		XSDT
   6.181 + * 		FADT
   6.182 + * 		MADT
   6.183 + * 		DSDT 		
   6.184 + *
   6.185 + */		
   6.186 +{
   6.187 +	ACPI_TABLE_ALL table;
   6.188 +	int offset=0;
   6.189 +
   6.190 +	// FACS: should be 64-bit alignment 	
   6.191 +	// so it is put at the start of buffer
   6.192 +	// as the buffer is 64 bit alignment
   6.193 +	table.FacsOffset = offset;
   6.194 +	table.Facs = (ACPI_2_0_FACS*)(&buf[offset]);
   6.195 +	MemCopy(&Facs, table.Facs, sizeof(ACPI_2_0_FACS));
   6.196 +	offset += sizeof(ACPI_2_0_FACS);
   6.197 +
   6.198 +	// RSDP
   6.199 +	table.RsdpOffset = offset;
   6.200 +	table.Rsdp = (ACPI_2_0_RSDP*)(&buf[offset]);
   6.201 +	MemCopy(&Rsdp, table.Rsdp, sizeof(ACPI_2_0_RSDP));
   6.202 +	offset+=sizeof(ACPI_2_0_RSDP);
   6.203 +
   6.204 +	// RSDT
   6.205 +	table.RsdtOffset = offset;
   6.206 +	table.Rsdt = (ACPI_2_0_RSDT*)(&buf[offset]);
   6.207 +	MemCopy(&Rsdt, table.Rsdt, sizeof(ACPI_2_0_RSDT));
   6.208 +	offset+=sizeof(ACPI_2_0_RSDT);
   6.209 +	
   6.210 +	// XSDT
   6.211 +	table.XsdtOffset = offset;
   6.212 +	table.Xsdt = (ACPI_2_0_XSDT*)(&buf[offset]);
   6.213 +	MemCopy(&Xsdt, table.Xsdt, sizeof(ACPI_2_0_XSDT));
   6.214 +	offset+=sizeof(ACPI_2_0_XSDT);
   6.215 +	
   6.216 +	// FADT
   6.217 +	table.FadtOffset = offset;
   6.218 +	table.Fadt = (ACPI_2_0_FADT*)(&buf[offset]);
   6.219 +	MemCopy(&Fadt, table.Fadt, sizeof(ACPI_2_0_FADT));
   6.220 +	offset+=sizeof(ACPI_2_0_FADT);
   6.221 +	
   6.222 +	// MADT
   6.223 +	table.MadtOffset = offset;
   6.224 +	table.Madt = (ACPI_MULTIPLE_APIC_DESCRIPTION_TABLE*)(&buf[offset]);
   6.225 +	MemCopy(&Madt, table.Madt, sizeof(ACPI_MULTIPLE_APIC_DESCRIPTION_TABLE));
   6.226 +	offset+=sizeof(ACPI_MULTIPLE_APIC_DESCRIPTION_TABLE);
   6.227 +
   6.228 +	// DSDT
   6.229 +	table.DsdtOffset = offset;
   6.230 +	table.Dsdt = (unsigned char*)(&buf[offset]);
   6.231 +	MemCopy(&AmlCode, table.Dsdt, DsdtLen);
   6.232 +	offset+=DsdtLen; 
   6.233 +	
   6.234 +	UpdateTable(&table);
   6.235 +}
     7.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.2 +++ b/tools/firmware/acpi/acpi_dsdt.asl	Thu Jun 30 08:09:23 2005 +0000
     7.3 @@ -0,0 +1,312 @@
     7.4 +//**********************************************************************//
     7.5 +//*
     7.6 +//* Copyright (c) 2004, Intel Corporation.
     7.7 +//*
     7.8 +//* This program is free software; you can redistribute it and/or modify it
     7.9 +//* under the terms and conditions of the GNU General Public License,
    7.10 +//* version 2, as published by the Free Software Foundation.
    7.11 +//*
    7.12 +//* This program is distributed in the hope it will be useful, but WITHOUT
    7.13 +//* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    7.14 +//* FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
    7.15 +//* more details.
    7.16 +//*
    7.17 +//* You should have received a copy of the GNU General Public License along with
    7.18 +//* this program; if not, write to the Free Software Foundation, Inc., 59 Temple
    7.19 +//* Place - Suite 330, Boston, MA 02111-1307 USA.
    7.20 +
    7.21 +//**
    7.22 +//** 		DSDT for Xen with Qemu device model
    7.23 +//**
    7.24 +//**
    7.25 +
    7.26 +DefinitionBlock ("DSDT.aml", "DSDT", 1, "INTEL ", "XEN     ", 2)
    7.27 +{
    7.28 +    Name (\PMBS, 0x0C00)
    7.29 +    Name (\PMLN, 0x08)
    7.30 +    Name (\IOB1, 0x00)
    7.31 +    Name (\IOL1, 0x00)
    7.32 +    Name (\APCB, 0xFEC00000)
    7.33 +    Name (\APCL, 0x00010000)
    7.34 +    Name (\PUID, 0x00)
    7.35 +    Scope (\_PR)
    7.36 +    {
    7.37 +        Processor (CPU0, 0x00, 0x00000000, 0x00) {}
    7.38 +        Processor (CPU1, 0x01, 0x00000000, 0x00) {}
    7.39 +        Processor (CPU2, 0x02, 0x00000000, 0x00) {}
    7.40 +        Processor (CPU3, 0x03, 0x00000000, 0x00) {}
    7.41 +    }
    7.42 +
    7.43 +    Scope (\_SB)
    7.44 +    {
    7.45 +        Device (PCI0)
    7.46 +        {
    7.47 +            Name (_HID, EisaId ("PNP0A03"))
    7.48 +            Name (_UID, 0x00)
    7.49 +            Name (_ADR, 0x00)
    7.50 +            Name (_BBN, 0x00)
    7.51 +            Method (_CRS, 0, NotSerialized)
    7.52 +            {
    7.53 +                Name (PRT0, ResourceTemplate ()
    7.54 +                {
    7.55 +					/* bus number is from 0 - 255*/
    7.56 +                    WordBusNumber (ResourceConsumer, MinFixed, MaxFixed, SubDecode,
    7.57 +                        0x0000,
    7.58 +                        0x0000,
    7.59 +                        0x00FF,
    7.60 +                        0x0000,
    7.61 +                        0x0100)
    7.62 +                    IO (Decode16, 0x0CF8, 0x0CF8, 0x01, 0x08)
    7.63 +                    WordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
    7.64 +                        0x0000,
    7.65 +                        0x0000,
    7.66 +                        0x0CF7,
    7.67 +                        0x0000,
    7.68 +                        0x0CF8)
    7.69 +                    WordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
    7.70 +                        0x0000,
    7.71 +                        0x0D00,
    7.72 +                        0x0FFF,
    7.73 +                        0x0000,
    7.74 +                        0x0300)
    7.75 +                    DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadOnly,
    7.76 +                        0x00000000,
    7.77 +                        0x000A0000,
    7.78 +                        0x000FFFFF,
    7.79 +                        0x00000000,
    7.80 +                        0x00060000)
    7.81 +                })
    7.82 +                Return (PRT0)
    7.83 +            }
    7.84 +
    7.85 +            Name (AIR0, Package (0x06)
    7.86 +            {
    7.87 +               Package (0x04)
    7.88 +                {
    7.89 +                    0x001FFFFF, 
    7.90 +                    0x02, 
    7.91 +                    0x00, 
    7.92 +                    0x17
    7.93 +                }, 
    7.94 +
    7.95 +                Package (0x04)
    7.96 +                {
    7.97 +                    0x001FFFFF, 
    7.98 +                    0x03, 
    7.99 +                    0x00, 
   7.100 +                    0x13
   7.101 +                }, 
   7.102 +
   7.103 +                Package (0x04)
   7.104 +                {
   7.105 +                    0x001DFFFF, 
   7.106 +                    0x01, 
   7.107 +                    0x00, 
   7.108 +                    0x13
   7.109 +                }, 
   7.110 +
   7.111 +                Package (0x04)
   7.112 +                {
   7.113 +                    0x001DFFFF, 
   7.114 +                    0x00, 
   7.115 +                    0x00, 
   7.116 +                    0x10
   7.117 +                }, 
   7.118 +
   7.119 +                Package (0x04)
   7.120 +                {
   7.121 +                    0x001DFFFF, 
   7.122 +                    0x02, 
   7.123 +                    0x00, 
   7.124 +                    0x12
   7.125 +                }, 
   7.126 +
   7.127 +                Package (0x04)
   7.128 +                {
   7.129 +                    0x001DFFFF, 
   7.130 +                    0x03, 
   7.131 +                    0x00, 
   7.132 +                    0x17
   7.133 +                }
   7.134 +            })
   7.135 +            Method (_PRT, 0, NotSerialized)
   7.136 +            {
   7.137 +                Return (AIR0)
   7.138 +            }
   7.139 +
   7.140 +            Device (ISA)
   7.141 +            {
   7.142 +                Name (_ADR, 0x00010000) /*TODO, device id, PCI bus num, ...*/
   7.143 +
   7.144 +                Device (SYSR)
   7.145 +                {
   7.146 +                    Name (_HID, EisaId ("PNP0C02"))
   7.147 +                    Name (_UID, 0x01)
   7.148 +                    Name (CRS, ResourceTemplate ()
   7.149 +                    {
   7.150 +						/* TODO: list hidden resources */
   7.151 +                        IO (Decode16, 0x0010, 0x0010, 0x00, 0x10)
   7.152 +                        IO (Decode16, 0x0022, 0x0022, 0x00, 0x0C)
   7.153 +                        IO (Decode16, 0x0030, 0x0030, 0x00, 0x10)
   7.154 +                        IO (Decode16, 0x0044, 0x0044, 0x00, 0x1C)
   7.155 +                        IO (Decode16, 0x0062, 0x0062, 0x00, 0x02)
   7.156 +                        IO (Decode16, 0x0065, 0x0065, 0x00, 0x0B)
   7.157 +                        IO (Decode16, 0x0072, 0x0072, 0x00, 0x0E)
   7.158 +                        IO (Decode16, 0x0080, 0x0080, 0x00, 0x01)
   7.159 +                        IO (Decode16, 0x0084, 0x0084, 0x00, 0x03)
   7.160 +                        IO (Decode16, 0x0088, 0x0088, 0x00, 0x01)
   7.161 +                        IO (Decode16, 0x008C, 0x008C, 0x00, 0x03)
   7.162 +                        IO (Decode16, 0x0090, 0x0090, 0x00, 0x10)
   7.163 +                        IO (Decode16, 0x00A2, 0x00A2, 0x00, 0x1C)
   7.164 +                        IO (Decode16, 0x00E0, 0x00E0, 0x00, 0x10)
   7.165 +                        IO (Decode16, 0x08A0, 0x08A0, 0x00, 0x04)
   7.166 +                        IO (Decode16, 0x0CC0, 0x0CC0, 0x00, 0x10)
   7.167 +                        IO (Decode16, 0x04D0, 0x04D0, 0x00, 0x02)
   7.168 +                    })
   7.169 +                    Method (_CRS, 0, NotSerialized)
   7.170 +                    {
   7.171 +                        Return (CRS)
   7.172 +                    }
   7.173 +                }
   7.174 +
   7.175 +                Device (PIC)
   7.176 +                {
   7.177 +                    Name (_HID, EisaId ("PNP0000"))
   7.178 +                    Name (_CRS, ResourceTemplate ()
   7.179 +                    {
   7.180 +                        IO (Decode16, 0x0020, 0x0020, 0x01, 0x02)
   7.181 +                        IO (Decode16, 0x00A0, 0x00A0, 0x01, 0x02)
   7.182 +                        IRQNoFlags () {2}
   7.183 +                    })
   7.184 +                }
   7.185 +
   7.186 +                Device (DMA0)
   7.187 +                {
   7.188 +                    Name (_HID, EisaId ("PNP0200"))
   7.189 +                    Name (_CRS, ResourceTemplate ()
   7.190 +                    {
   7.191 +                        DMA (Compatibility, BusMaster, Transfer8) {4}
   7.192 +                        IO (Decode16, 0x0000, 0x0000, 0x00, 0x10)
   7.193 +                        IO (Decode16, 0x0081, 0x0081, 0x00, 0x03)
   7.194 +                        IO (Decode16, 0x0087, 0x0087, 0x00, 0x01)
   7.195 +                        IO (Decode16, 0x0089, 0x0089, 0x00, 0x03)
   7.196 +                        IO (Decode16, 0x008F, 0x008F, 0x00, 0x01)
   7.197 +                        IO (Decode16, 0x00C0, 0x00C0, 0x00, 0x20)
   7.198 +						IO (Decode16, 0x0480, 0x0480, 0x00, 0x10)
   7.199 +                    })
   7.200 +                }
   7.201 +
   7.202 +                Device (TMR)
   7.203 +                {
   7.204 +                    Name (_HID, EisaId ("PNP0100"))
   7.205 +                    Name (_CRS, ResourceTemplate ()
   7.206 +                    {
   7.207 +                        IO (Decode16, 0x0040, 0x0040, 0x00, 0x04)
   7.208 +                        IRQNoFlags () {0}
   7.209 +                    })
   7.210 +                }
   7.211 +
   7.212 +                Device (RTC)
   7.213 +                {
   7.214 +                    Name (_HID, EisaId ("PNP0B00"))
   7.215 +                    Name (_CRS, ResourceTemplate ()
   7.216 +                    {
   7.217 +                        IO (Decode16, 0x0070, 0x0070, 0x00, 0x02)
   7.218 +                        IRQNoFlags () {8}
   7.219 +                    })
   7.220 +                }
   7.221 +
   7.222 +                Device (SPKR)
   7.223 +                {
   7.224 +                    Name (_HID, EisaId ("PNP0800"))
   7.225 +                    Name (_CRS, ResourceTemplate ()
   7.226 +                    {
   7.227 +                        IO (Decode16, 0x0061, 0x0061, 0x00, 0x01)
   7.228 +                    })
   7.229 +                }
   7.230 +
   7.231 +                Device (PS2M)
   7.232 +                {
   7.233 +                    Name (_HID, EisaId ("PNP0F13"))
   7.234 +                    Name (_CID, 0x130FD041)
   7.235 +                    Method (_STA, 0, NotSerialized)
   7.236 +                    {
   7.237 +                        Return (0x0F)
   7.238 +                    }
   7.239 +
   7.240 +                    Name (_CRS, ResourceTemplate ()
   7.241 +                    {
   7.242 +                        IRQNoFlags () {12}
   7.243 +                    })
   7.244 +                }
   7.245 +
   7.246 +                Device (PS2K)
   7.247 +                {
   7.248 +                    Name (_HID, EisaId ("PNP0303"))
   7.249 +                    Name (_CID, 0x0B03D041)
   7.250 +                    Method (_STA, 0, NotSerialized)
   7.251 +                    {
   7.252 +                        Return (0x0F)
   7.253 +                    }
   7.254 +
   7.255 +                    Name (_CRS, ResourceTemplate ()
   7.256 +                    {
   7.257 +                        IO (Decode16, 0x0060, 0x0060, 0x00, 0x01)
   7.258 +                        IO (Decode16, 0x0064, 0x0064, 0x00, 0x01)
   7.259 +                        IRQNoFlags () {1}
   7.260 +                    })
   7.261 +                }
   7.262 +
   7.263 +                Device (FDC0)
   7.264 +                {
   7.265 +                    Name (_HID, EisaId ("PNP0700"))
   7.266 +                    Method (_STA, 0, NotSerialized)
   7.267 +                    {
   7.268 +                          Return (0x0F)
   7.269 +                    }
   7.270 +
   7.271 +                    Name (_CRS, ResourceTemplate ()
   7.272 +                    {
   7.273 +                        IO (Decode16, 0x03F0, 0x03F0, 0x01, 0x06)
   7.274 +                        IO (Decode16, 0x03F7, 0x03F7, 0x01, 0x01)
   7.275 +                        IRQNoFlags () {6}
   7.276 +                        DMA (Compatibility, NotBusMaster, Transfer8) {2}
   7.277 +                    })
   7.278 +                }
   7.279 +
   7.280 +                Device (UAR1)
   7.281 +                {
   7.282 +                    Name (_HID, EisaId ("PNP0501"))
   7.283 +                    Name (_UID, 0x01)
   7.284 +                    Method (_STA, 0, NotSerialized)
   7.285 +                    {
   7.286 +                        Return (0x0F)
   7.287 +                    }
   7.288 +
   7.289 +                    Name (_CRS, ResourceTemplate()
   7.290 +                    {
   7.291 +                        IO (Decode16, 0x03F8, 0x03F8, 0x01, 0x08)
   7.292 +                        IRQNoFlags () {4}
   7.293 +                    })
   7.294 +                }
   7.295 +
   7.296 +                Device (UAR2)
   7.297 +                {
   7.298 +                    Name (_HID, EisaId ("PNP0501"))
   7.299 +                    Name (_UID, 0x02)
   7.300 +                    Method (_STA, 0, NotSerialized)
   7.301 +                    {
   7.302 +                        Return (0x0F)
   7.303 +                    }
   7.304 +
   7.305 +                    Name (_CRS, ResourceTemplate()
   7.306 +                    {
   7.307 +                        IO (Decode16, 0x02F8, 0x02F8, 0x01, 0x08)
   7.308 +                        IRQNoFlags () {3}
   7.309 +                    })
   7.310 +                } 
   7.311 +            }
   7.312 +        }
   7.313 +    }
   7.314 +}
   7.315 +
     8.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.2 +++ b/tools/firmware/acpi/acpi_dsdt.c	Thu Jun 30 08:09:23 2005 +0000
     8.3 @@ -0,0 +1,161 @@
     8.4 +/*
     8.5 + * 
     8.6 + * Intel ACPI Component Architecture
     8.7 + * ASL Optimizing Compiler / AML Disassembler version 20050513 [Jun  8 2005]
     8.8 + * Copyright (C) 2000 - 2005 Intel Corporation
     8.9 + * Supports ACPI Specification Revision 3.0
    8.10 + * 
    8.11 + * Compilation of "acpi_dsdt.asl" - Wed Jun 15 09:19:49 2005
    8.12 + * 
    8.13 + * C source code output
    8.14 + *
    8.15 + */
    8.16 +unsigned char AmlCode[] = 
    8.17 +{
    8.18 +    0x44,0x53,0x44,0x54,0x87,0x04,0x00,0x00,  /* 00000000    "DSDT...." */
    8.19 +    0x01,0x19,0x49,0x4E,0x54,0x45,0x4C,0x20,  /* 00000008    "..INTEL " */
    8.20 +    0x58,0x45,0x4E,0x20,0x20,0x20,0x20,0x20,  /* 00000010    "XEN     " */
    8.21 +    0x02,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C,  /* 00000018    "....INTL" */
    8.22 +    0x13,0x05,0x05,0x20,0x08,0x5C,0x50,0x4D,  /* 00000020    "... .\PM" */
    8.23 +    0x42,0x53,0x0B,0x00,0x0C,0x08,0x5C,0x50,  /* 00000028    "BS....\P" */
    8.24 +    0x4D,0x4C,0x4E,0x0A,0x08,0x08,0x5C,0x49,  /* 00000030    "MLN...\I" */
    8.25 +    0x4F,0x42,0x31,0x0A,0x00,0x08,0x5C,0x49,  /* 00000038    "OB1...\I" */
    8.26 +    0x4F,0x4C,0x31,0x0A,0x00,0x08,0x5C,0x41,  /* 00000040    "OL1...\A" */
    8.27 +    0x50,0x43,0x42,0x0C,0x00,0x00,0xC0,0xFE,  /* 00000048    "PCB....." */
    8.28 +    0x08,0x5C,0x41,0x50,0x43,0x4C,0x0C,0x00,  /* 00000050    ".\APCL.." */
    8.29 +    0x00,0x01,0x00,0x08,0x5C,0x50,0x55,0x49,  /* 00000058    "....\PUI" */
    8.30 +    0x44,0x0A,0x00,0x10,0x3A,0x5C,0x5F,0x50,  /* 00000060    "D...:\_P" */
    8.31 +    0x52,0x5F,0x5B,0x83,0x0B,0x43,0x50,0x55,  /* 00000068    "R_[..CPU" */
    8.32 +    0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x5B,  /* 00000070    "0......[" */
    8.33 +    0x83,0x0B,0x43,0x50,0x55,0x31,0x01,0x00,  /* 00000078    "..CPU1.." */
    8.34 +    0x00,0x00,0x00,0x00,0x5B,0x83,0x0B,0x43,  /* 00000080    "....[..C" */
    8.35 +    0x50,0x55,0x32,0x02,0x00,0x00,0x00,0x00,  /* 00000088    "PU2....." */
    8.36 +    0x00,0x5B,0x83,0x0B,0x43,0x50,0x55,0x33,  /* 00000090    ".[..CPU3" */
    8.37 +    0x03,0x00,0x00,0x00,0x00,0x00,0x10,0x48,  /* 00000098    ".......H" */
    8.38 +    0x3E,0x5C,0x5F,0x53,0x42,0x5F,0x5B,0x82,  /* 000000A0    ">\_SB_[." */
    8.39 +    0x4F,0x3D,0x50,0x43,0x49,0x30,0x08,0x5F,  /* 000000A8    "O=PCI0._" */
    8.40 +    0x48,0x49,0x44,0x0C,0x41,0xD0,0x0A,0x03,  /* 000000B0    "HID.A..." */
    8.41 +    0x08,0x5F,0x55,0x49,0x44,0x0A,0x00,0x08,  /* 000000B8    "._UID..." */
    8.42 +    0x5F,0x41,0x44,0x52,0x0A,0x00,0x08,0x5F,  /* 000000C0    "_ADR..._" */
    8.43 +    0x42,0x42,0x4E,0x0A,0x00,0x14,0x4A,0x06,  /* 000000C8    "BBN...J." */
    8.44 +    0x5F,0x43,0x52,0x53,0x00,0x08,0x50,0x52,  /* 000000D0    "_CRS..PR" */
    8.45 +    0x54,0x30,0x11,0x48,0x05,0x0A,0x54,0x88,  /* 000000D8    "T0.H..T." */
    8.46 +    0x0D,0x00,0x02,0x0F,0x00,0x00,0x00,0x00,  /* 000000E0    "........" */
    8.47 +    0x00,0xFF,0x00,0x00,0x00,0x00,0x01,0x47,  /* 000000E8    ".......G" */
    8.48 +    0x01,0xF8,0x0C,0xF8,0x0C,0x01,0x08,0x88,  /* 000000F0    "........" */
    8.49 +    0x0D,0x00,0x01,0x0C,0x03,0x00,0x00,0x00,  /* 000000F8    "........" */
    8.50 +    0x00,0xF7,0x0C,0x00,0x00,0xF8,0x0C,0x88,  /* 00000100    "........" */
    8.51 +    0x0D,0x00,0x01,0x0C,0x03,0x00,0x00,0x00,  /* 00000108    "........" */
    8.52 +    0x0D,0xFF,0x0F,0x00,0x00,0x00,0x03,0x87,  /* 00000110    "........" */
    8.53 +    0x17,0x00,0x00,0x0C,0x02,0x00,0x00,0x00,  /* 00000118    "........" */
    8.54 +    0x00,0x00,0x00,0x0A,0x00,0xFF,0xFF,0x0F,  /* 00000120    "........" */
    8.55 +    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,  /* 00000128    "........" */
    8.56 +    0x00,0x79,0x00,0xA4,0x50,0x52,0x54,0x30,  /* 00000130    ".y..PRT0" */
    8.57 +    0x08,0x41,0x49,0x52,0x30,0x12,0x47,0x05,  /* 00000138    ".AIR0.G." */
    8.58 +    0x06,0x12,0x0D,0x04,0x0C,0xFF,0xFF,0x1F,  /* 00000140    "........" */
    8.59 +    0x00,0x0A,0x02,0x0A,0x00,0x0A,0x17,0x12,  /* 00000148    "........" */
    8.60 +    0x0D,0x04,0x0C,0xFF,0xFF,0x1F,0x00,0x0A,  /* 00000150    "........" */
    8.61 +    0x03,0x0A,0x00,0x0A,0x13,0x12,0x0D,0x04,  /* 00000158    "........" */
    8.62 +    0x0C,0xFF,0xFF,0x1D,0x00,0x0A,0x01,0x0A,  /* 00000160    "........" */
    8.63 +    0x00,0x0A,0x13,0x12,0x0D,0x04,0x0C,0xFF,  /* 00000168    "........" */
    8.64 +    0xFF,0x1D,0x00,0x0A,0x00,0x0A,0x00,0x0A,  /* 00000170    "........" */
    8.65 +    0x10,0x12,0x0D,0x04,0x0C,0xFF,0xFF,0x1D,  /* 00000178    "........" */
    8.66 +    0x00,0x0A,0x02,0x0A,0x00,0x0A,0x12,0x12,  /* 00000180    "........" */
    8.67 +    0x0D,0x04,0x0C,0xFF,0xFF,0x1D,0x00,0x0A,  /* 00000188    "........" */
    8.68 +    0x03,0x0A,0x00,0x0A,0x17,0x14,0x0B,0x5F,  /* 00000190    "......._" */
    8.69 +    0x50,0x52,0x54,0x00,0xA4,0x41,0x49,0x52,  /* 00000198    "PRT..AIR" */
    8.70 +    0x30,0x5B,0x82,0x44,0x2E,0x49,0x53,0x41,  /* 000001A0    "0[.D.ISA" */
    8.71 +    0x5F,0x08,0x5F,0x41,0x44,0x52,0x0C,0x00,  /* 000001A8    "_._ADR.." */
    8.72 +    0x00,0x01,0x00,0x5B,0x82,0x47,0x0B,0x53,  /* 000001B0    "...[.G.S" */
    8.73 +    0x59,0x53,0x52,0x08,0x5F,0x48,0x49,0x44,  /* 000001B8    "YSR._HID" */
    8.74 +    0x0C,0x41,0xD0,0x0C,0x02,0x08,0x5F,0x55,  /* 000001C0    ".A...._U" */
    8.75 +    0x49,0x44,0x0A,0x01,0x08,0x43,0x52,0x53,  /* 000001C8    "ID...CRS" */
    8.76 +    0x5F,0x11,0x4E,0x08,0x0A,0x8A,0x47,0x01,  /* 000001D0    "_.N...G." */
    8.77 +    0x10,0x00,0x10,0x00,0x00,0x10,0x47,0x01,  /* 000001D8    "......G." */
    8.78 +    0x22,0x00,0x22,0x00,0x00,0x0C,0x47,0x01,  /* 000001E0    ""."...G." */
    8.79 +    0x30,0x00,0x30,0x00,0x00,0x10,0x47,0x01,  /* 000001E8    "0.0...G." */
    8.80 +    0x44,0x00,0x44,0x00,0x00,0x1C,0x47,0x01,  /* 000001F0    "D.D...G." */
    8.81 +    0x62,0x00,0x62,0x00,0x00,0x02,0x47,0x01,  /* 000001F8    "b.b...G." */
    8.82 +    0x65,0x00,0x65,0x00,0x00,0x0B,0x47,0x01,  /* 00000200    "e.e...G." */
    8.83 +    0x72,0x00,0x72,0x00,0x00,0x0E,0x47,0x01,  /* 00000208    "r.r...G." */
    8.84 +    0x80,0x00,0x80,0x00,0x00,0x01,0x47,0x01,  /* 00000210    "......G." */
    8.85 +    0x84,0x00,0x84,0x00,0x00,0x03,0x47,0x01,  /* 00000218    "......G." */
    8.86 +    0x88,0x00,0x88,0x00,0x00,0x01,0x47,0x01,  /* 00000220    "......G." */
    8.87 +    0x8C,0x00,0x8C,0x00,0x00,0x03,0x47,0x01,  /* 00000228    "......G." */
    8.88 +    0x90,0x00,0x90,0x00,0x00,0x10,0x47,0x01,  /* 00000230    "......G." */
    8.89 +    0xA2,0x00,0xA2,0x00,0x00,0x1C,0x47,0x01,  /* 00000238    "......G." */
    8.90 +    0xE0,0x00,0xE0,0x00,0x00,0x10,0x47,0x01,  /* 00000240    "......G." */
    8.91 +    0xA0,0x08,0xA0,0x08,0x00,0x04,0x47,0x01,  /* 00000248    "......G." */
    8.92 +    0xC0,0x0C,0xC0,0x0C,0x00,0x10,0x47,0x01,  /* 00000250    "......G." */
    8.93 +    0xD0,0x04,0xD0,0x04,0x00,0x02,0x79,0x00,  /* 00000258    "......y." */
    8.94 +    0x14,0x0B,0x5F,0x43,0x52,0x53,0x00,0xA4,  /* 00000260    ".._CRS.." */
    8.95 +    0x43,0x52,0x53,0x5F,0x5B,0x82,0x2B,0x50,  /* 00000268    "CRS_[.+P" */
    8.96 +    0x49,0x43,0x5F,0x08,0x5F,0x48,0x49,0x44,  /* 00000270    "IC_._HID" */
    8.97 +    0x0B,0x41,0xD0,0x08,0x5F,0x43,0x52,0x53,  /* 00000278    ".A.._CRS" */
    8.98 +    0x11,0x18,0x0A,0x15,0x47,0x01,0x20,0x00,  /* 00000280    "....G. ." */
    8.99 +    0x20,0x00,0x01,0x02,0x47,0x01,0xA0,0x00,  /* 00000288    " ...G..." */
   8.100 +    0xA0,0x00,0x01,0x02,0x22,0x04,0x00,0x79,  /* 00000290    "...."..y" */
   8.101 +    0x00,0x5B,0x82,0x47,0x05,0x44,0x4D,0x41,  /* 00000298    ".[.G.DMA" */
   8.102 +    0x30,0x08,0x5F,0x48,0x49,0x44,0x0C,0x41,  /* 000002A0    "0._HID.A" */
   8.103 +    0xD0,0x02,0x00,0x08,0x5F,0x43,0x52,0x53,  /* 000002A8    "...._CRS" */
   8.104 +    0x11,0x41,0x04,0x0A,0x3D,0x2A,0x10,0x04,  /* 000002B0    ".A..=*.." */
   8.105 +    0x47,0x01,0x00,0x00,0x00,0x00,0x00,0x10,  /* 000002B8    "G......." */
   8.106 +    0x47,0x01,0x81,0x00,0x81,0x00,0x00,0x03,  /* 000002C0    "G......." */
   8.107 +    0x47,0x01,0x87,0x00,0x87,0x00,0x00,0x01,  /* 000002C8    "G......." */
   8.108 +    0x47,0x01,0x89,0x00,0x89,0x00,0x00,0x03,  /* 000002D0    "G......." */
   8.109 +    0x47,0x01,0x8F,0x00,0x8F,0x00,0x00,0x01,  /* 000002D8    "G......." */
   8.110 +    0x47,0x01,0xC0,0x00,0xC0,0x00,0x00,0x20,  /* 000002E0    "G...... " */
   8.111 +    0x47,0x01,0x80,0x04,0x80,0x04,0x00,0x10,  /* 000002E8    "G......." */
   8.112 +    0x79,0x00,0x5B,0x82,0x25,0x54,0x4D,0x52,  /* 000002F0    "y.[.%TMR" */
   8.113 +    0x5F,0x08,0x5F,0x48,0x49,0x44,0x0C,0x41,  /* 000002F8    "_._HID.A" */
   8.114 +    0xD0,0x01,0x00,0x08,0x5F,0x43,0x52,0x53,  /* 00000300    "...._CRS" */
   8.115 +    0x11,0x10,0x0A,0x0D,0x47,0x01,0x40,0x00,  /* 00000308    "....G.@." */
   8.116 +    0x40,0x00,0x00,0x04,0x22,0x01,0x00,0x79,  /* 00000310    "@..."..y" */
   8.117 +    0x00,0x5B,0x82,0x25,0x52,0x54,0x43,0x5F,  /* 00000318    ".[.%RTC_" */
   8.118 +    0x08,0x5F,0x48,0x49,0x44,0x0C,0x41,0xD0,  /* 00000320    "._HID.A." */
   8.119 +    0x0B,0x00,0x08,0x5F,0x43,0x52,0x53,0x11,  /* 00000328    "..._CRS." */
   8.120 +    0x10,0x0A,0x0D,0x47,0x01,0x70,0x00,0x70,  /* 00000330    "...G.p.p" */
   8.121 +    0x00,0x00,0x02,0x22,0x00,0x01,0x79,0x00,  /* 00000338    "..."..y." */
   8.122 +    0x5B,0x82,0x22,0x53,0x50,0x4B,0x52,0x08,  /* 00000340    "[."SPKR." */
   8.123 +    0x5F,0x48,0x49,0x44,0x0C,0x41,0xD0,0x08,  /* 00000348    "_HID.A.." */
   8.124 +    0x00,0x08,0x5F,0x43,0x52,0x53,0x11,0x0D,  /* 00000350    ".._CRS.." */
   8.125 +    0x0A,0x0A,0x47,0x01,0x61,0x00,0x61,0x00,  /* 00000358    "..G.a.a." */
   8.126 +    0x00,0x01,0x79,0x00,0x5B,0x82,0x31,0x50,  /* 00000360    "..y.[.1P" */
   8.127 +    0x53,0x32,0x4D,0x08,0x5F,0x48,0x49,0x44,  /* 00000368    "S2M._HID" */
   8.128 +    0x0C,0x41,0xD0,0x0F,0x13,0x08,0x5F,0x43,  /* 00000370    ".A...._C" */
   8.129 +    0x49,0x44,0x0C,0x41,0xD0,0x0F,0x13,0x14,  /* 00000378    "ID.A...." */
   8.130 +    0x09,0x5F,0x53,0x54,0x41,0x00,0xA4,0x0A,  /* 00000380    "._STA..." */
   8.131 +    0x0F,0x08,0x5F,0x43,0x52,0x53,0x11,0x08,  /* 00000388    ".._CRS.." */
   8.132 +    0x0A,0x05,0x22,0x00,0x10,0x79,0x00,0x5B,  /* 00000390    ".."..y.[" */
   8.133 +    0x82,0x42,0x04,0x50,0x53,0x32,0x4B,0x08,  /* 00000398    ".B.PS2K." */
   8.134 +    0x5F,0x48,0x49,0x44,0x0C,0x41,0xD0,0x03,  /* 000003A0    "_HID.A.." */
   8.135 +    0x03,0x08,0x5F,0x43,0x49,0x44,0x0C,0x41,  /* 000003A8    ".._CID.A" */
   8.136 +    0xD0,0x03,0x0B,0x14,0x09,0x5F,0x53,0x54,  /* 000003B0    "....._ST" */
   8.137 +    0x41,0x00,0xA4,0x0A,0x0F,0x08,0x5F,0x43,  /* 000003B8    "A....._C" */
   8.138 +    0x52,0x53,0x11,0x18,0x0A,0x15,0x47,0x01,  /* 000003C0    "RS....G." */
   8.139 +    0x60,0x00,0x60,0x00,0x00,0x01,0x47,0x01,  /* 000003C8    "`.`...G." */
   8.140 +    0x64,0x00,0x64,0x00,0x00,0x01,0x22,0x02,  /* 000003D0    "d.d..."." */
   8.141 +    0x00,0x79,0x00,0x5B,0x82,0x3A,0x46,0x44,  /* 000003D8    ".y.[.:FD" */
   8.142 +    0x43,0x30,0x08,0x5F,0x48,0x49,0x44,0x0C,  /* 000003E0    "C0._HID." */
   8.143 +    0x41,0xD0,0x07,0x00,0x14,0x09,0x5F,0x53,  /* 000003E8    "A....._S" */
   8.144 +    0x54,0x41,0x00,0xA4,0x0A,0x0F,0x08,0x5F,  /* 000003F0    "TA....._" */
   8.145 +    0x43,0x52,0x53,0x11,0x1B,0x0A,0x18,0x47,  /* 000003F8    "CRS....G" */
   8.146 +    0x01,0xF0,0x03,0xF0,0x03,0x01,0x06,0x47,  /* 00000400    ".......G" */
   8.147 +    0x01,0xF7,0x03,0xF7,0x03,0x01,0x01,0x22,  /* 00000408    "......."" */
   8.148 +    0x40,0x00,0x2A,0x04,0x00,0x79,0x00,0x5B,  /* 00000410    "@.*..y.[" */
   8.149 +    0x82,0x36,0x55,0x41,0x52,0x31,0x08,0x5F,  /* 00000418    ".6UAR1._" */
   8.150 +    0x48,0x49,0x44,0x0C,0x41,0xD0,0x05,0x01,  /* 00000420    "HID.A..." */
   8.151 +    0x08,0x5F,0x55,0x49,0x44,0x0A,0x01,0x14,  /* 00000428    "._UID..." */
   8.152 +    0x09,0x5F,0x53,0x54,0x41,0x00,0xA4,0x0A,  /* 00000430    "._STA..." */
   8.153 +    0x0F,0x08,0x5F,0x43,0x52,0x53,0x11,0x10,  /* 00000438    ".._CRS.." */
   8.154 +    0x0A,0x0D,0x47,0x01,0xF8,0x03,0xF8,0x03,  /* 00000440    "..G....." */
   8.155 +    0x01,0x08,0x22,0x10,0x00,0x79,0x00,0x5B,  /* 00000448    ".."..y.[" */
   8.156 +    0x82,0x36,0x55,0x41,0x52,0x32,0x08,0x5F,  /* 00000450    ".6UAR2._" */
   8.157 +    0x48,0x49,0x44,0x0C,0x41,0xD0,0x05,0x01,  /* 00000458    "HID.A..." */
   8.158 +    0x08,0x5F,0x55,0x49,0x44,0x0A,0x02,0x14,  /* 00000460    "._UID..." */
   8.159 +    0x09,0x5F,0x53,0x54,0x41,0x00,0xA4,0x0A,  /* 00000468    "._STA..." */
   8.160 +    0x0F,0x08,0x5F,0x43,0x52,0x53,0x11,0x10,  /* 00000470    ".._CRS.." */
   8.161 +    0x0A,0x0D,0x47,0x01,0xF8,0x02,0xF8,0x02,  /* 00000478    "..G....." */
   8.162 +    0x01,0x08,0x22,0x08,0x00,0x79,0x00,
   8.163 +};
   8.164 +int DsdtLen=sizeof(AmlCode);
     9.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.2 +++ b/tools/firmware/acpi/acpi_facs.c	Thu Jun 30 08:09:23 2005 +0000
     9.3 @@ -0,0 +1,72 @@
     9.4 +/*
     9.5 + * Copyright (c) 2004, Intel Corporation.
     9.6 + *
     9.7 + * This program is free software; you can redistribute it and/or modify it
     9.8 + * under the terms and conditions of the GNU General Public License,
     9.9 + * version 2, as published by the Free Software Foundation.
    9.10 + *
    9.11 + * This program is distributed in the hope it will be useful, but WITHOUT
    9.12 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    9.13 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
    9.14 + * more details.
    9.15 + *
    9.16 + * You should have received a copy of the GNU General Public License along with
    9.17 + * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
    9.18 + * Place - Suite 330, Boston, MA 02111-1307 USA.
    9.19 + *
    9.20 + */
    9.21 +#include "acpi2_0.h"
    9.22 +#include "acpi_facs.h"
    9.23 +
    9.24 +//
    9.25 +// Firmware ACPI Control Structure
    9.26 +//
    9.27 +
    9.28 +ACPI_2_0_FACS Facs = {
    9.29 +		ACPI_2_0_FACS_SIGNATURE,
    9.30 +		sizeof (ACPI_2_0_FACS),
    9.31 +
    9.32 +		//
    9.33 +		// Hardware Signature
    9.34 +		//
    9.35 +		0x00000000,
    9.36 +
    9.37 +		ACPI_FIRMWARE_WAKING_VECTOR,
    9.38 +		ACPI_GLOBAL_LOCK,
    9.39 +		ACPI_FIRMWARE_CONTROL_STRUCTURE_FLAGS,
    9.40 +		ACPI_X_FIRMWARE_WAKING_VECTOR,
    9.41 +		ACPI_2_0_FACS_VERSION,
    9.42 +		{
    9.43 +				0x00,  // Reserved Fields
    9.44 +				0x00,
    9.45 +				0x00,
    9.46 +				0x00,
    9.47 +				0x00,
    9.48 +				0x00,
    9.49 +				0x00,
    9.50 +				0x00,
    9.51 +				0x00,
    9.52 +				0x00,
    9.53 +				0x00,
    9.54 +				0x00,
    9.55 +				0x00,
    9.56 +				0x00,
    9.57 +				0x00,
    9.58 +				0x00,
    9.59 +				0x00,
    9.60 +				0x00,
    9.61 +				0x00,
    9.62 +				0x00,
    9.63 +				0x00,
    9.64 +				0x00,
    9.65 +				0x00,
    9.66 +				0x00,
    9.67 +				0x00,
    9.68 +				0x00,
    9.69 +				0x00,
    9.70 +				0x00,
    9.71 +				0x00,
    9.72 +				0x00,
    9.73 +				0x00,
    9.74 +		}
    9.75 +};
    10.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.2 +++ b/tools/firmware/acpi/acpi_facs.h	Thu Jun 30 08:09:23 2005 +0000
    10.3 @@ -0,0 +1,32 @@
    10.4 +/*
    10.5 + * Copyright (c) 2004, Intel Corporation.
    10.6 + *
    10.7 + * This program is free software; you can redistribute it and/or modify it
    10.8 + * under the terms and conditions of the GNU General Public License,
    10.9 + * version 2, as published by the Free Software Foundation.
   10.10 + *
   10.11 + * This program is distributed in the hope it will be useful, but WITHOUT
   10.12 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   10.13 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
   10.14 + * more details.
   10.15 + *
   10.16 + * You should have received a copy of the GNU General Public License along with
   10.17 + * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
   10.18 + * Place - Suite 330, Boston, MA 02111-1307 USA.
   10.19 + *
   10.20 + */
   10.21 +#ifndef _FACS_H
   10.22 +#define _FACS_H
   10.23 +
   10.24 +//
   10.25 +// FACS Definitions
   10.26 +//
   10.27 +
   10.28 +#define ACPI_FIRMWARE_WAKING_VECTOR 0x00000000
   10.29 +#define ACPI_GLOBAL_LOCK 0x00000000
   10.30 +
   10.31 +#define ACPI_FIRMWARE_CONTROL_STRUCTURE_FLAGS 0x00000000
   10.32 +
   10.33 +#define ACPI_X_FIRMWARE_WAKING_VECTOR 0x0000000000000000
   10.34 +
   10.35 +#endif
    11.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    11.2 +++ b/tools/firmware/acpi/acpi_fadt.c	Thu Jun 30 08:09:23 2005 +0000
    11.3 @@ -0,0 +1,193 @@
    11.4 +/*
    11.5 + * Copyright (c) 2004, Intel Corporation.
    11.6 + *
    11.7 + * This program is free software; you can redistribute it and/or modify it
    11.8 + * under the terms and conditions of the GNU General Public License,
    11.9 + * version 2, as published by the Free Software Foundation.
   11.10 + *
   11.11 + * This program is distributed in the hope it will be useful, but WITHOUT
   11.12 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   11.13 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
   11.14 + * more details.
   11.15 + *
   11.16 + * You should have received a copy of the GNU General Public License along with
   11.17 + * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
   11.18 + * Place - Suite 330, Boston, MA 02111-1307 USA.
   11.19 + *
   11.20 + */
   11.21 +
   11.22 +#include "acpi2_0.h"
   11.23 +#include "acpi_fadt.h"
   11.24 +
   11.25 +//
   11.26 +// Fixed ACPI Description Table
   11.27 +//
   11.28 +
   11.29 +ACPI_2_0_FADT Fadt = {
   11.30 +		{
   11.31 +				ACPI_2_0_FADT_SIGNATURE,
   11.32 +				sizeof (ACPI_2_0_FADT),
   11.33 +				ACPI_2_0_FADT_REVISION,
   11.34 +				0x00,// Checksum will be updated later
   11.35 +				ACPI_OEM_ID,  // OEM ID
   11.36 +				ACPI_OEM_TABLE_ID,  // OEM Table ID
   11.37 +				ACPI_OEM_REVISION, // OEM Revision
   11.38 +				ACPI_CREATOR_ID,  // Creator ID
   11.39 +				ACPI_CREATOR_REVISION,  // Creator Revision 
   11.40 +		},
   11.41 +		//
   11.42 +		// These addresses will be updated later
   11.43 +		//
   11.44 +		0x00000000,   // Physical Address (0~4G) of the FACS
   11.45 +		0x00000000,   // Physical Address (0~4G) of the DSDT
   11.46 +
   11.47 +		0x00,  
   11.48 +		ACPI_PREFERRED_PM_PROFILE,  // Enterprise 
   11.49 +		ACPI_SCI_INT,               // IRQ 9
   11.50 +		ACPI_SMI_CMD,               
   11.51 +		ACPI_ACPI_ENABLE,
   11.52 +		ACPI_ACPI_DISABLE,
   11.53 +		ACPI_S4_BIOS_REQ,  // zero. not supported
   11.54 +		ACPI_PSTATE_CNT,   // not supported
   11.55 +
   11.56 +		ACPI_PM1A_EVT_BLK_ADDRESS,  // required
   11.57 +		ACPI_PM1B_EVT_BLK_ADDRESS,  // not supported 
   11.58 +		ACPI_PM1A_CNT_BLK_ADDRESS,  // required
   11.59 +		ACPI_PM1B_CNT_BLK_ADDRESS,  // not supported 
   11.60 +		ACPI_PM2_CNT_BLK_ADDRESS,   // not supported 
   11.61 +		ACPI_PM_TMR_BLK_ADDRESS,    // required
   11.62 +		ACPI_GPE0_BLK_ADDRESS,      // not supported
   11.63 +		ACPI_GPE1_BLK_ADDRESS,      // not supported 
   11.64 +		ACPI_PM1_EVT_LEN,           
   11.65 +		ACPI_PM1_CNT_LEN,
   11.66 +		ACPI_PM2_CNT_LEN,
   11.67 +		ACPI_PM_TMR_LEN,
   11.68 +		ACPI_GPE0_BLK_LEN,
   11.69 +		ACPI_GPE1_BLK_LEN,
   11.70 +		ACPI_GPE1_BASE,
   11.71 +
   11.72 +		ACPI_CST_CNT,
   11.73 +		ACPI_P_LVL2_LAT,             // >100, not support C2 state
   11.74 +		ACPI_P_LVL3_LAT,             // >1000, not support C3 state
   11.75 +		ACPI_FLUSH_SIZE,             // not support
   11.76 +		ACPI_FLUSH_STRIDE,           // not support
   11.77 +		ACPI_DUTY_OFFSET,            // not support 
   11.78 +		ACPI_DUTY_WIDTH,             // not support
   11.79 +		ACPI_DAY_ALRM,               // not support
   11.80 +		ACPI_MON_ALRM,               // not support
   11.81 +		ACPI_CENTURY,                // not support
   11.82 +		ACPI_IAPC_BOOT_ARCH,         
   11.83 +		0x00,          
   11.84 +		ACPI_FIXED_FEATURE_FLAGS,
   11.85 +
   11.86 +		//
   11.87 +		// Reset Register Block
   11.88 +		//
   11.89 +		{		ACPI_RESET_REG_ADDRESS_SPACE_ID,
   11.90 +				ACPI_RESET_REG_BIT_WIDTH,
   11.91 +				ACPI_RESET_REG_BIT_OFFSET,
   11.92 +				0x00,
   11.93 +				ACPI_RESET_REG_ADDRESS,
   11.94 +		},
   11.95 +
   11.96 +		ACPI_RESET_VALUE,
   11.97 +		{
   11.98 +				0x00,
   11.99 +				0x00,
  11.100 +				0x00,
  11.101 +		},
  11.102 +		//
  11.103 +		// These addresses will be updated later
  11.104 +		//
  11.105 +		0x0000000000000000,   // X_FIRMWARE_CTRL: 64bit physical address of the FACS.
  11.106 +		0x0000000000000000,   // X_DSDT: 64bit physical address of the DSDT.
  11.107 +
  11.108 +		//
  11.109 +		// PM1a Event Register Block
  11.110 +		//
  11.111 +		{
  11.112 +				ACPI_PM1A_EVT_BLK_ADDRESS_SPACE_ID,
  11.113 +				ACPI_PM1A_EVT_BLK_BIT_WIDTH,
  11.114 +				ACPI_PM1A_EVT_BLK_BIT_OFFSET,
  11.115 +				0x00,
  11.116 +				ACPI_PM1A_EVT_BLK_ADDRESS,
  11.117 +		},
  11.118 +
  11.119 +		//
  11.120 +		// PM1b Event Register Block
  11.121 +		//
  11.122 +		{
  11.123 +				ACPI_PM1B_EVT_BLK_ADDRESS_SPACE_ID,  // not support
  11.124 +				ACPI_PM1B_EVT_BLK_BIT_WIDTH,
  11.125 +				ACPI_PM1B_EVT_BLK_BIT_OFFSET,
  11.126 +				0x00,
  11.127 +				ACPI_PM1B_EVT_BLK_ADDRESS,
  11.128 +		},
  11.129 +
  11.130 +		//
  11.131 +		// PM1a Control Register Block
  11.132 +		//
  11.133 +		{
  11.134 +				ACPI_PM1A_CNT_BLK_ADDRESS_SPACE_ID,
  11.135 +				ACPI_PM1A_CNT_BLK_BIT_WIDTH,
  11.136 +				ACPI_PM1A_CNT_BLK_BIT_OFFSET,
  11.137 +				0x00,
  11.138 +				ACPI_PM1A_CNT_BLK_ADDRESS,
  11.139 +		},
  11.140 +
  11.141 +		//
  11.142 +		// PM1b Control Register Block
  11.143 +		//
  11.144 +		{
  11.145 +				ACPI_PM1B_CNT_BLK_ADDRESS_SPACE_ID,
  11.146 +				ACPI_PM1B_CNT_BLK_BIT_WIDTH,
  11.147 +				ACPI_PM1B_CNT_BLK_BIT_OFFSET,
  11.148 +				0x00,
  11.149 +				ACPI_PM1B_CNT_BLK_ADDRESS,
  11.150 +		},
  11.151 +
  11.152 +		//
  11.153 +		// PM2 Control Register Block
  11.154 +		//
  11.155 +		{
  11.156 +				ACPI_PM2_CNT_BLK_ADDRESS_SPACE_ID,
  11.157 +				ACPI_PM2_CNT_BLK_BIT_WIDTH,
  11.158 +				ACPI_PM2_CNT_BLK_BIT_OFFSET,
  11.159 +				0x00,
  11.160 +				ACPI_PM2_CNT_BLK_ADDRESS,
  11.161 +		},
  11.162 +
  11.163 +		//
  11.164 +		// PM Timer Control Register Block
  11.165 +		//
  11.166 +		{
  11.167 +				ACPI_PM_TMR_BLK_ADDRESS_SPACE_ID,
  11.168 +				ACPI_PM_TMR_BLK_BIT_WIDTH,
  11.169 +				ACPI_PM_TMR_BLK_BIT_OFFSET,
  11.170 +				0x00,
  11.171 +				ACPI_PM_TMR_BLK_ADDRESS,
  11.172 +		},
  11.173 +
  11.174 +		//
  11.175 +		// General Purpose Event 0 Register Block
  11.176 +		//
  11.177 +		{
  11.178 +				ACPI_GPE0_BLK_ADDRESS_SPACE_ID,
  11.179 +				ACPI_GPE0_BLK_BIT_WIDTH,
  11.180 +				ACPI_GPE0_BLK_BIT_OFFSET,
  11.181 +				0x00,
  11.182 +				ACPI_GPE0_BLK_ADDRESS,
  11.183 +		},
  11.184 +
  11.185 +		//
  11.186 +		// General Purpose Event 1 Register Block
  11.187 +		//
  11.188 +		{
  11.189 +				ACPI_GPE1_BLK_ADDRESS_SPACE_ID,
  11.190 +				ACPI_GPE1_BLK_BIT_WIDTH,
  11.191 +				ACPI_GPE1_BLK_BIT_OFFSET,
  11.192 +				0x00,
  11.193 +				ACPI_GPE1_BLK_ADDRESS
  11.194 +		}
  11.195 +		
  11.196 +};
    12.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    12.2 +++ b/tools/firmware/acpi/acpi_fadt.h	Thu Jun 30 08:09:23 2005 +0000
    12.3 @@ -0,0 +1,165 @@
    12.4 +/*
    12.5 + * Copyright (c) 2004, Intel Corporation.
    12.6 + *
    12.7 + * This program is free software; you can redistribute it and/or modify it
    12.8 + * under the terms and conditions of the GNU General Public License,
    12.9 + * version 2, as published by the Free Software Foundation.
   12.10 + *
   12.11 + * This program is distributed in the hope it will be useful, but WITHOUT
   12.12 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   12.13 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
   12.14 + * more details.
   12.15 + *
   12.16 + * You should have received a copy of the GNU General Public License along with
   12.17 + * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
   12.18 + * Place - Suite 330, Boston, MA 02111-1307 USA.
   12.19 + *
   12.20 + */
   12.21 +#ifndef _FADT_H_
   12.22 +#define _FADT_H_
   12.23 +
   12.24 +//
   12.25 +// FADT Definitions, see ACPI 2.0 specification for details.
   12.26 +//
   12.27 +
   12.28 +#define ACPI_OEM_FADT_REVISION  0x00000000 // TBD
   12.29 +
   12.30 +#define ACPI_PREFERRED_PM_PROFILE 0x04
   12.31 +#define ACPI_SCI_INT              0x0009
   12.32 +#define ACPI_SMI_CMD              0x000000B2
   12.33 +#define ACPI_ACPI_ENABLE    0x00
   12.34 +#define ACPI_ACPI_DISABLE   0x00
   12.35 +#define ACPI_S4_BIOS_REQ    0x00
   12.36 +#define ACPI_PSTATE_CNT     0x00
   12.37 +#define ACPI_GPE1_BASE      0x20
   12.38 +#define ACPI_CST_CNT        0x00
   12.39 +#define ACPI_P_LVL2_LAT     0x0065
   12.40 +#define ACPI_P_LVL3_LAT     0X03E9
   12.41 +#define ACPI_FLUSH_SIZE     0x00
   12.42 +#define ACPI_FLUSH_STRIDE   0x00
   12.43 +#define ACPI_DUTY_OFFSET    0x01
   12.44 +#define ACPI_DUTY_WIDTH     0x00
   12.45 +#define ACPI_DAY_ALRM       0x00
   12.46 +#define ACPI_MON_ALRM       0x00
   12.47 +#define ACPI_CENTURY        0x00
   12.48 +
   12.49 +//
   12.50 +// IA-PC Boot Architecture Flags, see ACPI 2.0 table specification and Acpi2_0.h
   12.51 +//
   12.52 +#define ACPI_IAPC_BOOT_ARCH (ACPI_LEGACY_DEVICES | ACPI_8042)
   12.53 +
   12.54 +//
   12.55 +// Fixed Feature Flags
   12.56 +// 
   12.57 +#define ACPI_FIXED_FEATURE_FLAGS (ACPI_SLP_BUTTON| ACPI_WBINVD  )
   12.58 +
   12.59 +//
   12.60 +// PM1A Event Register Block Generic Address Information
   12.61 +//
   12.62 +#define ACPI_PM1A_EVT_BLK_ADDRESS_SPACE_ID  ACPI_SYSTEM_IO
   12.63 +#define ACPI_PM1A_EVT_BLK_BIT_WIDTH         0x00
   12.64 +#define ACPI_PM1A_EVT_BLK_BIT_OFFSET        0x00
   12.65 +#define ACPI_PM1A_EVT_BLK_ADDRESS           0x0000000000000000
   12.66 +
   12.67 +//
   12.68 +// PM1B Event Register Block Generic Address Information
   12.69 +//
   12.70 +#define ACPI_PM1B_EVT_BLK_ADDRESS_SPACE_ID  ACPI_SYSTEM_IO
   12.71 +#define ACPI_PM1B_EVT_BLK_BIT_WIDTH         0x00
   12.72 +#define ACPI_PM1B_EVT_BLK_BIT_OFFSET        0x00
   12.73 +#define ACPI_PM1B_EVT_BLK_ADDRESS           0x0000000000000000
   12.74 +
   12.75 +//
   12.76 +// PM1A Control Register Block Generic Address Information
   12.77 +//
   12.78 +#define ACPI_PM1A_CNT_BLK_ADDRESS_SPACE_ID  ACPI_SYSTEM_IO
   12.79 +#define ACPI_PM1A_CNT_BLK_BIT_WIDTH         0x10
   12.80 +#define ACPI_PM1A_CNT_BLK_BIT_OFFSET        0x00
   12.81 +#define ACPI_PM1A_CNT_BLK_ADDRESS           (ACPI_PM1A_EVT_BLK_ADDRESS + 0x04)
   12.82 +
   12.83 +//
   12.84 +// PM1B Control Register Block Generic Address Information
   12.85 +//
   12.86 +#define ACPI_PM1B_CNT_BLK_ADDRESS_SPACE_ID  ACPI_SYSTEM_IO
   12.87 +#define ACPI_PM1B_CNT_BLK_BIT_WIDTH         0x00
   12.88 +#define ACPI_PM1B_CNT_BLK_BIT_OFFSET        0x00
   12.89 +#define ACPI_PM1B_CNT_BLK_ADDRESS           0x0000000000000000
   12.90 +
   12.91 +//
   12.92 +// PM2 Control Register Block Generic Address Information
   12.93 +//
   12.94 +#define ACPI_PM2_CNT_BLK_ADDRESS_SPACE_ID   ACPI_SYSTEM_IO
   12.95 +#define ACPI_PM2_CNT_BLK_BIT_WIDTH          0x00
   12.96 +#define ACPI_PM2_CNT_BLK_BIT_OFFSET         0x00
   12.97 +#define ACPI_PM2_CNT_BLK_ADDRESS            0x0000000000000000
   12.98 +
   12.99 +//
  12.100 +// Power Management Timer Control Register Block Generic Address 
  12.101 +// Information
  12.102 +//
  12.103 +#define ACPI_PM_TMR_BLK_ADDRESS_SPACE_ID    ACPI_SYSTEM_IO
  12.104 +#define ACPI_PM_TMR_BLK_BIT_WIDTH           0x20
  12.105 +#define ACPI_PM_TMR_BLK_BIT_OFFSET          0x00
  12.106 +#define ACPI_PM_TMR_BLK_ADDRESS             (ACPI_PM1A_EVT_BLK_ADDRESS + 0x08)
  12.107 +
  12.108 +//
  12.109 +// General Purpose Event 0 Register Block Generic Address
  12.110 +// Information
  12.111 +//
  12.112 +
  12.113 +#define ACPI_GPE0_BLK_ADDRESS_SPACE_ID      ACPI_SYSTEM_IO
  12.114 +#define ACPI_GPE0_BLK_BIT_WIDTH             0x00
  12.115 +#define ACPI_GPE0_BLK_BIT_OFFSET            0x00
  12.116 +#define ACPI_GPE0_BLK_ADDRESS               0x00
  12.117 +
  12.118 +//
  12.119 +// General Purpose Event 1 Register Block Generic Address
  12.120 +// Information
  12.121 +//
  12.122 +
  12.123 +#define ACPI_GPE1_BLK_ADDRESS_SPACE_ID      ACPI_SYSTEM_IO
  12.124 +#define ACPI_GPE1_BLK_BIT_WIDTH             0x00
  12.125 +#define ACPI_GPE1_BLK_BIT_OFFSET            0x00
  12.126 +#define ACPI_GPE1_BLK_ADDRESS               0x00
  12.127 +
  12.128 +
  12.129 +//
  12.130 +// Reset Register Generic Address Information
  12.131 +//
  12.132 +#define ACPI_RESET_REG_ADDRESS_SPACE_ID     ACPI_SYSTEM_IO
  12.133 +#define ACPI_RESET_REG_BIT_WIDTH            0x08
  12.134 +#define ACPI_RESET_REG_BIT_OFFSET           0x00
  12.135 +#define ACPI_RESET_REG_ADDRESS              0x0000000000000CF9
  12.136 +#define ACPI_RESET_VALUE                    0x06
  12.137 + 
  12.138 +//
  12.139 +// Number of bytes decoded by PM1 event blocks (a and b)
  12.140 +//
  12.141 +#define ACPI_PM1_EVT_LEN ((ACPI_PM1A_EVT_BLK_BIT_WIDTH + ACPI_PM1B_EVT_BLK_BIT_WIDTH) / 8)
  12.142 +
  12.143 +//
  12.144 +// Number of bytes decoded by PM1 control blocks (a and b)
  12.145 +//
  12.146 +#define ACPI_PM1_CNT_LEN ((ACPI_PM1A_CNT_BLK_BIT_WIDTH + ACPI_PM1B_CNT_BLK_BIT_WIDTH) / 8)
  12.147 +
  12.148 +//
  12.149 +// Number of bytes decoded by PM2 control block
  12.150 +//
  12.151 +#define ACPI_PM2_CNT_LEN (ACPI_PM2_CNT_BLK_BIT_WIDTH / 8)
  12.152 +
  12.153 +//
  12.154 +// Number of bytes decoded by PM timer block
  12.155 +//
  12.156 +#define ACPI_PM_TMR_LEN (ACPI_PM_TMR_BLK_BIT_WIDTH / 8)
  12.157 +
  12.158 +//
  12.159 +// Number of bytes decoded by GPE0 block
  12.160 +//
  12.161 +#define ACPI_GPE0_BLK_LEN (ACPI_GPE0_BLK_BIT_WIDTH / 8)
  12.162 +
  12.163 +//
  12.164 +// Number of bytes decoded by GPE1 block
  12.165 +//
  12.166 +#define ACPI_GPE1_BLK_LEN   0
  12.167 +
  12.168 +#endif
    13.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    13.2 +++ b/tools/firmware/acpi/acpi_gen.c	Thu Jun 30 08:09:23 2005 +0000
    13.3 @@ -0,0 +1,59 @@
    13.4 +/*
    13.5 + * Copyright (c) 2004, Intel Corporation.
    13.6 + *
    13.7 + * This program is free software; you can redistribute it and/or modify it
    13.8 + * under the terms and conditions of the GNU General Public License,
    13.9 + * version 2, as published by the Free Software Foundation.
   13.10 + *
   13.11 + * This program is distributed in the hope it will be useful, but WITHOUT
   13.12 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   13.13 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
   13.14 + * more details.
   13.15 + *
   13.16 + * You should have received a copy of the GNU General Public License along with
   13.17 + * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
   13.18 + * Place - Suite 330, Boston, MA 02111-1307 USA.
   13.19 + *
   13.20 + */
   13.21 +#include "acpi2_0.h"
   13.22 +#include "stdio.h"
   13.23 +
   13.24 +/*
   13.25 + * Generate acpi table
   13.26 + * write acpi table to binary: acpitable.bin
   13.27 + *
   13.28 + */
   13.29 + 
   13.30 +#define USAGE "Usage: acpi_gen filename \n" \
   13.31 +			  "       generage acpitable and write to the binary \n" \
   13.32 +			  "       filename - the binary name\n"
   13.33 +
   13.34 +
   13.35 +int main(int argc, char** argv){
   13.36 +		char* filename;
   13.37 +		char  buf[ACPI_TABLE_SIZE];
   13.38 +		FILE* f=NULL;
   13.39 +		int i;
   13.40 +
   13.41 +		for (i=0; i<ACPI_TABLE_SIZE; i++){
   13.42 +				buf[i]=0;
   13.43 +		}
   13.44 +
   13.45 +		if (argc<2){
   13.46 +				fprintf(stderr,"%s",USAGE);
   13.47 +				exit(1);
   13.48 +		}
   13.49 +
   13.50 +		filename = argv[1];
   13.51 +		
   13.52 +		if(!(f=fopen(filename, "w+"))){
   13.53 +				fprintf(stderr,"Can not open %s",filename);
   13.54 +				exit(1);
   13.55 +		}		
   13.56 +        AcpiBuildTable(buf);
   13.57 +		if (fwrite(buf, ACPI_TABLE_SIZE, 1, f)<1){
   13.58 +				fprintf(stderr,"Can not write to %s\n",filename);
   13.59 +				exit(1);
   13.60 +		}
   13.61 +		return 0;		
   13.62 +}
    14.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    14.2 +++ b/tools/firmware/acpi/acpi_madt.c	Thu Jun 30 08:09:23 2005 +0000
    14.3 @@ -0,0 +1,91 @@
    14.4 +/*
    14.5 + * Copyright (c) 2004, Intel Corporation.
    14.6 + *
    14.7 + * This program is free software; you can redistribute it and/or modify it
    14.8 + * under the terms and conditions of the GNU General Public License,
    14.9 + * version 2, as published by the Free Software Foundation.
   14.10 + *
   14.11 + * This program is distributed in the hope it will be useful, but WITHOUT
   14.12 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   14.13 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
   14.14 + * more details.
   14.15 + *
   14.16 + * You should have received a copy of the GNU General Public License along with
   14.17 + * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
   14.18 + * Place - Suite 330, Boston, MA 02111-1307 USA.
   14.19 + *
   14.20 + */
   14.21 +#include "acpi_madt.h"
   14.22 +
   14.23 +//
   14.24 +// Multiple APIC Description Table
   14.25 +//
   14.26 +
   14.27 +ACPI_MULTIPLE_APIC_DESCRIPTION_TABLE Madt = {
   14.28 +		{
   14.29 +				{
   14.30 +						ACPI_MULTIPLE_APIC_DESCRIPTION_TABLE_SIGNATURE,
   14.31 +						sizeof (ACPI_MULTIPLE_APIC_DESCRIPTION_TABLE),
   14.32 +						ACPI_2_0_MADT_REVISION,
   14.33 +						0x00,  // Checksum
   14.34 +						ACPI_OEM_ID, 
   14.35 +						ACPI_OEM_TABLE_ID,  
   14.36 +						ACPI_OEM_REVISION, 
   14.37 +						ACPI_CREATOR_ID,  
   14.38 +						ACPI_CREATOR_REVISION, 
   14.39 +				},
   14.40 +				ACPI_LOCAL_APIC_ADDRESS,
   14.41 +				ACPI_MULTIPLE_APIC_FLAGS,
   14.42 +		},
   14.43 +		//
   14.44 +		// LOCAL APIC Entries for 4 processors.
   14.45 +		//
   14.46 +		{
   14.47 +				{
   14.48 +						ACPI_PROCESSOR_LOCAL_APIC,                          
   14.49 +						sizeof (ACPI_LOCAL_APIC_STRUCTURE),     
   14.50 +						0x00,                                                     
   14.51 +						0x00,                                                     
   14.52 +						0x00000001,                                               
   14.53 +				},
   14.54 +
   14.55 +				{
   14.56 +						ACPI_PROCESSOR_LOCAL_APIC,                          
   14.57 +						sizeof (ACPI_LOCAL_APIC_STRUCTURE),     
   14.58 +						0x01,                                                     
   14.59 +						0x00,                                                     
   14.60 +						0x00000000
   14.61 +				},                                               
   14.62 +
   14.63 +				{
   14.64 +						ACPI_PROCESSOR_LOCAL_APIC,                          
   14.65 +						sizeof (ACPI_LOCAL_APIC_STRUCTURE),     
   14.66 +						0x02,                                                     
   14.67 +						0x00,                                                     
   14.68 +						0x00000000
   14.69 +				},                                               
   14.70 +
   14.71 +				{
   14.72 +						ACPI_PROCESSOR_LOCAL_APIC,                          
   14.73 +						sizeof (ACPI_LOCAL_APIC_STRUCTURE),     
   14.74 +						0x03,                                                     
   14.75 +						0x00,                                                     
   14.76 +						0x00000000
   14.77 +				}
   14.78 +		}
   14.79 +		,
   14.80 +
   14.81 +		//
   14.82 +		// IO APIC
   14.83 +		// 
   14.84 +		{
   14.85 +				{
   14.86 +						ACPI_IO_APIC,                         
   14.87 +						sizeof (ACPI_IO_APIC_STRUCTURE),  
   14.88 +						0x00,                                     
   14.89 +						0x00,                   
   14.90 +						ACPI_IO_APIC_ADDRESS_1,
   14.91 +						0x0000
   14.92 +				}
   14.93 +		}
   14.94 +};
    15.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    15.2 +++ b/tools/firmware/acpi/acpi_madt.h	Thu Jun 30 08:09:23 2005 +0000
    15.3 @@ -0,0 +1,44 @@
    15.4 +/*
    15.5 + * Copyright (c) 2004, Intel Corporation.
    15.6 + *
    15.7 + * This program is free software; you can redistribute it and/or modify it
    15.8 + * under the terms and conditions of the GNU General Public License,
    15.9 + * version 2, as published by the Free Software Foundation.
   15.10 + *
   15.11 + * This program is distributed in the hope it will be useful, but WITHOUT
   15.12 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   15.13 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
   15.14 + * more details.
   15.15 + *
   15.16 + * You should have received a copy of the GNU General Public License along with
   15.17 + * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
   15.18 + * Place - Suite 330, Boston, MA 02111-1307 USA.
   15.19 + *
   15.20 + */
   15.21 +#ifndef _MADT_H_
   15.22 +#define _MADT_H_
   15.23 +
   15.24 +#include "acpi2_0.h"
   15.25 +
   15.26 +//
   15.27 +// MADT Definitions, see ACPI 2.0 specification for details
   15.28 +//
   15.29 +
   15.30 +#define ACPI_LOCAL_APIC_ADDRESS 0xFEE00000
   15.31 +
   15.32 +#define ACPI_MULTIPLE_APIC_FLAGS      (ACPI_PCAT_COMPAT)
   15.33 +
   15.34 +#define ACPI_IO_APIC_ADDRESS_1   0xFEC00000
   15.35 +
   15.36 +//
   15.37 +// MADT structure
   15.38 +//
   15.39 +#pragma pack (1)
   15.40 +typedef struct {
   15.41 +  ACPI_2_0_MADT   				Header;
   15.42 +  ACPI_LOCAL_APIC_STRUCTURE     LocalApic[4];
   15.43 +  ACPI_IO_APIC_STRUCTURE        IoApic[1];
   15.44 +} ACPI_MULTIPLE_APIC_DESCRIPTION_TABLE;
   15.45 +#pragma pack ()
   15.46 +
   15.47 +#endif
    16.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    16.2 +++ b/tools/firmware/acpi/acpi_rsdt.c	Thu Jun 30 08:09:23 2005 +0000
    16.3 @@ -0,0 +1,68 @@
    16.4 +/*
    16.5 + * Copyright (c) 2004, Intel Corporation.
    16.6 + *
    16.7 + * This program is free software; you can redistribute it and/or modify it
    16.8 + * under the terms and conditions of the GNU General Public License,
    16.9 + * version 2, as published by the Free Software Foundation.
   16.10 + *
   16.11 + * This program is distributed in the hope it will be useful, but WITHOUT
   16.12 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   16.13 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
   16.14 + * more details.
   16.15 + *
   16.16 + * You should have received a copy of the GNU General Public License along with
   16.17 + * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
   16.18 + * Place - Suite 330, Boston, MA 02111-1307 USA.
   16.19 + *
   16.20 + */
   16.21 +#include "acpi2_0.h"
   16.22 +
   16.23 +ACPI_2_0_RSDT Rsdt={	
   16.24 +		{
   16.25 +				ACPI_2_0_RSDT_SIGNATURE,
   16.26 +				sizeof (ACPI_TABLE_HEADER), // udpated later
   16.27 +				ACPI_2_0_RSDT_REVISION,
   16.28 +				0x0, 				  //Checksum, updated later
   16.29 +				ACPI_OEM_ID, 
   16.30 +				ACPI_OEM_TABLE_ID,
   16.31 +				ACPI_OEM_REVISION,
   16.32 +				ACPI_CREATOR_ID,
   16.33 +				ACPI_CREATOR_REVISION,
   16.34 +		},
   16.35 +		{0x0, 0x0}
   16.36 +};
   16.37 +
   16.38 +ACPI_2_0_XSDT Xsdt={
   16.39 +		{
   16.40 +				ACPI_2_0_XSDT_SIGNATURE,
   16.41 +				sizeof (ACPI_TABLE_HEADER),  //update later
   16.42 +				ACPI_2_0_XSDT_REVISION,
   16.43 +				0x0, 				  //Checksum, update later
   16.44 +				ACPI_OEM_ID, 
   16.45 +				ACPI_OEM_TABLE_ID,
   16.46 +				ACPI_OEM_REVISION,
   16.47 +				ACPI_CREATOR_ID,
   16.48 +				ACPI_CREATOR_REVISION,
   16.49 +		},
   16.50 +		{0x0, 0x0},
   16.51 +};
   16.52 +
   16.53 +
   16.54 +ACPI_2_0_RSDP Rsdp={
   16.55 +		ACPI_2_0_RSDP_SIGNATURE,
   16.56 +		0x00, // Checksum, updated in later
   16.57 +		ACPI_OEM_ID,  // OEM ID,
   16.58 +		ACPI_OEM_REVISION, 
   16.59 +		0x0, // RSDT address, updated later
   16.60 +		sizeof (ACPI_2_0_RSDP),
   16.61 +		0x0, // XSDT address, updated later
   16.62 +		0x0, // Extended Checksum, update later
   16.63 +		{
   16.64 +				0x0, // Reserved
   16.65 +				0x0, // Reserved
   16.66 +				0x0, // Reserved
   16.67 +		}
   16.68 +};
   16.69 +
   16.70 +
   16.71 +
    17.1 --- a/tools/firmware/vmxassist/Makefile	Thu Jun 30 08:09:03 2005 +0000
    17.2 +++ b/tools/firmware/vmxassist/Makefile	Thu Jun 30 08:09:23 2005 +0000
    17.3 @@ -24,8 +24,8 @@ include $(XEN_ROOT)/tools/Rules.mk
    17.4  # The emulator code lives in ROM space
    17.5  TEXTADDR=0x000D0000
    17.6  
    17.7 -DEFINES=-DDEBUG -DTEXTADDR=${TEXTADDR}
    17.8 -XENINC=-I$(XEN_ROOT)/xen/include
    17.9 +DEFINES=-DDEBUG -DTEXTADDR=${TEXTADDR} -D_ACPI_
   17.10 +XENINC=-I$(XEN_ROOT)/xen/include -I$(XEN_ROOT)/tools/libxc
   17.11  #DEFINES=-DDEBUG -DTEST -DTEXTADDR=${TEXTADDR}
   17.12  #XENINC=-I/home/leendert/xen/xeno-unstable.bk/xen/include
   17.13  
   17.14 @@ -44,7 +44,7 @@ OBJECTS = head.o trap.o vm86.o setup.o u
   17.15  
   17.16  all: vmxloader
   17.17  
   17.18 -vmxloader: roms.h vmxloader.c
   17.19 +vmxloader: roms.h vmxloader.c acpi.h
   17.20  	${CC} ${CFLAGS} ${DEFINES} -c vmxloader.c
   17.21  	$(CC) -o vmxloader.tmp -m32 -nostdlib -Wl,-N -Wl,-Ttext -Wl,0x100000 vmxloader.o
   17.22  	objcopy --change-addresses=0xC0000000 vmxloader.tmp vmxloader
   17.23 @@ -79,6 +79,9 @@ roms.h:	../rombios/BIOS-bochs-latest ../
   17.24  	./mkhex vgabios_cirrusvga ../vgabios/VGABIOS-lgpl-latest.cirrus.bin >> roms.h
   17.25  	./mkhex vmxassist vmxassist.bin >> roms.h
   17.26  
   17.27 +acpi.h: ../acpi/acpi.bin
   17.28 +	./mkhex acpi ../acpi/acpi.bin > acpi.h
   17.29 +
   17.30  offsets.h: gen
   17.31  	./gen > offsets.h
   17.32  
   17.33 @@ -86,7 +89,7 @@ gen:	gen.c
   17.34  	${CC} ${CFLAGS} -o gen gen.c
   17.35  
   17.36  clean:
   17.37 -	rm -f vmxassist vmxassist.tmp vmxassist.bin vmxassist.run vmxassist.sym head.s roms.h
   17.38 +	rm -f vmxassist vmxassist.tmp vmxassist.bin vmxassist.run vmxassist.sym head.s roms.h acpi.h
   17.39  	rm -f vmxloader vmxloader.tmp vmxloader.o ${OBJECTS}
   17.40  	rm -f gen gen.o offsets.h
   17.41  
    18.1 --- a/tools/firmware/vmxassist/vmxloader.c	Thu Jun 30 08:09:03 2005 +0000
    18.2 +++ b/tools/firmware/vmxassist/vmxloader.c	Thu Jun 30 08:09:23 2005 +0000
    18.3 @@ -24,6 +24,12 @@
    18.4  #include "machine.h"
    18.5  #include "roms.h"
    18.6  
    18.7 +#ifdef _ACPI_
    18.8 +#include "acpi.h"
    18.9 +#include "../acpi/acpi2_0.h"  // for ACPI_PHYSICAL_ADDRESS
   18.10 +#endif
   18.11 +
   18.12 +
   18.13  /*
   18.14   * C runtime start off
   18.15   */
   18.16 @@ -102,6 +108,16 @@ main()
   18.17  		memcpy((void *)0xC0000,
   18.18  			vgabios_stdvga, sizeof(vgabios_stdvga));
   18.19  	}
   18.20 +#ifdef _ACPI_
   18.21 +	puts("Loading ACPI ...\n");
   18.22 +    if (ACPI_PHYSICAL_ADDRESS+sizeof(acpi) <= 0xF0000 ){
   18.23 +        /* make sure acpi table does not overlap rombios
   18.24 + 		 * currently acpi less than 8K will be OK.
   18.25 +		 */
   18.26 +		 memcpy((void *)ACPI_PHYSICAL_ADDRESS, acpi, sizeof(acpi));
   18.27 +	}
   18.28 +#endif
   18.29 +			
   18.30  	puts("Loading VMXAssist ...\n");
   18.31  	memcpy((void *)TEXTADDR, vmxassist, sizeof(vmxassist));
   18.32  	puts("Go ...\n");