Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/31202
Change subject: arch/x86/timestamp.c: Don't depend on CONFIG_TSC_CONSTANT_RATE
......................................................................
arch/x86/timestamp.c: Don't depend on CONFIG_TSC_CONSTANT_RATE
timestamp_tick_freq_mhz() is used to populate the coreboot tables
which cbmem can use to determine timestamps without needing userspace
tools to get the TSC frequency rate. CONFIG_TSC_CONSTANT_RATE depends
on CONFIG_UDELAY_TSC which is not the case on all targets that could
still make use of this functionality.
Change-Id: I8c34eb811e27d2a91ccf1ca6f48a638da5f6cfd9
Signed-off-by: Arthur Heymans <arthur(a)aheymans.xyz>
---
M src/arch/x86/timestamp.c
1 file changed, 13 insertions(+), 7 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/02/31202/1
diff --git a/src/arch/x86/timestamp.c b/src/arch/x86/timestamp.c
index b5257c4..f7b5541 100644
--- a/src/arch/x86/timestamp.c
+++ b/src/arch/x86/timestamp.c
@@ -21,14 +21,20 @@
return rdtscll();
}
+/* We want build to fail on targets with CONFIG_TSC_CONSTANT_RATE
+ if an implementation is lacking since it used to compute udelays.
+ FIXME: provide an implementation on every target to get rid of this.*/
+#if !IS_ENABLED(CONFIG_TSC_CONSTANT_RATE)
+unsigned long __weak tsc_freq_mhz(void)
+{
+ /* Default to not knowing TSC frequency. cbmem will have to fallback
+ * on trying to determine it in userspace. */
+ return 0;
+}
+#endif
+
int timestamp_tick_freq_mhz(void)
{
/* Chipsets that have a constant TSC provide this value correctly. */
- if (IS_ENABLED(CONFIG_TSC_CONSTANT_RATE))
- return tsc_freq_mhz();
-
- /* Filling tick_freq_mhz = 0 in timestamps-table will trigger
- * userspace utility to try deduce it from the running system.
- */
- return 0;
+ return tsc_freq_mhz();
}
--
To view, visit https://review.coreboot.org/c/coreboot/+/31202
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I8c34eb811e27d2a91ccf1ca6f48a638da5f6cfd9
Gerrit-Change-Number: 31202
Gerrit-PatchSet: 1
Gerrit-Owner: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-MessageType: newchange
Frans Hendriks has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/30810
Change subject: device/pci_device.c: Use verified boot to check oprom
......................................................................
device/pci_device.c: Use verified boot to check oprom
Before oprom is executed, no check is performed if rom passes verification.
Add call to verified_boot_should_run_oprom() to verify the oprom.
BUG=N/A
TEST=Created verified binary and verify logging on Portwell PQ-M107
Change-Id: Iec5092e85d34940ea3a3bb1192ea49f3bc3e5b27
Signed-off-by: Frans Hendriks <fhendriks(a)eltan.com>
---
M src/device/pci_device.c
M src/include/device/pci_rom.h
2 files changed, 22 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/10/30810/1
diff --git a/src/device/pci_device.c b/src/device/pci_device.c
index 82033a6..40012f9 100644
--- a/src/device/pci_device.c
+++ b/src/device/pci_device.c
@@ -16,6 +16,7 @@
* Copyright (C) 2005-2009 coresystems GmbH
* (Written by Stefan Reinauer <stepan(a)coresystems.de> for coresystems GmbH)
* Copyright (C) 2014 Sage Electronic Engineering, LLC.
+ * Copyright (C) 2018 Eltan B.V.
*
* 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
@@ -802,6 +803,10 @@
if (!should_run_oprom(dev))
return;
+ if (IS_ENABLED(CONFIG_VERIFIED_BOOT))
+ if (!verified_boot_should_run_oprom(rom))
+ return;
+
run_bios(dev, (unsigned long)ram);
gfx_set_init_done(1);
printk(BIOS_DEBUG, "VGA Option ROM was run\n");
diff --git a/src/include/device/pci_rom.h b/src/include/device/pci_rom.h
index a4aa52a..865fea3 100644
--- a/src/include/device/pci_rom.h
+++ b/src/include/device/pci_rom.h
@@ -1,3 +1,19 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright 2015 Google Inc.
+ * Copyright (C) 2018 Eltan B.V.
+ *
+ * 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.
+ */
+
#ifndef PCI_ROM_H
#define PCI_ROM_H
#include <endian.h>
@@ -47,4 +63,5 @@
u32 map_oprom_vendev(u32 vendev);
+int verified_boot_should_run_oprom(struct rom_header *rom_header);
#endif
--
To view, visit https://review.coreboot.org/c/coreboot/+/30810
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Iec5092e85d34940ea3a3bb1192ea49f3bc3e5b27
Gerrit-Change-Number: 30810
Gerrit-PatchSet: 1
Gerrit-Owner: Frans Hendriks <fhendriks(a)eltan.com>
Gerrit-MessageType: newchange
Nico Huber has uploaded this change for review. ( https://review.coreboot.org/c/libgfxinit/+/32730
Change subject: gma i2c: Rework GMBUS reset procedure
......................................................................
gma i2c: Rework GMBUS reset procedure
Once we tried to use the GMBUS controller with an unconnected pair of
I2C pins, it got stuck and a reset via the SOFTWARE_CLEAR_INTERRUPT
bit didn't suffice to recover. Further tests have shown that we are
able to recover, if we switch to a valid pin pair first and issue an
I2C stop cycle before the reset.
Change-Id: If737ffb35afa309de7746f0c16025b9598f69460
Signed-off-by: Nico Huber <nico.h(a)gmx.de>
---
M common/hw-gfx-gma-i2c.adb
1 file changed, 39 insertions(+), 31 deletions(-)
git pull ssh://review.coreboot.org:29418/libgfxinit refs/changes/30/32730/1
diff --git a/common/hw-gfx-gma-i2c.adb b/common/hw-gfx-gma-i2c.adb
index bc81734..3d41174 100644
--- a/common/hw-gfx-gma-i2c.adb
+++ b/common/hw-gfx-gma-i2c.adb
@@ -122,27 +122,39 @@
----------------------------------------------------------------------------
- procedure GMBUS_Ready (Result : out Boolean)
+ function GMBUS_Ready (GMBUS2 : Word32) return Boolean is
+ ((GMBUS2 and (GMBUS2_HARDWARE_WAIT_PHASE or
+ GMBUS2_SLAVE_STALL_TIMEOUT_ERROR or
+ GMBUS2_GMBUS_INTERRUPT_STATUS or
+ GMBUS2_NAK_INDICATOR or
+ GMBUS2_GMBUS_ACTIVE)) = 0);
+
+ procedure Check_And_Reset (Success : out Boolean)
is
GMBUS2 : Word32;
begin
- Registers.Read (GMBUS_Regs (2), GMBUS2);
- Result := (GMBUS2 and (GMBUS2_HARDWARE_WAIT_PHASE or
- GMBUS2_SLAVE_STALL_TIMEOUT_ERROR or
- GMBUS2_GMBUS_INTERRUPT_STATUS or
- GMBUS2_NAK_INDICATOR)) = 0;
- end GMBUS_Ready;
-
- procedure Reset_GMBUS (Success : out Boolean) is
- begin
pragma Debug (Debug.Put_Line (GNAT.Source_Info.Enclosing_Entity));
- Registers.Write (GMBUS_Regs (1), GMBUS1_SOFTWARE_CLEAR_INTERRUPT);
- Registers.Write (GMBUS_Regs (1), 0);
- Registers.Write (GMBUS_Regs (0), GMBUS0_PIN_PAIR_SELECT_NONE);
+ Registers.Read (GMBUS_Regs (2), GMBUS2);
+ if (GMBUS2 and GMBUS2_GMBUS_ACTIVE) /= 0 then
+ Registers.Write
+ (Register => GMBUS_Regs (1),
+ Value => GMBUS1_SOFTWARE_READY or GMBUS1_BUS_CYCLE_STOP);
+ Registers.Wait_Unset_Mask
+ (Register => GMBUS_Regs (2),
+ Mask => GMBUS2_GMBUS_ACTIVE,
+ TOut_MS => 1);
+ Registers.Read (GMBUS_Regs (2), GMBUS2);
+ end if;
+ Success := GMBUS_Ready (GMBUS2);
- GMBUS_Ready (Success);
- end Reset_GMBUS;
+ if not Success then
+ Registers.Write (GMBUS_Regs (1), GMBUS1_SOFTWARE_CLEAR_INTERRUPT);
+ Registers.Write (GMBUS_Regs (1), 0);
+ Registers.Read (GMBUS_Regs (2), GMBUS2);
+ Success := GMBUS_Ready (GMBUS2);
+ end if;
+ end Check_And_Reset;
procedure Init_GMBUS (Port : PCH_Port; Success : out Boolean) is
begin
@@ -157,23 +169,19 @@
-- TODO: Refactor + check for timeout.
Registers.Wait_Unset_Mask (GMBUS_Regs (2), GMBUS2_INUSE);
- GMBUS_Ready (Success);
- if not Success then
- Reset_GMBUS (Success);
- end if;
+ Registers.Write (GMBUS_Regs (4), 0);
+ Registers.Write (GMBUS_Regs (5), 0);
- if Success then
- Registers.Write
- (Register => GMBUS_Regs (0),
- Value => GMBUS0_GMBUS_RATE_SELECT_100KHZ or
- GMBUS0_PIN_PAIR_SELECT (Port));
- Registers.Write
- (Register => GMBUS_Regs (4),
- Value => 0);
- Registers.Write
- (Register => GMBUS_Regs (5),
- Value => 0);
- end if;
+ -- Resetting the state machine only works if a valid port
+ -- is selected and we don't always know which ports are
+ -- valid. So do the cleanup before we use the GMBUS with
+ -- the current port. If the port is valid, the reset should
+ -- work, if not, it shouldn't matter.
+ Registers.Write
+ (Register => GMBUS_Regs (0),
+ Value => GMBUS0_GMBUS_RATE_SELECT_100KHZ or
+ GMBUS0_PIN_PAIR_SELECT (Port));
+ Check_And_Reset (Success);
end Init_GMBUS;
procedure Release_GMBUS
--
To view, visit https://review.coreboot.org/c/libgfxinit/+/32730
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: libgfxinit
Gerrit-Branch: master
Gerrit-Change-Id: If737ffb35afa309de7746f0c16025b9598f69460
Gerrit-Change-Number: 32730
Gerrit-PatchSet: 1
Gerrit-Owner: Nico Huber <nico.h(a)gmx.de>
Gerrit-MessageType: newchange
Krystian Hebel has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/31617
Change subject: superio/ite/it8613e: add support for ITE IT8613E
......................................................................
superio/ite/it8613e: add support for ITE IT8613E
This change adds support for the SuperIO chip IT8613E. This chip uses
FANs 2-5 and have SmartGuardian always enabled (no ON/OFF control) so
it relies on support in common ITE code. LDNs were taken from datasheet.
Change-Id: I73c083b7019163c1203a5aabbef7d9d8f5ccb16a
Signed-off-by: Krystian Hebel <krystian.hebel(a)3mdeb.com>
---
A src/superio/ite/it8613e/Kconfig
A src/superio/ite/it8613e/Makefile.inc
A src/superio/ite/it8613e/chip.h
A src/superio/ite/it8613e/it8613e.h
A src/superio/ite/it8613e/superio.c
5 files changed, 189 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/17/31617/1
diff --git a/src/superio/ite/it8613e/Kconfig b/src/superio/ite/it8613e/Kconfig
new file mode 100644
index 0000000..f09cac2
--- /dev/null
+++ b/src/superio/ite/it8613e/Kconfig
@@ -0,0 +1,27 @@
+##
+## This file is part of the coreboot project.
+##
+## Copyright (C) 2009 Ronald G. Minnich
+## Copyright (C) 2014 Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
+## Copyright (C) 2017 Gergely Kiss <mail.gery(a)gmail.com>
+## Copyright (C) 2018 Kevin Cody-Little <kcodyjr(a)gmail.com>
+## Copyright (C) 2019 Protectli
+##
+## 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_ITE_IT8613E
+ bool
+ select SUPERIO_ITE_COMMON_PRE_RAM
+ select SUPERIO_ITE_ENV_CTRL
+ select SUPERIO_ITE_ENV_CTRL_PWM_FREQ2
+ select SUPERIO_ITE_ENV_CTRL_8BIT_PWM
+ select SUPERIO_ITE_ENV_CTRL_5FANS
+ select SUPERIO_ITE_ENV_CTRL_NO_ONOFF
diff --git a/src/superio/ite/it8613e/Makefile.inc b/src/superio/ite/it8613e/Makefile.inc
new file mode 100644
index 0000000..75ab26b
--- /dev/null
+++ b/src/superio/ite/it8613e/Makefile.inc
@@ -0,0 +1,19 @@
+##
+## This file is part of the coreboot project.
+##
+## Copyright (C) 2006 Uwe Hermann <uwe(a)hermann-uwe.de>
+## Copyright (C) 2017 Gergely Kiss <mail.gery(a)gmail.com>
+## Copyright (C) 2019 Protectli
+##
+## 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.
+##
+
+ramstage-$(CONFIG_SUPERIO_ITE_IT8613E) += superio.c
diff --git a/src/superio/ite/it8613e/chip.h b/src/superio/ite/it8613e/chip.h
new file mode 100644
index 0000000..65875c8
--- /dev/null
+++ b/src/superio/ite/it8613e/chip.h
@@ -0,0 +1,27 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2014 Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
+ * Copyright (C) 2019 Protectli
+ *
+ * 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_ITE_IT8613E_CHIP_H
+#define SUPERIO_ITE_IT8613E_CHIP_H
+
+#include <superio/ite/common/env_ctrl_chip.h>
+
+struct superio_ite_it8613e_config {
+ struct ite_ec_config ec;
+};
+
+#endif /* SUPERIO_ITE_IT8613E_CHIP_H */
diff --git a/src/superio/ite/it8613e/it8613e.h b/src/superio/ite/it8613e/it8613e.h
new file mode 100644
index 0000000..dace936
--- /dev/null
+++ b/src/superio/ite/it8613e/it8613e.h
@@ -0,0 +1,29 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2006 Uwe Hermann <uwe(a)hermann-uwe.de>
+ * Copyright (C) 2017 Gergely Kiss <mail.gery(a)gmail.com>
+ * Copyright (C) 2019 Protectli
+ *
+ * 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_ITE_IT8613E_H
+#define SUPERIO_ITE_IT8613E_H
+
+#define IT8613E_SP1 0x01 /* Com1 */
+#define IT8613E_EC 0x04 /* Environment controller */
+#define IT8613E_KBCK 0x05 /* PS/2 keyboard */
+#define IT8613E_KBCM 0x06 /* PS/2 mouse */
+#define IT8613E_GPIO 0x07 /* GPIO */
+#define IT8613E_CIR 0x0a /* Consumer Infrared */
+
+#endif /* SUPERIO_ITE_IT8613E_H */
diff --git a/src/superio/ite/it8613e/superio.c b/src/superio/ite/it8613e/superio.c
new file mode 100644
index 0000000..6bffc16
--- /dev/null
+++ b/src/superio/ite/it8613e/superio.c
@@ -0,0 +1,87 @@
+/*
+ * 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) 2017 Gergely Kiss <mail.gery(a)gmail.com>
+ * Copyright (C) 2019 Protectli
+ *
+ * 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 <pc80/keyboard.h>
+#include <arch/io.h>
+#include <stdlib.h>
+#include <superio/conf_mode.h>
+#include <superio/ite/common/env_ctrl.h>
+
+#include "chip.h"
+#include "it8613e.h"
+
+static void it8613e_init(struct device *dev)
+{
+ const struct superio_ite_it8613e_config *conf = dev->chip_info;
+ const struct resource *res;
+
+ if (!dev->enabled)
+ return;
+
+ switch (dev->path.pnp.device) {
+ case IT8613E_EC:
+ res = find_resource(dev, PNP_IDX_IO0);
+ if (!conf || !res)
+ break;
+ ite_ec_init(res->base, &conf->ec);
+ break;
+ case IT8613E_KBCK:
+ pc_keyboard_init(NO_AUX_DEVICE);
+ break;
+ case IT8613E_KBCM:
+ 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 = it8613e_init,
+ .ops_pnp_mode = &pnp_conf_mode_870155_aa,
+};
+
+static struct pnp_info pnp_dev_info[] = {
+ /* Serial Port 1 */
+ { NULL, IT8613E_SP1, PNP_IO0 | PNP_IRQ0 | PNP_MSC0, 0x0ff8, },
+ /* Environmental Controller */
+ { NULL, IT8613E_EC, PNP_IO0 | PNP_IO1 | PNP_IRQ0, 0x0ff8, 0x0ffc, },
+ /* KBC Keyboard */
+ { NULL, IT8613E_KBCK, PNP_IO0 | PNP_IO1 | PNP_IRQ0 | PNP_MSC0,
+ 0x0fff, 0x0fff, },
+ /* KBC Mouse */
+ { NULL, IT8613E_KBCM, PNP_IRQ0 | PNP_MSC0, },
+ /* GPIO */
+ { NULL, IT8613E_GPIO, PNP_IO0 | PNP_IO1 | PNP_IRQ0, 0x0ffc, 0x0fff, },
+ /* Consumer Infrared */
+ { NULL, IT8613E_CIR, PNP_IO0 | PNP_IRQ0 | PNP_MSC0, 0x0ff8, },
+};
+
+static void enable_dev(struct device *dev)
+{
+ pnp_enable_devices(dev, &ops, ARRAY_SIZE(pnp_dev_info), pnp_dev_info);
+}
+
+struct chip_operations superio_ite_it8613e_ops = {
+ CHIP_NAME("ITE IT8613E Super I/O")
+ .enable_dev = enable_dev,
+};
--
To view, visit https://review.coreboot.org/c/coreboot/+/31617
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I73c083b7019163c1203a5aabbef7d9d8f5ccb16a
Gerrit-Change-Number: 31617
Gerrit-PatchSet: 1
Gerrit-Owner: Krystian Hebel <krystian.hebel(a)3mdeb.com>
Gerrit-MessageType: newchange