Paul Menzel (paulepanter@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@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@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; }