summaryrefslogtreecommitdiff
path: root/src/superio/ite/it8671f
diff options
context:
space:
mode:
Diffstat (limited to 'src/superio/ite/it8671f')
-rw-r--r--src/superio/ite/it8671f/Config.lb2
-rw-r--r--src/superio/ite/it8671f/chip.h41
-rw-r--r--src/superio/ite/it8671f/it8671f.h35
-rw-r--r--src/superio/ite/it8671f/it8671f_early_serial.c29
-rw-r--r--src/superio/ite/it8671f/superio.c90
5 files changed, 197 insertions, 0 deletions
diff --git a/src/superio/ite/it8671f/Config.lb b/src/superio/ite/it8671f/Config.lb
new file mode 100644
index 0000000000..f62a567d61
--- /dev/null
+++ b/src/superio/ite/it8671f/Config.lb
@@ -0,0 +1,2 @@
+config chip.h
+object superio.o
diff --git a/src/superio/ite/it8671f/chip.h b/src/superio/ite/it8671f/chip.h
new file mode 100644
index 0000000000..39ef94c706
--- /dev/null
+++ b/src/superio/ite/it8671f/chip.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2006 Uwe Hermann <uwe@hermann-uwe.de>
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef _SUPERIO_ITE_IT8671F
+#define _SUPERIO_ITE_IT8671F
+
+// TODO: Unused?
+// #ifndef SIO_COM1
+// #define SIO_COM1_BASE 0x3F8
+// #endif
+// #ifndef SIO_COM2
+// #define SIO_COM2_BASE 0x2F8
+// #endif
+
+#include <pc80/keyboard.h>
+#include <uart8250.h>
+
+extern struct chip_operations superio_ITE_it8671f_ops;
+
+struct superio_ITE_it8671f_config {
+ struct uart8250 com1, com2;
+ struct pc_keyboard keyboard;
+};
+
+#endif /* _SUPERIO_ITE_IT8671F */
+
diff --git a/src/superio/ite/it8671f/it8671f.h b/src/superio/ite/it8671f/it8671f.h
new file mode 100644
index 0000000000..aec7fc154a
--- /dev/null
+++ b/src/superio/ite/it8671f/it8671f.h
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2006 Uwe Hermann <uwe@hermann-uwe.de>
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+// TODO: Untested, cut'n'pasted from some other file so it's probably wrong.
+// #define IT8671F_FDC 0x00 /* Floppy */
+// #define IT8671F_PP 0x01 /* Parallel port */
+#define IT8671F_SP2 0x02 /* Com2 */
+#define IT8671F_SP1 0x03 /* Com1 */
+// #define IT8671F_SWC 0x04
+// #define IT8671F_KBCM 0x05 /* Mouse */
+#define IT8671F_KBCK 0x06 /* Keyboard */
+// #define IT8671F_GPIO 0x07
+// #define IT8671F_ACB 0x08
+// #define IT8671F_FSCM 0x09
+// #define IT8671F_WDT 0x0A
+// #define IT8671F_GMP 0x0B
+// #define IT8671F_MIDI 0x0C
+// #define IT8671F_VLM 0x0D
+// #define IT8671F_TMS 0x0E
+
diff --git a/src/superio/ite/it8671f/it8671f_early_serial.c b/src/superio/ite/it8671f/it8671f_early_serial.c
new file mode 100644
index 0000000000..6af522e9d3
--- /dev/null
+++ b/src/superio/ite/it8671f/it8671f_early_serial.c
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2006 Uwe Hermann <uwe@hermann-uwe.de>
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <arch/romcc_io.h>
+#include "it8671f.h"
+
+static void it8671f_enable_serial(device_t dev, unsigned iobase)
+{
+ pnp_set_logical_device(dev);
+ pnp_set_enable(dev, 1);
+ pnp_set_iobase(dev, PNP_IDX_IO0, iobase);
+ pnp_set_enable(dev, 1);
+}
+
diff --git a/src/superio/ite/it8671f/superio.c b/src/superio/ite/it8671f/superio.c
new file mode 100644
index 0000000000..9a390efefa
--- /dev/null
+++ b/src/superio/ite/it8671f/superio.c
@@ -0,0 +1,90 @@
+/*
+ * Copyright (C) 2006 Uwe Hermann <uwe@hermann-uwe.de>
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+// #include <arch/io.h>
+// #include <device/device.h>
+// #include <device/pnp.h>
+// #include <console/console.h>
+// #include <string.h>
+// #include <bitops.h>
+#include <uart8250.h>
+#include <pc80/keyboard.h>
+#include "chip.h"
+#include "it8671f.h"
+
+static void init(device_t dev)
+{
+ struct superio_ITE_it8671f_config *conf;
+ struct resource *res0, *res1;
+
+ if (!dev->enabled) {
+ return;
+ }
+
+ conf = dev->chip_info;
+
+ switch(dev->path.u.pnp.device) {
+ case IT8671F_SP1:
+ res0 = find_resource(dev, PNP_IDX_IO0);
+ init_uart8250(res0->base, &conf->com1);
+ break;
+ case IT8671F_SP2:
+ res0 = find_resource(dev, PNP_IDX_IO0);
+ init_uart8250(res0->base, &conf->com2);
+ break;
+ case IT8671F_KBCK:
+ res0 = find_resource(dev, PNP_IDX_IO0);
+ res1 = find_resource(dev, PNP_IDX_IO1);
+ init_pc_keyboard(res0->base, res1->base, &conf->keyboard);
+ break;
+ }
+}
+
+static struct device_operations ops = {
+ .read_resources = pnp_read_resources,
+ .set_resources = pnp_set_resources,
+ .enable_resources = pnp_enable_resources,
+ .enable = pnp_enable,
+ .init = init,
+};
+
+// TODO.
+static struct pnp_info pnp_dev_info[] = {
+// { &ops, IT8671F_FDC, PNP_IO0 | PNP_IRQ0 | PNP_DRQ0, { 0x07fa, 0}, },
+// { &ops, IT8671F_PP, PNP_IO0 | PNP_IRQ0 | PNP_DRQ0, { 0x04f8, 0}, },
+ { &ops, IT8671F_SP2, PNP_IO0 | PNP_IRQ0 | PNP_DRQ0 | PNP_DRQ1, { 0x7f8, 0 }, },
+ { &ops, IT8671F_SP1, PNP_IO0 | PNP_IRQ0, { 0x7f8, 0 }, },
+// { &ops, IT8671F_SWC, PNP_IO0 | PNP_IRQ0, { 0xfff0, 0 }, },
+// { &ops, IT8671F_KBCM, PNP_IRQ0 },
+{ &ops, IT8671F_KBCK, PNP_IO0 | PNP_IO1 | PNP_IRQ0, { 0x7f8, 0 }, { 0x7f8, 0x4}, },
+// { &ops, IT8671F_GPIO, PNP_IO0 | PNP_IRQ0, { 0xfff8, 0 } },
+// { &ops, IT8671F_XBUS, PNP_IO0 | PNP_IRQ0, { 0xffe0, 0 } },
+// { &ops, IT8671F_RTC, PNP_IO0 | PNP_IO1, { 0xfffe, 0 }, {0xfffe, 0x4} },
+};
+
+static void enable_dev(struct device *dev)
+{
+ pnp_enable_devices(dev, &pnp_ops,
+ sizeof(pnp_dev_info)/sizeof(pnp_dev_info[0]), pnp_dev_info);
+}
+
+struct chip_operations superio_ITE_it8671f_ops = {
+ CHIP_NAME("ITE it8671f")
+ .enable_dev = enable_dev,
+};
+