summaryrefslogtreecommitdiff
path: root/Core/EM/ACPI/Uart1.asl
blob: 61344f79910b2d4a3ecf0d50beed8c8e0af612e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
//**********************************************************************
//**********************************************************************
//**                                                                  **
//**        (C)Copyright 1985-2009, American Megatrends, Inc.         **
//**                                                                  **
//**                       All Rights Reserved.                       **
//**                                                                  **
//**             5555 Oakbrook Pkwy, Norcross, GA 30093               **
//**                                                                  **
//**                       Phone: (770)-246-8600                      **
//**                                                                  **
//**********************************************************************
//**********************************************************************
// $Header: /Alaska/BIN/Modules/ACPI/Template/Core/Uart1.asl 7     10/01/10 3:43p Oleksiyy $
//
// $Revision: 7 $
//
// $Date: 10/01/10 3:43p $
//**********************************************************************;
// Revision History
// ----------------
// $Log: /Alaska/BIN/Modules/ACPI/Template/Core/Uart1.asl $
// 
// 7     10/01/10 3:43p Oleksiyy
// Issue Number:  39752 
//  
//  Category:  Improvement
// 
// Description: File modified to support Status Code in Runtime by hiding
// COM0 from OS.
// 
// Files:  Uart1.asl, Tokens.c, Runtime.c, GenericSio.c, EfiLib.c,
// CsmLib.c, AmiDxeLib.h and StatusCode eModule.
// 
// 6     3/26/09 4:53p Oleksiyy
// New ACPI Core implementation - improves logic, execution time and
// memory usage of ACPI module.
// 
// 5     8/03/06 12:45p Stacyh
// Updated to allow the use of SI1P for systems with 2 SIOs.  Now contains
// generic methods assuming SI1P to be 0 as well as methods which check
// SI1P (these are commented out).  
// 
// 4     4/21/06 12:38p Felixp
// 
// 2     4/03/06 4:05p Felixp
// New Super I/O infrastructure Support
// 
// 1     3/24/05 5:01p Sivagarn
// 
// 1     2/03/05 6:42p Sivagarn
// 0ABHI001 Check in
// 
// 1     7/27/04 2:48p Yakovlevs
// 
// 7     03/04/07 5:41p Chung
// Modify all I/O beta version
//
// 5	9/06/02 10:53a Alexp
// Add SourceSafe headers to all core asl files
//
//**********************************************************************;
// UART1 //
// Category # :0x00
Device(UAR1) {
	Name(_UID, 1)	//Generic ID for COMA
	
// Use the following if not using SI1P or only have 1 SIO	
	Method(_HID, 0)	{Return(^^SIO1.UHID(0))}	//PnP Device ID
	Method(_STA,0,Serialized)
    {
		If(And(\IOST,0x01)){
			Return (0x0F)   // UART1 device Present
		} else {
			Return(0x00)	// Device not present
		}
	}

	Method(_DIS, 0) {^^SIO1.DCNT(0, 0)}			//Disable UART
	Method(_CRS, 0) {Return(^^SIO1.DCRS(0, 0))}	//Get UART current resources
	Method(_SRS, 1) {^^SIO1.DSRS(Arg0, 0)} 		//Set UART recources

// Use the following if using SI1P
//	Method(_HID, 0) {	//PnP Device ID
//		if(SI1P){Return(^^SIO1.UHID(0))}
//		else{Return(^^SIO2.UHID(0))}
//	}
//	Method(_STA, 0) {	//Get UART status
//		if(SI1P){Return(^^SIO1.DSTA(0))}
//		else{Return(^^SIO2.DSTA(0))}
//	}
//	Method(_DIS, 0) {	//Disable UART
//		if(SI1P){^^SIO1.DCNT(0, 0)}
//		else{^^SIO2.DCNT(0, 0)}
//	}
//	Method(_CRS, 0) {	//Get UART current resources
//		if(SI1P){Return(^^SIO1.DCRS(0, 0))}
//		else{Return(^^SIO2.DCRS(0, 0))}
//	}
//	Method(_SRS, 1) {	//Set UART resources
//		if(SI1P){^^SIO1.DSRS(Arg0, 0)}
//		else{^^SIO2.DSRS(Arg0, 0)}
//	}

//-----------------------------------------------------------------------
// UART1 Possible Resources
//-----------------------------------------------------------------------
//NOTE: _PRS MUST be the NAME not a METHOD object 
//to have GENERICSIO.C working right! 
//-----------------------------------------------------------------------
	Name(_PRS, ResourceTemplate() {
		StartDependentFn(0, 0) {
			IO(Decode16, 0x3F8, 0x3F8, 1, 8)
			IRQNoFlags() {4}
			DMA(Compatibility, NotBusMaster, Transfer8) {}
		}
		StartDependentFnNoPri() {
			IO(Decode16, 0x3F8, 0x3F8, 1, 8)
			IRQNoFlags() {3,4,5,6,7,10,11,12}
			DMA(Compatibility, NotBusMaster, Transfer8) {}
		}
		StartDependentFnNoPri() {
			IO(Decode16, 0x2F8, 0x2F8, 1, 8)
			IRQNoFlags() {3,4,5,6,7,10,11,12}
			DMA(Compatibility, NotBusMaster, Transfer8) {}
		}
		StartDependentFnNoPri() {
			IO(Decode16, 0x3E8, 0x3E8, 1, 8)
			IRQNoFlags() {3,4,5,6,7,10,11,12}
			DMA(Compatibility, NotBusMaster, Transfer8) {}
		}
		StartDependentFnNoPri() {
			IO(Decode16, 0x2E8, 0x2E8, 1, 8)
			IRQNoFlags() {3,4,5,6,7,10,11,12}
			DMA(Compatibility, NotBusMaster, Transfer8) {}
		}
		EndDependentFn()
	})


/*
//---------Power Resources for UART1 -------------------------
	PowerResource(URP1, 0, 0) {	//SystemLevel Parameter=0,
					//which means UART can be turned off
					//in any sleep state
		Method(_STA, 0) {
			Return(URAP)	//Get Power Status
		}			//end of _STA
		Method(_ON) {
			Store(1, URAP)	//Power on
		}			//end of _ON
		Method(_OFF){
			Store(0, URAP)	//Power off
		}			//end of _OFF
	}
	Name(_PR0, Package(){URP1})	//Reference to PowerResources
*/
} // End Of UAR1
//-----------------------------------------------------------------------