diff options
author | hailfinger <hailfinger@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1> | 2009-11-16 15:03:35 +0000 |
---|---|---|
committer | hailfinger <hailfinger@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1> | 2009-11-16 15:03:35 +0000 |
commit | 917f906362457691c72d0c31f12b924c9dfc3a1e (patch) | |
tree | 426975a8a4a0afa512f7011e37aa01c9544248f4 /spi.c | |
parent | 204664969f7e9c4d2cd64d455e5386ca974da871 (diff) | |
download | flashrom-917f906362457691c72d0c31f12b924c9dfc3a1e.tar.gz |
If a SPI command taking an address does fail, we want to know the
address for easier debugging.
Vincent wrote: This patch provided help to debug the partial write on
ICH in descriptor mode.
Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Vincent S. Cojot <openlook@cojot.name>
git-svn-id: https://code.coreboot.org/svn/flashrom/trunk@764 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'spi.c')
-rw-r--r-- | spi.c | 27 |
1 files changed, 14 insertions, 13 deletions
@@ -615,8 +615,8 @@ int spi_block_erase_52(struct flashchip *flash, unsigned int addr, unsigned int result = spi_send_multicommand(cmds); if (result) { - fprintf(stderr, "%s failed during command execution\n", - __func__); + fprintf(stderr, "%s failed during command execution at address 0x%x\n", + __func__, addr); return result; } /* Wait until the Write-In-Progress bit is cleared. @@ -659,7 +659,8 @@ int spi_block_erase_d8(struct flashchip *flash, unsigned int addr, unsigned int result = spi_send_multicommand(cmds); if (result) { - fprintf(stderr, "%s failed during command execution\n", __func__); + fprintf(stderr, "%s failed during command execution at address 0x%x\n", + __func__, addr); return result; } /* Wait until the Write-In-Progress bit is cleared. @@ -721,8 +722,8 @@ int spi_block_erase_20(struct flashchip *flash, unsigned int addr, unsigned int result = spi_send_multicommand(cmds); if (result) { - fprintf(stderr, "%s failed during command execution\n", - __func__); + fprintf(stderr, "%s failed during command execution at address 0x%x\n", + __func__, addr); return result; } /* Wait until the Write-In-Progress bit is cleared. @@ -827,21 +828,21 @@ int spi_byte_program(int addr, uint8_t byte) result = spi_send_multicommand(cmds); if (result) { - fprintf(stderr, "%s failed during command execution\n", - __func__); + fprintf(stderr, "%s failed during command execution at address 0x%x\n", + __func__, addr); } return result; } -int spi_nbyte_program(int address, uint8_t *bytes, int len) +int spi_nbyte_program(int addr, uint8_t *bytes, int len) { int result; /* FIXME: Switch to malloc based on len unless that kills speed. */ unsigned char cmd[JEDEC_BYTE_PROGRAM_OUTSIZE - 1 + 256] = { JEDEC_BYTE_PROGRAM, - (address >> 16) & 0xff, - (address >> 8) & 0xff, - (address >> 0) & 0xff, + (addr >> 16) & 0xff, + (addr >> 8) & 0xff, + (addr >> 0) & 0xff, }; struct spi_command cmds[] = { { @@ -874,8 +875,8 @@ int spi_nbyte_program(int address, uint8_t *bytes, int len) result = spi_send_multicommand(cmds); if (result) { - fprintf(stderr, "%s failed during command execution\n", - __func__); + fprintf(stderr, "%s failed during command execution at address 0x%x\n", + __func__, addr); } return result; } |