Furquan Shaikh (furquan(a)google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/16259
-gerrit
commit cf8e4d91b9be4a427c2e01ec9c72b7b61bcac56f
Author: Furquan Shaikh <furquan(a)google.com>
Date: Thu Aug 18 21:42:36 2016 -0700
intel/skylake: Do not halt in poweroff if in SMM
Calling halt in poweroff when in SMM prevents SLP_SMI to be triggered
preventing the system from entering sleep state. Fix this by calling
halt only if ENV_SMM is not true.
BUG=chrome-os-partner:56395
Change-Id: I3addc1ea065346fbc5dbec9d1ad49bbd0ae05696
Signed-off-by: Furquan Shaikh <furquan(a)google.com>
---
src/soc/intel/skylake/pmutil.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/src/soc/intel/skylake/pmutil.c b/src/soc/intel/skylake/pmutil.c
index 807579d..31de242 100644
--- a/src/soc/intel/skylake/pmutil.c
+++ b/src/soc/intel/skylake/pmutil.c
@@ -25,6 +25,7 @@
#include <device/pci_def.h>
#include <console/console.h>
#include <halt.h>
+#include <rules.h>
#include <stdlib.h>
#include <soc/gpio.h>
#include <soc/iomap.h>
@@ -435,5 +436,12 @@ uint16_t smbus_tco_regs(void)
void poweroff(void)
{
enable_pm1_control(SLP_EN | (SLP_TYP_S5 << SLP_TYP_SHIFT));
- halt();
+
+ /*
+ * Setting SLP_TYP_S5 in PM1 triggers SLP_SMI, which is handled by SMM
+ * to transition to S5 state. If halt is called in SMM, then it prevents
+ * the SMI handler from being triggered and system never enters S5.
+ */
+ if (!ENV_SMM)
+ halt();
}
Furquan Shaikh (furquan(a)google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/16258
-gerrit
commit 35469d5699d4034df0cb305570a11d472900f7fc
Author: Furquan Shaikh <furquan(a)google.com>
Date: Thu Aug 18 21:39:14 2016 -0700
google/chromeec: Ensure data is ready before reading it
Before reading the data provided by EC to the host, ensure that data
ready flag is set. Otherwise, it could result in reading stale/incorrect
data from the data buffer.
BUG=chrome-os-partner:56395
BRANCH=None
TEST=Verified that lidclose event is read correctly by host on reef.
Change-Id: I88e345d64256af8325b3dbf670467d09f09420f0
Signed-off-by: Furquan Shaikh <furquan(a)google.com>
---
src/ec/google/chromeec/ec_lpc.c | 23 ++++++++++++++++++++---
1 file changed, 20 insertions(+), 3 deletions(-)
diff --git a/src/ec/google/chromeec/ec_lpc.c b/src/ec/google/chromeec/ec_lpc.c
index 06b506b..51a6e53 100644
--- a/src/ec/google/chromeec/ec_lpc.c
+++ b/src/ec/google/chromeec/ec_lpc.c
@@ -96,7 +96,7 @@ static inline u8 write_byte(u8 val, u16 port)
return byte;
}
-static int google_chromeec_wait_ready(u16 port)
+static int google_chromeec_status_check(u16 port, u8 mask, u8 cond)
{
u8 ec_status = read_byte(port);
u32 time_count = 0;
@@ -108,8 +108,7 @@ static int google_chromeec_wait_ready(u16 port)
*/
#define MAX_EC_TIMEOUT_US 1000000
- while (ec_status &
- (EC_LPC_CMDR_PENDING | EC_LPC_CMDR_BUSY)) {
+ while ((ec_status & mask) != cond) {
udelay(1);
if (time_count++ == MAX_EC_TIMEOUT_US)
return -1;
@@ -118,6 +117,13 @@ static int google_chromeec_wait_ready(u16 port)
return 0;
}
+static int google_chromeec_wait_ready(u16 port)
+{
+ return google_chromeec_status_check(port,
+ EC_LPC_CMDR_PENDING |
+ EC_LPC_CMDR_BUSY, 0);
+}
+
#if CONFIG_EC_GOOGLE_CHROMEEC_ACPI_MEMMAP
/* Read memmap data through ACPI port 66/62 */
static int read_memmap(u8 *data, u8 offset)
@@ -481,6 +487,12 @@ struct chip_operations ec_google_chromeec_ops = {
#endif /* __SMM__ */
+static int google_chromeec_data_ready(u16 port)
+{
+ return google_chromeec_status_check(port, EC_LPC_CMDR_DATA,
+ EC_LPC_CMDR_DATA);
+}
+
u8 google_chromeec_get_event(void)
{
if (google_chromeec_wait_ready(EC_LPC_ADDR_ACPI_CMD)) {
@@ -496,6 +508,11 @@ u8 google_chromeec_get_event(void)
return 0;
}
+ if (google_chromeec_data_ready(EC_LPC_ADDR_ACPI_CMD)) {
+ printk(BIOS_ERR, "Timeout waiting for data ready!\n");
+ return 0;
+ }
+
/* Event (or 0 if none) is returned directly in the data byte */
return read_byte(EC_LPC_ADDR_ACPI_DATA);
}
Furquan Shaikh (furquan(a)google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/16257
-gerrit
commit 4af9371a2335058b4c8b39e0b8b75f7922b05832
Author: Furquan Shaikh <furquan(a)google.com>
Date: Thu Aug 18 21:31:50 2016 -0700
intel/apollolake: Do not halt in poweroff if in SMM
Calling halt in poweroff when in SMM prevents SLP_SMI to be triggered
preventing the system from entering sleep state. Fix this by calling
halt only if ENV_SMM is not true.
BUG=chrome-os-partner:56395
BRANCH=None
TEST=Verified lidclose behavior on reef.
Change-Id: If116c8f4e867543abdc2ff235457c167b5073767
Signed-off-by: Furquan Shaikh <furquan(a)google.com>
---
src/soc/intel/apollolake/pmutil.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/src/soc/intel/apollolake/pmutil.c b/src/soc/intel/apollolake/pmutil.c
index dabc268..aaa4018 100644
--- a/src/soc/intel/apollolake/pmutil.c
+++ b/src/soc/intel/apollolake/pmutil.c
@@ -443,5 +443,12 @@ void vboot_platform_prepare_reboot(void)
void poweroff(void)
{
enable_pm1_control(SLP_EN | (SLP_TYP_S5 << SLP_TYP_SHIFT));
- halt();
+
+ /*
+ * Setting SLP_TYP_S5 in PM1 triggers SLP_SMI, which is handled by SMM
+ * to transition to S5 state. If halt is called in SMM, then it prevents
+ * the SMI handler from being triggered and system never enters S5.
+ */
+ if (!ENV_SMM)
+ halt();
}
Jonathan Neuschäfer (j.neuschaefer(a)gmx.net) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/16263
-gerrit
commit d73062e5111ef48bb7cc6efc9a7133b788bf184b
Author: Jonathan Neuschäfer <j.neuschaefer(a)gmx.net>
Date: Fri Aug 19 12:10:21 2016 +0200
arch/riscv: Map the kernel space into RAM (2GiB+)
Change-Id: I273e9d20e02f0333f28e0fc2adcc7940578ea93e
Signed-off-by: Jonathan Neuschäfer <j.neuschaefer(a)gmx.net>
---
src/arch/riscv/virtual_memory.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/arch/riscv/virtual_memory.c b/src/arch/riscv/virtual_memory.c
index 18d2862..eb219e7 100644
--- a/src/arch/riscv/virtual_memory.c
+++ b/src/arch/riscv/virtual_memory.c
@@ -186,9 +186,9 @@ void initVirtualMemory(void) {
}
printk(BIOS_DEBUG, "Initializing virtual memory...\n");
- uintptr_t physicalStart = 0x1000000; // TODO: Figure out how to grab this from cbfs
- uintptr_t virtualStart = 0xffffffff81000000;
- uintptr_t pageTableStart = 0x1400000;
+ uintptr_t physicalStart = 0x90000000; // TODO: Figure out how to grab this from cbfs
+ uintptr_t virtualStart = 0xffffffff80000000;
+ uintptr_t pageTableStart = 0x91400000;
init_vm(virtualStart, physicalStart, pageTableStart);
mb();