From f8337dd3986692bd1788ab254879d7f8424367e1 Mon Sep 17 00:00:00 2001 From: Stefan Reinauer Date: Thu, 3 Aug 2006 10:49:09 +0000 Subject: Some documentation updates by Uwe and some smaller ones by me Corresponding to flashrom svn r59 and coreboot v2 svn r2358. --- flash_rom.c | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) (limited to 'flash_rom.c') diff --git a/flash_rom.c b/flash_rom.c index 4245a8f9..28ce567f 100644 --- a/flash_rom.c +++ b/flash_rom.c @@ -51,7 +51,7 @@ struct flashchip *probe_flash(struct flashchip *flash) unsigned long size; if ((fd_mem = open("/dev/mem", O_RDWR)) < 0) { - perror("Can not open /dev/mem"); + perror("Error: Can not open /dev/mem. You need to be root."); exit(1); } @@ -73,7 +73,7 @@ struct flashchip *probe_flash(struct flashchip *flash) bios = mmap(0, size, PROT_WRITE | PROT_READ, MAP_SHARED, fd_mem, (off_t) (0xffffffff - size + 1)); if (bios == MAP_FAILED) { - perror("Error MMAP /dev/mem"); + perror("Error: Can't mmap /dev/mem."); exit(1); } flash->virt_addr = bios; @@ -90,7 +90,7 @@ struct flashchip *probe_flash(struct flashchip *flash) bios = mmap(0, size, PROT_WRITE | PROT_READ, MAP_SHARED, fd_mem, (off_t) (0x9400000)); if (bios == MAP_FAILED) { - perror("Error MMAP /dev/mem"); + perror("Error: Can't mmap /dev/mem."); exit(1); } flash->virt_addr = bios; @@ -145,22 +145,24 @@ int verify_flash(struct flashchip *flash, uint8_t *buf) void usage(const char *name) { - printf("usage: %s [-rwvE] [-V] [-c chipname] [-s exclude_start] [-e exclude_end] [file]\n", name); - printf(" -r | --read: read flash and save into file\n" - " -w | --write: write file into flash (default when file is specified)\n" - " -v | --verify: verify flash against file\n" - " -E | --erase: Erase flash device\n" - " -V | --verbose: more verbose output\n\n" - " -c | --chip : probe only for specified flash chip\n" - " -s | --estart : exclude start position\n" - " -e | --eend : exclude end postion\n" + printf("usage: %s [-rwvEVfh] [-c chipname] [-s exclude_start]\n", name); + printf(" [-e exclude_end] [-m vendor:part] [-l file.layout] [-i imagename] [file]\n"); + printf(" -r | --read: read flash and save into file\n" + " -w | --write: write file into flash (default when\n" + " file is specified)\n" + " -v | --verify: verify flash against file\n" + " -E | --erase: erase flash device\n" + " -V | --verbose: more verbose output\n" + " -c | --chip : probe only for specified flash chip\n" + " -s | --estart : exclude start position\n" + " -e | --eend : exclude end postion\n" " -m | --mainboard : override mainboard settings\n" - " -f | --force: force write without checking image\n" - " -l | --layout : read rom layout from file\n" - " -i | --image : only flash image name from flash layout\n" + " -f | --force: force write without checking image\n" + " -l | --layout : read rom layout from file\n" + " -i | --image : only flash image name from flash layout\n" "\n" " If no file is specified, then all that happens\n" - " is that flash info is dumped\n\n"); + " is that flash info is dumped.\n\n"); exit(1); } -- cgit v1.2.3