aboutsummaryrefslogtreecommitdiff
path: root/src/superio/nuvoton/npcd378/npcd378.h
diff options
context:
space:
mode:
authorPatrick Rudolph <patrick.rudolph@9elements.com>2018-03-27 15:58:38 +0200
committerPatrick Rudolph <siro@das-labor.org>2018-05-14 12:39:20 +0000
commit4576600dd2a820ddddf539c40f147757d8644466 (patch)
tree538658b6154341be607f4699b9fca689525bf539 /src/superio/nuvoton/npcd378/npcd378.h
parent3337497d2a1995614afd4a554747d86e4bcd8d31 (diff)
superio/nuvoton: Add support for NPCD378
The NPCD378 can be found on at least: * HP Compaq 8200 * HP Compaq 8300 The datasheet is not publicly available, as HP implements lots of custom hardware. Add basic support for it, based on HP Compaq 8200. The first eight LDNs seem to be standard nuvoton compatible, except for LDN4, which is used to control front LED and power in ACPI S3. LDN8 provides access to HP's proprietary HWM which is accessiable at the LDN's IOBASE with a size of 0x100 bytes. The HWM consists of 16 pages with each holding 0xff bytes. The pages can be selected by writing the page index to IOBASE + 0xff. TODO: Reverse engineer the HWM to support fan control. WARNING: The remaining LDNs have been guessed and might be wrong! The serial has been tested and is working. Change-Id: Ib497fd41b88e9c159eeeffa69bc2bfdccee9cb38 Signed-off-by: Patrick Rudolph <siro@das-labor.org> Reviewed-on: https://review.coreboot.org/25384 Reviewed-by: Felix Held <felix-coreboot@felixheld.de> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/superio/nuvoton/npcd378/npcd378.h')
-rw-r--r--src/superio/nuvoton/npcd378/npcd378.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/superio/nuvoton/npcd378/npcd378.h b/src/superio/nuvoton/npcd378/npcd378.h
new file mode 100644
index 0000000000..732dd000f3
--- /dev/null
+++ b/src/superio/nuvoton/npcd378/npcd378.h
@@ -0,0 +1,37 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2018 Patrick Rudolph <siro@das-labor.org>
+ *
+ * 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_NUVOTON_NPCD378_H
+#define SUPERIO_NUVOTON_NPCD378_H
+
+/* Logical Device Numbers (LDN). */
+/* Default Nuvoton hardware: */
+#define NPCD378_FDC 0x00 /* Floppy */
+#define NPCD378_PP 0x01 /* Parallel port */
+#define NPCD378_SP1 0x02 /* Com1 */
+#define NPCD378_SP2 0x03 /* Com2 & IR */
+#define NPCD378_PWR 0x04 /* LED and PWR button control */
+#define NPCD378_AUX 0x05 /* PS/2 mouse */
+#define NPCD378_KBC 0x06 /* PS/2 keyboard */
+/* The following is guessed based on observation and might be wrong: */
+#define NPCD378_WDT1 0x07
+#define NPCD378_HWM 0x08 /* HWM: 16 pages with each 255 byte */
+#define NPCD378_GPIO_PP_OD 0x0F /* GPIO Push-Pull/Open drain select */
+#define NPCD378_I2C 0x15 /* Provides 35Khz at IOBASE + 0x9 */
+#define NPCD378_SUSPEND 0x1c /* Suspend control ? */
+#define NPCD378_GPIOA 0x1e
+
+#endif /* SUPERIO_NUVOTON_NPCD378_H */