Paul Menzel (paulepanter(a)users.sourceforge.net) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/18503
-gerrit
commit 1c161da0148c17a921b0cc7aef6f7f99b4c238d9
Author: Paul Menzel <paulepanter(a)users.sourceforge.net>
Date: Sun Feb 26 19:58:24 2017 +0100
drivers/spi: Measure execution time of `spi_flash_probe()`
Stop the time of the execution of the method `spi_flash_probe()`. It’s
useful to analyze the boot process, and to compare different flash ROM
chips.
TEST=Build and boot on ASRock E350M1, and observe the new messages.
```
Manufacturer: ef
SF: Detected W25Q32 with sector size 0x1000, total 0x400000
spi_flash_probe: Probing the flash chip took 24 usecs
SF: Successfully erased 4096 bytes @ 0xffff1000
Manufacturer: ef
SF: Detected W25Q32 with sector size 0x1000, total 0x400000
spi_flash_probe: Probing the flash chip took 21 usecs
SF: Successfully erased 4096 bytes @ 0xffff0000
```
Change-Id: I448e12508b09a8796c5351b17495113afe9a50ef
Signed-off-by: Paul Menzel <paulepanter(a)users.sourceforge.net>
---
src/drivers/spi/spi_flash.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/drivers/spi/spi_flash.c b/src/drivers/spi/spi_flash.c
index 95362f2..b2e928b 100644
--- a/src/drivers/spi/spi_flash.c
+++ b/src/drivers/spi/spi_flash.c
@@ -331,6 +331,9 @@ struct spi_flash *spi_flash_probe(unsigned int bus, unsigned int cs)
{
struct spi_slave spi;
struct spi_flash *flash;
+ struct stopwatch sw;
+
+ stopwatch_init(&sw);
if (spi_setup_slave(bus, cs, &spi)) {
printk(BIOS_WARNING, "SF: Failed to set up slave\n");
@@ -365,6 +368,9 @@ struct spi_flash *spi_flash_probe(unsigned int bus, unsigned int cs)
CONFIG_BOOT_DEVICE_SPI_FLASH_BUS == bus && !spi_flash_dev)
spi_flash_dev = flash;
+ printk(BIOS_DEBUG, "%s: Probing the flash chip took %ld usecs\n",
+ __func__, stopwatch_duration_usecs(&sw));
+
return flash;
}
Marshall Dawson (marshalldawson3rd(a)gmail.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/18492
-gerrit
commit 71f9703cbe32e3ac3efbe44e1531bc1e91ce9d6f
Author: Marc Jones <marcj303(a)gmail.com>
Date: Fri Feb 24 16:40:41 2017 -0700
vendorcode/amd/pi/00670F00: Clean up CAR disable
Clean up the AMD_DISABLE_STACK_FAMILY_HOOK_F15 to be clear that
it does a wbinvd to preserve the coreboot stack and CAR globals.
The Stoney Ridge uses a different S3 architecture, so this is not
an issue of reserving or relocating the stack on a resume.
Change-Id: I77e53262212e00bce9145b0bc3909ad8651f2328
Signed-off-by: Marc Jones <marcj303(a)gmail.com>
Signed-off-by: Marshall Dawson <marshalldawson3rd(a)gmail.com>
---
src/vendorcode/amd/pi/00670F00/binaryPI/gcccar.inc | 20 +++++++++++++++-----
1 file changed, 15 insertions(+), 5 deletions(-)
diff --git a/src/vendorcode/amd/pi/00670F00/binaryPI/gcccar.inc b/src/vendorcode/amd/pi/00670F00/binaryPI/gcccar.inc
index d6782a3..4005057 100644
--- a/src/vendorcode/amd/pi/00670F00/binaryPI/gcccar.inc
+++ b/src/vendorcode/amd/pi/00670F00/binaryPI/gcccar.inc
@@ -401,6 +401,14 @@ fam15_enable_stack_hook_exit:
* Return any family specific controls to their 'standard'
* settings for using cache with main memory.
*
+* Note: Customized for coreboot:
+* A wbinvd is used to send cache to memory to preserve stack and
+* coreboot CAR globals. This should NOT be used with S3 resume IF the
+* stack/cache area is not reserved and over system memory.
+*
+* This CPU resume path doesn't use CAR, but be careful if porting to
+* other CPUs.
+*
* Inputs:
* ESI - [31:24] flags; [15,8]= Node#; [7,0]= core#
* Outputs:
@@ -634,11 +642,13 @@ fam15_disable_stack_remote_read_exit:
# Begin critical sequence in which EAX, BX, ECX, and EDX must be preserved.
#--------------------------------------------------------------------------
- mov $HWCR, %ecx # MSR:C001_0015h
- _RDMSR
- btr $INVD_WBINVD, %eax # Disable INVD -> WBINVD conversion
- _WRMSR
- wbinvd #bao # Clear the cache tag RAMs
+ #--------------------------------------------------------------------------
+ # Send cache to memory. Preserve stack and coreboot CAR globals.
+ # This shouldn't be used with S3 resume IF the stack/cache area is
+ # not reserved and over system memory.
+ #--------------------------------------------------------------------------
+ wbinvd # Clear the cache tag RAMs
+
# #.if (bh == 01h) || (bh == 03h) ; Is this TN or KM?
# cmp $01, %bh
# jz 4f
Alexander Couzens (lynxis(a)fe80.eu) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/12888
-gerrit
commit c85017fda3a3dd90a37066618b92092e00e625be
Author: Marian Tietz <mtcoreboot(a)gmail.com>
Date: Sat Jan 9 17:41:14 2016 +0100
ec/lenovo/h8: Add USB Always On fields
USB AO is the internal name for the dedicated charging port
on ThinkPads when in S3 or lower.
AOEN is used for enabling the feature (on PTS) and AOCF is
the configuration field for the different modes. The modes
are (according to Peter Stuge):
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 activates this feature on the X220. On PTS activate the
dedicated charging port to work under AC in all states and in battery under
S3. On wake-up the port is set back to USB2 mode.
To test this functionality USB devices (e.g. a smartphone) should be
able to negotiate full power from the dedicated charging port in S3
using a normal data cable. Without the Always On functionality this
is not possible.
Change-Id: Ief8de3e41fd6a701c6b3dbce81118d5eeb0fa648
Signed-off-by: Marian Tietz <mtcoreboot(a)gmail.com>
---
src/ec/lenovo/h8/acpi/ec.asl | 4 ++++
src/mainboard/lenovo/x220/acpi/platform.asl | 12 ++++++++++++
2 files changed, 16 insertions(+)
diff --git a/src/ec/lenovo/h8/acpi/ec.asl b/src/ec/lenovo/h8/acpi/ec.asl
index b69acf8..340443d 100644
--- a/src/ec/lenovo/h8/acpi/ec.asl
+++ b/src/ec/lenovo/h8/acpi/ec.asl
@@ -32,6 +32,10 @@ Device(EC)
HSPA, 1,
Offset (0x0C),
LEDS, 8, /* LED state */
+ Offset (0x0D),
+ AOEN, 1, /* USB Always On Enable */
+ , 1,
+ AOCF, 2, /* USB Always On Config */
Offset (0x1a),
DKR2, 1, /* Dock register 2 */
Offset (0x2a),
diff --git a/src/mainboard/lenovo/x220/acpi/platform.asl b/src/mainboard/lenovo/x220/acpi/platform.asl
index 3e9225c..70e6088 100644
--- a/src/mainboard/lenovo/x220/acpi/platform.asl
+++ b/src/mainboard/lenovo/x220/acpi/platform.asl
@@ -20,6 +20,15 @@
Method(_PTS,1)
{
\_SB.PCI0.LPCB.EC.RADI(0)
+
+ Store (1, \_SB.PCI0.LPCB.EC.AOEN)
+
+ /*
+ * 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
+ */
+ Store (0, \_SB.PCI0.LPCB.EC.AOCF)
}
/* The _WAK method is called on system wakeup */
@@ -30,6 +39,9 @@ Method(_WAK,1)
Store (0, \_TZ.MEB1)
Store (0, \_TZ.MEB2)
+ /* Deactivate dedicated charging port, activate USB2.0 */
+ Store (0, \_SB.PCI0.LPCB.EC.AOEN)
+
/* Not implemented. */
Return(Package(){0,0})
}
Paul Menzel (paulepanter(a)users.sourceforge.net) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/18503
-gerrit
commit c8d16be346a2eab7e05607c0d532a3ec1d974f19
Author: Paul Menzel <paulepanter(a)users.sourceforge.net>
Date: Sun Feb 26 19:58:24 2017 +0100
drivers/spi: Measure execution time of `spi_flash_probe()`
Stop the time of the execution of the method `spi_flash_probe()`. It’s
useful to analyze the boot process, and to compare different flash ROM
chips.
Change-Id: I448e12508b09a8796c5351b17495113afe9a50ef
Signed-off-by: Paul Menzel <paulepanter(a)users.sourceforge.net>
---
src/drivers/spi/spi_flash.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/drivers/spi/spi_flash.c b/src/drivers/spi/spi_flash.c
index 95362f2..b2e928b 100644
--- a/src/drivers/spi/spi_flash.c
+++ b/src/drivers/spi/spi_flash.c
@@ -331,6 +331,9 @@ struct spi_flash *spi_flash_probe(unsigned int bus, unsigned int cs)
{
struct spi_slave spi;
struct spi_flash *flash;
+ struct stopwatch sw;
+
+ stopwatch_init(&sw);
if (spi_setup_slave(bus, cs, &spi)) {
printk(BIOS_WARNING, "SF: Failed to set up slave\n");
@@ -365,6 +368,9 @@ struct spi_flash *spi_flash_probe(unsigned int bus, unsigned int cs)
CONFIG_BOOT_DEVICE_SPI_FLASH_BUS == bus && !spi_flash_dev)
spi_flash_dev = flash;
+ printk(BIOS_DEBUG, "%s: Probing the flash chip took %ld usecs\n",
+ __func__, stopwatch_duration_usecs(&sw));
+
return flash;
}
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 af7b7fcd70ebea8df74384ef0e012b28c203cb2e
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..7f2ea15 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_see
+
+ fninit
+ movl %cr0, %eax
+ andl $0xFFFFFFFB, %eax /* clear EM */
+ orl $0x00000022, %eax /* set MP, NE */
+ movl %eax, %cr0
+
+cpuid_see:
+ /* 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