Sumeet R Pawnikar has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/33129
Change subject: soc/intel/cannonlake: Set correct temperature threshold for PCH Thermal Sensor
......................................................................
soc/intel/cannonlake: Set correct temperature threshold for PCH Thermal Sensor
PMC logic shuts down the PCH thermal sensor when CPU is in a C-state and
DTS Temp <= Low Temp Threshold (LTT) in case of Dynamic Thermal shutdown
when S0ix is enabled.
BUG=None
BRANCH=None
TEST=Verified Thermal Device (B0: D18: F0) TSPM offset 0x1c [LTT (8:0)]
value is 0xFA.
Change-Id: Ibd1e669fcbfe8dc6e6e5556aa5b1373ed19c3685
Signed-off-by: Sumeet Pawnikar <sumeet.r.pawnikar(a)intel.com>
---
M src/soc/intel/cannonlake/Makefile.inc
M src/soc/intel/cannonlake/chip.h
M src/soc/intel/cannonlake/finalize.c
M src/soc/intel/cannonlake/include/soc/iomap.h
A src/soc/intel/cannonlake/include/soc/thermal.h
A src/soc/intel/cannonlake/thermal.c
6 files changed, 147 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/29/33129/1
diff --git a/src/soc/intel/cannonlake/Makefile.inc b/src/soc/intel/cannonlake/Makefile.inc
index 1328944..03faa3c 100644
--- a/src/soc/intel/cannonlake/Makefile.inc
+++ b/src/soc/intel/cannonlake/Makefile.inc
@@ -53,6 +53,7 @@
ramstage-y += smmrelocate.c
ramstage-y += spi.c
ramstage-y += systemagent.c
+ramstage-y += thermal.c
ramstage-y += uart.c
ramstage-y += vr_config.c
ramstage-y += sd.c
diff --git a/src/soc/intel/cannonlake/chip.h b/src/soc/intel/cannonlake/chip.h
index 0d51c1c..39f808b 100644
--- a/src/soc/intel/cannonlake/chip.h
+++ b/src/soc/intel/cannonlake/chip.h
@@ -421,6 +421,9 @@
* Bit 0: MISCCFG_GPDLCGEN
*/
uint8_t gpio_pm[TOTAL_GPIO_COMM];
+
+ /* PCH Trip Temperature */
+ uint8_t pch_trip_temp;
};
typedef struct soc_intel_cannonlake_config config_t;
diff --git a/src/soc/intel/cannonlake/finalize.c b/src/soc/intel/cannonlake/finalize.c
index 4dfd15b..d277658 100644
--- a/src/soc/intel/cannonlake/finalize.c
+++ b/src/soc/intel/cannonlake/finalize.c
@@ -32,6 +32,7 @@
#include <soc/pm.h>
#include <soc/smbus.h>
#include <soc/systemagent.h>
+#include <soc/thermal.h>
#include <stdlib.h>
#include "chip.h"
@@ -63,6 +64,16 @@
uint8_t reg8;
tco_lockdown();
+
+ /*
+ * Set low maximum temp value used for dynamic thermal sensor
+ * shutdown consideration.
+ *
+ * If Dynamic Thermal Shutdown is enabled then PMC logic shuts down the
+ * thermal sensor when CPU is in a C-state and DTS Temp <= LTT.
+ */
+ pch_thermal_configuration();
+
/*
* Disable ACPI PM timer based on dt policy
*
diff --git a/src/soc/intel/cannonlake/include/soc/iomap.h b/src/soc/intel/cannonlake/include/soc/iomap.h
index 100bd11..488d938 100644
--- a/src/soc/intel/cannonlake/include/soc/iomap.h
+++ b/src/soc/intel/cannonlake/include/soc/iomap.h
@@ -76,6 +76,8 @@
#define HECI1_BASE_ADDRESS 0xfeda2000
+#define THERMAL_BASE_ADDRESS 0xfe600000
+
#define VTD_BASE_ADDRESS 0xFED90000
#define VTD_BASE_SIZE 0x00004000
/*
diff --git a/src/soc/intel/cannonlake/include/soc/thermal.h b/src/soc/intel/cannonlake/include/soc/thermal.h
new file mode 100644
index 0000000..1f4085c
--- /dev/null
+++ b/src/soc/intel/cannonlake/include/soc/thermal.h
@@ -0,0 +1,24 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2019 Intel Corp.
+ *
+ * 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 _SOC_THERMAL_H_
+#define _SOC_THERMAL_H_
+
+#define THERMAL_SENSOR_POWER_MANAGEMENT 0x1c
+
+/* Enable thermal sensor power management */
+void pch_thermal_configuration(void);
+
+#endif
diff --git a/src/soc/intel/cannonlake/thermal.c b/src/soc/intel/cannonlake/thermal.c
new file mode 100644
index 0000000..9d62843
--- /dev/null
+++ b/src/soc/intel/cannonlake/thermal.c
@@ -0,0 +1,106 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2019 Intel Corp.
+ *
+ * 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.
+ */
+
+#include <device/mmio.h>
+#include <device/pci_ops.h>
+#include <console/console.h>
+#include <device/device.h>
+#include <device/pci.h>
+#include <soc/iomap.h>
+#include <soc/pci_devs.h>
+#include <soc/thermal.h>
+
+#include "chip.h"
+
+#define MAX_TRIP_TEMP 205
+#define DEFAULT_TRIP_TEMP 50
+
+static void *pch_thermal_get_bar(struct device *dev)
+{
+ uintptr_t bar;
+
+ bar = pci_read_config32(dev, PCI_BASE_ADDRESS_0);
+ /*
+ * Bits [31:12] are the base address as per EDS for Thermal Device,
+ * Don't care about [11:0] bits
+ */
+ return (void *)(bar & ~PCI_BASE_ADDRESS_MEM_ATTR_MASK);
+}
+
+static void pch_thermal_set_bar(struct device *dev, uintptr_t tempbar)
+{
+ uint8_t pcireg;
+
+ /* Assign Resources to Thermal Device */
+ /* Clear BIT 1-2 of Command Register */
+ pcireg = pci_read_config8(dev, PCI_COMMAND);
+ pcireg &= ~(PCI_COMMAND_MASTER | PCI_COMMAND_MEMORY);
+ pci_write_config8(dev, PCI_COMMAND, pcireg);
+
+ /* Program Temporary BAR for Thermal Device */
+ pci_write_config32(dev, PCI_BASE_ADDRESS_0, tempbar);
+ pci_write_config32(dev, PCI_BASE_ADDRESS_1, 0x0);
+
+ /* Enable Bus Master and MMIO Space */
+ pcireg = pci_read_config8(dev, PCI_COMMAND);
+ pcireg |= PCI_COMMAND_MASTER | PCI_COMMAND_MEMORY;
+ pci_write_config8(dev, PCI_COMMAND, pcireg);
+}
+
+/* PCH Low Temp Threshold (LTT) */
+static uint16_t pch_get_ltt_value(struct device *dev)
+{
+ static struct soc_intel_skylake_config *config;
+ uint16_t ltt_value;
+ uint16_t trip_temp = DEFAULT_TRIP_TEMP;
+
+ config = dev->chip_info;
+
+ if (config->pch_trip_temp)
+ trip_temp = config->pch_trip_temp;
+
+ if (trip_temp > MAX_TRIP_TEMP)
+ die("Input PCH temp trip is higher than allowed range!");
+
+ /* Trip Point Temp = (LTT / 2 - 50 degree C) */
+ ltt_value = (trip_temp + 50) * 2;
+
+ return ltt_value;
+}
+
+/* Enable thermal sensor power management */
+void pch_thermal_configuration(void)
+{
+ uint16_t reg16;
+ struct device *dev = PCH_DEV_THERMAL;
+ if (!dev) {
+ printk(BIOS_ERR, "PCH_DEV_THERMAL device not found!\n");
+ return;
+ }
+ void *thermalbar = pch_thermal_get_bar(dev);
+
+ /* Use default pre-ram bar */
+ if (!thermalbar) {
+ pch_thermal_set_bar(dev, THERMAL_BASE_ADDRESS);
+ thermalbar = (void *)THERMAL_BASE_ADDRESS;
+ }
+
+ /* Set Low Temp Threshold (LTT) at TSPM offset 0x1c[8:0] */
+ reg16 = read16(thermalbar + THERMAL_SENSOR_POWER_MANAGEMENT);
+ reg16 &= ~0x1ff;
+ /* Low Temp Threshold (LTT) */
+ reg16 |= pch_get_ltt_value(dev);
+ write16(thermalbar + THERMAL_SENSOR_POWER_MANAGEMENT, reg16);
+}
--
To view, visit https://review.coreboot.org/c/coreboot/+/33129
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ibd1e669fcbfe8dc6e6e5556aa5b1373ed19c3685
Gerrit-Change-Number: 33129
Gerrit-PatchSet: 1
Gerrit-Owner: Sumeet R Pawnikar <sumeet.r.pawnikar(a)intel.com>
Gerrit-MessageType: newchange
Hello Angel Pons, Arthur Heymans, Matt DeVillier,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/libgfxinit/+/36443
to review the following change.
Change subject: gma config: Add Comet Lake PCI IDs
......................................................................
gma config: Add Comet Lake PCI IDs
Comet Lake is still treated like Kaby Lake :)
Change-Id: I543f1a50c204d963de80111aa0afd724e4093c4a
Signed-off-by: Nico Huber <nico.h(a)gmx.de>
---
M common/hw-gfx-gma-config.ads.template
1 file changed, 15 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/libgfxinit refs/changes/43/36443/1
diff --git a/common/hw-gfx-gma-config.ads.template b/common/hw-gfx-gma-config.ads.template
index 0e49943..7347341 100644
--- a/common/hw-gfx-gma-config.ads.template
+++ b/common/hw-gfx-gma-config.ads.template
@@ -428,6 +428,17 @@
function Is_Coffee_Lake (Device_Id : Word16) return Boolean is
((Device_Id and 16#fff0#) = 16#3e90#);
+ function Is_Comet_Lake_U (Device_Id : Word16) return Boolean is
+ ((Device_Id and 16#ff9f#) = 16#9b01# or
+ (Device_Id and 16#ff9f#) = 16#9b8a# or
+ (Device_Id and 16#ff9f#) = 16#9b8c#);
+ function Is_Comet_Lake (Device_Id : Word16) return Boolean is
+ ((Device_Id and 16#ff8f#) = 16#9b82# or
+ (Device_Id and 16#ff8f#) = 16#9b84# or
+ (Device_Id and 16#ff8f#) = 16#9b85# or
+ (Device_Id and 16#ff8f#) = 16#9b86# or
+ (Device_Id and 16#ff8f#) = 16#9b88#);
+
function Is_GPU (Device_Id : Word16; CPU : CPU_Type; CPU_Var : CPU_Variant)
return Boolean is
(case CPU is
@@ -452,10 +463,12 @@
when Kabylake => (case CPU_Var is
when Normal =>
Is_Kaby_Lake (Device_Id) or
- Is_Coffee_Lake (Device_Id),
+ Is_Coffee_Lake (Device_Id) or
+ Is_Comet_Lake (Device_Id),
when ULT =>
Is_Kaby_Lake_U (Device_Id) or
- Is_Coffee_Lake_U (Device_Id),
+ Is_Coffee_Lake_U (Device_Id) or
+ Is_Comet_Lake_U (Device_Id),
when ULX =>
Is_Kaby_Lake_Y (Device_Id) or
Is_Kaby_Lake_Y_AML (Device_Id) or
--
To view, visit https://review.coreboot.org/c/libgfxinit/+/36443
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: libgfxinit
Gerrit-Branch: master
Gerrit-Change-Id: I543f1a50c204d963de80111aa0afd724e4093c4a
Gerrit-Change-Number: 36443
Gerrit-PatchSet: 1
Gerrit-Owner: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Reviewer: Matt DeVillier <matt.devillier(a)gmail.com>
Gerrit-MessageType: newchange
Marshall Dawson has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/36418 )
Change subject: [NOT FOR MERGE]: Demo adding near_reset_vector symbol
......................................................................
[NOT FOR MERGE]: Demo adding near_reset_vector symbol
In https://review.coreboot.org/c/coreboot/+/35035/8/src/arch/x86/early_dram.ld
we had a discussion about whether an approach like for RESET_VECTOR_IN_RAM
could potentially be used for a bootblock that needed to grow >64KB (to keep
the first 16-bit jmp within reach).
This is a mockup of the test I ran to verify that would be practical. Using
this code I built a google/grunt and recorded the following with readelf.
Section Headers:
[Nr] Name Type Addr Off Size ES Flg Lk Inf Al
[ 0] NULL 00000000 000000 000000 00 0 0 0
[ 1] .text PROGBITS ffff0000 000060 0059d0 00 AX 0 0 32
[ 2] .rel.text REL 00000000 01335c 001378 08 I 10 1 4
[ 3] .car.data NOBITS 00030000 000000 005860 00 WA 0 0 4
[ 4] .near_reset_vecto PROGBITS fffffe00 00fe60 0000bb 00 AX 0 0 4
[ 5] .rel.near_reset_v REL 00000000 0146d4 000040 08 I 10 4 4
[ 6] .reset PROGBITS fffffff0 010050 000010 00 AX 0 0 1
[ 7] .rel.reset REL 00000000 014714 000008 08 I 10 6 4
[ 8] .id PROGBITS ffffff4a 00ffaa 000036 00 A 0 0 1
[ 9] .gnu_debuglink PROGBITS 00000000 010060 000014 00 0 0 4
[10] .symtab SYMTAB 00000000 010074 001a80 10 11 243 4
[11] .strtab STRTAB 00000000 011af4 001868 00 0 0 1
[12] .shstrtab STRTAB 00000000 01471c 000064 00 0 0 1
Note, however, that I did not grow the bootblock.elf file; only inserted the
section and relocated the _start16bit code.
fffffe00 <_start16bit>:
fffffe00: fa cli
fffffe01: 66 89 c5 mov %ax,%bp
fffffe04: b0 01 mov $0x1,%al
fffffe06: e6 80 out %al,$0x80
fffffe08: 66 31 c0 xor %ax,%ax
fffffe0b: 0f 22 d8 mov %eax,%cr3
fffffe0e: 8c c8 mov %cs,%eax
fffffe10: c1 e0 04 shl $0x4,%eax
fffffe13: bb 4c fe 29 c3 mov $0xc329fe4c,%ebx
fffffe18: 2e 0f 01 1f lidtl %cs:(%edi)
fffffe1c: bb 44 fe 29 c3 mov $0xc329fe44,%ebx
fffffe21: 2e 66 0f 01 17 lgdtw %cs:(%edi)
fffffe26: 0f 20 c0 mov %cr0,%eax
fffffe29: 66 25 d1 ff and $0xffd1,%ax
fffffe2d: fa cli
fffffe2e: 7f 66 jg fffffe96 <__protected_start+0xb>
fffffe30: 0d 01 00 00 60 or $0x60000001,%eax
fffffe35: 0f 22 c0 mov %eax,%cr0
fffffe38: 66 89 e8 mov %bp,%ax
fffffe3b: 66 ea 8b fe ff ff ljmpw $0xffff,$0xfe8b
fffffe41: 08 00 or %al,(%eax)
fffffe43: 90 nop
Growing the elf should be reasonably straightforward. Right now reset16.ld
has a built-in assumption of 64KB. For RESET_VECTOR_IN_RAM I've added a
size symbol to Kconfig (yet to land still) for locating the reset vector
and near_reset_vector at the very top, and so that the calculations are
expected to match the instructions given to the PSP.
Change-Id: I6e7888c778e1d1cc426e4160543f4a4662ebf834
Signed-off-by: Marshall Dawson <marshalldawson3rd(a)gmail.com>
---
M src/cpu/x86/16bit/entry16.inc
M src/cpu/x86/16bit/reset16.ld
2 files changed, 11 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/18/36418/1
diff --git a/src/cpu/x86/16bit/entry16.inc b/src/cpu/x86/16bit/entry16.inc
index 9e00c55..6062abd 100644
--- a/src/cpu/x86/16bit/entry16.inc
+++ b/src/cpu/x86/16bit/entry16.inc
@@ -37,6 +37,9 @@
.align 4096
#endif
.code16
+
+.section ".near_reset_vector", "ax", %progbits
+
.globl _start16bit
.type _start16bit, @function
diff --git a/src/cpu/x86/16bit/reset16.ld b/src/cpu/x86/16bit/reset16.ld
index c57cc96..31716e0 100644
--- a/src/cpu/x86/16bit/reset16.ld
+++ b/src/cpu/x86/16bit/reset16.ld
@@ -17,6 +17,14 @@
*/
SECTIONS {
+ _ROMTOP = 0xfffffff0;
+ _NEAR_RESET_VECTOR = _ROMTOP + 0x10 - 0x200;
+
+ . = _NEAR_RESET_VECTOR;
+ .near_reset_vector . : {
+ *(.near_reset_vector);
+ }
+
/* Trigger an error if I have an unuseable start address */
_bogus = ASSERT(_start16bit >= 0xffff0000, "_start16bit too low. Please report.");
_ROMTOP = 0xfffffff0;
--
To view, visit https://review.coreboot.org/c/coreboot/+/36418
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I6e7888c778e1d1cc426e4160543f4a4662ebf834
Gerrit-Change-Number: 36418
Gerrit-PatchSet: 1
Gerrit-Owner: Marshall Dawson <marshalldawson3rd(a)gmail.com>
Gerrit-MessageType: newchange
Prasun Gera has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/35431 )
Change subject: src/mainboard/lenovo/t530/Kconfig: Fix PCI device id for the iGPU
......................................................................
src/mainboard/lenovo/t530/Kconfig: Fix PCI device id for the iGPU
Both T530 and W530 share the same PCI device id of 0166 for the iGPU.
Change-Id: Idce809e3820a653144db424aff1c55b70c4c693a
Signed-off-by: Prasun Gera <prasun.gera(a)gmail.com>
---
M src/mainboard/lenovo/t530/Kconfig
1 file changed, 5 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/31/35431/1
diff --git a/src/mainboard/lenovo/t530/Kconfig b/src/mainboard/lenovo/t530/Kconfig
index f63a120..4fcbcb5 100644
--- a/src/mainboard/lenovo/t530/Kconfig
+++ b/src/mainboard/lenovo/t530/Kconfig
@@ -60,7 +60,10 @@
config VGA_BIOS_FILE
string
- default "pci8086,0106.rom" if BOARD_LENOVO_T530
- default "pci8086,0166.rom" if BOARD_LENOVO_W530
+ default "pci8086,0166.rom"
+
+config VGA_BIOS_ID
+ string
+ default "8086,0166"
endif
--
To view, visit https://review.coreboot.org/c/coreboot/+/35431
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Idce809e3820a653144db424aff1c55b70c4c693a
Gerrit-Change-Number: 35431
Gerrit-PatchSet: 1
Gerrit-Owner: Prasun Gera
Gerrit-MessageType: newchange
Meera Ravindranath has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/36067 )
Change subject: mainboard/hatch/Kconfig: Add support for boot with tianocore payload
......................................................................
mainboard/hatch/Kconfig: Add support for boot with tianocore payload
Add new config and set the required GBB flags to support boot with
tianocore payload.
BUG=none
TEST=Allows boot to tianocore on pressing Ctrl+L in depthcharge.
Change-Id: I42fcf23523889d47f0490fbd662ca6b7587ab548
Signed-off-by: Meera Ravindranath <meera.ravindranath(a)intel.com>
---
M src/mainboard/google/hatch/Kconfig
1 file changed, 8 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/67/36067/1
diff --git a/src/mainboard/google/hatch/Kconfig b/src/mainboard/google/hatch/Kconfig
index 004cc28..246e258 100644
--- a/src/mainboard/google/hatch/Kconfig
+++ b/src/mainboard/google/hatch/Kconfig
@@ -33,10 +33,18 @@
select GBB_FLAG_FORCE_DEV_BOOT_USB
select GBB_FLAG_FORCE_DEV_BOOT_LEGACY
select GBB_FLAG_FORCE_MANUAL_RECOVERY
+ select GBB_FLAG_DISABLE_EC_SOFTWARE_SYNC if BOARD_USES_TIANOCORE
+ select GBB_FLAG_ENABLE_ALTERNATE_OS if BOARD_USES_TIANOCORE
select HAS_RECOVERY_MRC_CACHE
select MRC_CLEAR_NORMAL_CACHE_ON_RECOVERY_RETRAIN
select VBOOT_LID_SWITCH
+config BOARD_USES_TIANOCORE
+ bool
+ default n
+ select USE_LEGACY_8254_TIMER
+ select USE_ACPI_PM_TIMER
+
config CHROMEOS_WIFI_SAR
bool "Enable SAR options for Chrome OS build"
depends on CHROMEOS
--
To view, visit https://review.coreboot.org/c/coreboot/+/36067
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I42fcf23523889d47f0490fbd662ca6b7587ab548
Gerrit-Change-Number: 36067
Gerrit-PatchSet: 1
Gerrit-Owner: Meera Ravindranath <meera.ravindranath(a)intel.com>
Gerrit-MessageType: newchange