summaryrefslogtreecommitdiff
path: root/src/superio/smsc/sio1007/acpi/superio.asl
blob: b42e71eae9fd67c4ab4416ef3119a61e3633d767 (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
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
/* SPDX-License-Identifier: GPL-2.0-only */

// Scope is \_SB.PCI0.LPCB

Device (SIO) {
	Name (_ADR, 0x2E)
	OperationRegion (SIOA, SystemIO, 0x2E, 0x02)
	Field (SIOA, ByteAcc, NoLock, Preserve)
	{
		SI2E, 8,
		SI2F, 8,
	}

	IndexField (SI2E, SI2F, ByteAcc, NoLock, Preserve)
	{
		Offset (0x02),
		SCNT, 8,	/* Configure Control */
		Offset (0x07),
		SLDN, 8,	/* Logical Device Number */
		Offset (0x30),
		SACT, 8,	/* Activate */
		Offset (0x60),
		IO0H, 8,	/* Base Address 0 MSB */
		IO0L, 8,	/* Base Address 0 LSB */
		Offset (0x62),
		IO1H, 8,	/* Base Address 1 MSB */
		IO1L, 8,	/* Base Address 1 LSB */
		Offset (0x70),
		IQ00, 8,	/* Interrupt Select */
	}

	Name (SFDC, 0)		/* Floppy Disk Controller */
	Name (SSP1, 1)		/* Serial Port 1 */
	Name (SENV, 4)		/* Environment Controller */
	Name (SKBC, 5)		/* Keyboard */
	Name (SKBM, 6)		/* Mouse */
	Name (SGPI, 7)		/* GPIO */
	Name (SINF, 10)		/* Consumer IR */

	Method (ENTR, 0, NotSerialized)
	{
		Store (0x87, SI2E)
		Store (0x01, SI2E)
		Store (0x55, SI2E)
		Store (0x55, SI2E)
	}

	Method (EXIT, 0, NotSerialized)
	{
		Store (0x02, SCNT)
	}

	/* Parse activate register for an LDN */
	Method (ISEN, 1, NotSerialized)
	{
		ENTR ()
		Store (Arg0, SLDN)
		Store (SACT, Local0)
		EXIT ()

		/* Check if it exists */
		If (LEqual (Local0, 0xFF))
		{
			Return (0x00)
		}

		/* Check if activated */
		If (LEqual (Local0, One))
		{
			Return (0x0F)
		}
		Else
		{
			Return (0x0D)
		}
	}

	/* Enable an LDN via the activate register */
	Method (SENA, 1, NotSerialized)
	{
		ENTR ()
		Store (Arg0, SLDN)
		Store (One, SACT)
		EXIT ()
	}

	/* Disable an LDN via the activate register */
	Method (SDIS, 1, NotSerialized)
	{
		ENTR ()
		Store (Arg0, SLDN)
		Store (Zero, SACT)
		EXIT ()
	}

#ifdef SIO_ENABLE_ENVC
	Device (ENVC) {
		Name (_HID, EISAID ("PNP0C02"))
		Name (_UID, 10)

		Method (_STA, 0, NotSerialized) {
			Return (ISEN (SENV))
		}

		Name (_CRS, ResourceTemplate ()
		{
			IO (Decode16, SIO_ENVC_IO0, SIO_ENVC_IO0, 0x08, 0x08)
			IO (Decode16, SIO_ENVC_IO1, SIO_ENVC_IO1, 0x04, 0x04)
		})

		Name (_PRS, ResourceTemplate ()
		{
			IO (Decode16, SIO_ENVC_IO0, SIO_ENVC_IO0, 0x08, 0x08)
			IO (Decode16, SIO_ENVC_IO1, SIO_ENVC_IO1, 0x04, 0x04)
		})

		OperationRegion (ECAP, SystemIO, SIO_ENVC_IO0, 0x07)
		Field (ECAP, ByteAcc, NoLock, Preserve)
		{
			Offset (0x05),
			ECAI, 8,  // Address Index Register
			ECAD, 8,  // Address Data Register
		}

		// Registers for thermal zone implementations
		IndexField (ECAI, ECAD, ByteAcc, NoLock, Preserve)
		{
			Offset (0x29),
			TIN1, 8,  // TMPIN1 Reading
			TIN2, 8,  // TMPIN2 Reading
			TIN3, 8,  // TMPIN3 Reading
			Offset (0x6b),
			F2PS, 8,  // FAN2 PWM Setting
			Offset (0x73),
			F3PS, 8,  // FAN3 PWM Setting
		}
	}
#endif

#ifdef SIO_ENABLE_GPIO
	Device (GPIO) {
		Name (_HID, EISAID ("PNP0C02"))
		Name (_UID, 11)

		Method (_STA, 0, NotSerialized) {
			Return (0x0F)
		}

		Name (_CRS, ResourceTemplate ()
		{
			IO (Decode16, SIO_GPIO_IO0, SIO_GPIO_IO0, 0x01, 0x01)
			IO (Decode16, SIO_GPIO_IO1, SIO_GPIO_IO1, 0x08, 0x08)
		})

		Name (_PRS, ResourceTemplate ()
		{
			IO (Decode16, SIO_GPIO_IO0, SIO_GPIO_IO0, 0x01, 0x01)
			IO (Decode16, SIO_GPIO_IO1, SIO_GPIO_IO1, 0x08, 0x08)
		})
	}
#endif

#ifdef SIO_ENABLE_COM1
	Device (COM1) {
		Name (_HID, EISAID ("PNP0501"))
		Name (_UID, 1)

		Method (_STA, 0, NotSerialized) {
			Return (ISEN (SSP1))
		}

		Name (_CRS, ResourceTemplate ()
		{
			IO (Decode16, 0x03F8, 0x03F8, 0x08, 0x08)
			IRQNoFlags () {4}
		})

		Name (_PRS, ResourceTemplate ()
		{
			IO (Decode16, 0x03F8, 0x03F8, 0x08, 0x08)
			IRQNoFlags () {4}
		})
	}
#endif

#ifdef SIO_ENABLE_PS2K
	Device (PS2K)		// Keyboard
	{
		Name (_HID, EISAID("PNP0303"))
		Name (_CID, EISAID("PNP030B"))

		Method (_STA, 0, NotSerialized) {
			Return (ISEN (SKBC))
		}

		Name (_CRS, ResourceTemplate()
		{
			IO (Decode16, 0x60, 0x60, 0x01, 0x01)
			IO (Decode16, 0x64, 0x64, 0x01, 0x01)
			IRQNoFlags () {1}
		})

		Name (_PRS, ResourceTemplate()
		{
			IO (Decode16, 0x60, 0x60, 0x01, 0x01)
			IO (Decode16, 0x64, 0x64, 0x01, 0x01)
			IRQNoFlags () {1}
		})
	}
#endif

#ifdef SIO_ENABLE_PS2M
	Device (PS2M)		// Mouse
	{
		Name (_HID, EISAID("PNP0F13"))

		Method (_STA, 0, NotSerialized) {
			Return (ISEN (SKBM))
		}

		Name (_CRS, ResourceTemplate()
		{
			IRQNoFlags () {12}
		})

		Name (_PRS, ResourceTemplate()
		{
			IRQNoFlags () {12}
		})
	}
#endif

#ifdef SIO_ENABLE_FDC0
	Device (FDC0)		// Floppy controller
	{
		Name (_HID, EISAID ("PNP0700"))

		Method (_STA, 0, NotSerialized) {
			Return (ISEN (SFDC))
		}

		Name (_CRS, ResourceTemplate()
		{
			IO (Decode16, 0x03F0, 0x03F0, 0x01, 0x06)
			IO (Decode16, 0x03F7, 0x03F7, 0x01, 0x01)
			IRQNoFlags () {6}
			DMA (Compatibility, NotBusMaster, Transfer8) {2}
		})

		Name (_PRS, ResourceTemplate()
		{
			IO (Decode16, 0x03F0, 0x03F0, 0x01, 0x06)
			IO (Decode16, 0x03F7, 0x03F7, 0x01, 0x01)
			IRQNoFlags () {6}
			DMA (Compatibility, NotBusMaster, Transfer8) {2}
		})
	}
#endif

#ifdef SIO_ENABLE_INFR
	Device (INFR)		// Infrared controller
	{
		Name (_HID, EISAID ("PNP0510"))

		Method (_STA, 0, NotSerialized) {
			Return (ISEN (SINF))
		}

		Name (_CRS, ResourceTemplate()
		{
			IO (Decode16, SIO_INFR_IO0, SIO_INFR_IO0, 0x08, 0x08)
			IRQNoFlags () { SIO_INFR_IRQ }
		})

		Name (_PRS, ResourceTemplate()
		{
			IO (Decode16, SIO_INFR_IO0, SIO_INFR_IO0, 0x08, 0x08)
			IRQNoFlags () { SIO_INFR_IRQ }
		})
	}
#endif
}