Rizwan Qureshi (rizwan.qureshi(a)intel.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/18469
-gerrit
commit d99533d509dbd53a963500c17456f9e2a6efeda1
Author: Rizwan Qureshi <rizwan.qureshi(a)intel.com>
Date: Thu Feb 23 14:43:39 2017 +0530
soc/intel/skylake: indicate voltage margining enabled/disabled
Support for voltage margining is dependent on the platform.
Enbaling voltage margining puts additional constraints for
the SLP_S0# to be asserted and hence moving to S0ix state.
If the platform PMIC/VR supports PCH voltage reduction,
voltage marigining can be enabled.
Use the UPD provided by FSP to enable/disable voltage margining.
Change-Id: Iea214e9d7d6126e8367426485c6446ced63caa66
Signed-off-by: Rizwan Qureshi <rizwan.qureshi(a)intel.com>
---
src/soc/intel/skylake/chip.h | 8 ++++++++
src/soc/intel/skylake/chip_fsp20.c | 5 +++++
2 files changed, 13 insertions(+)
diff --git a/src/soc/intel/skylake/chip.h b/src/soc/intel/skylake/chip.h
index 2e4adb2..8e6fa69 100644
--- a/src/soc/intel/skylake/chip.h
+++ b/src/soc/intel/skylake/chip.h
@@ -333,6 +333,14 @@ struct soc_intel_skylake_config {
* Values: 0x0 - 4s, 0x1 - 6s, 0x2 - 8s, 0x3 - 10s, 0x4 - 12s, 0x5 - 14s
*/
u8 PmConfigPwrBtnOverridePeriod;
+
+ /*
+ * PCH Pm Slp S0 Voltage Margining Enable
+ * Indicates platform has support for VCCPrim_Core Voltage Margining
+ * in SLP_S0# asserted state.
+ */
+ u8 PchPmSlpS0VmEnable;
+
/*
* Reset Power Cycle Duration could be customized in the unit of second.
* PCH HW default is 4 seconds, and range is 1~4 seconds.
diff --git a/src/soc/intel/skylake/chip_fsp20.c b/src/soc/intel/skylake/chip_fsp20.c
index 8b8c37c..3d2f2cb 100644
--- a/src/soc/intel/skylake/chip_fsp20.c
+++ b/src/soc/intel/skylake/chip_fsp20.c
@@ -220,6 +220,11 @@ void platform_fsp_silicon_init_params_cb(FSPS_UPD *supd)
params->PchPmPwrBtnOverridePeriod =
config->PmConfigPwrBtnOverridePeriod;
params->PchPmPwrCycDur = config->PmConfigPwrCycDur;
+
+ /* Disable Voltage margining if S0ix is enabled */
+ if (config->s0ix_enable)
+ params->PchPmSlpS0VmEnable = 0x0;
+
params->PchSirqEnable = config->SerialIrqConfigSirqEnable;
params->PchSirqMode = config->SerialIrqConfigSirqMode;
Youness Alaoui (snifikino(a)gmail.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/18514
-gerrit
commit 1998e2f5d7142ccd90a79cbb9ff20309371bd09a
Author: Youness Alaoui <kakaroto(a)kakaroto.homelinux.net>
Date: Mon Feb 27 12:03:39 2017 -0500
intel/broadwell: Use the correct SATA port config for setting IOBP register
Fix a typo that was introduce in commit 696ebc2d (Broadwell/Sata:
Add support for setting IOBP registers for Ports 2 and 3.) [1].
Setting one of the SATA port 3 IOBP setting was using the value from
the port 2 register.
On the purism/librem13 (on which SATA port 3 is tested), this change
doesn't seem to affect anything, as that typo wasn't exhibiting any
visible problems anyways.
[1] https://review.coreboot.org/18408
Change-Id: I3948def5c0588791009c4b24cbc061552d9d1d48
Signed-off-by: Youness Alaoui <youness.alaoui(a)puri.sm>
---
src/soc/intel/broadwell/sata.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/soc/intel/broadwell/sata.c b/src/soc/intel/broadwell/sata.c
index 1f2e690..7b9bd0c 100644
--- a/src/soc/intel/broadwell/sata.c
+++ b/src/soc/intel/broadwell/sata.c
@@ -161,7 +161,7 @@ static void sata_init(struct device *dev)
pch_iobp_update(SATA_IOBP_SP3_SECRT88,
~(SATA_SECRT88_VADJ_MASK <<
SATA_SECRT88_VADJ_SHIFT),
- (config->sata_port2_gen3_tx &
+ (config->sata_port3_gen3_tx &
SATA_SECRT88_VADJ_MASK)
<< SATA_SECRT88_VADJ_SHIFT);
Rizwan Qureshi (rizwan.qureshi(a)intel.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/18469
-gerrit
commit 0d8b304e1657e7f27852334f9684fd84531b868f
Author: Rizwan Qureshi <rizwan.qureshi(a)intel.com>
Date: Thu Feb 23 14:43:39 2017 +0530
soc/intel/skylake: Add option to indicate voltage margining enabled/disabled
Support for voltage margining is dependent on the platform. Enbaling voltage
margining puts additional constraints for the SLP_S0# to be asserted and hence
moving to S0ix state. If the platform PMIC/VR supports PCH voltage reduction,
voltage marigining can be enabled.
Use the UPD provided by FSP to enable/disable voltage margining.
Change-Id: Iea214e9d7d6126e8367426485c6446ced63caa66
Signed-off-by: Rizwan Qureshi <rizwan.qureshi(a)intel.com>
---
src/soc/intel/skylake/chip.h | 8 ++++++++
src/soc/intel/skylake/chip_fsp20.c | 5 +++++
2 files changed, 13 insertions(+)
diff --git a/src/soc/intel/skylake/chip.h b/src/soc/intel/skylake/chip.h
index 2e4adb2..8e6fa69 100644
--- a/src/soc/intel/skylake/chip.h
+++ b/src/soc/intel/skylake/chip.h
@@ -333,6 +333,14 @@ struct soc_intel_skylake_config {
* Values: 0x0 - 4s, 0x1 - 6s, 0x2 - 8s, 0x3 - 10s, 0x4 - 12s, 0x5 - 14s
*/
u8 PmConfigPwrBtnOverridePeriod;
+
+ /*
+ * PCH Pm Slp S0 Voltage Margining Enable
+ * Indicates platform has support for VCCPrim_Core Voltage Margining
+ * in SLP_S0# asserted state.
+ */
+ u8 PchPmSlpS0VmEnable;
+
/*
* Reset Power Cycle Duration could be customized in the unit of second.
* PCH HW default is 4 seconds, and range is 1~4 seconds.
diff --git a/src/soc/intel/skylake/chip_fsp20.c b/src/soc/intel/skylake/chip_fsp20.c
index 8b8c37c..3d2f2cb 100644
--- a/src/soc/intel/skylake/chip_fsp20.c
+++ b/src/soc/intel/skylake/chip_fsp20.c
@@ -220,6 +220,11 @@ void platform_fsp_silicon_init_params_cb(FSPS_UPD *supd)
params->PchPmPwrBtnOverridePeriod =
config->PmConfigPwrBtnOverridePeriod;
params->PchPmPwrCycDur = config->PmConfigPwrCycDur;
+
+ /* Disable Voltage margining if S0ix is enabled */
+ if (config->s0ix_enable)
+ params->PchPmSlpS0VmEnable = 0x0;
+
params->PchSirqEnable = config->SerialIrqConfigSirqEnable;
params->PchSirqMode = config->SerialIrqConfigSirqMode;
Patrick Rudolph (siro(a)das-labor.org) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/18345
-gerrit
commit 14cc7b3c49ebcd1cf31bf2e1d2e0e8ff3f0bf30f
Author: Patrick Rudolph <siro(a)das-labor.org>
Date: Sun Jan 15 10:49:48 2017 +0100
libpayload-x86: Enable SSE and FPU when present
Allows to use SSE and floating point in payloads without digging to
much into x86 assembly code.
Tested on Lenovo T500 (Intel Core2Duo).
Both floating point operation and SSE is properly working.
Change-Id: I4a5fc633f158de421b70435a8bfdc0dcaa504c72
Signed-off-by: Patrick Rudolph <siro(a)das-labor.org>
---
payloads/libpayload/arch/x86/head.S | 43 +++++++++++++++++++++++++++++++++++++
1 file changed, 43 insertions(+)
diff --git a/payloads/libpayload/arch/x86/head.S b/payloads/libpayload/arch/x86/head.S
index 94a4d41..5250470 100644
--- a/payloads/libpayload/arch/x86/head.S
+++ b/payloads/libpayload/arch/x86/head.S
@@ -2,6 +2,7 @@
* This file is part of the libpayload project.
*
* Copyright (C) 2008 Advanced Micro Devices, Inc.
+ * Copyright (C) 2017 Patrick Rudolph <siro(a)das-labor.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -89,6 +90,48 @@ _init:
movl $_stack, %esp
pushl %eax
+ /* Enable special x86 functions if present. */
+ pushl %eax
+ pushl %ebx
+ pushl %ecx
+ pushl %edx
+
+ movl $0, %eax
+ cpuid
+ /* Test if CPUID(eax=1) is available. */
+ test %eax, %eax
+ je cpuid_done
+
+ /* Get CPU features. */
+ movl $1, %eax
+ cpuid
+
+cpuid_fpu:
+ /* Test if x87 FPU is present */
+ test $1, %edx
+ je cpuid_sse
+
+ fninit
+ movl %cr0, %eax
+ andl $0xFFFFFFFB, %eax /* clear EM */
+ orl $0x00000022, %eax /* set MP, NE */
+ movl %eax, %cr0
+
+cpuid_sse:
+ /* Test if SSE is available */
+ test $0x02000000, %edx
+ je cpuid_done
+
+ movl %cr4, %eax
+ orl $0x00000600, %eax /* set OSFXSR, OSXMMEXCPT */
+ movl %eax, %cr4
+
+cpuid_done:
+ popl %edx
+ popl %ecx
+ popl %ebx
+ popl %eax
+
/* Let's rock. */
call start_main
Patrick Rudolph (siro(a)das-labor.org) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/18345
-gerrit
commit fc2b8d15528cf5e281770fe6289d30e79422d220
Author: Patrick Rudolph <siro(a)das-labor.org>
Date: Sun Jan 15 10:49:48 2017 +0100
libpayload: Enable SSE and FPU when present
Allows to use SSE and floating point in payloads without digging to
much into x86 assembly code.
Tested on Lenovo T500 (Intel Core2Duo).
Both floating point operation and SSE is properly working.
Change-Id: I4a5fc633f158de421b70435a8bfdc0dcaa504c72
Signed-off-by: Patrick Rudolph <siro(a)das-labor.org>
---
payloads/libpayload/arch/x86/head.S | 43 +++++++++++++++++++++++++++++++++++++
1 file changed, 43 insertions(+)
diff --git a/payloads/libpayload/arch/x86/head.S b/payloads/libpayload/arch/x86/head.S
index 94a4d41..5250470 100644
--- a/payloads/libpayload/arch/x86/head.S
+++ b/payloads/libpayload/arch/x86/head.S
@@ -2,6 +2,7 @@
* This file is part of the libpayload project.
*
* Copyright (C) 2008 Advanced Micro Devices, Inc.
+ * Copyright (C) 2017 Patrick Rudolph <siro(a)das-labor.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -89,6 +90,48 @@ _init:
movl $_stack, %esp
pushl %eax
+ /* Enable special x86 functions if present. */
+ pushl %eax
+ pushl %ebx
+ pushl %ecx
+ pushl %edx
+
+ movl $0, %eax
+ cpuid
+ /* Test if CPUID(eax=1) is available. */
+ test %eax, %eax
+ je cpuid_done
+
+ /* Get CPU features. */
+ movl $1, %eax
+ cpuid
+
+cpuid_fpu:
+ /* Test if x87 FPU is present */
+ test $1, %edx
+ je cpuid_sse
+
+ fninit
+ movl %cr0, %eax
+ andl $0xFFFFFFFB, %eax /* clear EM */
+ orl $0x00000022, %eax /* set MP, NE */
+ movl %eax, %cr0
+
+cpuid_sse:
+ /* Test if SSE is available */
+ test $0x02000000, %edx
+ je cpuid_done
+
+ movl %cr4, %eax
+ orl $0x00000600, %eax /* set OSFXSR, OSXMMEXCPT */
+ movl %eax, %cr4
+
+cpuid_done:
+ popl %edx
+ popl %ecx
+ popl %ebx
+ popl %eax
+
/* Let's rock. */
call start_main
Rizwan Qureshi (rizwan.qureshi(a)intel.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/18063
-gerrit
commit f79ffd16ae604db3bdcfa06bb21ff1630f98a0d6
Author: Rizwan Qureshi <rizwan.qureshi(a)intel.com>
Date: Mon Jan 9 19:00:06 2017 +0530
drivers/i2c/tps68470: Add TPS68470 PMIC SSDT generator
Add TPS68470 PMIC SSDT generator.
Change-Id: Iaa1dba094a7f791d5b624e545b03b510a4306337
Signed-off-by: Rizwan Qureshi <rizwan.qureshi(a)intel.com>
---
src/drivers/i2c/tps68470/Kconfig | 2 +
src/drivers/i2c/tps68470/Makefile.inc | 1 +
src/drivers/i2c/tps68470/chip.h | 26 ++++++++++
src/drivers/i2c/tps68470/tps68470.c | 94 +++++++++++++++++++++++++++++++++++
4 files changed, 123 insertions(+)
diff --git a/src/drivers/i2c/tps68470/Kconfig b/src/drivers/i2c/tps68470/Kconfig
new file mode 100644
index 0000000..75d81dc
--- /dev/null
+++ b/src/drivers/i2c/tps68470/Kconfig
@@ -0,0 +1,2 @@
+config DRIVERS_I2C_TPS68470
+ bool
diff --git a/src/drivers/i2c/tps68470/Makefile.inc b/src/drivers/i2c/tps68470/Makefile.inc
new file mode 100644
index 0000000..3fa4412
--- /dev/null
+++ b/src/drivers/i2c/tps68470/Makefile.inc
@@ -0,0 +1 @@
+ramstage-$(CONFIG_DRIVERS_I2C_TPS68470) += tps68470.c
diff --git a/src/drivers/i2c/tps68470/chip.h b/src/drivers/i2c/tps68470/chip.h
new file mode 100644
index 0000000..d82d9bd
--- /dev/null
+++ b/src/drivers/i2c/tps68470/chip.h
@@ -0,0 +1,26 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright 2017 Intel Corporation.
+ *
+ * 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 <arch/acpi_device.h>
+
+#define TPS68470_MAX_CLDB_BUF 32
+
+struct drivers_i2c_tps68470_config {
+
+ /* I2C Bus Frequency in Hertz (default 400kHz) */
+ unsigned bus_speed;
+
+ uint8_t cldb_buf[TPS68470_MAX_CLDB_BUF];
+};
diff --git a/src/drivers/i2c/tps68470/tps68470.c b/src/drivers/i2c/tps68470/tps68470.c
new file mode 100644
index 0000000..f7c2ce1
--- /dev/null
+++ b/src/drivers/i2c/tps68470/tps68470.c
@@ -0,0 +1,94 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright 2017 Intel Corporation.
+ *
+ * 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 <arch/acpi.h>
+#include <arch/acpi_device.h>
+#include <arch/acpigen.h>
+#include <console/console.h>
+#include <device/i2c.h>
+#include <device/device.h>
+#include <device/path.h>
+#include <stdint.h>
+#include <string.h>
+#include "chip.h"
+
+#if IS_ENABLED(CONFIG_HAVE_ACPI_TABLES)
+
+#define TPS68470_ACPI_NAME "PMIC"
+
+static void tps68470_fill_ssdt(struct device *dev)
+{
+ struct drivers_i2c_tps68470_config *config = dev->chip_info;
+ const char *scope = acpi_device_scope(dev);
+ struct acpi_i2c i2c = {
+ .address = dev->path.i2c.device,
+ .mode_10bit = dev->path.i2c.mode_10bit,
+ .speed = config->bus_speed ? : I2C_SPEED_FAST,
+ .resource = scope,
+ };
+
+ if (!dev->enabled || !scope)
+ return;
+
+ /* Device */
+ acpigen_write_scope(scope);
+ acpigen_write_device(acpi_device_name(dev));
+ acpigen_write_name_string("_HID", "INT3472");
+ acpigen_write_name_integer("_UID", 0);
+ acpigen_write_name_string("_DDN", dev->chip_ops->name);
+ acpigen_write_STA(ACPI_STATUS_DEVICE_ALL_ON);
+
+ /* Resources */
+ acpigen_write_name("_CRS");
+ acpigen_write_resourcetemplate_header();
+ acpi_device_write_i2c(&i2c);
+ acpigen_write_resourcetemplate_footer();
+
+ /* Device Properties */
+ acpigen_write_method_serialized("CLDB",0);
+ acpigen_write_return_byte_buffer(config->cldb_buf,
+ TPS68470_MAX_CLDB_BUF);
+
+ acpigen_pop_len(); /* Method */
+ acpigen_pop_len(); /* Device */
+ acpigen_pop_len(); /* Scope */
+
+}
+
+static const char *tps68470_acpi_name(struct device *dev)
+{
+ return TPS68470_ACPI_NAME;
+}
+#endif
+
+static struct device_operations tps68470_ops = {
+ .read_resources = DEVICE_NOOP,
+ .set_resources = DEVICE_NOOP,
+ .enable_resources = DEVICE_NOOP,
+#if IS_ENABLED(CONFIG_HAVE_ACPI_TABLES)
+ .acpi_name = &tps68470_acpi_name,
+ .acpi_fill_ssdt_generator = &tps68470_fill_ssdt,
+#endif
+};
+
+static void tps68470_enable(struct device *dev)
+{
+ dev->ops = &tps68470_ops;
+}
+
+struct chip_operations drivers_i2c_tps68470_ops = {
+ CHIP_NAME("TPS 68470 PMIC")
+ .enable_dev = &tps68470_enable
+};