[coreboot-gerrit] Patch set updated for coreboot: drivers/spi: Measure execution time of `spi_flash_probe()`
Paul Menzel (paulepanter@users.sourceforge.net)
gerrit at coreboot.org
Wed Mar 1 09:21:51 CET 2017
Paul Menzel (paulepanter at users.sourceforge.net) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/18503
-gerrit
commit 660f4aca97fa3151acb943e912a70e9aacb7d67f
Author: Paul Menzel <paulepanter at users.sourceforge.net>
Date: Sun Feb 26 19:58:24 2017 +0100
drivers/spi: Measure execution time of `spi_flash_probe()`
Measure 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 at 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;
}
More information about the coreboot-gerrit
mailing list