Marc Jones (marcj303@gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/1965
-gerrit
commit 968c4be6ac0d674749421450d9fda0d64bbb2330 Author: Marc Jones marc.jones@se-eng.com Date: Mon Dec 3 22:16:29 2012 -0700
Limit SPI device debug prints with CONFIG_DEBUG_SPI_FLASH
Fix debug printks which were not using CONFIG_DEBUG_SPI_FLASH, which would cause long delays durring boot when SPI devices were written.
Change-Id: I99fc3d5f847fdf4bb98e2a0342ea418ab7d5fc54 Signed-off-by: Marc Jones marc.jones@se-eng.com --- src/drivers/spi/eon.c | 4 +++- src/drivers/spi/gigadevice.c | 5 ++++- src/drivers/spi/macronix.c | 4 +++- src/drivers/spi/spansion.c | 4 +++- src/drivers/spi/spi_flash.c | 3 ++- src/drivers/spi/sst.c | 9 +++++++-- src/drivers/spi/stmicro.c | 4 +++- src/drivers/spi/winbond.c | 4 +++- 8 files changed, 28 insertions(+), 9 deletions(-)
diff --git a/src/drivers/spi/eon.c b/src/drivers/spi/eon.c index 7d9bc44..2215a74 100644 --- a/src/drivers/spi/eon.c +++ b/src/drivers/spi/eon.c @@ -112,8 +112,10 @@ static int eon_write(struct spi_flash *flash, byte_addr = 0; }
- printk(BIOS_INFO, "SF: EON: Successfully programmed %zu bytes @ 0x%x\n", +#if CONFIG_DEBUG_SPI_FLASH + printk(BIOS_SPEW, "SF: EON: Successfully programmed %zu bytes @ 0x%x\n", len, offset); +#endif
spi_release_bus(flash->spi); return ret; diff --git a/src/drivers/spi/gigadevice.c b/src/drivers/spi/gigadevice.c index 0647baf..ece6978 100644 --- a/src/drivers/spi/gigadevice.c +++ b/src/drivers/spi/gigadevice.c @@ -175,9 +175,12 @@ static int gigadevice_write(struct spi_flash *flash, u32 offset, byte_addr = 0; }
- printk(BIOS_INFO, +#if CONFIG_DEBUG_SPI_FLASH + printk(BIOS_SPEW, "SF gigadevice.c: Successfully programmed %zu bytes @ %#x\n", len, (unsigned int)(offset - len)); +#endif + ret = 0;
out: diff --git a/src/drivers/spi/macronix.c b/src/drivers/spi/macronix.c index 332de23..0a0d62b 100644 --- a/src/drivers/spi/macronix.c +++ b/src/drivers/spi/macronix.c @@ -176,8 +176,10 @@ static int macronix_write(struct spi_flash *flash, byte_addr = 0; }
- printk(BIOS_INFO, "SF: Macronix: Successfully programmed %zu bytes @" +#if CONFIG_DEBUG_SPI_FLASH + printk(BIOS_SPEW, "SF: Macronix: Successfully programmed %zu bytes @" " 0x%lx\n", len, (unsigned long)(offset - len)); +#endif
spi_release_bus(flash->spi); return ret; diff --git a/src/drivers/spi/spansion.c b/src/drivers/spi/spansion.c index 511091b..328892c 100644 --- a/src/drivers/spi/spansion.c +++ b/src/drivers/spi/spansion.c @@ -189,8 +189,10 @@ static int spansion_write(struct spi_flash *flash, byte_addr = 0; }
- printk(BIOS_INFO, "SF: SPANSION: Successfully programmed %zu bytes @ 0x%x\n", +#if CONFIG_DEBUG_SPI_FLASH + printk(BIOS_SPEW, "SF: SPANSION: Successfully programmed %zu bytes @ 0x%x\n", len, offset); +#endif
spi_release_bus(flash->spi); return ret; diff --git a/src/drivers/spi/spi_flash.c b/src/drivers/spi/spi_flash.c index 7116cbf..75a5c21 100644 --- a/src/drivers/spi/spi_flash.c +++ b/src/drivers/spi/spi_flash.c @@ -162,9 +162,10 @@ int spi_flash_cmd_erase(struct spi_flash *flash, u8 erase_cmd, spi_flash_addr(offset, cmd); offset += erase_size;
+#if CONFIG_DEBUG_SPI_FLASH printk(BIOS_SPEW, "SF: erase %2x %2x %2x %2x (%x)\n", cmd[0], cmd[1], cmd[2], cmd[3], offset); - +#endif ret = spi_flash_cmd(flash->spi, CMD_WRITE_ENABLE, NULL, 0); if (ret) goto out; diff --git a/src/drivers/spi/sst.c b/src/drivers/spi/sst.c index ebeb441..2609591 100644 --- a/src/drivers/spi/sst.c +++ b/src/drivers/spi/sst.c @@ -130,8 +130,10 @@ sst_byte_write(struct spi_flash *flash, u32 offset, const void *buf) offset, };
+#if CONFIG_DEBUG_SPI_FLASH printk(BIOS_SPEW, "BP[%02x]: 0x%p => cmd = { 0x%02x 0x%06x }\n", spi_w8r8(flash->spi, CMD_SST_RDSR), buf, cmd[0], offset); +#endif
ret = sst_enable_writing(flash); if (ret) @@ -177,9 +179,11 @@ sst_write(struct spi_flash *flash, u32 offset, size_t len, const void *buf) cmd[3] = offset;
for (; actual < len - 1; actual += 2) { +#if CONFIG_DEBUG_SPI_FLASH printk(BIOS_SPEW, "WP[%02x]: 0x%p => cmd = { 0x%02x 0x%06x }\n", spi_w8r8(flash->spi, CMD_SST_RDSR), buf + actual, cmd[0], offset); +#endif
ret = spi_flash_cmd_write(flash->spi, cmd, cmd_len, buf + actual, 2); @@ -204,9 +208,10 @@ sst_write(struct spi_flash *flash, u32 offset, size_t len, const void *buf) ret = sst_byte_write(flash, offset, buf + actual);
done: - printk(BIOS_INFO, "SF: SST: program %s %zu bytes @ 0x%lx\n", +#if CONFIG_DEBUG_SPI_FLASH + printk(BIOS_SPEW, "SF: SST: program %s %zu bytes @ 0x%lx\n", ret ? "failure" : "success", len, (unsigned long)offset - actual); - +#endif spi_release_bus(flash->spi); return ret; } diff --git a/src/drivers/spi/stmicro.c b/src/drivers/spi/stmicro.c index ccdfa00..d10429b 100644 --- a/src/drivers/spi/stmicro.c +++ b/src/drivers/spi/stmicro.c @@ -190,8 +190,10 @@ static int stmicro_write(struct spi_flash *flash, byte_addr = 0; }
- printk(BIOS_INFO, "SF: STMicro: Successfully programmed %zu bytes @ 0x%x\n", +#if CONFIG_DEBUG_SPI_FLASH + printk(BIOS_SPEW, "SF: STMicro: Successfully programmed %zu bytes @ 0x%x\n", len, offset); +#endif
spi_release_bus(flash->spi); return ret; diff --git a/src/drivers/spi/winbond.c b/src/drivers/spi/winbond.c index 50c2ed4..2878675 100644 --- a/src/drivers/spi/winbond.c +++ b/src/drivers/spi/winbond.c @@ -157,8 +157,10 @@ static int winbond_write(struct spi_flash *flash, byte_addr = 0; }
- printk(BIOS_INFO, "SF: Winbond: Successfully programmed %zu bytes @" +#if CONFIG_DEBUG_SPI_FLASH + printk(BIOS_SPEW, "SF: Winbond: Successfully programmed %zu bytes @" " 0x%lx\n", len, (unsigned long)(offset - len)); +#endif ret = 0;
out: