the following patch was just integrated into master:
commit d5be4e3d7e7d092d3ea9dc98738c39ea43d3f738
Author: Aaron Durbin <adurbin(a)chromium.org>
Date: Fri Nov 4 10:53:43 2016 -0500
elog: add sources to reflect full event type namespace usage
Some events were added in other places, but coreboot's
elog namespace wasn't updated. As such there's a collision
with the thermtrip event. This change at least updates the
elog information to reflect potential event type uage.
BUG=chrome-os-partner:59395
Change-Id: Ib82e2b65ef7d34e260b7d7450174aee7537b69f6
Signed-off-by: Aaron Durbin <adurbin(a)chromium.org>
Reviewed-on: https://review.coreboot.org/17230
Tested-by: build bot (Jenkins)
Reviewed-by: Furquan Shaikh <furquan(a)google.com>
See https://review.coreboot.org/17230 for details.
-gerrit
the following patch was just integrated into master:
commit d9b1050dfba7cc97b95ca9dcc72ae6172d8a1735
Author: Aaron Durbin <adurbin(a)chromium.org>
Date: Fri Nov 4 11:17:54 2016 -0500
elog: fix default elog_add_event_raw() declaration
When CONFIG_ELOG isn't used default empty inline functions are
provided, however the elog_add_event_raw() had the wrong type
signature. Fix that.
BUG=chrome-os-partner:59395
Change-Id: Iaee68440bbafc1e91c88a7b03e283fc3e72de0a3
Signed-off-by: Aaron Durbin <adurbin(a)chromium.org>
Reviewed-on: https://review.coreboot.org/17232
Tested-by: build bot (Jenkins)
Reviewed-by: Furquan Shaikh <furquan(a)google.com>
See https://review.coreboot.org/17232 for details.
-gerrit
the following patch was just integrated into master:
commit e0ed9025cf7453212e5e5a845e34e0b7ecfa3eb9
Author: Nico Huber <nico.huber(a)secunet.com>
Date: Fri Oct 7 12:58:17 2016 +0200
Add option to use Ada code in ramstage
If selected, libgnat will be linked into ramstage. And, to support Ada
package intializations, we have to call ramstage_adainit().
Change-Id: I11417db21f16bf3007739a097d63fd592344bce3
Signed-off-by: Nico Huber <nico.huber(a)secunet.com>
Reviewed-on: https://review.coreboot.org/16944
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin(a)chromium.org>
See https://review.coreboot.org/16944 for details.
-gerrit
Nicola Corna (nicola(a)corna.info) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/17252
-gerrit
commit 27ec5093ed622a32930f8891dbec45366a49049b
Author: Nicola Corna <nicola(a)corna.info>
Date: Sat Nov 5 16:06:59 2016 +0100
ec/lenovo/h8: Add USB Always On
USB AO is the internal name for the dedicated charging port on ThinkPads
when in S3 or lower.
AOEN (bit 0) is internal name for enabling this feature while AOCF (bits 2
and 3) is the configuration field. According to Peter Stuge, AOCF can be
configured in this way:
00 => AC S3 S4 S4 USB on, battery S3 USB on, battery S4 S5 off
11 => AC S3 S4 S4 USB on, battery S3 S4 S5 USB off
10, 01 => equivalent to 00
This commit also adds a new configuration field in the CMOS of the X220
and the X201 to activate this feature. It probably can be also added to
all the Thinkpads that support this functionality.
With this functionality USB devices are able to negotiate full power from
the dedicated port (usually the yellow one) even in S3.
Tested on a X201 and X220 with an Android smartphone: with this feature
enabled it shows "Charging" when connected during S3, without it it shows
"Charging slowly" (or it doesn't charge at all on the X201).
Change-Id: Ie1269a4357e2fbd608ad8b7b8262275914730f6e
Signed-off-by: Nicola Corna <nicola(a)corna.info>
---
src/ec/lenovo/h8/h8.c | 1 +
src/ec/lenovo/h8/h8.h | 5 +++++
src/mainboard/lenovo/x201/cmos.default | 1 +
src/mainboard/lenovo/x201/cmos.layout | 6 ++++--
src/mainboard/lenovo/x201/smihandler.c | 17 +++++++++++++++--
src/mainboard/lenovo/x220/cmos.default | 1 +
src/mainboard/lenovo/x220/cmos.layout | 5 ++++-
src/mainboard/lenovo/x220/smihandler.c | 17 +++++++++++++++--
8 files changed, 46 insertions(+), 7 deletions(-)
diff --git a/src/ec/lenovo/h8/h8.c b/src/ec/lenovo/h8/h8.c
index 703acad..2484b3b 100644
--- a/src/ec/lenovo/h8/h8.c
+++ b/src/ec/lenovo/h8/h8.c
@@ -313,6 +313,7 @@ static void h8_enable(struct device *dev)
ec_write(0x1f, conf->eventf_enable);
ec_write(H8_FAN_CONTROL, H8_FAN_CONTROL_AUTO);
+ ec_write(H8_USB_ALWAYS_ON, H8_USB_ALWAYS_ON_DISABLE);
h8_trackpoint_enable(1);
h8_usb_power_enable(1);
diff --git a/src/ec/lenovo/h8/h8.h b/src/ec/lenovo/h8/h8.h
index d3803c0..c893396 100644
--- a/src/ec/lenovo/h8/h8.h
+++ b/src/ec/lenovo/h8/h8.h
@@ -64,6 +64,11 @@ void h8_mainboard_init_dock (void);
#define H8_LED_CONTROL_ON 0x80
#define H8_LED_CONTROL_BLINK 0xc0
+#define H8_USB_ALWAYS_ON 0x0d
+#define H8_USB_ALWAYS_ON_DISABLE 0x00
+#define H8_USB_ALWAYS_ON_AC_ONLY 0x0d
+#define H8_USB_ALWAYS_ON_AC_BAT 0x01
+
#define H8_LED_CONTROL_POWER_LED 0x00
#define H8_LED_CONTROL_BAT0_LED 0x01
#define H8_LED_CONTROL_BAT1_LED 0x02
diff --git a/src/mainboard/lenovo/x201/cmos.default b/src/mainboard/lenovo/x201/cmos.default
index 50d17ae..9f1e31d 100644
--- a/src/mainboard/lenovo/x201/cmos.default
+++ b/src/mainboard/lenovo/x201/cmos.default
@@ -15,3 +15,4 @@ sticky_fn=Disable
power_management_beeps=Enable
low_battery_beep=Enable
sata_mode=AHCI
+usb_always_on=Disable
diff --git a/src/mainboard/lenovo/x201/cmos.layout b/src/mainboard/lenovo/x201/cmos.layout
index 2a91eb7..36b09f2 100644
--- a/src/mainboard/lenovo/x201/cmos.layout
+++ b/src/mainboard/lenovo/x201/cmos.layout
@@ -70,8 +70,7 @@ entries
419 1 e 1 power_management_beeps
420 1 e 1 low_battery_beep
421 1 e 9 sata_mode
-
-#422 2 r 0 unused
+422 2 e 11 usb_always_on
# coreboot config options: northbridge
424 3 e 10 gfx_uma_size
@@ -123,6 +122,9 @@ enumerations
10 3 128M
10 5 96M
10 6 160M
+11 0 Disable
+11 1 AC only
+11 2 AC and battery
# -----------------------------------------------------------------
checksums
diff --git a/src/mainboard/lenovo/x201/smihandler.c b/src/mainboard/lenovo/x201/smihandler.c
index 591a521..60186d3 100644
--- a/src/mainboard/lenovo/x201/smihandler.c
+++ b/src/mainboard/lenovo/x201/smihandler.c
@@ -2,6 +2,7 @@
* This file is part of the coreboot project.
*
* Copyright (C) 2008-2009 coresystems GmbH
+ * Copyright (C) 2016 Nicola Corna <nicola(a)corna.info>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -178,10 +179,22 @@ int mainboard_smi_apmc(u8 data)
void mainboard_smi_sleep(u8 slp_typ)
{
+ u8 val;
+
+ if (get_option(&val, "usb_always_on") != CB_SUCCESS)
+ val = 0;
+
+ if (val == 1)
+ ec_write(H8_USB_ALWAYS_ON, H8_USB_ALWAYS_ON_AC_ONLY);
+ else if (val == 2)
+ ec_write(H8_USB_ALWAYS_ON, H8_USB_ALWAYS_ON_AC_BAT);
+ else
+ ec_write(H8_USB_ALWAYS_ON, H8_USB_ALWAYS_ON_DISABLE);
+
if (slp_typ == 3) {
- u8 ec_wake = ec_read(0x32);
+ val = ec_read(0x32);
/* If EC wake events are enabled, enable wake on EC WAKE GPE. */
- if (ec_wake & 0x14) {
+ if (val & 0x14) {
/* Redirect EC WAKE GPE to SCI. */
gpi_route_interrupt(GPE_EC_WAKE, GPI_IS_SCI);
}
diff --git a/src/mainboard/lenovo/x220/cmos.default b/src/mainboard/lenovo/x220/cmos.default
index 1b8e212..91331ab 100644
--- a/src/mainboard/lenovo/x220/cmos.default
+++ b/src/mainboard/lenovo/x220/cmos.default
@@ -10,6 +10,7 @@ wwan=Enable
wlan=Enable
touchpad=Enable
sata_mode=AHCI
+usb_always_on=Disable
fn_ctrl_swap=Disable
sticky_fn=Disable
trackpoint=Enable
diff --git a/src/mainboard/lenovo/x220/cmos.layout b/src/mainboard/lenovo/x220/cmos.layout
index 143ee80..bc506f1 100644
--- a/src/mainboard/lenovo/x220/cmos.layout
+++ b/src/mainboard/lenovo/x220/cmos.layout
@@ -69,7 +69,7 @@ entries
418 1 e 1 sticky_fn
419 1 e 1 power_management_beeps
421 1 e 9 sata_mode
-#422 2 r 1 unused
+422 2 e 12 usb_always_on
# coreboot config options: cpu
424 1 e 2 hyper_threading
@@ -134,6 +134,9 @@ enumerations
11 4 160M
11 5 192M
11 6 224M
+12 0 Disable
+12 1 AC only
+12 2 AC and battery
# -----------------------------------------------------------------
checksums
diff --git a/src/mainboard/lenovo/x220/smihandler.c b/src/mainboard/lenovo/x220/smihandler.c
index 08554c9..71af2cc 100644
--- a/src/mainboard/lenovo/x220/smihandler.c
+++ b/src/mainboard/lenovo/x220/smihandler.c
@@ -3,6 +3,7 @@
*
* Copyright (C) 2008-2009 coresystems GmbH
* Copyright (C) 2014 Vladimir Serbinenko
+ * Copyright (C) 2016 Nicola Corna <nicola(a)corna.info>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -133,10 +134,22 @@ int mainboard_smi_apmc(u8 data)
void mainboard_smi_sleep(u8 slp_typ)
{
+ u8 val;
+
+ if (get_option(&val, "usb_always_on") != CB_SUCCESS)
+ val = 0;
+
+ if (val == 1)
+ ec_write(H8_USB_ALWAYS_ON, H8_USB_ALWAYS_ON_AC_ONLY);
+ else if (val == 2)
+ ec_write(H8_USB_ALWAYS_ON, H8_USB_ALWAYS_ON_AC_BAT);
+ else
+ ec_write(H8_USB_ALWAYS_ON, H8_USB_ALWAYS_ON_DISABLE);
+
if (slp_typ == 3) {
- u8 ec_wake = ec_read(0x32);
+ val = ec_read(0x32);
/* If EC wake events are enabled, enable wake on EC WAKE GPE. */
- if (ec_wake & 0x14) {
+ if (val & 0x14) {
/* Redirect EC WAKE GPE to SCI. */
gpi_route_interrupt(GPE_EC_WAKE, GPI_IS_SCI);
}
Naresh Solanki (naresh.solanki(a)intel.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/17067
-gerrit
commit 55a7f10a78e272228b869e7884ce0fcec485d9cc
Author: Sumeet Pawnikar <sumeet.r.pawnikar(a)intel.com>
Date: Tue Oct 18 10:57:58 2016 +0530
soc/intel/skylake: Add _ACx methods for TSR0 sensor for fan control
This patch updates below info,
[1] Delete the DPTF_CPU_ACTIVE_AC* values because these are not
being used. Hence, removing unnecessary defines.
[2] Add new DPTF_TSR0_ACTIVE_AC* temperature trip points for TSR0
external thermal sensor. These trip points are being used by _ACx
methods to control the fan speed on Skylake-U fan based Lars and
Kunimitsu platforms.
[3] Follow up patches are using DPTF_CPU_ACTIVE_AC* temperature trip
points in board specific acpi/dptf.asl (for lars, kunimitsu, etc) to
control the fan speed as per the CPU temperature trip points.
[4] Newly added _ACx methods for thermal sensor TSR0 in this patch
has nothing to do with DPTF_CPU_ACTIVE_AC*.
We can control fan speed using various different thermal sensors.
In this patch, we have added new _ACx methods for TSR0 thermal sensor.
We run the fan at different speeds to cool down the system at different
TSR0 temperatures.
Similarly, we considered CPU sensor temperature values and ran the fan
at different speeds to cool down the system.
BUG=chrome-os-partner:51025
BRANCH=firmware-glados-7820.B
TEST=Built and booted on kunimitsu and lars EVT boards.
Verified these _ACx methods with _ART table on these boards
with different workloads.
Change-Id: Ia7b81e03da936c4a0f69057e43f18efd7c3b9f17
Signed-off-by: Sumeet Pawnikar <sumeet.r.pawnikar(a)intel.com>
Reviewed-on: https://chromium-review.googlesource.com/332368
---
src/soc/intel/skylake/acpi/dptf/cpu.asl | 20 ----------------
src/soc/intel/skylake/acpi/dptf/thermal.asl | 37 +++++++++++++++++++++++++++++
2 files changed, 37 insertions(+), 20 deletions(-)
diff --git a/src/soc/intel/skylake/acpi/dptf/cpu.asl b/src/soc/intel/skylake/acpi/dptf/cpu.asl
index 32e8863..6278b9f 100644
--- a/src/soc/intel/skylake/acpi/dptf/cpu.asl
+++ b/src/soc/intel/skylake/acpi/dptf/cpu.asl
@@ -22,26 +22,6 @@
#define DPTF_CPU_CRITICAL 90
#endif
-#ifndef DPTF_CPU_ACTIVE_AC0
-#define DPTF_CPU_ACTIVE_AC0 90
-#endif
-
-#ifndef DPTF_CPU_ACTIVE_AC1
-#define DPTF_CPU_ACTIVE_AC1 80
-#endif
-
-#ifndef DPTF_CPU_ACTIVE_AC2
-#define DPTF_CPU_ACTIVE_AC2 70
-#endif
-
-#ifndef DPTF_CPU_ACTIVE_AC3
-#define DPTF_CPU_ACTIVE_AC3 60
-#endif
-
-#ifndef DPTF_CPU_ACTIVE_AC4
-#define DPTF_CPU_ACTIVE_AC4 50
-#endif
-
External (\_PR.CP00._PSS, PkgObj)
External (\_PR.CP00._TSS, PkgObj)
External (\_PR.CP00._TPC, MethodObj)
diff --git a/src/soc/intel/skylake/acpi/dptf/thermal.asl b/src/soc/intel/skylake/acpi/dptf/thermal.asl
index d9bd9c0..a94c278 100644
--- a/src/soc/intel/skylake/acpi/dptf/thermal.asl
+++ b/src/soc/intel/skylake/acpi/dptf/thermal.asl
@@ -110,6 +110,43 @@ Device (TSR0)
{
\_SB.PCI0.LPCB.EC0.PATD (TMPI)
}
+
+#ifdef DPTF_ENABLE_FAN_CONTROL
+ Method (_AC0)
+ {
+ Return (\_SB.DPTF.CTOK (DPTF_TSR0_ACTIVE_AC0))
+ }
+
+ Method (_AC1)
+ {
+ Return (\_SB.DPTF.CTOK (DPTF_TSR0_ACTIVE_AC1))
+ }
+
+ Method (_AC2)
+ {
+ Return (\_SB.DPTF.CTOK (DPTF_TSR0_ACTIVE_AC2))
+ }
+
+ Method (_AC3)
+ {
+ Return (\_SB.DPTF.CTOK (DPTF_TSR0_ACTIVE_AC3))
+ }
+
+ Method (_AC4)
+ {
+ Return (\_SB.DPTF.CTOK (DPTF_TSR0_ACTIVE_AC4))
+ }
+
+ Method (_AC5)
+ {
+ Return (\_SB.DPTF.CTOK (DPTF_TSR0_ACTIVE_AC5))
+ }
+
+ Method (_AC6)
+ {
+ Return (\_SB.DPTF.CTOK (DPTF_TSR0_ACTIVE_AC6))
+ }
+#endif
}
#endif