Rudolf Marek (r.marek(a)assembler.cz) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/4498
-gerrit
commit 340df293e1cc93716d765db8afe1394864b8cef3
Author: Rudolf Marek <r.marek(a)assembler.cz>
Date: Sat Dec 7 22:34:24 2013 +0100
Implement proper IT8728F PNP ops
The Asus F2A85-M has IT8306E which is a stripped down version
of this SIO. Implement the PNP SIO ops and do the HWM setup.
If there is future user implement some config option for devicetree.cb.
Implement missing early calls needed for F2A85-M.
Change-Id: Ibc4f3fafc3ffb1cd799948e63be01e6924b45d6c
Signed-off-by: Rudolf Marek <r.marek(a)assembler.cz>
---
src/superio/ite/it8728f/Makefile.inc | 2 +
src/superio/ite/it8728f/chip.h | 33 ++++++++
src/superio/ite/it8728f/early_serial.c | 23 ++++++
src/superio/ite/it8728f/early_serial.h | 3 +
src/superio/ite/it8728f/it8728f.h | 2 +
src/superio/ite/it8728f/superio.c | 141 +++++++++++++++++++++++++++++++++
6 files changed, 204 insertions(+)
diff --git a/src/superio/ite/it8728f/Makefile.inc b/src/superio/ite/it8728f/Makefile.inc
index d8d4f6a..46fd40a 100644
--- a/src/superio/ite/it8728f/Makefile.inc
+++ b/src/superio/ite/it8728f/Makefile.inc
@@ -19,3 +19,5 @@
##
romstage-$(CONFIG_SUPERIO_ITE_IT8728F) += early_serial.c
+ramstage-$(CONFIG_SUPERIO_ITE_IT8728F) += superio.c
+
diff --git a/src/superio/ite/it8728f/chip.h b/src/superio/ite/it8728f/chip.h
new file mode 100644
index 0000000..8013531
--- /dev/null
+++ b/src/superio/ite/it8728f/chip.h
@@ -0,0 +1,33 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2006 Uwe Hermann <uwe(a)hermann-uwe.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
+ */
+
+#ifndef SUPERIO_ITE_IT8728F_CHIP_H
+#define SUPERIO_ITE_IT8728F_CHIP_H
+
+#include <device/device.h>
+#include <pc80/keyboard.h>
+#include <uart8250.h>
+
+struct superio_ite_it8728f_config {
+
+ struct pc_keyboard keyboard;
+};
+
+#endif
diff --git a/src/superio/ite/it8728f/early_serial.c b/src/superio/ite/it8728f/early_serial.c
index 7fbd061..78a49aa 100644
--- a/src/superio/ite/it8728f/early_serial.c
+++ b/src/superio/ite/it8728f/early_serial.c
@@ -69,3 +69,26 @@ void it8728f_enable_serial(device_t dev, u16 iobase)
/* (3) Exit the configuration state (MB PnP mode). */
it8728f_exit_conf(dev);
}
+
+/*
+ * We need to set enable 3VSBSW#, this was documented only in IT8712F_V0.9.2!
+ *
+ * LDN 7, reg 0x2a - needed for S3, or memory power will be cut off.
+ *
+ * Enable 3VSBSW#. (For System Suspend-to-RAM)
+ * 0: 3VSBSW# will be always inactive.
+ * 1: 3VSBSW# enabled. It will be (NOT SUSB#) NAND SUSC#.
+ */
+void it8728f_enable_3vsbsw(device_t dev)
+{
+ it8728f_enter_conf(dev);
+ it8728f_sio_write(dev, IT8728F_CONFIG_REG_MFC, 0x80);
+ it8728f_exit_conf(dev);
+}
+
+void it8728f_kill_watchdog(device_t dev)
+{
+ it8728f_enter_conf(dev);
+ it8728f_sio_write(dev, IT8728F_CONFIG_REG_WATCHDOG, 0x00);
+ it8728f_exit_conf(dev);
+}
diff --git a/src/superio/ite/it8728f/early_serial.h b/src/superio/ite/it8728f/early_serial.h
index a146f4c..3443e0d 100644
--- a/src/superio/ite/it8728f/early_serial.h
+++ b/src/superio/ite/it8728f/early_serial.h
@@ -37,4 +37,7 @@ void it8728f_24mhz_clkin(device_t dev);
/* Enable the serial port(s). */
void it8728f_enable_serial(device_t dev, u16 iobase);
+void it8728f_kill_watchdog(device_t dev);
+void it8728f_enable_3vsbsw(device_t dev);
+
#endif
diff --git a/src/superio/ite/it8728f/it8728f.h b/src/superio/ite/it8728f/it8728f.h
index 603e467..9a92f5a 100644
--- a/src/superio/ite/it8728f/it8728f.h
+++ b/src/superio/ite/it8728f/it8728f.h
@@ -38,5 +38,7 @@
#define IT8728F_CONFIG_REG_CHIPVERS 0x22 /* Chip version */
#define IT8728F_CONFIG_REG_CLOCKSEL 0x23 /* Clock Selection. */
#define IT8728F_CONFIG_REG_SWSUSP 0x24 /* Software Suspend, Flash I/F. 'Special register' */
+#define IT8728F_CONFIG_REG_WATCHDOG 0x72 /* Watchdog control. */
+#define IT8728F_CONFIG_REG_MFC 0x2a /* Multi-function control */
#endif
diff --git a/src/superio/ite/it8728f/superio.c b/src/superio/ite/it8728f/superio.c
new file mode 100644
index 0000000..67699fa
--- /dev/null
+++ b/src/superio/ite/it8728f/superio.c
@@ -0,0 +1,141 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2006 Uwe Hermann <uwe(a)hermann-uwe.de>
+ * Copyright (C) 2007 Philipp Degler <pdegler(a)rumms.uni-mannheim.de>
+ * Copyright (C) 2013 Rudolf Marek <r.marek(a)assembler.cz>
+ *
+ * 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 <device/device.h>
+#include <device/pnp.h>
+#include <uart8250.h>
+#include <pc80/keyboard.h>
+#include <arch/io.h>
+#include <stdlib.h>
+#include "chip.h"
+#include "it8728f.h"
+
+static void pnp_enter_ext_func_mode(device_t dev)
+{
+ u16 port = dev->path.pnp.port;
+
+ outb(0x87, port);
+ outb(0x01, port);
+ outb(0x55, port);
+ outb((port == 0x4e) ? 0xaa : 0x55, port);
+}
+
+static void pnp_exit_ext_func_mode(device_t dev)
+{
+ pnp_write_config(dev, 0x02, 0x02);
+}
+
+static u8 hwm_read(u16 base, u8 reg)
+{
+ outb(reg, base + 5);
+ return inb(base + 6);
+}
+
+static void hwm_write(u16 base, u8 reg, u8 val)
+{
+ outb(reg, base + 5);
+ outb(val, base + 6);
+}
+
+static void it8728f_init(device_t dev)
+{
+ struct superio_ite_it8728f_config *conf = dev->chip_info;
+
+ if (!dev->enabled)
+ return;
+
+ switch (dev->path.pnp.device) {
+ case IT8728F_FDC: /* TODO. */
+ break;
+ case IT8728F_PP: /* TODO. */
+ break;
+ case IT8728F_EC:
+ {
+ /* keep it simple for now, configuration options may come later */
+ u8 tmp;
+ u16 base;
+ pnp_enter_ext_func_mode(dev);
+ pnp_set_logical_device(dev);
+ /* there must be better way to read the I/O base */
+ base = ((u16) pnp_read_config(dev, 0x60) << 8);
+ base |= pnp_read_config(dev, 0x61);
+ tmp = hwm_read(base, 0x14);
+ /* setup fan polarity */
+ hwm_write(base, 0x14, tmp | (1 << 7));
+ /* enable fans 1-3 */
+ tmp = hwm_read(base, 0x13);
+ hwm_write(base, 0x13, tmp | (7 << 4));
+ /* enable termistor temps for temp1-temp3 */
+ tmp = hwm_read(base, 0x51);
+ hwm_write(base, 0x51, tmp | (7 << 3));
+ /* fan2 is using temp1 */
+ hwm_write(base, 0x16, 0x80);
+ pnp_exit_ext_func_mode(dev);
+ break;
+ }
+ case IT8728F_KBCK:
+ set_kbc_ps2_mode();
+ pc_keyboard_init(&conf->keyboard);
+ break;
+ case IT8728F_KBCM: /* TODO. */
+ break;
+ case IT8728F_IR: /* TODO. */
+ break;
+ }
+}
+
+static const struct pnp_mode_ops pnp_conf_mode_ops = {
+ .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 = it8728f_init,
+ .ops_pnp_mode = &pnp_conf_mode_ops,
+};
+
+static struct pnp_info pnp_dev_info[] = {
+ { &ops, IT8728F_FDC, PNP_IO0 | PNP_IRQ0 | PNP_DRQ0, {0x0ff8, 0}, },
+ { &ops, IT8728F_SP1, PNP_IO0 | PNP_IRQ0, {0x0ff8, 0}, },
+ { &ops, IT8728F_SP2, PNP_IO0 | PNP_IRQ0, {0x0ff8, 0}, },
+ { &ops, IT8728F_PP, PNP_IO0 | PNP_IRQ0 | PNP_DRQ0, {0x0ffc, 0}, },
+ { &ops, IT8728F_EC, PNP_IO0 | PNP_IO1 | PNP_IRQ0, {0x0ff8, 0}, {0x0ff8, 4}, },
+ { &ops, IT8728F_KBCK, PNP_IO0 | PNP_IO1 | PNP_IRQ0, {0x0fff, 0}, {0x0fff, 4}, },
+ { &ops, IT8728F_KBCM, PNP_IRQ0, },
+ { &ops, IT8728F_GPIO, PNP_IO0 | PNP_IO1 | PNP_IO2 | PNP_IRQ0, {0x0fff, 0}, {0x0ff8, 0}, {0x0ff8, 0}, },
+ { &ops, IT8728F_IR, PNP_IO0 | PNP_IRQ0, {0x0ff8, 0}, },
+};
+
+static void enable_dev(struct device *dev)
+{
+ pnp_enable_devices(dev, &pnp_ops,
+ ARRAY_SIZE(pnp_dev_info), pnp_dev_info);
+}
+
+struct chip_operations superio_ite_it8728f_ops = {
+ CHIP_NAME("ITE IT8728F Super I/O")
+ .enable_dev = enable_dev,
+};
the following patch was just integrated into master:
commit 2742010b522f93da0c9e7d0e781b37999f6bfbdc
Author: Idwer Vollering <vidwer(a)gmail.com>
Date: Mon Jan 6 21:57:56 2014 +0000
AMD Hudson: show POST codes on a PCI device
Show POST codes on a PCI device: implement hudson_pci_port80().
Remove the comments that use pci_locate_device():
using the code found in the comment seems to break booting.
This shares much code with sb600/sb700/sb800,
however the deduplication work needs to be discusses somewhere else
than in this review board.
Tested on an Asus F2A85-M.
The contribution is (C) by Rudolf Marek.
Change-Id: I54fb1dcb0614452c775ed70d867ab44ff263a61a
Author: Rudolf Marek <r.marek(a)assembler.cz>
Signed-off-by: Idwer Vollering <vidwer(a)gmail.com>
See http://review.coreboot.org/4559 for details.
-gerrit
the following patch was just integrated into master:
commit f94892a7cec80a6e2d97b7dc9e78cd87d5f079cf
Author: Paul Menzel <paulepanter(a)users.sourceforge.net>
Date: Tue Oct 29 20:41:50 2013 +0100
cpu/amd/model_fxx/powernow_acpi.c: Comment out set but unused variable `Start_vid`
When adding support for PSS object generation for AMD pre Family Fh CPUs
(199c694f) the function `pstates_algorithm` was copied and adapted, but
`Start_vid` is not needed anymore as a static table is used. I’d remove
the variable, but Ron Minnich requested to leave it there for
documentation purposes. So just comment it out.
Change-Id: I3002951d168cade6461941c16d78373c47792e13
Signed-off-by: Paul Menzel <paulepanter(a)users.sourceforge.net>
See http://review.coreboot.org/4036 for details.
-gerrit
Vladimir Serbinenko (phcoder(a)gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/4693
-gerrit
commit 0301495d063ab063db1720d2b2347ae48d329ced
Author: Vladimir Serbinenko <phcoder(a)gmail.com>
Date: Wed Jan 15 22:09:25 2014 +0100
nvramcui: reboot at the end as TODO suggests
Use cf9 to reboot at the end.
Change-Id: I642a5ec89c864fb03bbcdf6e4fcbb1e28f3fc34c
Signed-off-by: Vladimir Serbinenko <phcoder(a)gmail.com>
---
payloads/nvramcui/nvramcui.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/payloads/nvramcui/nvramcui.c b/payloads/nvramcui/nvramcui.c
index daf153b..f0496c6 100644
--- a/payloads/nvramcui/nvramcui.c
+++ b/payloads/nvramcui/nvramcui.c
@@ -245,7 +245,8 @@ int main()
refresh();
endwin();
- /* TODO: reboot */
+ /* reboot */
+ outb (0x6, 0xcf9);
halt();
}
Vladimir Serbinenko (phcoder(a)gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/4692
-gerrit
commit 6feb371ce098de949f6a4440e404b5c18c941118
Author: Vladimir Serbinenko <phcoder(a)gmail.com>
Date: Wed Jan 15 22:07:52 2014 +0100
nvramcui: Trim values when setting.
Values get space-padded by curses and then enum search fails to match them.
Rtrim to compensat for curses.
Change-Id: Iecf095f21cfade9425eaa039b67625615eb80481
Signed-off-by: Vladimir Serbinenko <phcoder(a)gmail.com>
---
payloads/nvramcui/nvramcui.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/payloads/nvramcui/nvramcui.c b/payloads/nvramcui/nvramcui.c
index 04367cd..daf153b 100644
--- a/payloads/nvramcui/nvramcui.c
+++ b/payloads/nvramcui/nvramcui.c
@@ -232,6 +232,10 @@ int main()
for (i = 0; i < numopts; i++) {
char *name = field_buffer(fields[2*i], 0);
char *value = field_buffer(fields[2*i+1], 0);
+ char *ptr;
+ for (ptr = value + strlen (value) - 1;
+ ptr >= value && *ptr == ' '; ptr--);
+ ptr[1] = '\0';
set_option_from_string(use_nvram, opttbl, value, name);
}
Vladimir Serbinenko (phcoder(a)gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/4691
-gerrit
commit b4fc4fdbc1047201e70bae82b6491fa0b2d2d9d6
Author: Vladimir Serbinenko <phcoder(a)gmail.com>
Date: Wed Jan 15 22:06:56 2014 +0100
libpayload/options: Fix out of array read.
It resulted in garbage in upper bytes of numeric options.
Change-Id: I5e5d8b770ed93c7e8a1756a5ce32444b6a045bac
Signed-off-by: Vladimir Serbinenko <phcoder(a)gmail.com>
---
payloads/libpayload/drivers/options.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/payloads/libpayload/drivers/options.c b/payloads/libpayload/drivers/options.c
index d497c0a..70c2b17 100644
--- a/payloads/libpayload/drivers/options.c
+++ b/payloads/libpayload/drivers/options.c
@@ -310,6 +310,10 @@ int get_option_as_string(const struct nvram_accessor *nvram, struct cb_cmos_opti
return 1;
int cmos_length = (cmos_entry->length+7)/8;
+ /* ensure we have enough space for u64 */
+ if (cmos_length < 8)
+ cmos_length = 8;
+
/* extra byte to ensure 0-terminated strings */
raw = malloc(cmos_length+1);
memset(raw, 0, cmos_length+1);
Vladimir Serbinenko (phcoder(a)gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/4690
-gerrit
commit dde005f9aec15a6951d6ce7e0f6c538d71aad054
Author: Vladimir Serbinenko <phcoder(a)gmail.com>
Date: Wed Jan 15 22:06:16 2014 +0100
libpayload/keyboard: Do not call non-existant keyboard_wait_write.
Change-Id: Ia3029c697d46acb61a941ba97a027124572a50ed
Signed-off-by: Vladimir Serbinenko <phcoder(a)gmail.com>
---
payloads/libpayload/drivers/keyboard.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/payloads/libpayload/drivers/keyboard.c b/payloads/libpayload/drivers/keyboard.c
index 0175bc7..0b4d12a 100644
--- a/payloads/libpayload/drivers/keyboard.c
+++ b/payloads/libpayload/drivers/keyboard.c
@@ -315,7 +315,6 @@ void keyboard_disconnect(void)
/* Send keyboard disconnect command */
outb(I8042_CMD_DIS_KB, 0x64);
- keyboard_wait_write();
/* Hand off with empty buffer */
while (keyboard_havechar())
Vladimir Serbinenko (phcoder(a)gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/4689
-gerrit
commit 7c22b464d60735587ea30a7293799d49cd30a9aa
Author: Vladimir Serbinenko <phcoder(a)gmail.com>
Date: Wed Jan 15 22:04:12 2014 +0100
libpayload/lpgcc: Add curses include path.
Without it payloads that need curses fail to build.
Change-Id: I4533238b547e4c2d9e0778fb7d314db35a9559df
Signed-off-by: Vladimir Serbinenko <phcoder(a)gmail.com>
---
payloads/libpayload/bin/lpgcc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/payloads/libpayload/bin/lpgcc b/payloads/libpayload/bin/lpgcc
index 43eb016..f098873 100755
--- a/payloads/libpayload/bin/lpgcc
+++ b/payloads/libpayload/bin/lpgcc
@@ -133,7 +133,7 @@ while [ $# -gt 0 ]; do
shift
done
-_CFLAGS="$_ARCHEXTRA -nostdinc -nostdlib -I$BASE/../build -I$_INCDIR -I$_ARCHINCDIR -D__LIBPAYLOAD__=1"
+_CFLAGS="$_ARCHEXTRA -nostdinc -nostdlib -I$BASE/../build -I$BASE/../curses -I$_INCDIR -I$_ARCHINCDIR -D__LIBPAYLOAD__=1"
# Check for the -fno-stack-protector silliness