summaryrefslogtreecommitdiffstats
path: root/m29f400bt.c
diff options
context:
space:
mode:
authorSean Nelson <audiohacked@gmail.com>2010-03-24 23:14:32 +0000
committerSean Nelson <audiohacked@gmail.com>2010-03-24 23:14:32 +0000
commit753de15d9e72773db99bf099f0c93914133ab832 (patch)
tree50b12e054fcff9b0cabbf916d2d049d00f2bf8e5 /m29f400bt.c
parent550546f92ffe1afa730a7a18729e2b1169654a6d (diff)
downloadflashrom-753de15d9e72773db99bf099f0c93914133ab832.zip
flashrom-753de15d9e72773db99bf099f0c93914133ab832.tar.gz
Convert chips' message printing to msg_c* Fixed suggestions by Carl-Daniel
Corresponding to flashrom svn r982. Signed-off-by: Sean Nelson <audiohacked@gmail.com> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Diffstat (limited to 'm29f400bt.c')
-rw-r--r--m29f400bt.c59
1 files changed, 29 insertions, 30 deletions
diff --git a/m29f400bt.c b/m29f400bt.c
index c394074..c8ed5d8 100644
--- a/m29f400bt.c
+++ b/m29f400bt.c
@@ -42,8 +42,7 @@ void write_page_m29f400bt(chipaddr bios, uint8_t *src,
//chip_writeb(0xF0, bios);
//programmer_delay(5);
toggle_ready_jedec(dst);
- printf
- ("Value in the flash at address 0x%lx = %#x, want %#x\n",
+ msg_cerr("Value in the flash at address 0x%lx = %#x, want %#x\n",
(dst - bios), chip_readb(dst), *src);
dst++;
src++;
@@ -73,7 +72,7 @@ int probe_m29f400bt(struct flashchip *flash)
programmer_delay(10);
- printf_debug("%s: id1 0x%02x, id2 0x%02x\n", __func__, id1, id2);
+ msg_cdbg("%s: id1 0x%02x, id2 0x%02x\n", __func__, id1, id2);
if (id1 == flash->manufacture_id && id2 == flash->model_id)
return 1;
@@ -97,7 +96,7 @@ int erase_m29f400bt(struct flashchip *flash)
toggle_ready_jedec(bios);
if (check_erased_range(flash, 0, flash->total_size * 1024)) {
- fprintf(stderr, "ERASE FAILED!\n");
+ msg_cerr("ERASE FAILED!\n");
return -1;
}
return 0;
@@ -121,7 +120,7 @@ int block_erase_m29f400bt(struct flashchip *flash, unsigned int start, unsigned
toggle_ready_jedec(bios);
if (check_erased_range(flash, start, len)) {
- fprintf(stderr, "ERASE FAILED!\n");
+ msg_cerr("ERASE FAILED!\n");
return -1;
}
return 0;
@@ -130,7 +129,7 @@ int block_erase_m29f400bt(struct flashchip *flash, unsigned int start, unsigned
int block_erase_chip_m29f400bt(struct flashchip *flash, unsigned int address, unsigned int blocklen)
{
if ((address != 0) || (blocklen != flash->total_size * 1024)) {
- fprintf(stderr, "%s called with incorrect arguments\n",
+ msg_cerr("%s called with incorrect arguments\n",
__func__);
return -1;
}
@@ -145,7 +144,7 @@ int write_m29f400bt(struct flashchip *flash, uint8_t *buf)
chipaddr bios = flash->virtual_memory;
//erase_m29f400bt (flash);
- printf("Programming page:\n ");
+ msg_cinfo("Programming page:\n ");
/*********************************
*Pages for M29F400BT:
* 16 0x7c000 0x7ffff TOP
@@ -161,47 +160,47 @@ int write_m29f400bt(struct flashchip *flash, uint8_t *buf)
* 64 0x10000 0x1ffff
* 64 0x00000 0x0ffff BOTTOM
*********************************/
- printf("total_size/page_size = %d\n", total_size / page_size);
+ msg_cinfo("total_size/page_size = %d\n", total_size / page_size);
for (i = 0; i < (total_size / page_size) - 1; i++) {
- printf("%04d at address: 0x%08x\n", i, i * page_size);
+ msg_cinfo("%04d at address: 0x%08x\n", i, i * page_size);
if (block_erase_m29f400bt(flash, i * page_size, page_size)) {
- fprintf(stderr, "ERASE FAILED!\n");
+ msg_cerr("ERASE FAILED!\n");
return -1;
}
write_page_m29f400bt(bios, buf + i * page_size,
bios + i * page_size, page_size);
- printf("\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b");
+ msg_cinfo("\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b");
}
- printf("%04d at address: 0x%08x\n", 7, 0x70000);
+ msg_cinfo("%04d at address: 0x%08x\n", 7, 0x70000);
if (block_erase_m29f400bt(flash, 0x70000, 32 * 1024)) {
- fprintf(stderr, "ERASE FAILED!\n");
+ msg_cerr("ERASE FAILED!\n");
return -1;
}
write_page_m29f400bt(bios, buf + 0x70000, bios + 0x70000, 32 * 1024);
- printf("%04d at address: 0x%08x\n", 8, 0x78000);
+ msg_cinfo("%04d at address: 0x%08x\n", 8, 0x78000);
if (block_erase_m29f400bt(flash, 0x78000, 8 * 1024)) {
- fprintf(stderr, "ERASE FAILED!\n");
+ msg_cerr("ERASE FAILED!\n");
return -1;
}
write_page_m29f400bt(bios, buf + 0x78000, bios + 0x78000, 8 * 1024);
- printf("%04d at address: 0x%08x\n", 9, 0x7a000);
+ msg_cinfo("%04d at address: 0x%08x\n", 9, 0x7a000);
if (block_erase_m29f400bt(flash, 0x7a000, 8 * 1024)) {
- fprintf(stderr, "ERASE FAILED!\n");
+ msg_cerr("ERASE FAILED!\n");
return -1;
}
write_page_m29f400bt(bios, buf + 0x7a000, bios + 0x7a000, 8 * 1024);
- printf("%04d at address: 0x%08x\n", 10, 0x7c000);
+ msg_cinfo("%04d at address: 0x%08x\n", 10, 0x7c000);
if (block_erase_m29f400bt(flash, 0x7c000, 16 * 1024)) {
- fprintf(stderr, "ERASE FAILED!\n");
+ msg_cerr("ERASE FAILED!\n");
return -1;
}
write_page_m29f400bt(bios, buf + 0x7c000, bios + 0x7c000, 16 * 1024);
- printf("\n");
+ msg_cinfo("\n");
return 0;
}
@@ -210,7 +209,7 @@ int write_coreboot_m29f400bt(struct flashchip *flash, uint8_t *buf)
{
chipaddr bios = flash->virtual_memory;
- printf("Programming page:\n ");
+ msg_cinfo("Programming page:\n ");
/*********************************
*Pages for M29F400BT:
* 16 0x7c000 0x7ffff TOP
@@ -226,35 +225,35 @@ int write_coreboot_m29f400bt(struct flashchip *flash, uint8_t *buf)
* 64 0x10000 0x1ffff
* 64 0x00000 0x0ffff BOTTOM
*********************************/
- printf("%04d at address: 0x%08x\n", 7, 0x00000);
+ msg_cinfo("%04d at address: 0x%08x\n", 7, 0x00000);
if (block_erase_m29f400bt(flash, 0x00000, 64 * 1024)) {
- fprintf(stderr, "ERASE FAILED!\n");
+ msg_cerr("ERASE FAILED!\n");
return -1;
}
write_page_m29f400bt(bios, buf + 0x00000, bios + 0x00000, 64 * 1024);
- printf("%04d at address: 0x%08x\n", 7, 0x10000);
+ msg_cinfo("%04d at address: 0x%08x\n", 7, 0x10000);
if (block_erase_m29f400bt(flash, 0x10000, 64 * 1024)) {
- fprintf(stderr, "ERASE FAILED!\n");
+ msg_cerr("ERASE FAILED!\n");
return -1;
}
write_page_m29f400bt(bios, buf + 0x10000, bios + 0x10000, 64 * 1024);
- printf("%04d at address: 0x%08x\n", 7, 0x20000);
+ msg_cinfo("%04d at address: 0x%08x\n", 7, 0x20000);
if (block_erase_m29f400bt(flash, 0x20000, 64 * 1024)) {
- fprintf(stderr, "ERASE FAILED!\n");
+ msg_cerr("ERASE FAILED!\n");
return -1;
}
write_page_m29f400bt(bios, buf + 0x20000, bios + 0x20000, 64 * 1024);
- printf("%04d at address: 0x%08x\n", 7, 0x30000);
+ msg_cinfo("%04d at address: 0x%08x\n", 7, 0x30000);
if (block_erase_m29f400bt(flash, 0x30000, 64 * 1024)) {
- fprintf(stderr, "ERASE FAILED!\n");
+ msg_cerr("ERASE FAILED!\n");
return -1;
}
write_page_m29f400bt(bios, buf + 0x30000, bios + 0x30000, 64 * 1024);
- printf("\n");
+ msg_cinfo("\n");
return 0;
}
OpenPOWER on IntegriCloud