;	[]==========================================================[]
;
;	    This source code is classified as confidential and 
;	    contains trade secrets owned by Award Software, Inc.
;
;	    		Copyright 1984, 1997
;			Award Software, Inc.
;			All rights reserved.
;
; 	[]==========================================================[]
;----------------------------------------------------------------------------
;Rev	Date	Name	Description
;----------------------------------------------------------------------------
;R08   10/28/98 DNL	Added APIC plamform MP support for NT 5.0
;R07   10/01/98 DNL	Filled OEM ID,OEM Revision,Creator ID parameter to 
;			identify ACPI BIOS version
;R06   04/13/98 DNL	Support S1 state wakeup by IRQ
;R05   02/25/98 DNL	Added ACPI S4/BIOS support 
;R04   02/19/98 DNL	Add simple boot spec. v0.99b support
;R03   12/01/97 DNL	Added ACPI OEM ID & OEM Table ID support 
;R02   10/20/97	DNL	Added S4/OS support
;R01   05/02/97 DNL	Fixed the ACPI table formate conflict with ACPI spec 1.0
;R00	123096	ATT	First rev for ACPI (spec 0.9)
;			This file will create RSDT, FACP, and FACS tables
;			The DSDT table is created by ASL code and combine together later.
;----------------------------------------------------------------------------
.model small
.code
	include	BIOS.CFG
ifdef	ACPI_SUPPORT
;Include fix EQUs	
	include ACPI.INC	
;Include chip set dependent EQUs
;
;ifdef	PIIX_PMU   		
;	include	PIIX4.ACP	
;endif;	PIIX_PMU
;Need to modify getpci.bat to rename chip set dependent filename to generic
;file name like "ACPI_CT.INC" 
	include	ACPI_CT.INC
;R07 - start
ACPI_OEMID		EQU	"AWARD "	;OEM ID
ACPI_VERSION		EQU	"1.00"		;OEM Revision
ACPI_ID			EQU	"AWRD"		;Creator ID
;R07 - end
;----------------------------------------------------------------------------
;RSDT table
;
RSDTtable:
	db	"RSDT"		;Signature
	dd	RSDTLength    	;Lenght
	db	1	     	;Revision
	db	0		;checksum
;R03	db	6 dup (?)	;OEM ID
	db	ACPI_OEMID	;R03 OEMID
;R03	db	8 dup (?)	;OEM Table ID
	db	"AWRDACPI"	;R03 OEM Table ID
;R07	db	4 dup (?)	;OEMRevision
	db	ACPI_VERSION	;R07 OEMRevision
;R01 ;	db	4 dup (?)	;Creator ID
;R01 ;	db	4 dup (?)	;Creatore Revision
;R07	db	4 dup (?)	;Creator ID		;R01
	db	ACPI_ID		;R07 Creator ID
	db	4 dup (?)	;Creatore Revision	;R01
	db	4 dup (?)	;Pointer of FACP table
ifdef	SIMPLE_BOOT_SUPPORT	;R04
	db	4 dup (?)	;R04 Pointer of BOOT table
endif	;SIMPLE_BOOT_SUPPORT	;R04
ifdef	MP_SUPPORT		;R08
	db	4 dup (?)	;R08
endif	;MP_SUPPORT		;R08
	RSDTLength EQU ($-RSDTtable)

;----------------------------------------------------------------------------
;FACP Table
;
FACPtable:
	db	"FACP" 		;Signature
	dd	FACPLength	;Length
	db	1		;Revision
	db	0		;checksum
;R03	db	6 dup (?)	;OEM ID
	db	ACPI_OEMID	;R03 OEMID
;R03	db	8 dup (?)	;OEM Table ID
	db	"AWRDACPI"	;R03 OEM Table ID
;R07	db	4 dup (?)	;OEM Revision
	db	ACPI_VERSION	;R07 OEMRevision
;R07	db	4 dup (?)	;Creator ID		;R01
	db	ACPI_ID		;R07 Creator ID
	db	4 dup (?)	;Creatore Revision	;R01
	db	4 dup (?)	;Pointer of FACS table
	db	4 dup (?)	;Pointer of DSDT table
	db	INT_MODEL	;
	db	0		;Reserved
	dw	SCI_INT		;
	dd	SMI_CMD		;
	db	ACPI_ENABLE
	db	ACPI_DISABLE
;R01	dw	0		;Reserved 
;R05	db	0		;R01 S4BIOS_REQ value	
	db	S4BIOS_REQ	;R05 S4BIOS_REQ value	
	db	0		;R01 Reserved 		
	dd	PM1a_EVT_BLK
	dd	PM1b_EVT_BLK
ifdef	Virtual_ACPI_IO			;R06
	dd	Virtual_ACPI_IO		;R06
else	;Virtual_ACPI_IO		;R06
	dd	PM1a_CNT_BLK
