blob: 04b112f7f723066a3d9785b9bc7d3b2500241135 [file] [log] [blame]
Stefan Reinauerd6682e82013-02-21 15:39:35 -08001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2012 The ChromiumOS Authors. All rights reserved.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
Stefan Reinauerd6682e82013-02-21 15:39:35 -080014 */
15
16/*
17 * Chrome OS Embedded Controller interface
18 *
19 * Constants that should be defined:
20 *
21 * SIO_EC_MEMMAP_ENABLE : Enable EC LPC memory map resources
22 * EC_LPC_ADDR_MEMMAP : Base address of memory map range
23 * EC_MEMMAP_SIZE : Size of memory map range
24 *
25 * SIO_EC_HOST_ENABLE : Enable EC host command interface resources
26 * EC_LPC_ADDR_HOST_DATA : EC host command interface data port
27 * EC_LPC_ADDR_HOST_CMD : EC host command interface command port
Bill Richardsone221aad2013-06-12 10:50:41 -070028 * EC_HOST_CMD_REGION0 : EC host command buffer
29 * EC_HOST_CMD_REGION1 : EC host command buffer
30 * EC_HOST_CMD_REGION_SIZE : EC host command buffer size
Stefan Reinauerd6682e82013-02-21 15:39:35 -080031 */
32
33// Scope is \_SB.PCI0.LPCB
34
35Device (SIO) {
36 Name (_UID, 0)
37 Name (_ADR, 0)
38
39#ifdef SIO_EC_MEMMAP_ENABLE
40 Device (ECMM) {
41 Name (_HID, EISAID ("PNP0C02"))
42 Name (_UID, 1)
43 Name (_ADR, 0)
44
45 Method (_STA, 0, NotSerialized) {
46 Return (0x0F)
47 }
48
49 Name (_CRS, ResourceTemplate ()
50 {
Duncan Laurie58867b12013-10-24 12:37:48 -070051 IO (Decode16, EC_LPC_ADDR_MEMMAP, EC_LPC_ADDR_MEMMAP,
52 0x08, EC_MEMMAP_SIZE)
Stefan Reinauerd6682e82013-02-21 15:39:35 -080053 })
54
55 Name (_PRS, ResourceTemplate ()
56 {
Duncan Laurie58867b12013-10-24 12:37:48 -070057 IO (Decode16, EC_LPC_ADDR_MEMMAP, EC_LPC_ADDR_MEMMAP,
58 0x08, EC_MEMMAP_SIZE)
Stefan Reinauerd6682e82013-02-21 15:39:35 -080059 })
60 }
61#endif
62
63#ifdef SIO_EC_HOST_ENABLE
64 Device (ECUI) {
65 Name (_HID, EISAID ("PNP0C02"))
66 Name (_UID, 3)
67 Name (_ADR, 0)
68
69 Method (_STA, 0, NotSerialized) {
70 Return (0x0F)
71 }
72
73 Name (_CRS, ResourceTemplate ()
74 {
Duncan Laurie58867b12013-10-24 12:37:48 -070075 IO (Decode16,
76 EC_LPC_ADDR_HOST_DATA, EC_LPC_ADDR_HOST_DATA,
77 0x01, 0x01)
78 IO (Decode16,
79 EC_LPC_ADDR_HOST_CMD, EC_LPC_ADDR_HOST_CMD,
80 0x01, 0x01)
81 IO (Decode16,
82 EC_HOST_CMD_REGION0, EC_HOST_CMD_REGION0, 0x08,
83 EC_HOST_CMD_REGION_SIZE)
84 IO (Decode16,
85 EC_HOST_CMD_REGION1, EC_HOST_CMD_REGION0, 0x08,
86 EC_HOST_CMD_REGION_SIZE)
Stefan Reinauerd6682e82013-02-21 15:39:35 -080087 })
88
89 Name (_PRS, ResourceTemplate ()
90 {
91 StartDependentFn (0, 0) {
Duncan Laurie58867b12013-10-24 12:37:48 -070092 IO (Decode16, EC_LPC_ADDR_HOST_DATA,
93 EC_LPC_ADDR_HOST_DATA, 0x01, 0x01)
94 IO (Decode16, EC_LPC_ADDR_HOST_CMD,
95 EC_LPC_ADDR_HOST_CMD, 0x01, 0x01)
96 IO (Decode16,
97 EC_HOST_CMD_REGION0, EC_HOST_CMD_REGION0,
98 0x08, EC_HOST_CMD_REGION_SIZE)
99 IO (Decode16,
100 EC_HOST_CMD_REGION1, EC_HOST_CMD_REGION1,
101 0x08, EC_HOST_CMD_REGION_SIZE)
Stefan Reinauerd6682e82013-02-21 15:39:35 -0800102 }
103 EndDependentFn ()
104 })
105 }
106#endif
107
108#ifdef SIO_EC_ENABLE_COM1
109 Device (COM1) {
110 Name (_HID, EISAID ("PNP0501"))
111 Name (_UID, 1)
112 Name (_ADR, 0)
113
114 Method (_STA, 0, NotSerialized) {
115 Return (0x0F)
116 }
117
118 Name (_CRS, ResourceTemplate ()
119 {
Duncan Laurie58867b12013-10-24 12:37:48 -0700120 IO (Decode16, 0x03F8, 0x3F8, 0x08, 0x08)
Stefan Reinauerd6682e82013-02-21 15:39:35 -0800121 IRQNoFlags () {4}
122 })
123
124 Name (_PRS, ResourceTemplate ()
125 {
126 StartDependentFn (0, 0) {
Duncan Laurie58867b12013-10-24 12:37:48 -0700127 IO (Decode16, 0x03F8, 0x3F8, 0x08, 0x08)
Stefan Reinauerd6682e82013-02-21 15:39:35 -0800128 IRQNoFlags () {4}
129 }
130 EndDependentFn ()
131 })
132 }
133#endif
134
135#ifdef SIO_EC_ENABLE_PS2K
136 Device (PS2K) // Keyboard
137 {
138 Name (_UID, 0)
139 Name (_ADR, 0)
140 Name (_HID, EISAID("PNP0303"))
141 Name (_CID, EISAID("PNP030B"))
142
143 Method (_STA, 0, NotSerialized) {
144 Return (0x0F)
145 }
146
147 Name (_CRS, ResourceTemplate()
148 {
Duncan Laurie58867b12013-10-24 12:37:48 -0700149 IO (Decode16, 0x60, 0x60, 0x01, 0x01)
150 IO (Decode16, 0x64, 0x64, 0x01, 0x01)
Aaron Durbin2f6402c2013-11-20 15:18:24 -0600151#ifdef SIO_EC_PS2K_IRQ
152 SIO_EC_PS2K_IRQ
153#else
Duncan Laurief611fcf2015-09-21 15:00:20 -0700154 IRQ (Edge, ActiveHigh, ExclusiveAndWake) {1}
Aaron Durbin2f6402c2013-11-20 15:18:24 -0600155#endif
Stefan Reinauerd6682e82013-02-21 15:39:35 -0800156 })
157
158 Name (_PRS, ResourceTemplate()
159 {
160 StartDependentFn (0, 0) {
Duncan Laurie58867b12013-10-24 12:37:48 -0700161 IO (Decode16, 0x60, 0x60, 0x01, 0x01)
162 IO (Decode16, 0x64, 0x64, 0x01, 0x01)
Aaron Durbin2f6402c2013-11-20 15:18:24 -0600163#ifdef SIO_EC_PS2K_IRQ
164 SIO_EC_PS2K_IRQ
165#else
Duncan Laurief611fcf2015-09-21 15:00:20 -0700166 IRQ (Edge, ActiveHigh, ExclusiveAndWake) {1}
Aaron Durbin2f6402c2013-11-20 15:18:24 -0600167#endif
Stefan Reinauerd6682e82013-02-21 15:39:35 -0800168 }
169 EndDependentFn ()
170 })
171 }
172#endif
173}