summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2009-07-23 01:33:43 +0000
committerCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2009-07-23 01:33:43 +0000
commit414bd320ac1346db9539625975644bfa7b30281e (patch)
tree1029c94038ad13ad5ac0b7e292c28b3135932662
parenta80cfbc3d7ebc5ebe8775652687a26e6e02247b6 (diff)
downloadast2050-flashrom-414bd320ac1346db9539625975644bfa7b30281e.zip
ast2050-flashrom-414bd320ac1346db9539625975644bfa7b30281e.tar.gz
Verbose probe output is split across multiple lines for some probe functions
This makes visual inspection and grepping a lot harder than necessary. Remove line breaks where appropriate. Some error messages should end up on stderr instead of just being displayed in verbose mode. Thanks to Maciej Pijanka for testing. Corresponding to flashrom svn r660. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Stefan Reinauer <stepan@coresystems.de>
-rw-r--r--jedec.c2
-rw-r--r--spi.c56
-rw-r--r--w29ee011.c9
3 files changed, 37 insertions, 30 deletions
diff --git a/jedec.c b/jedec.c
index 5c71980..0e426d6 100644
--- a/jedec.c
+++ b/jedec.c
@@ -99,7 +99,7 @@ int probe_jedec(struct flashchip *flash)
probe_timing_enter = probe_timing_exit = 0;
} else if (flash->probe_timing == TIMING_FIXME) { /* == _IGNORED */
printf_debug("Chip lacks correct probe timing information, "
- "using default 10mS/40uS\n");
+ "using default 10mS/40uS. ");
probe_timing_enter = 10000;
probe_timing_exit = 40;
} else {
diff --git a/spi.c b/spi.c
index 09cfc90..8d82c4e 100644
--- a/spi.c
+++ b/spi.c
@@ -163,7 +163,7 @@ static int spi_rdid(unsigned char *readarr, int bytes)
printf_debug("RDID returned");
for (i = 0; i < bytes; i++)
printf_debug(" 0x%02x", readarr[i]);
- printf_debug("\n");
+ printf_debug(". ");
return 0;
}
@@ -184,7 +184,7 @@ static int spi_rems(unsigned char *readarr)
}
if (ret)
return ret;
- printf_debug("REMS returned %02x %02x.\n", readarr[0], readarr[1]);
+ printf_debug("REMS returned %02x %02x. ", readarr[0], readarr[1]);
return 0;
}
@@ -205,7 +205,7 @@ static int spi_res(unsigned char *readarr)
}
if (ret)
return ret;
- printf_debug("RES returned %02x.\n", readarr[0]);
+ printf_debug("RES returned %02x. ", readarr[0]);
return 0;
}
@@ -218,7 +218,7 @@ int spi_write_enable(void)
result = spi_send_command(sizeof(cmd), 0, cmd, NULL);
if (result)
- printf_debug("%s failed\n", __func__);
+ fprintf(stderr, "%s failed\n", __func__);
return result;
}
@@ -241,12 +241,12 @@ static int probe_spi_rdid_generic(struct flashchip *flash, int bytes)
return 0;
if (!oddparity(readarr[0]))
- printf_debug("RDID byte 0 parity violation.\n");
+ printf_debug("RDID byte 0 parity violation. ");
/* Check if this is a continuation vendor ID */
if (readarr[0] == 0x7f) {
if (!oddparity(readarr[1]))
- printf_debug("RDID byte 1 parity violation.\n");
+ printf_debug("RDID byte 1 parity violation. ");
id1 = (readarr[0] << 8) | readarr[1];
id2 = readarr[2];
if (bytes > 3) {
@@ -373,7 +373,7 @@ uint8_t spi_read_status_register(void)
}
ret = spi_send_command(sizeof(cmd), sizeof(readarr), cmd, readarr);
if (ret)
- printf_debug("RDSR failed!\n");
+ fprintf(stderr, "RDSR failed!\n");
return readarr[0];
}
@@ -506,13 +506,14 @@ int spi_chip_erase_60(struct flashchip *flash)
result = spi_disable_blockprotect();
if (result) {
- printf_debug("spi_disable_blockprotect failed\n");
+ fprintf(stderr, "spi_disable_blockprotect failed\n");
return result;
}
result = spi_send_multicommand(spicommands);
if (result) {
- printf_debug("%s failed during command execution\n", __func__);
+ fprintf(stderr, "%s failed during command execution\n",
+ __func__);
return result;
}
/* Wait until the Write-In-Progress bit is cleared.
@@ -551,13 +552,13 @@ int spi_chip_erase_c7(struct flashchip *flash)
result = spi_disable_blockprotect();
if (result) {
- printf_debug("spi_disable_blockprotect failed\n");
+ fprintf(stderr, "spi_disable_blockprotect failed\n");
return result;
}
result = spi_send_multicommand(spicommands);
if (result) {
- printf_debug("%s failed during command execution\n", __func__);
+ fprintf(stderr, "%s failed during command execution\n", __func__);
return result;
}
/* Wait until the Write-In-Progress bit is cleared.
@@ -607,7 +608,8 @@ int spi_block_erase_52(struct flashchip *flash, unsigned int addr, unsigned int
result = spi_send_multicommand(spicommands);
if (result) {
- printf_debug("%s failed during command execution\n", __func__);
+ fprintf(stderr, "%s failed during command execution\n",
+ __func__);
return result;
}
/* Wait until the Write-In-Progress bit is cleared.
@@ -650,7 +652,7 @@ int spi_block_erase_d8(struct flashchip *flash, unsigned int addr, unsigned int
result = spi_send_multicommand(spicommands);
if (result) {
- printf_debug("%s failed during command execution\n", __func__);
+ fprintf(stderr, "%s failed during command execution\n", __func__);
return result;
}
/* Wait until the Write-In-Progress bit is cleared.
@@ -678,7 +680,7 @@ int spi_chip_erase_d8(struct flashchip *flash)
for (i = 0; i < total_size / erase_size; i++) {
rc = spi_block_erase_d8(flash, i * erase_size, erase_size);
if (rc) {
- printf("Error erasing block at 0x%x\n", i);
+ fprintf(stderr, "Error erasing block at 0x%x\n", i);
break;
}
}
@@ -712,7 +714,8 @@ int spi_block_erase_20(struct flashchip *flash, unsigned int addr, unsigned int
result = spi_send_multicommand(spicommands);
if (result) {
- printf_debug("%s failed during command execution\n", __func__);
+ fprintf(stderr, "%s failed during command execution\n",
+ __func__);
return result;
}
/* Wait until the Write-In-Progress bit is cleared.
@@ -730,7 +733,8 @@ int spi_block_erase_20(struct flashchip *flash, unsigned int addr, unsigned int
int spi_block_erase_60(struct flashchip *flash, unsigned int addr, unsigned int blocklen)
{
if ((addr != 0) || (blocklen != flash->total_size * 1024)) {
- fprintf(stderr, "%s called with incorrect arguments\n", __func__);
+ fprintf(stderr, "%s called with incorrect arguments\n",
+ __func__);
return -1;
}
return spi_chip_erase_60(flash);
@@ -739,7 +743,8 @@ int spi_block_erase_60(struct flashchip *flash, unsigned int addr, unsigned int
int spi_block_erase_c7(struct flashchip *flash, unsigned int addr, unsigned int blocklen)
{
if ((addr != 0) || (blocklen != flash->total_size * 1024)) {
- fprintf(stderr, "%s called with incorrect arguments\n", __func__);
+ fprintf(stderr, "%s called with incorrect arguments\n",
+ __func__);
return -1;
}
return spi_chip_erase_c7(flash);
@@ -754,7 +759,7 @@ int spi_write_status_enable(void)
result = spi_send_command(sizeof(cmd), JEDEC_EWSR_INSIZE, cmd, NULL);
if (result)
- printf_debug("%s failed\n", __func__);
+ fprintf(stderr, "%s failed\n", __func__);
return result;
}
@@ -786,7 +791,8 @@ int spi_write_status_register(int status)
result = spi_send_multicommand(spicommands);
if (result) {
- printf_debug("%s failed during command execution\n", __func__);
+ fprintf(stderr, "%s failed during command execution\n",
+ __func__);
}
return result;
}
@@ -814,7 +820,8 @@ int spi_byte_program(int addr, uint8_t byte)
result = spi_send_multicommand(spicommands);
if (result) {
- printf_debug("%s failed during command execution\n", __func__);
+ fprintf(stderr, "%s failed during command execution\n",
+ __func__);
}
return result;
}
@@ -848,11 +855,11 @@ int spi_nbyte_program(int address, uint8_t *bytes, int len)
}};
if (!len) {
- printf_debug ("%s called for zero-length write\n", __func__);
+ fprintf(stderr, "%s called for zero-length write\n", __func__);
return 1;
}
if (len > 256) {
- printf_debug ("%s called for too long a write\n", __func__);
+ fprintf(stderr, "%s called for too long a write\n", __func__);
return 1;
}
@@ -860,7 +867,8 @@ int spi_nbyte_program(int address, uint8_t *bytes, int len)
result = spi_send_multicommand(spicommands);
if (result) {
- printf_debug("%s failed during command execution\n", __func__);
+ fprintf(stderr, "%s failed during command execution\n",
+ __func__);
}
return result;
}
@@ -876,7 +884,7 @@ int spi_disable_blockprotect(void)
printf_debug("Some block protection in effect, disabling\n");
result = spi_write_status_register(status & ~0x3c);
if (result) {
- printf_debug("spi_write_status_register failed\n");
+ fprintf(stderr, "spi_write_status_register failed\n");
return result;
}
}
diff --git a/w29ee011.c b/w29ee011.c
index 77724be..a26cd80 100644
--- a/w29ee011.c
+++ b/w29ee011.c
@@ -28,11 +28,10 @@ int probe_w29ee011(struct flashchip *flash)
extern char *chip_to_probe;
if (!chip_to_probe || strcmp(chip_to_probe, "W29EE011")) {
- printf_debug("\n===\n");
- printf_debug(" Probing disabled for Winbond W29EE011 because the probing sequence puts the\n");
- printf_debug(" AMIC A49LF040A in a funky state.\n");
- printf_debug(" Use 'flashrom -c W29EE011' if you have a board with this chip.");
- printf_debug("\n===\n");
+ printf_debug("Probing disabled for Winbond W29EE011 because "
+ "the probing sequence puts the AMIC A49LF040A in "
+ "a funky state. Use 'flashrom -c W29EE011' if you "
+ "have a board with this chip.\n");
return 0;
}
OpenPOWER on IntegriCloud