Paul Menzel (paulepanter(a)users.sourceforge.net) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/17994
-gerrit
commit 9b3921828af3441011de3235a431f53dbd16b5b3
Author: Paul Menzel <paulepanter(a)users.sourceforge.net>
Date: Thu Dec 29 22:46:12 2016 +0100
intel/i945: Factor out ram init time stamps
Instead of having the code for the RAM init time stamps in each mainboard’s
`romstage.c`, factor it out to the northbridge code.
Change-Id: Ibb699a1fea2f0b1f3c6564d401542d2fb3249f5a
Signed-off-by: Paul Menzel <paulepanter(a)users.sourceforge.net>
---
src/mainboard/gigabyte/ga-945gcm-s2l/romstage.c | 2 --
src/mainboard/lenovo/t60/romstage.c | 2 --
src/mainboard/lenovo/x60/romstage.c | 2 --
3 files changed, 6 deletions(-)
diff --git a/src/mainboard/gigabyte/ga-945gcm-s2l/romstage.c b/src/mainboard/gigabyte/ga-945gcm-s2l/romstage.c
index 62729a7..a2bbb47 100644
--- a/src/mainboard/gigabyte/ga-945gcm-s2l/romstage.c
+++ b/src/mainboard/gigabyte/ga-945gcm-s2l/romstage.c
@@ -206,9 +206,7 @@ void mainboard_romstage_entry(unsigned long bist)
dump_spd_registers();
#endif
- timestamp_add_now(TS_BEFORE_INITRAM);
sdram_initialize(s3resume ? 2 : boot_mode, NULL);
- timestamp_add_now(TS_AFTER_INITRAM);
/* Perform some initialization that must run before stage2 */
early_ich7_init();
diff --git a/src/mainboard/lenovo/t60/romstage.c b/src/mainboard/lenovo/t60/romstage.c
index d3cd90c..e9ac79c 100644
--- a/src/mainboard/lenovo/t60/romstage.c
+++ b/src/mainboard/lenovo/t60/romstage.c
@@ -263,9 +263,7 @@ void mainboard_romstage_entry(unsigned long bist)
dump_spd_registers();
#endif
- timestamp_add_now(TS_BEFORE_INITRAM);
sdram_initialize(s3resume ? 2 : 0, spd_addrmap);
- timestamp_add_now(TS_AFTER_INITRAM);
/* Perform some initialization that must run before stage2 */
early_ich7_init();
diff --git a/src/mainboard/lenovo/x60/romstage.c b/src/mainboard/lenovo/x60/romstage.c
index 53a0151..c8f27a2 100644
--- a/src/mainboard/lenovo/x60/romstage.c
+++ b/src/mainboard/lenovo/x60/romstage.c
@@ -268,9 +268,7 @@ void mainboard_romstage_entry(unsigned long bist)
dump_spd_registers();
#endif
- timestamp_add_now(TS_BEFORE_INITRAM);
sdram_initialize(s3resume ? 2 : 0, spd_addrmap);
- timestamp_add_now(TS_AFTER_INITRAM);
/* Perform some initialization that must run before stage2 */
early_ich7_init();
Martin Roth (martinroth(a)google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/17992
-gerrit
commit 160d6d2ec338f91651fbb8910c17ebd885856d76
Author: Martin Roth <martinroth(a)google.com>
Date: Thu Dec 29 14:03:50 2016 -0700
amdmct: Rewrite mct_ResetDataStruct_D to avoid array-bounds warning
The code was intentionally using an offset past the end of the array to
get the value of the next byte when starting to clear the structure.
Rewrite it to get the end of the array and then increment the starting
value.
Fixes warning for GCC 6.2 toolchain update:
src/northbridge/amd/amdfam10/../amdmct/mct/mct_d.c:3628:27:
In function 'mct_ResetDataStruct_D':
error: index 2 denotes an offset greater than size of 'u8[2][4]
{aka unsigned char[2][4]}' [-Werror=array-bounds]
Change-Id: Ic81cf5e57992fc0e45f6c96b62a35742a8ef891f
Signed-off-by: Martin Roth <martinroth(a)google.com>
---
src/northbridge/amd/amdmct/mct/mct_d.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/northbridge/amd/amdmct/mct/mct_d.c b/src/northbridge/amd/amdmct/mct/mct_d.c
index 62fc626..b45bf1c 100644
--- a/src/northbridge/amd/amdmct/mct/mct_d.c
+++ b/src/northbridge/amd/amdmct/mct/mct_d.c
@@ -3625,9 +3625,9 @@ static void mct_ResetDataStruct_D(struct MCTStatStruc *pMCTstat,
p[i] = 0;
}
- start = (u32)(&((struct DCTStatStruc *)0)->CH_D_BC_RCVRDLY[2][4]);
+ start = (u32)(&((struct DCTStatStruc *)0)->CH_D_BC_RCVRDLY[2][3]);
stop = sizeof(struct DCTStatStruc);
- for (i = start; i < stop; i++) {
+ for (i = start + 1; i < stop; i++) {
p[i] = 0;
}
pDCTstat->HostBiosSrvc1 = host_serv1;
Ricardo Ribalda Delgado (ricardo.ribalda(a)gmail.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/17980
-gerrit
commit bbef554d77b0eecb0b785e78a4f5a93bbcf6b31e
Author: Ricardo Ribalda Delgado <ricardo.ribalda(a)gmail.com>
Date: Wed Dec 28 15:16:22 2016 +0100
amd/pi: Make BottomIo position configurable
Some PCI peripherals, such as FPGA accelerators, require a great amount
of memory mapped IO. This patch allows the user to select at build time
the bottom IO to leave enough space for such devices.
We cannot calculate this value at runtime because it has to be set
before the PCI devices are enumerated.
Change-Id: Ic590e8aa8b91ff89877cbff6afd10614d33dcf8d
Credit-to: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda(a)gmail.com>
---
src/northbridge/amd/pi/Kconfig | 12 ++++++++++++
src/northbridge/amd/pi/agesawrapper.c | 3 ++-
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/src/northbridge/amd/pi/Kconfig b/src/northbridge/amd/pi/Kconfig
index 122b0e6..f5f36f8 100644
--- a/src/northbridge/amd/pi/Kconfig
+++ b/src/northbridge/amd/pi/Kconfig
@@ -20,6 +20,18 @@ config NORTHBRIDGE_AMD_PI
if NORTHBRIDGE_AMD_PI
+config BOTTOMIO_POSITION
+ hex "Bottom of 32-bit IO space"
+ default 0xD0000000
+ help
+ If PCI peripherals with big BARs are connected to the system
+ the bottom of the IO must be decreased to allocate such
+ devices.
+
+ Declare the beginning of the 128MB-aligned MMIO region. This
+ option is useful when PCI peripherals requesting large address
+ ranges are present.
+
config CONSOLE_VGA_MULTI
bool
default n
diff --git a/src/northbridge/amd/pi/agesawrapper.c b/src/northbridge/amd/pi/agesawrapper.c
index 8e16e75..0fe8eab 100644
--- a/src/northbridge/amd/pi/agesawrapper.c
+++ b/src/northbridge/amd/pi/agesawrapper.c
@@ -140,7 +140,8 @@ AGESA_STATUS agesawrapper_amdinitpost(void)
// the compiler to flag the error if CONFIG_GFXUMA is not set.
PostParams->MemConfig.UmaMode = CONFIG_GFXUMA ? UMA_AUTO : UMA_NONE;
PostParams->MemConfig.UmaSize = 0;
- PostParams->MemConfig.BottomIo = (UINT16)(0xD0000000 >> 24);
+ PostParams->MemConfig.BottomIo = (UINT16)
+ (CONFIG_BOTTOMIO_POSITION >> 24);
status = AmdInitPost (PostParams);
printk(
BIOS_SPEW,
Ricardo Ribalda Delgado (ricardo.ribalda(a)gmail.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/17980
-gerrit
commit a2bd1c96fdd2933062f3551ef3022634296da740
Author: Ricardo Ribalda Delgado <ricardo.ribalda(a)gmail.com>
Date: Wed Dec 28 15:16:22 2016 +0100
amd/pi: Make BottomIo position configurable
Some PCI peripherals, such as FPGA accelerators, require a great amount
of memory mapped IO. This patch allows the user to select at build time
the bottom IO to leave enough space for such devices.
We cannot calculate this value at runtime because it has to be set
before the PCI devices are enumerated.
Change-Id: Ic590e8aa8b91ff89877cbff6afd10614d33dcf8d
Credit-to: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda(a)gmail.com>
---
src/northbridge/amd/pi/Kconfig | 11 +++++++++++
src/northbridge/amd/pi/agesawrapper.c | 3 ++-
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/src/northbridge/amd/pi/Kconfig b/src/northbridge/amd/pi/Kconfig
index 122b0e6..a4a3539 100644
--- a/src/northbridge/amd/pi/Kconfig
+++ b/src/northbridge/amd/pi/Kconfig
@@ -20,6 +20,17 @@ config NORTHBRIDGE_AMD_PI
if NORTHBRIDGE_AMD_PI
+config BOTTOMIO_POSITION
+ hex "Bottom of 32-bit IO space"
+ default 0xD0000000
+ help
+ If PCI peripherals with big BARs are connected to the system
+ the bottom of the IO must be decreased to allocated such
+ devices.
+
+ Please note that the last 24 bits of this parameter are ignored
+ by AGESA.
+
config CONSOLE_VGA_MULTI
bool
default n
diff --git a/src/northbridge/amd/pi/agesawrapper.c b/src/northbridge/amd/pi/agesawrapper.c
index 8e16e75..0fe8eab 100644
--- a/src/northbridge/amd/pi/agesawrapper.c
+++ b/src/northbridge/amd/pi/agesawrapper.c
@@ -140,7 +140,8 @@ AGESA_STATUS agesawrapper_amdinitpost(void)
// the compiler to flag the error if CONFIG_GFXUMA is not set.
PostParams->MemConfig.UmaMode = CONFIG_GFXUMA ? UMA_AUTO : UMA_NONE;
PostParams->MemConfig.UmaSize = 0;
- PostParams->MemConfig.BottomIo = (UINT16)(0xD0000000 >> 24);
+ PostParams->MemConfig.BottomIo = (UINT16)
+ (CONFIG_BOTTOMIO_POSITION >> 24);
status = AmdInitPost (PostParams);
printk(
BIOS_SPEW,
Patrick Agrain (patrick.agrain(a)al-enterprise.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/17988
-gerrit
commit 66d19a95abc0fc8b2670c1cb05bf8e2825bd5949
Author: Patrick Agrain <patrick.agrain(a)al-enterprise.com>
Date: Thu Dec 29 01:17:48 2016 -0800
[WIP] Required to test EXAR superIO chip XR28V382
These modifications have been performed to be able to test the EXAR
superIO chip XR28V382 on an Intel Mohon Peak CRB.
This should also allow reviewers to check if nothing is missing.
DO NOT MERGE.
Change-Id: Ib76d5dff822ab9e6524dd11cd9dd026bef7315cd
Signed-off-by: Patrick Agrain <patrick.agrain(a)al-enterprise.com>
---
src/mainboard/intel/mohonpeak/Kconfig | 3 ++-
src/mainboard/intel/mohonpeak/devicetree.cb | 8 ++++++++
src/mainboard/intel/mohonpeak/romstage.c | 1 +
src/superio/Makefile.inc | 1 +
4 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/src/mainboard/intel/mohonpeak/Kconfig b/src/mainboard/intel/mohonpeak/Kconfig
index 38c9976..18b3a75 100644
--- a/src/mainboard/intel/mohonpeak/Kconfig
+++ b/src/mainboard/intel/mohonpeak/Kconfig
@@ -25,6 +25,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy
select HAVE_OPTION_TABLE
select POST_IO
select HAVE_FSP_BIN if FSP_PACKAGE_DEFAULT
+ select SUPERIO_EXAR_XR28V382
config MAINBOARD_DIR
string
@@ -44,7 +45,7 @@ config CACHE_ROM_SIZE_OVERRIDE
config FSP_FILE
string
- default "../intel/fsp/rangeley/FvFsp.bin"
+ default "./intel/fsp/FvFsp.bin"
config CBFS_SIZE
hex
diff --git a/src/mainboard/intel/mohonpeak/devicetree.cb b/src/mainboard/intel/mohonpeak/devicetree.cb
index 1df54d3..c0e977f 100644
--- a/src/mainboard/intel/mohonpeak/devicetree.cb
+++ b/src/mainboard/intel/mohonpeak/devicetree.cb
@@ -58,6 +58,14 @@ chip northbridge/intel/fsp_rangeley
device pci 17.0 on end # SATA 2.0
device pci 18.0 on end # SATA 3.0
device pci 1f.0 on end # LPC bridge
+ chip superio/exar/xr28v382 # Super I/O
+ device pnp 2e.0 on # COM 1
+ io 0x60 = 0x3f8
+ irq 0x70 = 4
+ end
+ device pnp 2e.1 off end # COM 2
+ device pnp 2e.8 off end # Watchdog
+ end
device pci 1f.3 on end # SMBus 0
end
end
diff --git a/src/mainboard/intel/mohonpeak/romstage.c b/src/mainboard/intel/mohonpeak/romstage.c
index c7c78e2..671b5f5 100644
--- a/src/mainboard/intel/mohonpeak/romstage.c
+++ b/src/mainboard/intel/mohonpeak/romstage.c
@@ -24,6 +24,7 @@
#include <southbridge/intel/fsp_rangeley/gpio.h>
#include <southbridge/intel/fsp_rangeley/romstage.h>
#include <arch/cpu.h>
+#include <superio/exar/xr28v382/xr28v382.h>
#include "gpio.h"
static void interrupt_routing_config(void)
diff --git a/src/superio/Makefile.inc b/src/superio/Makefile.inc
index 5fc0ecd..89d2ff4 100644
--- a/src/superio/Makefile.inc
+++ b/src/superio/Makefile.inc
@@ -13,6 +13,7 @@
## GNU General Public License for more details.
##
+subdirs-y += exar
subdirs-y += fintek
subdirs-y += intel
subdirs-y += ite
Patrick Agrain (patrick.agrain(a)al-enterprise.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/17987
-gerrit
commit 1bb560449aca9820f8930df15448c1f39b2b2ff3
Author: Patrick Agrain <patrick.agrain(a)al-enterprise.com>
Date: Thu Dec 29 01:06:21 2016 -0800
[WIP] Add Exar superIO chip XR28V382
This commit is to push new code to support the superIO chip from Exar
XR28V382 in the coreboot source tree and to allow reviewers to tell
what could be missing.
First test shows following messages on console (DEBUG level):
PCI: Static device PCI: 00:01.0 not found, disabling it.
child PNP: 002e.0 not a PCI device
And later...
PCI: Left over static devices:
PNP: 002e.0
PNP: 002e.1
PNP: 002e.8
PCI: Check your devicetree.cb.
PCI: pci_scan_bus for bus 01
Change-Id: Iabb5eec22d831369b41c5c8df47a1f55b5724ffe
---
src/superio/exar/Makefile.inc | 17 ++++++
src/superio/exar/xr28v382/Kconfig | 20 +++++++
src/superio/exar/xr28v382/Makefile.inc | 19 +++++++
src/superio/exar/xr28v382/early_init.c | 67 ++++++++++++++++++++++++
src/superio/exar/xr28v382/superio.c | 96 ++++++++++++++++++++++++++++++++++
src/superio/exar/xr28v382/xr28v382.h | 43 +++++++++++++++
6 files changed, 262 insertions(+)
diff --git a/src/superio/exar/Makefile.inc b/src/superio/exar/Makefile.inc
new file mode 100644
index 0000000..862617b
--- /dev/null
+++ b/src/superio/exar/Makefile.inc
@@ -0,0 +1,17 @@
+##
+## This file is part of the coreboot project.
+##
+## Copyright (C) 2009 Ronald G. Minnich
+##
+## 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; version 2 of the License.
+##
+## 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.
+##
+
+subdirs-y += xr28v382
+
diff --git a/src/superio/exar/xr28v382/Kconfig b/src/superio/exar/xr28v382/Kconfig
new file mode 100644
index 0000000..22311b5
--- /dev/null
+++ b/src/superio/exar/xr28v382/Kconfig
@@ -0,0 +1,20 @@
+##
+## This file is part of the coreboot project.
+##
+## Copyright (C) 2009 Ronald G. Minnich
+## Copyright (C) 2014 Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
+##
+## 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; version 2 of the License.
+##
+## 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.
+##
+
+config SUPERIO_EXAR_XR28V382
+ bool
+ default y
+
diff --git a/src/superio/exar/xr28v382/Makefile.inc b/src/superio/exar/xr28v382/Makefile.inc
new file mode 100644
index 0000000..0c59263
--- /dev/null
+++ b/src/superio/exar/xr28v382/Makefile.inc
@@ -0,0 +1,19 @@
+##
+## This file is part of the coreboot project.
+##
+## Copyright (C) 2016 Patrick Agrain <patrick.agrain(a)al-enterprise.com>
+##
+## 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.
+##
+
+romstage-$(CONFIG_SUPERIO_EXAR_XR28V382) += early_init.c
+ramstage-$(CONFIG_SUPERIO_EXAR_XR28V382) += superio.c
+
diff --git a/src/superio/exar/xr28v382/early_init.c b/src/superio/exar/xr28v382/early_init.c
new file mode 100644
index 0000000..2c72647
--- /dev/null
+++ b/src/superio/exar/xr28v382/early_init.c
@@ -0,0 +1,67 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2008 Arastra, 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.
+ */
+
+#include <arch/io.h>
+#include <device/pnp.h>
+#include <stdint.h>
+#include "xr28v382.h"
+
+static void pnp_enter_ext_func_mode(pnp_devfn_t dev)
+{
+ u16 port = dev >> 8;
+
+ outb(0x67, port);
+ outb(0x67, port);
+}
+
+static void pnp_exit_ext_func_mode(pnp_devfn_t dev)
+{
+ u16 port = dev >> 8;
+
+ outb(0xAA, port);
+}
+
+void xr28v382_setup_chip(pnp_devfn_t dev)
+{
+ u8 reg8;
+
+ pnp_enter_ext_func_mode(dev);
+
+ /* Setup Input Clock - 24MHz */
+ reg8 = pnp_read_config(dev, XR28V382_CLKSEL_REG);
+ reg8 &= 0xFE;
+ pnp_write_config(dev, XR28V382_CLKSEL_REG, reg8);
+
+ /* Setup Entry key - 0x67 */
+ /* Setup Configuration Port - 0x2E/0x2F */
+ reg8 = pnp_read_config(dev, XR28V382_PORT_SEL_REG);
+ reg8 |= 0x03; /* [1-0] = '11' */
+ reg8 &= 0xEF; /* [4] = '0' */
+ pnp_write_config(dev, XR28V382_PORT_SEL_REG, reg8);
+
+ pnp_exit_ext_func_mode(dev);
+}
+
+void xr28v382_enable_serial(pnp_devfn_t dev, u16 iobase)
+{
+ pnp_enter_ext_func_mode(dev);
+ pnp_set_logical_device(dev);
+ pnp_set_enable(dev, 0);
+ pnp_set_iobase(dev, PNP_IDX_IO0, iobase);
+ pnp_set_enable(dev, 1);
+ pnp_exit_ext_func_mode(dev);
+}
+
diff --git a/src/superio/exar/xr28v382/superio.c b/src/superio/exar/xr28v382/superio.c
new file mode 100644
index 0000000..0e07cdd
--- /dev/null
+++ b/src/superio/exar/xr28v382/superio.c
@@ -0,0 +1,96 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2016 Patrick Agrain <patrick.agrain(a)al-enterprise.com>
+ *
+ * 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.
+ */
+
+#include <device/device.h>
+#include <device/pnp.h>
+#include <console/console.h>
+#include <pc80/keyboard.h>
+#include <arch/io.h>
+#include <stdlib.h>
+#include <superio/conf_mode.h>
+
+#include "xr28v382.h"
+
+static void pnp_enter_ext_func_mode(struct device *dev)
+{
+ outb(0x67, dev->path.pnp.port);
+ outb(0x67, dev->path.pnp.port);
+}
+
+static void pnp_exit_ext_func_mode(struct device *dev)
+{
+ outb(0xAA, dev->path.pnp.port);
+}
+
+static void xr28v382_init(struct device *dev)
+{
+ u16 did;
+
+ printk(BIOS_DEBUG, "EXAR: Enter init()\n");
+
+ if (!dev->enabled)
+ return;
+
+ switch (dev->path.pnp.device) {
+ case XR28V382_SP1:
+ pnp_enter_ext_func_mode(dev);
+ outb(0x20, dev->path.pnp.port);
+ did = (inb(dev->path.pnp.port+1) << 8);
+ outb(0x21, dev->path.pnp.port);
+ did |= inb(dev->path.pnp.port+1);
+ pnp_exit_ext_func_mode(dev);
+ printk(BIOS_DEBUG, "EXAR: Get Device ID 0x%04x\n", did);
+ break;
+ case XR28V382_SP2:
+ /* TODO */
+ break;
+ case XR28V382_WDT:
+ /* TODO */
+ break;
+ }
+}
+
+static const struct pnp_mode_ops pnp_conf_mode_xr28v382 = {
+ .enter_conf_mode = pnp_enter_ext_func_mode,
+ .exit_conf_mode = pnp_exit_ext_func_mode,
+};
+
+static struct device_operations ops = {
+ .read_resources = pnp_read_resources,
+ .set_resources = pnp_set_resources,
+ .enable_resources = pnp_enable_resources,
+ .enable = pnp_alt_enable,
+ .init = xr28v382_init,
+ .ops_pnp_mode = &pnp_conf_mode_xr28v382,
+};
+
+static struct pnp_info pnp_dev_info[] = {
+ { &ops, XR28V382_SP1, PNP_IO0 | PNP_IRQ0, {0x07f8, 0}, },
+ { &ops, XR28V382_SP2, PNP_IO0 | PNP_IRQ0, {0x07f8, 0}, },
+ { &ops, XR28V382_WDT, },
+};
+
+static void enable_dev(struct device *dev)
+{
+ pnp_enable_devices(dev, &ops, ARRAY_SIZE(pnp_dev_info), pnp_dev_info);
+}
+
+struct chip_operations superio_exar_xr28v382_ops = {
+ CHIP_NAME("EXAR XR28V382 Super I/O")
+ .enable_dev = enable_dev,
+};
+
+
diff --git a/src/superio/exar/xr28v382/xr28v382.h b/src/superio/exar/xr28v382/xr28v382.h
new file mode 100644
index 0000000..51664c8
--- /dev/null
+++ b/src/superio/exar/xr28v382/xr28v382.h
@@ -0,0 +1,43 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2016 Patrick Agrain <patrick.agrain(a)al-enterprise.com>
+ *
+ * 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_EXAR_XR28V382_H
+#define SUPERIO_EXAR_XR28V382_H
+
+#include <stdint.h>
+
+/* Datasheet: https://www.exar.com/content/document.ashx?id=21367 */
+
+#define XR28V382_SP1 0x00 /* Com1 */
+#define XR28V382_SP2 0x01 /* Com2 */
+#define XR28V382_WDT 0x08 /* Watchdog */
+
+/* Registers and bit definitions: */
+#define XR28V382_SW_RESET_REG 0x02
+#define XR28V382_LDN_REG 0x07
+#define XR28V382_DID_MSB_REG 0x20
+#define XR28V382_DID_LSB_REG 0x21
+#define XR28V382_VID_MSB 0x23
+#define XR28V382_VID_LSB 0x24
+#define XR28V382_CLKSEL_REG 0x25
+#define XR28V382_WDTCTRL_REG 0x26
+#define XR28V382_PORT_SEL_REG 0x27
+
+void xr28v382_enable_serial(pnp_devfn_t dev, u16 iobase);
+void xr28v382_setup_chip(pnp_devfn_t dev);
+
+#endif /* SUPERIO_EXAR_XR28V382_H */
+