Daniel Maslowski has uploaded this change for review.

View Change

superio: IT8587E (WIP)

Change-Id: I1e541daa2b3d48a4f5a0e7b7fa88a2c2f8a1b0c5
Signed-off-by: Daniel Maslowski <info@orangecms.org>
---
A src/superio/ite/it8587e/Kconfig
A src/superio/ite/it8587e/Makefile.inc
A src/superio/ite/it8587e/it8587e.h
A src/superio/ite/it8587e/superio.c
4 files changed, 137 insertions(+), 0 deletions(-)

git pull ssh://review.coreboot.org:29418/coreboot refs/changes/71/36071/1
diff --git a/src/superio/ite/it8587e/Kconfig b/src/superio/ite/it8587e/Kconfig
new file mode 100644
index 0000000..438bd3e
--- /dev/null
+++ b/src/superio/ite/it8587e/Kconfig
@@ -0,0 +1,16 @@
+##
+## This file is part of the coreboot project.
+##
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; version 2 of the License.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+## GNU General Public License for more details.
+##
+
+config SUPERIO_ITE_IT8587E
+ bool
+ select SUPERIO_ITE_COMMON_PRE_RAM
diff --git a/src/superio/ite/it8587e/Makefile.inc b/src/superio/ite/it8587e/Makefile.inc
new file mode 100644
index 0000000..dbde0b7
--- /dev/null
+++ b/src/superio/ite/it8587e/Makefile.inc
@@ -0,0 +1,15 @@
+##
+## This file is part of the coreboot project.
+##
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+## GNU General Public License for more details.
+##
+
+ramstage-$(CONFIG_SUPERIO_ITE_IT8587E) += superio.c
diff --git a/src/superio/ite/it8587e/it8587e.h b/src/superio/ite/it8587e/it8587e.h
new file mode 100644
index 0000000..eab3527
--- /dev/null
+++ b/src/superio/ite/it8587e/it8587e.h
@@ -0,0 +1,34 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef SUPERIO_ITE_IT8587E_H
+#define SUPERIO_ITE_IT8587E_H
+
+#define IT8528E_SP1 0x01 /* Com1 */
+#define IT8528E_SP2 0x02 /* Com2 */
+#define IT8587E_SWUC 0x04 /* System Wake-Up */
+#define IT8587E_KBCM 0x05 /* PS/2 mouse */
+#define IT8587E_KBCK 0x06 /* PS/2 keyboard */
+#define IT8587E_SMFI 0x0f /* Shared Memory/Flash Interface */
+#define IT8587E_RTCT 0x10 /* RTC-like Timer */
+#define IT8587E_PMC1 0x11 /* Power Management Channel 1 */
+#define IT8587E_PMC2 0x12 /* Power Management Channel 2 */
+#define IT8587E_SSPI 0x13 /* Serial Periphial Interface */
+#define IT8587E_PECI 0x14 /* Platform EC Interface */
+#define IT8587E_PMC3 0x17 /* Power Management Channel 3 */
+#define IT8587E_PMC4 0x18 /* Power Management Channel 4 */
+#define IT8587E_PMC5 0x19 /* Power Management Channel 5 */
+
+
+#endif /* SUPERIO_ITE_IT8587E_H */
diff --git a/src/superio/ite/it8587e/superio.c b/src/superio/ite/it8587e/superio.c
new file mode 100644
index 0000000..cdb97e6
--- /dev/null
+++ b/src/superio/ite/it8587e/superio.c
@@ -0,0 +1,72 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2006 Uwe Hermann <uwe@hermann-uwe.de>
+ * Copyright (C) 2007 Philipp Degler <pdegler@rumms.uni-mannheim.de>
+ * Copyright (C) 2017 Gergely Kiss <mail.gery@gmail.com>
+ * Copyright (C) 2019 9Elements GmbH <patrick.rudolph@9elements.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#include <device/device.h>
+#include <device/pnp.h>
+#include <stdlib.h>
+#include <superio/conf_mode.h>
+
+#include "it8587e.h"
+
+static void it8587e_init(struct device *dev)
+{
+}
+
+static struct device_operations ops = {
+ .read_resources = pnp_read_resources,
+ .set_resources = pnp_set_resources,
+ .enable_resources = pnp_enable_resources,
+ .enable = pnp_alt_enable,
+ .init = it8587e_init,
+ .ops_pnp_mode = &pnp_conf_mode_870155_aa,
+};
+
+static struct pnp_info pnp_dev_info[] = {
+ { NULL, IT8587E_SP1, PNP_IO0 | PNP_IRQ0, 0x0ff8, },
+ { NULL, IT8587E_SP2, PNP_IO0 | PNP_IRQ0, 0x0ff8, },
+ { NULL, IT8587E_SWUC, PNP_IO0 | PNP_IRQ0, 0xfff0, },
+ /* Documentation: Unused */
+ { NULL, IT8587E_KBCM, PNP_IRQ0, },
+ /* Documentation: Program io0 = 0x60 and io1 = 0x64 */
+ { NULL, IT8587E_KBCK, PNP_IO0 | PNP_IO1 | PNP_IRQ0, 0x07ff, 0x07ff, },
+ { NULL, IT8587E_SMFI, PNP_IO0 | PNP_IRQ0, 0xfff0, },
+ /* Documentation: Program io0 = 0x70-0x73 */
+ { NULL, IT8587E_RTCT, PNP_IO0 | PNP_IO1 | PNP_IO2 | PNP_IO3 | PNP_IRQ0,
+ 0xfffe, 0xfffe, 0xfffe, 0xfffe},
+ /* Documentation: Program io0 = 0x62 and io1 = 0x66 */
+ { NULL, IT8587E_PMC1, PNP_IO0 | PNP_IO1 | PNP_IRQ0, 0x07ff, 0x07ff },
+ /* Documentation: Program io0 = 0x68 and io1 = 0x6c */
+ { NULL, IT8587E_PMC2, PNP_IO0 | PNP_IO1 | PNP_IRQ0, 0x07fc, 0x07fc },
+ /* Documentation: Program io0 = 0x6a and io1 = 0x6e */
+ { NULL, IT8587E_PMC3, PNP_IO0 | PNP_IO1 | PNP_IRQ0, 0x07ff, 0x07ff },
+ { NULL, IT8587E_PMC4, PNP_IO0 | PNP_IO1 | PNP_IRQ0, 0x07ff, 0x07ff },
+ { NULL, IT8587E_PMC5, PNP_IO0 | PNP_IO1 | PNP_IRQ0, 0x07ff, 0x07ff },
+ { NULL, IT8587E_SSPI, PNP_IO0 | PNP_IRQ0, 0xfff8 },
+ { NULL, IT8528E_PECI, PNP_IO0, 0xfff8 },
+};
+
+static void enable_dev(struct device *dev)
+{
+ pnp_enable_devices(dev, &ops, ARRAY_SIZE(pnp_dev_info), pnp_dev_info);
+}
+
+struct chip_operations superio_ite_it8587e_ops = {
+ CHIP_NAME("ITE IT8587E Super I/O")
+ .enable_dev = enable_dev,
+};

To view, visit change 36071. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I1e541daa2b3d48a4f5a0e7b7fa88a2c2f8a1b0c5
Gerrit-Change-Number: 36071
Gerrit-PatchSet: 1
Gerrit-Owner: Daniel Maslowski <info@orangecms.org>
Gerrit-Reviewer: Daniel Maslowski <info@orangecms.org>
Gerrit-Reviewer: Felix Held <felix-coreboot@felixheld.de>
Gerrit-Reviewer: Martin Roth <martinroth@google.com>
Gerrit-Reviewer: Patrick Georgi <pgeorgi@google.com>
Gerrit-MessageType: newchange