summaryrefslogtreecommitdiff
path: root/src/drivers/spi/cbfs_spi.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/drivers/spi/cbfs_spi.c')
-rw-r--r--src/drivers/spi/cbfs_spi.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/drivers/spi/cbfs_spi.c b/src/drivers/spi/cbfs_spi.c
index e311752dee..ad282c695b 100644
--- a/src/drivers/spi/cbfs_spi.c
+++ b/src/drivers/spi/cbfs_spi.c
@@ -31,21 +31,18 @@ static struct spi_flash spi_flash_info;
static bool spi_flash_init_done;
/*
- * Set this to 1 to debug SPI speed, 0 to disable it
- * The format is:
+ * SPI speed logging for big transfers available with BIOS_DEBUG. The format is:
*
- * read SPI 62854 7db7: 10416 us, 3089 KB/s, 24.712 Mbps
+ * read SPI 0x62854 0x7db7: 10416 us, 3089 KB/s, 24.712 Mbps
*
* The important number is the last one. It should roughly match your SPI
* clock. If it doesn't, your driver might need a little tuning.
*/
-#define SPI_SPEED_DEBUG 0
-
static ssize_t spi_readat(const struct region_device *rd, void *b,
size_t offset, size_t size)
{
struct stopwatch sw;
- bool show = SPI_SPEED_DEBUG && size >= 4 * KiB;
+ bool show = size >= 4 * KiB && console_log_level(BIOS_DEBUG);
if (show)
stopwatch_init(&sw);
@@ -58,7 +55,7 @@ static ssize_t spi_readat(const struct region_device *rd, void *b,
u64 speed; /* KiB/s */
int bps; /* Bits per second */
- speed = (u64)size * 1000 / usecs;
+ speed = size * 1000 / usecs;
bps = speed * 8;
printk(BIOS_DEBUG, "read SPI %#zx %#zx: %ld us, %lld KB/s, %d.%03d Mbps\n",