summaryrefslogtreecommitdiff
path: root/Core/EM/ACPI/Lpte.asl
blob: 164c9a1a815e4474750c9ff5045ca0d2559475d6 (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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
//**********************************************************************
//**********************************************************************
//**                                                                  **
//**        (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/Lpte.asl 3     3/26/09 4:53p Oleksiyy $
//
// $Revision: 3 $
//
// $Date: 3/26/09 4:53p $
//**********************************************************************;
// Revision History
// ----------------
// $Log: /Alaska/BIN/Modules/ACPI/Template/Core/Lpte.asl $
// 
// 3     3/26/09 4:53p Oleksiyy
// New ACPI Core implementation - improves logic, execution time and
// memory usage of ACPI module.
// 
// 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
//
// 4	 9/06/02 10:53a Alexp
// Add SourceSafe headers to all core asl files
//
//**********************************************************************;
// Parallel port - LPT or ECP(Extended mode)/////////////////////////////
//**********************************************************************;
// Category # :0x02
Device(LPTE) {
	Method(_HID, 0){		//PnP Device ID
		If(^^SIO1.LPTM(2))		//Get LPT mode : 0-plain LPT, non Zero-ECP mode
			{Return(EISAID("PNP0401"))}	//PnP ID for ECP Port
		Else
			{Return(EISAID("PNP0400"))}	//PnP ID for LPT Port
	}

	Method(_STA, 0) {Return(^^SIO1.DSTA(2))}	//Get Device status

	Method(_DIS, 0) {^^SIO1.DCNT(2,0)}		//Disable LPT, arg0 - LDN, arg1 - 1(disable)

	Method(_CRS, 0) {			//Get LPT current resources
		^^SIO1.DCRS(2, 1)		//Fill in Return buffer with DMA, Irq and 1st IO
		If(^^SIO1.LPTM(2)){		//Extended LPT mode ?
			//Move resources from CRS1 ro CRS2 buffer
			Store(^^SIO1.IRQM, ^^SIO1.IRQE)	//IRQ mask 0x1
			Store(^^SIO1.DMAM, ^^SIO1.DMAE)	//DMA 0x04

			Store(^^SIO1.IO11, ^^SIO1.IO21)	//1st IO Range Min Base Word 0x8
			Store(^^SIO1.IO12, ^^SIO1.IO22)	//	       Max Base Word 0xa
			Store(^^SIO1.LEN1, ^^SIO1.LEN2)

			Add(^^SIO1.IO21, 0x400, ^^SIO1.IO31)	//2nd IO range
			Store(^^SIO1.IO31, ^^SIO1.IO32)
			Store(^^SIO1.LEN2, ^^SIO1.LEN3)
			Return(^^SIO1.CRS2)
		}else{
			Return(^^SIO1.CRS1)
		}
	}

	Method(_SRS, 1) {		//Set LPT resources
		^^SIO1.DSRS(Arg0, 2)
	}

	Method(_PRS, 0) {		//Return Possible resources
		If(^^SIO1.LPTM(2))		//Get LPT mode : 0-plain LPT, non Zero-ECP mode
			{Return(EPPR)}	//ECP mode resources
		Else
			{Return(LPPR)}	//LPT mode resources
	}


//-----------------------------------------------------------------------
// LPT Possible Resources
//-----------------------------------------------------------------------
//------------------------------------------------------------------------
//NOTE: _PRS MUST be the NAME not a METHOD object 
//to have GENERICSIO.C working right! 
//-----------------------------------------------------------------------
	Name(LPPR, ResourceTemplate(){
// IRQ
		StartDependentFn(0,0) {
			IO(Decode16, 0x378, 0x378, 1, 8)
			IRQNoFlags() {5}
		}
		StartDependentFnNoPri() {
			IO(Decode16, 0x378, 0x378, 1, 8)
			IRQNoFlags() {5,6,7,10,11,12}
		}
		StartDependentFnNoPri() {
			IO(Decode16, 0x278, 0x278, 1, 8)
			IRQNoFlags() {5,6,7,10,11,12}
		}
		StartDependentFnNoPri() {
			IO(Decode16, 0x3BC, 0x3BC, 1, 4)
			IRQNoFlags() {5,6,7,10,11,12}
		}
// No IRQ
		StartDependentFnNoPri() {
			IO(Decode16, 0x378, 0x378, 1, 8)
			IRQNoFlags() {}
		}
		StartDependentFnNoPri() {
			IO(Decode16, 0x278, 0x278, 1, 8)
			IRQNoFlags() {}
		}
		StartDependentFnNoPri() {
			IO(Decode16, 0x3BC, 0x3BC, 1, 4)
			IRQNoFlags() {}
		}
		EndDependentFn()
	})

//-----------------------------------------------------------------------
// ECP Possible Resources
//-----------------------------------------------------------------------
	Name(EPPR, ResourceTemplate() {
		StartDependentFn(0, 0) {
			IO(Decode16, 0x378, 0x378, 1, 8)
			IO(Decode16, 0x778, 0x778, 1, 8)
			IRQNoFlags() {5}
			DMA(Compatibility, NotBusMaster, Transfer8) {3}
		}
		StartDependentFnNoPri() {
			IO(Decode16, 0x378, 0x378, 1, 8)
			IO(Decode16, 0x778, 0x778, 1, 8)
			IRQNoFlags() {5,6,7,10,11,12}
			DMA(Compatibility, NotBusMaster, Transfer8) {1,3}
		}
		StartDependentFnNoPri() {
			IO(Decode16, 0x278, 0x278, 1, 8)
			IO(Decode16, 0x678, 0x678, 1, 8)
			IRQNoFlags() {5,6,7,10,11,12}
			DMA(Compatibility, NotBusMaster, Transfer8) {1,3}
		}
		StartDependentFnNoPri() {
			IO(Decode16, 0x3BC, 0x3BC, 1, 4)
			IO(Decode16, 0x7BC, 0x7BC, 1, 4)
			IRQNoFlags() {5,6,7,10,11,12}
			DMA(Compatibility, NotBusMaster, Transfer8) {1,3}
		}
// No IRQ
		StartDependentFnNoPri() {
			IO(Decode16, 0x378, 0x378, 1, 8)
			IO(Decode16, 0x778, 0x778, 1, 8)
			IRQNoFlags() {}
			DMA(Compatibility, NotBusMaster, Transfer8) {1,3}
		}
		StartDependentFnNoPri() {
			IO(Decode16, 0x278, 0x278, 1, 8)
			IO(Decode16, 0x678, 0x678, 1, 8)
			IRQNoFlags() {}
			DMA(Compatibility, NotBusMaster, Transfer8) {1,3}
		}
		StartDependentFnNoPri() {
			IO(Decode16, 0x3BC, 0x3BC, 1, 4)
			IO(Decode16, 0x7BC, 0x7BC, 1, 4)
			IRQNoFlags() {}
			DMA(Compatibility, NotBusMaster, Transfer8) {1,3}
		}
		EndDependentFn()
	})

/*
//---------Power Resources for LPT -------------------------
	PowerResource(LPTP, 0, 0) {   // SystemLevel Parameter=0,
		Method(_STA, 0) {
			Return(LPTP)	// Get Power Status
		}				// end of _STA
		Method(_ON) {
			Store(1,LPTP)
		}				// end of _ON
		Method(_OFF){
			Store(0,LPTP)
		}				// end of _OFF
	}
	Name(_PR0, Package(){LPTP})	    // Reference to PowerResources
*/
//**********************************************************************;
} // End Of LPTE ////////////////////////////////////////////////////////