aboutsummaryrefslogtreecommitdiff
path: root/util/flashrom/flash_rom.c
diff options
context:
space:
mode:
authorStefan Reinauer <stepan@openbios.org>2006-08-03 10:49:09 +0000
committerStefan Reinauer <stepan@openbios.org>2006-08-03 10:49:09 +0000
commit9327d22641992459a8e57f4d5125fdce72f7f263 (patch)
tree4e00a19f383e3721665e5171df8cbcb58b78f698 /util/flashrom/flash_rom.c
parent085cb4b4ca9a51e42f0665850e2cc9879bfbfa76 (diff)
some documentation updates by Uwe and some smaller ones by me.
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@2358 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'util/flashrom/flash_rom.c')
-rw-r--r--util/flashrom/flash_rom.c34
1 files changed, 18 insertions, 16 deletions
diff --git a/util/flashrom/flash_rom.c b/util/flashrom/flash_rom.c
index 4245a8f92b..28ce567ff4 100644
--- a/util/flashrom/flash_rom.c
+++ b/util/flashrom/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 <chipname>: probe only for specified flash chip\n"
- " -s | --estart <addr>: exclude start position\n"
- " -e | --eend <addr>: 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 <chipname>: probe only for specified flash chip\n"
+ " -s | --estart <addr>: exclude start position\n"
+ " -e | --eend <addr>: exclude end postion\n"
" -m | --mainboard <vendor:part>: override mainboard settings\n"
- " -f | --force: force write without checking image\n"
- " -l | --layout <file.layout>: read rom layout from file\n"
- " -i | --image <name>: only flash image name from flash layout\n"
+ " -f | --force: force write without checking image\n"
+ " -l | --layout <file.layout>: read rom layout from file\n"
+ " -i | --image <name>: 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);
}