Dave Frodin (dave.frodin(a)se-eng.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/5947
-gerrit
commit 6b9f2dbc114a3174bd6f6049822c706b6cb2a587
Author: Dave Frodin <dave.frodin(a)se-eng.com>
Date: Thu Jun 5 14:30:22 2014 -0600
amd/southbridge/lpc: SPI BAR has fixed size/location
The CIMX sb700/sb800/sb900 and agesa/hudson code was treating
the LPC SPI BAR as a normal PCI BAR. This will set the
resources for a fixed size at a fixed address. This was tested
on hp/abm, amd/persimmon, and gizmosphere/gizmo boards.
Change-Id: I1367efe0bbb53b7727258585963f61f4bd02ea1d
Signed-off-by: Dave Frodin <dave.frodin(a)se-eng.com>
---
src/southbridge/amd/agesa/hudson/hudson.h | 5 +++++
src/southbridge/amd/agesa/hudson/lpc.c | 11 +++++------
src/southbridge/amd/cimx/sb700/lpc.c | 13 ++++++++-----
src/southbridge/amd/cimx/sb700/lpc.h | 6 +++++-
src/southbridge/amd/cimx/sb800/lpc.c | 10 ++++++----
src/southbridge/amd/cimx/sb800/lpc.h | 7 ++++++-
src/southbridge/amd/cimx/sb900/lpc.c | 13 ++++++++-----
src/southbridge/amd/cimx/sb900/lpc.h | 6 +++++-
8 files changed, 48 insertions(+), 23 deletions(-)
diff --git a/src/southbridge/amd/agesa/hudson/hudson.h b/src/southbridge/amd/agesa/hudson/hudson.h
index 6f757eb..9828ca0 100644
--- a/src/southbridge/amd/agesa/hudson/hudson.h
+++ b/src/southbridge/amd/agesa/hudson/hudson.h
@@ -2,6 +2,7 @@
* This file is part of the coreboot project.
*
* Copyright (C) 2010 Advanced Micro Devices, Inc.
+ * Copyright (C) 2014 Sage Electronic Engineering, LLC
*
* 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
@@ -51,6 +52,10 @@
#define REV_HUDSON_A12 0x12
#define SPIROM_BASE_ADDRESS_REGISTER 0xA0
+#define SPI_ROM_ENABLE 0x02
+#ifndef SPI_BASE_ADDRESS
+ #define SPI_BASE_ADDRESS 0xFEC10000
+#endif
#ifndef __SMM__
diff --git a/src/southbridge/amd/agesa/hudson/lpc.c b/src/southbridge/amd/agesa/hudson/lpc.c
index 71aaf6f..c8051ec 100644
--- a/src/southbridge/amd/agesa/hudson/lpc.c
+++ b/src/southbridge/amd/agesa/hudson/lpc.c
@@ -87,8 +87,6 @@ static void hudson_lpc_read_resources(device_t dev)
/* Get the normal pci resources of this device */
pci_dev_read_resources(dev); /* We got one for APIC, or one more for TRAP */
- pci_get_resource(dev, 0xA0); /* SPI ROM base address */
-
/* Add an extra subtractive resource for both memory and I/O. */
res = new_resource(dev, IOINDEX_SUBTRACTIVE(0, 0));
res->base = 0;
@@ -102,6 +100,9 @@ static void hudson_lpc_read_resources(device_t dev)
res->flags = IORESOURCE_MEM | IORESOURCE_SUBTRACTIVE |
IORESOURCE_ASSIGNED | IORESOURCE_FIXED;
+ /* Add a memory resource for the SPI BAR. */
+ fixed_mem_resource(dev, 2, SPI_BASE_ADDRESS / 1024, 1, IORESOURCE_SUBTRACTIVE);
+
res = new_resource(dev, 3); /* IOAPIC */
res->base = IO_APIC_ADDR;
res->size = 0x00001000;
@@ -115,12 +116,10 @@ static void hudson_lpc_set_resources(struct device *dev)
struct resource *res;
/* Special case. SPI Base Address. The SpiRomEnable should STAY set. */
- res = find_resource(dev, SPIROM_BASE_ADDRESS_REGISTER);
- res->base |= PCI_COMMAND_MEMORY;
+ res = find_resource(dev, 2);
+ pci_write_config32(dev, SPIROM_BASE_ADDRESS_REGISTER, res->base | SPI_ROM_ENABLE);
pci_dev_set_resources(dev);
-
-
}
/**
diff --git a/src/southbridge/amd/cimx/sb700/lpc.c b/src/southbridge/amd/cimx/sb700/lpc.c
index 91d7d2f..5d05762 100644
--- a/src/southbridge/amd/cimx/sb700/lpc.c
+++ b/src/southbridge/amd/cimx/sb700/lpc.c
@@ -46,8 +46,6 @@ void lpc_read_resources(device_t dev)
/* Get the normal pci resources of this device */
pci_dev_read_resources(dev); /* We got one for APIC, or one more for TRAP */
- pci_get_resource(dev, SPIROM_BASE_ADDRESS); /* SPI ROM base address */
-
/* Add an extra subtractive resource for both memory and I/O. */
res = new_resource(dev, IOINDEX_SUBTRACTIVE(0, 0));
res->base = 0;
@@ -61,6 +59,9 @@ void lpc_read_resources(device_t dev)
res->flags = IORESOURCE_MEM | IORESOURCE_SUBTRACTIVE |
IORESOURCE_ASSIGNED | IORESOURCE_FIXED;
+ /* Add a memory resource for the SPI BAR. */
+ fixed_mem_resource(dev, 2, SPI_BASE_ADDRESS / 1024, 1, IORESOURCE_SUBTRACTIVE);
+
res = new_resource(dev, 3);
res->base = IO_APIC_ADDR;
res->size = 0x00001000;
@@ -75,11 +76,13 @@ void lpc_set_resources(struct device *dev)
struct resource *res;
printk(BIOS_SPEW, "SB700 - Lpc.c - %s - Start.\n", __func__);
+
+ /* Special case. SPI Base Address. The SpiRomEnable should STAY set. */
+ res = find_resource(dev, 2);
+ pci_write_config32(dev, SPIROM_BASE_ADDRESS_REGISTER, res->base | SPI_ROM_ENABLE);
+
pci_dev_set_resources(dev);
- /* Specical case. SPI Base Address. The SpiRomEnable should be set. */
- res = find_resource(dev, SPIROM_BASE_ADDRESS);
- pci_write_config32(dev, SPIROM_BASE_ADDRESS, res->base | 1 << 1);
printk(BIOS_SPEW, "SB700 - Lpc.c - %s - End.\n", __func__);
}
diff --git a/src/southbridge/amd/cimx/sb700/lpc.h b/src/southbridge/amd/cimx/sb700/lpc.h
index e110026..055c6b3 100644
--- a/src/southbridge/amd/cimx/sb700/lpc.h
+++ b/src/southbridge/amd/cimx/sb700/lpc.h
@@ -21,7 +21,11 @@
#define _SB700_LPC_H_
-#define SPIROM_BASE_ADDRESS 0xA0 /* SPI ROM base address */
+#define SPIROM_BASE_ADDRESS_REGISTER 0xA0 /* SPI ROM base address */
+#define SPI_ROM_ENABLE 0x02
+#ifndef SPI_BASE_ADDRESS
+ #define SPI_BASE_ADDRESS 0xFEC10000
+#endif
void lpc_read_resources(device_t dev);
void lpc_set_resources(device_t dev);
diff --git a/src/southbridge/amd/cimx/sb800/lpc.c b/src/southbridge/amd/cimx/sb800/lpc.c
index a1e0dc9..519e3c1 100644
--- a/src/southbridge/amd/cimx/sb800/lpc.c
+++ b/src/southbridge/amd/cimx/sb800/lpc.c
@@ -2,6 +2,7 @@
* This file is part of the coreboot project.
*
* Copyright (C) 2011 Advanced Micro Devices, Inc.
+ * Copyright (C) 2014 Sage Electronic Engineering, LLC
*
* 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
@@ -33,8 +34,6 @@ void lpc_read_resources(device_t dev)
/* Get the normal pci resources of this device */
pci_dev_read_resources(dev); /* We got one for APIC, or one more for TRAP */
- pci_get_resource(dev, SPIROM_BASE_ADDRESS_REGISTER); /* SPI ROM base address */
-
/* Add an extra subtractive resource for both memory and I/O. */
res = new_resource(dev, IOINDEX_SUBTRACTIVE(0, 0));
res->base = 0;
@@ -48,6 +47,9 @@ void lpc_read_resources(device_t dev)
res->flags = IORESOURCE_MEM | IORESOURCE_SUBTRACTIVE |
IORESOURCE_ASSIGNED | IORESOURCE_FIXED;
+ /* Add a memory resource for the SPI BAR. */
+ fixed_mem_resource(dev, 2, SPI_BASE_ADDRESS / 1024, 1, IORESOURCE_SUBTRACTIVE);
+
res = new_resource(dev, 3);
res->base = IO_APIC_ADDR;
res->size = 0x00001000;
@@ -64,8 +66,8 @@ void lpc_set_resources(struct device *dev)
printk(BIOS_DEBUG, "SB800 - Lpc.c - lpc_set_resources - Start.\n");
/* Special case. SPI Base Address. The SpiRomEnable should STAY set. */
- res = find_resource(dev, SPIROM_BASE_ADDRESS_REGISTER);
- res->base |= PCI_COMMAND_MEMORY;
+ res = find_resource(dev, 2);
+ pci_write_config32(dev, SPIROM_BASE_ADDRESS_REGISTER, res->base | SPI_ROM_ENABLE);
pci_dev_set_resources(dev);
diff --git a/src/southbridge/amd/cimx/sb800/lpc.h b/src/southbridge/amd/cimx/sb800/lpc.h
index 575b9f7..45b10d9 100644
--- a/src/southbridge/amd/cimx/sb800/lpc.h
+++ b/src/southbridge/amd/cimx/sb800/lpc.h
@@ -2,6 +2,7 @@
* This file is part of the coreboot project.
*
* Copyright (C) 2011 Advanced Micro Devices, Inc.
+ * Copyright (C) 2014 Sage Electronic Engineering, LLC
*
* 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
@@ -20,7 +21,11 @@
#ifndef _SB800_LPC_H_
#define _SB800_LPC_H_
-#define SPIROM_BASE_ADDRESS_REGISTER 0xA0 /* SPI ROM base address */
+#define SPIROM_BASE_ADDRESS_REGISTER 0xA0 /* SPI ROM base address */
+#define SPI_ROM_ENABLE 0x02
+#ifndef SPI_BASE_ADDRESS
+ #define SPI_BASE_ADDRESS 0xFEC10000
+#endif
void lpc_read_resources(device_t dev);
void lpc_set_resources(device_t dev);
diff --git a/src/southbridge/amd/cimx/sb900/lpc.c b/src/southbridge/amd/cimx/sb900/lpc.c
index 5b414f4..ce1be11 100644
--- a/src/southbridge/amd/cimx/sb900/lpc.c
+++ b/src/southbridge/amd/cimx/sb900/lpc.c
@@ -31,8 +31,6 @@ void lpc_read_resources(device_t dev)
/* Get the normal pci resources of this device */
pci_dev_read_resources(dev); /* We got one for APIC, or one more for TRAP */
- pci_get_resource(dev, SPIROM_BASE_ADDRESS); /* SPI ROM base address */
-
/* Add an extra subtractive resource for both memory and I/O. */
res = new_resource(dev, IOINDEX_SUBTRACTIVE(0, 0));
res->base = 0;
@@ -46,6 +44,9 @@ void lpc_read_resources(device_t dev)
res->flags = IORESOURCE_MEM | IORESOURCE_SUBTRACTIVE |
IORESOURCE_ASSIGNED | IORESOURCE_FIXED;
+ /* Add a memory resource for the SPI BAR. */
+ fixed_mem_resource(dev, 2, SPI_BASE_ADDRESS / 1024, 1, IORESOURCE_SUBTRACTIVE);
+
res = new_resource(dev, 3);
res->base = IO_APIC_ADDR;
res->size = 0x00001000;
@@ -60,11 +61,13 @@ void lpc_set_resources(struct device *dev)
struct resource *res;
printk(BIOS_DEBUG, "SB900 - Lpc.c - lpc_set_resources - Start.\n");
+
+ /* Special case. SPI Base Address. The SpiRomEnable should STAY set. */
+ res = find_resource(dev, 2);
+ pci_write_config32(dev, SPIROM_BASE_ADDRESS_REGISTER, res->base | SPI_ROM_ENABLE);
+
pci_dev_set_resources(dev);
- /* Specical case. SPI Base Address. The SpiRomEnable should be set. */
- res = find_resource(dev, SPIROM_BASE_ADDRESS);
- pci_write_config32(dev, SPIROM_BASE_ADDRESS, res->base | 1 << 1);
printk(BIOS_DEBUG, "SB900 - Lpc.c - lpc_set_resources - End.\n");
}
diff --git a/src/southbridge/amd/cimx/sb900/lpc.h b/src/southbridge/amd/cimx/sb900/lpc.h
index c0c5f20..2c6307a 100644
--- a/src/southbridge/amd/cimx/sb900/lpc.h
+++ b/src/southbridge/amd/cimx/sb900/lpc.h
@@ -21,7 +21,11 @@
#define _SB900_LPC_H_
-#define SPIROM_BASE_ADDRESS 0xA0 /* SPI ROM base address */
+#define SPIROM_BASE_ADDRESS_REGISTER 0xA0 /* SPI ROM base address */
+#define SPI_ROM_ENABLE 0x02
+#ifndef SPI_BASE_ADDRESS
+ #define SPI_BASE_ADDRESS 0xFEC10000
+#endif
void lpc_read_resources(device_t dev);
void lpc_set_resources(device_t dev);
Dave Frodin (dave.frodin(a)se-eng.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/5946
-gerrit
commit 7c65ed8ceee7c5e21d5b3d732f7fe64c09bfb4ab
Author: Dave Frodin <dave.frodin(a)se-eng.com>
Date: Thu Jun 5 14:21:11 2014 -0600
amd/hudson: Add the IOAPIC space to the fixed resources table
Without this change the IOAPIC memory window would collide
with PCI config space. This was tested on the hp/abm board.
Change-Id: I5dd53463961f75bab80a41dc7beff8d0434b24ae
Signed-off-by: Dave Frodin <dave.frodin(a)se-eng.com>
---
src/southbridge/amd/agesa/hudson/lpc.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/src/southbridge/amd/agesa/hudson/lpc.c b/src/southbridge/amd/agesa/hudson/lpc.c
index a0dc072..71aaf6f 100644
--- a/src/southbridge/amd/agesa/hudson/lpc.c
+++ b/src/southbridge/amd/agesa/hudson/lpc.c
@@ -2,6 +2,7 @@
* This file is part of the coreboot project.
*
* Copyright (C) 2010 Advanced Micro Devices, Inc.
+ * Copyright (C) 2014 Sage Electronic Engineering, LLC
*
* 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
@@ -27,6 +28,7 @@
#include <pc80/mc146818rtc.h>
#include <pc80/isa-dma.h>
#include <arch/io.h>
+#include <arch/ioapic.h>
#include "hudson.h"
static void lpc_init(device_t dev)
@@ -100,10 +102,10 @@ static void hudson_lpc_read_resources(device_t dev)
res->flags = IORESOURCE_MEM | IORESOURCE_SUBTRACTIVE |
IORESOURCE_ASSIGNED | IORESOURCE_FIXED;
- //res = new_resource(dev, 3); /* IOAPIC */
- //res->base = 0xfec00000;
- //res->size = 0x00001000;
- //res->flags = IORESOURCE_MEM | IORESOURCE_ASSIGNED | IORESOURCE_FIXED;
+ res = new_resource(dev, 3); /* IOAPIC */
+ res->base = IO_APIC_ADDR;
+ res->size = 0x00001000;
+ res->flags = IORESOURCE_MEM | IORESOURCE_ASSIGNED | IORESOURCE_FIXED;
compact_resources(dev);
}
Dave Frodin (dave.frodin(a)se-eng.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/5945
-gerrit
commit c7aa17a204fdbc48ce93299cc9908fd646fda01b
Author: Dave Frodin <dave.frodin(a)se-eng.com>
Date: Fri Jun 6 06:52:28 2014 -0600
amd/family16kb: Move and resize the MMIO region
The Kabini MMIO region was assigned a 256MB region at
0xA0000000. That location is below TOP_MEM and is getting
carved out of useable system memory which is not being
reclaimed above 4GB. This changes its size to 64MB and
moves it to 0xF8000000.
This was tested on the hp/abm and asrock/imb-a180 boards.
Change-Id: Ib226bc954311a3a2a15f182ab4618f4924e95a5b
Signed-off-by: Dave Frodin <dave.frodin(a)se-eng.com>
---
src/northbridge/amd/agesa/family16kb/Kconfig | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/northbridge/amd/agesa/family16kb/Kconfig b/src/northbridge/amd/agesa/family16kb/Kconfig
index 259195b..466414c 100644
--- a/src/northbridge/amd/agesa/family16kb/Kconfig
+++ b/src/northbridge/amd/agesa/family16kb/Kconfig
@@ -2,6 +2,7 @@
## This file is part of the coreboot project.
##
## Copyright (C) 2007-2009 coresystems GmbH
+## Copyright (C) 2014 Sage Electronic Engineering, LLC
##
## 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
@@ -32,11 +33,11 @@ config HW_MEM_HOLE_SIZE_AUTO_INC
config MMCONF_BASE_ADDRESS
hex
- default 0xA0000000
+ default 0xF8000000
config MMCONF_BUS_NUMBER
int
- default 256
+ default 64
config VGA_BIOS_ID
string
Bruce Griffith (Bruce.Griffith(a)se-eng.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/5966
-gerrit
commit 5e396b2e42a2e6484022cac308cf8a264a2000be
Author: Bruce Griffith <Bruce.Griffith(a)se-eng.com>
Date: Tue Jun 10 01:50:20 2014 -0600
Super I/O: Add support for Fintek F81216H
A new Fintek Super I/O chip will be used on an upcoming AMD development
board. Use the Fintek common directories to enable the serial ports
on the new device.
Change-Id: Ie6b86db6a0f654265c06deed89d2e20bae266e80
Signed-off-by: Bruce Griffith <Bruce.Griffith(a)se-eng.com>
---
src/superio/fintek/Kconfig | 3 +
src/superio/fintek/Makefile.inc | 1 +
src/superio/fintek/f81216h/Makefile.inc | 21 +++++++
src/superio/fintek/f81216h/f81216h.h | 34 +++++++++++
src/superio/fintek/f81216h/superio.c | 102 ++++++++++++++++++++++++++++++++
5 files changed, 161 insertions(+)
diff --git a/src/superio/fintek/Kconfig b/src/superio/fintek/Kconfig
index f577898..cd72c0a 100644
--- a/src/superio/fintek/Kconfig
+++ b/src/superio/fintek/Kconfig
@@ -50,3 +50,6 @@ config SUPERIO_FINTEK_F71889
config SUPERIO_FINTEK_F81865F
bool
select SUPERIO_FINTEK_COMMON_ROMSTAGE
+config SUPERIO_FINTEK_F81216H
+ bool
+ select SUPERIO_FINTEK_COMMON_ROMSTAGE
diff --git a/src/superio/fintek/Makefile.inc b/src/superio/fintek/Makefile.inc
index 1b11336..8d64f64 100644
--- a/src/superio/fintek/Makefile.inc
+++ b/src/superio/fintek/Makefile.inc
@@ -27,3 +27,4 @@ subdirs-y += f71869ad
subdirs-y += f71872
subdirs-y += f71889
subdirs-y += f81865f
+subdirs-y += f81216h
diff --git a/src/superio/fintek/f81216h/Makefile.inc b/src/superio/fintek/f81216h/Makefile.inc
new file mode 100644
index 0000000..73bc84f
--- /dev/null
+++ b/src/superio/fintek/f81216h/Makefile.inc
@@ -0,0 +1,21 @@
+##
+## This file is part of the coreboot project.
+##
+## Copyright (C) 2011 Advanced Micro Devices, Inc.
+##
+## 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
+##
+
+ramstage-$(CONFIG_SUPERIO_FINTEK_F81216H) += superio.c
diff --git a/src/superio/fintek/f81216h/f81216h.h b/src/superio/fintek/f81216h/f81216h.h
new file mode 100644
index 0000000..b57ad4f
--- /dev/null
+++ b/src/superio/fintek/f81216h/f81216h.h
@@ -0,0 +1,34 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2011 Advanced Micro Devices, Inc.
+ *
+ * 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
+ */
+
+/*
+ * Datasheet:
+ * - Name: F81216H
+ */
+#ifndef SUPERIO_FINTEK_F81216_H
+#define SUPERIO_FINTEK_F81216_H
+
+/* Logical Device Numbers (LDN). */
+#define F81216H_SP1 0x00 /* UART1 */
+#define F81216H_SP2 0x01 /* UART2 */
+#define F81216H_SP3 0x02 /* UART3 */
+#define F81216H_SP4 0x03 /* UART4 */
+
+#endif
diff --git a/src/superio/fintek/f81216h/superio.c b/src/superio/fintek/f81216h/superio.c
new file mode 100644
index 0000000..02b5976
--- /dev/null
+++ b/src/superio/fintek/f81216h/superio.c
@@ -0,0 +1,102 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2011 Advanced Micro Devices, Inc.
+ *
+ * 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 <stdlib.h>
+#include "f81216h.h"
+
+static void pnp_enter_conf_state(device_t dev)
+{
+ outb(0x77, dev->path.pnp.port);
+ outb(0x77, dev->path.pnp.port);
+}
+
+static void pnp_exit_conf_state(device_t dev)
+{
+ outb(0xaa, dev->path.pnp.port);
+}
+
+static void f81216h_init(device_t dev)
+{
+ struct superio_fintek_f81216h_config *conf = dev->chip_info;
+
+ if (!dev->enabled)
+ return;
+
+ switch (dev->path.pnp.device) {
+ /* TODO: Might potentially need code for HWM or FDC etc. */
+ case F81216H_SP1:
+ case F81216H_SP2:
+ case F81216H_SP3:
+ case F81216H_SP4:
+ break;
+ }
+}
+
+static void f81216h_pnp_set_resources(device_t dev)
+{
+ pnp_enter_conf_state(dev);
+ pnp_set_resources(dev);
+ pnp_exit_conf_state(dev);
+}
+
+static void f81216h_pnp_enable_resources(device_t dev)
+{
+ pnp_enter_conf_state(dev);
+ pnp_enable_resources(dev);
+ pnp_exit_conf_state(dev);
+}
+
+static void f81216h_pnp_enable(device_t dev)
+{
+ pnp_enter_conf_state(dev);
+ pnp_set_logical_device(dev);
+ (dev->enabled) ? pnp_set_enable(dev, 1) : pnp_set_enable(dev, 0);
+ pnp_exit_conf_state(dev);
+}
+
+static struct device_operations ops = {
+ .read_resources = pnp_read_resources,
+ .set_resources = f81216h_pnp_set_resources,
+ .enable_resources = f81216h_pnp_enable_resources,
+ .enable = f81216h_pnp_enable,
+ .init = f81216h_init,
+};
+
+static struct pnp_info pnp_dev_info[] = {
+ /* TODO: Some of the 0x7f8 etc. values may not be correct. */
+ { &ops, F81216H_SP1, PNP_IO0 | PNP_IRQ0, { 0x7f8, 0 }, },
+ { &ops, F81216H_SP2, PNP_IO0 | PNP_IRQ0, { 0x7f8, 0 }, },
+// { &ops, F81216H_SP3, PNP_IO0 | PNP_IRQ0, { 0x7f8, 0 }, },
+// { &ops, F81216H_SP4, PNP_IO0 | PNP_IRQ0, { 0x7f8, 0 }, },
+};
+
+static void enable_dev(device_t dev)
+{
+ pnp_enable_devices(dev, &ops, ARRAY_SIZE(pnp_dev_info), pnp_dev_info);
+}
+
+struct chip_operations superio_fintek_f81216h_ops = {
+ CHIP_NAME("Fintek F81216H Super I/O")
+ .enable_dev = enable_dev
+};