Vladimir Serbinenko (phcoder(a)gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/7203
-gerrit
commit b5471cc47ad136711aec8731a31c8d70291be924
Author: Vladimir Serbinenko <phcoder(a)gmail.com>
Date: Mon Oct 27 02:45:22 2014 +0100
lenovo/x2[23]0: Handle Ricoh SD cardreader
Change-Id: Id0aecbd3e45bdf9661168ebd0e55f17dc6febaaa
Signed-off-by: Vladimir Serbinenko <phcoder(a)gmail.com>
---
src/drivers/Kconfig | 1 +
src/drivers/Makefile.inc | 1 +
src/drivers/ricoh/rce822/Kconfig | 3 ++
src/drivers/ricoh/rce822/Makefile.inc | 1 +
src/drivers/ricoh/rce822/chip.h | 29 ++++++++++++
src/drivers/ricoh/rce822/rce822.c | 79 +++++++++++++++++++++++++++++++++
src/mainboard/lenovo/x220/Kconfig | 1 +
src/mainboard/lenovo/x220/devicetree.cb | 11 ++---
src/mainboard/lenovo/x230/Kconfig | 1 +
src/mainboard/lenovo/x230/devicetree.cb | 11 ++---
10 files changed, 128 insertions(+), 10 deletions(-)
diff --git a/src/drivers/Kconfig b/src/drivers/Kconfig
index 42d1583..12f9a79 100644
--- a/src/drivers/Kconfig
+++ b/src/drivers/Kconfig
@@ -39,3 +39,4 @@ source src/drivers/trident/Kconfig
source src/drivers/uart/Kconfig
source src/drivers/usb/Kconfig
source src/drivers/xpowers/Kconfig
+source src/drivers/ricoh/rce822/Kconfig
diff --git a/src/drivers/Makefile.inc b/src/drivers/Makefile.inc
index cb26643..7ae3eb2 100644
--- a/src/drivers/Makefile.inc
+++ b/src/drivers/Makefile.inc
@@ -38,3 +38,4 @@ subdirs-y += ipmi
subdirs-y += elog
subdirs-y += xpowers
subdirs-$(CONFIG_ARCH_X86) += pc80
+subdirs-y += ricoh/rce822
diff --git a/src/drivers/ricoh/rce822/Kconfig b/src/drivers/ricoh/rce822/Kconfig
new file mode 100644
index 0000000..6b0c790
--- /dev/null
+++ b/src/drivers/ricoh/rce822/Kconfig
@@ -0,0 +1,3 @@
+config DRIVERS_RICOH_RCE822
+ bool
+ default n
diff --git a/src/drivers/ricoh/rce822/Makefile.inc b/src/drivers/ricoh/rce822/Makefile.inc
new file mode 100644
index 0000000..738bd0e
--- /dev/null
+++ b/src/drivers/ricoh/rce822/Makefile.inc
@@ -0,0 +1 @@
+ramstage-$(CONFIG_DRIVERS_RICOH_RCE822) += rce822.c
diff --git a/src/drivers/ricoh/rce822/chip.h b/src/drivers/ricoh/rce822/chip.h
new file mode 100644
index 0000000..cfed32e
--- /dev/null
+++ b/src/drivers/ricoh/rce822/chip.h
@@ -0,0 +1,29 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2014 Vladimir Serbinenko
+ *
+ * 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.
+ *
+ * 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
+ */
+
+#ifndef DRIVERS_RICOH_RC822_CHIP_H
+#define DRIVERS_RICOH_RC822_CHIP_H
+
+struct drivers_ricoh_rce822_config {
+ u8 sdwppol:1;
+ u8 disable_mask;
+};
+
+#endif
diff --git a/src/drivers/ricoh/rce822/rce822.c b/src/drivers/ricoh/rce822/rce822.c
new file mode 100644
index 0000000..2383f4b
--- /dev/null
+++ b/src/drivers/ricoh/rce822/rce822.c
@@ -0,0 +1,79 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2014 Vladimir Serbinenko
+ *
+ * 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.
+ *
+ * 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 <kconfig.h>
+#include <console/console.h>
+#include <device/device.h>
+#include <device/pci.h>
+#include <device/pci_ids.h>
+#include <arch/io.h>
+#include "chip.h"
+
+static void rce822_enable(struct device *dev)
+{
+ struct drivers_ricoh_rce822_config *config = dev->chip_info;
+
+ pci_write_config8(dev, 0xca, 0x57);
+ pci_write_config8(dev, 0xcb, config->disable_mask);
+ pci_write_config8(dev, 0xca, 0x00);
+}
+
+static void rce822_init(struct device *dev)
+{
+ struct drivers_ricoh_rce822_config *config = dev->chip_info;
+
+ pci_write_config8(dev, 0xf9, 0xfc);
+ pci_write_config8(dev, 0xfb, config->sdwppol << 1);
+ pci_write_config8(dev, 0xf9, 0x00);
+}
+
+static void rce822_set_subsystem(device_t dev, unsigned vendor, unsigned device)
+{
+
+ if (!vendor || !device) {
+ pci_write_config32(dev, 0xac,
+ pci_read_config32(dev, PCI_VENDOR_ID));
+ } else {
+ pci_write_config32(dev, 0xac,
+ ((device & 0xffff) << 16) | (vendor & 0xffff));
+ }
+}
+
+static struct pci_operations lops_pci = {
+ .set_subsystem = &rce822_set_subsystem,
+};
+
+static struct device_operations usb_ehci_ops = {
+ .read_resources = pci_dev_read_resources,
+ .set_resources = pci_dev_set_resources,
+ .enable_resources = pci_dev_enable_resources,
+ .init = rce822_init,
+ .enable = rce822_enable,
+ .scan_bus = 0,
+ .ops_pci = &lops_pci,
+};
+
+static const unsigned short pci_device_ids[] = { 0xe822, 0xe823, 0 };
+
+static const struct pci_driver pch_usb_ehci __pci_driver = {
+ .ops = &usb_ehci_ops,
+ .vendor = PCI_VENDOR_ID_RICOH,
+ .devices = pci_device_ids,
+};
diff --git a/src/mainboard/lenovo/x220/Kconfig b/src/mainboard/lenovo/x220/Kconfig
index 9a9b143..861f3a4 100644
--- a/src/mainboard/lenovo/x220/Kconfig
+++ b/src/mainboard/lenovo/x220/Kconfig
@@ -21,6 +21,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy
select MAINBOARD_HAS_NATIVE_VGA_INIT
select MAINBOARD_HAS_NATIVE_VGA_INIT_TEXTMODECFG
select SANDYBRIDGE_LVDS
+ select DRIVERS_RICOH_RCE822
# Workaround for EC/KBC IRQ1.
select SERIRQ_CONTINUOUS_MODE
diff --git a/src/mainboard/lenovo/x220/devicetree.cb b/src/mainboard/lenovo/x220/devicetree.cb
index c1ed116..c3b8ad9 100644
--- a/src/mainboard/lenovo/x220/devicetree.cb
+++ b/src/mainboard/lenovo/x220/devicetree.cb
@@ -100,11 +100,12 @@ chip northbridge/intel/sandybridge
end # PCIe Port #4
device pci 1c.4 on
subsystemid 0x17aa 0x21db
- device pci 00.0 on
- subsystemid 0x17aa 0x21db
- end
- device pci 00.1 on
- subsystemid 0x17aa 0x21db
+ chip drivers/ricoh/rce822
+ register "sdwppol" = "1"
+ register "disable_mask" = "0x87"
+ device pci 00.0 on
+ subsystemid 0x17aa 0x21fa
+ end
end
end # PCIe Port #5 (SD)
device pci 1c.5 off end # PCIe Port #6
diff --git a/src/mainboard/lenovo/x230/Kconfig b/src/mainboard/lenovo/x230/Kconfig
index 839fc42..49dab80 100644
--- a/src/mainboard/lenovo/x230/Kconfig
+++ b/src/mainboard/lenovo/x230/Kconfig
@@ -21,6 +21,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy
select MAINBOARD_HAS_NATIVE_VGA_INIT
select MAINBOARD_HAS_NATIVE_VGA_INIT_TEXTMODECFG
select IVYBRIDGE_LVDS
+ select DRIVERS_RICOH_RCE822
# Workaround for EC/KBC IRQ1.
select SERIRQ_CONTINUOUS_MODE
diff --git a/src/mainboard/lenovo/x230/devicetree.cb b/src/mainboard/lenovo/x230/devicetree.cb
index f9f8d26..f2fed1f 100644
--- a/src/mainboard/lenovo/x230/devicetree.cb
+++ b/src/mainboard/lenovo/x230/devicetree.cb
@@ -90,11 +90,12 @@ chip northbridge/intel/sandybridge
end # High Definition Audio
device pci 1c.0 on
subsystemid 0x17aa 0x21fa
- device pci 00.0 on
- subsystemid 0x17aa 0x21fa
- end
- device pci 00.1 on
- subsystemid 0x17aa 0x21fa
+ chip drivers/ricoh/rce822
+ register "sdwppol" = "1"
+ register "disable_mask" = "0x87"
+ device pci 00.0 on
+ subsystemid 0x17aa 0x21fa
+ end
end
end # PCIe Port #1
device pci 1c.1 on
Vladimir Serbinenko (phcoder(a)gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/7199
-gerrit
commit 2ceeae1b5ddeed898b037dab3cd690807aeaee9f
Author: Vladimir Serbinenko <phcoder(a)gmail.com>
Date: Sat Oct 25 15:18:25 2014 +0200
i82801gx: Handle whole FADT in southbridge.
Do all the handling in SB code with few parameters from devicetree.cb
instead of having mobo callbacks.
Change-Id: I8fd02ff05553a3c51ea5f6ae66b8f5502509e2bc
Signed-off-by: Vladimir Serbinenko <phcoder(a)gmail.com>
---
src/arch/x86/boot/acpi.c | 5 ++--
src/arch/x86/include/arch/acpi.h | 3 +-
src/mainboard/apple/macbook21/devicetree.cb | 3 ++
src/mainboard/apple/macbook21/fadt.c | 27 -----------------
src/mainboard/getac/p470/devicetree.cb | 4 +++
src/mainboard/getac/p470/fadt.c | 28 ------------------
src/mainboard/ibase/mb899/devicetree.cb | 3 ++
src/mainboard/ibase/mb899/fadt.c | 32 ---------------------
src/mainboard/intel/d945gclf/devicetree.cb | 2 ++
src/mainboard/intel/d945gclf/fadt.c | 28 ------------------
src/mainboard/kontron/986lcd-m/devicetree.cb | 2 ++
src/mainboard/kontron/986lcd-m/fadt.c | 33 ---------------------
src/mainboard/lenovo/t60/devicetree.cb | 3 ++
src/mainboard/lenovo/t60/fadt.c | 28 ------------------
src/mainboard/lenovo/x60/devicetree.cb | 4 +++
src/mainboard/lenovo/x60/fadt.c | 28 ------------------
src/mainboard/roda/rk886ex/devicetree.cb | 4 +++
src/mainboard/roda/rk886ex/fadt.c | 28 ------------------
src/southbridge/intel/i82801gx/chip.h | 3 ++
src/southbridge/intel/i82801gx/lpc.c | 43 +++++++++++++++++-----------
20 files changed, 58 insertions(+), 253 deletions(-)
diff --git a/src/arch/x86/boot/acpi.c b/src/arch/x86/boot/acpi.c
index c3c946d..baea65c 100644
--- a/src/arch/x86/boot/acpi.c
+++ b/src/arch/x86/boot/acpi.c
@@ -660,7 +660,7 @@ void acpi_create_fadt(acpi_fadt_t *fadt,acpi_facs_t *facs, void *dsdt)
memset((void *) fadt, 0, sizeof(acpi_fadt_t));
memcpy(header->signature, "FACP", 4);
header->length = sizeof(acpi_fadt_t);
- header->revision = 3;
+ header->revision = 4;
memcpy(header->oem_id, OEM_ID, 6);
memcpy(header->oem_table_id, ACPI_TABLE_CREATOR, 8);
memcpy(header->asl_compiler_id, ASLC, 4);
@@ -680,8 +680,7 @@ void acpi_create_fadt(acpi_fadt_t *fadt,acpi_facs_t *facs, void *dsdt)
fadt->preferred_pm_profile = PM_DESKTOP;
}
- southbridge_fill_fadt(fadt);
- mainboard_fill_fadt(fadt);
+ acpi_fill_fadt(fadt);
header->checksum =
acpi_checksum((void *) fadt, header->length);
diff --git a/src/arch/x86/include/arch/acpi.h b/src/arch/x86/include/arch/acpi.h
index ff59a01..313bdf1 100644
--- a/src/arch/x86/include/arch/acpi.h
+++ b/src/arch/x86/include/arch/acpi.h
@@ -495,8 +495,7 @@ unsigned long acpi_fill_ssdt_generator(unsigned long current,
void acpi_create_ssdt_generator(acpi_header_t *ssdt, const char *oem_table_id);
void acpi_create_fadt(acpi_fadt_t *fadt,acpi_facs_t *facs, void *dsdt);
#if IS_ENABLED(CONFIG_COMMON_FADT)
-void southbridge_fill_fadt(acpi_fadt_t * fadt);
-void mainboard_fill_fadt(acpi_fadt_t * fadt);
+void acpi_fill_fadt(acpi_fadt_t * fadt);
#endif
void update_ssdt(void *ssdt);
diff --git a/src/mainboard/apple/macbook21/devicetree.cb b/src/mainboard/apple/macbook21/devicetree.cb
index 5b11b52..9509c81 100644
--- a/src/mainboard/apple/macbook21/devicetree.cb
+++ b/src/mainboard/apple/macbook21/devicetree.cb
@@ -69,6 +69,9 @@ chip northbridge/intel/i945
register "ide_enable_secondary" = "1"
register "c4onc3_enable" = "1"
+ register "c3_latency" = "0x23"
+ register "p_cnt_throttling_supported" = "1"
+
device pci 1b.0 on
ioapic_irq 2 INTA 0x16 # Audio Controller
subsystemid 0x8384 0x7680
diff --git a/src/mainboard/apple/macbook21/fadt.c b/src/mainboard/apple/macbook21/fadt.c
deleted file mode 100644
index 314153d..0000000
--- a/src/mainboard/apple/macbook21/fadt.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * This file is part of the coreboot project.
- *
- * Copyright (C) 2007-2008 coresystems GmbH
- *
- * 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.
- *
- * 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/acpi.h>
-
-void mainboard_fill_fadt(acpi_fadt_t * fadt)
-{
- fadt->p_lvl3_lat = 0x23;
-}
diff --git a/src/mainboard/getac/p470/devicetree.cb b/src/mainboard/getac/p470/devicetree.cb
index fd97445..d88304e 100644
--- a/src/mainboard/getac/p470/devicetree.cb
+++ b/src/mainboard/getac/p470/devicetree.cb
@@ -60,6 +60,10 @@ chip northbridge/intel/i945
register "ide_enable_secondary" = "0x0"
register "sata_ahci" = "0x0"
+ register "c3_latency" = "85"
+ register "docking_supported" = "1"
+ register "p_cnt_throttling_supported" = "1"
+
device pci 1b.0 on # High Definition Audio
ioapic_irq 2 INTA 0x16
end
diff --git a/src/mainboard/getac/p470/fadt.c b/src/mainboard/getac/p470/fadt.c
deleted file mode 100644
index 8722743..0000000
--- a/src/mainboard/getac/p470/fadt.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * This file is part of the coreboot project.
- *
- * Copyright (C) 2007-2009 coresystems GmbH
- *
- * 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.
- *
- * 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/acpi.h>
-
-void mainboard_fill_fadt(acpi_fadt_t * fadt)
-{
- fadt->p_lvl3_lat = 85;
- fadt->flags |= ACPI_FADT_DOCKING_SUPPORTED;
-}
diff --git a/src/mainboard/ibase/mb899/devicetree.cb b/src/mainboard/ibase/mb899/devicetree.cb
index af04398..ccf6405 100644
--- a/src/mainboard/ibase/mb899/devicetree.cb
+++ b/src/mainboard/ibase/mb899/devicetree.cb
@@ -32,6 +32,9 @@ chip northbridge/intel/i945
register "ide_enable_secondary" = "0x0"
register "sata_ahci" = "0x1"
+ register "c3_latency" = "85"
+ register "p_cnt_throttling_supported" = "0"
+
device pci 1b.0 on
ioapic_irq 2 INTA 0x16
end # High Definition Audio
diff --git a/src/mainboard/ibase/mb899/fadt.c b/src/mainboard/ibase/mb899/fadt.c
deleted file mode 100644
index f2770a5..0000000
--- a/src/mainboard/ibase/mb899/fadt.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * This file is part of the coreboot project.
- *
- * Copyright (C) 2007-2009 coresystems GmbH
- *
- * 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.
- *
- * 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 <string.h>
-#include <device/pci.h>
-#include <arch/acpi.h>
-#include <cpu/x86/smm.h>
-
-void mainboard_fill_fadt(acpi_fadt_t * fadt)
-{
- fadt->p_lvl3_lat = 85;
- fadt->duty_width = 0;
- fadt->iapc_boot_arch = 0x03;
-
- fadt->flags |= ACPI_FADT_C2_MP_SUPPORTED | ACPI_FADT_PLATFORM_CLOCK;
-}
diff --git a/src/mainboard/intel/d945gclf/devicetree.cb b/src/mainboard/intel/d945gclf/devicetree.cb
index acbde2a..9f9afff 100644
--- a/src/mainboard/intel/d945gclf/devicetree.cb
+++ b/src/mainboard/intel/d945gclf/devicetree.cb
@@ -52,6 +52,8 @@ chip northbridge/intel/i945
register "ide_enable_primary" = "0x1"
register "ide_enable_secondary" = "0x0"
register "sata_ahci" = "0x0"
+ register "c3_latency" = "85"
+ register "p_cnt_throttling_supported" = "0"
device pci 1b.0 on
ioapic_irq 2 INTA 0x16 end # High Definition Audio
diff --git a/src/mainboard/intel/d945gclf/fadt.c b/src/mainboard/intel/d945gclf/fadt.c
deleted file mode 100644
index 74a0e7e..0000000
--- a/src/mainboard/intel/d945gclf/fadt.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * This file is part of the coreboot project.
- *
- * Copyright (C) 2007-2009 coresystems GmbH
- *
- * 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.
- *
- * 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/acpi.h>
-
-void mainboard_fill_fadt(acpi_fadt_t * fadt)
-{
- fadt->p_lvl3_lat = 85;
- fadt->duty_width = 0;
- fadt->iapc_boot_arch = 0x03;
- fadt->flags |= ACPI_FADT_C2_MP_SUPPORTED | ACPI_FADT_PLATFORM_CLOCK;
-}
diff --git a/src/mainboard/kontron/986lcd-m/devicetree.cb b/src/mainboard/kontron/986lcd-m/devicetree.cb
index 069660c..b701f78 100644
--- a/src/mainboard/kontron/986lcd-m/devicetree.cb
+++ b/src/mainboard/kontron/986lcd-m/devicetree.cb
@@ -32,6 +32,8 @@ chip northbridge/intel/i945
register "ide_enable_primary" = "0x1"
register "ide_enable_secondary" = "0x1"
register "sata_ahci" = "0x0"
+ register "c3_latency" = "85"
+ register "p_cnt_throttling_supported" = "0"
device pci 1b.0 on
ioapic_irq 2 INTA 0x16
diff --git a/src/mainboard/kontron/986lcd-m/fadt.c b/src/mainboard/kontron/986lcd-m/fadt.c
deleted file mode 100644
index 92bf647..0000000
--- a/src/mainboard/kontron/986lcd-m/fadt.c
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * This file is part of the coreboot project.
- *
- * Copyright (C) 2007-2009 coresystems GmbH
- *
- * 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.
- *
- * 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 <string.h>
-#include <device/pci.h>
-#include <arch/acpi.h>
-#include <cpu/x86/smm.h>
-
-void mainboard_fill_fadt(acpi_fadt_t * fadt)
-{
- fadt->p_lvl3_lat = 85;
- fadt->duty_width = 0;
- fadt->iapc_boot_arch = 0x03;
-
- fadt->flags |= ACPI_FADT_C2_MP_SUPPORTED
- | ACPI_FADT_RESET_REGISTER |ACPI_FADT_PLATFORM_CLOCK;
-}
diff --git a/src/mainboard/lenovo/t60/devicetree.cb b/src/mainboard/lenovo/t60/devicetree.cb
index 5e2a4fe..1d5f549 100644
--- a/src/mainboard/lenovo/t60/devicetree.cb
+++ b/src/mainboard/lenovo/t60/devicetree.cb
@@ -69,6 +69,9 @@ chip northbridge/intel/i945
register "alt_gp_smi_en" = "0x1000"
register "c4onc3_enable" = "1"
+ register "c3_latency" = "0x23"
+ register "docking_supported" = "1"
+ register "p_cnt_throttling_supported" = "1"
device pci 1b.0 on
ioapic_irq 2 INTA 0x16 # Audio Controller
diff --git a/src/mainboard/lenovo/t60/fadt.c b/src/mainboard/lenovo/t60/fadt.c
deleted file mode 100644
index 96767bd..0000000
--- a/src/mainboard/lenovo/t60/fadt.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * This file is part of the coreboot project.
- *
- * Copyright (C) 2007-2008 coresystems GmbH
- *
- * 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.
- *
- * 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/acpi.h>
-
-void mainboard_fill_fadt(acpi_fadt_t * fadt)
-{
- fadt->p_lvl3_lat = 0x23;
- fadt->flags |= ACPI_FADT_DOCKING_SUPPORTED;
-}
diff --git a/src/mainboard/lenovo/x60/devicetree.cb b/src/mainboard/lenovo/x60/devicetree.cb
index a067f92..af3d10d 100644
--- a/src/mainboard/lenovo/x60/devicetree.cb
+++ b/src/mainboard/lenovo/x60/devicetree.cb
@@ -67,6 +67,10 @@ chip northbridge/intel/i945
register "alt_gp_smi_en" = "0x1000"
register "c4onc3_enable" = "1"
+ register "c3_latency" = "0x23"
+ register "docking_supported" = "1"
+ register "p_cnt_throttling_supported" = "1"
+
device pci 1b.0 on
ioapic_irq 2 INTA 0x16 # Audio Controller
subsystemid 0x17aa 0x2010
diff --git a/src/mainboard/lenovo/x60/fadt.c b/src/mainboard/lenovo/x60/fadt.c
deleted file mode 100644
index 96767bd..0000000
--- a/src/mainboard/lenovo/x60/fadt.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * This file is part of the coreboot project.
- *
- * Copyright (C) 2007-2008 coresystems GmbH
- *
- * 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.
- *
- * 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/acpi.h>
-
-void mainboard_fill_fadt(acpi_fadt_t * fadt)
-{
- fadt->p_lvl3_lat = 0x23;
- fadt->flags |= ACPI_FADT_DOCKING_SUPPORTED;
-}
diff --git a/src/mainboard/roda/rk886ex/devicetree.cb b/src/mainboard/roda/rk886ex/devicetree.cb
index 6e34b6f..8e4a665 100644
--- a/src/mainboard/roda/rk886ex/devicetree.cb
+++ b/src/mainboard/roda/rk886ex/devicetree.cb
@@ -53,6 +53,10 @@ chip northbridge/intel/i945
register "gpi7_routing" = "2"
register "gpe0_en" = "0x20800007"
+ register "c3_latency" = "0x23"
+ register "docking_supported" = "1"
+ register "p_cnt_throttling_supported" = "1"
+
register "ide_legacy_combined" = "0x1"
register "ide_enable_primary" = "0x1"
register "ide_enable_secondary" = "0x0"
diff --git a/src/mainboard/roda/rk886ex/fadt.c b/src/mainboard/roda/rk886ex/fadt.c
deleted file mode 100644
index 96767bd..0000000
--- a/src/mainboard/roda/rk886ex/fadt.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * This file is part of the coreboot project.
- *
- * Copyright (C) 2007-2008 coresystems GmbH
- *
- * 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.
- *
- * 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/acpi.h>
-
-void mainboard_fill_fadt(acpi_fadt_t * fadt)
-{
- fadt->p_lvl3_lat = 0x23;
- fadt->flags |= ACPI_FADT_DOCKING_SUPPORTED;
-}
diff --git a/src/southbridge/intel/i82801gx/chip.h b/src/southbridge/intel/i82801gx/chip.h
index c61ec98..589c082 100644
--- a/src/southbridge/intel/i82801gx/chip.h
+++ b/src/southbridge/intel/i82801gx/chip.h
@@ -59,6 +59,9 @@ struct southbridge_intel_i82801gx_config {
uint32_t sata_ports_implemented;
int c4onc3_enable:1;
+ int docking_supported:1;
+ int p_cnt_throttling_supported:1;
+ int c3_latency;
};
#endif /* SOUTHBRIDGE_INTEL_I82801GX_CHIP_H */
diff --git a/src/southbridge/intel/i82801gx/lpc.c b/src/southbridge/intel/i82801gx/lpc.c
index 085906f..4fc5ff7 100644
--- a/src/southbridge/intel/i82801gx/lpc.c
+++ b/src/southbridge/intel/i82801gx/lpc.c
@@ -486,9 +486,11 @@ unsigned long acpi_fill_madt(unsigned long current)
return current;
}
-void southbridge_fill_fadt(acpi_fadt_t * fadt)
+void acpi_fill_fadt(acpi_fadt_t * fadt)
{
- u16 pmbase = pci_read_config16(dev_find_slot(0, PCI_DEVFN(0x1f,0)), 0x40) & 0xfffe;
+ device_t dev = dev_find_slot(0, PCI_DEVFN(0x1f,0));
+ config_t *chip = dev->chip_info;
+ u16 pmbase = pci_read_config16(dev, 0x40) & 0xfffe;
fadt->pm1a_evt_blk = pmbase;
fadt->pm1b_evt_blk = 0x0;
@@ -510,7 +512,7 @@ void southbridge_fill_fadt(acpi_fadt_t * fadt)
fadt->reset_reg.space_id = 1;
fadt->reset_reg.bit_width = 8;
fadt->reset_reg.bit_offset = 0;
- fadt->reset_reg.resv = 0;
+ fadt->reset_reg.access_size = ACPI_ACCESS_SIZE_BYTE_ACCESS;
fadt->reset_reg.addrl = 0xcf9;
fadt->reset_reg.addrh = 0;
@@ -519,56 +521,56 @@ void southbridge_fill_fadt(acpi_fadt_t * fadt)
fadt->x_pm1a_evt_blk.space_id = 1;
fadt->x_pm1a_evt_blk.bit_width = 32;
fadt->x_pm1a_evt_blk.bit_offset = 0;
- fadt->x_pm1a_evt_blk.resv = 0;
+ fadt->x_pm1a_evt_blk.access_size = ACPI_ACCESS_SIZE_DWORD_ACCESS;
fadt->x_pm1a_evt_blk.addrl = pmbase;
fadt->x_pm1a_evt_blk.addrh = 0x0;
fadt->x_pm1b_evt_blk.space_id = 0;
fadt->x_pm1b_evt_blk.bit_width = 0;
fadt->x_pm1b_evt_blk.bit_offset = 0;
- fadt->x_pm1b_evt_blk.resv = 0;
+ fadt->x_pm1b_evt_blk.access_size = 0;
fadt->x_pm1b_evt_blk.addrl = 0x0;
fadt->x_pm1b_evt_blk.addrh = 0x0;
fadt->x_pm1a_cnt_blk.space_id = 1;
fadt->x_pm1a_cnt_blk.bit_width = 16;
fadt->x_pm1a_cnt_blk.bit_offset = 0;
- fadt->x_pm1a_cnt_blk.resv = 0;
+ fadt->x_pm1a_cnt_blk.access_size = ACPI_ACCESS_SIZE_WORD_ACCESS;
fadt->x_pm1a_cnt_blk.addrl = pmbase + 0x4;
fadt->x_pm1a_cnt_blk.addrh = 0x0;
fadt->x_pm1b_cnt_blk.space_id = 0;
fadt->x_pm1b_cnt_blk.bit_width = 0;
fadt->x_pm1b_cnt_blk.bit_offset = 0;
- fadt->x_pm1b_cnt_blk.resv = 0;
+ fadt->x_pm1b_cnt_blk.access_size = 0;
fadt->x_pm1b_cnt_blk.addrl = 0x0;
fadt->x_pm1b_cnt_blk.addrh = 0x0;
fadt->x_pm2_cnt_blk.space_id = 1;
fadt->x_pm2_cnt_blk.bit_width = 8;
fadt->x_pm2_cnt_blk.bit_offset = 0;
- fadt->x_pm2_cnt_blk.resv = 0;
+ fadt->x_pm2_cnt_blk.access_size = ACPI_ACCESS_SIZE_BYTE_ACCESS;
fadt->x_pm2_cnt_blk.addrl = pmbase + 0x20;
fadt->x_pm2_cnt_blk.addrh = 0x0;
fadt->x_pm_tmr_blk.space_id = 1;
fadt->x_pm_tmr_blk.bit_width = 32;
fadt->x_pm_tmr_blk.bit_offset = 0;
- fadt->x_pm_tmr_blk.resv = 0;
+ fadt->x_pm_tmr_blk.access_size = ACPI_ACCESS_SIZE_DWORD_ACCESS;
fadt->x_pm_tmr_blk.addrl = pmbase + 0x8;
fadt->x_pm_tmr_blk.addrh = 0x0;
fadt->x_gpe0_blk.space_id = 1;
fadt->x_gpe0_blk.bit_width = 64;
fadt->x_gpe0_blk.bit_offset = 0;
- fadt->x_gpe0_blk.resv = 0;
+ fadt->x_gpe0_blk.access_size = ACPI_ACCESS_SIZE_DWORD_ACCESS;
fadt->x_gpe0_blk.addrl = pmbase + 0x28;
fadt->x_gpe0_blk.addrh = 0x0;
fadt->x_gpe1_blk.space_id = 0;
fadt->x_gpe1_blk.bit_width = 0;
fadt->x_gpe1_blk.bit_offset = 0;
- fadt->x_gpe1_blk.resv = 0;
+ fadt->x_gpe1_blk.access_size = 0;
fadt->x_gpe1_blk.addrl = 0x0;
fadt->x_gpe1_blk.addrh = 0x0;
fadt->day_alrm = 0xd;
@@ -585,14 +587,23 @@ void southbridge_fill_fadt(acpi_fadt_t * fadt)
fadt->cst_cnt = APM_CNT_CST_CONTROL;
fadt->p_lvl2_lat = 1;
- fadt->p_lvl3_lat = 0x23;
+ fadt->p_lvl3_lat = chip->c3_latency;
fadt->flush_size = 0;
fadt->flush_stride = 0;
fadt->duty_offset = 1;
- fadt->duty_width = 3;
- fadt->iapc_boot_arch = 0x00;
- fadt->flags = ACPI_FADT_WBINVD | ACPI_FADT_C1_SUPPORTED |
- ACPI_FADT_SLEEP_BUTTON | ACPI_FADT_S4_RTC_WAKE;
+ if (chip->p_cnt_throttling_supported) {
+ fadt->duty_width = 3;
+ } else {
+ fadt->duty_width = 0;
+ }
+ fadt->iapc_boot_arch = 0x03;
+ fadt->flags = (ACPI_FADT_WBINVD | ACPI_FADT_C1_SUPPORTED
+ | ACPI_FADT_SLEEP_BUTTON | ACPI_FADT_S4_RTC_WAKE
+ | ACPI_FADT_PLATFORM_CLOCK | ACPI_FADT_RESET_REGISTER
+ | ACPI_FADT_C2_MP_SUPPORTED);
+ if (chip->docking_supported) {
+ fadt->flags |= ACPI_FADT_DOCKING_SUPPORTED;
+ }
}
static void i82801gx_lpc_read_resources(device_t dev)
Felix Held (felix-coreboot(a)felixheld.de) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/5450
-gerrit
commit cde460ec30a2ec7f9ebe96b4831aefad0209a8e6
Author: Felix Held <felix-coreboot(a)felixheld.de>
Date: Wed Jun 4 23:15:26 2014 +0200
superio/nuvoton: Add support for Nuvoton NCT6776
Add support for both NCT6776D and NCT6776F devices.
Change-Id: If6686ea0a1cd6be537e286699b4ee8f88ba8ad7c
Signed-off-by: Felix Held <felix-coreboot(a)felixheld.de>
---
src/superio/nuvoton/Kconfig | 4 ++
src/superio/nuvoton/Makefile.inc | 1 +
src/superio/nuvoton/nct6776/Makefile.inc | 22 ++++++++
src/superio/nuvoton/nct6776/nct6776.h | 62 +++++++++++++++++++++
src/superio/nuvoton/nct6776/superio.c | 94 ++++++++++++++++++++++++++++++++
5 files changed, 183 insertions(+)
diff --git a/src/superio/nuvoton/Kconfig b/src/superio/nuvoton/Kconfig
index 4bdcd1e..dd387a1 100644
--- a/src/superio/nuvoton/Kconfig
+++ b/src/superio/nuvoton/Kconfig
@@ -32,3 +32,7 @@ config SUPERIO_NUVOTON_NCT5104D
config SUPERIO_NUVOTON_NCT5572D
bool
select SUPERIO_NUVOTON_COMMON_ROMSTAGE
+
+config SUPERIO_NUVOTON_NCT6776
+ bool
+ select SUPERIO_NUVOTON_COMMON_ROMSTAGE
diff --git a/src/superio/nuvoton/Makefile.inc b/src/superio/nuvoton/Makefile.inc
index 9ce04d3..5e4727f 100644
--- a/src/superio/nuvoton/Makefile.inc
+++ b/src/superio/nuvoton/Makefile.inc
@@ -23,3 +23,4 @@ romstage-$(CONFIG_SUPERIO_NUVOTON_COMMON_ROMSTAGE) += common/early_serial.c
subdirs-$(CONFIG_SUPERIO_NUVOTON_WPCM450) += wpcm450
subdirs-$(CONFIG_SUPERIO_NUVOTON_NCT5104D) += nct5104d
subdirs-$(CONFIG_SUPERIO_NUVOTON_NCT5572D) += nct5572d
+subdirs-$(CONFIG_SUPERIO_NUVOTON_NCT6776) += nct6776
diff --git a/src/superio/nuvoton/nct6776/Makefile.inc b/src/superio/nuvoton/nct6776/Makefile.inc
new file mode 100755
index 0000000..45bd755
--- /dev/null
+++ b/src/superio/nuvoton/nct6776/Makefile.inc
@@ -0,0 +1,22 @@
+##
+## This file is part of the coreboot project.
+##
+## Copyright (C) 2011 - 2012 Advanced Micro Devices, Inc.
+## Copyright (C) 2014 Felix Held <felix-coreboot(a)felixheld.de>
+##
+## 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_NUVOTON_NCT6776) += superio.c
diff --git a/src/superio/nuvoton/nct6776/nct6776.h b/src/superio/nuvoton/nct6776/nct6776.h
new file mode 100755
index 0000000..f6f31ef
--- /dev/null
+++ b/src/superio/nuvoton/nct6776/nct6776.h
@@ -0,0 +1,62 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2014 Felix Held <felix-coreboot(a)felixheld.de>
+ *
+ * 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
+ */
+
+/* Both NCT6776D and NCT6776F package variants are supported. */
+
+#ifndef SUPERIO_NUVOTON_NCT6776_H
+#define SUPERIO_NUVOTON_NCT6776_H
+
+/* Logical Device Numbers (LDN). */
+#define NCT6776_FDC 0x00 /* Floppy */
+#define NCT6776_PP 0x01 /* Parallel port */
+#define NCT6776_SP1 0x02 /* Com1 */
+#define NCT6776_SP2 0x03 /* Com2 & IR */
+#define NCT6776_KBC 0x05 /* PS/2 keyboard and mouse */
+#define NCT6776_CIR 0x06
+#define NCT6776_GPIO6789_V 0x07
+#define NCT6776_WDT1_GPIO01A_V 0x08
+#define NCT6776_GPIO1234567_V 0x09
+#define NCT6776_ACPI 0x0A
+#define NCT6776_HWM_FPLED 0x0B /* Hardware monitor & front LED */
+#define NCT6776_VID 0x0D
+#define NCT6776_CIRWKUP 0x0E /* CIR wakeup */
+#define NCT6776_GPIO_PP_OD 0x0F /* GPIO Push-Pull/Open drain select */
+#define NCT6776_SVID 0x14
+#define NCT6776_DSLP 0x16 /* Deep sleep */
+#define NCT6776_GPIOA_LDN 0x17
+
+/* virtual LDN for GPIO and WDT */
+#define NCT6776_WDT1 ((0 << 8) | NCT6776_WDT1_GPIO01A_V)
+
+#define NCT6776_GPIOBASE ((0 << 8) | NCT6776_WDT1_GPIO01A_V) //?
+
+#define NCT6776_GPIO0 ((1 << 8) | NCT6776_WDT1_GPIO01A_V)
+#define NCT6776_GPIO1 ((1 << 8) | NCT6776_GPIO1234567_V)
+#define NCT6776_GPIO2 ((2 << 8) | NCT6776_GPIO1234567_V)
+#define NCT6776_GPIO3 ((3 << 8) | NCT6776_GPIO1234567_V)
+#define NCT6776_GPIO4 ((4 << 8) | NCT6776_GPIO1234567_V)
+#define NCT6776_GPIO5 ((5 << 8) | NCT6776_GPIO1234567_V)
+#define NCT6776_GPIO6 ((6 << 8) | NCT6776_GPIO1234567_V)
+#define NCT6776_GPIO7 ((7 << 8) | NCT6776_GPIO1234567_V)
+#define NCT6776_GPIO8 ((0 << 8) | NCT6776_GPIO6789_V)
+#define NCT6776_GPIO9 ((1 << 8) | NCT6776_GPIO6789_V)
+#define NCT6776_GPIOA ((2 << 8) | NCT6776_WDT1_GPIO01A_V)
+
+#endif /* SUPERIO_NUVOTON_NCT6776_H */
diff --git a/src/superio/nuvoton/nct6776/superio.c b/src/superio/nuvoton/nct6776/superio.c
new file mode 100755
index 0000000..d58fe03
--- /dev/null
+++ b/src/superio/nuvoton/nct6776/superio.c
@@ -0,0 +1,94 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2011 Advanced Micro Devices, Inc.
+ * Copyright (C) 2014 Felix Held <felix-coreboot(a)felixheld.de>
+ * 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; 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 <pc80/keyboard.h>
+#include <stdlib.h>
+#include <superio/conf_mode.h>
+
+#include "nct6776.h"
+
+/* Both NCT6776D and NCT6776F package variants are supported. */
+
+static void nct6776_init(struct device *dev)
+{
+ if (!dev->enabled)
+ return;
+
+ switch(dev->path.pnp.device) {
+ /* TODO: Might potentially need code for HWM or FDC etc. */
+ case NCT6776_KBC:
+ pc_keyboard_init();
+ break;
+ }
+}
+
+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 = nct6776_init,
+ .ops_pnp_mode = &pnp_conf_mode_8787_aa,
+};
+
+static struct pnp_info pnp_dev_info[] = {
+ { &ops, NCT6776_FDC, PNP_IO0 | PNP_IRQ0 | PNP_DRQ0, {0x0ff8, 0}, },
+ { &ops, NCT6776_PP, PNP_IO0 | PNP_IRQ0 | PNP_DRQ0, {0x0ff8, 0}, },
+ { &ops, NCT6776_SP1, PNP_IO0 | PNP_IRQ0, {0x0ff8, 0}, },
+ { &ops, NCT6776_SP2, PNP_IO0 | PNP_IRQ0, {0x0ff8, 0}, },
+ { &ops, NCT6776_KBC, PNP_IO0 | PNP_IO1 | PNP_IRQ0 | PNP_IRQ1, {0x0fff, 0}, {0x0fff, 4}, },
+ { &ops, NCT6776_CIR, PNP_IO0 | PNP_IRQ0, {0x0ff8, 0}, },
+ { &ops, NCT6776_ACPI},
+ { &ops, NCT6776_HWM_FPLED, PNP_IO0 | PNP_IO1 | PNP_IRQ0, {0x0ffe, 0}, {0x0ffe, 4}, },
+ { &ops, NCT6776_VID},
+ { &ops, NCT6776_CIRWKUP, PNP_IO0 | PNP_IRQ0, {0x0ff8, 0}, },
+ { &ops, NCT6776_GPIO_PP_OD},
+ { &ops, NCT6776_SVID},
+ { &ops, NCT6776_DSLP},
+ { &ops, NCT6776_GPIOA_LDN},
+ { &ops, NCT6776_WDT1},
+ { &ops, NCT6776_GPIOBASE, PNP_IO0 | PNP_IRQ0, {0x0ff8, 0}, },
+ { &ops, NCT6776_GPIO0},
+ { &ops, NCT6776_GPIO1},
+ { &ops, NCT6776_GPIO2},
+ { &ops, NCT6776_GPIO3},
+ { &ops, NCT6776_GPIO4},
+ { &ops, NCT6776_GPIO5},
+ { &ops, NCT6776_GPIO6},
+ { &ops, NCT6776_GPIO7},
+ { &ops, NCT6776_GPIO8},
+ { &ops, NCT6776_GPIO9},
+ { &ops, NCT6776_GPIOA},
+};
+
+static void enable_dev(struct device *dev)
+{
+ pnp_enable_devices(dev, &ops, ARRAY_SIZE(pnp_dev_info), pnp_dev_info);
+}
+
+struct chip_operations superio_nuvoton_nct6776_ops = {
+ CHIP_NAME("NUVOTON NCT6776 Super I/O")
+ .enable_dev = enable_dev,
+};
Felix Held (felix-coreboot(a)felixheld.de) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/6266
-gerrit
commit 9e2235a2707fa31b677c8661aac0812db413647d
Author: Felix Held <felix-coreboot(a)felixheld.de>
Date: Sat Jul 19 00:21:43 2014 +0200
mainboards/asrock/e350m1: Use driver for Nuvoton NCT5572D superio chip
On the ASRock E350M1 a Nuvoton NCT5572D is used as SuperIO-chip. The coreboot
port to this board however used the driver of the Winbond W83627HF SuperIO,
which is compatible enough to get most stuff working, but which clears bit 6 in
register 0x2B. This switches the function of pin 38 of the NCT5572D from
RSTOUT1# output to GP36. The PERST# pin of the ethernet chip and the
unpopulated miniPCIe slot are connected to this pin, so they didn't get reset
during a reboot.
Using the newly added driver for the Nuvoton NCT5572D fixes this problem.
There is also a trace from the pin 37 of the SuperIO, which can be configured
as RSTOUT2#, to pin 82 of the USB3-chip with unknown function.
As with the wrong driver, PS/2 keyboard and mouse do work in SeaBIOS and GRUB
but not in Linux.
Change-Id: I4bc78406afd3b0e10a1b04b561147e0ed94cc494
Signed-off-by: Felix Held <felix-coreboot(a)felixheld.de>
---
src/mainboard/asrock/e350m1/BiosCallOuts.c | 8 +++----
src/mainboard/asrock/e350m1/Kconfig | 2 +-
src/mainboard/asrock/e350m1/devicetree.cb | 36 ++++++++++++++----------------
src/mainboard/asrock/e350m1/romstage.c | 8 +++----
4 files changed, 25 insertions(+), 29 deletions(-)
diff --git a/src/mainboard/asrock/e350m1/BiosCallOuts.c b/src/mainboard/asrock/e350m1/BiosCallOuts.c
index e88f4f9..7a4ee26 100644
--- a/src/mainboard/asrock/e350m1/BiosCallOuts.c
+++ b/src/mainboard/asrock/e350m1/BiosCallOuts.c
@@ -24,11 +24,6 @@
#include "SB800.h"
#include <stdlib.h>
-/* Should AGESA_GNB_PCIE_SLOT_RESET use agesa_NoopSuccess?
- *
- * Board is known to have some issues with integrated NIC and
- * might need implementation to drive some GPIOs.
- */
static AGESA_STATUS board_BeforeDramInit (UINT32 Func, UINT32 Data, VOID *ConfigPtr);
@@ -100,6 +95,9 @@ static AGESA_STATUS board_BeforeDramInit (UINT32 Func, UINT32 Data, VOID *Config
TempData8 |= Data8;
Write64Mem8(GpioMmioAddr+SB_GPIO_REG179, TempData8);
+ /* this seems to be just copy-pasted from the AMD reference boards and needs
+ * some investigation
+ */
switch(MemData->ParameterListPtr->DDR3Voltage){
case VOLT1_35:
Data8 = Read64Mem8 (GpioMmioAddr+SB_GPIO_REG178);
diff --git a/src/mainboard/asrock/e350m1/Kconfig b/src/mainboard/asrock/e350m1/Kconfig
index 00cdaa7..2f2e58d 100644
--- a/src/mainboard/asrock/e350m1/Kconfig
+++ b/src/mainboard/asrock/e350m1/Kconfig
@@ -24,7 +24,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy
select CPU_AMD_AGESA_FAMILY14
select NORTHBRIDGE_AMD_AGESA_FAMILY14
select SOUTHBRIDGE_AMD_CIMX_SB800
- select SUPERIO_WINBOND_W83627HF
+ select SUPERIO_NUVOTON_NCT5572D
select SB_SUPERIO_HWM
select HAVE_OPTION_TABLE
select HAVE_PIRQ_TABLE
diff --git a/src/mainboard/asrock/e350m1/devicetree.cb b/src/mainboard/asrock/e350m1/devicetree.cb
index e2096c0..0690664 100644
--- a/src/mainboard/asrock/e350m1/devicetree.cb
+++ b/src/mainboard/asrock/e350m1/devicetree.cb
@@ -54,22 +54,15 @@ chip northbridge/amd/agesa/family14/root_complex
end # SM
device pci 14.1 on end # IDE 0x439c
device pci 14.2 on end # HDA 0x4383
- device pci 14.3 on # LPC 0x439d
- chip superio/winbond/w83627hf
- device pnp 2e.0 off # Floppy
- io 0x60 = 0x3f0
- irq 0x70 = 6
- drq 0x74 = 2
- end
- device pnp 2e.1 off # Parallel Port
- io 0x60 = 0x378
- irq 0x70 = 7
- end
+ device pci 14.3 on # LPC
+ chip superio/nuvoton/nct5572d
+ device pnp 2e.0 off end # FDC; not externally available on the NCT5572D, but on the die
+ device pnp 2e.1 off end # LPT1; same as FDC
device pnp 2e.2 on # Com1
io 0x60 = 0x3f8
irq 0x70 = 4
end
- device pnp 2e.3 off # Com2
+ device pnp 2e.3 off # IR
io 0x60 = 0x2f8
irq 0x70 = 3
end
@@ -81,19 +74,24 @@ chip northbridge/amd/agesa/family14/root_complex
end
device pnp 2e.6 off # CIR
io 0x60 = 0x100
+ irq 0x70 = 0
end
- device pnp 2e.7 off # GAME_MIDI_GIPO1
- io 0x60 = 0x220
- io 0x62 = 0x300
- irq 0x70 = 9
- end
- device pnp 2e.8 off end # GPIO2
- device pnp 2e.9 off end # GPIO3
+ device pnp 2e.7 off end # GIPO689
+ device pnp 2e.8 off end # WDT
+ device pnp 2e.9 off end # GPIO235
device pnp 2e.a on end # ACPI
device pnp 2e.b on # HW Monitor
io 0x60 = 0x290
+ io 0x62 = 0x0000 # SB-TSI currently not implemented
irq 0x70 = 5
end
+ device pnp 2e.c off end # PECI
+ device pnp 2e.d off end # SUSLED
+ device pnp 2e.e off # CIRWKUP
+ io 0x60 = 0x0000
+ irq 0x70 = 0
+ end
+ device pnp 2e.f off end # GPIO_PP_OD
end
end #LPC
device pci 14.4 on end # PCIB 0x4384, NOTE: PCI interface pins shared with GPIO {GPIO 35:0}
diff --git a/src/mainboard/asrock/e350m1/romstage.c b/src/mainboard/asrock/e350m1/romstage.c
index 5223360..47704ed 100644
--- a/src/mainboard/asrock/e350m1/romstage.c
+++ b/src/mainboard/asrock/e350m1/romstage.c
@@ -33,14 +33,14 @@
#include "agesawrapper.h"
#include <northbridge/amd/agesa/agesawrapper_call.h>
#include "cpu/x86/bist.h"
-#include <superio/winbond/common/winbond.h>
-#include <superio/winbond/w83627hf/w83627hf.h>
+#include <superio/nuvoton/common/nuvoton.h>
+#include <superio/nuvoton/nct5572d/nct5572d.h>
#include "cpu/x86/lapic.h"
#include <sb_cimx.h>
#include "SBPLATFORM.h"
-#define SERIAL_DEV PNP_DEV(0x2e, W83627HF_SP1)
+#define SERIAL_DEV PNP_DEV(0x2e, NCT5572D_SP1)
void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
{
@@ -61,7 +61,7 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
sb_Poweron_Init();
post_code(0x31);
- winbond_enable_serial(SERIAL_DEV, CONFIG_TTYS0_BASE);
+ nuvoton_enable_serial(SERIAL_DEV, CONFIG_TTYS0_BASE);
console_init();
}