endif	;Virtual_ACPI_IO		;R06
	dd	PM1b_CNT_BLK
	dd	PM2_CNT_BLK
	dd	PM_TMR_BLK
	dd	GPE0_BLK
	dd	GPE1_BLK
	db	PM1_EVT_LEN
	db	PM1_CNT_LEN
	db	PM2_CNT_LEN
	db	PM_TM_LEN
	db	GPE0_BLK_LEN
	db	GPE1_BLK_LEN
	db	GPE1_BASE
	db	0		;Reserved
	dw	P_LVL2_LAT
	dw	P_LVL3_LAT
	dw	FLUSH_SIZE
	dw	FLUSH_STRIDE
	db	DUTY_OFFSET
	db	DUTY_WIDTH
	db	DAY_ALRM
	db	MON_ALRM
	db	CENTURY_ALRM
;R01	db	1 dup (0)	;Reserved
	db	3 dup (0)	;R01 Reserved
	dd	FACPFlag	;Flags 
	FACPLength EQU ($-FACPtable)		

;----------------------------------------------------------------------------
;FACS Table
;
FACStable:
	db	"FACS" 		;Signature
	dd	FACSLength	;Length
	dd	0		;Hardware Signature
	dd	0		;Firmware Waking Vector
	dd	0		;Global Lock
;R02	dd	0		;Flags
	dd	FACSFlag	;R02
	db	40 dup (0)	;Reserved	
	FACSLength EQU ($-FACStable)		
;DSDT table will merge here.

;R04 - start
ifdef	SIMPLE_BOOT_SUPPORT
;BOOT Table
;
BOOTtable:
	db	"BOOT" 			;Signature
	dd	BOOTLength		;Length
	db	1			;Revision
	db	0			;checksum
	db	ACPI_OEMID		;OEMID
	db	8 dup (?)		;OEM Table ID
	db	4 dup (?)		;OEM Revision
	db	4 dup (?)		;Creator ID
	db	4 dup (?)		;Creatore Revision
	db	SIMPLE_BOOT_CMOS	;CMOS index
	db	3 dup (0)		;Reserved	
BOOTLength	EQU	( $ - offset BOOTtable )
endif	;SIMPLE_BOOT_SUPPORT
;R04 - end
;R08 - start
ifdef	MP_SUPPORT
PCAT_COMPAT	EQU	1
APIC_Flag	EQU	PCAT_COMPAT
CPU_ENABLE	EQU	1
CPU_APIC_Flag	EQU	CPU_ENABLE	
APICTable:
	db	"APIC" 			;Signature
	dd	APICLength		;Length
	db	1			;Revision
	db	0			;checksum
	db	ACPI_OEMID		;OEMID
	db	8 dup (?)		;OEM Table ID
	db	4 dup (?)		;OEM Revision
	db	4 dup (?)		;Creator ID
	db	4 dup (?)		;Creatore Revision
	dd	0FEE00000h		;Local APIC address
	dd	APIC_Flag
CPU_APIC_Table:
	db	0			;APIC structure Types	0 - Processor Local APIC structure
	db	8			;Length		
	db	0			;CPU ID
	db	0			;Loacl APIC ID
	dd	CPU_APIC_Flag
CPU1_APIC_Table:
	db	0			;APIC structure Types	0 - Processor Local APIC structure
	db	8			;Length		
	db	1			;CPU ID
	db	1			;Loacl APIC ID
	dd	CPU_APIC_Flag
IO_APIC_Table:
	db	1			;APIC structure Types	1 - IO APIC structure
	db	12			;Length		
	db	2			;IO APIC's ID
	db	0			;Reserved	
	dd	0FEC00000h		;IO APIC address
	dd	0h			;System Vector Base

;  INIT Flags 
;
;  Bit 15-4 : Reserved
;  Bit  3-2 : Trigger mode of the APIC I/O Input signals
;	      00 = Conforms to specifications of the bus
;		   (for example, ISA is edge-triggered)	
;	      01 = Edge-triggered	
;	      10 = Reserved
;	      11 = Level Triggered	
;  Bit  1-0 : Polarity of the APIC I/O Input signals
;	      00 = Conforms to specifications of the bus
;		   (for example, EISA is active-low for 
;		    level-triggered interrupts)	
;	      01 = Active high
;	      10 = Reserved
;	      11 = Active low

INTI_Flag	EQU	00000100b	
					
INT_Source_Table:
	db	2			;APIC structure Types	2 - Interrupt Source Override
	db	10			;Length		
	db	0			;Bus 0 - Constant, meaning ISA		
	db	0			;Source IRQ
	dd	2			;Global System Interrupt Vector
	dw	INTI_Flag		
INT1_Source_Table:
	db	2			;APIC structure Types	2 - Interrupt Source Override
	db	10			;Length		
	db	0			;Bus 0 - Constant, meaning ISA		
	db	9			;Source IRQ
	dd	9			;Global System Interrupt Vector
	dw	INTI_Flag		
APICLength	EQU	( $ - offset APICtable )
endif	;MP_SUPPORT
;R08 - end
endif	;ACPI_SUPPORT
end  
	
