<p>Gergely Kiss has uploaded this change for <strong>review</strong>.</p><p><a href="https://review.coreboot.org/23001">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">superio/ite/it8623e: add support for SIO chip ITE IT8623E<br><br>This change adds basic support for the SuperIO chip ITE IT8623E.<br>Due to the lack of a datasheet, defaults are shown as "not available (NA)"<br>in superiotool's register dump. LDNs defined in it8623e.h are<br>definitely correct and working as expected.<br><br>Change-Id: I05832c4db7ab59541337f11200640316376e792e<br>Signed-off-by: Gergely Kiss <mail.gery@gmail.com><br>---<br>M src/superio/ite/Makefile.inc<br>A src/superio/ite/it8623e/Kconfig<br>A src/superio/ite/it8623e/Makefile.inc<br>A src/superio/ite/it8623e/it8623e.h<br>A src/superio/ite/it8623e/superio.c<br>5 files changed, 146 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://review.coreboot.org:29418/coreboot refs/changes/01/23001/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/superio/ite/Makefile.inc b/src/superio/ite/Makefile.inc</span><br><span>index f27a333..382dbd7 100644</span><br><span>--- a/src/superio/ite/Makefile.inc</span><br><span>+++ b/src/superio/ite/Makefile.inc</span><br><span>@@ -19,6 +19,7 @@</span><br><span> ## include generic ite environment controller driver</span><br><span> ramstage-$(CONFIG_SUPERIO_ITE_ENV_CTRL) += common/env_ctrl.c</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+subdirs-y += it8623e</span><br><span> subdirs-y += it8671f</span><br><span> subdirs-y += it8712f</span><br><span> subdirs-y += it8716f</span><br><span>diff --git a/src/superio/ite/it8623e/Kconfig b/src/superio/ite/it8623e/Kconfig</span><br><span>new file mode 100644</span><br><span>index 0000000..1b4fe4a</span><br><span>--- /dev/null</span><br><span>+++ b/src/superio/ite/it8623e/Kconfig</span><br><span>@@ -0,0 +1,20 @@</span><br><span style="color: hsl(120, 100%, 40%);">+##</span><br><span style="color: hsl(120, 100%, 40%);">+## This file is part of the coreboot project.</span><br><span style="color: hsl(120, 100%, 40%);">+##</span><br><span style="color: hsl(120, 100%, 40%);">+## Copyright (C) 2009 Ronald G. Minnich</span><br><span style="color: hsl(120, 100%, 40%);">+## Copyright (C) 2014 Edward O'Callaghan <eocallaghan@alterapraxis.com></span><br><span style="color: hsl(120, 100%, 40%);">+## Copyright (C) 2017 Gergely Kiss <mail.gery@gmail.com></span><br><span style="color: hsl(120, 100%, 40%);">+##</span><br><span style="color: hsl(120, 100%, 40%);">+## This program is free software; you can redistribute it and/or modify</span><br><span style="color: hsl(120, 100%, 40%);">+## it under the terms of the GNU General Public License as published by</span><br><span style="color: hsl(120, 100%, 40%);">+## the Free Software Foundation; version 2 of the License.</span><br><span style="color: hsl(120, 100%, 40%);">+##</span><br><span style="color: hsl(120, 100%, 40%);">+## This program is distributed in the hope that it will be useful,</span><br><span style="color: hsl(120, 100%, 40%);">+## but WITHOUT ANY WARRANTY; without even the implied warranty of</span><br><span style="color: hsl(120, 100%, 40%);">+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span><br><span style="color: hsl(120, 100%, 40%);">+## GNU General Public License for more details.</span><br><span style="color: hsl(120, 100%, 40%);">+##</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+config SUPERIO_ITE_IT8623E</span><br><span style="color: hsl(120, 100%, 40%);">+   bool</span><br><span style="color: hsl(120, 100%, 40%);">+  select SUPERIO_ITE_COMMON_ROMSTAGE</span><br><span>diff --git a/src/superio/ite/it8623e/Makefile.inc b/src/superio/ite/it8623e/Makefile.inc</span><br><span>new file mode 100644</span><br><span>index 0000000..2afaecf</span><br><span>--- /dev/null</span><br><span>+++ b/src/superio/ite/it8623e/Makefile.inc</span><br><span>@@ -0,0 +1,18 @@</span><br><span style="color: hsl(120, 100%, 40%);">+##</span><br><span style="color: hsl(120, 100%, 40%);">+## This file is part of the coreboot project.</span><br><span style="color: hsl(120, 100%, 40%);">+##</span><br><span style="color: hsl(120, 100%, 40%);">+## Copyright (C) 2006 Uwe Hermann <uwe@hermann-uwe.de></span><br><span style="color: hsl(120, 100%, 40%);">+## Copyright (C) 2017 Gergely Kiss <mail.gery@gmail.com></span><br><span style="color: hsl(120, 100%, 40%);">+##</span><br><span style="color: hsl(120, 100%, 40%);">+## This program is free software; you can redistribute it and/or modify</span><br><span style="color: hsl(120, 100%, 40%);">+## it under the terms of the GNU General Public License as published by</span><br><span style="color: hsl(120, 100%, 40%);">+## the Free Software Foundation; either version 2 of the License, or</span><br><span style="color: hsl(120, 100%, 40%);">+## (at your option) any later version.</span><br><span style="color: hsl(120, 100%, 40%);">+##</span><br><span style="color: hsl(120, 100%, 40%);">+## This program is distributed in the hope that it will be useful,</span><br><span style="color: hsl(120, 100%, 40%);">+## but WITHOUT ANY WARRANTY; without even the implied warranty of</span><br><span style="color: hsl(120, 100%, 40%);">+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span><br><span style="color: hsl(120, 100%, 40%);">+## GNU General Public License for more details.</span><br><span style="color: hsl(120, 100%, 40%);">+##</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ramstage-$(CONFIG_SUPERIO_ITE_IT8623E) += superio.c</span><br><span>diff --git a/src/superio/ite/it8623e/it8623e.h b/src/superio/ite/it8623e/it8623e.h</span><br><span>new file mode 100644</span><br><span>index 0000000..25670c5</span><br><span>--- /dev/null</span><br><span>+++ b/src/superio/ite/it8623e/it8623e.h</span><br><span>@@ -0,0 +1,32 @@</span><br><span style="color: hsl(120, 100%, 40%);">+/*</span><br><span style="color: hsl(120, 100%, 40%);">+ * This file is part of the coreboot project.</span><br><span style="color: hsl(120, 100%, 40%);">+ *</span><br><span style="color: hsl(120, 100%, 40%);">+ * Copyright (C) 2006 Uwe Hermann <uwe@hermann-uwe.de></span><br><span style="color: hsl(120, 100%, 40%);">+ * Copyright (C) 2017 Gergely Kiss <mail.gery@gmail.com></span><br><span style="color: hsl(120, 100%, 40%);">+ *</span><br><span style="color: hsl(120, 100%, 40%);">+ * This program is free software; you can redistribute it and/or modify</span><br><span style="color: hsl(120, 100%, 40%);">+ * it under the terms of the GNU General Public License as published by</span><br><span style="color: hsl(120, 100%, 40%);">+ * the Free Software Foundation; either version 2 of the License, or</span><br><span style="color: hsl(120, 100%, 40%);">+ * (at your option) any later version.</span><br><span style="color: hsl(120, 100%, 40%);">+ *</span><br><span style="color: hsl(120, 100%, 40%);">+ * This program is distributed in the hope that it will be useful,</span><br><span style="color: hsl(120, 100%, 40%);">+ * but WITHOUT ANY WARRANTY; without even the implied warranty of</span><br><span style="color: hsl(120, 100%, 40%);">+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span><br><span style="color: hsl(120, 100%, 40%);">+ * GNU General Public License for more details.</span><br><span style="color: hsl(120, 100%, 40%);">+ */</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+#ifndef SUPERIO_ITE_IT8623E_H</span><br><span style="color: hsl(120, 100%, 40%);">+#define SUPERIO_ITE_IT8623E_H</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+/* Datasheet not available. The list of LDNs might not be complete. */</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+#define IT8623E_FDC  0x00 /* Floppy Controller */</span><br><span style="color: hsl(120, 100%, 40%);">+#define IT8623E_SP1  0x01 /* Com1 */</span><br><span style="color: hsl(120, 100%, 40%);">+#define IT8623E_SP2  0x02 /* Com2 */</span><br><span style="color: hsl(120, 100%, 40%);">+#define IT8623E_PP   0x03 /* Parallel port */</span><br><span style="color: hsl(120, 100%, 40%);">+#define IT8623E_EC   0x04 /* Environment controller */</span><br><span style="color: hsl(120, 100%, 40%);">+#define IT8623E_KBCK 0x05 /* PS/2 keyboard */</span><br><span style="color: hsl(120, 100%, 40%);">+#define IT8623E_KBCM 0x06 /* PS/2 mouse */</span><br><span style="color: hsl(120, 100%, 40%);">+#define IT8623E_GPIO 0x07 /* GPIO */</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+#endif /* SUPERIO_ITE_IT8623E_H */</span><br><span>diff --git a/src/superio/ite/it8623e/superio.c b/src/superio/ite/it8623e/superio.c</span><br><span>new file mode 100644</span><br><span>index 0000000..b7b5342</span><br><span>--- /dev/null</span><br><span>+++ b/src/superio/ite/it8623e/superio.c</span><br><span>@@ -0,0 +1,75 @@</span><br><span style="color: hsl(120, 100%, 40%);">+/*</span><br><span style="color: hsl(120, 100%, 40%);">+ * This file is part of the coreboot project.</span><br><span style="color: hsl(120, 100%, 40%);">+ *</span><br><span style="color: hsl(120, 100%, 40%);">+ * Copyright (C) 2006 Uwe Hermann <uwe@hermann-uwe.de></span><br><span style="color: hsl(120, 100%, 40%);">+ * Copyright (C) 2007 Philipp Degler <pdegler@rumms.uni-mannheim.de></span><br><span style="color: hsl(120, 100%, 40%);">+ * Copyright (C) 2016 Gergely Kiss <mail.gery@gmail.com></span><br><span style="color: hsl(120, 100%, 40%);">+ *</span><br><span style="color: hsl(120, 100%, 40%);">+ * This program is free software; you can redistribute it and/or modify</span><br><span style="color: hsl(120, 100%, 40%);">+ * it under the terms of the GNU General Public License as published by</span><br><span style="color: hsl(120, 100%, 40%);">+ * the Free Software Foundation; either version 2 of the License, or</span><br><span style="color: hsl(120, 100%, 40%);">+ * (at your option) any later version.</span><br><span style="color: hsl(120, 100%, 40%);">+ *</span><br><span style="color: hsl(120, 100%, 40%);">+ * This program is distributed in the hope that it will be useful,</span><br><span style="color: hsl(120, 100%, 40%);">+ * but WITHOUT ANY WARRANTY; without even the implied warranty of</span><br><span style="color: hsl(120, 100%, 40%);">+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span><br><span style="color: hsl(120, 100%, 40%);">+ * GNU General Public License for more details.</span><br><span style="color: hsl(120, 100%, 40%);">+ */</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+#include <device/device.h></span><br><span style="color: hsl(120, 100%, 40%);">+#include <device/pnp.h></span><br><span style="color: hsl(120, 100%, 40%);">+#include <pc80/keyboard.h></span><br><span style="color: hsl(120, 100%, 40%);">+#include <arch/io.h></span><br><span style="color: hsl(120, 100%, 40%);">+#include <stdlib.h></span><br><span style="color: hsl(120, 100%, 40%);">+#include <superio/conf_mode.h></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+#include "it8623e.h"</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+static void it8623e_init(struct device *dev)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+     if (!dev->enabled)</span><br><span style="color: hsl(120, 100%, 40%);">+         return;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+     switch (dev->path.pnp.device) {</span><br><span style="color: hsl(120, 100%, 40%);">+    case IT8623E_EC:</span><br><span style="color: hsl(120, 100%, 40%);">+              break;</span><br><span style="color: hsl(120, 100%, 40%);">+        case IT8623E_KBCK:</span><br><span style="color: hsl(120, 100%, 40%);">+            set_kbc_ps2_mode();</span><br><span style="color: hsl(120, 100%, 40%);">+           pc_keyboard_init(NO_AUX_DEVICE);</span><br><span style="color: hsl(120, 100%, 40%);">+              break;</span><br><span style="color: hsl(120, 100%, 40%);">+        case IT8623E_KBCM:</span><br><span style="color: hsl(120, 100%, 40%);">+            break;</span><br><span style="color: hsl(120, 100%, 40%);">+        }</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+static struct device_operations ops = {</span><br><span style="color: hsl(120, 100%, 40%);">+       .read_resources   = pnp_read_resources,</span><br><span style="color: hsl(120, 100%, 40%);">+       .set_resources    = pnp_set_resources,</span><br><span style="color: hsl(120, 100%, 40%);">+        .enable_resources = pnp_enable_resources,</span><br><span style="color: hsl(120, 100%, 40%);">+     .enable           = pnp_alt_enable,</span><br><span style="color: hsl(120, 100%, 40%);">+   .init             = it8623e_init,</span><br><span style="color: hsl(120, 100%, 40%);">+     .ops_pnp_mode     = &pnp_conf_mode_870155_aa,</span><br><span style="color: hsl(120, 100%, 40%);">+};</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+static struct pnp_info pnp_dev_info[] = {</span><br><span style="color: hsl(120, 100%, 40%);">+    { &ops, IT8623E_FDC, PNP_IO0 | PNP_IRQ0 | PNP_DRQ0, 0x0ff8, },</span><br><span style="color: hsl(120, 100%, 40%);">+    { &ops, IT8623E_SP1, PNP_IO0 | PNP_IRQ0, 0x0ff8, },</span><br><span style="color: hsl(120, 100%, 40%);">+       { &ops, IT8623E_SP2, PNP_IO0 | PNP_IRQ0, 0x0ff8, },</span><br><span style="color: hsl(120, 100%, 40%);">+       { &ops, IT8623E_PP, PNP_IO0 | PNP_IO1 | PNP_IRQ0 | PNP_DRQ0, 0x0ffc, 0x0ffc },</span><br><span style="color: hsl(120, 100%, 40%);">+    { &ops, IT8623E_EC, PNP_IO0 | PNP_IO1 | PNP_IRQ0, 0x0ff8, 0x0ff8, },</span><br><span style="color: hsl(120, 100%, 40%);">+      { &ops, IT8623E_KBCK, PNP_IO0 | PNP_IO1 | PNP_IRQ0, 0x0fff, 0x0fff, },</span><br><span style="color: hsl(120, 100%, 40%);">+    { &ops, IT8623E_KBCM, PNP_IRQ0, },</span><br><span style="color: hsl(120, 100%, 40%);">+        { &ops, IT8623E_GPIO, PNP_IO0 | PNP_IO1 | PNP_IO2 | PNP_IRQ0, 0x0fff, 0x0ff8, 0x0ff8, },</span><br><span style="color: hsl(120, 100%, 40%);">+};</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+static void enable_dev(struct device *dev)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+     pnp_enable_devices(dev, &pnp_ops,</span><br><span style="color: hsl(120, 100%, 40%);">+         ARRAY_SIZE(pnp_dev_info), pnp_dev_info);</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+struct chip_operations superio_ite_it8623e_ops = {</span><br><span style="color: hsl(120, 100%, 40%);">+     CHIP_NAME("ITE IT8623E Super I/O")</span><br><span style="color: hsl(120, 100%, 40%);">+  .enable_dev = enable_dev,</span><br><span style="color: hsl(120, 100%, 40%);">+};</span><br><span></span><br></pre><p>To view, visit <a href="https://review.coreboot.org/23001">change 23001</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://review.coreboot.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://review.coreboot.org/23001"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: coreboot </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I05832c4db7ab59541337f11200640316376e792e </div>
<div style="display:none"> Gerrit-Change-Number: 23001 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Gergely Kiss <mail.gery@gmail.com> </div>