Add support for Fintek F81803 SuperIO chip

Reviewed by:	avg
This commit is contained in:
Poul-Henning Kamp 2020-11-26 07:34:20 +00:00
parent b83e94be53
commit c0c2345432
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=368052
2 changed files with 36 additions and 1 deletions

View file

@ -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;
}

View file

@ -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,