aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/dev/superio/superio.c34
-rw-r--r--sys/dev/superio/superio.h3
2 files changed, 36 insertions, 1 deletions
diff --git a/sys/dev/superio/superio.c b/sys/dev/superio/superio.c
index d58135298d67..b102159c2810 100644
--- a/sys/dev/superio/superio.c
+++ b/sys/dev/superio/superio.c
@@ -233,9 +233,29 @@ static const struct sio_conf_methods nvt_conf_methods = {
.vendor = SUPERIO_VENDOR_NUVOTON
};
+static void
+fintek_conf_enter(struct resource* res, uint16_t port)
+{
+ bus_write_1(res, 0, 0x87);
+ bus_write_1(res, 0, 0x87);
+}
+
+static void
+fintek_conf_exit(struct resource* res, uint16_t port)
+{
+ bus_write_1(res, 0, 0xaa);
+}
+
+static const struct sio_conf_methods fintek_conf_methods = {
+ .enter = fintek_conf_enter,
+ .exit = fintek_conf_exit,
+ .vendor = SUPERIO_VENDOR_FINTEK
+};
+
static const struct sio_conf_methods * const methods_table[] = {
&ite_conf_methods,
&nvt_conf_methods,
+ &fintek_conf_methods,
NULL
};
@@ -261,6 +281,11 @@ const struct sio_device nct5104_devices[] = {
{ .type = SUPERIO_DEV_NONE },
};
+const struct sio_device fintek_devices[] = {
+ { .ldn = 7, .type = SUPERIO_DEV_WDT },
+ { .type = SUPERIO_DEV_NONE },
+};
+
static const struct {
superio_vendor_t vendor;
uint16_t devid;
@@ -410,6 +435,11 @@ static const struct {
.descr = "Nuvoton NCT6795",
.devices = nvt_devices,
},
+ {
+ .vendor = SUPERIO_VENDOR_FINTEK, .devid = 0x1210, .mask = 0xff,
+ .descr = "Fintek F81803",
+ .devices = fintek_devices,
+ },
{ 0, 0 }
};
@@ -475,6 +505,10 @@ superio_detect(device_t dev, bool claim, struct siosc *sc)
devid = sio_read(res, 0x20);
revid = sio_read(res, 0x21);
devid = (devid << 8) | revid;
+ } else if (methods_table[m]->vendor == SUPERIO_VENDOR_FINTEK) {
+ devid = sio_read(res, 0x20);
+ revid = sio_read(res, 0x21);
+ devid = (devid << 8) | revid;
} else {
continue;
}
diff --git a/sys/dev/superio/superio.h b/sys/dev/superio/superio.h
index 2748b1f27eca..993f95fc9fbb 100644
--- a/sys/dev/superio/superio.h
+++ b/sys/dev/superio/superio.h
@@ -34,6 +34,7 @@ typedef enum superio_vendor {
SUPERIO_VENDOR_NONE,
SUPERIO_VENDOR_ITE,
SUPERIO_VENDOR_NUVOTON,
+ SUPERIO_VENDOR_FINTEK,
SUPERIO_VENDOR_MAX
} superio_vendor_t;
@@ -58,7 +59,7 @@ device_t superio_find_dev(device_t superio, superio_dev_type_t type,
int ldn);
enum superio_ivars {
- SUPERIO_IVAR_LDN = 10600,
+ SUPERIO_IVAR_LDN = 10600,
SUPERIO_IVAR_TYPE,
SUPERIO_IVAR_IOBASE,
SUPERIO_IVAR_IOBASE2,