<div dir="ltr">What EC is this for? The device and interface is defined by the spec, but the offsets and methods are custom for every EC.<div><br></div><div><br></div><div style>Marc</div></div><div class="gmail_extra"><br>

<br><div class="gmail_quote">On Wed, Apr 17, 2013 at 1:22 AM, liguang <span dir="ltr"><<a href="mailto:lig.fnst@cn.fujitsu.com" target="_blank">lig.fnst@cn.fujitsu.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

defined at ACPI SPEC v5 chapter 12:<br>
"ACPI Embedded Controller Interface Specification"<br>
<br>
Signed-off-by: liguang <<a href="mailto:lig.fnst@cn.fujitsu.com">lig.fnst@cn.fujitsu.com</a>><br>
---<br>
 src/acpi-dsdt-ec.dsl |  106 ++++++++++++++++++++++++++++++++++++++++++++++++++<br>
 1 files changed, 106 insertions(+), 0 deletions(-)<br>
 create mode 100644 src/acpi-dsdt-ec.dsl<br>
<br>
diff --git a/src/acpi-dsdt-ec.dsl b/src/acpi-dsdt-ec.dsl<br>
new file mode 100644<br>
index 0000000..6bd8edd<br>
--- /dev/null<br>
+++ b/src/acpi-dsdt-ec.dsl<br>
@@ -0,0 +1,106 @@<br>
+/*<br>
+ * This program is free software; you can redistribute it and/or modify<br>
+ * it under the terms of the GNU General Public License as published by<br>
+ * the Free Software Foundation; version 2 of the License.<br>
+ *<br>
+ * This program is distributed in the hope that it will be useful,<br>
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of<br>
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the<br>
+ * GNU General Public License for more details.<br>
+ *<br>
+ * You should have received a copy of the GNU General Public License<br>
+ * along with this program; if not, write to the Free Software<br>
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA<br>
+ */<br>
+<br>
+<br>
+Device (EC0)<br>
+{<br>
+       Name (_HID, EISAID ("PNP0C09"))<br>
+       Name(_UID, 1)<br>
+<br>
+       Method(_CRS, 0)<br>
+       {<br>
+       Name(BFFR, ResourceTemplate()<br>
+       {<br>
+               IO(Decode16, 0x62, 0x62, 0, 1)      // ACPI DATA IN/OUT<br>
+               IO(Decode16, 0x66, 0x66, 0, 1)      // CMD/STS<br>
+               IRQ(Edge, ActiveHigh, Exclusive) {0x0B}<br>
+       })<br>
+    Return(BFFR)<br>
+       }<br>
+<br>
+       OperationRegion(ECF0, EmbeddedControl, 0, 0xFF)<br>
+    Field(ECF2, ByteAcc, Lock, Preserve)<br>
+       {<br>
+               Offset(1),<br>
+               STMP,   8,      // 1,      Sensor Temperature<br>
+               ACPW,   8,      // 2,      AC Power (AC Present = 1, else 0)<br>
+               LIDS,   8,      // 3,      Lid State (Lid Open = 1, else 0)<br>
+               PBNS,   8,      // 4,      Power Button State (Pressed = 1, else 0)<br>
+               BTST,   8,      // 5,      Battery Status<br>
+               BTCR,   8,      // 6,      Battery Current Rate<br>
+               BTCC,   8,      // 7,      Battery Current Capacity<br>
+               BTVT,   8,      // 8,      Battery Voltage<br>
+               offset(0x10),<br>
+               SPTR,   8,      // 5,      SMBus Protocol Register<br>
+               SSTS,   8,      // 5,      SMBus Status Register<br>
+               SADR,   8,      // 6,      SMBus Address Register<br>
+               SCMD,   8,      // 7,      SMBus Command Register<br>
+               SBFR,   256,    // 8,      SMBus Block Buffer<br>
+               SCNT,   8,      // 40,     SMBus Block Count<br>
+       }<br>
+<br>
+       Method(_REG, 2)<br>
+       {<br>
+       }<br>
+<br>
+       /* AC status: present */<br>
+       Method(_Q01, 0, NotSerialized)<br>
+       {<br>
+               Notify (AC, 0x80)<br>
+       }<br>
+<br>
+       /* AC status: dispear*/<br>
+       Method(_Q02, 0, NotSerialized)<br>
+       {<br>
+               Notify (AC, 0x80)<br>
+       }<br>
+<br>
+    Method(_Q04, 0, NotSerialized)<br>
+    {<br>
+       Notify(LID, 0x80)<br>
+    }<br>
+<br>
+    Method(_Q04, 0, NotSerialized)<br>
+    {<br>
+       Notify(LID, 0x80)<br>
+    }<br>
+<br>
+       Device(AC)<br>
+       {<br>
+               Name(_HID, "ACPI0003")<br>
+               Name(_UID, 0x00)<br>
+               Name(_PCL, Package() { \_SB } )<br>
+<br>
+               Method(_PSR, 0, NotSerialized)<br>
+               {<br>
+                       return (ACPW)<br>
+               }<br>
+<br>
+               Method(_STA, 0, NotSerialized)<br>
+               {<br>
+                       Return (0x0f)<br>
+               }<br>
+       }<br>
+<br>
+       Device(LID)<br>
+       {<br>
+               Name(_HID, "PNP0C0D")<br>
+<br>
+               Method(_LID, 0, NotSerialized)<br>
+               {<br>
+                       return (LIDS)<br>
+               }<br>
+       }<br>
+}<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.7.2.5<br>
<br>
<br>
_______________________________________________<br>
SeaBIOS mailing list<br>
<a href="mailto:SeaBIOS@seabios.org">SeaBIOS@seabios.org</a><br>
<a href="http://www.seabios.org/mailman/listinfo/seabios" target="_blank">http://www.seabios.org/mailman/listinfo/seabios</a><br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><a href="http://se-eng.com">http://se-eng.com</a>
</div>